ETH Price: $3,444.68 (+3.39%)

Contract

0xf797cA03e6E6bE3f1a52c68c1662D8fcE2B839B9
 

Overview

ETH Balance

0.85 ETH

Eth Value

$2,927.98 (@ $3,444.68/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...195434422024-03-30 1:14:35293 days ago1711761275IN
0xf797cA03...cE2B839B9
0 ETH0.000543322.45538682
Claim Loot173021692023-05-20 17:37:59607 days ago1684604279IN
0xf797cA03...cE2B839B9
0 ETH0.0066659959.86040278
Claim Loot169237572023-03-28 5:26:35661 days ago1679981195IN
0xf797cA03...cE2B839B9
0 ETH0.0019869220.17817503
Claim Loot169169372023-03-27 6:28:35662 days ago1679898515IN
0xf797cA03...cE2B839B9
0 ETH0.0016245816.91449564
Claim Loot169059252023-03-25 17:20:59663 days ago1679764859IN
0xf797cA03...cE2B839B9
0 ETH0.0030738532.24643756
Claim Loot169059182023-03-25 17:19:35663 days ago1679764775IN
0xf797cA03...cE2B839B9
0 ETH0.0031264831.99369643
New Loot Root168589022023-03-19 2:49:47670 days ago1679194187IN
0xf797cA03...cE2B839B9
0 ETH0.0006367412.01449869
Forge167212142023-02-27 18:08:23689 days ago1677521303IN
0xf797cA03...cE2B839B9
0.025 ETH0.0020914825.93703418
Tutorial167119072023-02-26 10:46:23691 days ago1677408383IN
0xf797cA03...cE2B839B9
0 ETH0.001991418.59158996
Claim Loot165570902023-02-04 18:04:59712 days ago1675533899IN
0xf797cA03...cE2B839B9
0 ETH0.0022175922.68986342
Claim Loot165535362023-02-04 6:08:59713 days ago1675490939IN
0xf797cA03...cE2B839B9
0 ETH0.0026262623.51704824
Tutorial164568862023-01-21 18:11:35726 days ago1674324695IN
0xf797cA03...cE2B839B9
0 ETH0.0019791418.47713665
Claim Loot164568542023-01-21 18:05:11726 days ago1674324311IN
0xf797cA03...cE2B839B9
0 ETH0.0021511318.76883882
Claim Loot164568522023-01-21 18:04:47726 days ago1674324287IN
0xf797cA03...cE2B839B9
0 ETH0.0017634818.98016526
Claim Loot164395772023-01-19 8:11:47729 days ago1674115907IN
0xf797cA03...cE2B839B9
0 ETH0.0018953615.71321993
Claim Loot164388712023-01-19 5:49:35729 days ago1674107375IN
0xf797cA03...cE2B839B9
0 ETH0.0019395816.92099158
Claim Loot164382042023-01-19 3:35:47729 days ago1674099347IN
0xf797cA03...cE2B839B9
0 ETH0.0023699321.58860006
Claim Loot164381182023-01-19 3:18:35729 days ago1674098315IN
0xf797cA03...cE2B839B9
0 ETH0.0021459120.44117505
Claim Loot164379302023-01-19 2:40:35729 days ago1674096035IN
0xf797cA03...cE2B839B9
0 ETH0.0022753219.85626017
Claim Loot164378312023-01-19 2:20:47729 days ago1674094847IN
0xf797cA03...cE2B839B9
0 ETH0.0022865719.95037199
New Loot Root164082562023-01-14 23:13:47733 days ago1673738027IN
0xf797cA03...cE2B839B9
0 ETH0.0016251330.66404755
Forge163250812023-01-03 8:31:59745 days ago1672734719IN
0xf797cA03...cE2B839B9
0.025 ETH0.000994315.64919134
Tutorial162300792022-12-21 2:25:59758 days ago1671589559IN
0xf797cA03...cE2B839B9
0 ETH0.0014407316.00590372
Claim Loot162060852022-12-17 18:03:23761 days ago1671300203IN
0xf797cA03...cE2B839B9
0 ETH0.0013625614.66500806
Claim Loot162058522022-12-17 17:16:47761 days ago1671297407IN
0xf797cA03...cE2B839B9
0 ETH0.0013493614.79356668
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EverLoot

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 17 : EverLoot.sol
// SPDX-License-Identifier: MIT
// 
// Made with love from @muddotxyz 
// @author st4rgard3n @KyleSt4rgarden @c0mput3rxz @gvanderest

// '||''''|                           '||                    .   
//  ||  .    .... ...   ....  ... ..   ||    ...     ...   .||.  
//  ||''|     '|.  |  .|...||  ||' ''  ||  .|  '|. .|  '|.  ||   
//  ||         '|.|   ||       ||      ||  ||   || ||   ||  ||   
// .||.....|    '|     '|...' .||.    .||.  '|..|'  '|..|'  '|.' 

pragma solidity ^0.8.2;

import "./Parents/ERC721A.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

// @todo Edit price just prior to launch
contract EverLoot is ERC721A, AccessControl, ReentrancyGuard {

    bytes32 public constant ROOT_ROLE = keccak256("ROOT_ROLE");
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");

    // max number of EverLoot that can be minted per call
    uint public constant MAXMINT = 10;

    // the Heroes of Evermore contract
    IERC721 public constant HEROES = IERC721(0xf1eF40f5aEa5D1501C1B8BCD216CF305764fca40);

    /*************************
     MAPPING STRUCTS EVENTS
     *************************/

    // tracks the merkle roots for each loot claim
    mapping(uint => bytes32) private _lootRoots;

    // tracks if user has claimed loot for a particular root
    mapping(address => mapping(uint => uint)) private _claimedLoot;

    // tracks if user has claimed prizes for a particular root
    mapping(address => mapping(uint => uint)) private _claimedPrize;

    // tracks if a user has completed the tutorial with this token
    mapping(address => mapping(uint => bool)) public _tutorialClaimed;

    // tracks a full bulk claim
    event ClaimLoot(address indexed to, uint256[] indexed indexedUniqueItemIds, uint256 indexed startingTokenId, uint256[] uniqueItemIds);

    // tracks a full prize claim
    event ClaimPrize(address indexed to, uint[] tokenIds, address[] tokenAddresses);

    // tracks a forged loot chunk
    event Forge(address indexed to, uint256 indexed amount, uint256 indexed startingTokenId, string forgeType);

    // tracks the promotion of claims on chain
    event PromoteClaims(uint rootIndex, bytes32 lootRoot);

    /*************************
     STATE VARIABLES
     *************************/

    // price of each EverLoot token
    uint private _price = 0.025 ether;
    // pauses minting when true
    bool private _paused = true;
    // increments when a weekly lootRoot is written
    uint private _rootIndex = 0;
    // baseURI for accessing token metadata
    string private _baseTokenURI;

    constructor() ERC721A("EverLoot", "EVER") {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(ROOT_ROLE, msg.sender);
        _baseTokenURI = "https://api.evermore.mud.xyz/everloot/";
    }


    /*************************
     MODIFIERS
     *************************/

    /**
    * @dev Modifier for preventing calls from contracts
    * Safety feature for preventing malicious contract call backs
    */
    modifier callerIsUser() {
        require(tx.origin == msg.sender, "The caller is another contract!");
        _;
    }

    /**
    * @dev Modifier for preventing function calls
    * Safety feature that enforces the _paused
    */
    modifier notPaused() {
        require(!_paused, "Minting is paused!");
        _;
    }


    /*************************
     VIEW AND PURE FUNCTIONS
     *************************/

    /**
    * @dev Helper function for validating a merkle proof and leaf
    * @param merkleProof is an array of proofs needed to authenticate a transaction
    * @param root is used along with proofs and our leaf to authenticate our transaction
    * @param leaf is generated from parameter data which can be enforced
    */
    function verifyClaim(
        bytes32[] memory merkleProof,
        bytes32 root,
        bytes32 leaf
    )
        public
        pure
        returns (bool valid)
    {
        return MerkleProof.verify(merkleProof, root, leaf);
    }

    /**
    * @dev Internal function for returning the token URI
    * wrapped with showBaseUri
    */
    function _baseURI() internal view virtual override returns (string memory) {
    return _baseTokenURI;
  }

    /**
    * @dev Public function for returning the base token URI
    * wraps _baseURI() function
    */
    function returnBaseURI() public view returns (string memory) {
    return _baseURI();
  }

    /**
    * @dev Public function for returning the price
    * wraps _price state variable
    */
    function getPrice() public view returns (uint price) {
        return _price;
    }

    /**
    * @dev Public function for returning the current root index
    * wraps _rootIndex state variable
    */
    function getRootIndex() public view returns (uint rootIndex) {
        return _rootIndex;
    }

    /**
    * @dev Public function for returning if a user has already claimed
    * @param claimedIndex the _claimedLoot index to check
    * @param user the user address to check
    * wraps _claimedLoot mapping
    */
    function getClaimStatus(uint claimedIndex, address user)
        public
        view
        returns (uint status) {
        return _claimedLoot[user][claimedIndex];
    }

    /**
    * @dev Public function for returning if a user has already completed the tutorial for this character
    * @param characterId the token id of the character to check
    * @param user the user address to check
    * wraps _tutorialClaimed mapping
    */
    function getTutorialStatus(uint characterId, address user)
    public
    view
    returns (bool status) {
        return _tutorialClaimed[user][characterId];
    }

    /**
    * @dev Public function for returning the pause status
    * helper function for front end consumption
    */
    function isPaused() public view returns (bool) {
        return _paused;
    }

    /*************************
     USER FUNCTIONS
     *************************/

    /**
    * @dev claims all earned NFTs for a specific claim period
    * @param to is the address which receives minted tokens
    * @param rootId is used to determine which loot root we access
    * @param uniqueItemIds is the array of items the user is claiming
    * @param merkleProof is an array of proofs needed to authenticate a transaction
    */
    function claimLoot(
        address to,
        uint256 rootId,
        uint256[] calldata uniqueItemIds,
        bytes32[] calldata merkleProof
    )
        external callerIsUser notPaused {

        // require that user is claiming less than 10
        require(uniqueItemIds.length <= MAXMINT, "Must not claim more than MAXMINT!");

        // require that user hasn't already claimed these items
        require(_claimedLoot[to][rootId] == 0, "Already claimed items!");

        // build our leaf from the recipient address and the hash of unique item ids
        bytes32 leaf = keccak256(abi.encodePacked(to, uniqueItemIds));

        // authenticate and enforce the correct unique item ids for the correct user
        require(verifyClaim(merkleProof, _lootRoots[rootId], leaf), "Incorrect merkle proof!");

        // set the claimed status for user
        _claimedLoot[to][rootId] = 1;

        // indexed data for assigning unique item id's metadata to the correct token id
        emit ClaimLoot(to, uniqueItemIds, _currentIndex, uniqueItemIds);

        // mint the new loot token's to user
        _safeMint(to, uniqueItemIds.length);
    }

    /**
    * @dev claims all prize NFTs for a specific claim period
    * @param to is the address which receives minted tokens
    * @param rootId is used to determine which loot root we access
    * @param tokenIds is the array of items the user is claiming
    * @param tokenAddresses is the array of NFT contract addresses
    * @param merkleProof is an array of proof needed to authenticate a transaction
    */
    function claimPrize(
        address to,
        uint rootId,
        uint[] calldata tokenIds,
        address[] calldata tokenAddresses,
        bytes32[] calldata merkleProof
    )
        external callerIsUser notPaused {

        // require that user hasn't already claimed these prizes
        require(_claimedPrize[to][rootId] == 0, "Already claimed items!");

        // require that our array lengths match
        require(tokenIds.length == tokenAddresses.length, "Arrays don't match!");

        // build our leaf from the user address, token Ids and token contract addresses
        bytes32 leaf = keccak256(abi.encodePacked(to, tokenIds, tokenAddresses));

        // authenticate and enforce the correct token ids, contracts and user user
        require(verifyClaim(merkleProof, _lootRoots[rootId], leaf), "Incorrect merkle proof!");

        // set the claimed status for user
        _claimedPrize[to][rootId] = 1;

        // log data for user claiming which tokens and collection
        emit ClaimPrize(to, tokenIds, tokenAddresses);

        for (uint256 i; i < tokenIds.length; i++) {

            // instantiate an interface for the ERC721 prize contract
            IERC721 prizeContract = IERC721(tokenAddresses[i]);

            // transfer token to prize winner
            prizeContract.transferFrom(address(this), to, tokenIds[i]);
        }

    }

    /**
    * @dev Forges new EverLoot tokens to the function caller
    * @param amount the number of tokens to forge
    */
    function forge(uint amount)
    external payable callerIsUser notPaused {

        // require that user is claiming less than 10
        require(amount <= MAXMINT, "Must not claim more than MAXMINT!");

        // require the correct amount of ETH is sent
        require(msg.value == amount * _price, "Must send exact ETH!");

        // emit data for generating loot tokens
        emit Forge(_msgSender(), amount, _currentIndex, "forge");

        // mints the new tokens to the user
        _safeMint(_msgSender(), amount);

    }

    /**
    * @dev Forges new EverLoot tokens to the function caller
    * @param tokenId The Heroes of Evermore character minting the token
    */
    function tutorial(uint tokenId)
    external callerIsUser notPaused {

        // require that user is claiming less than 10
        require(!getTutorialStatus(tokenId, _msgSender()), "Already claimed tutorial gear!");

        // require that the user owns the hero they are claiming
        require(HEROES.ownerOf(tokenId) == _msgSender(), "Doesn't own the hero!");

        // emit data for generating loot tokens
        emit Forge(_msgSender(), 1, _currentIndex, "tutorial");

        // mark user as claiming for this tokenId
        _tutorialClaimed[_msgSender()][tokenId] = true;

        // mints the new tokens to the user
        _safeMint(_msgSender(), 1);

    }

    /*************************
     ACCESS CONTROL FUNCTIONS
     *************************/

    /**
    * @dev Access control function allows Battle for Evermore to post new root hashes
    * @param newIndex the new index of our loot root mapping
    * @param newRoot the new merkle root to be stored on chain
    */
    function newLootRoot(
        uint newIndex,
        bytes32 newRoot
    )
        external onlyRole(ROOT_ROLE) {

        // enforces that we aren't rewriting merkle roots
        require(newIndex == _rootIndex + 1, "Cannot rewrite an older root!");

        // update the root index to the new root index
        _rootIndex = newIndex;

        // set the new root within the loot roots mapping
        _lootRoots[_rootIndex] = newRoot;

        // log the new loot root data
        emit PromoteClaims(newIndex, newRoot);
    }

    /**
    * @dev Forges new EverLoot tokens to the function caller
    * @param amount the number of tokens to forge
    */
    function specialForge(address to, uint amount, string calldata forgeType)
    external onlyRole(MINTER_ROLE) notPaused {

        // require that user is claiming less than 10
        require(amount <= MAXMINT, "Must not claim more than MAXMINT!");

        // emit data for generating loot tokens
        emit Forge(to, amount, _currentIndex, forgeType);

        // mints the new tokens to the user
        _safeMint(to, amount);

    }

    /**
    * @dev Access control function allows PAUSER_ROLE to toggle _paused flag
    * @param setPaused the new status of the paused variable
    */
    function setPause(
        bool setPaused
    )
        external onlyRole(PAUSER_ROLE) {
        _paused = setPaused;
    }

    /**
    * @dev Access control function allows DEFAULT_ADMIN_ROLE to change the URI
    * @param newBaseURI the new base token URI
    */
    function setBaseURI(string calldata newBaseURI)
        external
        onlyRole(DEFAULT_ADMIN_ROLE) {
        _baseTokenURI = newBaseURI;
    }

    /**
    * @dev Access control function allows DEFAULT_ADMIN_ROLE to withdraw ETH
    */
    function withdrawAll()
        external
        nonReentrant
        onlyRole(DEFAULT_ADMIN_ROLE) {

        // transfer contract's balance to the multi-sig
        (bool success, ) = msg.sender.call{value: address(this).balance}("");

        // revert if transfer fails
        require(success, "Transfer failed.");
  }

    /*************************
     OVERRIDES
     *************************/

    // required by Solidity
    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721A, AccessControl)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

    /**
     * Change the starting tokenId to 1
     */
    function _startTokenId()
    internal
    pure
    override(ERC721A) returns (uint256) {
        return 1;
    }

}

