Skip to content

Commit 9bc0d4e

Browse files
Merge branch 'main' into 1782-snaps-ui
2 parents 602bf6e + 904cca2 commit 9bc0d4e

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed

services/reference/blast/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Celo quickstart guide.
2+
description: Blast quickstart guide.
33
sidebar_position: 2
44
---
55

services/reference/linea/json-rpc-methods/linea_estimategas.mdx

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ We recommend using `linea_estimateGas` for more accurate results.
3030

3131
## Parameters
3232

33-
- `TRANSACTION CALL OBJECT` _\[required]_
33+
- `call`: _\[required]_ Transaction call object:
3434
- `from`: _\[optional]_ 20 bytes - The address the transaction is sent from.
3535
- `to`: _\[optional]_ 20 bytes - The address the transaction is directed to.
3636
- `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.
4141
- `value`: _\[optional]_ Hexadecimal value of the value sent with this transaction.
4242
- `data`: _\[optional]_ Hash of the method signature and encoded parameters. See the
4343
[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 value of the temporary account balance for the call execution.
47+
- `nonce`: _\[optional]_ Hexadecimal value of the temporary nonce 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.
4950

5051
## Returns
5152

@@ -95,3 +96,42 @@ Replace `<YOUR-API-KEY>` with an API key from your [MetaMask Developer dashboard
9596
```
9697
</TabItem>
9798
</Tabs>
99+
100+
## Override state values
101+
102+
You can override an account with temporary state values before making the call. This allows you to
103+
make temporary state changes without affecting the actual blockchain state.
104+
105+
The following example estimates the cost for transferring an ERC-20 token for an account which does not
106+
have the required assets onchain.
107+
108+
The example sets a custom ETH balance for the sender (to cover gas costs) and modifies the account's
109+
balance within the ERC-20 contract's storage for the duration of the call.
110+
111+
```json
112+
curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
113+
-X POST \
114+
-H "Content-Type: application/json" \
115+
-d '{
116+
"jsonrpc":"2.0",
117+
"method":"linea_estimateGas",
118+
"params":[
119+
{
120+
"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
121+
"to":"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",
122+
"data":"0xa9059cbb000000000000000000000000627306090abaB3A6e1400e9345bC60c78a8BEf570000000000000000000000000000000000000000000000001bc16d674ec80000"
123+
},
124+
{
125+
"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73": {
126+
"balance": "0x16345785d8a0000"
127+
},
128+
"0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f": {
129+
"stateDiff": {
130+
"0x2d206e5210c119b1cbed144f517f1f1dfd586eed26793a233e6afc261f4cf97f":"0x0000000000000000000000000000000000000000000000001bc16d674ec80000"
131+
}
132+
}
133+
}
134+
],
135+
"id":53
136+
}'
137+
```

0 commit comments

Comments
 (0)