ETH Price: $3,259.73 (+2.34%)
Gas: 1 Gwei

Contract

0x3071e07E1101a6A81B01ebABe59c292C0e8a0226
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Pause186988462023-12-02 12:53:47237 days ago1701521627IN
0x3071e07E...C0e8a0226
0 ETH0.000816628.17532002
Mint186988242023-12-02 12:49:23237 days ago1701521363IN
0x3071e07E...C0e8a0226
0.005 ETH0.0042452228.14091332
Mint186983952023-12-02 11:22:59237 days ago1701516179IN
0x3071e07E...C0e8a0226
0.005 ETH0.0042295328.02442542
Mint186981362023-12-02 10:31:11237 days ago1701513071IN
0x3071e07E...C0e8a0226
0.0025 ETH0.0045282732.87646981
Set Royalty Addr...186948512023-12-01 23:29:59238 days ago1701473399IN
0x3071e07E...C0e8a0226
0 ETH0.0014372930.82924919
Mint186919262023-12-01 13:41:35238 days ago1701438095IN
0x3071e07E...C0e8a0226
0.005 ETH0.0061587444.03253298
Mint186903702023-12-01 8:27:11238 days ago1701419231IN
0x3071e07E...C0e8a0226
0.0025 ETH0.0041836431.31866434
Mint186889272023-12-01 3:37:23238 days ago1701401843IN
0x3071e07E...C0e8a0226
0.0025 ETH0.0046103230.80882675
Mint186841892023-11-30 11:41:11239 days ago1701344471IN
0x3071e07E...C0e8a0226
0.0025 ETH0.0044788130.09471067
Mint186838462023-11-30 10:32:23239 days ago1701340343IN
0x3071e07E...C0e8a0226
0.0025 ETH0.0043787131.78303499
Mint186768352023-11-29 11:00:35240 days ago1701255635IN
0x3071e07E...C0e8a0226
0.0025 ETH0.0046849331.6652306
Mint186657842023-11-27 21:54:11242 days ago1701122051IN
0x3071e07E...C0e8a0226
0.0125 ETH0.0068041352.69578624
Mint186657812023-11-27 21:53:35242 days ago1701122015IN
0x3071e07E...C0e8a0226
0.0125 ETH0.007313550.01680251
Mint186609162023-11-27 5:31:35242 days ago1701063095IN
0x3071e07E...C0e8a0226
0.0025 ETH0.0031283622.70830278
Mint186588732023-11-26 22:39:11243 days ago1701038351IN
0x3071e07E...C0e8a0226
0.01 ETH0.0035295827.79351544
Set Merkle Root186564002023-11-26 14:19:59243 days ago1701008399IN
0x3071e07E...C0e8a0226
0 ETH0.0011963725.6386672
Set Merkle Root186563992023-11-26 14:19:47243 days ago1701008387IN
0x3071e07E...C0e8a0226
0 ETH0.0010664222.85373871
Set Merkle Root186563992023-11-26 14:19:47243 days ago1701008387IN
0x3071e07E...C0e8a0226
0 ETH0.0010661422.85373871
Set Merkle Root186563972023-11-26 14:19:23243 days ago1701008363IN
0x3071e07E...C0e8a0226
0 ETH0.0011540424.73786188
Set Merkle Root186563962023-11-26 14:19:11243 days ago1701008351IN
0x3071e07E...C0e8a0226
0 ETH0.0011891225.48316665
Set Merkle Root186563952023-11-26 14:18:59243 days ago1701008339IN
0x3071e07E...C0e8a0226
0 ETH0.0012203526.1524562
Mint186555482023-11-26 11:27:35243 days ago1700998055IN
0x3071e07E...C0e8a0226
0.0025 ETH0.0037803225.39959878
Mint186544012023-11-26 7:36:23243 days ago1700984183IN
0x3071e07E...C0e8a0226
0.025 ETH0.0032229419.30332248
Mint186462312023-11-25 4:08:59244 days ago1700885339IN
0x3071e07E...C0e8a0226
0.0075 ETH0.0029927920.3347918
Mint186193192023-11-21 9:43:23248 days ago1700559803IN
0x3071e07E...C0e8a0226
0.0125 ETH0.0040856425.84605263
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
186988242023-12-02 12:49:23237 days ago1701521363
0x3071e07E...C0e8a0226
0.0045 ETH
186988242023-12-02 12:49:23237 days ago1701521363
0x3071e07E...C0e8a0226
0.0005 ETH
186983952023-12-02 11:22:59237 days ago1701516179
0x3071e07E...C0e8a0226
0.0045 ETH
186983952023-12-02 11:22:59237 days ago1701516179
0x3071e07E...C0e8a0226
0.0005 ETH
186981362023-12-02 10:31:11237 days ago1701513071
0x3071e07E...C0e8a0226
0.0025 ETH
186919262023-12-01 13:41:35238 days ago1701438095
0x3071e07E...C0e8a0226
0.005 ETH
186903702023-12-01 8:27:11238 days ago1701419231
0x3071e07E...C0e8a0226
0.0025 ETH
186889272023-12-01 3:37:23238 days ago1701401843
0x3071e07E...C0e8a0226
0.00225 ETH
186889272023-12-01 3:37:23238 days ago1701401843
0x3071e07E...C0e8a0226
0.00025 ETH
186841892023-11-30 11:41:11239 days ago1701344471
0x3071e07E...C0e8a0226
0.00225 ETH
186841892023-11-30 11:41:11239 days ago1701344471
0x3071e07E...C0e8a0226
0.00025 ETH
186838462023-11-30 10:32:23239 days ago1701340343
0x3071e07E...C0e8a0226
0.0025 ETH
186768352023-11-29 11:00:35240 days ago1701255635
0x3071e07E...C0e8a0226
0.00225 ETH
186768352023-11-29 11:00:35240 days ago1701255635
0x3071e07E...C0e8a0226
0.00025 ETH
186657842023-11-27 21:54:11242 days ago1701122051
0x3071e07E...C0e8a0226
0.0125 ETH
186657812023-11-27 21:53:35242 days ago1701122015
0x3071e07E...C0e8a0226
0.0125 ETH
186609162023-11-27 5:31:35242 days ago1701063095
0x3071e07E...C0e8a0226
0.0025 ETH
186588732023-11-26 22:39:11243 days ago1701038351
0x3071e07E...C0e8a0226
0.01 ETH
186555482023-11-26 11:27:35243 days ago1700998055
0x3071e07E...C0e8a0226
0.00225 ETH
186555482023-11-26 11:27:35243 days ago1700998055
0x3071e07E...C0e8a0226
0.00025 ETH
186544012023-11-26 7:36:23243 days ago1700984183
0x3071e07E...C0e8a0226
0.0225 ETH
186544012023-11-26 7:36:23243 days ago1700984183
0x3071e07E...C0e8a0226
0.0025 ETH
186462312023-11-25 4:08:59244 days ago1700885339
0x3071e07E...C0e8a0226
0.00675 ETH
186462312023-11-25 4:08:59244 days ago1700885339
0x3071e07E...C0e8a0226
0.00075 ETH
186193192023-11-21 9:43:23248 days ago1700559803
0x3071e07E...C0e8a0226
0.01125 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
externalMinter

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : minter_external.sol
// SPDX-License-Identifier: MIT
// Copyright (c) 2023 Keisuke OHNO

