Repository navigation
Add SolSlot and SolMapping for Solidity storage layouts - #1605
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 522c7a7df9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
522c7a7 to
41e1763
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41e17633ee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
41e1763 to
43852ac
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43852ac763
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`std::evm::SolSlot` works with Solidity's storage layout at a runtime slot: - `read`/`write` access a packed state variable at a byte offset without touching its neighbours, via the new `SolPacked` trait for `bool`, `Address`, all integer widths including the `sol::` wrappers, and `FixedBytes<N>`. A field that would extend past the slot, or a non-canonical `Address` or `FixedBytes<N>`, reverts instead of being truncated. - `read_bytes`/`read_string`/`write_bytes`/`write_string` use Solidity's `bytes`/`string` layout; a write clears words left behind by a longer previous value. A head whose length contradicts its short/long marker panics with 0x22, like Solidity. `std::evm::SolMapping` derives `mapping` slots like Solidity for a runtime root, including nested mappings. The custom-width `sol::` integers implement `StorageKey`, sign-extended like `abi.encode`.
43852ac to
2904b5e
Compare
sbillig
left a comment
There was a problem hiding this comment.
Reviewed the current head; no blocking findings.
std::evm::SolSlotworks with Solidity's storage layout at a runtime slot:read/writeaccess a packed state variable at a byte offset without touching its neighbours, via the newSolPackedtrait forbool,Address, all integer widths including thesol::wrappers, andFixedBytes<N>.read_bytes/read_string/write_bytes/write_stringuse Solidity'sbytes/stringlayout; a write clears words left behind by a longer previous value.std::evm::SolMappingderivesmappingslots like Solidity for a runtime root, including nested mappings. The custom-widthsol::integers implementStorageKey, sign-extended likeabi.encode.