Token Balto Origin NFT

 

Overview [ERC-721]

Max Total Supply:
395 BaltoAlpha

Holders:
83

Transfers:
-

 
Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
BaltoOriginNft

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 15 : BaltoOriginNft.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/**
 * @author Brewlabs
 * This contract has been developed by brewlabs.info
 */
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

contract BaltoOriginNft is Ownable, ERC721URIStorage, ReentrancyGuard {
  using Strings for uint256;

  uint256 private constant MAX_SUPPLY = 5000;
  bool public mintAllowed = false;

  string private _tokenBaseURI = "";
  // Optional mapping for token URIs
  mapping(uint256 => string) private _tokenURIs;

  bytes32 private merkleRoot;
  mapping(address => uint256) public numOfMints;

  uint256 public totalSupply = 0;
  uint256 public currentPhase;

  uint256 public oneTimeMintLimit = 40;
  uint256[7] public lastTokenIds = [350, 850, 1700, 2550, 3400, 4250, 5000];
  uint256[7] public prices = [0.03 ether, 0.04 ether, 0.04 ether, 0.04 ether, 0.05 ether, 0.05 ether, 0.06 ether];

  address public treasury = 0x2874054656ab183BCe742deF5994d0B3BD6f6aF8;
  address public feeWallet = 0x2874054656ab183BCe742deF5994d0B3BD6f6aF8;
  uint256 public performanceFee = 0.0023 ether;

  event MintEnabled();
  event MoveToNextPhase(uint256 phase);
  event Mint(address indexed user, uint256 tokenId);
  event BaseURIUpdated(string uri);

  event SetMintPrice(uint256 phase, uint256 price);
  event SetLastTokenId(uint256 phase, uint256 lastTokenId);
  event SetOneTimeMintLimit(uint256 limit);
  event SetWhitelist(bytes32 whitelistMerkleRoot);

  event SetFeeWallet(address wallet);
  event ServiceInfoUpadted(address wallet, uint256 fee);
  event AdminTokenRecovered(address tokenRecovered, uint256 amount);

  modifier onlyMintable() {
    require(mintAllowed && totalSupply < MAX_SUPPLY, "cannot mint");
    _;
  }

  constructor() ERC721("Balto Origin NFT", "BaltoAlpha") {}

  function mint(
    bytes32[] memory _merkleProof,
    uint256 _numToMint,
    uint256 _maxToMint
  ) external payable onlyMintable nonReentrant {
    require(_numToMint > 0, "invalid amount");
    require(_numToMint <= oneTimeMintLimit, "exceed one-time mint limit");
    require(totalSupply + _numToMint <= lastTokenIds[currentPhase - 1], "Exceed current phase limit");

    uint256 price = prices[currentPhase - 1] * _numToMint;

    bytes32 leaf = keccak256(abi.encodePacked(msg.sender, _maxToMint));
    if (MerkleProof.verify(_merkleProof, merkleRoot, leaf)) {
      if (numOfMints[msg.sender] < _maxToMint) {
        uint256 remainedFreeMint = _maxToMint - numOfMints[msg.sender];
        if (remainedFreeMint >= _numToMint) {
          price = 0;
        } else {
          price -= prices[currentPhase - 1] * remainedFreeMint;
        }
      }
    }
    require(msg.value >= price + performanceFee, "insufficient eth amount for mint");

    payable(feeWallet).transfer(price);
    payable(treasury).transfer(performanceFee);
    if (msg.value > price + performanceFee) {
      payable(msg.sender).transfer(msg.value - price - performanceFee);
    }

    numOfMints[msg.sender] += _numToMint;
    for (uint256 i = 0; i < _numToMint; i++) {
      uint256 tokenId = totalSupply + i + 1;

      _safeMint(msg.sender, tokenId);
      _setTokenURI(tokenId, tokenId.toString());
      super._setTokenURI(tokenId, tokenId.toString());

      emit Mint(msg.sender, tokenId);
    }

    totalSupply += _numToMint;
    if (totalSupply == MAX_SUPPLY) {
      mintAllowed = false;
    } else {
      if (totalSupply >= lastTokenIds[currentPhase - 1]) currentPhase += 1;
    }
  }

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

    string memory _tokenURI = _tokenURIs[tokenId];
    string memory base = _baseURI();

    // If there is no base URI, return the token URI.
    if (bytes(base).length == 0) {
      return _tokenURI;
    }
    // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
    if (bytes(_tokenURI).length > 0) {
      return string(abi.encodePacked(_baseURI(), _tokenURI));
    }

    return super.tokenURI(tokenId);
  }

  function enableMint() external onlyOwner {
    require(merkleRoot != "", "Whitelist not set");
    require(!mintAllowed, "already enabled");
    require(currentPhase == 0, "mint already finished");

    currentPhase = 1;
    mintAllowed = true;

    emit MintEnabled();
  }

  function moveToNextPhase() external onlyOwner {
    require(mintAllowed, "mint not enabled");
    require(currentPhase < 7, "reached last phase");

    lastTokenIds[currentPhase - 1] = totalSupply;
    currentPhase++;
    emit MoveToNextPhase(currentPhase);
  }

  function setMintPrice(uint256 _phase, uint256 _price) external onlyOwner {
    require(_phase <= 7 && _phase > 0, "invalid phase");
    require(_phase >= currentPhase, "cannot update mint price of previous phase");
    prices[_phase - 1] = _price;

    emit SetMintPrice(_phase, _price);
  }

  function setLastTokenIdForPhase(uint256 _phase, uint256 _lastTokenId) external onlyOwner {
    require(_phase <= 7 && _phase > 0, "invalid phase");
    require(_phase < 7, "cannot set last tokenId for last phase");
    require(_phase >= currentPhase, "cannot update last tokenId of previous phase");

    require(_lastTokenId <= MAX_SUPPLY, "exceed max supply");
    require(_lastTokenId >= totalSupply, "use upcoming tokenId");
    require(_lastTokenId < lastTokenIds[_phase], "use a tokenId less than last tokenId in next phase");
    if(_phase > 1) {
      require(_lastTokenId > lastTokenIds[_phase - 2], "use a tokenId greater than last tokenId in prev phase");
    }

    lastTokenIds[_phase - 1] = _lastTokenId;
    emit SetLastTokenId(_phase, _lastTokenId);
  }

  function setOneTimeMintLimit(uint256 _limit) external onlyOwner {
    require(_limit <= 150, "cannot exceed 150");
    oneTimeMintLimit = _limit;
    emit SetOneTimeMintLimit(_limit);
  }

  function setAdminWallet(address _wallet) external onlyOwner {
    require(_wallet != address(0x0), "invalid address");
    feeWallet = _wallet;
    emit SetFeeWallet(_wallet);
  }

  function setServiceInfo(address _treasury, uint256 _fee) external onlyOwner {
    require(_treasury != address(0x0), "invalid address");
    treasury = _treasury;
    performanceFee = _fee;
    emit ServiceInfoUpadted(_treasury, _fee);
  }

  function setWhiteList(bytes32 _merkleRoot) external onlyOwner {
    require(_merkleRoot != "", "invalid merkle root");
    merkleRoot = _merkleRoot;
    emit SetWhitelist(_merkleRoot);
  }

  function rescueTokens(address _token, uint256 _amount) external onlyOwner {
    if (_token == address(0x0)) {
      payable(msg.sender).transfer(_amount);
    } else {
      IERC20(_token).transfer(address(msg.sender), _amount);
    }

    emit AdminTokenRecovered(_token, _amount);
  }

  function setTokenBaseUri(string memory _uri) external onlyOwner {
    _tokenBaseURI = _uri;
    emit BaseURIUpdated(_uri);
  }

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

  function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal override {
    require(_exists(tokenId), "BaltoOriginNft: URI set of nonexistent token");
    _tokenURIs[tokenId] = _tokenURI;
  }

  receive() external payable {}
}

