Documentation Index Fetch the complete documentation index at: https://base-a060aa97-bo-update-contract-addresses.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Returns an estimate of how much gas is required to execute a transaction. The estimate may be larger than the gas actually used at execution time.
Flashblocks: Query https://mainnet.base.org with "pending" to estimate gas against the current pre-confirmed state, useful when a transaction depends on a prior pre-confirmed one.
Parameters
The transaction object to estimate gas for. Address the transaction is sent from. Optional.
Address the transaction is sent to. Optional for contract deployments.
Gas limit. Optional; a high default is used if omitted.
Gas price in wei for legacy transactions. Optional.
EIP-1559 maximum total fee per gas. Optional.
EIP-1559 maximum priority fee per gas. Optional.
Value to transfer in wei. Optional.
ABI-encoded call data. Optional.
Block to estimate against. Optional; defaults to "latest". Use "pending" to estimate against pre-confirmed state.
Returns
The estimated gas amount as a hexadecimal integer.
Error Codes
Code Message Description -32000execution reverted The transaction would revert. The error data field may contain a revert reason.
Example
Standard
Flashblocks (pending state)
Response
curl https://mainnet.base.org \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [{
"from": "0xd3CdA913deB6f4967b2Ef66ae97DE114a83bcc01",
"to": "0x4200000000000000000000000000000000000006",
"value": "0x2c68af0bb14000"
}],
"id": 1
}'