Skip to content

Commit

Permalink
Update contracts/utils/NoncesKeyed.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestognw authored Nov 26, 2024
1 parent 33bbf24 commit bf2d786
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/utils/NoncesKeyed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {Nonces} from "./Nonces.sol";
*
* Follows the https://eips.ethereum.org/EIPS/eip-4337#semi-abstracted-nonce-support[ERC-4337's semi-abstracted nonce system].
*
* Note: This contract extends {Nonces}, and reuses {Nonces}'s storage for key #0. This makes upgrading from {Nonces}
* to {NoncesKeyed} safe, as such an upgrade will NOT reset the current state of nonces. Doing otherwise would enable
* replay attacks where operation that used nonces before the upgrade would be replayable after the upgrade.
* NOTE: This contract inherits from {Nonces} and reuses its storage for the first nonce key (i.e. `0`). This
* makes upgrading from {Nonces} to {NoncesKeyed} safe. Doing so will NOT reset the current state of nonces to
* avoid replay attacks where a nonce is reused after the upgrade.
*/
abstract contract NoncesKeyed is Nonces {
mapping(address owner => mapping(uint192 key => uint64)) private _nonces;
Expand Down

0 comments on commit bf2d786

Please sign in to comment.