Estimates the gas values for a UserOperation
.
NOTE
This endpoint does not require a valid signature field in
userOperation
. It just requires a dummy signature for gas estimation. You can use the dummy signature mentioned below when the sender account isLightAccount
orSimpleAccount
:
0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c
Network Support
Chain | Mainnet | Testnet |
---|---|---|
Ethereum | ||
Polygon | ||
Arbitrum | ||
Optimism | ||
Base | ||
Frax | ||
Zora |
Choosing an Entry Point Version
eth_estimateUserOperationGas
supports versions 0.6.0 and 0.7.0 of ERC-4337. These two versions define different formats for user operations, and their entry point contracts are deployed at different addresses. Thus, when calling eth_estimateUserOperationGas
, you must choose whether you want to use the 0.6.0 or 0.7.0 version of this endpoint and ensure that you are using the correct user operation format and entry point address.
Which version of the endpoint you want is determined by the smart contract account for which you are trying to send a user operation. A given smart contract account will typically be written to be compatible with either 0.6.0 or 0.7.0 and you should use that version in your request. If you're not sure which version is compatible with a smart contract account, you can look at its source code and check the first parameter to validateUserOp
. If it has type UserOperation
, then the account uses 0.6.0, while if it has type PackedUserOperation
then the account uses 0.7.0.
For more information about the differences in versions, see the specifications for ERC-4337 v0.6.0 and ERC-4337 v0.7.0