ETH Price: $3,294.33 (-3.16%)
 

Overview

Max Total Supply

70 GLDMNFT

Holders

11

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
20 GLDMNFT
0x2Bb70959883302601AcB3C8Fdc83c031D80Be32b
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:
GLDMNFT

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 14 : gldmnft.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

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

interface IERC20Ext is IERC20 {
  function decimals() external view returns(uint8);
}

contract GLDMNFT is ERC721Enumerable, Ownable {
  using Strings for uint;

  event Deposit(address who, uint256 amount);
  event GoldMint(address to);
  event Reveal();
  event ClaimReward(address who, uint256 tokenId, uint256 amount);

  // tiers
  uint CHEST = 1;
  uint BAR = 2;
  uint SACK = 3;
  uint COIN = 4;

  // structure of representing properties of every tier
  struct Tier {
    string    name;
    uint256   rewards;
    uint      limit;
    uint      minted;
  }

  struct NFTInfo {
    uint      rarity;
    bool      rewardReceived;
  }

  // tier overviews
  mapping(uint => Tier) private tiers;
  // payment token
  IERC20Ext public tokenForPayment;
  // mint rewards
  uint256 private mintPrice;
  // map variable to generate random id
  mapping(uint => uint) private random_map;
  // inited flag
  bool private inited;
  // base uri
  string private baseURI;
  string private dummyURI;
  // NFT info
  mapping(uint256 => NFTInfo) private nfts;
  // reveal flag
  bool public revealed;
  // max supply
  uint256 private _maxSupply;
  // epoch supply
  uint256 public epochSupply;
  // round
  uint public round;
  // pause
  bool public pause;

  // initialize
  function init(string memory baseURI_, string memory dummyURI_) internal {
    CHEST = 1;
    BAR = 2;
    SACK = 3;
    COIN = 4;
    tiers[CHEST].name="Chest";
    tiers[CHEST].limit = 2;

    tiers[BAR].name="Bar";
    tiers[BAR].limit = 8;

    tiers[SACK].name="Sack";
    tiers[SACK].limit = 20;

    tiers[COIN].name="Coin";
    tiers[COIN].limit = 40;

     mintPrice = 0.44 ether; // 0.44
    epochSupply = createRandomMap(); 
    _maxSupply = epochSupply;
    inited = false;
    baseURI = baseURI_;
    dummyURI = dummyURI_;
    round = 1;
  }

  // constructor
  constructor(
    string memory name_, 
    string memory symbol_, 
    string memory baseURI_, 
    string memory dummyURI_) ERC721(name_, symbol_) {
      init(baseURI_, dummyURI_);
  }

  function createRandomMap() private returns(uint) {
    uint i;
    uint base =  0;
    for (i = 0; i < tiers[CHEST].limit; i ++)
      random_map[i] = CHEST;
    base = i;
    for (; i < base + tiers[BAR].limit; i ++)
      random_map[i] = BAR;
    base = i;
    for (; i < base + tiers[SACK].limit; i ++)
      random_map[i] = SACK;
    base = i;
    for (; i < base + tiers[COIN].limit; i ++)
      random_map[i] = COIN;
    return i;
  }

  // scale mint
  function openNewEpoch(uint[4] memory limits) public onlyOwner {
    // require(totalSupply() == _maxSupply, "[GoldMintNFT] Old round has not been finished yet!");
    for(uint i = 0; i < limits.length; i ++) {
      tiers[i+1].limit = limits[i];
      tiers[i+1].minted = 0;
    }
    epochSupply = createRandomMap();
    _maxSupply += epochSupply;
    round ++;
  }

  // set round value
  function setRound(uint round_) public onlyOwner {
    round = round_;
  }

  // set uri
  function setBaseURI(string memory baseURI_) public onlyOwner {
    baseURI = baseURI_;
  }

  function setDummyURI(string memory dummyURI_) public onlyOwner {
    dummyURI = dummyURI_;
  }

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

  // set mint price
  function setMintPrice(uint256 price) public onlyOwner {
    mintPrice = price;
  }

  // set rewards amount of each tier
  function setRewards(uint id, uint256 amount) public onlyOwner {
    tiers[id].rewards = amount;
  }

  // set payment token
  function setPaymentToken(address _tokenaddr) public onlyOwner {
    tokenForPayment = IERC20Ext(_tokenaddr);
    uint8 decimals = tokenForPayment.decimals() - 2;
    uint256 unit = 10**decimals; 
    mintPrice = 44*unit; // 0.4 ether
    tiers[CHEST].rewards = 250*unit;  // 2.5 ether
    tiers[BAR].rewards = 100*unit;    // 1 ether
    tiers[SACK].rewards = 20*unit;    // 0.2 ether
    tiers[COIN].rewards = 10*unit;    // 0.1 ether
    inited = true;
  }

  // deposit token for reward
  function deposit() public onlyOwner {
    // calculate amount of deposit
    uint256 amount = 
      (tiers[CHEST].limit * tiers[CHEST].rewards) +
      (tiers[BAR].limit * tiers[BAR].rewards) +
      (tiers[SACK].limit * tiers[SACK].rewards) +
      (tiers[COIN].limit * tiers[COIN].rewards);
    require(tokenForPayment.balanceOf(msg.sender) >= amount, "Insufficient funds to deposit!");
    tokenForPayment.transferFrom(msg.sender, address(this), amount);
    
    emit Deposit(msg.sender, amount);
  }

  // generate random tier
  function getRandomizedTier() private view returns(uint) {
    uint randomNumber = uint(keccak256(abi.encodePacked(block.difficulty, block.timestamp)));
    uint rndScaleIn = randomNumber % epochSupply;
    uint id;
    
    for(id = random_map[rndScaleIn]; id <= COIN; id ++)
    {
      Tier storage t = tiers[id];
      if (t.minted < t.limit)
        return id;
    }

    for(id = random_map[rndScaleIn]; id >= CHEST; id --)
    {
      Tier storage t = tiers[id];
      if (t.minted < t.limit)
        return id;
    }

    return 0;
  }

  // set pause to mint
  function setPause(bool flag) public onlyOwner {
    pause = flag;
  }

  // mint
  function mint() public returns(uint){
    require(inited == true, "Contract is not inited yet!");
    require(pause == false, "[GoldMintNFT] Paused to mint!");
    require(
      tokenForPayment.balanceOf(msg.sender) >= mintPrice,
      "[MINT] Insufficient funds to mint!"
    );
    uint256 tokenId = totalSupply() + 1;
    uint id = getRandomizedTier();
    require(id != 0, "All NFTs are minted. Not able to mint anymore!");
    
    // payment for mint
    tokenForPayment.transferFrom(msg.sender, address(this), mintPrice);
    // setting nft info
    nfts[tokenId].rarity = id;
    // setting tiers mint count
    tiers[id].minted += 1;
    // mint
    _mint(msg.sender, tokenId);
    emit GoldMint(msg.sender);
    return id;
  }

  // mint function 
  function mintAll() public onlyOwner {
    uint i;
    for(i = totalSupply(); i < _maxSupply; i ++)
      mint();
  }

  // claim reward
  function claimReward(uint256 tokenId) public {
    uint rarity = nfts[tokenId].rarity;
    uint256 amount = tiers[rarity].rewards;
    address tokenOwner = ownerOf(tokenId);
    require(revealed == true, "[GoldMintNFT] : Cannot get rewards under the unrevealed state!");
    require(tokenOwner == msg.sender, "GoldMintNFT: You are not the owner of this NFT!");
    require(tokenForPayment.balanceOf(address(this)) >= amount, "[GoldMintNFT] Insufficient balance for reward.");
    require(nfts[tokenId].rewardReceived == false, "[GoldMintNFT] You have already received the rewards.");
    tokenForPayment.transfer(msg.sender, amount);
    nfts[tokenId].rewardReceived = true;
    emit ClaimReward(msg.sender, tokenId, amount);
  }

  function isClaimed(uint256 tokenId) public view returns(bool) {
    return nfts[tokenId].rewardReceived;
  }

  // token uri
  function tokenURI(uint256 tokenId) public view override returns (string memory) {
    require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
    uint rarity = nfts[tokenId].rarity;
    require (rarity == CHEST ||
        rarity == BAR ||
        rarity == SACK ||
        rarity == COIN, "GoldMintNFT: Unknown rarity!");
    
    string memory uri = string(abi.encodePacked(baseURI, rarity.toString(), ".json"));
    
    if (nfts[tokenId].rewardReceived)
      return uri;

    if (!revealed)
      return dummyURI;

    return uri;
  }

  // reveal
  function reveal(bool flag) public onlyOwner {
    if (flag == true)
      require(totalSupply() == _maxSupply, "[GoldMintNFT] Not all NFTs have been minted yet!");
    revealed = flag;
  }

  // withdraw rest from this contract
  function withdraw(uint256 amount) public onlyOwner {
    require(amount <= tokenForPayment.balanceOf(address(this)), "[GodMintNFT] Cannot withraw more than balance this contract!");
    tokenForPayment.transfer(msg.sender, amount);
  }
}