File 2 of 15 : 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 3 of 15 : 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 15 : 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 5 of 15 : ERC721URIStorage.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721URIStorage.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";

/**
 * @dev ERC721 token with storage based token URI management.
 */
abstract contract ERC721URIStorage is ERC721 {
    using Strings for uint256;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

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

        string memory _tokenURI = _tokenURIs[tokenId];
        string memory base = _baseURI();

        // If there is no base URI, return the token URI.
        if (bytes(base).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(base, _tokenURI));
        }

        return super.tokenURI(tokenId);
    }

    /**
     * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
        require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token");
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @dev See {ERC721-_burn}. This override additionally checks to see if a
     * token-specific URI was set for the token, and if so, it deletes the token URI from
     * the storage mapping.
     */
    function _burn(uint256 tokenId) internal virtual override {
        super._burn(tokenId);

        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

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

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

    /**
     * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
     * consuming from one or the other at each step according to the instructions given by
     * `proofFlags`.
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

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

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

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

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

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

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

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

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

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

File 8 of 15 : 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 9 of 15 : 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 10 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 11 of 15 : 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 12 of 15 : 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 13 of 15 : 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 14 of 15 : 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 15 of 15 : 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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenRecovered","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AdminTokenRecovered","type":"event"},{"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":"string","name":"uri","type":"string"}],"name":"BaseURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[],"name":"MintEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"phase","type":"uint256"}],"name":"MoveToNextPhase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"ServiceInfoUpadted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"}],"name":"SetFeeWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"phase","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastTokenId","type":"uint256"}],"name":"SetLastTokenId","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"phase","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"SetMintPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"SetOneTimeMintLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"whitelistMerkleRoot","type":"bytes32"}],"name":"SetWhitelist","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":[],"name":"currentPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"","type":"uint256"}],"name":"lastTokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_numToMint","type":"uint256"},{"internalType":"uint256","name":"_maxToMint","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"moveToNextPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numOfMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oneTimeMintLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"performanceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"prices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"setAdminWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phase","type":"uint256"},{"internalType":"uint256","name":"_lastTokenId","type":"uint256"}],"name":"setLastTokenIdForPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phase","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"setOneTimeMintLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setServiceInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6009805460ff1916905560a06040819052600060808190526200002591600a9162000227565b506000600e5560286010556040805160e08101825261015e815261035260208201526106a4918101919091526109f66060820152610d48608082015261109a60a082015261138860c082015262000081906011906007620002b6565b506040805160e081018252666a94d74f4300008152668e1bc9bf04000060208201819052918101829052606081019190915266b1a2bc2ec500006080820181905260a082015266d529ae9e86000060c0820152620000e4906018906007620002ed565b50601f8054732874054656ab183bce742def5994d0b3bd6f6af86001600160a01b0319918216811790925560208054909116909117905566082bd67afbc0006021553480156200013357600080fd5b506040518060400160405280601081526020016f10985b1d1bc813dc9a59da5b8813919560821b8152506040518060400160405280600a81526020016942616c746f416c70686160b01b8152506200019a62000194620001d360201b60201c565b620001d7565b8151620001af90600190602085019062000227565b508051620001c590600290602084019062000227565b50506001600855506200037c565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054620002359062000340565b90600052602060002090601f016020900481019282620002595760008555620002a4565b82601f106200027457805160ff1916838001178555620002a4565b82800160010185558215620002a4579182015b82811115620002a457825182559160200191906001019062000287565b50620002b292915062000329565b5090565b8260078101928215620002a4579160200282015b82811115620002a4578251829061ffff16905591602001919060010190620002ca565b8260078101928215620002a4579160200282015b82811115620002a4578251829066ffffffffffffff1690559160200191906001019062000301565b5b80821115620002b257600081556001016200032a565b600181811c908216806200035557607f821691505b6020821081036200037657634e487b7160e01b600052602260045260246000fd5b50919050565b612d5d806200038c6000396000f3fe6080604052600436106101ee5760003560e01c80636b0815f311610113578063b4cc927d116100ab578063c87b56dd1161006f578063c87b56dd146105e8578063e6fe107c14610608578063e985e9c51461061d578063f25f4b561461063d578063f2fde38b1461065d57600080fd5b8063b4cc927d14610541578063b88d4fde1461056e578063bc31c1c11461058e578063be8a2d22146105ae578063c467201e146105ce57600080fd5b80636b0815f31461044d57806370a082311461046d578063715018a61461048d57806381b61948146104a257806387788782146104c25780638da5cb5b146104d857806395d89b41146104f6578063a22cb4651461050b578063a47e483e1461052b57600080fd5b8063350829331161018657806335082933146103385780633f87db251461035857806342842e0e1461037857806344b28d5914610398578063530f0874146103ad57806357376198146103cd57806361d027b3146103ed5780636352211e1461040d57806364d4b23d1461042d57600080fd5b806301ffc9a7146101fa5780630442bfa81461022f578063055ad42e1461025157806306fdde0314610275578063081812fc14610297578063095ea7b3146102cf57806314bf9af6146102ef57806318160ddd1461030257806323b872dd1461031857600080fd5b366101f557005b600080fd5b34801561020657600080fd5b5061021a610215366004612649565b61067d565b60405190151581526020015b60405180910390f35b34801561023b57600080fd5b5061024f61024a366004612666565b6106cf565b005b34801561025d57600080fd5b50610267600f5481565b604051908152602001610226565b34801561028157600080fd5b5061028a6107d0565b60405161022691906126e0565b3480156102a357600080fd5b506102b76102b23660046126f3565b610862565b6040516001600160a01b039091168152602001610226565b3480156102db57600080fd5b5061024f6102ea366004612728565b610889565b61024f6102fd366004612799565b61099e565b34801561030e57600080fd5b50610267600e5481565b34801561032457600080fd5b5061024f61033336600461284f565b610ecd565b34801561034457600080fd5b5061024f61035336600461288b565b610efe565b34801561036457600080fd5b5061024f6103733660046128fe565b610f7e565b34801561038457600080fd5b5061024f61039336600461284f565b610fc9565b3480156103a457600080fd5b5061024f610fe4565b3480156103b957600080fd5b5061024f6103c8366004612666565b6110fe565b3480156103d957600080fd5b5061024f6103e8366004612728565b6113f0565b3480156103f957600080fd5b50601f546102b7906001600160a01b031681565b34801561041957600080fd5b506102b76104283660046126f3565b6114dd565b34801561043957600080fd5b5061024f6104483660046126f3565b611512565b34801561045957600080fd5b5061024f6104683660046126f3565b611594565b34801561047957600080fd5b5061026761048836600461288b565b611617565b34801561049957600080fd5b5061024f61169d565b3480156104ae57600080fd5b5061024f6104bd366004612728565b6116b1565b3480156104ce57600080fd5b5061026760215481565b3480156104e457600080fd5b506000546001600160a01b03166102b7565b34801561050257600080fd5b5061028a611731565b34801561051757600080fd5b5061024f610526366004612955565b611740565b34801561053757600080fd5b5061026760105481565b34801561054d57600080fd5b5061026761055c36600461288b565b600d6020526000908152604090205481565b34801561057a57600080fd5b5061024f61058936600461298c565b61174f565b34801561059a57600080fd5b506102676105a93660046126f3565b611787565b3480156105ba57600080fd5b506102676105c93660046126f3565b61179e565b3480156105da57600080fd5b5060095461021a9060ff1681565b3480156105f457600080fd5b5061028a6106033660046126f3565b6117ae565b34801561061457600080fd5b5061024f611918565b34801561062957600080fd5b5061021a610638366004612a08565b611a24565b34801561064957600080fd5b506020546102b7906001600160a01b031681565b34801561066957600080fd5b5061024f61067836600461288b565b611a52565b60006001600160e01b031982166380ac58cd60e01b14806106ae57506001600160e01b03198216635b5e139f60e01b145b806106c957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6106d7611acb565b600782111580156106e85750600082115b61070d5760405162461bcd60e51b815260040161070490612a3b565b60405180910390fd5b600f548210156107725760405162461bcd60e51b815260206004820152602a60248201527f63616e6e6f7420757064617465206d696e74207072696365206f662070726576604482015269696f757320706861736560b01b6064820152608401610704565b806018610780600185612a78565b6007811061079057610790612a8f565b015560408051838152602081018390527f44d4a06d863160370919caa06915c580288234ffbd37e330623be1d73574dea291015b60405180910390a15050565b6060600180546107df90612aa5565b80601f016020809104026020016040519081016040528092919081815260200182805461080b90612aa5565b80156108585780601f1061082d57610100808354040283529160200191610858565b820191906000526020600020905b81548152906001019060200180831161083b57829003601f168201915b5050505050905090565b600061086d82611b25565b506000908152600560205260409020546001600160a01b031690565b6000610894826114dd565b9050806001600160a01b0316836001600160a01b0316036109015760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610704565b336001600160a01b038216148061091d575061091d8133611a24565b61098f5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610704565b6109998383611b4a565b505050565b60095460ff1680156109b35750611388600e54105b6109ed5760405162461bcd60e51b815260206004820152600b60248201526a18d85b9b9bdd081b5a5b9d60aa1b6044820152606401610704565b600260085403610a3f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610704565b600260085581610a825760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610704565b601054821115610ad45760405162461bcd60e51b815260206004820152601a60248201527f657863656564206f6e652d74696d65206d696e74206c696d69740000000000006044820152606401610704565b60116001600f54610ae59190612a78565b60078110610af557610af5612a8f565b015482600e54610b059190612adf565b1115610b535760405162461bcd60e51b815260206004820152601a60248201527f4578636565642063757272656e74207068617365206c696d69740000000000006044820152606401610704565b60008260186001600f54610b679190612a78565b60078110610b7757610b77612a8f565b0154610b839190612af7565b6040516bffffffffffffffffffffffff193360601b16602082015260348101849052909150600090605401604051602081830303815290604052805190602001209050610bd385600c5483611bb8565b15610c5857336000908152600d6020526040902054831115610c5857336000908152600d6020526040812054610c099085612a78565b9050848110610c1b5760009250610c56565b8060186001600f54610c2d9190612a78565b60078110610c3d57610c3d612a8f565b0154610c499190612af7565b610c539084612a78565b92505b505b602154610c659083612adf565b341015610cb45760405162461bcd60e51b815260206004820181905260248201527f696e73756666696369656e742065746820616d6f756e7420666f72206d696e746044820152606401610704565b6020546040516001600160a01b039091169083156108fc029084906000818181858888f19350505050158015610cee573d6000803e3d6000fd5b50601f546021546040516001600160a01b039092169181156108fc0291906000818181858888f19350505050158015610d2b573d6000803e3d6000fd5b50602154610d399083612adf565b341115610d875760215433906108fc90610d538534612a78565b610d5d9190612a78565b6040518115909202916000818181858888f19350505050158015610d85573d6000803e3d6000fd5b505b336000908152600d602052604081208054869290610da6908490612adf565b90915550600090505b84811015610e4a57600081600e54610dc79190612adf565b610dd2906001612adf565b9050610dde3382611bce565b610df081610deb83611be8565b611ce9565b610e0281610dfd83611be8565b611d72565b60405181815233907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859060200160405180910390a25080610e4281612b16565b915050610daf565b5083600e6000828254610e5d9190612adf565b9091555050600e546113871901610e7d576009805460ff19169055610ec1565b60116001600f54610e8e9190612a78565b60078110610e9e57610e9e612a8f565b0154600e5410610ec1576001600f6000828254610ebb9190612adf565b90915550505b50506001600855505050565b610ed73382611dfd565b610ef35760405162461bcd60e51b815260040161070490612b2f565b610999838383611e5b565b610f06611acb565b6001600160a01b038116610f2c5760405162461bcd60e51b815260040161070490612b7d565b602080546001600160a01b0319166001600160a01b03831690811782556040519081527f3d21e5a2b633291bd1ff5f9c654e402d063783c95759d2ea521b31fb30e4da4191015b60405180910390a150565b610f86611acb565b8051610f9990600a90602084019061259a565b507f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad81604051610f7391906126e0565b6109998383836040518060200160405280600081525061174f565b610fec611acb565b600c546000036110325760405162461bcd60e51b815260206004820152601160248201527015da1a5d195b1a5cdd081b9bdd081cd95d607a1b6044820152606401610704565b60095460ff16156110775760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e48195b98589b1959608a1b6044820152606401610704565b600f54156110bf5760405162461bcd60e51b81526020600482015260156024820152741b5a5b9d08185b1c9958591e48199a5b9a5cda1959605a1b6044820152606401610704565b6001600f8190556009805460ff191690911790556040517f7d4c15f0a1a76cde938e0b5d3a1c1e9905f57401c4aed53ae344801d156736e690600090a1565b611106611acb565b600782111580156111175750600082115b6111335760405162461bcd60e51b815260040161070490612a3b565b600782106111925760405162461bcd60e51b815260206004820152602660248201527f63616e6e6f7420736574206c61737420746f6b656e496420666f72206c61737460448201526520706861736560d01b6064820152608401610704565b600f548210156111f95760405162461bcd60e51b815260206004820152602c60248201527f63616e6e6f7420757064617465206c61737420746f6b656e4964206f6620707260448201526b6576696f757320706861736560a01b6064820152608401610704565b61138881111561123f5760405162461bcd60e51b8152602060048201526011602482015270657863656564206d617820737570706c7960781b6044820152606401610704565b600e548110156112885760405162461bcd60e51b81526020600482015260146024820152731d5cd9481d5c18dbdb5a5b99c81d1bdad95b925960621b6044820152606401610704565b6011826007811061129b5761129b612a8f565b015481106113065760405162461bcd60e51b815260206004820152603260248201527f757365206120746f6b656e4964206c657373207468616e206c61737420746f6b604482015271656e496420696e206e65787420706861736560701b6064820152608401610704565b600182111561139a57601161131c600284612a78565b6007811061132c5761132c612a8f565b0154811161139a5760405162461bcd60e51b815260206004820152603560248201527f757365206120746f6b656e49642067726561746572207468616e206c61737420604482015274746f6b656e496420696e207072657620706861736560581b6064820152608401610704565b8060116113a8600185612a78565b600781106113b8576113b8612a8f565b015560408051838152602081018390527f8a0565872515acd5d250cb8a49449dcb56374a5dc9df3991e6179db5c78be0bb91016107c4565b6113f8611acb565b6001600160a01b03821661143957604051339082156108fc029083906000818181858888f19350505050158015611433573d6000803e3d6000fd5b506114ac565b60405163a9059cbb60e01b81526001600160a01b0383169063a9059cbb906114679033908590600401612ba6565b6020604051808303816000875af1158015611486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114aa9190612bbf565b505b7f74f5dcd55c394cb1c6d3b9da22c2464bcc46c38cc3865bd629ed75823249b40b82826040516107c4929190612ba6565b6000818152600360205260408120546001600160a01b0316806106c95760405162461bcd60e51b815260040161070490612bdc565b61151a611acb565b609681111561155f5760405162461bcd60e51b8152602060048201526011602482015270063616e6e6f74206578636565642031353607c1b6044820152606401610704565b60108190556040518181527fd77359630618dd32a2fafd6311a2670e53617d7d6ea23eeac8f3a14b3110b6b190602001610f73565b61159c611acb565b806000036115e25760405162461bcd60e51b81526020600482015260136024820152721a5b9d985b1a59081b595c9adb19481c9bdbdd606a1b6044820152606401610704565b600c8190556040518181527fc504a95022b9d01b3024e95b0a85c200d0c538f417160776512b95fcbf7b2daa90602001610f73565b60006001600160a01b0382166116815760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610704565b506001600160a01b031660009081526004602052604090205490565b6116a5611acb565b6116af6000611ff7565b565b6116b9611acb565b6001600160a01b0382166116df5760405162461bcd60e51b815260040161070490612b7d565b601f80546001600160a01b0319166001600160a01b03841617905560218190556040517f232f2e6280d2064b1e439bf40ecdada042d84eefbb55039e4c49e8dc4f4c90c9906107c49084908490612ba6565b6060600280546107df90612aa5565b61174b338383612047565b5050565b6117593383611dfd565b6117755760405162461bcd60e51b815260040161070490612b2f565b61178184848484612111565b50505050565b6018816007811061179757600080fd5b0154905081565b6011816007811061179757600080fd5b60606117b982612144565b6118195760405162461bcd60e51b815260206004820152602b60248201527f526162626c65506173733a2055524920717565727920666f72206e6f6e65786960448201526a39ba32b73a103a37b5b2b760a91b6064820152608401610704565b6000828152600b60205260408120805461183290612aa5565b80601f016020809104026020016040519081016040528092919081815260200182805461185e90612aa5565b80156118ab5780601f10611880576101008083540402835291602001916118ab565b820191906000526020600020905b81548152906001019060200180831161188e57829003601f168201915b5050505050905060006118bc612161565b905080516000036118ce575092915050565b815115611907576118dd612161565b826040516020016118ef929190612c0e565b60405160208183030381529060405292505050919050565b61191084612170565b949350505050565b611920611acb565b60095460ff166119655760405162461bcd60e51b815260206004820152601060248201526f1b5a5b9d081b9bdd08195b98589b195960821b6044820152606401610704565b6007600f54106119ac5760405162461bcd60e51b815260206004820152601260248201527172656163686564206c61737420706861736560701b6044820152606401610704565b600e5460116001600f546119c09190612a78565b600781106119d0576119d0612a8f565b0155600f80549060006119e283612b16565b91905055507f256d119225bce371df2a9a8b235dcce1e1fc71e53c93f27d2fbb41af9b4704cb600f54604051611a1a91815260200190565b60405180910390a1565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b611a5a611acb565b6001600160a01b038116611abf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610704565b611ac881611ff7565b50565b6000546001600160a01b031633146116af5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610704565b611b2e81612144565b611ac85760405162461bcd60e51b815260040161070490612bdc565b600081815260056020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611b7f826114dd565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082611bc58584612253565b14949350505050565b61174b8282604051806020016040528060008152506122a0565b606081600003611c0f5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611c395780611c2381612b16565b9150611c329050600a83612c53565b9150611c13565b60008167ffffffffffffffff811115611c5457611c54612752565b6040519080825280601f01601f191660200182016040528015611c7e576020820181803683370190505b5090505b841561191057611c93600183612a78565b9150611ca0600a86612c67565b611cab906030612adf565b60f81b818381518110611cc057611cc0612a8f565b60200101906001600160f81b031916908160001a905350611ce2600a86612c53565b9450611c82565b611cf282612144565b611d535760405162461bcd60e51b815260206004820152602c60248201527f42616c746f4f726967696e4e66743a2055524920736574206f66206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610704565b6000828152600b6020908152604090912082516109999284019061259a565b611d7b82612144565b611dde5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610704565b600082815260076020908152604090912082516109999284019061259a565b600080611e09836114dd565b9050806001600160a01b0316846001600160a01b03161480611e305750611e308185611a24565b806119105750836001600160a01b0316611e4984610862565b6001600160a01b031614949350505050565b826001600160a01b0316611e6e826114dd565b6001600160a01b031614611ed25760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610704565b6001600160a01b038216611f345760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610704565b611f3f600082611b4a565b6001600160a01b0383166000908152600460205260408120805460019290611f68908490612a78565b90915550506001600160a01b0382166000908152600460205260408120805460019290611f96908490612adf565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b816001600160a01b0316836001600160a01b0316036120a45760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610704565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61211c848484611e5b565b612128848484846122d3565b6117815760405162461bcd60e51b815260040161070490612c7b565b6000908152600360205260409020546001600160a01b0316151590565b6060600a80546107df90612aa5565b606061217b82611b25565b6000828152600760205260408120805461219490612aa5565b80601f01602080910402602001604051908101604052809291908181526020018280546121c090612aa5565b801561220d5780601f106121e25761010080835404028352916020019161220d565b820191906000526020600020905b8154815290600101906020018083116121f057829003601f168201915b50505050509050600061221e612161565b90508051600003612230575092915050565b81511561224a5780826040516020016118ef929190612c0e565b611910846123d4565b600081815b8451811015612298576122848286838151811061227757612277612a8f565b602002602001015161243b565b91508061229081612b16565b915050612258565b509392505050565b6122aa8383612467565b6122b760008484846122d3565b6109995760405162461bcd60e51b815260040161070490612c7b565b60006001600160a01b0384163b156123c957604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612317903390899088908890600401612ccd565b6020604051808303816000875af1925050508015612352575060408051601f3d908101601f1916820190925261234f91810190612d0a565b60015b6123af573d808015612380576040519150601f19603f3d011682016040523d82523d6000602084013e612385565b606091505b5080516000036123a75760405162461bcd60e51b815260040161070490612c7b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611910565b506001949350505050565b60606123df82611b25565b60006123e9612161565b905060008151116124095760405180602001604052806000815250612434565b8061241384611be8565b604051602001612424929190612c0e565b6040516020818303038152906040525b9392505050565b6000818310612457576000828152602084905260409020612434565b5060009182526020526040902090565b6001600160a01b0382166124bd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610704565b6124c681612144565b156125135760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610704565b6001600160a01b038216600090815260046020526040812080546001929061253c908490612adf565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280546125a690612aa5565b90600052602060002090601f0160209004810192826125c8576000855561260e565b82601f106125e157805160ff191683800117855561260e565b8280016001018555821561260e579182015b8281111561260e5782518255916020019190600101906125f3565b5061261a92915061261e565b5090565b5b8082111561261a576000815560010161261f565b6001600160e01b031981168114611ac857600080fd5b60006020828403121561265b57600080fd5b813561243481612633565b6000806040838503121561267957600080fd5b50508035926020909101359150565b60005b838110156126a357818101518382015260200161268b565b838111156117815750506000910152565b600081518084526126cc816020860160208601612688565b601f01601f19169290920160200192915050565b60208152600061243460208301846126b4565b60006020828403121561270557600080fd5b5035919050565b80356001600160a01b038116811461272357600080fd5b919050565b6000806040838503121561273b57600080fd5b6127448361270c565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561279157612791612752565b604052919050565b6000806000606084860312156127ae57600080fd5b833567ffffffffffffffff808211156127c657600080fd5b818601915086601f8301126127da57600080fd5b81356020828211156127ee576127ee612752565b8160051b92506127ff818401612768565b828152928401810192818101908a85111561281957600080fd5b948201945b848610156128375785358252948201949082019061281e565b9a918901359950506040909701359695505050505050565b60008060006060848603121561286457600080fd5b61286d8461270c565b925061287b6020850161270c565b9150604084013590509250925092565b60006020828403121561289d57600080fd5b6124348261270c565b600067ffffffffffffffff8311156128c0576128c0612752565b6128d3601f8401601f1916602001612768565b90508281528383830111156128e757600080fd5b828260208301376000602084830101529392505050565b60006020828403121561291057600080fd5b813567ffffffffffffffff81111561292757600080fd5b8201601f8101841361293857600080fd5b611910848235602084016128a6565b8015158114611ac857600080fd5b6000806040838503121561296857600080fd5b6129718361270c565b9150602083013561298181612947565b809150509250929050565b600080600080608085870312156129a257600080fd5b6129ab8561270c565b93506129b96020860161270c565b925060408501359150606085013567ffffffffffffffff8111156129dc57600080fd5b8501601f810187136129ed57600080fd5b6129fc878235602084016128a6565b91505092959194509250565b60008060408385031215612a1b57600080fd5b612a248361270c565b9150612a326020840161270c565b90509250929050565b6020808252600d908201526c696e76616c696420706861736560981b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015612a8a57612a8a612a62565b500390565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680612ab957607f821691505b602082108103612ad957634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115612af257612af2612a62565b500190565b6000816000190483118215151615612b1157612b11612a62565b500290565b600060018201612b2857612b28612a62565b5060010190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252600f908201526e696e76616c6964206164647265737360881b604082015260600190565b6001600160a01b03929092168252602082015260400190565b600060208284031215612bd157600080fd5b815161243481612947565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60008351612c20818460208801612688565b835190830190612c34818360208801612688565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b600082612c6257612c62612c3d565b500490565b600082612c7657612c76612c3d565b500690565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d00908301846126b4565b9695505050505050565b600060208284031215612d1c57600080fd5b81516124348161263356fea264697066735822122016461d860efe7b5019a7c08d4aa1b4c3d2a1efab61ae3e3e5963dd4d760c3bc664736f6c634300080e0033

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.