You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: services/reference/linea/json-rpc-methods/linea_estimategas.mdx
+39-6Lines changed: 39 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ We recommend using `linea_estimateGas` for more accurate results.
30
30
31
31
## Parameters
32
32
33
-
-`TRANSACTION CALL OBJECT`_\[required]_
33
+
-`call`:_\[required]_ Transaction call object:
34
34
-`from`: _\[optional]_ 20 bytes - The address the transaction is sent from.
35
35
-`to`: _\[optional]_ 20 bytes - The address the transaction is directed to.
36
36
-`gas`: _\[optional]_ Hexadecimal value of the gas provided for the transaction execution. `linea_estimateGas` consumes
@@ -41,11 +41,12 @@ We recommend using `linea_estimateGas` for more accurate results.
41
41
-`value`: _\[optional]_ Hexadecimal value of the value sent with this transaction.
42
42
-`data`: _\[optional]_ Hash of the method signature and encoded parameters. See the
43
43
[Ethereum contract ABI specification](https://docs.soliditylang.org/en/latest/abi-spec.html).
44
-
-`blockParameter`: (string) [_optional_] A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending` or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
45
-
:::warning
46
-
`safe` isn't supported. Use `finalized` instead.
47
-
Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block).
48
-
:::
44
+
-`stateOverride`: _\[optional]_ Object that contains the address-to-state mapping to [override state values](#override-state-values)
45
+
Each entry specifies a state that will be temporarily overridden before executing the call:
46
+
-`balance`: _\[optional]_ Hexadecimal of the temporary account balance for the call execution.
47
+
-`nonce`: _\[optional]_ Hexadecimal of the temporary nonce value for the call execution.
48
+
-`code` : _\[optional]_ Bytecode to inject into the account.
49
+
-`stateDiff`: `key:value` pairs to override individual slots in the account storage.
49
50
50
51
## Returns
51
52
@@ -95,3 +96,35 @@ Replace `<YOUR-API-KEY>` with an API key from your [MetaMask Developer dashboard
95
96
```
96
97
</TabItem>
97
98
</Tabs>
99
+
100
+
## Override state values
101
+
102
+
You can to override an account with temporary state values before
103
+
making the call. This allows you to make temporary state changes without affecting the actual
104
+
blockchain state.
105
+
106
+
For example, here we'll override the balance of account `0xfe3b557e8fb62b89f4916b721be55ceb828dbd73`
107
+
to ensure it has sufficient funds to estimate transferring ETH to the specified account:
0 commit comments