Skip to content

Commit

Permalink
Using constants instead of magic numbers
Browse files Browse the repository at this point in the history
Renaming _unstakeDelaySec to unstakeDelaySec
  • Loading branch information
shahafn committed Feb 26, 2025
1 parent 3f66f14 commit f36d669
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion contracts/accounts/Simple7702Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract Simple7702Account is BaseAccount, IERC165, IERC1271, ERC1155Holder, ERC

// temporary address of entryPoint v0.8
function entryPoint() public pure override returns (IEntryPoint) {
return IEntryPoint(0xd50BE0da15e04EF4fADbcbA27642179231E0A862);
return IEntryPoint(0x6282F42d4f559552b42aB22b04075c0525259d1F);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/core/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function _packValidationData(
uint48 validAfter
) pure returns (uint256) {
return
(sigFailed ? 1 : 0) |
(sigFailed ? SIG_VALIDATION_FAILED : SIG_VALIDATION_SUCCESS) |
(uint256(validUntil) << 160) |
(uint256(validAfter) << (160 + 48));
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IStakeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ interface IStakeManager {
/**
* Add to the account's stake - amount and delay
* any pending unstake is first cancelled.
* @param _unstakeDelaySec - The new lock duration before the deposit can be withdrawn.
* @param unstakeDelaySec - The new lock duration before the deposit can be withdrawn.
*/
function addStake(uint32 _unstakeDelaySec) external payable;
function addStake(uint32 unstakeDelaySec) external payable;

/**
* Attempt to unlock the stake.
Expand Down
26 changes: 13 additions & 13 deletions reports/gas-checker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@
║ │ │ │ (delta for │ (compared to ║
║ │ │ │ one UserOp) │ account.exec()) ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple │ 1 │ 77427 │ │ ║
║ simple │ 1 │ 77439 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple - diff from previous │ 2 │ │ 4150812509
║ simple - diff from previous │ 2 │ │ 4149612497
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple │ 10 │ 451046 │ │ ║
║ simple │ 10 │ 450974 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple - diff from previous │ 11 │ │ 4160412605
║ simple - diff from previous │ 11 │ │ 4165212653
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster │ 1 │ 83409 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster with diff │ 2 │ │ 40167 │ 11168 ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster │ 10 │ 445122 │ │ ║
║ simple paymaster │ 10 │ 445110 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ simple paymaster with diff │ 11 │ │ 4021111212
║ simple paymaster with diff │ 11 │ │ 4017511176
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx 5k │ 1 │ 167212 │ │ ║
║ big tx 5k │ 1 │ 167224 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx - diff from previous │ 2 │ │ 13075516315
║ big tx - diff from previous │ 2 │ │ 13074316303
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx 5k │ 10 │ 1343939 │ │ ║
║ big tx 5k │ 10 │ 1343963 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ big tx - diff from previous │ 11 │ │ 13077816338
║ big tx - diff from previous │ 11 │ │ 13075416314
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ paymaster+postOp │ 1 │ 84771 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ paymaster+postOp with diff │ 2 │ │ 4154112542
║ paymaster+postOp with diff │ 2 │ │ 4152912530
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ paymaster+postOp │ 10 │ 458700 │ │ ║
║ paymaster+postOp │ 10 │ 458772 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ paymaster+postOp with diff │ 11 │ │ 4160112602
║ paymaster+postOp with diff │ 11 │ │ 4154112542
╚════════════════════════════════╧═══════╧═══════════════╧════════════════╧═════════════════════╝

0 comments on commit f36d669

Please sign in to comment.