-
Notifications
You must be signed in to change notification settings - Fork 38
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
fix: accountstorage coverage, natspec, storage root derivation #246
Conversation
Summary by OctaneNew ContractsNo new contracts were added in this PR. Updated Contracts
🔗 Commit Hash: b9a7366 |
Contract sizes: | Contract | Size (B) | Margin (B) |
|-------------------------------|----------|------------|
| AccountFactory | 4,814 | 19,762 |
| AllowlistModule | 9,230 | 15,346 |
| ECDSAValidationModule | 3,646 | 20,930 |
| ModularAccount | 25,655 | -1,079 |
| NativeTokenLimitModule | 4,714 | 19,862 |
| PaymasterGuardModule | 1,797 | 22,779 |
| SemiModularAccountBytecode | 27,553 | -2,977 |
| SemiModularAccountStorageOnly | 28,071 | -3,495 |
| TimeRangeModule | 2,000 | 22,576 |
| WebauthnValidationModule | 7,854 | 16,722 | Code coverage:
|
src/account/AccountStorage.sol
Outdated
bytes32 constant _ACCOUNT_STORAGE_SLOT = 0xc531f081ecdb5a90f38c197521797881a6e5c752a7d451780f325a95f8b91f45; | ||
// ERC-7201 derived storage slot. | ||
// keccak256(abi.encode(uint256(keccak256("Alchemy.ModularAccount.Storage_V2")) - 1)) & ~bytes32(uint256(0xff)) | ||
bytes32 constant _ACCOUNT_STORAGE_SLOT = 0x596912a710dec01bac203cb0ed2c7e56a2ce6b2a68276967fff6dd57561bdd00; | ||
|
||
// Represents data associated with a specifc function selector. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we natspec this? I think foundry picks it up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, updating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I meant this line (also a typo)
// Represents data associated with a specifc function selector. | |
/// @dev Represents data associated with a specific function selector. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
OverviewOctane AI analysis has finished. No vulnerabilities were found. Cheers! 🎉🎉🎉 🔗 Commit Hash: b9a7366 |
4225666
to
b9a7366
Compare
Motivation
Cleanup pass on
AccountStorage.sol
andAccountStorageInitializable.sol
.Solution
Expand and clarify natspec.
Test an edge case for the disableInitializers logic (impossible to reach in MA/SMA code).
Update the derivation of the storage root. Previously, we were not actually using ERC-7201, and the hash calculation was wrong. Both of those are now corrected, and the derivation matches the pattern used in MAv1, but with the major version number increased to 2.