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

CSE: generate code & storage for addresses in contract field #597

Closed
palinatolmach opened this issue Jun 3, 2024 · 0 comments · Fixed by #600
Closed

CSE: generate code & storage for addresses in contract field #597

palinatolmach opened this issue Jun 3, 2024 · 0 comments · Fixed by #600
Assignees
Labels
cse engagement enhancement New feature or request

Comments

@palinatolmach
Copy link
Collaborator

palinatolmach commented Jun 3, 2024

As suggested by @PetarMax, the next step for CSE requires ensuring that code and storage are in place for addresses/accounts corresponding to contract fields.

It is to do with calls to addresses that don’t exist in the accounts. If we know that a storage slot of contract X we’re analysing holds an address of another account addrY coming from another contract Y, then we also know that account with address addrY should be in the storage of X and we also know the structure of the storage of Y.

For me, this should amount to:

  • creating a fresh symbolic address addrY and putting it into the appropriate storage slot of X;
  • calling the function that understands storage layout recursively on contract Y and putting whatever it returns in the account with address addrY.

It would be better to test this feature with non-test functions. There are some examples already in the codebase, specifically in this file.

An additional challenge comes from the fact that a field can be an interface but not a contract, in which case we can't run CSE since the we don't know what the addres we're calling has been instantiated with, so perhaps we can just leave it as a known limitation.

@palinatolmach palinatolmach changed the title CSE: generate code & storage for contract field CSE: generate code & storage for addresses in contract field Jun 3, 2024
@palinatolmach palinatolmach self-assigned this Jun 3, 2024
@palinatolmach palinatolmach added enhancement New feature or request engagement cse labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cse engagement enhancement New feature or request
Projects
None yet
1 participant