-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feat/2d nonce helpers #173
Conversation
Feat/2d nonce helpers
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #173 +/- ##
=======================================
Coverage 86.40% 86.40%
=======================================
Files 14 14
Lines 905 905
Branches 266 244 -22
=======================================
Hits 782 782
Misses 109 109
Partials 14 14 Continue to review full report in Codecov by Sentry.
|
// Todo: fix this test. instead of pranking we should send actual userOp. | ||
|
||
// bytes memory expectedRevertReason = abi.encodeWithSelector( | ||
// FailedOp.selector, | ||
// 0, | ||
// "AA25 invalid account nonce" | ||
// ); | ||
|
||
// vm.expectRevert(expectedRevertReason); |
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 this be done before merge?
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 foundry test case.
.connect(impersonatedEntryPoint) | ||
.validateUserOp(userOp, userOpHash, ethers.parseEther("0.1")); | ||
}); | ||
// Todo: fix below test |
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.
And this?
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.
hardhat one seems unrelated to testing anything nonce related but has abruptly started failing. need to check more
…function buildPackedUserOperation
@@ -46,13 +46,13 @@ contract TestFuzz_ERC4337Account is NexusTest_Base { | |||
vm.assume(numOps < 20); // Keep the number of operations manageable | |||
|
|||
for (uint256 i = 0; i < numOps; i++) { | |||
uint256 nonceBefore = getNonce(address(BOB_ACCOUNT), MODE_VALIDATION, address(VALIDATOR_MODULE)); | |||
uint256 nonceBefore = getNonce(address(BOB_ACCOUNT), MODE_VALIDATION, address(VALIDATOR_MODULE), bytes3(0)); |
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.
maybe use some random batchId since it's fuzz
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.
ok
🤖 Slither Analysis Report 🔎Slither report
# Slither report
_This comment was automatically generated by the GitHub Actions workflow._
THIS CHECKLIST IS NOT COMPLETE. Use
locked-ether🟡 Impact: Medium
utils/RegistryBootstrap.sol#L33-L165 unused-return🟡 Impact: Medium
base/ERC7739Validator.sol#L279-L309 constable-statesImpact: Optimization
|
adds 2D nonce support by packing 3 bytes batchId into most significant 3 bytes of 24 byte (uint192) nonceKey.
no changes required in NonceLib.sol