File 2 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 3 of 17 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 17 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * 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.
 */
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 proved to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * _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}
     *
     * _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 the sibling nodes in `proof`,
     * consuming from one or the other at each step according to the instructions given by
     * `proofFlags`.
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild 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 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 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 for 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) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild 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 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 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 for 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) {
            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 5 of 17 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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:
 *
 * ```
 * 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}:
 *
 * ```
 * 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.
 */
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(uint160(account), 20),
                        " 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 6 of 17 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 7 of 17 : ERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is Context, ERC165, IERC721A, IERC721Enumerable {
    using Address for address;
    using Strings for uint256;

    // The tokenId of the next token to be minted.
    uint256 internal _currentIndex;

    // The number of tokens burned.
    uint256 internal _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * To change the starting tokenId, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
     */
    function totalSupply() public view override(IERC721A, IERC721Enumerable) returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex - _startTokenId() times
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view returns (uint256) {
        // Counter underflow is impossible as _currentIndex does not decrement,
        // and it is initialized to _startTokenId()
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        uint256 numMintedSoFar = _currentIndex;
        uint256 tokenIdsIdx;

        // Counter overflow is impossible as the loop breaks when
        // uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (!ownership.burned) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }
        revert TokenIndexOutOfBounds();
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds();
        uint256 numMintedSoFar = _currentIndex;
        uint256 tokenIdsIdx;
        address currOwnershipAddr;

        // Counter overflow is impossible as the loop breaks when
        // uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }

        // Execution should never reach this point.
        revert();
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberMinted);
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return _addressData[owner].aux;
    }

    /**
     * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal {
        _addressData[owner].aux = aux;
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr && curr < _currentIndex) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (!ownership.burned) {
                    if (ownership.addr != address(0)) {
                        return ownership;
                    }
                    // Invariant:
                    // There will always be an ownership that has an address and is not burned
                    // before an ownership that does not have an address and is not burned.
                    // Hence, curr will not underflow.
                    while (true) {
                        curr--;
                        ownership = _ownerships[curr];
                        if (ownership.addr != address(0)) {
                            return ownership;
                        }
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return _ownershipOf(tokenId).addr;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        if (operator == _msgSender()) revert ApproveToCaller();

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        _transfer(from, to, tokenId);
        if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned;
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     *   {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            if (to.isContract()) {
                do {
                    emit Transfer(address(0), to, updatedIndex);
                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (updatedIndex != end);
                // Reentrancy protection
                if (_currentIndex != startTokenId) revert();
            } else {
                do {
                    emit Transfer(address(0), to, updatedIndex++);
                } while (updatedIndex != end);
            }
            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 quantity) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            do {
                emit Transfer(address(0), to, updatedIndex++);
            } while (updatedIndex != end);

            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) private {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();

        bool isApprovedOrOwner = (_msgSender() == from ||
            isApprovedForAll(from, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId, from);

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            TokenOwnership storage currSlot = _ownerships[tokenId];
            currSlot.addr = to;
            currSlot.startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            TokenOwnership storage nextSlot = _ownerships[nextTokenId];
            if (nextSlot.addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId != _currentIndex) {
                    nextSlot.addr = from;
                    nextSlot.startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        address from = prevOwnership.addr;

        if (approvalCheck) {
            bool isApprovedOrOwner = (_msgSender() == from ||
                isApprovedForAll(from, _msgSender()) ||
                getApproved(tokenId) == _msgSender());

            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId, from);

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            AddressData storage addressData = _addressData[from];
            addressData.balance -= 1;
            addressData.numberBurned += 1;

            // Keep track of who burned the token, and the timestamp of burning.
            TokenOwnership storage currSlot = _ownerships[tokenId];
            currSlot.addr = from;
            currSlot.startTimestamp = uint64(block.timestamp);
            currSlot.burned = true;

            // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            TokenOwnership storage nextSlot = _ownerships[nextTokenId];
            if (nextSlot.addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId != _currentIndex) {
                    nextSlot.addr = from;
                    nextSlot.startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        address owner
    ) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
            return retval == IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     * And also called after one token has been burned.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

File 8 of 17 : 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 9 of 17 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_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) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_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);
    }
}

File 10 of 17 : 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 11 of 17 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 12 of 17 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 13 of 17 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 14 of 17 : IERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';

/**
 * @dev Interface of an ERC721A compliant contract.
 */
