Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

NoncesUpgradeable

Inherits: Initializable

Provides tracking nonces for addresses. Nonces will only increment.

State Variables

NoncesStorageLocation

bytes32 private constant NoncesStorageLocation = 0x5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb00;

Functions

_getNoncesStorage

function _getNoncesStorage() private pure returns (NoncesStorage storage $);

__Nonces_init

function __Nonces_init() internal onlyInitializing;

__Nonces_init_unchained

function __Nonces_init_unchained() internal onlyInitializing;

nonces

Returns the next unused nonce for an address.

function nonces(address owner) public view virtual returns (uint256);

_useNonce

Consumes a nonce. Returns the current value and increments nonce.

function _useNonce(address owner) internal virtual returns (uint256);

_useCheckedNonce

Same as _useNonce but checking that nonce is the next valid for owner.

function _useCheckedNonce(address owner, uint256 nonce) internal virtual;

Errors

InvalidAccountNonce

The nonce used for an account is not the expected current nonce.

error InvalidAccountNonce(address account, uint256 currentNonce);

Structs

NoncesStorage

Note: storage-location: erc7201:openzeppelin.storage.Nonces

struct NoncesStorage {
    mapping(address account => uint256) _nonces;
}