NonceTracker

Description:

Proxy contract enabling upgradeable smart contract patterns. Delegates calls to an implementation contract.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "settings": {
    "evmVersion": "cancun",
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  },
  "sources": {
    "project/contracts/NonceTracker.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

/// @title NonceTracker
///
/// @notice A singleton contract for EIP-7702 accounts to manage nonces for ERC-1967 implementation overrides
///
/// @dev Separating nonce storage from EIP-7702 accounts mitigates other arbitrary delegates from unexpectedly reversing state
///
/// @author Coinbase (https://github.com/base/eip-7702-proxy)
contract NonceTracker {
    /// @notice Track nonces per-account to mitigate signature replayability
    mapping(address account => uint256 nonce) public nonces;

    /// @notice An account's nonce has been used
    event NonceUsed(address indexed account, uint256 nonce);

    /// @notice Consume a nonce for the caller
    ///
    /// @return nonce The nonce just used
    function useNonce() external returns (uint256 nonce) {
        nonce = nonces[msg.sender]++;
        emit NonceUsed(msg.sender, nonce);
    }
}"
    }
  }
}}

Tags:
Proxy, Upgradeable, Factory|addr:0xe944116bf2915fc11fcade53e210ce8af3fd75a2|verified:true|block:23577540|tx:0xedfe85a68f20a191b7584c1d47104680ab2c624268db0182441f8b1800583830|first_check:1760467882

Submitted on: 2025-10-14 20:51:23

Comments

Log in to comment.

No comments yet.