interface IERC721A is IERC721, IERC721Metadata {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * The caller cannot approve to their own address.
     */
    error ApproveToCaller();

    /**
     * The caller cannot approve to the current owner.
     */
    error ApprovalToCurrentOwner();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * Invalid owner index
     */
    error OwnerIndexOutOfBounds();

    /**
     * Invalid token index
     */
    error TokenIndexOutOfBounds();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    // Compiler will pack this into a single 256bit word.
    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
    }

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
        // For miscellaneous variable(s) pertaining to the address
        // (e.g. number of whitelist mint slots used).
        // If there are multiple variables, please pack them into a uint64.
        uint64 aux;
    }

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
     */
    function totalSupply() external view returns (uint256);
}

File 15 of 17 : 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 16 of 17 : 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 17 of 17 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TokenIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256[]","name":"indexedUniqueItemIds","type":"uint256[]"},{"indexed":true,"internalType":"uint256","name":"startingTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"uniqueItemIds","type":"uint256[]"}],"name":"ClaimLoot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"address[]","name":"tokenAddresses","type":"address[]"}],"name":"ClaimPrize","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"startingTokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"forgeType","type":"string"}],"name":"Forge","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rootIndex","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"lootRoot","type":"bytes32"}],"name":"PromoteClaims","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HEROES","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXMINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROOT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tutorialClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"rootId","type":"uint256"},{"internalType":"uint256[]","name":"uniqueItemIds","type":"uint256[]"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claimLoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"rootId","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"tokenAddresses","type":"address[]"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claimPrize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"forge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"claimedIndex","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"getClaimStatus","outputs":[{"internalType":"uint256","name":"status","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"price","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":[],"name":"getRootIndex","outputs":[{"internalType":"uint256","name":"rootIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"characterId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"getTutorialStatus","outputs":[{"internalType":"bool","name":"status","type":"bool"}],"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":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newIndex","type":"uint256"},{"internalType":"bytes32","name":"newRoot","type":"bytes32"}],"name":"newLootRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"returnBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"setPaused","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"forgeType","type":"string"}],"name":"specialForge","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":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tutorial","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"bytes32","name":"leaf","type":"bytes32"}],"name":"verifyClaim","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526658d15e17628000600e55600f805460ff1916600117905560006010553480156200002e57600080fd5b506040805180820182526008815267115d995c931bdbdd60c21b60208083019182528351808501909452600484526322ab22a960e11b9084015281519192916200007b91600291620001b5565b50805162000091906003906020840190620001b5565b50600160009081556001600955620000ad925090503362000110565b620000d97f79e553c6f53701daa99614646285e66adb98ff0fcc1ef165dd2718e5c873bee63362000110565b604051806060016040528060268152602001620039786026913980516200010991601191602090910190620001b5565b5062000298565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16620001b15760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620001703390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b828054620001c3906200025b565b90600052602060002090601f016020900481019282620001e7576000855562000232565b82601f106200020257805160ff191683800117855562000232565b8280016001018555821562000232579182015b828111156200023257825182559160200191906001019062000215565b506200024092915062000244565b5090565b5b8082111562000240576000815560010162000245565b600181811c908216806200027057607f821691505b602082108114156200029257634e487b7160e01b600052602260045260246000fd5b50919050565b6136d080620002a86000396000f3fe6080604052600436106102e75760003560e01c8063853828b611610184578063afc65b0c116100d6578063c87b56dd1161008a578063e63ab1e911610064578063e63ab1e91461089e578063e861a551146108d2578063e985e9c5146108fa57600080fd5b8063c87b56dd1461082a578063d53913931461084a578063d547741f1461087e57600080fd5b8063b88d4fde116100bb578063b88d4fde146107aa578063baef8103146107ca578063bedb86fb1461080a57600080fd5b8063afc65b0c14610772578063b187bd261461079257600080fd5b80639a2d90f211610138578063a22cb46511610112578063a22cb4651461071f578063a94e834b1461073f578063aafdc4e01461075257600080fd5b80639a2d90f21461068c5780639be1e13a146106c7578063a217fddf1461070a57600080fd5b806391d148541161016957806391d148541461061c57806395d89b411461066257806398d5fdca1461067757600080fd5b8063853828b6146105f25780638ce761b01461060757600080fd5b8063344886701161023d5780634f6ccce7116101f157806370a08231116101cb57806370a082311461057e578063756063991461059e5780637e8c7f08146105be57600080fd5b80634f6ccce71461051e57806355f804b31461053e5780636352211e1461055e57600080fd5b8063385a21c411610222578063385a21c4146104c95780633d8a5660146104e957806342842e0e146104fe57600080fd5b8063344886701461049457806336568abe146104a957600080fd5b806323b872dd1161029f5780632f081e59116102795780632f081e59146104345780632f2ff15d146104545780632f745c591461047457600080fd5b806323b872dd146103c4578063248a9ca3146103e4578063275847201461041457600080fd5b8063081812fc116102d0578063081812fc14610343578063095ea7b31461037b57806318160ddd1461039d57600080fd5b806301ffc9a7146102ec57806306fdde0314610321575b600080fd5b3480156102f857600080fd5b5061030c61030736600461312e565b610943565b60405190151581526020015b60405180910390f35b34801561032d57600080fd5b50610336610954565b60405161031891906134c4565b34801561034f57600080fd5b5061036361035e3660046130f0565b6109e6565b6040516001600160a01b039091168152602001610318565b34801561038757600080fd5b5061039b610396366004612e4e565b610a43565b005b3480156103a957600080fd5b5060015460005403600019015b604051908152602001610318565b3480156103d057600080fd5b5061039b6103df366004612d14565b610b03565b3480156103f057600080fd5b506103b66103ff3660046130f0565b60009081526008602052604090206001015490565b34801561042057600080fd5b5061039b61042f366004612e7a565b610b0e565b34801561044057600080fd5b5061039b61044f3660046131aa565b610e81565b34801561046057600080fd5b5061039b61046f366004613109565b610f5c565b34801561048057600080fd5b506103b661048f366004612e4e565b610f81565b3480156104a057600080fd5b506010546103b6565b3480156104b557600080fd5b5061039b6104c4366004613109565b61108e565b3480156104d557600080fd5b5061039b6104e4366004612f30565b61111a565b3480156104f557600080fd5b506103b6600a81565b34801561050a57600080fd5b5061039b610519366004612d14565b6113da565b34801561052a57600080fd5b506103b66105393660046130f0565b6113f5565b34801561054a57600080fd5b5061039b610559366004613168565b6114b0565b34801561056a57600080fd5b506103636105793660046130f0565b6114cd565b34801561058a57600080fd5b506103b6610599366004612ca1565b6114df565b3480156105aa57600080fd5b5061039b6105b93660046130f0565b611547565b3480156105ca57600080fd5b506103b67f79e553c6f53701daa99614646285e66adb98ff0fcc1ef165dd2718e5c873bee681565b3480156105fe57600080fd5b5061039b6117e0565b34801561061357600080fd5b506103366118e4565b34801561062857600080fd5b5061030c610637366004613109565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561066e57600080fd5b506103366118f3565b34801561068357600080fd5b50600e546103b6565b34801561069857600080fd5b5061030c6106a7366004612e4e565b600d60209081526000928352604080842090915290825290205460ff1681565b3480156106d357600080fd5b5061030c6106e2366004613109565b6001600160a01b03166000908152600d60209081526040808320938352929052205460ff1690565b34801561071657600080fd5b506103b6600081565b34801561072b57600080fd5b5061039b61073a366004612e19565b611902565b61039b61074d3660046130f0565b6119b1565b34801561075e57600080fd5b5061030c61076d366004613018565b611b7d565b34801561077e57600080fd5b5061039b61078d366004612fbc565b611b92565b34801561079e57600080fd5b50600f5460ff1661030c565b3480156107b657600080fd5b5061039b6107c5366004612d55565b611cb7565b3480156107d657600080fd5b506103b66107e5366004613109565b6001600160a01b03166000908152600b60209081526040808320938352929052205490565b34801561081657600080fd5b5061039b6108253660046130d5565b611d02565b34801561083657600080fd5b506103366108453660046130f0565b611d40565b34801561085657600080fd5b506103b67f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b34801561088a57600080fd5b5061039b610899366004613109565b611dde565b3480156108aa57600080fd5b506103b67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b3480156108de57600080fd5b5061036373f1ef40f5aea5d1501c1b8bcd216cf305764fca4081565b34801561090657600080fd5b5061030c610915366004612cdb565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b600061094e82611e03565b92915050565b606060028054610963906135ad565b80601f016020809104026020016040519081016040528092919081815260200182805461098f906135ad565b80156109dc5780601f106109b1576101008083540402835291602001916109dc565b820191906000526020600020905b8154815290600101906020018083116109bf57829003601f168201915b5050505050905090565b60006109f182611e41565b610a27576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610a4e826114cd565b9050806001600160a01b0316836001600160a01b03161415610a9c576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610abc5750610aba8133610915565b155b15610af3576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610afe838383611e7a565b505050565b610afe838383611eee565b323314610b625760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e7472616374210060448201526064015b60405180910390fd5b600f5460ff1615610baa5760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b6001600160a01b0388166000908152600c602090815260408083208a845290915290205415610c1b5760405162461bcd60e51b815260206004820152601660248201527f416c726561647920636c61696d6564206974656d7321000000000000000000006044820152606401610b59565b848314610c6a5760405162461bcd60e51b815260206004820152601360248201527f41727261797320646f6e2774206d6174636821000000000000000000000000006044820152606401610b59565b60008887878787604051602001610c859594939291906132bb565b604051602081830303815290604052805190602001209050610ce883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508d8152600a60205260409020549250859150611b7d9050565b610d345760405162461bcd60e51b815260206004820152601760248201527f496e636f7272656374206d65726b6c652070726f6f66210000000000000000006044820152606401610b59565b6001600160a01b0389166000818152600c602090815260408083208c84529091529081902060019055517fda4c2c881a0e39d123574e41eecf2c7f09ae8d656411ffa2c9f83113bdbf7ce990610d91908a908a908a908a90613430565b60405180910390a260005b86811015610e75576000868683818110610db857610db8613643565b9050602002016020810190610dcd9190612ca1565b9050806001600160a01b03166323b872dd308d8c8c87818110610df257610df2613643565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b158015610e4957600080fd5b505af1158015610e5d573d6000803e3d6000fd5b50505050508080610e6d906135e8565b915050610d9c565b50505050505050505050565b7f79e553c6f53701daa99614646285e66adb98ff0fcc1ef165dd2718e5c873bee6610eab81612127565b601054610eb9906001613508565b8314610f075760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f74207265777269746520616e206f6c64657220726f6f74210000006044820152606401610b59565b60108390556000838152600a602090815260409182902084905581518581529081018490527f544a8892da7295a2cf60f0394be95f65cccee8f05660b0810908135a28d4bd9a910160405180910390a1505050565b600082815260086020526040902060010154610f7781612127565b610afe8383612131565b6000610f8c836114df565b8210610fc4576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080549080805b8381101561108857600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615801592820192909252906110345750611080565b80516001600160a01b03161561104957805192505b876001600160a01b0316836001600160a01b0316141561107e57868414156110775750935061094e92505050565b6001909301925b505b600101610fcc565b50600080fd5b6001600160a01b038116331461110c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610b59565b61111682826121d3565b5050565b3233146111695760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e747261637421006044820152606401610b59565b600f5460ff16156111b15760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b600a83111561120c5760405162461bcd60e51b815260206004820152602160248201527f4d757374206e6f7420636c61696d206d6f7265207468616e204d41584d494e546044820152602160f81b6064820152608401610b59565b6001600160a01b0386166000908152600b602090815260408083208884529091529020541561127d5760405162461bcd60e51b815260206004820152601660248201527f416c726561647920636c61696d6564206974656d7321000000000000000000006044820152606401610b59565b60008685856040516020016112949392919061328d565b6040516020818303038152906040528051906020012090506112f783838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508b8152600a60205260409020549250859150611b7d9050565b6113435760405162461bcd60e51b815260206004820152601760248201527f496e636f7272656374206d65726b6c652070726f6f66210000000000000000006044820152606401610b59565b6001600160a01b0387166000908152600b60209081526040808320898452909152808220600190559054905161137c9087908790613323565b6040518091039020886001600160a01b03167f16b52b42d546e07f89c1f740e879b70f0ac4d12fb8949875d62920b465da85d888886040516113bf92919061341c565b60405180910390a46113d18785612256565b50505050505050565b610afe83838360405180602001604052806000815250611cb7565b6000805481805b8281101561147d57600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff16151591810182905290611474578583141561146d5750949350505050565b6001909201915b506001016113fc565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006114bb81612127565b6114c760118484612b65565b50505050565b60006114d882612270565b5192915050565b60006001600160a01b038216611521576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b3233146115965760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e747261637421006044820152606401610b59565b600f5460ff16156115de5760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b6115e881336106e2565b156116355760405162461bcd60e51b815260206004820152601e60248201527f416c726561647920636c61696d6564207475746f7269616c20676561722100006044820152606401610b59565b336040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b03919091169073f1ef40f5aea5d1501c1b8bcd216cf305764fca4090636352211e9060240160206040518083038186803b1580156116a757600080fd5b505afa1580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df9190612cbe565b6001600160a01b0316146117355760405162461bcd60e51b815260206004820152601560248201527f446f65736e2774206f776e20746865206865726f2100000000000000000000006044820152606401610b59565b6000546001336001600160a01b03167f559136f8b22ccd3b517346a74ae55db250e7b7585487c63a01a7b719c95f8f7f6040516117a39060208082526008908201527f7475746f7269616c000000000000000000000000000000000000000000000000604082015260600190565b60405180910390a4336000818152600d602090815260408083208584529091529020805460ff191660019081179091556117dd9190612256565b50565b600260095414156118335760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b59565b6002600955600061184381612127565b604051600090339047908381818185875af1925050503d8060008114611885576040519150601f19603f3d011682016040523d82523d6000602084013e61188a565b606091505b50509050806118db5760405162461bcd60e51b815260206004820152601060248201527f5472616e73666572206661696c65642e000000000000000000000000000000006044820152606401610b59565b50506001600955565b60606118ee6123b2565b905090565b606060038054610963906135ad565b6001600160a01b038216331415611945576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b323314611a005760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e747261637421006044820152606401610b59565b600f5460ff1615611a485760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b600a811115611aa35760405162461bcd60e51b815260206004820152602160248201527f4d757374206e6f7420636c61696d206d6f7265207468616e204d41584d494e546044820152602160f81b6064820152608401610b59565b600e54611ab09082613534565b3414611afe5760405162461bcd60e51b815260206004820152601460248201527f4d7573742073656e6420657861637420455448210000000000000000000000006044820152606401610b59565b60005481336001600160a01b03167f559136f8b22ccd3b517346a74ae55db250e7b7585487c63a01a7b719c95f8f7f604051611b6b9060208082526005908201527f666f726765000000000000000000000000000000000000000000000000000000604082015260600190565b60405180910390a46117dd3382612256565b6000611b8a8484846123c1565b949350505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611bbc81612127565b600f5460ff1615611c045760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b600a841115611c5f5760405162461bcd60e51b815260206004820152602160248201527f4d757374206e6f7420636c61696d206d6f7265207468616e204d41584d494e546044820152602160f81b6064820152608401610b59565b60005484866001600160a01b03167f559136f8b22ccd3b517346a74ae55db250e7b7585487c63a01a7b719c95f8f7f8686604051611c9e929190613495565b60405180910390a4611cb08585612256565b5050505050565b611cc2848484611eee565b6001600160a01b0383163b15158015611ce45750611ce2848484846123d7565b155b156114c7576040516368d2bf6b60e11b815260040160405180910390fd5b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611d2c81612127565b50600f805460ff1916911515919091179055565b6060611d4b82611e41565b611d81576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611d8b6123b2565b9050805160001415611dac5760405180602001604052806000815250611dd7565b80611db6846124ce565b604051602001611dc7929190613330565b6040516020818303038152906040525b9392505050565b600082815260086020526040902060010154611df981612127565b610afe83836121d3565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061094e575061094e826125cc565b600081600111158015611e55575060005482105b801561094e575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611ef982612270565b9050836001600160a01b031681600001516001600160a01b031614611f4a576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336001600160a01b0386161480611f685750611f688533610915565b80611f83575033611f78846109e6565b6001600160a01b0316145b905080611fbc576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416611ffc576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61200860008487611e7a565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166120de5760005482146120de578054602086015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611cb0565b6117dd813361269b565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff166111165760008281526008602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561218f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16156111165760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b61111682826040518060200160405280600081525061271b565b604080516060810182526000808252602082018190529181019190915281806001111580156122a0575060005481105b1561238057600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615159181018290529061237e5780516001600160a01b031615612314579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612379579392505050565b612314565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606060118054610963906135ad565b6000826123ce8584612924565b14949350505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061240c9033908990889088906004016133e0565b602060405180830381600087803b15801561242657600080fd5b505af1925050508015612456575060408051601f3d908101601f191682019092526124539181019061314b565b60015b6124b1573d808015612484576040519150601f19603f3d011682016040523d82523d6000602084013e612489565b606091505b5080516124a9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060816124f25750506040805180820190915260018152600360fc1b602082015290565b8160005b811561251c5780612506816135e8565b91506125159050600a83613520565b91506124f6565b60008167ffffffffffffffff81111561253757612537613659565b6040519080825280601f01601f191660200182016040528015612561576020820181803683370190505b5090505b8415611b8a57612576600183613553565b9150612583600a86613603565b61258e906030613508565b60f81b8183815181106125a3576125a3613643565b60200101906001600160f81b031916908160001a9053506125c5600a86613520565b9450612565565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061262f57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061266357506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061094e57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b031983161461094e565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16611116576126d9816001600160a01b03166014612971565b6126e4836020612971565b6040516020016126f592919061335f565b60408051601f198184030181529082905262461bcd60e51b8252610b59916004016134c4565b6000546001600160a01b03841661275e576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82612795576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416600081815260056020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168b0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168b01811690920217909155858452600490925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b156128ce575b60405182906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461289660008784806001019550876123d7565b6128b3576040516368d2bf6b60e11b815260040160405180910390fd5b8082141561284b5782600054146128c957600080fd5b612914565b5b6040516001830192906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808214156128cf575b5060009081556114c79085838684565b600081815b8451811015612969576129558286838151811061294857612948613643565b6020026020010151612b36565b915080612961816135e8565b915050612929565b509392505050565b60606000612980836002613534565b61298b906002613508565b67ffffffffffffffff8111156129a3576129a3613659565b6040519080825280601f01601f1916602001820160405280156129cd576020820181803683370190505b509050600360fc1b816000815181106129e8576129e8613643565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612a3357612a33613643565b60200101906001600160f81b031916908160001a9053506000612a57846002613534565b612a62906001613508565b90505b6001811115612ae7577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612aa357612aa3613643565b1a60f81b828281518110612ab957612ab9613643565b60200101906001600160f81b031916908160001a90535060049490941c93612ae081613596565b9050612a65565b508315611dd75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b59565b6000818310612b52576000828152602084905260409020611dd7565b6000838152602083905260409020611dd7565b828054612b71906135ad565b90600052602060002090601f016020900481019282612b935760008555612bd9565b82601f10612bac5782800160ff19823516178555612bd9565b82800160010185558215612bd9579182015b82811115612bd9578235825591602001919060010190612bbe565b50612be5929150612be9565b5090565b5b80821115612be55760008155600101612bea565b60008083601f840112612c1057600080fd5b50813567ffffffffffffffff811115612c2857600080fd5b6020830191508360208260051b8501011115612c4357600080fd5b9250929050565b80358015158114612c5a57600080fd5b919050565b60008083601f840112612c7157600080fd5b50813567ffffffffffffffff811115612c8957600080fd5b602083019150836020828501011115612c4357600080fd5b600060208284031215612cb357600080fd5b8135611dd78161366f565b600060208284031215612cd057600080fd5b8151611dd78161366f565b60008060408385031215612cee57600080fd5b8235612cf98161366f565b91506020830135612d098161366f565b809150509250929050565b600080600060608486031215612d2957600080fd5b8335612d348161366f565b92506020840135612d448161366f565b929592945050506040919091013590565b60008060008060808587031215612d6b57600080fd5b8435612d768161366f565b9350602085810135612d878161366f565b935060408601359250606086013567ffffffffffffffff80821115612dab57600080fd5b818801915088601f830112612dbf57600080fd5b813581811115612dd157612dd1613659565b612de3601f8201601f191685016134d7565b91508082528984828501011115612df957600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060408385031215612e2c57600080fd5b8235612e378161366f565b9150612e4560208401612c4a565b90509250929050565b60008060408385031215612e6157600080fd5b8235612e6c8161366f565b946020939093013593505050565b60008060008060008060008060a0898b031215612e9657600080fd5b8835612ea18161366f565b975060208901359650604089013567ffffffffffffffff80821115612ec557600080fd5b612ed18c838d01612bfe565b909850965060608b0135915080821115612eea57600080fd5b612ef68c838d01612bfe565b909650945060808b0135915080821115612f0f57600080fd5b50612f1c8b828c01612bfe565b999c989b5096995094979396929594505050565b60008060008060008060808789031215612f4957600080fd5b8635612f548161366f565b955060208701359450604087013567ffffffffffffffff80821115612f7857600080fd5b612f848a838b01612bfe565b90965094506060890135915080821115612f9d57600080fd5b50612faa89828a01612bfe565b979a9699509497509295939492505050565b60008060008060608587031215612fd257600080fd5b8435612fdd8161366f565b935060208501359250604085013567ffffffffffffffff81111561300057600080fd5b61300c87828801612c5f565b95989497509550505050565b60008060006060848603121561302d57600080fd5b833567ffffffffffffffff8082111561304557600080fd5b818601915086601f83011261305957600080fd5b813560208282111561306d5761306d613659565b8160051b925061307e8184016134d7565b8281528181019085830185870184018c101561309957600080fd5b600096505b848710156130bc57803583526001969096019591830191830161309e565b509a918901359950506040909701359695505050505050565b6000602082840312156130e757600080fd5b611dd782612c4a565b60006020828403121561310257600080fd5b5035919050565b6000806040838503121561311c57600080fd5b823591506020830135612d098161366f565b60006020828403121561314057600080fd5b8135611dd781613684565b60006020828403121561315d57600080fd5b8151611dd781613684565b6000806020838503121561317b57600080fd5b823567ffffffffffffffff81111561319257600080fd5b61319e85828601612c5f565b90969095509350505050565b600080604083850312156131bd57600080fd5b50508035926020909101359150565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156131fe57600080fd5b8260051b8083602087013760009401602001938452509192915050565b60007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561324a57600080fd5b8260051b8083863760009401938452509192915050565b6000815180845261327981602086016020860161356a565b601f01601f19169290920160200192915050565b6bffffffffffffffffffffffff198460601b16815260006132b260148301848661321b565b95945050505050565b6bffffffffffffffffffffffff198660601b16815260006132e060148301868861321b565b8460005b858110156133155781356132f78161366f565b6001600160a01b0316835260209283019291909101906001016132e4565b509098975050505050505050565b6000611b8a82848661321b565b6000835161334281846020880161356a565b83519083019061335681836020880161356a565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161339781601785016020880161356a565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516133d481602884016020880161356a565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526134126080830184613261565b9695505050505050565b602081526000611b8a6020830184866131cc565b6040815260006134446040830186886131cc565b8281036020848101919091528482528591810160005b8681101561348857833561346d8161366f565b6001600160a01b03168252928201929082019060010161345a565b5098975050505050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b602081526000611dd76020830184613261565b604051601f8201601f1916810167ffffffffffffffff8111828210171561350057613500613659565b604052919050565b6000821982111561351b5761351b613617565b500190565b60008261352f5761352f61362d565b500490565b600081600019048311821515161561354e5761354e613617565b500290565b60008282101561356557613565613617565b500390565b60005b8381101561358557818101518382015260200161356d565b838111156114c75750506000910152565b6000816135a5576135a5613617565b506000190190565b600181811c908216806135c157607f821691505b602082108114156135e257634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156135fc576135fc613617565b5060010190565b6000826136125761361261362d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146117dd57600080fd5b6001600160e01b0319811681146117dd57600080fdfea2646970667358221220b594029c050a3c39424f818ab5568be5792492be61383492a619cdb5246e06e464736f6c6343000807003368747470733a2f2f6170692e657665726d6f72652e6d75642e78797a2f657665726c6f6f742f

