Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support state overrides in eth_call #512

Open
gzliudan opened this issue Apr 1, 2024 · 2 comments
Open

Support state overrides in eth_call #512

gzliudan opened this issue Apr 1, 2024 · 2 comments

Comments

@gzliudan
Copy link
Collaborator

gzliudan commented Apr 1, 2024

The state override set option allows you to change the state of a contract before executing the call. This means you can modify the values of variables stored in the contract, such as balances and approvals for that call without actually modifying the contract on the blockchain.

In more technical terms, the state override set is an optional parameter that allows executing the call against a modified chain state. It is an address-to-state mapping, where each entry specifies some state to be overridden prior to executing the call. Each address maps to an object containing:

FIELD TYPE BYTES 2 DESCRIPTION
balance Quantity <32 Fake balance to set for the account before executing the call.
nonce Quantity <8 Fake nonce to set for the account before executing the call.
code Binary any Fake EVM bytecode to inject into the account before executing the call.
state Object any Fake key-value mapping to override all slots in the account storage before executing the call.
stateDiff Object any Fake key-value mapping to override individual slots in the account storage before executing the call.

The state override set is the third parameter in eth_call. We only support the first and the second parameters now. It is a new feature to the xdc blockchain.

Reference:

@liam-lai
Copy link
Collaborator

liam-lai commented Apr 2, 2024

Report by EIP-4337 patch

@wgr523
Copy link
Collaborator

wgr523 commented May 1, 2024

Code is in PR #529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants