Skip to content

Commit

Permalink
Clarified behaviour of eth_call strict parameter
Browse files Browse the repository at this point in the history
Signed-off-by: madelinemurray <madeline.murray@consensys.net>
  • Loading branch information
MadelineMurray committed Nov 22, 2023
1 parent c7c2603 commit 4b80d43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion docs/public-networks/reference/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,12 @@ By default, the `eth_call` error response includes the [revert reason](../../../
:::note
By default, `eth_call` does not fail if the sender account has an insufficient balance. This is done by setting the balance of the account to a large amount of ether. To enforce balance rules, set the [`strict` parameter](objects.md#transaction-call-object) in the transaction call object to `true`.
The [`strict` parameter](objects.md#transaction-call-object) determines if the sender account balance is checked:
* If `strict:true`, the balance is checked and `eth_call` fails if the sender account has an insufficient balance to send the transaction with the specified gas parameters.
* If `strict:false`, the balance is not checked and `eth_call` can succeed even if the sender account has an insufficient balance.
* If `strict` is not specified, the balance is checked against the gas parameters if supplied.
If you do not want the sender account balance checked, send zero gas or specify `strict:false`.
:::
Expand Down
2 changes: 1 addition & 1 deletion docs/public-networks/reference/api/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ All transaction call object parameters are optional.
| `value` | Quantity, Integer | Value transferred, in Wei. |
| `data` or `input` | Data | Hash of the method signature and encoded parameters. For details, see [Ethereum Contract ABI](https://solidity.readthedocs.io/en/develop/abi-spec.html). |
| `accessList` | Array | List of addresses and storage keys that the transaction plans to access. Used only in non-[`FRONTIER`](../../concepts/transactions/types.md#frontier-transactions) transactions. |
| `strict` | Tag | If `true`, checks that the `from` account’s ether balance is sufficient to cover the transaction and gas fee. If `false`, the `gasPrice` and `baseFee` are set to zero, in order to simulate a transaction without enforcing a balance check. The default is `false`. |
| `strict` | Tag | Determines if the sender account balance is checked. If `true`, the balance is checked. If `false`, the balance is not checked. If not specified, the balance is checked against the gas parameters if supplied.|

## Transaction receipt object

Expand Down

0 comments on commit 4b80d43

Please sign in to comment.