Deployed Bytecode

0x6080604052600436106102e75760003560e01c8063853828b611610184578063afc65b0c116100d6578063c87b56dd1161008a578063e63ab1e911610064578063e63ab1e91461089e578063e861a551146108d2578063e985e9c5146108fa57600080fd5b8063c87b56dd1461082a578063d53913931461084a578063d547741f1461087e57600080fd5b8063b88d4fde116100bb578063b88d4fde146107aa578063baef8103146107ca578063bedb86fb1461080a57600080fd5b8063afc65b0c14610772578063b187bd261461079257600080fd5b80639a2d90f211610138578063a22cb46511610112578063a22cb4651461071f578063a94e834b1461073f578063aafdc4e01461075257600080fd5b80639a2d90f21461068c5780639be1e13a146106c7578063a217fddf1461070a57600080fd5b806391d148541161016957806391d148541461061c57806395d89b411461066257806398d5fdca1461067757600080fd5b8063853828b6146105f25780638ce761b01461060757600080fd5b8063344886701161023d5780634f6ccce7116101f157806370a08231116101cb57806370a082311461057e578063756063991461059e5780637e8c7f08146105be57600080fd5b80634f6ccce71461051e57806355f804b31461053e5780636352211e1461055e57600080fd5b8063385a21c411610222578063385a21c4146104c95780633d8a5660146104e957806342842e0e146104fe57600080fd5b8063344886701461049457806336568abe146104a957600080fd5b806323b872dd1161029f5780632f081e59116102795780632f081e59146104345780632f2ff15d146104545780632f745c591461047457600080fd5b806323b872dd146103c4578063248a9ca3146103e4578063275847201461041457600080fd5b8063081812fc116102d0578063081812fc14610343578063095ea7b31461037b57806318160ddd1461039d57600080fd5b806301ffc9a7146102ec57806306fdde0314610321575b600080fd5b3480156102f857600080fd5b5061030c61030736600461312e565b610943565b60405190151581526020015b60405180910390f35b34801561032d57600080fd5b50610336610954565b60405161031891906134c4565b34801561034f57600080fd5b5061036361035e3660046130f0565b6109e6565b6040516001600160a01b039091168152602001610318565b34801561038757600080fd5b5061039b610396366004612e4e565b610a43565b005b3480156103a957600080fd5b5060015460005403600019015b604051908152602001610318565b3480156103d057600080fd5b5061039b6103df366004612d14565b610b03565b3480156103f057600080fd5b506103b66103ff3660046130f0565b60009081526008602052604090206001015490565b34801561042057600080fd5b5061039b61042f366004612e7a565b610b0e565b34801561044057600080fd5b5061039b61044f3660046131aa565b610e81565b34801561046057600080fd5b5061039b61046f366004613109565b610f5c565b34801561048057600080fd5b506103b661048f366004612e4e565b610f81565b3480156104a057600080fd5b506010546103b6565b3480156104b557600080fd5b5061039b6104c4366004613109565b61108e565b3480156104d557600080fd5b5061039b6104e4366004612f30565b61111a565b3480156104f557600080fd5b506103b6600a81565b34801561050a57600080fd5b5061039b610519366004612d14565b6113da565b34801561052a57600080fd5b506103b66105393660046130f0565b6113f5565b34801561054a57600080fd5b5061039b610559366004613168565b6114b0565b34801561056a57600080fd5b506103636105793660046130f0565b6114cd565b34801561058a57600080fd5b506103b6610599366004612ca1565b6114df565b3480156105aa57600080fd5b5061039b6105b93660046130f0565b611547565b3480156105ca57600080fd5b506103b67f79e553c6f53701daa99614646285e66adb98ff0fcc1ef165dd2718e5c873bee681565b3480156105fe57600080fd5b5061039b6117e0565b34801561061357600080fd5b506103366118e4565b34801561062857600080fd5b5061030c610637366004613109565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561066e57600080fd5b506103366118f3565b34801561068357600080fd5b50600e546103b6565b34801561069857600080fd5b5061030c6106a7366004612e4e565b600d60209081526000928352604080842090915290825290205460ff1681565b3480156106d357600080fd5b5061030c6106e2366004613109565b6001600160a01b03166000908152600d60209081526040808320938352929052205460ff1690565b34801561071657600080fd5b506103b6600081565b34801561072b57600080fd5b5061039b61073a366004612e19565b611902565b61039b61074d3660046130f0565b6119b1565b34801561075e57600080fd5b5061030c61076d366004613018565b611b7d565b34801561077e57600080fd5b5061039b61078d366004612fbc565b611b92565b34801561079e57600080fd5b50600f5460ff1661030c565b3480156107b657600080fd5b5061039b6107c5366004612d55565b611cb7565b3480156107d657600080fd5b506103b66107e5366004613109565b6001600160a01b03166000908152600b60209081526040808320938352929052205490565b34801561081657600080fd5b5061039b6108253660046130d5565b611d02565b34801561083657600080fd5b506103366108453660046130f0565b611d40565b34801561085657600080fd5b506103b67f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b34801561088a57600080fd5b5061039b610899366004613109565b611dde565b3480156108aa57600080fd5b506103b67f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b3480156108de57600080fd5b5061036373f1ef40f5aea5d1501c1b8bcd216cf305764fca4081565b34801561090657600080fd5b5061030c610915366004612cdb565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b600061094e82611e03565b92915050565b606060028054610963906135ad565b80601f016020809104026020016040519081016040528092919081815260200182805461098f906135ad565b80156109dc5780601f106109b1576101008083540402835291602001916109dc565b820191906000526020600020905b8154815290600101906020018083116109bf57829003601f168201915b5050505050905090565b60006109f182611e41565b610a27576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610a4e826114cd565b9050806001600160a01b0316836001600160a01b03161415610a9c576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610abc5750610aba8133610915565b155b15610af3576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610afe838383611e7a565b505050565b610afe838383611eee565b323314610b625760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e7472616374210060448201526064015b60405180910390fd5b600f5460ff1615610baa5760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b6001600160a01b0388166000908152600c602090815260408083208a845290915290205415610c1b5760405162461bcd60e51b815260206004820152601660248201527f416c726561647920636c61696d6564206974656d7321000000000000000000006044820152606401610b59565b848314610c6a5760405162461bcd60e51b815260206004820152601360248201527f41727261797320646f6e2774206d6174636821000000000000000000000000006044820152606401610b59565b60008887878787604051602001610c859594939291906132bb565b604051602081830303815290604052805190602001209050610ce883838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508d8152600a60205260409020549250859150611b7d9050565b610d345760405162461bcd60e51b815260206004820152601760248201527f496e636f7272656374206d65726b6c652070726f6f66210000000000000000006044820152606401610b59565b6001600160a01b0389166000818152600c602090815260408083208c84529091529081902060019055517fda4c2c881a0e39d123574e41eecf2c7f09ae8d656411ffa2c9f83113bdbf7ce990610d91908a908a908a908a90613430565b60405180910390a260005b86811015610e75576000868683818110610db857610db8613643565b9050602002016020810190610dcd9190612ca1565b9050806001600160a01b03166323b872dd308d8c8c87818110610df257610df2613643565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b158015610e4957600080fd5b505af1158015610e5d573d6000803e3d6000fd5b50505050508080610e6d906135e8565b915050610d9c565b50505050505050505050565b7f79e553c6f53701daa99614646285e66adb98ff0fcc1ef165dd2718e5c873bee6610eab81612127565b601054610eb9906001613508565b8314610f075760405162461bcd60e51b815260206004820152601d60248201527f43616e6e6f74207265777269746520616e206f6c64657220726f6f74210000006044820152606401610b59565b60108390556000838152600a602090815260409182902084905581518581529081018490527f544a8892da7295a2cf60f0394be95f65cccee8f05660b0810908135a28d4bd9a910160405180910390a1505050565b600082815260086020526040902060010154610f7781612127565b610afe8383612131565b6000610f8c836114df565b8210610fc4576040517f0ddac30e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080549080805b8381101561108857600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615801592820192909252906110345750611080565b80516001600160a01b03161561104957805192505b876001600160a01b0316836001600160a01b0316141561107e57868414156110775750935061094e92505050565b6001909301925b505b600101610fcc565b50600080fd5b6001600160a01b038116331461110c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610b59565b61111682826121d3565b5050565b3233146111695760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e747261637421006044820152606401610b59565b600f5460ff16156111b15760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b600a83111561120c5760405162461bcd60e51b815260206004820152602160248201527f4d757374206e6f7420636c61696d206d6f7265207468616e204d41584d494e546044820152602160f81b6064820152608401610b59565b6001600160a01b0386166000908152600b602090815260408083208884529091529020541561127d5760405162461bcd60e51b815260206004820152601660248201527f416c726561647920636c61696d6564206974656d7321000000000000000000006044820152606401610b59565b60008685856040516020016112949392919061328d565b6040516020818303038152906040528051906020012090506112f783838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508b8152600a60205260409020549250859150611b7d9050565b6113435760405162461bcd60e51b815260206004820152601760248201527f496e636f7272656374206d65726b6c652070726f6f66210000000000000000006044820152606401610b59565b6001600160a01b0387166000908152600b60209081526040808320898452909152808220600190559054905161137c9087908790613323565b6040518091039020886001600160a01b03167f16b52b42d546e07f89c1f740e879b70f0ac4d12fb8949875d62920b465da85d888886040516113bf92919061341c565b60405180910390a46113d18785612256565b50505050505050565b610afe83838360405180602001604052806000815250611cb7565b6000805481805b8281101561147d57600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff16151591810182905290611474578583141561146d5750949350505050565b6001909201915b506001016113fc565b506040517fa723001c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006114bb81612127565b6114c760118484612b65565b50505050565b60006114d882612270565b5192915050565b60006001600160a01b038216611521576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b3233146115965760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e747261637421006044820152606401610b59565b600f5460ff16156115de5760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b6115e881336106e2565b156116355760405162461bcd60e51b815260206004820152601e60248201527f416c726561647920636c61696d6564207475746f7269616c20676561722100006044820152606401610b59565b336040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b03919091169073f1ef40f5aea5d1501c1b8bcd216cf305764fca4090636352211e9060240160206040518083038186803b1580156116a757600080fd5b505afa1580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df9190612cbe565b6001600160a01b0316146117355760405162461bcd60e51b815260206004820152601560248201527f446f65736e2774206f776e20746865206865726f2100000000000000000000006044820152606401610b59565b6000546001336001600160a01b03167f559136f8b22ccd3b517346a74ae55db250e7b7585487c63a01a7b719c95f8f7f6040516117a39060208082526008908201527f7475746f7269616c000000000000000000000000000000000000000000000000604082015260600190565b60405180910390a4336000818152600d602090815260408083208584529091529020805460ff191660019081179091556117dd9190612256565b50565b600260095414156118335760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b59565b6002600955600061184381612127565b604051600090339047908381818185875af1925050503d8060008114611885576040519150601f19603f3d011682016040523d82523d6000602084013e61188a565b606091505b50509050806118db5760405162461bcd60e51b815260206004820152601060248201527f5472616e73666572206661696c65642e000000000000000000000000000000006044820152606401610b59565b50506001600955565b60606118ee6123b2565b905090565b606060038054610963906135ad565b6001600160a01b038216331415611945576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b323314611a005760405162461bcd60e51b815260206004820152601f60248201527f5468652063616c6c657220697320616e6f7468657220636f6e747261637421006044820152606401610b59565b600f5460ff1615611a485760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b600a811115611aa35760405162461bcd60e51b815260206004820152602160248201527f4d757374206e6f7420636c61696d206d6f7265207468616e204d41584d494e546044820152602160f81b6064820152608401610b59565b600e54611ab09082613534565b3414611afe5760405162461bcd60e51b815260206004820152601460248201527f4d7573742073656e6420657861637420455448210000000000000000000000006044820152606401610b59565b60005481336001600160a01b03167f559136f8b22ccd3b517346a74ae55db250e7b7585487c63a01a7b719c95f8f7f604051611b6b9060208082526005908201527f666f726765000000000000000000000000000000000000000000000000000000604082015260600190565b60405180910390a46117dd3382612256565b6000611b8a8484846123c1565b949350505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611bbc81612127565b600f5460ff1615611c045760405162461bcd60e51b81526020600482015260126024820152714d696e74696e67206973207061757365642160701b6044820152606401610b59565b600a841115611c5f5760405162461bcd60e51b815260206004820152602160248201527f4d757374206e6f7420636c61696d206d6f7265207468616e204d41584d494e546044820152602160f81b6064820152608401610b59565b60005484866001600160a01b03167f559136f8b22ccd3b517346a74ae55db250e7b7585487c63a01a7b719c95f8f7f8686604051611c9e929190613495565b60405180910390a4611cb08585612256565b5050505050565b611cc2848484611eee565b6001600160a01b0383163b15158015611ce45750611ce2848484846123d7565b155b156114c7576040516368d2bf6b60e11b815260040160405180910390fd5b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a611d2c81612127565b50600f805460ff1916911515919091179055565b6060611d4b82611e41565b611d81576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611d8b6123b2565b9050805160001415611dac5760405180602001604052806000815250611dd7565b80611db6846124ce565b604051602001611dc7929190613330565b6040516020818303038152906040525b9392505050565b600082815260086020526040902060010154611df981612127565b610afe83836121d3565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061094e575061094e826125cc565b600081600111158015611e55575060005482105b801561094e575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611ef982612270565b9050836001600160a01b031681600001516001600160a01b031614611f4a576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336001600160a01b0386161480611f685750611f688533610915565b80611f83575033611f78846109e6565b6001600160a01b0316145b905080611fbc576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416611ffc576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61200860008487611e7a565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166120de5760005482146120de578054602086015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611cb0565b6117dd813361269b565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff166111165760008281526008602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561218f3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16156111165760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b61111682826040518060200160405280600081525061271b565b604080516060810182526000808252602082018190529181019190915281806001111580156122a0575060005481105b1561238057600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615159181018290529061237e5780516001600160a01b031615612314579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612379579392505050565b612314565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606060118054610963906135ad565b6000826123ce8584612924565b14949350505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061240c9033908990889088906004016133e0565b602060405180830381600087803b15801561242657600080fd5b505af1925050508015612456575060408051601f3d908101601f191682019092526124539181019061314b565b60015b6124b1573d808015612484576040519150601f19603f3d011682016040523d82523d6000602084013e612489565b606091505b5080516124a9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060816124f25750506040805180820190915260018152600360fc1b602082015290565b8160005b811561251c5780612506816135e8565b91506125159050600a83613520565b91506124f6565b60008167ffffffffffffffff81111561253757612537613659565b6040519080825280601f01601f191660200182016040528015612561576020820181803683370190505b5090505b8415611b8a57612576600183613553565b9150612583600a86613603565b61258e906030613508565b60f81b8183815181106125a3576125a3613643565b60200101906001600160f81b031916908160001a9053506125c5600a86613520565b9450612565565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061262f57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061266357506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061094e57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b031983161461094e565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16611116576126d9816001600160a01b03166014612971565b6126e4836020612971565b6040516020016126f592919061335f565b60408051601f198184030181529082905262461bcd60e51b8252610b59916004016134c4565b6000546001600160a01b03841661275e576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82612795576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416600081815260056020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168b0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168b01811690920217909155858452600490925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b156128ce575b60405182906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461289660008784806001019550876123d7565b6128b3576040516368d2bf6b60e11b815260040160405180910390fd5b8082141561284b5782600054146128c957600080fd5b612914565b5b6040516001830192906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808214156128cf575b5060009081556114c79085838684565b600081815b8451811015612969576129558286838151811061294857612948613643565b6020026020010151612b36565b915080612961816135e8565b915050612929565b509392505050565b60606000612980836002613534565b61298b906002613508565b67ffffffffffffffff8111156129a3576129a3613659565b6040519080825280601f01601f1916602001820160405280156129cd576020820181803683370190505b509050600360fc1b816000815181106129e8576129e8613643565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612a3357612a33613643565b60200101906001600160f81b031916908160001a9053506000612a57846002613534565b612a62906001613508565b90505b6001811115612ae7577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612aa357612aa3613643565b1a60f81b828281518110612ab957612ab9613643565b60200101906001600160f81b031916908160001a90535060049490941c93612ae081613596565b9050612a65565b508315611dd75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b59565b6000818310612b52576000828152602084905260409020611dd7565b6000838152602083905260409020611dd7565b828054612b71906135ad565b90600052602060002090601f016020900481019282612b935760008555612bd9565b82601f10612bac5782800160ff19823516178555612bd9565b82800160010185558215612bd9579182015b82811115612bd9578235825591602001919060010190612bbe565b50612be5929150612be9565b5090565b5b80821115612be55760008155600101612bea565b60008083601f840112612c1057600080fd5b50813567ffffffffffffffff811115612c2857600080fd5b6020830191508360208260051b8501011115612c4357600080fd5b9250929050565b80358015158114612c5a57600080fd5b919050565b60008083601f840112612c7157600080fd5b50813567ffffffffffffffff811115612c8957600080fd5b602083019150836020828501011115612c4357600080fd5b600060208284031215612cb357600080fd5b8135611dd78161366f565b600060208284031215612cd057600080fd5b8151611dd78161366f565b60008060408385031215612cee57600080fd5b8235612cf98161366f565b91506020830135612d098161366f565b809150509250929050565b600080600060608486031215612d2957600080fd5b8335612d348161366f565b92506020840135612d448161366f565b929592945050506040919091013590565b60008060008060808587031215612d6b57600080fd5b8435612d768161366f565b9350602085810135612d878161366f565b935060408601359250606086013567ffffffffffffffff80821115612dab57600080fd5b818801915088601f830112612dbf57600080fd5b813581811115612dd157612dd1613659565b612de3601f8201601f191685016134d7565b91508082528984828501011115612df957600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060408385031215612e2c57600080fd5b8235612e378161366f565b9150612e4560208401612c4a565b90509250929050565b60008060408385031215612e6157600080fd5b8235612e6c8161366f565b946020939093013593505050565b60008060008060008060008060a0898b031215612e9657600080fd5b8835612ea18161366f565b975060208901359650604089013567ffffffffffffffff80821115612ec557600080fd5b612ed18c838d01612bfe565b909850965060608b0135915080821115612eea57600080fd5b612ef68c838d01612bfe565b909650945060808b0135915080821115612f0f57600080fd5b50612f1c8b828c01612bfe565b999c989b5096995094979396929594505050565b60008060008060008060808789031215612f4957600080fd5b8635612f548161366f565b955060208701359450604087013567ffffffffffffffff80821115612f7857600080fd5b612f848a838b01612bfe565b90965094506060890135915080821115612f9d57600080fd5b50612faa89828a01612bfe565b979a9699509497509295939492505050565b60008060008060608587031215612fd257600080fd5b8435612fdd8161366f565b935060208501359250604085013567ffffffffffffffff81111561300057600080fd5b61300c87828801612c5f565b95989497509550505050565b60008060006060848603121561302d57600080fd5b833567ffffffffffffffff8082111561304557600080fd5b818601915086601f83011261305957600080fd5b813560208282111561306d5761306d613659565b8160051b925061307e8184016134d7565b8281528181019085830185870184018c101561309957600080fd5b600096505b848710156130bc57803583526001969096019591830191830161309e565b509a918901359950506040909701359695505050505050565b6000602082840312156130e757600080fd5b611dd782612c4a565b60006020828403121561310257600080fd5b5035919050565b6000806040838503121561311c57600080fd5b823591506020830135612d098161366f565b60006020828403121561314057600080fd5b8135611dd781613684565b60006020828403121561315d57600080fd5b8151611dd781613684565b6000806020838503121561317b57600080fd5b823567ffffffffffffffff81111561319257600080fd5b61319e85828601612c5f565b90969095509350505050565b600080604083850312156131bd57600080fd5b50508035926020909101359150565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156131fe57600080fd5b8260051b8083602087013760009401602001938452509192915050565b60007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561324a57600080fd5b8260051b8083863760009401938452509192915050565b6000815180845261327981602086016020860161356a565b601f01601f19169290920160200192915050565b6bffffffffffffffffffffffff198460601b16815260006132b260148301848661321b565b95945050505050565b6bffffffffffffffffffffffff198660601b16815260006132e060148301868861321b565b8460005b858110156133155781356132f78161366f565b6001600160a01b0316835260209283019291909101906001016132e4565b509098975050505050505050565b6000611b8a82848661321b565b6000835161334281846020880161356a565b83519083019061335681836020880161356a565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161339781601785016020880161356a565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516133d481602884016020880161356a565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526134126080830184613261565b9695505050505050565b602081526000611b8a6020830184866131cc565b6040815260006134446040830186886131cc565b8281036020848101919091528482528591810160005b8681101561348857833561346d8161366f565b6001600160a01b03168252928201929082019060010161345a565b5098975050505050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b602081526000611dd76020830184613261565b604051601f8201601f1916810167ffffffffffffffff8111828210171561350057613500613659565b604052919050565b6000821982111561351b5761351b613617565b500190565b60008261352f5761352f61362d565b500490565b600081600019048311821515161561354e5761354e613617565b500290565b60008282101561356557613565613617565b500390565b60005b8381101561358557818101518382015260200161356d565b838111156114c75750506000910152565b6000816135a5576135a5613617565b506000190190565b600181811c908216806135c157607f821691505b602082108114156135e257634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156135fc576135fc613617565b5060010190565b6000826136125761361261362d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146117dd57600080fd5b6001600160e01b0319811681146117dd57600080fdfea2646970667358221220b594029c050a3c39424f818ab5568be5792492be61383492a619cdb5246e06e464736f6c63430008070033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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