diff --git a/contracts/smart-account/utils/GasEstimator.sol b/contracts/smart-account/utils/GasEstimator.sol index 1f787c84..9307728d 100644 --- a/contracts/smart-account/utils/GasEstimator.sol +++ b/contracts/smart-account/utils/GasEstimator.sol @@ -3,14 +3,21 @@ pragma solidity 0.8.17; // Generic contract for estimating gas on any target and data contract GasEstimator { + /** + * @notice Estimates the gas consumption of a call to a given address with specific data. + * @dev This function does not revert if the call fails but instead returns the success status. + * @param _to The address to call. + * @param _data The calldata to send with the call. + * @return success A boolean indicating if the call was successful. + * @return result The bytes data returned from the called function. + * @return gas The amount of gas consumed by the call. + */ function estimate( address _to, bytes calldata _data ) external returns (bool success, bytes memory result, uint256 gas) { - // solhint-disable uint256 initialGas = gasleft(); (success, result) = _to.call(_data); gas = initialGas - gasleft(); - // solhint-enable } } diff --git a/package.json b/package.json index 93eccba1..359d986e 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "@typescript-eslint/eslint-plugin": "^5.30.5", "@typescript-eslint/parser": "^5.30.5", "chai": "^4.3.7", - "dotenv": "^16.0.1", "merkletreejs": "^0.3.9", "ts-node": "^10.9.1", "typechain": "^8.1.1",