File 2 of 14 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions 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 5 of 14 : 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 6 of 14 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 7 of 14 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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: address zero is not a valid owner");
        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: invalid token ID");
        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) {
        _requireMinted(tokenId);

        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 overridden 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 token owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        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: caller is not token 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: caller is not token 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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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);

        _afterTokenTransfer(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);

        _afterTokenTransfer(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 from incorrect owner");
        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);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {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 an {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 Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @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 {
                    /// @solidity memory-safe-assembly
                    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 {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 8 of 14 : 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 14 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 12 of 14 : 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 14 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"baseURI_","type":"string"},{"internalType":"string","name":"dummyURI_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"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":false,"internalType":"address","name":"who","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"who","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"GoldMint","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":[],"name":"Reveal","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":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epochSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[4]","name":"limits","type":"uint256[4]"}],"name":"openNewEpoch","outputs":[],"stateMutability":"nonpayable","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":"pause","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"flag","type":"bool"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"round","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":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"dummyURI_","type":"string"}],"name":"setDummyURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"flag","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenaddr","type":"address"}],"name":"setPaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"round_","type":"uint256"}],"name":"setRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenForPayment","outputs":[{"internalType":"contract IERC20Ext","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526001600b556002600c556003600d556004600e553480156200002557600080fd5b50604051620036d0380380620036d08339810160408190526200004891620004c1565b8383600062000058838262000603565b50600162000067828262000603565b505050620000846200007e6200009a60201b60201c565b6200009e565b620000908282620000f0565b505050506200071c565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600b8190556002600c556003600d556004600e5560408051808201909152600581526410da195cdd60da1b602080830191909152600092909252600f9091527f169f97de0d9a84d840042b17d3c6b9638b3d6fd9024c9eb0c7a306a17b49f88f906200015f908262000603565b50600b546000908152600f602081815260408084206002908101558051808201825260038152622130b960e91b81840152600c5485529290915290912090620001a9908262000603565b50600c546000908152600f6020818152604080842060086002909101558051808201825260048152635361636b60e01b81840152600d5485529290915290912090620001f6908262000603565b50600d546000908152600f60208181526040808420601460029091015580518082018252600481526321b7b4b760e11b81840152600e548552929091529091209062000243908262000603565b50600e546000908152600f60205260409020602860029091015567061b31ab352c000060115562000273620002ac565b60198190556018556013805460ff19169055601462000293838262000603565b506015620002a2828262000603565b50506001601a5550565b600080805b600b546000908152600f6020526040902060020154821015620002f557600b5460008381526012602052604090205581620002ec81620006e5565b925050620002b1565b50805b600c546000908152600f602052604090206002015462000319908262000701565b8210156200034857600c54600083815260126020526040902055816200033f81620006e5565b925050620002f8565b50805b600d546000908152600f60205260409020600201546200036c908262000701565b8210156200039b57600d54600083815260126020526040902055816200039281620006e5565b9250506200034b565b50805b600e546000908152600f6020526040902060020154620003bf908262000701565b821015620003ee57600e5460008381526012602052604090205581620003e581620006e5565b9250506200039e565b50919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200041c57600080fd5b81516001600160401b0380821115620004395762000439620003f4565b604051601f8301601f19908116603f01168101908282118183101715620004645762000464620003f4565b816040528381526020925086838588010111156200048157600080fd5b600091505b83821015620004a5578582018301518183018401529082019062000486565b83821115620004b75760008385830101525b9695505050505050565b60008060008060808587031215620004d857600080fd5b84516001600160401b0380821115620004f057600080fd5b620004fe888389016200040a565b955060208701519150808211156200051557600080fd5b62000523888389016200040a565b945060408701519150808211156200053a57600080fd5b62000548888389016200040a565b935060608701519150808211156200055f57600080fd5b506200056e878288016200040a565b91505092959194509250565b600181811c908216806200058f57607f821691505b602082108103620003ee57634e487b7160e01b600052602260045260246000fd5b601f821115620005fe57600081815260208120601f850160051c81016020861015620005d95750805b601f850160051c820191505b81811015620005fa57828155600101620005e5565b5050505b505050565b81516001600160401b038111156200061f576200061f620003f4565b62000637816200063084546200057a565b84620005b0565b602080601f8311600181146200066f5760008415620006565750858301515b600019600386901b1c1916600185901b178555620005fa565b600085815260208120601f198616915b82811015620006a0578886015182559484019460019091019084016200067f565b5085821015620006bf5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600060018201620006fa57620006fa620006cf565b5060010190565b60008219821115620007175762000717620006cf565b500190565b612fa4806200072c6000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c806370a082311161013b578063ae169a50116100b8578063d0e30db01161007c578063d0e30db0146104cb578063e985e9c5146104d3578063f2fde38b1461050f578063f4a0a52814610522578063fdd6dbd61461053557600080fd5b8063ae169a501461046c578063b88d4fde1461047f578063bd5f3d3814610492578063bedb86fb146104a5578063c87b56dd146104b857600080fd5b8063940cd05b116100ff578063940cd05b1461040557806395d89b41146104185780639b624e7b146104205780639e34070f14610433578063a22cb4651461045957600080fd5b806370a08231146103b9578063715018a6146103cc5780637485d8dc146103d45780638456cb59146103e75780638da5cb5b146103f457600080fd5b80632e1a7d4d116101c957806355f804b31161018d57806355f804b314610365578063595882b3146103785780636352211e14610380578063654e51e7146103935780636a326ab1146103a657600080fd5b80632e1a7d4d1461030c5780632f745c591461031f57806342842e0e146103325780634f6ccce714610345578063518302271461035857600080fd5b8063095ea7b311610210578063095ea7b3146102bf5780631249c58b146102d2578063146ca531146102e857806318160ddd146102f157806323b872dd146102f957600080fd5b80630173351b1461024257806301ffc9a71461025757806306fdde031461027f578063081812fc14610294575b600080fd5b61025561025036600461266a565b61053e565b005b61026a6102653660046126fe565b610603565b60405190151581526020015b60405180910390f35b61028761062e565b6040516102769190612773565b6102a76102a2366004612786565b6106c0565b6040516001600160a01b039091168152602001610276565b6102556102cd3660046127bb565b6106e7565b6102da610801565b604051908152602001610276565b6102da601a5481565b6008546102da565b6102556103073660046127e5565b610afc565b61025561031a366004612786565b610b2d565b6102da61032d3660046127bb565b610c8f565b6102556103403660046127e5565b610d25565b6102da610353366004612786565b610d40565b60175461026a9060ff1681565b610255610373366004612897565b610dd3565b610255610de7565b6102a761038e366004612786565b610e25565b6102556103a13660046128e0565b610e85565b6102556103b4366004612902565b610ea2565b6102da6103c7366004612902565b610fef565b610255611075565b6010546102a7906001600160a01b031681565b601b5461026a9060ff1681565b600a546001600160a01b03166102a7565b61025561041336600461292b565b611089565b61028761111a565b61025561042e366004612786565b611129565b61026a610441366004612786565b60009081526016602052604090206001015460ff1690565b610255610467366004612948565b611136565b61025561047a366004612786565b611141565b61025561048d36600461297f565b611488565b6102556104a0366004612897565b6114c0565b6102556104b336600461292b565b6114d4565b6102876104c6366004612786565b6114ef565b6102556116e6565b61026a6104e13660046129fb565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61025561051d366004612902565b61191b565b610255610530366004612786565b611991565b6102da60195481565b61054661199e565b60005b60048110156105c65781816004811061056457610564612a2e565b6020020151600f6000610578846001612a5a565b8152602001908152602001600020600201819055506000600f60008360016105a09190612a5a565b8152602081019190915260400160002060030155806105be81612a72565b915050610549565b506105cf6119f8565b6019819055601880546000906105e6908490612a5a565b9091555050601a80549060006105fb83612a72565b919050555050565b60006001600160e01b0319821663780e9d6360e01b1480610628575061062882611b2a565b92915050565b60606000805461063d90612a8b565b80601f016020809104026020016040519081016040528092919081815260200182805461066990612a8b565b80156106b65780601f1061068b576101008083540402835291602001916106b6565b820191906000526020600020905b81548152906001019060200180831161069957829003601f168201915b5050505050905090565b60006106cb82611b7a565b506000908152600460205260409020546001600160a01b031690565b60006106f282610e25565b9050806001600160a01b0316836001600160a01b0316036107645760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610780575061078081336104e1565b6107f25760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000606482015260840161075b565b6107fc8383611bd9565b505050565b60135460009060ff16151560011461085b5760405162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206973206e6f7420696e6974656420796574210000000000604482015260640161075b565b601b5460ff16156108ae5760405162461bcd60e51b815260206004820152601d60248201527f5b476f6c644d696e744e46545d2050617573656420746f206d696e7421000000604482015260640161075b565b6011546010546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156108f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091d9190612abf565b10156109765760405162461bcd60e51b815260206004820152602260248201527f5b4d494e545d20496e73756666696369656e742066756e647320746f206d696e604482015261742160f01b606482015260840161075b565b600061098160085490565b61098c906001612a5a565b90506000610998611c47565b905080600003610a015760405162461bcd60e51b815260206004820152602e60248201527f416c6c204e46547320617265206d696e7465642e204e6f742061626c6520746f60448201526d206d696e7420616e796d6f72652160901b606482015260840161075b565b6010546011546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a809190612ad8565b506000828152601660209081526040808320849055838352600f9091528120600301805460019290610ab3908490612a5a565b90915550610ac390503383611d43565b6040513381527f78df45fb2ab5f8a03a580be8844aee5b3767e94ca1680ee2e9379f6c70460dbe9060200160405180910390a192915050565b610b063382611e91565b610b225760405162461bcd60e51b815260040161075b90612af5565b6107fc838383611f10565b610b3561199e565b6010546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190612abf565b811115610c165760405162461bcd60e51b815260206004820152603c60248201527f5b476f644d696e744e46545d2043616e6e6f742077697468726177206d6f726560448201527f207468616e2062616c616e6365207468697320636f6e74726163742100000000606482015260840161075b565b60105460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8b9190612ad8565b5050565b6000610c9a83610fef565b8210610cfc5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161075b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6107fc83838360405180602001604052806000815250611488565b6000610d4b60085490565b8210610dae5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161075b565b60088281548110610dc157610dc1612a2e565b90600052602060002001549050919050565b610ddb61199e565b6014610c8b8282612b91565b610def61199e565b6000610dfa60085490565b90505b601854811015610e2257610e0f610801565b5080610e1a81612a72565b915050610dfd565b50565b6000818152600260205260408120546001600160a01b0316806106285760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161075b565b610e8d61199e565b6000918252600f602052604090912060010155565b610eaa61199e565b601080546001600160a01b0319166001600160a01b0383169081179091556040805163313ce56760e01b81529051600092600292909163313ce567916004808201926020929091908290030181865afa158015610f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2f9190612c51565b610f399190612c74565b90506000610f4882600a612d7b565b9050610f5581602c612d8a565b601155610f638160fa612d8a565b600b546000908152600f6020526040902060010155610f83816064612d8a565b600c546000908152600f6020526040902060010155610fa3816014612d8a565b600d546000908152600f6020526040902060010155610fc381600a612d8a565b600e546000908152600f602052604090206001908101919091556013805460ff19169091179055505050565b60006001600160a01b0382166110595760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161075b565b506001600160a01b031660009081526003602052604090205490565b61107d61199e565b61108760006120b7565b565b61109161199e565b80151560010361110757601854600854146111075760405162461bcd60e51b815260206004820152603060248201527f5b476f6c644d696e744e46545d204e6f7420616c6c204e46547320686176652060448201526f6265656e206d696e746564207965742160801b606482015260840161075b565b6017805460ff1916911515919091179055565b60606001805461063d90612a8b565b61113161199e565b601a55565b610c8b338383612109565b600081815260166020908152604080832054808452600f909252822060010154909161116c84610e25565b60175490915060ff1615156001146111ec5760405162461bcd60e51b815260206004820152603e60248201527f5b476f6c644d696e744e46545d203a2043616e6e6f742067657420726577617260448201527f647320756e6465722074686520756e72657665616c6564207374617465210000606482015260840161075b565b6001600160a01b038116331461125c5760405162461bcd60e51b815260206004820152602f60248201527f476f6c644d696e744e46543a20596f7520617265206e6f7420746865206f776e60448201526e6572206f662074686973204e46542160881b606482015260840161075b565b6010546040516370a0823160e01b815230600482015283916001600160a01b0316906370a0823190602401602060405180830381865afa1580156112a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c89190612abf565b101561132d5760405162461bcd60e51b815260206004820152602e60248201527f5b476f6c644d696e744e46545d20496e73756666696369656e742062616c616e60448201526d31b2903337b9103932bbb0b9321760911b606482015260840161075b565b60008481526016602052604090206001015460ff16156113ac5760405162461bcd60e51b815260206004820152603460248201527f5b476f6c644d696e744e46545d20596f75206861766520616c7265616479207260448201527332b1b2b4bb32b2103a3432903932bbb0b932399760611b606482015260840161075b565b60105460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156113fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114219190612ad8565b506000848152601660209081526040918290206001908101805460ff1916909117905581513381529081018690529081018390527fe74e5c9d4ac1fc33412485f18c159a0a391efe287ab3fd271123f30e6bacf4e39060600160405180910390a150505050565b6114923383611e91565b6114ae5760405162461bcd60e51b815260040161075b90612af5565b6114ba848484846121d7565b50505050565b6114c861199e565b6015610c8b8282612b91565b6114dc61199e565b601b805460ff1916911515919091179055565b6000818152600260205260409020546060906001600160a01b031661156e5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161075b565b600082815260166020526040902054600b5481148061158e5750600c5481145b8061159a5750600d5481145b806115a65750600e5481145b6115f25760405162461bcd60e51b815260206004820152601c60248201527f476f6c644d696e744e46543a20556e6b6e6f776e207261726974792100000000604482015260640161075b565b600060146115ff8361220a565b604051602001611610929190612da9565b60408051601f1981840301815291815260008681526016602052206001015490915060ff1615611641579392505050565b60175460ff166116df576015805461165890612a8b565b80601f016020809104026020016040519081016040528092919081815260200182805461168490612a8b565b80156116d15780601f106116a6576101008083540402835291602001916116d1565b820191906000526020600020905b8154815290600101906020018083116116b457829003601f168201915b505050505092505050919050565b9392505050565b6116ee61199e565b600e546000908152600f6020526040812060018101546002909101546117149190612d8a565b600d546000908152600f60205260409020600181015460029091015461173a9190612d8a565b600c546000908152600f6020526040902060018101546002909101546117609190612d8a565b600b546000908152600f6020526040902060018101546002909101546117869190612d8a565b6117909190612a5a565b61179a9190612a5a565b6117a49190612a5a565b6010546040516370a0823160e01b815233600482015291925082916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156117f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118159190612abf565b10156118635760405162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e742066756e647320746f206465706f736974210000604482015260640161075b565b6010546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156118ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118de9190612ad8565b5060408051338152602081018390527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c910160405180910390a150565b61192361199e565b6001600160a01b0381166119885760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161075b565b610e22816120b7565b61199961199e565b601155565b600a546001600160a01b031633146110875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161075b565b600080805b600b546000908152600f6020526040902060020154821015611a3d57600b5460008381526012602052604090205581611a3581612a72565b9250506119fd565b50805b600c546000908152600f6020526040902060020154611a5f9082612a5a565b821015611a8a57600c5460008381526012602052604090205581611a8281612a72565b925050611a40565b50805b600d546000908152600f6020526040902060020154611aac9082612a5a565b821015611ad757600d5460008381526012602052604090205581611acf81612a72565b925050611a8d565b50805b600e546000908152600f6020526040902060020154611af99082612a5a565b821015611b2457600e5460008381526012602052604090205581611b1c81612a72565b925050611ada565b50919050565b60006001600160e01b031982166380ac58cd60e01b1480611b5b57506001600160e01b03198216635b5e139f60e01b145b8061062857506301ffc9a760e01b6001600160e01b0319831614610628565b6000818152600260205260409020546001600160a01b0316610e225760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161075b565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c0e82610e25565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000804442604051602001611c66929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c9050600060195482611c919190612e56565b6000818152601260205260409020549091505b600e548111611ce6576000818152600f60205260409020600281015460038201541015611cd357509392505050565b5080611cde81612a72565b915050611ca4565b506000818152601260205260409020545b600b548110611d39576000818152600f60205260409020600281015460038201541015611d2657509392505050565b5080611d3181612e6a565b915050611cf7565b6000935050505090565b6001600160a01b038216611d995760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161075b565b6000818152600260205260409020546001600160a01b031615611dfe5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161075b565b611e0a6000838361230b565b6001600160a01b0382166000908152600360205260408120805460019290611e33908490612a5a565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600080611e9d83610e25565b9050806001600160a01b0316846001600160a01b03161480611ee457506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80611f085750836001600160a01b0316611efd846106c0565b6001600160a01b0316145b949350505050565b826001600160a01b0316611f2382610e25565b6001600160a01b031614611f875760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161075b565b6001600160a01b038216611fe95760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161075b565b611ff483838361230b565b611fff600082611bd9565b6001600160a01b0383166000908152600360205260408120805460019290612028908490612e81565b90915550506001600160a01b0382166000908152600360205260408120805460019290612056908490612a5a565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03160361216a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161075b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6121e2848484611f10565b6121ee848484846123c3565b6114ba5760405162461bcd60e51b815260040161075b90612e98565b6060816000036122315750506040805180820190915260018152600360fc1b602082015290565b8160005b811561225b578061224581612a72565b91506122549050600a83612eea565b9150612235565b60008167ffffffffffffffff81111561227657612276612654565b6040519080825280601f01601f1916602001820160405280156122a0576020820181803683370190505b5090505b8415611f08576122b5600183612e81565b91506122c2600a86612e56565b6122cd906030612a5a565b60f81b8183815181106122e2576122e2612a2e565b60200101906001600160f81b031916908160001a905350612304600a86612eea565b94506122a4565b6001600160a01b0383166123665761236181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612389565b816001600160a01b0316836001600160a01b0316146123895761238983826124c4565b6001600160a01b0382166123a0576107fc81612561565b826001600160a01b0316826001600160a01b0316146107fc576107fc8282612610565b60006001600160a01b0384163b156124b957604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612407903390899088908890600401612efe565b6020604051808303816000875af1925050508015612442575060408051601f3d908101601f1916820190925261243f91810190612f3b565b60015b61249f573d808015612470576040519150601f19603f3d011682016040523d82523d6000602084013e612475565b606091505b5080516000036124975760405162461bcd60e51b815260040161075b90612e98565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f08565b506001949350505050565b600060016124d184610fef565b6124db9190612e81565b60008381526007602052604090205490915080821461252e576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061257390600190612e81565b6000838152600960205260408120546008805493945090928490811061259b5761259b612a2e565b9060005260206000200154905080600883815481106125bc576125bc612a2e565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806125f4576125f4612f58565b6001900381819060005260206000200160009055905550505050565b600061261b83610fef565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b634e487b7160e01b600052604160045260246000fd5b60006080828403121561267c57600080fd5b82601f83011261268b57600080fd5b6040516080810181811067ffffffffffffffff821117156126ae576126ae612654565b6040528060808401858111156126c357600080fd5b845b818110156126dd5780358352602092830192016126c5565b509195945050505050565b6001600160e01b031981168114610e2257600080fd5b60006020828403121561271057600080fd5b81356116df816126e8565b60005b8381101561273657818101518382015260200161271e565b838111156114ba5750506000910152565b6000815180845261275f81602086016020860161271b565b601f01601f19169290920160200192915050565b6020815260006116df6020830184612747565b60006020828403121561279857600080fd5b5035919050565b80356001600160a01b03811681146127b657600080fd5b919050565b600080604083850312156127ce57600080fd5b6127d78361279f565b946020939093013593505050565b6000806000606084860312156127fa57600080fd5b6128038461279f565b92506128116020850161279f565b9150604084013590509250925092565b600067ffffffffffffffff8084111561283c5761283c612654565b604051601f8501601f19908116603f0116810190828211818310171561286457612864612654565b8160405280935085815286868601111561287d57600080fd5b858560208301376000602087830101525050509392505050565b6000602082840312156128a957600080fd5b813567ffffffffffffffff8111156128c057600080fd5b8201601f810184136128d157600080fd5b611f0884823560208401612821565b600080604083850312156128f357600080fd5b50508035926020909101359150565b60006020828403121561291457600080fd5b6116df8261279f565b8015158114610e2257600080fd5b60006020828403121561293d57600080fd5b81356116df8161291d565b6000806040838503121561295b57600080fd5b6129648361279f565b915060208301356129748161291d565b809150509250929050565b6000806000806080858703121561299557600080fd5b61299e8561279f565b93506129ac6020860161279f565b925060408501359150606085013567ffffffffffffffff8111156129cf57600080fd5b8501601f810187136129e057600080fd5b6129ef87823560208401612821565b91505092959194509250565b60008060408385031215612a0e57600080fd5b612a178361279f565b9150612a256020840161279f565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612a6d57612a6d612a44565b500190565b600060018201612a8457612a84612a44565b5060010190565b600181811c90821680612a9f57607f821691505b602082108103611b2457634e487b7160e01b600052602260045260246000fd5b600060208284031215612ad157600080fd5b5051919050565b600060208284031215612aea57600080fd5b81516116df8161291d565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b601f8211156107fc57600081815260208120601f850160051c81016020861015612b6a5750805b601f850160051c820191505b81811015612b8957828155600101612b76565b505050505050565b815167ffffffffffffffff811115612bab57612bab612654565b612bbf81612bb98454612a8b565b84612b43565b602080601f831160018114612bf45760008415612bdc5750858301515b600019600386901b1c1916600185901b178555612b89565b600085815260208120601f198616915b82811015612c2357888601518255948401946001909101908401612c04565b5085821015612c415787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215612c6357600080fd5b815160ff811681146116df57600080fd5b600060ff821660ff841680821015612c8e57612c8e612a44565b90039392505050565b600181815b80851115612cd2578160001904821115612cb857612cb8612a44565b80851615612cc557918102915b93841c9390800290612c9c565b509250929050565b600082612ce957506001610628565b81612cf657506000610628565b8160018114612d0c5760028114612d1657612d32565b6001915050610628565b60ff841115612d2757612d27612a44565b50506001821b610628565b5060208310610133831016604e8410600b8410161715612d55575081810a610628565b612d5f8383612c97565b8060001904821115612d7357612d73612a44565b029392505050565b60006116df60ff841683612cda565b6000816000190483118215151615612da457612da4612a44565b500290565b6000808454612db781612a8b565b60018281168015612dcf5760018114612de457612e13565b60ff1984168752821515830287019450612e13565b8860005260208060002060005b85811015612e0a5781548a820152908401908201612df1565b50505082870194505b505050508351612e2781836020880161271b565b64173539b7b760d91b9101908152600501949350505050565b634e487b7160e01b600052601260045260246000fd5b600082612e6557612e65612e40565b500690565b600081612e7957612e79612a44565b506000190190565b600082821015612e9357612e93612a44565b500390565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082612ef957612ef9612e40565b500490565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612f3190830184612747565b9695505050505050565b600060208284031215612f4d57600080fd5b81516116df816126e8565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ab30badfd8c5bc3f1640087c548404b62c9f56099d4ed5a898b35e4dcb7adcab64736f6c634300080f0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000c476f6c644d696e74204e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007474c444d4e4654000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656966636979376a7935346237667a7a72626b3479657870716679676e64613666336a77796c6c71336f6765613534656164766d68752f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d61724d6d6a58656e59386d483350344d78784e6b6544717833737a45654e4163654478314a6d3770654862580000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061023d5760003560e01c806370a082311161013b578063ae169a50116100b8578063d0e30db01161007c578063d0e30db0146104cb578063e985e9c5146104d3578063f2fde38b1461050f578063f4a0a52814610522578063fdd6dbd61461053557600080fd5b8063ae169a501461046c578063b88d4fde1461047f578063bd5f3d3814610492578063bedb86fb146104a5578063c87b56dd146104b857600080fd5b8063940cd05b116100ff578063940cd05b1461040557806395d89b41146104185780639b624e7b146104205780639e34070f14610433578063a22cb4651461045957600080fd5b806370a08231146103b9578063715018a6146103cc5780637485d8dc146103d45780638456cb59146103e75780638da5cb5b146103f457600080fd5b80632e1a7d4d116101c957806355f804b31161018d57806355f804b314610365578063595882b3146103785780636352211e14610380578063654e51e7146103935780636a326ab1146103a657600080fd5b80632e1a7d4d1461030c5780632f745c591461031f57806342842e0e146103325780634f6ccce714610345578063518302271461035857600080fd5b8063095ea7b311610210578063095ea7b3146102bf5780631249c58b146102d2578063146ca531146102e857806318160ddd146102f157806323b872dd146102f957600080fd5b80630173351b1461024257806301ffc9a71461025757806306fdde031461027f578063081812fc14610294575b600080fd5b61025561025036600461266a565b61053e565b005b61026a6102653660046126fe565b610603565b60405190151581526020015b60405180910390f35b61028761062e565b6040516102769190612773565b6102a76102a2366004612786565b6106c0565b6040516001600160a01b039091168152602001610276565b6102556102cd3660046127bb565b6106e7565b6102da610801565b604051908152602001610276565b6102da601a5481565b6008546102da565b6102556103073660046127e5565b610afc565b61025561031a366004612786565b610b2d565b6102da61032d3660046127bb565b610c8f565b6102556103403660046127e5565b610d25565b6102da610353366004612786565b610d40565b60175461026a9060ff1681565b610255610373366004612897565b610dd3565b610255610de7565b6102a761038e366004612786565b610e25565b6102556103a13660046128e0565b610e85565b6102556103b4366004612902565b610ea2565b6102da6103c7366004612902565b610fef565b610255611075565b6010546102a7906001600160a01b031681565b601b5461026a9060ff1681565b600a546001600160a01b03166102a7565b61025561041336600461292b565b611089565b61028761111a565b61025561042e366004612786565b611129565b61026a610441366004612786565b60009081526016602052604090206001015460ff1690565b610255610467366004612948565b611136565b61025561047a366004612786565b611141565b61025561048d36600461297f565b611488565b6102556104a0366004612897565b6114c0565b6102556104b336600461292b565b6114d4565b6102876104c6366004612786565b6114ef565b6102556116e6565b61026a6104e13660046129fb565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61025561051d366004612902565b61191b565b610255610530366004612786565b611991565b6102da60195481565b61054661199e565b60005b60048110156105c65781816004811061056457610564612a2e565b6020020151600f6000610578846001612a5a565b8152602001908152602001600020600201819055506000600f60008360016105a09190612a5a565b8152602081019190915260400160002060030155806105be81612a72565b915050610549565b506105cf6119f8565b6019819055601880546000906105e6908490612a5a565b9091555050601a80549060006105fb83612a72565b919050555050565b60006001600160e01b0319821663780e9d6360e01b1480610628575061062882611b2a565b92915050565b60606000805461063d90612a8b565b80601f016020809104026020016040519081016040528092919081815260200182805461066990612a8b565b80156106b65780601f1061068b576101008083540402835291602001916106b6565b820191906000526020600020905b81548152906001019060200180831161069957829003601f168201915b5050505050905090565b60006106cb82611b7a565b506000908152600460205260409020546001600160a01b031690565b60006106f282610e25565b9050806001600160a01b0316836001600160a01b0316036107645760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610780575061078081336104e1565b6107f25760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000606482015260840161075b565b6107fc8383611bd9565b505050565b60135460009060ff16151560011461085b5760405162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206973206e6f7420696e6974656420796574210000000000604482015260640161075b565b601b5460ff16156108ae5760405162461bcd60e51b815260206004820152601d60248201527f5b476f6c644d696e744e46545d2050617573656420746f206d696e7421000000604482015260640161075b565b6011546010546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156108f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091d9190612abf565b10156109765760405162461bcd60e51b815260206004820152602260248201527f5b4d494e545d20496e73756666696369656e742066756e647320746f206d696e604482015261742160f01b606482015260840161075b565b600061098160085490565b61098c906001612a5a565b90506000610998611c47565b905080600003610a015760405162461bcd60e51b815260206004820152602e60248201527f416c6c204e46547320617265206d696e7465642e204e6f742061626c6520746f60448201526d206d696e7420616e796d6f72652160901b606482015260840161075b565b6010546011546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a809190612ad8565b506000828152601660209081526040808320849055838352600f9091528120600301805460019290610ab3908490612a5a565b90915550610ac390503383611d43565b6040513381527f78df45fb2ab5f8a03a580be8844aee5b3767e94ca1680ee2e9379f6c70460dbe9060200160405180910390a192915050565b610b063382611e91565b610b225760405162461bcd60e51b815260040161075b90612af5565b6107fc838383611f10565b610b3561199e565b6010546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610b7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba19190612abf565b811115610c165760405162461bcd60e51b815260206004820152603c60248201527f5b476f644d696e744e46545d2043616e6e6f742077697468726177206d6f726560448201527f207468616e2062616c616e6365207468697320636f6e74726163742100000000606482015260840161075b565b60105460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8b9190612ad8565b5050565b6000610c9a83610fef565b8210610cfc5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b606482015260840161075b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6107fc83838360405180602001604052806000815250611488565b6000610d4b60085490565b8210610dae5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b606482015260840161075b565b60088281548110610dc157610dc1612a2e565b90600052602060002001549050919050565b610ddb61199e565b6014610c8b8282612b91565b610def61199e565b6000610dfa60085490565b90505b601854811015610e2257610e0f610801565b5080610e1a81612a72565b915050610dfd565b50565b6000818152600260205260408120546001600160a01b0316806106285760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161075b565b610e8d61199e565b6000918252600f602052604090912060010155565b610eaa61199e565b601080546001600160a01b0319166001600160a01b0383169081179091556040805163313ce56760e01b81529051600092600292909163313ce567916004808201926020929091908290030181865afa158015610f0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2f9190612c51565b610f399190612c74565b90506000610f4882600a612d7b565b9050610f5581602c612d8a565b601155610f638160fa612d8a565b600b546000908152600f6020526040902060010155610f83816064612d8a565b600c546000908152600f6020526040902060010155610fa3816014612d8a565b600d546000908152600f6020526040902060010155610fc381600a612d8a565b600e546000908152600f602052604090206001908101919091556013805460ff19169091179055505050565b60006001600160a01b0382166110595760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840161075b565b506001600160a01b031660009081526003602052604090205490565b61107d61199e565b61108760006120b7565b565b61109161199e565b80151560010361110757601854600854146111075760405162461bcd60e51b815260206004820152603060248201527f5b476f6c644d696e744e46545d204e6f7420616c6c204e46547320686176652060448201526f6265656e206d696e746564207965742160801b606482015260840161075b565b6017805460ff1916911515919091179055565b60606001805461063d90612a8b565b61113161199e565b601a55565b610c8b338383612109565b600081815260166020908152604080832054808452600f909252822060010154909161116c84610e25565b60175490915060ff1615156001146111ec5760405162461bcd60e51b815260206004820152603e60248201527f5b476f6c644d696e744e46545d203a2043616e6e6f742067657420726577617260448201527f647320756e6465722074686520756e72657665616c6564207374617465210000606482015260840161075b565b6001600160a01b038116331461125c5760405162461bcd60e51b815260206004820152602f60248201527f476f6c644d696e744e46543a20596f7520617265206e6f7420746865206f776e60448201526e6572206f662074686973204e46542160881b606482015260840161075b565b6010546040516370a0823160e01b815230600482015283916001600160a01b0316906370a0823190602401602060405180830381865afa1580156112a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c89190612abf565b101561132d5760405162461bcd60e51b815260206004820152602e60248201527f5b476f6c644d696e744e46545d20496e73756666696369656e742062616c616e60448201526d31b2903337b9103932bbb0b9321760911b606482015260840161075b565b60008481526016602052604090206001015460ff16156113ac5760405162461bcd60e51b815260206004820152603460248201527f5b476f6c644d696e744e46545d20596f75206861766520616c7265616479207260448201527332b1b2b4bb32b2103a3432903932bbb0b932399760611b606482015260840161075b565b60105460405163a9059cbb60e01b8152336004820152602481018490526001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156113fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114219190612ad8565b506000848152601660209081526040918290206001908101805460ff1916909117905581513381529081018690529081018390527fe74e5c9d4ac1fc33412485f18c159a0a391efe287ab3fd271123f30e6bacf4e39060600160405180910390a150505050565b6114923383611e91565b6114ae5760405162461bcd60e51b815260040161075b90612af5565b6114ba848484846121d7565b50505050565b6114c861199e565b6015610c8b8282612b91565b6114dc61199e565b601b805460ff1916911515919091179055565b6000818152600260205260409020546060906001600160a01b031661156e5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161075b565b600082815260166020526040902054600b5481148061158e5750600c5481145b8061159a5750600d5481145b806115a65750600e5481145b6115f25760405162461bcd60e51b815260206004820152601c60248201527f476f6c644d696e744e46543a20556e6b6e6f776e207261726974792100000000604482015260640161075b565b600060146115ff8361220a565b604051602001611610929190612da9565b60408051601f1981840301815291815260008681526016602052206001015490915060ff1615611641579392505050565b60175460ff166116df576015805461165890612a8b565b80601f016020809104026020016040519081016040528092919081815260200182805461168490612a8b565b80156116d15780601f106116a6576101008083540402835291602001916116d1565b820191906000526020600020905b8154815290600101906020018083116116b457829003601f168201915b505050505092505050919050565b9392505050565b6116ee61199e565b600e546000908152600f6020526040812060018101546002909101546117149190612d8a565b600d546000908152600f60205260409020600181015460029091015461173a9190612d8a565b600c546000908152600f6020526040902060018101546002909101546117609190612d8a565b600b546000908152600f6020526040902060018101546002909101546117869190612d8a565b6117909190612a5a565b61179a9190612a5a565b6117a49190612a5a565b6010546040516370a0823160e01b815233600482015291925082916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156117f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118159190612abf565b10156118635760405162461bcd60e51b815260206004820152601e60248201527f496e73756666696369656e742066756e647320746f206465706f736974210000604482015260640161075b565b6010546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156118ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118de9190612ad8565b5060408051338152602081018390527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c910160405180910390a150565b61192361199e565b6001600160a01b0381166119885760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161075b565b610e22816120b7565b61199961199e565b601155565b600a546001600160a01b031633146110875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161075b565b600080805b600b546000908152600f6020526040902060020154821015611a3d57600b5460008381526012602052604090205581611a3581612a72565b9250506119fd565b50805b600c546000908152600f6020526040902060020154611a5f9082612a5a565b821015611a8a57600c5460008381526012602052604090205581611a8281612a72565b925050611a40565b50805b600d546000908152600f6020526040902060020154611aac9082612a5a565b821015611ad757600d5460008381526012602052604090205581611acf81612a72565b925050611a8d565b50805b600e546000908152600f6020526040902060020154611af99082612a5a565b821015611b2457600e5460008381526012602052604090205581611b1c81612a72565b925050611ada565b50919050565b60006001600160e01b031982166380ac58cd60e01b1480611b5b57506001600160e01b03198216635b5e139f60e01b145b8061062857506301ffc9a760e01b6001600160e01b0319831614610628565b6000818152600260205260409020546001600160a01b0316610e225760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640161075b565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c0e82610e25565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000804442604051602001611c66929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c9050600060195482611c919190612e56565b6000818152601260205260409020549091505b600e548111611ce6576000818152600f60205260409020600281015460038201541015611cd357509392505050565b5080611cde81612a72565b915050611ca4565b506000818152601260205260409020545b600b548110611d39576000818152600f60205260409020600281015460038201541015611d2657509392505050565b5080611d3181612e6a565b915050611cf7565b6000935050505090565b6001600160a01b038216611d995760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161075b565b6000818152600260205260409020546001600160a01b031615611dfe5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161075b565b611e0a6000838361230b565b6001600160a01b0382166000908152600360205260408120805460019290611e33908490612a5a565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600080611e9d83610e25565b9050806001600160a01b0316846001600160a01b03161480611ee457506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80611f085750836001600160a01b0316611efd846106c0565b6001600160a01b0316145b949350505050565b826001600160a01b0316611f2382610e25565b6001600160a01b031614611f875760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b606482015260840161075b565b6001600160a01b038216611fe95760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161075b565b611ff483838361230b565b611fff600082611bd9565b6001600160a01b0383166000908152600360205260408120805460019290612028908490612e81565b90915550506001600160a01b0382166000908152600360205260408120805460019290612056908490612a5a565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b03160361216a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161075b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6121e2848484611f10565b6121ee848484846123c3565b6114ba5760405162461bcd60e51b815260040161075b90612e98565b6060816000036122315750506040805180820190915260018152600360fc1b602082015290565b8160005b811561225b578061224581612a72565b91506122549050600a83612eea565b9150612235565b60008167ffffffffffffffff81111561227657612276612654565b6040519080825280601f01601f1916602001820160405280156122a0576020820181803683370190505b5090505b8415611f08576122b5600183612e81565b91506122c2600a86612e56565b6122cd906030612a5a565b60f81b8183815181106122e2576122e2612a2e565b60200101906001600160f81b031916908160001a905350612304600a86612eea565b94506122a4565b6001600160a01b0383166123665761236181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612389565b816001600160a01b0316836001600160a01b0316146123895761238983826124c4565b6001600160a01b0382166123a0576107fc81612561565b826001600160a01b0316826001600160a01b0316146107fc576107fc8282612610565b60006001600160a01b0384163b156124b957604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612407903390899088908890600401612efe565b6020604051808303816000875af1925050508015612442575060408051601f3d908101601f1916820190925261243f91810190612f3b565b60015b61249f573d808015612470576040519150601f19603f3d011682016040523d82523d6000602084013e612475565b606091505b5080516000036124975760405162461bcd60e51b815260040161075b90612e98565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f08565b506001949350505050565b600060016124d184610fef565b6124db9190612e81565b60008381526007602052604090205490915080821461252e576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061257390600190612e81565b6000838152600960205260408120546008805493945090928490811061259b5761259b612a2e565b9060005260206000200154905080600883815481106125bc576125bc612a2e565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806125f4576125f4612f58565b6001900381819060005260206000200160009055905550505050565b600061261b83610fef565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b634e487b7160e01b600052604160045260246000fd5b60006080828403121561267c57600080fd5b82601f83011261268b57600080fd5b6040516080810181811067ffffffffffffffff821117156126ae576126ae612654565b6040528060808401858111156126c357600080fd5b845b818110156126dd5780358352602092830192016126c5565b509195945050505050565b6001600160e01b031981168114610e2257600080fd5b60006020828403121561271057600080fd5b81356116df816126e8565b60005b8381101561273657818101518382015260200161271e565b838111156114ba5750506000910152565b6000815180845261275f81602086016020860161271b565b601f01601f19169290920160200192915050565b6020815260006116df6020830184612747565b60006020828403121561279857600080fd5b5035919050565b80356001600160a01b03811681146127b657600080fd5b919050565b600080604083850312156127ce57600080fd5b6127d78361279f565b946020939093013593505050565b6000806000606084860312156127fa57600080fd5b6128038461279f565b92506128116020850161279f565b9150604084013590509250925092565b600067ffffffffffffffff8084111561283c5761283c612654565b604051601f8501601f19908116603f0116810190828211818310171561286457612864612654565b8160405280935085815286868601111561287d57600080fd5b858560208301376000602087830101525050509392505050565b6000602082840312156128a957600080fd5b813567ffffffffffffffff8111156128c057600080fd5b8201601f810184136128d157600080fd5b611f0884823560208401612821565b600080604083850312156128f357600080fd5b50508035926020909101359150565b60006020828403121561291457600080fd5b6116df8261279f565b8015158114610e2257600080fd5b60006020828403121561293d57600080fd5b81356116df8161291d565b6000806040838503121561295b57600080fd5b6129648361279f565b915060208301356129748161291d565b809150509250929050565b6000806000806080858703121561299557600080fd5b61299e8561279f565b93506129ac6020860161279f565b925060408501359150606085013567ffffffffffffffff8111156129cf57600080fd5b8501601f810187136129e057600080fd5b6129ef87823560208401612821565b91505092959194509250565b60008060408385031215612a0e57600080fd5b612a178361279f565b9150612a256020840161279f565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612a6d57612a6d612a44565b500190565b600060018201612a8457612a84612a44565b5060010190565b600181811c90821680612a9f57607f821691505b602082108103611b2457634e487b7160e01b600052602260045260246000fd5b600060208284031215612ad157600080fd5b5051919050565b600060208284031215612aea57600080fd5b81516116df8161291d565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b601f8211156107fc57600081815260208120601f850160051c81016020861015612b6a5750805b601f850160051c820191505b81811015612b8957828155600101612b76565b505050505050565b815167ffffffffffffffff811115612bab57612bab612654565b612bbf81612bb98454612a8b565b84612b43565b602080601f831160018114612bf45760008415612bdc5750858301515b600019600386901b1c1916600185901b178555612b89565b600085815260208120601f198616915b82811015612c2357888601518255948401946001909101908401612c04565b5085821015612c415787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215612c6357600080fd5b815160ff811681146116df57600080fd5b600060ff821660ff841680821015612c8e57612c8e612a44565b90039392505050565b600181815b80851115612cd2578160001904821115612cb857612cb8612a44565b80851615612cc557918102915b93841c9390800290612c9c565b509250929050565b600082612ce957506001610628565b81612cf657506000610628565b8160018114612d0c5760028114612d1657612d32565b6001915050610628565b60ff841115612d2757612d27612a44565b50506001821b610628565b5060208310610133831016604e8410600b8410161715612d55575081810a610628565b612d5f8383612c97565b8060001904821115612d7357612d73612a44565b029392505050565b60006116df60ff841683612cda565b6000816000190483118215151615612da457612da4612a44565b500290565b6000808454612db781612a8b565b60018281168015612dcf5760018114612de457612e13565b60ff1984168752821515830287019450612e13565b8860005260208060002060005b85811015612e0a5781548a820152908401908201612df1565b50505082870194505b505050508351612e2781836020880161271b565b64173539b7b760d91b9101908152600501949350505050565b634e487b7160e01b600052601260045260246000fd5b600082612e6557612e65612e40565b500690565b600081612e7957612e79612a44565b506000190190565b600082821015612e9357612e93612a44565b500390565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082612ef957612ef9612e40565b500490565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612f3190830184612747565b9695505050505050565b600060208284031215612f4d57600080fd5b81516116df816126e8565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220ab30badfd8c5bc3f1640087c548404b62c9f56099d4ed5a898b35e4dcb7adcab64736f6c634300080f0033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000c476f6c644d696e74204e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007474c444d4e4654000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656966636979376a7935346237667a7a72626b3479657870716679676e64613666336a77796c6c71336f6765613534656164766d68752f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d61724d6d6a58656e59386d483350344d78784e6b6544717833737a45654e4163654478314a6d3770654862580000000000000000000000

-----Decoded View---------------
Arg [0] : name_ (string): GoldMint NFT
Arg [1] : symbol_ (string): GLDMNFT
Arg [2] : baseURI_ (string): ipfs://bafybeifciy7jy54b7fzzrbk4yexpqfygnda6f3jwyllq3ogea54eadvmhu/
Arg [3] : dummyURI_ (string): ipfs://QmarMmjXenY8mH3P4MxxNkeDqx3szEeNAceDx1Jm7peHbX

-----Encoded View---------------
15 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000c
Arg [5] : 476f6c644d696e74204e46540000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [7] : 474c444d4e465400000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [9] : 697066733a2f2f6261667962656966636979376a7935346237667a7a72626b34
Arg [10] : 79657870716679676e64613666336a77796c6c71336f6765613534656164766d
Arg [11] : 68752f0000000000000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000035
Arg [13] : 697066733a2f2f516d61724d6d6a58656e59386d483350344d78784e6b654471
Arg [14] : 7833737a45654e4163654478314a6d3770654862580000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.