ETH Price: $2,480.14 (-8.05%)

Contract

0xD8e78115B09503d9624FBefF6C7b16c665a971B5
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040165279612023-01-31 16:20:11574 days ago1675182011IN
 Create: StructNonceManager
0 ETH0.0045052230.27559454

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StructNonceManager

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 3333 runs

Other Settings:
default evmVersion
File 1 of 2 : StructNonceManager.sol
// SPDX-License-Identifier: Unlicense

pragma solidity ^0.8.0;

import "../interfaces/IStructNonceManager.sol";

error StructNonceManager_InvalidState();

/**                       .-==+++++++++++++++++++++++++++++++=-:
                     :=*%##########################################+-
                  .+%##################################################-
                .*######################################################%=
               *##################%*##################*###################%:
             .###################+   :##############+   :###################=
            :####################=    ##############=    ####################*
           .#####################=    ##############=    #####################+
           ######################*   -##############*   -######################
          .#########################%##################%#######################=
          :####################################################################*
          .%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=

       .-+*##############################*-                          .=########*+=.
     -######################################+:                     -###############%=
    *#########################################%=                :+####################
   *##############################################-          .+%######################%
  .##################################################-     =%##########################-
  :####################################################%#%#############################-
   ###################################################################################%
    *#################################################################################
     -#############################################################################%=
        -+*#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%##+=.

          .#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#=
          -####################################################################*
          .####################################################################=
           ####################################################################.
           .##################################################################+
            :################################################################*
             :##############################################################+
              .############################################################-
                :########################################################=
                  :*###################################################=
                     :+###########################################%*-.
                          :-=+******************************++=:.

 * @title Manage struct nonces
 * @author Augminted Labs, LLC
 */
contract StructNonceManager is IStructNonceManager {
    mapping(uint256 => bool) private _nonceConsumed;

    constructor () {}

    /**
     * @notice Returns if a nonce has been consumed
     * @param nonce Nonce to return state of
     * @return bool State of specified nonce
     */
    function nonceConsumed(uint256 nonce) external view returns (bool) {
        return _nonceConsumed[nonce];
    }

    /**
     * @notice Throw if specified nonce is not in specified state
     * @param nonce Target nonce
     * @param consumed Target state
     */
    function requireNonceState(uint256 nonce, bool consumed) external view {
        if (_nonceConsumed[nonce] != consumed) revert StructNonceManager_InvalidState();
    }

    /**
     * @notice Consume specified nonce
     * @param nonce Nonce to consume
     */
    function consumeNonce(uint256 nonce) external payable {
        _nonceConsumed[nonce] = true;
    }
}

File 2 of 2 : IStructNonceManager.sol
// SPDX-License-Identifier: Unlicense

pragma solidity ^0.8.0;

interface IStructNonceManager {
    function nonceConsumed(uint256 nonce) external view returns (bool);
    function requireNonceState(uint256 nonce, bool consumed) external view;
    function consumeNonce(uint256 nonce) external payable;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 3333
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"StructNonceManager_InvalidState","type":"error"},{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"consumeNonce","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"nonceConsumed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bool","name":"consumed","type":"bool"}],"name":"requireNonceState","outputs":[],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506101bc806100206000396000f3fe6080604052600436106100345760003560e01c806350392f7d14610039578063cf422b361461005b578063fecb2b64146100a2575b600080fd5b34801561004557600080fd5b50610059610054366004610138565b6100e6565b005b61005961006936600461016d565b600090815260208190526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b3480156100ae57600080fd5b506100d26100bd36600461016d565b60009081526020819052604090205460ff1690565b604051901515815260200160405180910390f35b60008281526020819052604090205460ff16151581151514610134576040517fa3fc4c9200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6000806040838503121561014b57600080fd5b823591506020830135801515811461016257600080fd5b809150509250929050565b60006020828403121561017f57600080fd5b503591905056fea2646970667358221220cbc698ee63ea529a327d17e6210c68b0b9292ee6810991f93c61ca692f1f6faf64736f6c63430008100033

Deployed Bytecode

0x6080604052600436106100345760003560e01c806350392f7d14610039578063cf422b361461005b578063fecb2b64146100a2575b600080fd5b34801561004557600080fd5b50610059610054366004610138565b6100e6565b005b61005961006936600461016d565b600090815260208190526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b3480156100ae57600080fd5b506100d26100bd36600461016d565b60009081526020819052604090205460ff1690565b604051901515815260200160405180910390f35b60008281526020819052604090205460ff16151581151514610134576040517fa3fc4c9200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6000806040838503121561014b57600080fd5b823591506020830135801515811461016257600080fd5b809150509250929050565b60006020828403121561017f57600080fd5b503591905056fea2646970667358221220cbc698ee63ea529a327d17e6210c68b0b9292ee6810991f93c61ca692f1f6faf64736f6c63430008100033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.