/*

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/

pragma solidity >=0.7.0 <0.9.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";


interface iNFTCollection {
    function externalMint(address _address , uint256 _amount ) external payable ;
 }

contract externalMinter is Ownable , AccessControl{


    constructor(){
        //Role initialization
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        grantRole( ADMIN             , msg.sender);

        setWithdrawAddress(0xe40850F4Da5b96bC4D2A5041BdBFBA15e4B13C3F);
        setNFTCollection(0x61775831f5F31F000CE65d150d3FF63158972fb7);

        setMintCount(false);


    }

    iNFTCollection public NFTCollection;
    bytes32 public constant ADMIN = keccak256("ADMIN");
    bytes32 public constant MINTER_ROLE  = keccak256("MINTER_ROLE");



    //
    //withdraw section
    //

    address public withdrawAddress = 0xdEcf4B112d4120B6998e5020a6B4819E490F7db6;

    function setWithdrawAddress(address _withdrawAddress) public onlyOwner {
        withdrawAddress = _withdrawAddress;
    }

    function withdraw() public payable onlyOwner {
        (bool os, ) = payable(withdrawAddress).call{value: address(this).balance}('');
        require(os);
    }





    //
    //mint section
    //

    uint256 public mintedAmount = 0;
    function _nextTokenId() internal view returns(uint256){
        return mintedAmount + 1;
    }

    //https://eth-converter.com/
    uint256 public cost = 2500000000000000;
    uint256 public maxSupply = 9999;
    uint256 public maxMintAmountPerTransaction = 200;
    uint256 public publicSaleMaxMintAmountPerAddress = 50;
    bool public paused = true;

    bool public onlyAllowlisted = true;
    bool public mintCount = true;
    bool public burnAndMintMode = false;

    //0 : Merkle Tree
    //1 : Mapping
    uint256 public allowlistType = 0;
    mapping(uint256 => bytes32) public merkleRoot;
    uint256 public saleId = 0;
    mapping(uint256 => mapping(address => uint256)) public userMintedAmount;
    mapping(uint256 => mapping(address => uint256)) public allowlistUserAmount;

    mapping(uint256 => address) public royaltyAddress;
    uint256 public royaltyRate = 1000;
    address nullAddress = 0x0000000000000000000000000000000000000000;

    modifier callerIsUser() {
        require(tx.origin == msg.sender, "The caller is another contract.");
        _;
    }
 
    //mint with merkle tree
    function mint(uint256 _mintAmount , uint256 _maxMintAmount , bytes32[] calldata _merkleProof , uint256 _inputSaleId ) public payable callerIsUser{
        require(!paused, "the contract is paused");
        require(0 < _mintAmount, "need to mint at least 1 NFT");
        require(_mintAmount <= maxMintAmountPerTransaction, "max mint amount per session exceeded");
        require( _nextTokenId() + _mintAmount -1 <= maxSupply , "max NFT limit exceeded");
        require(cost * _mintAmount <= msg.value, "insufficient funds");

        uint256 maxMintAmountPerAddress;
        if(onlyAllowlisted == true) {
            if(allowlistType == 0){
                //Merkle tree
                bytes32 leaf = keccak256( abi.encodePacked(msg.sender, _maxMintAmount) );
                require(MerkleProof.verify(_merkleProof, merkleRoot[_inputSaleId], leaf), "user is not allowlisted");
                maxMintAmountPerAddress = _maxMintAmount;
            }else if(allowlistType == 1){
                //Mapping
                require( allowlistUserAmount[_inputSaleId][msg.sender] != 0 , "user is not allowlisted");
                maxMintAmountPerAddress = allowlistUserAmount[_inputSaleId][msg.sender];
            }
        }else{
            maxMintAmountPerAddress = publicSaleMaxMintAmountPerAddress;
        }

        if(mintCount == true){
            require(_mintAmount <= maxMintAmountPerAddress - userMintedAmount[_inputSaleId][msg.sender] , "max NFT per address exceeded");
            userMintedAmount[_inputSaleId][msg.sender] += _mintAmount;
        }

        mintedAmount += _mintAmount;

        if( royaltyAddress[_inputSaleId] != nullAddress ){

            (bool osRoyalty, ) = payable(royaltyAddress[_inputSaleId]).call{ value: address(this).balance * royaltyRate / 10000 }('');
            require(osRoyalty);

        }

        (bool osWithdraw, ) = payable(withdrawAddress).call{value: address(this).balance}('');
        require(osWithdraw);

        NFTCollection.externalMint( msg.sender, _mintAmount );
    }



    //mint with merkle tree
    function mintPie(uint256 _mintAmount , uint256 _maxMintAmount , bytes32[] calldata _merkleProof ,uint256 _inputSaleId,  address receiver ) public payable callerIsUser onlyRole(MINTER_ROLE){
        require(!paused, "the contract is paused");
        require(0 < _mintAmount, "need to mint at least 1 NFT");
        require(_mintAmount <= maxMintAmountPerTransaction, "max mint amount per session exceeded");
        require( _nextTokenId() + _mintAmount -1 <= maxSupply , "max NFT limit exceeded");
        require(cost * _mintAmount <= msg.value, "insufficient funds");

        uint256 maxMintAmountPerAddress;
        if(onlyAllowlisted == true) {
            if(allowlistType == 0){
                //Merkle tree
                bytes32 leaf = keccak256( abi.encodePacked(receiver , _maxMintAmount) );
                require(MerkleProof.verify(_merkleProof, merkleRoot[_inputSaleId], leaf), "user is not allowlisted");
                maxMintAmountPerAddress = _maxMintAmount;
            }else if(allowlistType == 1){
                //Mapping
                require( allowlistUserAmount[_inputSaleId][receiver] != 0 , "user is not allowlisted");
                maxMintAmountPerAddress = allowlistUserAmount[_inputSaleId][receiver];
            }
        }else{
            maxMintAmountPerAddress = publicSaleMaxMintAmountPerAddress;
        }

        if(mintCount == true){
            require(_mintAmount <= maxMintAmountPerAddress - userMintedAmount[_inputSaleId][receiver] , "max NFT per address exceeded");
            userMintedAmount[_inputSaleId][receiver] += _mintAmount;
        }

        mintedAmount += _mintAmount;

        if( royaltyAddress[_inputSaleId] != nullAddress ){
            (bool osRoyalty, ) = payable(royaltyAddress[_inputSaleId]).call{ value: address(this).balance * royaltyRate / 10000 }('');
            require(osRoyalty);
        }

        (bool osWithdraw, ) = payable(withdrawAddress).call{value: address(this).balance}('');
        require(osWithdraw);

        NFTCollection.externalMint( receiver , _mintAmount );
    }



    function currentTokenId() public view returns(uint256){
        return _nextTokenId() -1;
    }

    function setBurnAndMintMode(bool _burnAndMintMode) public onlyRole(ADMIN) {
        burnAndMintMode = _burnAndMintMode;
    }

    function setRoyaltyRate(uint256 _royaltyRate) public onlyRole(ADMIN) {
        royaltyRate = _royaltyRate;
    }

    function setRoyaltyAddress(uint256 _saleId , address _royaltyAddress) public onlyRole(ADMIN) {
        royaltyAddress[_saleId] = _royaltyAddress;
    }

    function setMerkleRoot(uint256 _saleId , bytes32 _merkleRoot) public onlyRole(ADMIN) {
        merkleRoot[_saleId] = _merkleRoot;
    }

    function setPause(bool _state) public onlyRole(ADMIN) {
        paused = _state;
    }

    function setAllowListType(uint256 _type)public onlyRole(ADMIN){
        require( _type == 0 || _type == 1 , "Allow list type error");
        allowlistType = _type;
    }

    function setAllowlistMapping(uint256 _saleId , address[] memory addresses, uint256[] memory saleSupplies) public onlyRole(ADMIN) {
        require(addresses.length == saleSupplies.length);
        for (uint256 i = 0; i < addresses.length; i++) {
            allowlistUserAmount[_saleId][addresses[i]] = saleSupplies[i];
        }
    }

    function getAllowlistUserAmount(address _address ) public view returns(uint256){
        return allowlistUserAmount[saleId][_address];
    }

    function getUserMintedAmountBySaleId(uint256 _saleId , address _address ) public view returns(uint256){
        return userMintedAmount[_saleId][_address];
    }

    function getUserMintedAmount(address _address ) public view returns(uint256){
        return userMintedAmount[saleId][_address];
    }

    function setSaleId(uint256 _saleId) public onlyRole(ADMIN) {
        saleId = _saleId;
    }

    function setMaxSupply(uint256 _maxSupply) public onlyRole(ADMIN) {
        maxSupply = _maxSupply;
    }

    function setPublicSaleMaxMintAmountPerAddress(uint256 _publicSaleMaxMintAmountPerAddress) public onlyRole(ADMIN) {
        publicSaleMaxMintAmountPerAddress = _publicSaleMaxMintAmountPerAddress;
    }

    function setCost(uint256 _newCost) public onlyRole(ADMIN) {
        cost = _newCost;
    }

    function setOnlyAllowlisted(bool _state) public onlyRole(ADMIN) {
        onlyAllowlisted = _state;
    }

    function setMaxMintAmountPerTransaction(uint256 _maxMintAmountPerTransaction) public onlyRole(ADMIN) {
        maxMintAmountPerTransaction = _maxMintAmountPerTransaction;
    }
  
    function setMintCount(bool _state) public onlyRole(ADMIN) {
        mintCount = _state;
    }

    function setMintedAmount(uint256 _mintedAmount) public onlyRole(ADMIN) {
        mintedAmount = _mintedAmount;
    }

    function setNFTCollection(address _address) public onlyRole(ADMIN) {
        NFTCollection = iNFTCollection(_address);
    }

    function totalSupply() public view returns (uint256) {
        return mintedAmount;
    }

}

File 2 of 11 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 3 of 11 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 4 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 11 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 6 of 11 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 7 of 11 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 8 of 11 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 9 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 10 of 11 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 11 of 11 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"ADMIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NFTCollection","outputs":[{"internalType":"contract iNFTCollection","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"allowlistUserAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnAndMintMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getAllowlistUserAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getUserMintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleId","type":"uint256"},{"internalType":"address","name":"_address","type":"address"}],"name":"getUserMintedAmountBySaleId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmountPerTransaction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"uint256","name":"_maxMintAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_inputSaleId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintCount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"uint256","name":"_maxMintAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_inputSaleId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mintPie","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"onlyAllowlisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleMaxMintAmountPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"royaltyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_type","type":"uint256"}],"name":"setAllowListType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleId","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"saleSupplies","type":"uint256[]"}],"name":"setAllowlistMapping","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_burnAndMintMode","type":"bool"}],"name":"setBurnAndMintMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCost","type":"uint256"}],"name":"setCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMintAmountPerTransaction","type":"uint256"}],"name":"setMaxMintAmountPerTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleId","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setMintCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintedAmount","type":"uint256"}],"name":"setMintedAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setNFTCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setOnlyAllowlisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_publicSaleMaxMintAmountPerAddress","type":"uint256"}],"name":"setPublicSaleMaxMintAmountPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleId","type":"uint256"},{"internalType":"address","name":"_royaltyAddress","type":"address"}],"name":"setRoyaltyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_royaltyRate","type":"uint256"}],"name":"setRoyaltyRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleId","type":"uint256"}],"name":"setSaleId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_withdrawAddress","type":"address"}],"name":"setWithdrawAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userMintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdrawAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6080604052600380546001600160a01b031990811673decf4b112d4120b6998e5020a6b4819e490f7db617909155600060048190556608e1bc9bf0400060055561270f60065560c860075560326008556009805463ffffffff191662010101179055600a819055600c556103e86010556011805490911690553480156200008557600080fd5b50620000913362000109565b6200009e60003362000159565b620000b960008051602062002c938339815191523362000169565b620000d873e40850f4da5b96bc4d2a5041bdbfba15e4b13c3f62000198565b620000f77361775831f5f31f000ce65d150d3ff63158972fb7620001c4565b62000103600062000202565b620006f1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6200016582826200023a565b5050565b600082815260016020819052604090912001546200018781620002a8565b6200019383836200023a565b505050565b620001a2620002b7565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60008051602062002c93833981519152620001df81620002a8565b50600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008051602062002c938339815191526200021d81620002a8565b5060098054911515620100000262ff000019909216919091179055565b62000246828262000319565b620001655760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b620002b4813362000346565b50565b6000546001600160a01b03163314620003175760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b62000352828262000319565b62000165576200036d81620003be60201b62001b621760201c565b6200038383602062001b74620003d1821b17811c565b60405160200162000396929190620005b7565b60408051601f198184030181529082905262461bcd60e51b82526200030e9160040162000630565b6060620003406001600160a01b03831660145b60606000620003e28360026200067b565b620003ef90600262000695565b6001600160401b03811115620004095762000409620006ab565b6040519080825280601f01601f19166020018201604052801562000434576020820181803683370190505b509050600360fc1b81600081518110620004525762000452620006c1565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110620004845762000484620006c1565b60200101906001600160f81b031916908160001a9053506000620004aa8460026200067b565b620004b790600162000695565b90505b600181111562000539576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110620004ef57620004ef620006c1565b1a60f81b828281518110620005085762000508620006c1565b60200101906001600160f81b031916908160001a90535060049490941c936200053181620006d7565b9050620004ba565b5083156200058a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016200030e565b9392505050565b60005b83811015620005ae57818101518382015260200162000594565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351620005f181601785016020880162000591565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516200062481602884016020880162000591565b01602801949350505050565b60208152600082518060208401526200065181604085016020870162000591565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141762000340576200034062000665565b8082018082111562000340576200034062000665565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081620006e957620006e962000665565b506000190190565b61259280620007016000396000f3fe60806040526004361061034e5760003560e01c8063674c02aa116101c6578063a9e2acd5116100f7578063d539139311610095578063d728312a1161006f578063d728312a14610a07578063e39e026914610a27578063f2fde38b14610a47578063f48824db14610a6757600080fd5b8063d53913931461099d578063d547741f146109d1578063d5abeb01146109f157600080fd5b8063bedb86fb116100d1578063bedb86fb1461090d578063c4d1510d1461092d578063c84c038714610943578063d04f32d21461095957600080fd5b8063a9e2acd5146108b7578063b5f94d06146108d7578063bbb89744146108f757600080fd5b80637ee3b2ac1161016457806391d148541161013e57806391d148541461084c5780639659867e1461086c578063a217fddf1461088c578063a72193b6146108a157600080fd5b80637ee3b2ac146107ee5780638da5cb5b1461080e5780638e73cf001461082c57600080fd5b8063715018a6116101a0578063715018a61461078357806373ef64fd1461079857806378b2e3a9146107ae5780637b9757db146107ce57600080fd5b8063674c02aa146107315780636b1a2b7f146107505780636f8b44b01461076357600080fd5b80632d380242116102a057806344a0d68a1161023e578063499a15d411610218578063499a15d41461069f5780634e6bf204146106d7578063537782a2146106f75780635c975abb1461071757600080fd5b806344a0d68a1461062857806347705cbc1461064857806347b174421461068c57600080fd5b806336568abe1161027a57806336568abe146105b35780633ab1a494146105d35780633c70b357146105f35780633ccfd60b1461062057600080fd5b80632d3802421461053a5780632f2ff15d146105505780633511cd541461057057600080fd5b806317dc10c41161030d5780631bb25016116102e75780631bb25016146104a7578063248a9ca3146104c75780632a0acc6a146104f85780632b4fd7791461051a57600080fd5b806317dc10c41461045057806318160ddd1461047257806318712c211461048757600080fd5b806285bb6f146103535780629a9b7b1461038957806301ffc9a7146103ac578063036eaf66146103cc57806313faede61461041a5780631581b60014610430575b600080fd5b34801561035f57600080fd5b50600954610374906301000000900460ff1681565b60405190151581526020015b60405180910390f35b34801561039557600080fd5b5061039e610a9f565b604051908152602001610380565b3480156103b857600080fd5b506103746103c7366004611f99565b610aba565b3480156103d857600080fd5b506104026103e7366004611fc3565b600f602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610380565b34801561042657600080fd5b5061039e60055481565b34801561043c57600080fd5b50600354610402906001600160a01b031681565b34801561045c57600080fd5b5061047061046b366004611fdc565b610af1565b005b34801561047e57600080fd5b5060045461039e565b34801561049357600080fd5b506104706104a2366004611ffe565b610b24565b3480156104b357600080fd5b506104706104c236600461203c565b610b4f565b3480156104d357600080fd5b5061039e6104e2366004611fc3565b6000908152600160208190526040909120015490565b34801561050457600080fd5b5061039e60008051602061253d83398151915281565b34801561052657600080fd5b50610470610535366004612068565b610b96565b34801561054657600080fd5b5061039e60045481565b34801561055c57600080fd5b5061047061056b36600461203c565b610bd1565b34801561057c57600080fd5b5061039e61058b36600461203c565b6000918252600d602090815260408084206001600160a01b0393909316845291905290205490565b3480156105bf57600080fd5b506104706105ce36600461203c565b610bfc565b3480156105df57600080fd5b506104706105ee366004612068565b610c7f565b3480156105ff57600080fd5b5061039e61060e366004611fc3565b600b6020526000908152604090205481565b610470610ca9565b34801561063457600080fd5b50610470610643366004611fc3565b610d14565b34801561065457600080fd5b5061039e610663366004612068565b600c546000908152600d602090815260408083206001600160a01b039094168352929052205490565b61047061069a3660046120cf565b610d32565b3480156106ab57600080fd5b5061039e6106ba36600461203c565b600e60209081526000928352604080842090915290825290205481565b3480156106e357600080fd5b506104706106f2366004612214565b6112cc565b34801561070357600080fd5b50610470610712366004611fc3565b611385565b34801561072357600080fd5b506009546103749060ff1681565b34801561073d57600080fd5b5060095461037490610100900460ff1681565b61047061075e3660046122df565b6113a3565b34801561076f57600080fd5b5061047061077e366004611fc3565b6118ea565b34801561078f57600080fd5b50610470611908565b3480156107a457600080fd5b5061039e60085481565b3480156107ba57600080fd5b50600254610402906001600160a01b031681565b3480156107da57600080fd5b506104706107e9366004611fc3565b61191c565b3480156107fa57600080fd5b50610470610809366004611fc3565b61193a565b34801561081a57600080fd5b506000546001600160a01b0316610402565b34801561083857600080fd5b50610470610847366004611fdc565b6119a9565b34801561085857600080fd5b5061037461086736600461203c565b6119de565b34801561087857600080fd5b506009546103749062010000900460ff1681565b34801561089857600080fd5b5061039e600081565b3480156108ad57600080fd5b5061039e600a5481565b3480156108c357600080fd5b506104706108d2366004611fc3565b611a09565b3480156108e357600080fd5b506104706108f2366004611fc3565b611a27565b34801561090357600080fd5b5061039e60075481565b34801561091957600080fd5b50610470610928366004611fdc565b611a45565b34801561093957600080fd5b5061039e60105481565b34801561094f57600080fd5b5061039e600c5481565b34801561096557600080fd5b5061039e610974366004612068565b600c546000908152600e602090815260408083206001600160a01b039094168352929052205490565b3480156109a957600080fd5b5061039e7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b3480156109dd57600080fd5b506104706109ec36600461203c565b611a71565b3480156109fd57600080fd5b5061039e60065481565b348015610a1357600080fd5b50610470610a22366004611fc3565b611a97565b348015610a3357600080fd5b50610470610a42366004611fdc565b611ab5565b348015610a5357600080fd5b50610470610a62366004612068565b611aec565b348015610a7357600080fd5b5061039e610a8236600461203c565b600d60209081526000928352604080842090915290825290205481565b60006001610aab611d17565b610ab59190612350565b905090565b60006001600160e01b03198216637965db0b60e01b1480610aeb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008051602061253d833981519152610b0981611d28565b50600980549115156101000261ff0019909216919091179055565b60008051602061253d833981519152610b3c81611d28565b506000918252600b602052604090912055565b60008051602061253d833981519152610b6781611d28565b506000918252600f602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b60008051602061253d833981519152610bae81611d28565b50600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610bed81611d28565b610bf78383611d32565b505050565b6001600160a01b0381163314610c715760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610c7b8282611d9d565b5050565b610c87611e04565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b610cb1611e04565b6003546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610cfe576040519150601f19603f3d011682016040523d82523d6000602084013e610d03565b606091505b5050905080610d1157600080fd5b50565b60008051602061253d833981519152610d2c81611d28565b50600555565b323314610d815760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163742e006044820152606401610c68565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610dab81611d28565b60095460ff1615610df75760405162461bcd60e51b81526020600482015260166024820152751d1a194818dbdb9d1c9858dd081a5cc81c185d5cd95960521b6044820152606401610c68565b86600010610e475760405162461bcd60e51b815260206004820152601b60248201527f6e65656420746f206d696e74206174206c656173742031204e465400000000006044820152606401610c68565b600754871115610e695760405162461bcd60e51b8152600401610c6890612363565b600654600188610e77611d17565b610e8191906123a7565b610e8b9190612350565b1115610ed25760405162461bcd60e51b81526020600482015260166024820152751b585e08139195081b1a5b5a5d08195e18d95959195960521b6044820152606401610c68565b3487600554610ee191906123ba565b1115610f245760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b6044820152606401610c68565b600954600090610100900460ff16151560010361106b57600a54600003610ff6576040516bffffffffffffffffffffffff19606085901b16602082015260348101889052600090605401604051602081830303815290604052805190602001209050610fd187878080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508a8152600b60205260409020549250859150611e5e9050565b610fed5760405162461bcd60e51b8152600401610c68906123d1565b87915050611070565b600a54600103611066576000848152600e602090815260408083206001600160a01b038716845290915281205490036110415760405162461bcd60e51b8152600401610c68906123d1565b506000838152600e602090815260408083206001600160a01b03861684529091529020545b611070565b506008545b60095462010000900460ff161515600103611139576000848152600d602090815260408083206001600160a01b03871684529091529020546110b29082612350565b8811156111015760405162461bcd60e51b815260206004820152601c60248201527f6d6178204e4654207065722061646472657373206578636565646564000000006044820152606401610c68565b6000848152600d602090815260408083206001600160a01b0387168452909152812080548a92906111339084906123a7565b90915550505b876004600082825461114b91906123a7565b90915550506011546000858152600f60205260409020546001600160a01b039081169116146111fb576000848152600f60205260408120546010546001600160a01b0390911690612710906111a090476123ba565b6111aa9190612408565b604051600081818185875af1925050503d80600081146111e6576040519150601f19603f3d011682016040523d82523d6000602084013e6111eb565b606091505b50509050806111f957600080fd5b505b6003546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611248576040519150601f19603f3d011682016040523d82523d6000602084013e61124d565b606091505b505090508061125b57600080fd5b60025460405163133f311360e31b81526001600160a01b038681166004830152602482018c9052909116906399f9889890604401600060405180830381600087803b1580156112a957600080fd5b505af11580156112bd573d6000803e3d6000fd5b50505050505050505050505050565b60008051602061253d8339815191526112e481611d28565b81518351146112f257600080fd5b60005b835181101561137e578281815181106113105761131061242a565b6020026020010151600e6000878152602001908152602001600020600086848151811061133f5761133f61242a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061137690612440565b9150506112f5565b5050505050565b60008051602061253d83398151915261139d81611d28565b50601055565b3233146113f25760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163742e006044820152606401610c68565b60095460ff161561143e5760405162461bcd60e51b81526020600482015260166024820152751d1a194818dbdb9d1c9858dd081a5cc81c185d5cd95960521b6044820152606401610c68565b8460001061148e5760405162461bcd60e51b815260206004820152601b60248201527f6e65656420746f206d696e74206174206c656173742031204e465400000000006044820152606401610c68565b6007548511156114b05760405162461bcd60e51b8152600401610c6890612363565b6006546001866114be611d17565b6114c891906123a7565b6114d29190612350565b11156115195760405162461bcd60e51b81526020600482015260166024820152751b585e08139195081b1a5b5a5d08195e18d95959195960521b6044820152606401610c68565b348560055461152891906123ba565b111561156b5760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b6044820152606401610c68565b600954600090610100900460ff16151560010361169f57600a5460000361163c576040516bffffffffffffffffffffffff193360601b166020820152603481018690526000906054016040516020818303038152906040528051906020012090506116178585808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250888152600b60205260409020549250859150611e5e9050565b6116335760405162461bcd60e51b8152600401610c68906123d1565b859150506116a4565b600a5460010361169a576000828152600e60209081526040808320338452909152812054900361167e5760405162461bcd60e51b8152600401610c68906123d1565b506000818152600e602090815260408083203384529091529020545b6116a4565b506008545b60095462010000900460ff16151560010361175b576000828152600d602090815260408083203384529091529020546116dd9082612350565b86111561172c5760405162461bcd60e51b815260206004820152601c60248201527f6d6178204e4654207065722061646472657373206578636565646564000000006044820152606401610c68565b6000828152600d60209081526040808320338452909152812080548892906117559084906123a7565b90915550505b856004600082825461176d91906123a7565b90915550506011546000838152600f60205260409020546001600160a01b0390811691161461181d576000828152600f60205260408120546010546001600160a01b0390911690612710906117c290476123ba565b6117cc9190612408565b604051600081818185875af1925050503d8060008114611808576040519150601f19603f3d011682016040523d82523d6000602084013e61180d565b606091505b505090508061181b57600080fd5b505b6003546040516000916001600160a01b03169047908381818185875af1925050503d806000811461186a576040519150601f19603f3d011682016040523d82523d6000602084013e61186f565b606091505b505090508061187d57600080fd5b60025460405163133f311360e31b8152336004820152602481018990526001600160a01b03909116906399f9889890604401600060405180830381600087803b1580156118c957600080fd5b505af11580156118dd573d6000803e3d6000fd5b5050505050505050505050565b60008051602061253d83398151915261190281611d28565b50600655565b611910611e04565b61191a6000611e74565b565b60008051602061253d83398151915261193481611d28565b50600455565b60008051602061253d83398151915261195281611d28565b81158061195f5750816001145b6119a35760405162461bcd60e51b815260206004820152601560248201527420b63637bb903634b9ba103a3cb8329032b93937b960591b6044820152606401610c68565b50600a55565b60008051602061253d8339815191526119c181611d28565b5060098054911515620100000262ff000019909216919091179055565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061253d833981519152611a2181611d28565b50600755565b60008051602061253d833981519152611a3f81611d28565b50600855565b60008051602061253d833981519152611a5d81611d28565b506009805460ff1916911515919091179055565b60008281526001602081905260409091200154611a8d81611d28565b610bf78383611d9d565b60008051602061253d833981519152611aaf81611d28565b50600c55565b60008051602061253d833981519152611acd81611d28565b506009805491151563010000000263ff00000019909216919091179055565b611af4611e04565b6001600160a01b038116611b595760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c68565b610d1181611e74565b6060610aeb6001600160a01b03831660145b60606000611b838360026123ba565b611b8e9060026123a7565b67ffffffffffffffff811115611ba657611ba661213e565b6040519080825280601f01601f191660200182016040528015611bd0576020820181803683370190505b509050600360fc1b81600081518110611beb57611beb61242a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611c1a57611c1a61242a565b60200101906001600160f81b031916908160001a9053506000611c3e8460026123ba565b611c499060016123a7565b90505b6001811115611cc1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611c7d57611c7d61242a565b1a60f81b828281518110611c9357611c9361242a565b60200101906001600160f81b031916908160001a90535060049490941c93611cba81612459565b9050611c4c565b508315611d105760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c68565b9392505050565b60006004546001610ab591906123a7565b610d118133611ec4565b611d3c82826119de565b610c7b5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b611da782826119de565b15610c7b5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000546001600160a01b0316331461191a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c68565b600082611e6b8584611f1d565b14949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611ece82826119de565b610c7b57611edb81611b62565b611ee6836020611b74565b604051602001611ef7929190612494565b60408051601f198184030181529082905262461bcd60e51b8252610c6891600401612509565b600081815b8451811015611f6257611f4e82868381518110611f4157611f4161242a565b6020026020010151611f6a565b915080611f5a81612440565b915050611f22565b509392505050565b6000818310611f86576000828152602084905260409020611d10565b6000838152602083905260409020611d10565b600060208284031215611fab57600080fd5b81356001600160e01b031981168114611d1057600080fd5b600060208284031215611fd557600080fd5b5035919050565b600060208284031215611fee57600080fd5b81358015158114611d1057600080fd5b6000806040838503121561201157600080fd5b50508035926020909101359150565b80356001600160a01b038116811461203757600080fd5b919050565b6000806040838503121561204f57600080fd5b8235915061205f60208401612020565b90509250929050565b60006020828403121561207a57600080fd5b611d1082612020565b60008083601f84011261209557600080fd5b50813567ffffffffffffffff8111156120ad57600080fd5b6020830191508360208260051b85010111156120c857600080fd5b9250929050565b60008060008060008060a087890312156120e857600080fd5b8635955060208701359450604087013567ffffffffffffffff81111561210d57600080fd5b61211989828a01612083565b9095509350506060870135915061213260808801612020565b90509295509295509295565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561217d5761217d61213e565b604052919050565b600067ffffffffffffffff82111561219f5761219f61213e565b5060051b60200190565b600082601f8301126121ba57600080fd5b813560206121cf6121ca83612185565b612154565b82815260059290921b840181019181810190868411156121ee57600080fd5b8286015b8481101561220957803583529183019183016121f2565b509695505050505050565b60008060006060848603121561222957600080fd5b8335925060208085013567ffffffffffffffff8082111561224957600080fd5b818701915087601f83011261225d57600080fd5b813561226b6121ca82612185565b81815260059190911b8301840190848101908a83111561228a57600080fd5b938501935b828510156122af576122a085612020565b8252938501939085019061228f565b9650505060408701359250808311156122c757600080fd5b50506122d5868287016121a9565b9150509250925092565b6000806000806000608086880312156122f757600080fd5b8535945060208601359350604086013567ffffffffffffffff81111561231c57600080fd5b61232888828901612083565b96999598509660600135949350505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610aeb57610aeb61233a565b60208082526024908201527f6d6178206d696e7420616d6f756e74207065722073657373696f6e20657863656040820152631959195960e21b606082015260800190565b80820180821115610aeb57610aeb61233a565b8082028115828204841417610aeb57610aeb61233a565b60208082526017908201527f75736572206973206e6f7420616c6c6f776c6973746564000000000000000000604082015260600190565b60008261242557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000600182016124525761245261233a565b5060010190565b6000816124685761246861233a565b506000190190565b60005b8381101561248b578181015183820152602001612473565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516124cc816017850160208801612470565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516124fd816028840160208801612470565b01602801949350505050565b6020815260008251806020840152612528816040850160208701612470565b601f01601f1916919091016040019291505056fedf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec42a2646970667358221220d1e230792f61c8018d84445382e3834c0bf8ae311183a15db36cd2bf5673ae6764736f6c63430008120033df8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec42

Deployed Bytecode

0x60806040526004361061034e5760003560e01c8063674c02aa116101c6578063a9e2acd5116100f7578063d539139311610095578063d728312a1161006f578063d728312a14610a07578063e39e026914610a27578063f2fde38b14610a47578063f48824db14610a6757600080fd5b8063d53913931461099d578063d547741f146109d1578063d5abeb01146109f157600080fd5b8063bedb86fb116100d1578063bedb86fb1461090d578063c4d1510d1461092d578063c84c038714610943578063d04f32d21461095957600080fd5b8063a9e2acd5146108b7578063b5f94d06146108d7578063bbb89744146108f757600080fd5b80637ee3b2ac1161016457806391d148541161013e57806391d148541461084c5780639659867e1461086c578063a217fddf1461088c578063a72193b6146108a157600080fd5b80637ee3b2ac146107ee5780638da5cb5b1461080e5780638e73cf001461082c57600080fd5b8063715018a6116101a0578063715018a61461078357806373ef64fd1461079857806378b2e3a9146107ae5780637b9757db146107ce57600080fd5b8063674c02aa146107315780636b1a2b7f146107505780636f8b44b01461076357600080fd5b80632d380242116102a057806344a0d68a1161023e578063499a15d411610218578063499a15d41461069f5780634e6bf204146106d7578063537782a2146106f75780635c975abb1461071757600080fd5b806344a0d68a1461062857806347705cbc1461064857806347b174421461068c57600080fd5b806336568abe1161027a57806336568abe146105b35780633ab1a494146105d35780633c70b357146105f35780633ccfd60b1461062057600080fd5b80632d3802421461053a5780632f2ff15d146105505780633511cd541461057057600080fd5b806317dc10c41161030d5780631bb25016116102e75780631bb25016146104a7578063248a9ca3146104c75780632a0acc6a146104f85780632b4fd7791461051a57600080fd5b806317dc10c41461045057806318160ddd1461047257806318712c211461048757600080fd5b806285bb6f146103535780629a9b7b1461038957806301ffc9a7146103ac578063036eaf66146103cc57806313faede61461041a5780631581b60014610430575b600080fd5b34801561035f57600080fd5b50600954610374906301000000900460ff1681565b60405190151581526020015b60405180910390f35b34801561039557600080fd5b5061039e610a9f565b604051908152602001610380565b3480156103b857600080fd5b506103746103c7366004611f99565b610aba565b3480156103d857600080fd5b506104026103e7366004611fc3565b600f602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610380565b34801561042657600080fd5b5061039e60055481565b34801561043c57600080fd5b50600354610402906001600160a01b031681565b34801561045c57600080fd5b5061047061046b366004611fdc565b610af1565b005b34801561047e57600080fd5b5060045461039e565b34801561049357600080fd5b506104706104a2366004611ffe565b610b24565b3480156104b357600080fd5b506104706104c236600461203c565b610b4f565b3480156104d357600080fd5b5061039e6104e2366004611fc3565b6000908152600160208190526040909120015490565b34801561050457600080fd5b5061039e60008051602061253d83398151915281565b34801561052657600080fd5b50610470610535366004612068565b610b96565b34801561054657600080fd5b5061039e60045481565b34801561055c57600080fd5b5061047061056b36600461203c565b610bd1565b34801561057c57600080fd5b5061039e61058b36600461203c565b6000918252600d602090815260408084206001600160a01b0393909316845291905290205490565b3480156105bf57600080fd5b506104706105ce36600461203c565b610bfc565b3480156105df57600080fd5b506104706105ee366004612068565b610c7f565b3480156105ff57600080fd5b5061039e61060e366004611fc3565b600b6020526000908152604090205481565b610470610ca9565b34801561063457600080fd5b50610470610643366004611fc3565b610d14565b34801561065457600080fd5b5061039e610663366004612068565b600c546000908152600d602090815260408083206001600160a01b039094168352929052205490565b61047061069a3660046120cf565b610d32565b3480156106ab57600080fd5b5061039e6106ba36600461203c565b600e60209081526000928352604080842090915290825290205481565b3480156106e357600080fd5b506104706106f2366004612214565b6112cc565b34801561070357600080fd5b50610470610712366004611fc3565b611385565b34801561072357600080fd5b506009546103749060ff1681565b34801561073d57600080fd5b5060095461037490610100900460ff1681565b61047061075e3660046122df565b6113a3565b34801561076f57600080fd5b5061047061077e366004611fc3565b6118ea565b34801561078f57600080fd5b50610470611908565b3480156107a457600080fd5b5061039e60085481565b3480156107ba57600080fd5b50600254610402906001600160a01b031681565b3480156107da57600080fd5b506104706107e9366004611fc3565b61191c565b3480156107fa57600080fd5b50610470610809366004611fc3565b61193a565b34801561081a57600080fd5b506000546001600160a01b0316610402565b34801561083857600080fd5b50610470610847366004611fdc565b6119a9565b34801561085857600080fd5b5061037461086736600461203c565b6119de565b34801561087857600080fd5b506009546103749062010000900460ff1681565b34801561089857600080fd5b5061039e600081565b3480156108ad57600080fd5b5061039e600a5481565b3480156108c357600080fd5b506104706108d2366004611fc3565b611a09565b3480156108e357600080fd5b506104706108f2366004611fc3565b611a27565b34801561090357600080fd5b5061039e60075481565b34801561091957600080fd5b50610470610928366004611fdc565b611a45565b34801561093957600080fd5b5061039e60105481565b34801561094f57600080fd5b5061039e600c5481565b34801561096557600080fd5b5061039e610974366004612068565b600c546000908152600e602090815260408083206001600160a01b039094168352929052205490565b3480156109a957600080fd5b5061039e7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b3480156109dd57600080fd5b506104706109ec36600461203c565b611a71565b3480156109fd57600080fd5b5061039e60065481565b348015610a1357600080fd5b50610470610a22366004611fc3565b611a97565b348015610a3357600080fd5b50610470610a42366004611fdc565b611ab5565b348015610a5357600080fd5b50610470610a62366004612068565b611aec565b348015610a7357600080fd5b5061039e610a8236600461203c565b600d60209081526000928352604080842090915290825290205481565b60006001610aab611d17565b610ab59190612350565b905090565b60006001600160e01b03198216637965db0b60e01b1480610aeb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008051602061253d833981519152610b0981611d28565b50600980549115156101000261ff0019909216919091179055565b60008051602061253d833981519152610b3c81611d28565b506000918252600b602052604090912055565b60008051602061253d833981519152610b6781611d28565b506000918252600f602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b60008051602061253d833981519152610bae81611d28565b50600280546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610bed81611d28565b610bf78383611d32565b505050565b6001600160a01b0381163314610c715760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610c7b8282611d9d565b5050565b610c87611e04565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b610cb1611e04565b6003546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610cfe576040519150601f19603f3d011682016040523d82523d6000602084013e610d03565b606091505b5050905080610d1157600080fd5b50565b60008051602061253d833981519152610d2c81611d28565b50600555565b323314610d815760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163742e006044820152606401610c68565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610dab81611d28565b60095460ff1615610df75760405162461bcd60e51b81526020600482015260166024820152751d1a194818dbdb9d1c9858dd081a5cc81c185d5cd95960521b6044820152606401610c68565b86600010610e475760405162461bcd60e51b815260206004820152601b60248201527f6e65656420746f206d696e74206174206c656173742031204e465400000000006044820152606401610c68565b600754871115610e695760405162461bcd60e51b8152600401610c6890612363565b600654600188610e77611d17565b610e8191906123a7565b610e8b9190612350565b1115610ed25760405162461bcd60e51b81526020600482015260166024820152751b585e08139195081b1a5b5a5d08195e18d95959195960521b6044820152606401610c68565b3487600554610ee191906123ba565b1115610f245760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b6044820152606401610c68565b600954600090610100900460ff16151560010361106b57600a54600003610ff6576040516bffffffffffffffffffffffff19606085901b16602082015260348101889052600090605401604051602081830303815290604052805190602001209050610fd187878080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508a8152600b60205260409020549250859150611e5e9050565b610fed5760405162461bcd60e51b8152600401610c68906123d1565b87915050611070565b600a54600103611066576000848152600e602090815260408083206001600160a01b038716845290915281205490036110415760405162461bcd60e51b8152600401610c68906123d1565b506000838152600e602090815260408083206001600160a01b03861684529091529020545b611070565b506008545b60095462010000900460ff161515600103611139576000848152600d602090815260408083206001600160a01b03871684529091529020546110b29082612350565b8811156111015760405162461bcd60e51b815260206004820152601c60248201527f6d6178204e4654207065722061646472657373206578636565646564000000006044820152606401610c68565b6000848152600d602090815260408083206001600160a01b0387168452909152812080548a92906111339084906123a7565b90915550505b876004600082825461114b91906123a7565b90915550506011546000858152600f60205260409020546001600160a01b039081169116146111fb576000848152600f60205260408120546010546001600160a01b0390911690612710906111a090476123ba565b6111aa9190612408565b604051600081818185875af1925050503d80600081146111e6576040519150601f19603f3d011682016040523d82523d6000602084013e6111eb565b606091505b50509050806111f957600080fd5b505b6003546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611248576040519150601f19603f3d011682016040523d82523d6000602084013e61124d565b606091505b505090508061125b57600080fd5b60025460405163133f311360e31b81526001600160a01b038681166004830152602482018c9052909116906399f9889890604401600060405180830381600087803b1580156112a957600080fd5b505af11580156112bd573d6000803e3d6000fd5b50505050505050505050505050565b60008051602061253d8339815191526112e481611d28565b81518351146112f257600080fd5b60005b835181101561137e578281815181106113105761131061242a565b6020026020010151600e6000878152602001908152602001600020600086848151811061133f5761133f61242a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061137690612440565b9150506112f5565b5050505050565b60008051602061253d83398151915261139d81611d28565b50601055565b3233146113f25760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163742e006044820152606401610c68565b60095460ff161561143e5760405162461bcd60e51b81526020600482015260166024820152751d1a194818dbdb9d1c9858dd081a5cc81c185d5cd95960521b6044820152606401610c68565b8460001061148e5760405162461bcd60e51b815260206004820152601b60248201527f6e65656420746f206d696e74206174206c656173742031204e465400000000006044820152606401610c68565b6007548511156114b05760405162461bcd60e51b8152600401610c6890612363565b6006546001866114be611d17565b6114c891906123a7565b6114d29190612350565b11156115195760405162461bcd60e51b81526020600482015260166024820152751b585e08139195081b1a5b5a5d08195e18d95959195960521b6044820152606401610c68565b348560055461152891906123ba565b111561156b5760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b6044820152606401610c68565b600954600090610100900460ff16151560010361169f57600a5460000361163c576040516bffffffffffffffffffffffff193360601b166020820152603481018690526000906054016040516020818303038152906040528051906020012090506116178585808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250888152600b60205260409020549250859150611e5e9050565b6116335760405162461bcd60e51b8152600401610c68906123d1565b859150506116a4565b600a5460010361169a576000828152600e60209081526040808320338452909152812054900361167e5760405162461bcd60e51b8152600401610c68906123d1565b506000818152600e602090815260408083203384529091529020545b6116a4565b506008545b60095462010000900460ff16151560010361175b576000828152600d602090815260408083203384529091529020546116dd9082612350565b86111561172c5760405162461bcd60e51b815260206004820152601c60248201527f6d6178204e4654207065722061646472657373206578636565646564000000006044820152606401610c68565b6000828152600d60209081526040808320338452909152812080548892906117559084906123a7565b90915550505b856004600082825461176d91906123a7565b90915550506011546000838152600f60205260409020546001600160a01b0390811691161461181d576000828152600f60205260408120546010546001600160a01b0390911690612710906117c290476123ba565b6117cc9190612408565b604051600081818185875af1925050503d8060008114611808576040519150601f19603f3d011682016040523d82523d6000602084013e61180d565b606091505b505090508061181b57600080fd5b505b6003546040516000916001600160a01b03169047908381818185875af1925050503d806000811461186a576040519150601f19603f3d011682016040523d82523d6000602084013e61186f565b606091505b505090508061187d57600080fd5b60025460405163133f311360e31b8152336004820152602481018990526001600160a01b03909116906399f9889890604401600060405180830381600087803b1580156118c957600080fd5b505af11580156118dd573d6000803e3d6000fd5b5050505050505050505050565b60008051602061253d83398151915261190281611d28565b50600655565b611910611e04565b61191a6000611e74565b565b60008051602061253d83398151915261193481611d28565b50600455565b60008051602061253d83398151915261195281611d28565b81158061195f5750816001145b6119a35760405162461bcd60e51b815260206004820152601560248201527420b63637bb903634b9ba103a3cb8329032b93937b960591b6044820152606401610c68565b50600a55565b60008051602061253d8339815191526119c181611d28565b5060098054911515620100000262ff000019909216919091179055565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60008051602061253d833981519152611a2181611d28565b50600755565b60008051602061253d833981519152611a3f81611d28565b50600855565b60008051602061253d833981519152611a5d81611d28565b506009805460ff1916911515919091179055565b60008281526001602081905260409091200154611a8d81611d28565b610bf78383611d9d565b60008051602061253d833981519152611aaf81611d28565b50600c55565b60008051602061253d833981519152611acd81611d28565b506009805491151563010000000263ff00000019909216919091179055565b611af4611e04565b6001600160a01b038116611b595760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c68565b610d1181611e74565b6060610aeb6001600160a01b03831660145b60606000611b838360026123ba565b611b8e9060026123a7565b67ffffffffffffffff811115611ba657611ba661213e565b6040519080825280601f01601f191660200182016040528015611bd0576020820181803683370190505b509050600360fc1b81600081518110611beb57611beb61242a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611c1a57611c1a61242a565b60200101906001600160f81b031916908160001a9053506000611c3e8460026123ba565b611c499060016123a7565b90505b6001811115611cc1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611c7d57611c7d61242a565b1a60f81b828281518110611c9357611c9361242a565b60200101906001600160f81b031916908160001a90535060049490941c93611cba81612459565b9050611c4c565b508315611d105760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c68565b9392505050565b60006004546001610ab591906123a7565b610d118133611ec4565b611d3c82826119de565b610c7b5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b611da782826119de565b15610c7b5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000546001600160a01b0316331461191a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c68565b600082611e6b8584611f1d565b14949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611ece82826119de565b610c7b57611edb81611b62565b611ee6836020611b74565b604051602001611ef7929190612494565b60408051601f198184030181529082905262461bcd60e51b8252610c6891600401612509565b600081815b8451811015611f6257611f4e82868381518110611f4157611f4161242a565b6020026020010151611f6a565b915080611f5a81612440565b915050611f22565b509392505050565b6000818310611f86576000828152602084905260409020611d10565b6000838152602083905260409020611d10565b600060208284031215611fab57600080fd5b81356001600160e01b031981168114611d1057600080fd5b600060208284031215611fd557600080fd5b5035919050565b600060208284031215611fee57600080fd5b81358015158114611d1057600080fd5b6000806040838503121561201157600080fd5b50508035926020909101359150565b80356001600160a01b038116811461203757600080fd5b919050565b6000806040838503121561204f57600080fd5b8235915061205f60208401612020565b90509250929050565b60006020828403121561207a57600080fd5b611d1082612020565b60008083601f84011261209557600080fd5b50813567ffffffffffffffff8111156120ad57600080fd5b6020830191508360208260051b85010111156120c857600080fd5b9250929050565b60008060008060008060a087890312156120e857600080fd5b8635955060208701359450604087013567ffffffffffffffff81111561210d57600080fd5b61211989828a01612083565b9095509350506060870135915061213260808801612020565b90509295509295509295565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561217d5761217d61213e565b604052919050565b600067ffffffffffffffff82111561219f5761219f61213e565b5060051b60200190565b600082601f8301126121ba57600080fd5b813560206121cf6121ca83612185565b612154565b82815260059290921b840181019181810190868411156121ee57600080fd5b8286015b8481101561220957803583529183019183016121f2565b509695505050505050565b60008060006060848603121561222957600080fd5b8335925060208085013567ffffffffffffffff8082111561224957600080fd5b818701915087601f83011261225d57600080fd5b813561226b6121ca82612185565b81815260059190911b8301840190848101908a83111561228a57600080fd5b938501935b828510156122af576122a085612020565b8252938501939085019061228f565b9650505060408701359250808311156122c757600080fd5b50506122d5868287016121a9565b9150509250925092565b6000806000806000608086880312156122f757600080fd5b8535945060208601359350604086013567ffffffffffffffff81111561231c57600080fd5b61232888828901612083565b96999598509660600135949350505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610aeb57610aeb61233a565b60208082526024908201527f6d6178206d696e7420616d6f756e74207065722073657373696f6e20657863656040820152631959195960e21b606082015260800190565b80820180821115610aeb57610aeb61233a565b8082028115828204841417610aeb57610aeb61233a565b60208082526017908201527f75736572206973206e6f7420616c6c6f776c6973746564000000000000000000604082015260600190565b60008261242557634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000600182016124525761245261233a565b5060010190565b6000816124685761246861233a565b506000190190565b60005b8381101561248b578181015183820152602001612473565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516124cc816017850160208801612470565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516124fd816028840160208801612470565b01602801949350505050565b6020815260008251806020840152612528816040850160208701612470565b601f01601f1916919091016040019291505056fedf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec42a2646970667358221220d1e230792f61c8018d84445382e3834c0bf8ae311183a15db36cd2bf5673ae6764736f6c63430008120033

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  ]
[ 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.