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

Correct encoding of the Solidity storage layout in the Expr translation #189

Open
zoep opened this issue Jan 15, 2025 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@zoep
Copy link
Collaborator

zoep commented Jan 15, 2025

The translation of Act to Expr is not faithful to the Solidity storage layout for values shorted than a word. The current translation naively puts every storage value in 256bit word slots. As a result, equivalence for the following fails:

constructor of A
interface constructor()

iff

  CALLVALUE == 0

creates

  uint128 x := 11
  uint128 y := 42

contract A {
    uint128 x;
    uint128 y;
    
    constructor() {
        x = 11;
        y = 42;
    }
}

Correct encoding of the layout will also fix #175.

@zoep zoep added the bug Something isn't working label Jan 15, 2025
@zoep zoep self-assigned this Jan 15, 2025
@zoep
Copy link
Collaborator Author

zoep commented Jan 15, 2025

Note that this will make the order of declaring storage variables in Act relevant. An alternative would be for the user to provide the storage layout in the specification or read the layout from the compiler generated json, so that we don't make compiler-specific assumptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant