ETH Price: $2,454.11 (+1.49%)

Royals (ROYALS)
 

Overview

TokenID

151

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Royals

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 18 : Royals.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.7;

import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./Oil.sol";
import "./Habibi.sol";

contract Royals is ERC721AQueryable, Ownable {
    enum SaleState {
        Disabled,
        AllowlistSale,
        PublicSale
    }

    Oil public constant OIL = Oil(0x5Fe8C486B5f216B9AD83C12958d8A03eb3fD5060);
    Habibi public constant HABIBIZ = Habibi(0x98a0227E99E7AF0f1f0D51746211a245c3B859c2);

    uint256 public constant MAX_SUPPLY = 300;
    uint256 public availableSupply = 100;
    uint256 public maxClaimPerWallet = 1;
    uint256 public amountRequiredToBurn = 8;
    bytes32 public root;
    string public baseURI;
    string public notRevealedUri;

    SaleState public saleState = SaleState.Disabled;

    event SaleStateChanged(uint256 previousState, uint256 nextState, uint256 timestamp);
    event ClaimedRoyal(address indexed staker, uint256[] frozenTokenIds, uint256 indexed royalId);

    // solhint-disable-next-line no-empty-blocks
    constructor(string memory baseURI_) ERC721A("Royals", "ROYALS") {
        baseURI = baseURI_;
    }

    modifier isClaimingActive() {
        require(saleState != SaleState.Disabled, "Claiming is not active");
        _;
    }

    modifier isInAllowlist(address address_, bytes32[] calldata proof_) {
        require(saleState == SaleState.PublicSale || _verify(_leaf(address_), proof_), "Not in allowlist");
        _;
    }

    //++++++++
    // Public functions
    //++++++++

    function sacrificeAndClaim(
        uint256[] calldata habibizTokenIds_,
        uint256 royalTokenId_,
        bytes32[] calldata proof_
    ) external isClaimingActive isInAllowlist(msg.sender, proof_) {
        require(habibizTokenIds_.length >= amountRequiredToBurn, "Must burn at least required amount of habibiz");
        require(
            habibizTokenIds_.length % amountRequiredToBurn == 0,
            "Must burn multiples of required amount of habibiz"
        );
        setApprovalForAll(address(OIL), true);
        // Count number of potential mints
        uint256 numToClaim = habibizTokenIds_.length / amountRequiredToBurn;

        // O(N^2) loop, its more gas efficient to use this than a mapping with addresses, due to lower storage usage
        for (uint256 i = 0; i < habibizTokenIds_.length; i++) {
            for (uint256 j = i + 1; j < habibizTokenIds_.length; j++) {
                require(habibizTokenIds_[i] != habibizTokenIds_[j], "No duplicates allowed");
            }
        }

        // Now that we have amount a user can mint, lets ensure they can mint given maximum mints per wallet, and batch size
        require(numToClaim <= availableSupply, "available supply reached");
        // Ensure user doesn't already exceed maximum number of mints
        require(_getAux(msg.sender) < maxClaimPerWallet, "Not have enough mints available");
        // Ensure user doesn't exceed maxmium allowable number of mints
        require(uint256(_getAux(msg.sender)) + numToClaim <= maxClaimPerWallet, "Would exceed maximum allowable mints");
        // Burns staked habibis and if there was an issue burning, it reverts
        require(OIL.freeze(msg.sender, habibizTokenIds_, royalTokenId_), "Failed to claim Royal");

        _setAux(_msgSender(), uint64(numToClaim) + _getAux(msg.sender)); // Kfish - moved this to happen before mint
        emit ClaimedRoyal(msg.sender, habibizTokenIds_, royalTokenId_);
    }

    //++++++++
    // Owner functions
    //++++++++

    function mintToStakingContract(uint256 quantity_) external onlyOwner {
        require(quantity_ <= availableSupply, "Would exceed available supply");
        _safeMint(address(OIL), quantity_);
    }

    function setRoot(bytes32 root_) external onlyOwner {
        root = root_;
    }

    // Sale functions
    function setSaleState(uint256 state_) external onlyOwner {
        require(state_ < 3, "Invalid state");
        uint256 prevState = uint256(saleState);
        saleState = SaleState(state_);
        emit SaleStateChanged(prevState, state_, block.timestamp);
    }

    function setAvailableSupply(uint256 availableSupply_) external onlyOwner {
        require(availableSupply_ <= MAX_SUPPLY, "Would exceed max supply");
        availableSupply = availableSupply_;
    }

    function setmaxClaimPerWallet(uint256 maxClaimPerWallet_) public onlyOwner {
        maxClaimPerWallet = maxClaimPerWallet_;
    }

    function setBaseURI(string memory newBaseURI_) public onlyOwner {
        baseURI = newBaseURI_;
    }

    function setNotRevealedURI(string memory notRevealedURI_) public onlyOwner {
        notRevealedUri = notRevealedURI_;
    }

    function withdraw() public payable onlyOwner {
        // solhint-disable-next-line avoid-low-level-calls
        (bool success, ) = payable(msg.sender).call{value: address(this).balance}("");
        require(success, "Withdrawal failed");
    }

    function setAmountRequiredToBurn(uint256 amountRequiredToBurn_) public onlyOwner {
        amountRequiredToBurn = amountRequiredToBurn_;
    }

    //++++++++
    // Internal functions
    //++++++++
    function _leaf(address account_) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(account_));
    }

    function _verify(bytes32 leaf_, bytes32[] memory proof_) internal view returns (bool) {
        return MerkleProof.verify(proof_, root, leaf_);
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return baseURI;
    }

    function _startTokenId() internal view virtual override returns (uint256) {
        return 1;
    }

    //++++++++
    // Override functions
    //++++++++
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        if (bytes(baseURI).length == 0) {
            return notRevealedUri;
        }

        return string(abi.encodePacked(baseURI, Strings.toString(tokenId), ".json"));
    }
}

File 2 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

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

File 3 of 18 : ERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../ERC721A.sol';

error InvalidQueryRange();

/**
 * @title ERC721A Queryable
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryable is ERC721A {
    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *   - `addr` = `address(0)`
     *   - `startTimestamp` = `0`
     *   - `burned` = `false`
     *
     * If the `tokenId` is burned:
     *   - `addr` = `<Address of owner before token was burned>`
     *   - `startTimestamp` = `<Timestamp when token was burned>`
     *   - `burned = `true`
     *
     * Otherwise:
     *   - `addr` = `<Address of owner>`
     *   - `startTimestamp` = `<Timestamp of start of ownership>`
     *   - `burned = `false`
     */
    function explicitOwnershipOf(uint256 tokenId) public view returns (TokenOwnership memory) {
        TokenOwnership memory ownership;
        if (tokenId < _startTokenId() || tokenId >= _currentIndex) {
            return ownership;
        }
        ownership = _ownerships[tokenId];
        if (ownership.burned) {
            return ownership;
        }
        return _ownershipOf(tokenId);
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory) {
        unchecked {
            uint256 tokenIdsLength = tokenIds.length;
            TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
            for (uint256 i; i != tokenIdsLength; ++i) {
                ownerships[i] = explicitOwnershipOf(tokenIds[i]);
            }
            return ownerships;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start` < `stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory) {
        unchecked {
            if (start >= stop) revert InvalidQueryRange();
            uint256 tokenIdsIdx;
            uint256 stopLimit = _currentIndex;
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            // Set `stop = min(stop, _currentIndex)`.
            if (stop > stopLimit) {
                stop = stopLimit;
            }
            uint256 tokenIdsMaxLength = balanceOf(owner);
            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
            // to cater for cases where `balanceOf(owner)` is too big.
            if (start < stop) {
                uint256 rangeLength = stop - start;
                if (rangeLength < tokenIdsMaxLength) {
                    tokenIdsMaxLength = rangeLength;
                }
            } else {
                tokenIdsMaxLength = 0;
            }
            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
            if (tokenIdsMaxLength == 0) {
                return tokenIds;
            }
            // We need to call `explicitOwnershipOf(start)`,
            // because the slot at `start` may not be initialized.
            TokenOwnership memory ownership = explicitOwnershipOf(start);
            address currOwnershipAddr;
            // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.
            // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.
            if (!ownership.burned) {
                currOwnershipAddr = ownership.addr;
            }
            for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
                ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            // Downsize the array to fit.
            assembly {
                mstore(tokenIds, tokenIdsIdx)
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(totalSupply) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K pfp collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            TokenOwnership memory ownership;
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }
}

File 4 of 18 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

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

File 5 of 18 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees 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.
 */
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 Returns the rebuilt hash obtained by traversing a Merklee 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++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }
        return computedHash;
    }
}

File 6 of 18 : Oil.sol
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.7;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// Inspired by Solmate: https://github.com/Rari-Capital/solmate
/// Developed originally by 0xBasset
/// Upgraded by <redacted>
/// Additions by Tsuki Labs: https://tsukiyomigroup.com/ :)

contract Oil {
    /*///////////////////////////////////////////////////////////////
                                  EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /*///////////////////////////////////////////////////////////////
                             ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    address public impl_;
    address public ruler;
    address public treasury;
    address public uniPair;
    address public weth;

    uint256 public totalSupply;
    uint256 public startingTime;
    uint256 public baseTax;
    uint256 public minSwap;

    bool public paused;
    bool public swapping;

    ERC721Like public habibi;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    mapping(address => bool) public isMinter;

    mapping(uint256 => uint256) public claims;

    mapping(address => Staker) internal stakers;

    uint256 public sellFee;

    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    uint256 public doubleBaseTimestamp;

    struct Habibi {
        uint256 stakedTimestamp;
        uint256 tokenId;
    }

    struct Staker {
        Habibi[] habibiz;
        uint256 lastClaim;
    }

    struct Rescueable {
        address revoker;
        bool adminAllowedAsRevoker;
    }

    mapping(address => Rescueable) private rescueable;

    address public sushiswapPair;
    IUniswapV2Router02 public uniswapV2Router;
    IUniswapV2Router02 public sushiswapV2Router;

    mapping(address => bool) public excludedFromFees;
    mapping(address => bool) public blockList;

    struct RoyalStaker {
        Royal[] royals;
    }

    struct Royal {
        uint256 stakedTimestamp;
        uint256 tokenId;
    }

    ERC721Like public royals;

    uint256[] frozenHabibiz;

    mapping(uint256 => address) public claimedRoyals;
    mapping(address => RoyalStaker) internal royalStakers;

    /*///////////////////////////////////////////////////////////////
                             METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    function name() external pure returns (string memory) {
        return "OIL";
    }

    function symbol() external pure returns (string memory) {
        return "OIL";
    }

    function decimals() external pure returns (uint8) {
        return 18;
    }

    /*///////////////////////////////////////////////////////////////
                              ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function initialize(address habibi_, address treasury_) external {
        require(msg.sender == ruler, "NOT ALLOWED TO RULE");
        ruler = msg.sender;
        treasury = treasury_;
        habibi = ERC721Like(habibi_);
        sellFee = 15000;
        _status = _NOT_ENTERED;
    }

    function approve(address spender, uint256 value) external returns (bool) {
        allowance[msg.sender][spender] = value;

        emit Approval(msg.sender, spender, value);

        return true;
    }

    function transfer(address to, uint256 value) external whenNotPaused returns (bool) {
        require(!blockList[msg.sender], "Address Blocked");
        _transfer(msg.sender, to, value);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external whenNotPaused returns (bool) {
        require(!blockList[msg.sender], "Address Blocked");
        if (allowance[from][msg.sender] != type(uint256).max) {
            allowance[from][msg.sender] -= value;
        }

        _transfer(from, to, value);

        return true;
    }

    /*///////////////////////////////////////////////////////////////
                              STAKING
    //////////////////////////////////////////////////////////////*/

    function _tokensOfStaker(address staker_, bool royals_) internal view returns (uint256[] memory) {
        uint256 i;
        if (royals_) {
            uint256[] memory tokenIds = new uint256[](royalStakers[staker_].royals.length);
            for (i = 0; i < royalStakers[staker_].royals.length; i++) {
                tokenIds[i] = royalStakers[staker_].royals[i].tokenId;
            }
            return tokenIds;
        } else {
            uint256[] memory tokenIds = new uint256[](stakers[staker_].habibiz.length);
            for (i = 0; i < stakers[staker_].habibiz.length; i++) {
                tokenIds[i] = stakers[staker_].habibiz[i].tokenId;
            }
            return tokenIds;
        }
    }

    function habibizOfStaker(address staker_) public view returns (uint256[] memory) {
        return _tokensOfStaker(staker_, false);
    }

    function royalsOfStaker(address staker_) public view returns (uint256[] memory) {
        return _tokensOfStaker(staker_, true);
    }

    function allStakedOfStaker(address staker_) public view returns (uint256[] memory, uint256[] memory) {
        return (habibizOfStaker(staker_), royalsOfStaker(staker_));
    }

    function stake(uint256[] memory habibiz_, uint256[] memory royals_) public whenNotPaused {
        uint256 i;
        for (i = 0; i < habibiz_.length; i++) {
            require(habibi.ownerOf(habibiz_[i]) == msg.sender, "At least one Habibi is not owned by you.");
            habibi.transferFrom(msg.sender, address(this), habibiz_[i]);
            stakers[msg.sender].habibiz.push(Habibi(block.timestamp, habibiz_[i]));
        }

        for (i = 0; i < royals_.length; i++) {
            require(royals.ownerOf(royals_[i]) == msg.sender, "At least one Royals is not owned by you.");
            royals.transferFrom(msg.sender, address(this), royals_[i]);
            royalStakers[msg.sender].royals.push(Royal(block.timestamp, royals_[i]));
        }
    }

    function stakeAll() external whenNotPaused {
        uint256[] memory habibizTokenIds = habibi.walletOfOwner(msg.sender);
        uint256[] memory royalsTokenIds = royals.tokensOfOwner(msg.sender);
        stake(habibizTokenIds, royalsTokenIds);
    }

    function isOwnedByStaker(
        address staker_,
        uint256 tokenId_,
        bool isRoyal_
    ) public view returns (bool) {
        uint256[] memory tokenIds;
        if (isRoyal_) {
            tokenIds = royalsOfStaker(staker_);
        } else {
            tokenIds = habibizOfStaker(staker_);
        }
        for (uint256 i = 0; i < tokenIds.length; i++) {
            if (tokenIds[i] == tokenId_) {
                return true;
            }
        }
        return false;
    }

    function _unstake(bool habibiz_, bool royals_) internal {
        /*
        address staker_,
        uint256 tokenId_,
        uint256 stakedTimestamp_,
        bool isRoyal_
        */
        uint256 i;
        uint256 oil;
        if (habibiz_) {
            uint256[] memory tokenIds = new uint256[](stakers[msg.sender].habibiz.length);
            for (i = 0; i < tokenIds.length; i++) {
                Habibi memory _habibi = stakers[msg.sender].habibiz[i];
                habibi.transferFrom(address(this), msg.sender, _habibi.tokenId);
                tokenIds[i] = _habibi.tokenId;
                oil += _calculateOil(msg.sender, _habibi.tokenId, _habibi.stakedTimestamp, false);
            }
            _removeHabibizFromStaker(msg.sender, tokenIds);
        }

        if (royals_) {
            uint256[] memory tokenIds = new uint256[](royalStakers[msg.sender].royals.length);
            for (i = 0; i < tokenIds.length; i++) {
                Royal memory _royal = royalStakers[msg.sender].royals[i];
                royals.transferFrom(address(this), msg.sender, _royal.tokenId);
                tokenIds[i] = _royal.tokenId;
                oil += _calculateOil(msg.sender, _royal.tokenId, _royal.stakedTimestamp, true);
            }
            _removeRoyalsFromStaker(msg.sender, tokenIds);
        }
        if (oil > 0) _claimAmount(msg.sender, oil);
    }

    function _unstakeByIds(uint256[] memory habibizIds_, uint256[] memory royalsIds_) internal {
        uint256 i;
        uint256 oil = calculateOilRewards(msg.sender);
        if (habibizIds_.length > 0) {
            uint256[] memory tokenIds = new uint256[](habibizIds_.length);
            for (i = 0; i < habibizIds_.length; i++) {
                require(isOwnedByStaker(msg.sender, habibizIds_[i], false), "Habibi not owned by sender");
                habibi.transferFrom(address(this), msg.sender, habibizIds_[i]);
                tokenIds[i] = habibizIds_[i];
            }
            _removeHabibizFromStaker(msg.sender, tokenIds);
        }
        if (royalsIds_.length > 0) {
            uint256[] memory tokenIds = new uint256[](royalsIds_.length);
            for (i = 0; i < tokenIds.length; i++) {
                require(isOwnedByStaker(msg.sender, royalsIds_[i], true), "Habibi not owned by sender");
                royals.transferFrom(address(this), msg.sender, royalsIds_[i]);
                tokenIds[i] = royalsIds_[i];
            }
            _removeRoyalsFromStaker(msg.sender, tokenIds);
        }
        if (oil > 0) _claimAmount(msg.sender, oil);
    }

    function unstakeAllHabibiz() external whenNotPaused {
        require(stakers[msg.sender].habibiz.length > 0, "No Habibiz staked");
        _unstake(true, false);
    }

    function unstakeAllRoyals() external whenNotPaused {
        require(royalStakers[msg.sender].royals.length > 0, "No Royals staked");
        _unstake(false, true);
    }

    function unstakeAll() external whenNotPaused {
        require(
            stakers[msg.sender].habibiz.length > 0 || royalStakers[msg.sender].royals.length > 0,
            "No Habibiz or Royals staked"
        );
        _unstake(true, true);
    }

    function unstakeHabibizByIds(uint256[] calldata tokenIds_) external whenNotPaused {
        _unstakeByIds(tokenIds_, new uint256[](0));
    }

    function unstakeRoyalsByIds(uint256[] calldata tokenIds_) external whenNotPaused {
        _unstakeByIds(new uint256[](0), tokenIds_);
    }

    function _removeRoyalsFromStaker(address staker_, uint256[] memory tokenIds_) internal {
        for (uint256 i = 0; i < tokenIds_.length; i++) {
            for (uint256 j = 0; j < royalStakers[staker_].royals.length; j++) {
                if (tokenIds_[i] == royalStakers[staker_].royals[j].tokenId) {
                    royalStakers[staker_].royals[j] = royalStakers[staker_].royals[
                        royalStakers[staker_].royals.length - 1
                    ];
                    royalStakers[staker_].royals.pop();
                }
            }
        }
    }

    function _removeHabibizFromStaker(address staker_, uint256[] memory tokenIds_) internal {
        for (uint256 i = 0; i < tokenIds_.length; i++) {
            for (uint256 j = 0; j < stakers[staker_].habibiz.length; j++) {
                if (tokenIds_[i] == stakers[staker_].habibiz[j].tokenId) {
                    stakers[staker_].habibiz[j] = stakers[staker_].habibiz[stakers[staker_].habibiz.length - 1];
                    stakers[staker_].habibiz.pop();
                }
            }
        }
    }

    function approveRescue(
        address revoker_,
        bool confirm_,
        bool rescueableByAdmin_
    ) external {
        require(confirm_, "Did not confirm");
        require(revoker_ != address(0), "Revoker cannot be null address");
        rescueable[msg.sender] = Rescueable(revoker_, rescueableByAdmin_);
    }

    function revokeRescue(address rescueable_, bool confirm_) external {
        if (msg.sender == ruler) {
            require(rescueable[rescueable_].adminAllowedAsRevoker, "Admin is not allowed to revoke");
        } else {
            require(rescueable[rescueable_].revoker == msg.sender, "Sender is not revoker");
        }
        require(confirm_, "Did not confirm");

        delete rescueable[rescueable_];
    }

    /*////////////////////////////////////////////////////////////
                        Sacrifice for Royals
    ////////////////////////////////////////////////////////////*/

    function freeze(
        address staker_,
        uint256[] calldata habibizIds_,
        uint256 royalId_
    ) external returns (bool) {
        require(msg.sender == address(royals), "You do not have permission to call this function");
        require(
            royals.ownerOf(royalId_) == address(this) && claimedRoyals[royalId_] == address(0),
            "Invalid or claimed token id"
        );
        uint256[] memory habibiz = habibizOfStaker(staker_);

        uint256 count = 0;
        for (uint256 i = 0; i < habibizIds_.length; i++) {
            for (uint256 j = 0; j < habibiz.length; j++) {
                if (habibizIds_[i] == habibiz[j]) {
                    count++;
                    frozenHabibiz.push(habibizIds_[i]);
                    break;
                }
            }
        }
        require(habibizIds_.length == count, "Missing staked Habibiz");
        _claim(staker_);
        _removeHabibizFromStaker(staker_, habibizIds_);
        claimedRoyals[royalId_] = staker_;
        royalStakers[staker_].royals.push(Royal(block.timestamp, royalId_));
        return true;
    }

    /*///////////////////////////////////////////////////////////////
                              CLAIMING
    //////////////////////////////////////////////////////////////*/

    function claim() public whenNotPaused {
        require(!blockList[msg.sender], "Address Blocked");
        _claim(msg.sender);
    }

    function _claim(address to_) internal {
        uint256 oil = calculateOilRewards(to_);
        if (oil > 0) {
            _claimAmount(to_, oil);
        }
    }

    function _claimAmount(address to_, uint256 amount_) internal {
        stakers[to_].lastClaim = block.timestamp;
        _mint(to_, amount_);
    }

    /*///////////////////////////////////////////////////////////////
                            OIL REWARDS
    //////////////////////////////////////////////////////////////*/

    function calculateOilRewards(address staker_) public view returns (uint256 oilAmount) {
        uint256 balanceBonus = holderBonusPercentage(staker_);
        uint256 habibizAmount = stakers[staker_].habibiz.length;
        uint256 royalsAmount = royalStakers[staker_].royals.length;
        uint256 totalStaked = habibizAmount + royalsAmount;
        uint256 royalsBase = getRoyalsBase(staker_);
        uint256 lastClaimTimestamp = stakers[staker_].lastClaim;
        bool isAnimated;
        for (uint256 i = 0; i < totalStaked; i++) {
            uint256 tokenId;
            bool isRoyal;
            uint256 stakedTimestamp;
            if (i < habibizAmount) {
                tokenId = stakers[staker_].habibiz[i].tokenId;
                stakedTimestamp = stakers[staker_].habibiz[i].stakedTimestamp;
                isAnimated = _isAnimated(tokenId);
            } else {
                tokenId = royalStakers[staker_].royals[i - habibizAmount].tokenId;
                stakedTimestamp = royalStakers[staker_].royals[i - habibizAmount].stakedTimestamp;
                isRoyal = true;
            }
            oilAmount += calculateOilOfToken(
                isAnimated,
                lastClaimTimestamp,
                stakedTimestamp,
                balanceBonus,
                isRoyal,
                royalsBase
            );
        }
    }

    function _calculateTimes(uint256 stakedTimestamp_, uint256 lastClaimedTimestamp_)
        internal
        view
        returns (uint256, uint256)
    {
        if (lastClaimedTimestamp_ < stakedTimestamp_) {
            lastClaimedTimestamp_ = stakedTimestamp_;
        }
        return (block.timestamp - stakedTimestamp_, block.timestamp - lastClaimedTimestamp_);
    }

    function _calculateOil(
        address staker_,
        uint256 tokenId_,
        uint256 stakedTimestamp_,
        bool isRoyal_
    ) internal view returns (uint256) {
        uint256 balanceBonus = holderBonusPercentage(staker_);
        uint256 lastClaimTimestamp = stakers[staker_].lastClaim;
        if (isRoyal_) {
            return calculateOilOfToken(false, lastClaimTimestamp, stakedTimestamp_, balanceBonus, true, 0);
        }
        return
            calculateOilOfToken(
                _isAnimated(tokenId_),
                lastClaimTimestamp,
                stakedTimestamp_,
                balanceBonus,
                false,
                getRoyalsBase(staker_)
            );
    }

    function calculateOilOfToken(
        bool isAnimated_,
        uint256 lastClaimedTimestamp_,
        uint256 stakedTimestamp_,
        uint256 balanceBonus_,
        bool isRoyal_,
        uint256 royalsBase
    ) internal view returns (uint256 oil) {
        uint256 bonusPercentage;
        uint256 baseOilMultiplier = 1;

        (uint256 stakedTime, uint256 unclaimedTime) = _calculateTimes(stakedTimestamp_, lastClaimedTimestamp_);

        if (stakedTime >= 15 days || stakedTimestamp_ <= doubleBaseTimestamp) {
            baseOilMultiplier = 2;
        }

        if (stakedTime >= 90 days) {
            bonusPercentage = 100;
        } else {
            for (uint256 i = 2; i < 4; i++) {
                uint256 timeRequirement = 15 days * i;
                if (timeRequirement > 0 && timeRequirement <= stakedTime) {
                    bonusPercentage = bonusPercentage + 15;
                } else {
                    break;
                }
            }
        }

        if (isRoyal_) {
            oil = (unclaimedTime * royalsBase * 1 ether) / 1 days;
        } else if (isAnimated_) {
            oil = (unclaimedTime * 2500 ether * baseOilMultiplier) / 1 days;
        } else {
            bonusPercentage = bonusPercentage + balanceBonus_;
            oil = (unclaimedTime * 500 ether * baseOilMultiplier) / 1 days;
        }
        oil += ((oil * bonusPercentage) / 100);
    }

    function getRoyalsBase(address staker_) public view returns (uint256 base) {
        if (royalStakers[staker_].royals.length == 1) {
            base = 12000;
        } else if (royalStakers[staker_].royals.length == 2) {
            base = 13500;
        } else if (royalStakers[staker_].royals.length >= 3) {
            base = 15000;
        } else {
            base = 0;
        }
        return base;
    }

    function staker(address staker_) public view returns (Staker memory, RoyalStaker memory) {
        return (stakers[staker_], royalStakers[staker_]);
    }

    /*///////////////////////////////////////////////////////////////
                            OIL PRIVILEGE
    //////////////////////////////////////////////////////////////*/

    function mint(address to, uint256 value) external onlyMinter {
        _mint(to, value);
    }

    function burn(address from, uint256 value) external onlyMinter {
        _burn(from, value);
    }

    /*///////////////////////////////////////////////////////////////
                         Ruler Function
    //////////////////////////////////////////////////////////////*/

    function setDoubleBaseTimestamp(uint256 doubleBaseTimestamp_) external onlyRuler {
        doubleBaseTimestamp = doubleBaseTimestamp_;
    }

    function setMinter(address minter_, bool canMint_) external onlyRuler {
        isMinter[minter_] = canMint_;
    }

    function setRuler(address ruler_) external onlyRuler {
        ruler = ruler_;
    }

    function setPaused(bool paused_) external onlyRuler {
        paused = paused_;
    }

    function setHabibiAddress(address habibiAddress_) external onlyRuler {
        habibi = ERC721Like(habibiAddress_);
    }

    function setRoyalsAddress(address royalsAddress_) external onlyRuler {
        royals = ERC721Like(royalsAddress_);
    }

    function setSellFee(uint256 fee_) external onlyRuler {
        sellFee = fee_;
    }

    function setUniswapV2Router(address router_) external onlyRuler {
        uniswapV2Router = IUniswapV2Router02(router_);
    }

    function setSushiswapV2Router(address router_) external onlyRuler {
        sushiswapV2Router = IUniswapV2Router02(router_);
    }

    function setV2Routers(address uniswapRouter_, address sushiswapRouter_) external onlyRuler {
        uniswapV2Router = IUniswapV2Router02(uniswapRouter_);
        sushiswapV2Router = IUniswapV2Router02(sushiswapRouter_);
    }

    function setUniPair(address uniPair_) external onlyRuler {
        uniPair = uniPair_;
    }

    function setSushiswapPair(address sushiswapPair_) external onlyRuler {
        sushiswapPair = sushiswapPair_;
    }

    function setPairs(address uniPair_, address sushiswapPair_) external onlyRuler {
        uniPair = uniPair_;
        sushiswapPair = sushiswapPair_;
    }

    function excludeFromFees(address[] calldata addresses_, bool[] calldata excluded_) external onlyRuler {
        for (uint256 i = 0; i < addresses_.length; i++) {
            excludedFromFees[addresses_[i]] = excluded_[i];
        }
    }

    function blockOrUnblockAddresses(address[] calldata addresses_, bool[] calldata blocked_) external onlyRuler {
        for (uint256 i = 0; i < addresses_.length; i++) {
            blockList[addresses_[i]] = blocked_[i];
        }
    }

    /// emergency
    function rescue(
        address staker_,
        address to_,
        uint256[] calldata habibiIds_,
        uint256[] calldata royalIds_
    ) external onlyRuler {
        require(rescueable[staker_].revoker != address(0), "User has not opted-in for rescue");
        if (habibiIds_.length > 0) {
            for (uint256 i = 0; i < habibiIds_.length; i++) {
                require(isOwnedByStaker(staker_, habibiIds_[i], false), "Habibi TokenID not found");
                stakers[to_].habibiz.push(Habibi(block.timestamp, habibiIds_[i]));
            }
            _removeHabibizFromStaker(staker_, habibiIds_);
        }

        if (royalIds_.length > 0) {
            for (uint256 i = 0; i < royalIds_.length; i++) {
                require(isOwnedByStaker(staker_, royalIds_[i], true), "Royal TokenID not found");
                royalStakers[to_].royals.push(Royal(block.timestamp, royalIds_[i]));
            }
            _removeRoyalsFromStaker(staker_, royalIds_);
        }
    }

    /*///////////////////////////////////////////////////////////////
                          INTERNAL UTILS
    //////////////////////////////////////////////////////////////*/

    function _getRouterFromPair(address pairAddress_) internal view returns (IUniswapV2Router02) {
        return pairAddress_ == address(uniPair) ? uniswapV2Router : sushiswapV2Router;
    }

    function _transfer(
        address from,
        address to,
        uint256 value
    ) internal {
        require(balanceOf[from] >= value, "ERC20: transfer amount exceeds balance");
        uint256 tax;

        bool shouldTax = ((to == uniPair && balanceOf[to] != 0) || (to == sushiswapPair && balanceOf[to] != 0)) &&
            !swapping;
        if (shouldTax && !excludedFromFees[from]) {
            tax = (value * sellFee) / 100_000;
            if (tax > 0) {
                balanceOf[address(this)] += tax;
                swapTokensForEth(to, tax, treasury);
            }
        }
        uint256 taxedAmount = value - tax;
        balanceOf[from] -= value;
        balanceOf[to] += taxedAmount;
        emit Transfer(from, to, taxedAmount);
    }

    function swapTokensForEth(
        address pairAddress_,
        uint256 amountIn_,
        address to_
    ) private lockTheSwap {
        IUniswapV2Router02 router = _getRouterFromPair(pairAddress_);
        IERC20(address(this)).approve(address(router), amountIn_);

        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = router.WETH(); // or router.WETH();

        router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountIn_, 1, path, to_, block.timestamp);
    }

    function _mint(address to, uint256 value) internal {
        totalSupply += value;

        // This is safe because the sum of all user
        // balances can't exceed type(uint256).max!
        unchecked {
            balanceOf[to] += value;
        }

        emit Transfer(address(0), to, value);
    }

    function _burn(address from, uint256 value) internal {
        balanceOf[from] -= value;

        // This is safe because a user won't ever
        // have a balance larger than totalSupply!
        unchecked {
            totalSupply -= value;
        }

        emit Transfer(from, address(0), value);
    }

    function holderBonusPercentage(address staker_) public view returns (uint256) {
        uint256 balance = stakers[staker_].habibiz.length + royalStakers[staker_].royals.length * 8;

        if (balance < 5) return 0;
        if (balance < 10) return 15;
        if (balance < 20) return 25;
        return 35;
    }

    function _isAnimated(uint256 id_) internal pure returns (bool animated) {
        return
            id_ == 40 ||
            id_ == 108 ||
            id_ == 169 ||
            id_ == 191 ||
            id_ == 246 ||
            id_ == 257 ||
            id_ == 319 ||
            id_ == 386 ||
            id_ == 496 ||
            id_ == 562 ||
            id_ == 637 ||
            id_ == 692 ||
            id_ == 832 ||
            id_ == 942 ||
            id_ == 943 ||
            id_ == 957 ||
            id_ == 1100 ||
            id_ == 1108 ||
            id_ == 1169 ||
            id_ == 1178 ||
            id_ == 1627 ||
            id_ == 1706 ||
            id_ == 1843 ||
            id_ == 1884 ||
            id_ == 2137 ||
            id_ == 2158 ||
            id_ == 2165 ||
            id_ == 2214 ||
            id_ == 2232 ||
            id_ == 2238 ||
            id_ == 2508 ||
            id_ == 2629 ||
            id_ == 2863 ||
            id_ == 3055 ||
            id_ == 3073 ||
            id_ == 3280 ||
            id_ == 3297 ||
            id_ == 3322 ||
            id_ == 3327 ||
            id_ == 3361 ||
            id_ == 3411 ||
            id_ == 3605 ||
            id_ == 3639 ||
            id_ == 3774 ||
            id_ == 4250 ||
            id_ == 4267 ||
            id_ == 4302 ||
            id_ == 4362 ||
            id_ == 4382 ||
            id_ == 4397 ||
            id_ == 4675 ||
            id_ == 4707 ||
            id_ == 4863;
    }

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

    modifier onlyMinter() {
        require(isMinter[msg.sender], "FORBIDDEN TO MINT OR BURN");
        _;
    }

    modifier onlyRuler() {
        require(msg.sender == ruler, "NOT ALLOWED TO RULE");
        _;
    }

    modifier whenNotPaused() {
        require(!paused, "Pausable: paused");
        _;
    }

    modifier lockTheSwap() {
        swapping = true;
        _;
        swapping = false;
    }

    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;
    }

    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4) {
        return ERC721Like.onERC721Received.selector;
    }
}

interface ERC721Like {
    function balanceOf(address holder_) external view returns (uint256);

    function ownerOf(uint256 id_) external view returns (address);

    function walletOfOwner(address _owner) external view returns (uint256[] calldata);

    function tokensOfOwner(address owner) external view returns (uint256[] memory);

    function isApprovedForAll(address operator_, address address_) external view returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

interface IERC20 {
    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount) external returns (bool);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

interface IUniswapV2Router02 {
    function WETH() external pure returns (address);

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

interface UniPairLike {
    function token0() external returns (address);

    function swap(
        uint256 amount0Out,
        uint256 amount1Out,
        address to,
        bytes calldata data
    ) external;

    function getReserves()
        external
        view
        returns (
            uint112 reserve0,
            uint112 reserve1,
            uint32 blockTimestampLast
        );
}

File 7 of 18 : Habibi.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.7;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

contract Habibi is ERC721Enumerable, Ownable {
    using Strings for uint256;

    string public baseURI;
    string public baseExtension = ".json";
    string public notRevealedUri;
    uint256 public cost = 0 ether;
    uint256 public maxSupply = 4900;
    uint256 public maxMintAmount = 4900;
    uint256 public nftPerAddressLimit = 4900;
    bool public paused = false;
    bool public revealed = true;
    mapping(address => uint256) public addressMintedBalance;

    constructor(
        string memory _name,
        string memory _symbol,
        string memory _initBaseURI,
        string memory _initNotRevealedUri
    ) ERC721(_name, _symbol) {
        setBaseURI(_initBaseURI);
        setNotRevealedURI(_initNotRevealedUri);
    }

    // internal
    function _baseURI() internal view virtual override returns (string memory) {
        return baseURI;
    }

    // public
    function mint(uint256 _mintAmount) public payable {
        uint256 supply = totalSupply();
        require(_mintAmount > 0, "need to mint at least 1 NFT");
        require(_mintAmount <= maxMintAmount, "max mint amount per session exceeded");
        require(supply + _mintAmount <= maxSupply, "max NFT limit exceeded");
        uint256 ownerMintedCount = addressMintedBalance[msg.sender];
        require(ownerMintedCount + _mintAmount <= nftPerAddressLimit, "max NFT per address exceeded");

        if (msg.sender != owner()) {
            require(!paused, "the contract is paused");
            if (supply <= 500) {
                require(ownerMintedCount + _mintAmount <= 3, "max NFT per address exceeded for the first 500 ");
            }
            //free first 500 mint
            if (supply >= 500) {
                require(msg.value >= cost * _mintAmount, "insufficient funds");
            }
            if (supply >= 4819) {
                paused = true;
            }
        }

        for (uint256 i = 1; i <= _mintAmount; i++) {
            addressMintedBalance[msg.sender]++;
            _safeMint(msg.sender, supply + i);
        }
    }

    function walletOfOwner(address _owner) public view returns (uint256[] memory) {
        uint256 ownerTokenCount = balanceOf(_owner);
        uint256[] memory tokenIds = new uint256[](ownerTokenCount);
        for (uint256 i; i < ownerTokenCount; i++) {
            tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
        }
        return tokenIds;
    }

    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        if (revealed == false) {
            return notRevealedUri;
        }

        string memory currentBaseURI = _baseURI();
        return
            bytes(currentBaseURI).length > 0
                ? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension))
                : "";
    }

    //only owner
    function reveal() public onlyOwner {
        revealed = true;
    }

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

    function setMaxMintAmount(uint256 _newAmount) public onlyOwner {
        maxMintAmount = _newAmount;
    }

    function setNftPerAddressLimit(uint256 _newLimit) public onlyOwner {
        nftPerAddressLimit = _newLimit;
    }

    function setBaseURI(string memory _newBaseURI) public onlyOwner {
        baseURI = _newBaseURI;
    }

    function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
        baseExtension = _newBaseExtension;
    }

    function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
        notRevealedUri = _notRevealedURI;
    }

    function pause(bool _state) public onlyOwner {
        paused = _state;
    }

    function withdraw() public payable onlyOwner {
        (bool success, ) = payable(msg.sender).call{value: address(this).balance}("");
        require(success);
    }
}

File 8 of 18 : 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 9 of 18 : ERC721A.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/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.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';

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

/**
 * @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, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // 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;
    }

    // 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 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 {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).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;
    }

    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 {
        _mint(to, quantity, _data, true);
    }

    /**
     * @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,
        bytes memory _data,
        bool safe
    ) 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 (safe && 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 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 This is 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 10 of 18 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, 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 be 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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 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);

    /**
     * @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;
}

File 11 of 18 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 12 of 18 : 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);
}

File 13 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * 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, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 17 of 18 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // 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;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @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 ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @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) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        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 virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_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 {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _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 {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @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`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * 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
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

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

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a 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 _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * 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, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 18 of 18 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 tokenId);

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"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":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","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":"staker","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"frozenTokenIds","type":"uint256[]"},{"indexed":true,"internalType":"uint256","name":"royalId","type":"uint256"}],"name":"ClaimedRoyal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousState","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nextState","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"SaleStateChanged","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":"HABIBIZ","outputs":[{"internalType":"contract Habibi","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OIL","outputs":[{"internalType":"contract Oil","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amountRequiredToBurn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"availableSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct ERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct ERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"maxClaimPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity_","type":"uint256"}],"name":"mintToStakingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"notRevealedUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"root","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"habibizTokenIds_","type":"uint256[]"},{"internalType":"uint256","name":"royalTokenId_","type":"uint256"},{"internalType":"bytes32[]","name":"proof_","type":"bytes32[]"}],"name":"sacrificeAndClaim","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":[],"name":"saleState","outputs":[{"internalType":"enum Royals.SaleState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountRequiredToBurn_","type":"uint256"}],"name":"setAmountRequiredToBurn","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":"uint256","name":"availableSupply_","type":"uint256"}],"name":"setAvailableSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"notRevealedURI_","type":"string"}],"name":"setNotRevealedURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root_","type":"bytes32"}],"name":"setRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"state_","type":"uint256"}],"name":"setSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxClaimPerWallet_","type":"uint256"}],"name":"setmaxClaimPerWallet","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":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]

608060405260646009556001600a556008600b55600f805460ff191690553480156200002a57600080fd5b5060405162003736380380620037368339810160408190526200004d91620001e1565b60405180604001604052806006815260200165526f79616c7360d01b81525060405180604001604052806006815260200165524f59414c5360d01b8152508160029080519060200190620000a39291906200013b565b508051620000b99060039060208401906200013b565b5050600160005550620000cc33620000e9565b8051620000e190600d9060208401906200013b565b505062000310565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200014990620002bd565b90600052602060002090601f0160209004810192826200016d5760008555620001b8565b82601f106200018857805160ff1916838001178555620001b8565b82800160010185558215620001b8579182015b82811115620001b85782518255916020019190600101906200019b565b50620001c6929150620001ca565b5090565b5b80821115620001c65760008155600101620001cb565b60006020808385031215620001f557600080fd5b82516001600160401b03808211156200020d57600080fd5b818501915085601f8301126200022257600080fd5b815181811115620002375762000237620002fa565b604051601f8201601f19908116603f01168101908382118183101715620002625762000262620002fa565b8160405282815288868487010111156200027b57600080fd5b600093505b828410156200029f578484018601518185018701529285019262000280565b82841115620002b15760008684830101525b98975050505050505050565b600181811c90821680620002d257607f821691505b60208210811415620002f457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61341680620003206000396000f3fe6080604052600436106102c65760003560e01c80636c0360eb11610179578063b88d4fde116100d6578063df120fc61161008a578063f2c4ce1e11610064578063f2c4ce1e146107b2578063f2fde38b146107d2578063f7e8a688146107f257600080fd5b8063df120fc614610733578063e985e9c514610753578063ebf0c7171461079c57600080fd5b8063c707985a116100bb578063c707985a146106cb578063c87b56dd146106f3578063dab5f3401461071357600080fd5b8063b88d4fde1461067e578063c23dc68f1461069e57600080fd5b80638d13ba841161012d57806395d89b411161011257806395d89b411461062957806399a2557a1461063e578063a22cb4651461065e57600080fd5b80638d13ba84146105e35780638da5cb5b1461060b57600080fd5b8063715018a61161015e578063715018a61461058b5780637ecc2b56146105a05780638462151c146105b657600080fd5b80636c0360eb1461055657806370a082311461056b57600080fd5b806332cb6b0c1161022757806355f804b3116101db578063603f4d52116101c0578063603f4d52146104ef5780636352211e1461051657806366c29da11461053657600080fd5b806355f804b3146104a25780635bbb2177146104c257600080fd5b806342842e0e1161020c57806342842e0e1461044c57806344b4fa731461046c57806354003f901461048257600080fd5b806332cb6b0c1461042e5780633ccfd60b1461044457600080fd5b8063095ea7b31161027e57806318160ddd1161026357806318160ddd146103d157806323b872dd146103f85780632d1b3d661461041857600080fd5b8063095ea7b3146103915780631723934d146103b157600080fd5b8063081812fc116102af578063081812fc14610322578063081c8c441461035a578063084c40881461036f57600080fd5b806301ffc9a7146102cb57806306fdde0314610300575b600080fd5b3480156102d757600080fd5b506102eb6102e6366004612e93565b610812565b60405190151581526020015b60405180910390f35b34801561030c57600080fd5b506103156108af565b6040516102f791906131cf565b34801561032e57600080fd5b5061034261033d366004612e7a565b610941565b6040516001600160a01b0390911681526020016102f7565b34801561036657600080fd5b5061031561099e565b34801561037b57600080fd5b5061038f61038a366004612e7a565b610a2c565b005b34801561039d57600080fd5b5061038f6103ac366004612cd9565b610b6d565b3480156103bd57600080fd5b5061038f6103cc366004612e7a565b610c4a565b3480156103dd57600080fd5b5060015460005403600019015b6040519081526020016102f7565b34801561040457600080fd5b5061038f610413366004612bea565b610cfb565b34801561042457600080fd5b506103ea600b5481565b34801561043a57600080fd5b506103ea61012c81565b61038f610d06565b34801561045857600080fd5b5061038f610467366004612bea565b610dfb565b34801561047857600080fd5b506103ea600a5481565b34801561048e57600080fd5b5061038f61049d366004612e7a565b610e16565b3480156104ae57600080fd5b5061038f6104bd366004612ecd565b610e75565b3480156104ce57600080fd5b506104e26104dd366004612db0565b610ee6565b6040516102f791906130f0565b3480156104fb57600080fd5b50600f546105099060ff1681565b6040516102f791906131a7565b34801561052257600080fd5b50610342610531366004612e7a565b610fad565b34801561054257600080fd5b5061038f610551366004612e7a565b610fbf565b34801561056257600080fd5b50610315611089565b34801561057757600080fd5b506103ea610586366004612b9c565b611096565b34801561059757600080fd5b5061038f6110fe565b3480156105ac57600080fd5b506103ea60095481565b3480156105c257600080fd5b506105d66105d1366004612b9c565b611164565b6040516102f7919061316f565b3480156105ef57600080fd5b506103427398a0227e99e7af0f1f0d51746211a245c3b859c281565b34801561061757600080fd5b506008546001600160a01b0316610342565b34801561063557600080fd5b506103156112ae565b34801561064a57600080fd5b506105d6610659366004612d03565b6112bd565b34801561066a57600080fd5b5061038f610679366004612ca2565b61149e565b34801561068a57600080fd5b5061038f610699366004612c26565b61154d565b3480156106aa57600080fd5b506106be6106b9366004612e7a565b61159e565b6040516102f791906131e2565b3480156106d757600080fd5b50610342735fe8c486b5f216b9ad83c12958d8a03eb3fd506081565b3480156106ff57600080fd5b5061031561070e366004612e7a565b611659565b34801561071f57600080fd5b5061038f61072e366004612e7a565b6117af565b34801561073f57600080fd5b5061038f61074e366004612d36565b61180e565b34801561075f57600080fd5b506102eb61076e366004612bb7565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156107a857600080fd5b506103ea600c5481565b3480156107be57600080fd5b5061038f6107cd366004612ecd565b611e86565b3480156107de57600080fd5b5061038f6107ed366004612b9c565b611ef3565b3480156107fe57600080fd5b5061038f61080d366004612e7a565b611fd2565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061087557506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806108a957507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6060600280546108be906132e4565b80601f01602080910402602001604051908101604052809291908181526020018280546108ea906132e4565b80156109375780601f1061090c57610100808354040283529160200191610937565b820191906000526020600020905b81548152906001019060200180831161091a57829003601f168201915b5050505050905090565b600061094c82612031565b610982576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600e80546109ab906132e4565b80601f01602080910402602001604051908101604052809291908181526020018280546109d7906132e4565b8015610a245780601f106109f957610100808354040283529160200191610a24565b820191906000526020600020905b815481529060010190602001808311610a0757829003601f168201915b505050505081565b6008546001600160a01b03163314610a8b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60038110610adb5760405162461bcd60e51b815260206004820152600d60248201527f496e76616c6964207374617465000000000000000000000000000000000000006044820152606401610a82565b600f5460009060ff166002811115610af557610af561337a565b9050816002811115610b0957610b0961337a565b600f805460ff19166001836002811115610b2557610b2561337a565b02179055506040805182815260208101849052428183015290517f5ae4d07c5da1ad821e922d47f80ffe8c88b0d8187b67b95231aa8d381329a7649181900360600190a15050565b6000610b7882610fad565b9050806001600160a01b0316836001600160a01b03161415610bc6576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610c0357506001600160a01b038116600090815260076020908152604080832033845290915290205460ff16155b15610c3a576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c4583838361206a565b505050565b6008546001600160a01b03163314610ca45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b61012c811115610cf65760405162461bcd60e51b815260206004820152601760248201527f576f756c6420657863656564206d617820737570706c790000000000000000006044820152606401610a82565b600955565b610c458383836120de565b6008546001600160a01b03163314610d605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b604051600090339047908381818185875af1925050503d8060008114610da2576040519150601f19603f3d011682016040523d82523d6000602084013e610da7565b606091505b5050905080610df85760405162461bcd60e51b815260206004820152601160248201527f5769746864726177616c206661696c65640000000000000000000000000000006044820152606401610a82565b50565b610c458383836040518060200160405280600081525061154d565b6008546001600160a01b03163314610e705760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b600b55565b6008546001600160a01b03163314610ecf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b8051610ee290600d906020840190612a43565b5050565b805160609060008167ffffffffffffffff811115610f0657610f066133a6565b604051908082528060200260200182016040528015610f5157816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181610f245790505b50905060005b828114610fa557610f80858281518110610f7357610f73613390565b602002602001015161159e565b828281518110610f9257610f92613390565b6020908102919091010152600101610f57565b509392505050565b6000610fb882612338565b5192915050565b6008546001600160a01b031633146110195760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b60095481111561106b5760405162461bcd60e51b815260206004820152601d60248201527f576f756c642065786365656420617661696c61626c6520737570706c790000006044820152606401610a82565b610df8735fe8c486b5f216b9ad83c12958d8a03eb3fd50608261247a565b600d80546109ab906132e4565b60006001600160a01b0382166110d8576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6008546001600160a01b031633146111585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b6111626000612494565b565b6060600080600061117485611096565b905060008167ffffffffffffffff811115611191576111916133a6565b6040519080825280602002602001820160405280156111ba578160200160208202803683370190505b50604080516060810182526000808252602082018190529181019190915290915060015b8386146112a257600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161580159282019290925292506112455761129a565b81516001600160a01b03161561125a57815194505b876001600160a01b0316856001600160a01b0316141561129a578083878060010198508151811061128d5761128d613390565b6020026020010181815250505b6001016111de565b50909695505050505050565b6060600380546108be906132e4565b60608183106112f8576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054600185101561130a57600194505b80841115611316578093505b600061132187611096565b905084861015611340578585038181101561133a578091505b50611344565b5060005b60008167ffffffffffffffff81111561135f5761135f6133a6565b604051908082528060200260200182016040528015611388578160200160208202803683370190505b5090508161139b57935061149792505050565b60006113a68861159e565b9050600081604001516113b7575080515b885b8881141580156113c95750848714155b1561148b57600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615801592820192909252935061142e57611483565b82516001600160a01b03161561144357825191505b8a6001600160a01b0316826001600160a01b03161415611483578084888060010199508151811061147657611476613390565b6020026020010181815250505b6001016113b9565b50505092835250909150505b9392505050565b6001600160a01b0382163314156114e1576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6115588484846120de565b6001600160a01b0383163b1515801561157a5750611578848484846124fe565b155b15611598576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101929092529060018310806115e457506000548310155b156115ef5792915050565b50600082815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615801592820192909252906116505792915050565b61149783612338565b606061166482612031565b6116d65760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610a82565b600d80546116e3906132e4565b1515905061177d57600e80546116f8906132e4565b80601f0160208091040260200160405190810160405280929190818152602001828054611724906132e4565b80156117715780601f1061174657610100808354040283529160200191611771565b820191906000526020600020905b81548152906001019060200180831161175457829003601f168201915b50505050509050919050565b600d61178883612628565b604051602001611799929190612fad565b6040516020818303038152906040529050919050565b6008546001600160a01b031633146118095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b600c55565b6000600f5460ff1660028111156118275761182761337a565b14156118755760405162461bcd60e51b815260206004820152601660248201527f436c61696d696e67206973206e6f7420616374697665000000000000000000006044820152606401610a82565b3382826002600f5460ff1660028111156118915761189161337a565b1480611920575060408051606085901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208083019190915282516014818403018152603490920190925280519101206119209083838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061275a92505050565b61196c5760405162461bcd60e51b815260206004820152601060248201527f4e6f7420696e20616c6c6f776c697374000000000000000000000000000000006044820152606401610a82565b600b548710156119e45760405162461bcd60e51b815260206004820152602d60248201527f4d757374206275726e206174206c6561737420726571756972656420616d6f7560448201527f6e74206f66206861626962697a000000000000000000000000000000000000006064820152608401610a82565b600b546119f1908861333a565b15611a645760405162461bcd60e51b815260206004820152603160248201527f4d757374206275726e206d756c7469706c6573206f662072657175697265642060448201527f616d6f756e74206f66206861626962697a0000000000000000000000000000006064820152608401610a82565b611a83735fe8c486b5f216b9ad83c12958d8a03eb3fd5060600161149e565b600b54600090611a93908961328d565b905060005b88811015611b5d576000611aad826001613249565b90505b89811015611b4a578a8a82818110611aca57611aca613390565b905060200201358b8b84818110611ae357611ae3613390565b905060200201351415611b385760405162461bcd60e51b815260206004820152601560248201527f4e6f206475706c69636174657320616c6c6f77656400000000000000000000006044820152606401610a82565b80611b428161331f565b915050611ab0565b5080611b558161331f565b915050611a98565b50600954811115611bb05760405162461bcd60e51b815260206004820152601860248201527f617661696c61626c6520737570706c79207265616368656400000000000000006044820152606401610a82565b600a5433600090815260056020526040902054600160c01b900467ffffffffffffffff1610611c215760405162461bcd60e51b815260206004820152601f60248201527f4e6f74206861766520656e6f756768206d696e747320617661696c61626c65006044820152606401610a82565b600a5433600090815260056020526040902054611c50908390600160c01b900467ffffffffffffffff16613249565b1115611cc35760405162461bcd60e51b8152602060048201526024808201527f576f756c6420657863656564206d6178696d756d20616c6c6f7761626c65206d60448201527f696e7473000000000000000000000000000000000000000000000000000000006064820152608401610a82565b6040517f0c7098d8000000000000000000000000000000000000000000000000000000008152735fe8c486b5f216b9ad83c12958d8a03eb3fd506090630c7098d890611d199033908d908d908d906004016130bc565b602060405180830381600087803b158015611d3357600080fd5b505af1158015611d47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6b9190612e5d565b611db75760405162461bcd60e51b815260206004820152601560248201527f4661696c656420746f20636c61696d20526f79616c00000000000000000000006044820152606401610a82565b611e373333600090815260056020526040902054600160c01b900467ffffffffffffffff16611de69084613261565b6001600160a01b039091166000908152600560205260409020805467ffffffffffffffff909216600160c01b0277ffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b86336001600160a01b03167fd6df0cca7ded1ec9b7e53de931556ffc69461019bbef7f894ea63fe3451e47208b8b604051611e7392919061315b565b60405180910390a3505050505050505050565b6008546001600160a01b03163314611ee05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b8051610ee290600e906020840190612a43565b6008546001600160a01b03163314611f4d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b6001600160a01b038116611fc95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a82565b610df881612494565b6008546001600160a01b0316331461202c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b600a55565b600081600111158015612045575060005482105b80156108a9575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006120e982612338565b9050836001600160a01b031681600001516001600160a01b03161461213a576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336001600160a01b038616148061217657506001600160a01b038516600090815260076020908152604080832033845290915290205460ff165b8061219157503361218684610941565b6001600160a01b0316145b9050806121ca576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03841661220a576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122166000848761206a565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166122ec5760005482146122ec578054602086015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60408051606081018252600080825260208201819052918101919091528180600111158015612368575060005481105b1561244857600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161515918101829052906124465780516001600160a01b0316156123dc579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612441579392505050565b6123dc565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ee2828260405180602001604052806000815250612769565b600880546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040517f150b7a020000000000000000000000000000000000000000000000000000000081526000906001600160a01b0385169063150b7a029061254c903390899088908890600401613080565b602060405180830381600087803b15801561256657600080fd5b505af1925050508015612596575060408051601f3d908101601f1916820190925261259391810190612eb0565b60015b6125f1573d8080156125c4576040519150601f19603f3d011682016040523d82523d6000602084013e6125c9565b606091505b5080516125e9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b0319167f150b7a02000000000000000000000000000000000000000000000000000000001490505b949350505050565b60608161266857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612692578061267c8161331f565b915061268b9050600a8361328d565b915061266c565b60008167ffffffffffffffff8111156126ad576126ad6133a6565b6040519080825280601f01601f1916602001820160405280156126d7576020820181803683370190505b5090505b8415612620576126ec6001836132a1565b91506126f9600a8661333a565b612704906030613249565b60f81b81838151811061271957612719613390565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612753600a8661328d565b94506126db565b600061149782600c5485612776565b610c45838383600161278c565b600082612783858461299f565b14949350505050565b6000546001600160a01b0385166127cf576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612806576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b4290921691909102179055808085018380156128c757506001600160a01b0387163b15155b15612950575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461291860008884806001019550886124fe565b612935576040516368d2bf6b60e11b815260040160405180910390fd5b808214156128cd57826000541461294b57600080fd5b612996565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415612951575b50600055612331565b600081815b8451811015610fa55760008582815181106129c1576129c1613390565b60200260200101519050808311612a03576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250612a30565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612a3b8161331f565b9150506129a4565b828054612a4f906132e4565b90600052602060002090601f016020900481019282612a715760008555612ab7565b82601f10612a8a57805160ff1916838001178555612ab7565b82800160010185558215612ab7579182015b82811115612ab7578251825591602001919060010190612a9c565b50612ac3929150612ac7565b5090565b5b80821115612ac35760008155600101612ac8565b600067ffffffffffffffff831115612af657612af66133a6565b612b096020601f19601f86011601613218565b9050828152838383011115612b1d57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114612b4b57600080fd5b919050565b60008083601f840112612b6257600080fd5b50813567ffffffffffffffff811115612b7a57600080fd5b6020830191508360208260051b8501011115612b9557600080fd5b9250929050565b600060208284031215612bae57600080fd5b61149782612b34565b60008060408385031215612bca57600080fd5b612bd383612b34565b9150612be160208401612b34565b90509250929050565b600080600060608486031215612bff57600080fd5b612c0884612b34565b9250612c1660208501612b34565b9150604084013590509250925092565b60008060008060808587031215612c3c57600080fd5b612c4585612b34565b9350612c5360208601612b34565b925060408501359150606085013567ffffffffffffffff811115612c7657600080fd5b8501601f81018713612c8757600080fd5b612c9687823560208401612adc565b91505092959194509250565b60008060408385031215612cb557600080fd5b612cbe83612b34565b91506020830135612cce816133bc565b809150509250929050565b60008060408385031215612cec57600080fd5b612cf583612b34565b946020939093013593505050565b600080600060608486031215612d1857600080fd5b612d2184612b34565b95602085013595506040909401359392505050565b600080600080600060608688031215612d4e57600080fd5b853567ffffffffffffffff80821115612d6657600080fd5b612d7289838a01612b50565b9097509550602088013594506040880135915080821115612d9257600080fd5b50612d9f88828901612b50565b969995985093965092949392505050565b60006020808385031215612dc357600080fd5b823567ffffffffffffffff80821115612ddb57600080fd5b818501915085601f830112612def57600080fd5b813581811115612e0157612e016133a6565b8060051b9150612e12848301613218565b8181528481019084860184860187018a1015612e2d57600080fd5b600095505b83861015612e50578035835260019590950194918601918601612e32565b5098975050505050505050565b600060208284031215612e6f57600080fd5b8151611497816133bc565b600060208284031215612e8c57600080fd5b5035919050565b600060208284031215612ea557600080fd5b8135611497816133ca565b600060208284031215612ec257600080fd5b8151611497816133ca565b600060208284031215612edf57600080fd5b813567ffffffffffffffff811115612ef657600080fd5b8201601f81018413612f0757600080fd5b61262084823560208401612adc565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612f4857600080fd5b8260051b8083602087013760009401602001938452509192915050565b60008151808452612f7d8160208601602086016132b8565b601f01601f19169290920160200192915050565b60008151612fa38185602086016132b8565b9290920192915050565b600080845481600182811c915080831680612fc957607f831692505b6020808410821415612fe957634e487b7160e01b86526022600452602486fd5b818015612ffd576001811461300e5761303b565b60ff1986168952848901965061303b565b60008b81526020902060005b868110156130335781548b82015290850190830161301a565b505084890196505b50505050505061307761304e8286612f91565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b95945050505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526130b26080830184612f65565b9695505050505050565b6001600160a01b03851681526060602082015260006130df606083018587612f16565b905082604083015295945050505050565b6020808252825182820181905260009190848201906040850190845b818110156112a25761314883855180516001600160a01b0316825260208082015167ffffffffffffffff16908301526040908101511515910152565b928401926060929092019160010161310c565b602081526000612620602083018486612f16565b6020808252825182820181905260009190848201906040850190845b818110156112a25783518352928401929184019160010161318b565b60208101600383106131c957634e487b7160e01b600052602160045260246000fd5b91905290565b6020815260006114976020830184612f65565b81516001600160a01b0316815260208083015167ffffffffffffffff1690820152604080830151151590820152606081016108a9565b604051601f8201601f1916810167ffffffffffffffff81118282101715613241576132416133a6565b604052919050565b6000821982111561325c5761325c61334e565b500190565b600067ffffffffffffffff8083168185168083038211156132845761328461334e565b01949350505050565b60008261329c5761329c613364565b500490565b6000828210156132b3576132b361334e565b500390565b60005b838110156132d35781810151838201526020016132bb565b838111156115985750506000910152565b600181811c908216806132f857607f821691505b6020821081141561331957634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156133335761333361334e565b5060010190565b60008261334957613349613364565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610df857600080fd5b6001600160e01b031981168114610df857600080fdfea26469706673582212204415ef21292d0ae787ffeb6282eeffdfb84d6cbf7b1f0d01dda1c091a943e85d64736f6c6343000807003300000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d576265684e6a725941634d5174437743347a536261704474506a6a63487741384b4169386a584a54364578652f00000000000000000000

Deployed Bytecode

0x6080604052600436106102c65760003560e01c80636c0360eb11610179578063b88d4fde116100d6578063df120fc61161008a578063f2c4ce1e11610064578063f2c4ce1e146107b2578063f2fde38b146107d2578063f7e8a688146107f257600080fd5b8063df120fc614610733578063e985e9c514610753578063ebf0c7171461079c57600080fd5b8063c707985a116100bb578063c707985a146106cb578063c87b56dd146106f3578063dab5f3401461071357600080fd5b8063b88d4fde1461067e578063c23dc68f1461069e57600080fd5b80638d13ba841161012d57806395d89b411161011257806395d89b411461062957806399a2557a1461063e578063a22cb4651461065e57600080fd5b80638d13ba84146105e35780638da5cb5b1461060b57600080fd5b8063715018a61161015e578063715018a61461058b5780637ecc2b56146105a05780638462151c146105b657600080fd5b80636c0360eb1461055657806370a082311461056b57600080fd5b806332cb6b0c1161022757806355f804b3116101db578063603f4d52116101c0578063603f4d52146104ef5780636352211e1461051657806366c29da11461053657600080fd5b806355f804b3146104a25780635bbb2177146104c257600080fd5b806342842e0e1161020c57806342842e0e1461044c57806344b4fa731461046c57806354003f901461048257600080fd5b806332cb6b0c1461042e5780633ccfd60b1461044457600080fd5b8063095ea7b31161027e57806318160ddd1161026357806318160ddd146103d157806323b872dd146103f85780632d1b3d661461041857600080fd5b8063095ea7b3146103915780631723934d146103b157600080fd5b8063081812fc116102af578063081812fc14610322578063081c8c441461035a578063084c40881461036f57600080fd5b806301ffc9a7146102cb57806306fdde0314610300575b600080fd5b3480156102d757600080fd5b506102eb6102e6366004612e93565b610812565b60405190151581526020015b60405180910390f35b34801561030c57600080fd5b506103156108af565b6040516102f791906131cf565b34801561032e57600080fd5b5061034261033d366004612e7a565b610941565b6040516001600160a01b0390911681526020016102f7565b34801561036657600080fd5b5061031561099e565b34801561037b57600080fd5b5061038f61038a366004612e7a565b610a2c565b005b34801561039d57600080fd5b5061038f6103ac366004612cd9565b610b6d565b3480156103bd57600080fd5b5061038f6103cc366004612e7a565b610c4a565b3480156103dd57600080fd5b5060015460005403600019015b6040519081526020016102f7565b34801561040457600080fd5b5061038f610413366004612bea565b610cfb565b34801561042457600080fd5b506103ea600b5481565b34801561043a57600080fd5b506103ea61012c81565b61038f610d06565b34801561045857600080fd5b5061038f610467366004612bea565b610dfb565b34801561047857600080fd5b506103ea600a5481565b34801561048e57600080fd5b5061038f61049d366004612e7a565b610e16565b3480156104ae57600080fd5b5061038f6104bd366004612ecd565b610e75565b3480156104ce57600080fd5b506104e26104dd366004612db0565b610ee6565b6040516102f791906130f0565b3480156104fb57600080fd5b50600f546105099060ff1681565b6040516102f791906131a7565b34801561052257600080fd5b50610342610531366004612e7a565b610fad565b34801561054257600080fd5b5061038f610551366004612e7a565b610fbf565b34801561056257600080fd5b50610315611089565b34801561057757600080fd5b506103ea610586366004612b9c565b611096565b34801561059757600080fd5b5061038f6110fe565b3480156105ac57600080fd5b506103ea60095481565b3480156105c257600080fd5b506105d66105d1366004612b9c565b611164565b6040516102f7919061316f565b3480156105ef57600080fd5b506103427398a0227e99e7af0f1f0d51746211a245c3b859c281565b34801561061757600080fd5b506008546001600160a01b0316610342565b34801561063557600080fd5b506103156112ae565b34801561064a57600080fd5b506105d6610659366004612d03565b6112bd565b34801561066a57600080fd5b5061038f610679366004612ca2565b61149e565b34801561068a57600080fd5b5061038f610699366004612c26565b61154d565b3480156106aa57600080fd5b506106be6106b9366004612e7a565b61159e565b6040516102f791906131e2565b3480156106d757600080fd5b50610342735fe8c486b5f216b9ad83c12958d8a03eb3fd506081565b3480156106ff57600080fd5b5061031561070e366004612e7a565b611659565b34801561071f57600080fd5b5061038f61072e366004612e7a565b6117af565b34801561073f57600080fd5b5061038f61074e366004612d36565b61180e565b34801561075f57600080fd5b506102eb61076e366004612bb7565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156107a857600080fd5b506103ea600c5481565b3480156107be57600080fd5b5061038f6107cd366004612ecd565b611e86565b3480156107de57600080fd5b5061038f6107ed366004612b9c565b611ef3565b3480156107fe57600080fd5b5061038f61080d366004612e7a565b611fd2565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061087557506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806108a957507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6060600280546108be906132e4565b80601f01602080910402602001604051908101604052809291908181526020018280546108ea906132e4565b80156109375780601f1061090c57610100808354040283529160200191610937565b820191906000526020600020905b81548152906001019060200180831161091a57829003601f168201915b5050505050905090565b600061094c82612031565b610982576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600e80546109ab906132e4565b80601f01602080910402602001604051908101604052809291908181526020018280546109d7906132e4565b8015610a245780601f106109f957610100808354040283529160200191610a24565b820191906000526020600020905b815481529060010190602001808311610a0757829003601f168201915b505050505081565b6008546001600160a01b03163314610a8b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60038110610adb5760405162461bcd60e51b815260206004820152600d60248201527f496e76616c6964207374617465000000000000000000000000000000000000006044820152606401610a82565b600f5460009060ff166002811115610af557610af561337a565b9050816002811115610b0957610b0961337a565b600f805460ff19166001836002811115610b2557610b2561337a565b02179055506040805182815260208101849052428183015290517f5ae4d07c5da1ad821e922d47f80ffe8c88b0d8187b67b95231aa8d381329a7649181900360600190a15050565b6000610b7882610fad565b9050806001600160a01b0316836001600160a01b03161415610bc6576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610c0357506001600160a01b038116600090815260076020908152604080832033845290915290205460ff16155b15610c3a576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c4583838361206a565b505050565b6008546001600160a01b03163314610ca45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b61012c811115610cf65760405162461bcd60e51b815260206004820152601760248201527f576f756c6420657863656564206d617820737570706c790000000000000000006044820152606401610a82565b600955565b610c458383836120de565b6008546001600160a01b03163314610d605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b604051600090339047908381818185875af1925050503d8060008114610da2576040519150601f19603f3d011682016040523d82523d6000602084013e610da7565b606091505b5050905080610df85760405162461bcd60e51b815260206004820152601160248201527f5769746864726177616c206661696c65640000000000000000000000000000006044820152606401610a82565b50565b610c458383836040518060200160405280600081525061154d565b6008546001600160a01b03163314610e705760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b600b55565b6008546001600160a01b03163314610ecf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b8051610ee290600d906020840190612a43565b5050565b805160609060008167ffffffffffffffff811115610f0657610f066133a6565b604051908082528060200260200182016040528015610f5157816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181610f245790505b50905060005b828114610fa557610f80858281518110610f7357610f73613390565b602002602001015161159e565b828281518110610f9257610f92613390565b6020908102919091010152600101610f57565b509392505050565b6000610fb882612338565b5192915050565b6008546001600160a01b031633146110195760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b60095481111561106b5760405162461bcd60e51b815260206004820152601d60248201527f576f756c642065786365656420617661696c61626c6520737570706c790000006044820152606401610a82565b610df8735fe8c486b5f216b9ad83c12958d8a03eb3fd50608261247a565b600d80546109ab906132e4565b60006001600160a01b0382166110d8576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6008546001600160a01b031633146111585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b6111626000612494565b565b6060600080600061117485611096565b905060008167ffffffffffffffff811115611191576111916133a6565b6040519080825280602002602001820160405280156111ba578160200160208202803683370190505b50604080516060810182526000808252602082018190529181019190915290915060015b8386146112a257600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161580159282019290925292506112455761129a565b81516001600160a01b03161561125a57815194505b876001600160a01b0316856001600160a01b0316141561129a578083878060010198508151811061128d5761128d613390565b6020026020010181815250505b6001016111de565b50909695505050505050565b6060600380546108be906132e4565b60608183106112f8576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054600185101561130a57600194505b80841115611316578093505b600061132187611096565b905084861015611340578585038181101561133a578091505b50611344565b5060005b60008167ffffffffffffffff81111561135f5761135f6133a6565b604051908082528060200260200182016040528015611388578160200160208202803683370190505b5090508161139b57935061149792505050565b60006113a68861159e565b9050600081604001516113b7575080515b885b8881141580156113c95750848714155b1561148b57600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615801592820192909252935061142e57611483565b82516001600160a01b03161561144357825191505b8a6001600160a01b0316826001600160a01b03161415611483578084888060010199508151811061147657611476613390565b6020026020010181815250505b6001016113b9565b50505092835250909150505b9392505050565b6001600160a01b0382163314156114e1576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6115588484846120de565b6001600160a01b0383163b1515801561157a5750611578848484846124fe565b155b15611598576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101929092529060018310806115e457506000548310155b156115ef5792915050565b50600082815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff1615801592820192909252906116505792915050565b61149783612338565b606061166482612031565b6116d65760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610a82565b600d80546116e3906132e4565b1515905061177d57600e80546116f8906132e4565b80601f0160208091040260200160405190810160405280929190818152602001828054611724906132e4565b80156117715780601f1061174657610100808354040283529160200191611771565b820191906000526020600020905b81548152906001019060200180831161175457829003601f168201915b50505050509050919050565b600d61178883612628565b604051602001611799929190612fad565b6040516020818303038152906040529050919050565b6008546001600160a01b031633146118095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b600c55565b6000600f5460ff1660028111156118275761182761337a565b14156118755760405162461bcd60e51b815260206004820152601660248201527f436c61696d696e67206973206e6f7420616374697665000000000000000000006044820152606401610a82565b3382826002600f5460ff1660028111156118915761189161337a565b1480611920575060408051606085901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660208083019190915282516014818403018152603490920190925280519101206119209083838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061275a92505050565b61196c5760405162461bcd60e51b815260206004820152601060248201527f4e6f7420696e20616c6c6f776c697374000000000000000000000000000000006044820152606401610a82565b600b548710156119e45760405162461bcd60e51b815260206004820152602d60248201527f4d757374206275726e206174206c6561737420726571756972656420616d6f7560448201527f6e74206f66206861626962697a000000000000000000000000000000000000006064820152608401610a82565b600b546119f1908861333a565b15611a645760405162461bcd60e51b815260206004820152603160248201527f4d757374206275726e206d756c7469706c6573206f662072657175697265642060448201527f616d6f756e74206f66206861626962697a0000000000000000000000000000006064820152608401610a82565b611a83735fe8c486b5f216b9ad83c12958d8a03eb3fd5060600161149e565b600b54600090611a93908961328d565b905060005b88811015611b5d576000611aad826001613249565b90505b89811015611b4a578a8a82818110611aca57611aca613390565b905060200201358b8b84818110611ae357611ae3613390565b905060200201351415611b385760405162461bcd60e51b815260206004820152601560248201527f4e6f206475706c69636174657320616c6c6f77656400000000000000000000006044820152606401610a82565b80611b428161331f565b915050611ab0565b5080611b558161331f565b915050611a98565b50600954811115611bb05760405162461bcd60e51b815260206004820152601860248201527f617661696c61626c6520737570706c79207265616368656400000000000000006044820152606401610a82565b600a5433600090815260056020526040902054600160c01b900467ffffffffffffffff1610611c215760405162461bcd60e51b815260206004820152601f60248201527f4e6f74206861766520656e6f756768206d696e747320617661696c61626c65006044820152606401610a82565b600a5433600090815260056020526040902054611c50908390600160c01b900467ffffffffffffffff16613249565b1115611cc35760405162461bcd60e51b8152602060048201526024808201527f576f756c6420657863656564206d6178696d756d20616c6c6f7761626c65206d60448201527f696e7473000000000000000000000000000000000000000000000000000000006064820152608401610a82565b6040517f0c7098d8000000000000000000000000000000000000000000000000000000008152735fe8c486b5f216b9ad83c12958d8a03eb3fd506090630c7098d890611d199033908d908d908d906004016130bc565b602060405180830381600087803b158015611d3357600080fd5b505af1158015611d47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6b9190612e5d565b611db75760405162461bcd60e51b815260206004820152601560248201527f4661696c656420746f20636c61696d20526f79616c00000000000000000000006044820152606401610a82565b611e373333600090815260056020526040902054600160c01b900467ffffffffffffffff16611de69084613261565b6001600160a01b039091166000908152600560205260409020805467ffffffffffffffff909216600160c01b0277ffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b86336001600160a01b03167fd6df0cca7ded1ec9b7e53de931556ffc69461019bbef7f894ea63fe3451e47208b8b604051611e7392919061315b565b60405180910390a3505050505050505050565b6008546001600160a01b03163314611ee05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b8051610ee290600e906020840190612a43565b6008546001600160a01b03163314611f4d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b6001600160a01b038116611fc95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a82565b610df881612494565b6008546001600160a01b0316331461202c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b600a55565b600081600111158015612045575060005482105b80156108a9575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006120e982612338565b9050836001600160a01b031681600001516001600160a01b03161461213a576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336001600160a01b038616148061217657506001600160a01b038516600090815260076020908152604080832033845290915290205460ff165b8061219157503361218684610941565b6001600160a01b0316145b9050806121ca576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03841661220a576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122166000848761206a565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166122ec5760005482146122ec578054602086015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60408051606081018252600080825260208201819052918101919091528180600111158015612368575060005481105b1561244857600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161515918101829052906124465780516001600160a01b0316156123dc579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612441579392505050565b6123dc565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ee2828260405180602001604052806000815250612769565b600880546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040517f150b7a020000000000000000000000000000000000000000000000000000000081526000906001600160a01b0385169063150b7a029061254c903390899088908890600401613080565b602060405180830381600087803b15801561256657600080fd5b505af1925050508015612596575060408051601f3d908101601f1916820190925261259391810190612eb0565b60015b6125f1573d8080156125c4576040519150601f19603f3d011682016040523d82523d6000602084013e6125c9565b606091505b5080516125e9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b0319167f150b7a02000000000000000000000000000000000000000000000000000000001490505b949350505050565b60608161266857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612692578061267c8161331f565b915061268b9050600a8361328d565b915061266c565b60008167ffffffffffffffff8111156126ad576126ad6133a6565b6040519080825280601f01601f1916602001820160405280156126d7576020820181803683370190505b5090505b8415612620576126ec6001836132a1565b91506126f9600a8661333a565b612704906030613249565b60f81b81838151811061271957612719613390565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612753600a8661328d565b94506126db565b600061149782600c5485612776565b610c45838383600161278c565b600082612783858461299f565b14949350505050565b6000546001600160a01b0385166127cf576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612806576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b4290921691909102179055808085018380156128c757506001600160a01b0387163b15155b15612950575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461291860008884806001019550886124fe565b612935576040516368d2bf6b60e11b815260040160405180910390fd5b808214156128cd57826000541461294b57600080fd5b612996565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415612951575b50600055612331565b600081815b8451811015610fa55760008582815181106129c1576129c1613390565b60200260200101519050808311612a03576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250612a30565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080612a3b8161331f565b9150506129a4565b828054612a4f906132e4565b90600052602060002090601f016020900481019282612a715760008555612ab7565b82601f10612a8a57805160ff1916838001178555612ab7565b82800160010185558215612ab7579182015b82811115612ab7578251825591602001919060010190612a9c565b50612ac3929150612ac7565b5090565b5b80821115612ac35760008155600101612ac8565b600067ffffffffffffffff831115612af657612af66133a6565b612b096020601f19601f86011601613218565b9050828152838383011115612b1d57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114612b4b57600080fd5b919050565b60008083601f840112612b6257600080fd5b50813567ffffffffffffffff811115612b7a57600080fd5b6020830191508360208260051b8501011115612b9557600080fd5b9250929050565b600060208284031215612bae57600080fd5b61149782612b34565b60008060408385031215612bca57600080fd5b612bd383612b34565b9150612be160208401612b34565b90509250929050565b600080600060608486031215612bff57600080fd5b612c0884612b34565b9250612c1660208501612b34565b9150604084013590509250925092565b60008060008060808587031215612c3c57600080fd5b612c4585612b34565b9350612c5360208601612b34565b925060408501359150606085013567ffffffffffffffff811115612c7657600080fd5b8501601f81018713612c8757600080fd5b612c9687823560208401612adc565b91505092959194509250565b60008060408385031215612cb557600080fd5b612cbe83612b34565b91506020830135612cce816133bc565b809150509250929050565b60008060408385031215612cec57600080fd5b612cf583612b34565b946020939093013593505050565b600080600060608486031215612d1857600080fd5b612d2184612b34565b95602085013595506040909401359392505050565b600080600080600060608688031215612d4e57600080fd5b853567ffffffffffffffff80821115612d6657600080fd5b612d7289838a01612b50565b9097509550602088013594506040880135915080821115612d9257600080fd5b50612d9f88828901612b50565b969995985093965092949392505050565b60006020808385031215612dc357600080fd5b823567ffffffffffffffff80821115612ddb57600080fd5b818501915085601f830112612def57600080fd5b813581811115612e0157612e016133a6565b8060051b9150612e12848301613218565b8181528481019084860184860187018a1015612e2d57600080fd5b600095505b83861015612e50578035835260019590950194918601918601612e32565b5098975050505050505050565b600060208284031215612e6f57600080fd5b8151611497816133bc565b600060208284031215612e8c57600080fd5b5035919050565b600060208284031215612ea557600080fd5b8135611497816133ca565b600060208284031215612ec257600080fd5b8151611497816133ca565b600060208284031215612edf57600080fd5b813567ffffffffffffffff811115612ef657600080fd5b8201601f81018413612f0757600080fd5b61262084823560208401612adc565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612f4857600080fd5b8260051b8083602087013760009401602001938452509192915050565b60008151808452612f7d8160208601602086016132b8565b601f01601f19169290920160200192915050565b60008151612fa38185602086016132b8565b9290920192915050565b600080845481600182811c915080831680612fc957607f831692505b6020808410821415612fe957634e487b7160e01b86526022600452602486fd5b818015612ffd576001811461300e5761303b565b60ff1986168952848901965061303b565b60008b81526020902060005b868110156130335781548b82015290850190830161301a565b505084890196505b50505050505061307761304e8286612f91565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b95945050505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526130b26080830184612f65565b9695505050505050565b6001600160a01b03851681526060602082015260006130df606083018587612f16565b905082604083015295945050505050565b6020808252825182820181905260009190848201906040850190845b818110156112a25761314883855180516001600160a01b0316825260208082015167ffffffffffffffff16908301526040908101511515910152565b928401926060929092019160010161310c565b602081526000612620602083018486612f16565b6020808252825182820181905260009190848201906040850190845b818110156112a25783518352928401929184019160010161318b565b60208101600383106131c957634e487b7160e01b600052602160045260246000fd5b91905290565b6020815260006114976020830184612f65565b81516001600160a01b0316815260208083015167ffffffffffffffff1690820152604080830151151590820152606081016108a9565b604051601f8201601f1916810167ffffffffffffffff81118282101715613241576132416133a6565b604052919050565b6000821982111561325c5761325c61334e565b500190565b600067ffffffffffffffff8083168185168083038211156132845761328461334e565b01949350505050565b60008261329c5761329c613364565b500490565b6000828210156132b3576132b361334e565b500390565b60005b838110156132d35781810151838201526020016132bb565b838111156115985750506000910152565b600181811c908216806132f857607f821691505b6020821081141561331957634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156133335761333361334e565b5060010190565b60008261334957613349613364565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610df857600080fd5b6001600160e01b031981168114610df857600080fdfea26469706673582212204415ef21292d0ae787ffeb6282eeffdfb84d6cbf7b1f0d01dda1c091a943e85d64736f6c63430008070033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d576265684e6a725941634d5174437743347a536261704474506a6a63487741384b4169386a584a54364578652f00000000000000000000

-----Decoded View---------------
Arg [0] : baseURI_ (string): ipfs://QmWbehNjrYAcMQtCwC4zSbapDtPjjcHwA8KAi8jXJT6Exe/

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [2] : 697066733a2f2f516d576265684e6a725941634d5174437743347a5362617044
Arg [3] : 74506a6a63487741384b4169386a584a54364578652f00000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.