ETH Price: $2,537.33 (+4.11%)

Token

Gratitude Gang (GRATITUDE)
 

Overview

Max Total Supply

536 GRATITUDE

Holders

166

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 GRATITUDE
0x4a406d5ef35c7b11597c38d7d1d35e4fa47723a2
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
GratitudeGang

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.8.0;

//   ____           _   _ _             _      
//  / ___|_ __ __ _| |_(_) |_ _   _  __| | ___ 
// | |  _| '__/ _` | __| | __| | | |/ _` |/ _ \
// | |_| | | | (_| | |_| | |_| |_| | (_| |  __/
//  \____|_|  \__,_|\__|_|\__|\__,_|\__,_|\___|
//
// A collection of 2,222 unique Non-Fungible Power SUNFLOWERS living in 
// the metaverse. Becoming a GRATITUDE GANG NFT owner introduces you to 
// a FAMILY of heart-centered, purpose-driven, service-oriented human 
// beings.
//
// https://www.gratitudegang.io/
//

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

import "erc721b/contracts/extensions/ERC721BBaseTokenURI.sol";
import "erc721b/contracts/extensions/ERC721BContractURIStorage.sol";

contract GratitudeGang is
  Ownable,
  ReentrancyGuard,
  ERC721BBaseTokenURI,
  ERC721BContractURIStorage
{
  using Strings for uint256;
  using SafeMath for uint256;

  // ============ Constants ============

  //bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
  bytes4 internal constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
  
  //max amount that can be minted in this collection
  uint16 public constant MAX_SUPPLY = 2222;
  //maximum amount that can be purchased per wallet
  uint8 public constant MAX_PURCHASE = 5;
  //the whitelist price per token
  uint256 public constant WHITELIST_PRICE = 0.05 ether;
  //the sale price per token
  uint256 public constant SALE_PRICE = 0.08 ether;

  // ============ Storage ============

  //the offset to be used to determine what token id should get which 
  //CID in some sort of random fashion. This is kind of immutable as 
  //it's only set in `widthdraw()`
  uint16 public randomizer;
  //mapping of address to amount minted
  mapping(address => uint256) public minted;
  //mapping of token id to custom uri
  mapping(uint256 => string) public ambassadorURI;
  //mapping of ambassador address to whether if they redeemed already
  mapping(address => bool) public ambassadors;

  //the preview uri json
  string public previewURI;
  //flag for if the whitelist sale has started
  bool public whitelistStarted;
  //flag for if the sales has started
  bool public saleStarted;
  //a flag that allows NFTs to be listed on marketplaces
  //this helps to prevent people from listing at a lower
  //price during the whitelist
  bool approvable = false;

  // ============ Modifier ============

  modifier canApprove {
    if (!approvable) revert InvalidCall();
    _;
  }

  // ============ Deploy ============

  /**
   * @dev Sets contract URI, preview URI, mints 30 to the owner for giveaways
   */
  constructor(string memory uri, string memory preview) {
    _setContractURI(uri);
    previewURI = preview;
    _safeMint(owner(), 30);
  }

  // ============ Read Methods ============

  /**
   * @dev See {IERC721Metadata-name}.
   */
  function name() external pure returns(string memory) {
    return "Gratitude Gang";
  }

  /**
   * @dev See {IERC721Metadata-symbol}.
   */
  function symbol() external pure returns(string memory) {
    return "GRATITUDE";
  }

  /** 
   * @dev ERC165 bytes to add to interface array - set in parent contract
   *  implementing this standard
   * 
   *  bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
   *  bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
   *  _registerInterface(_INTERFACE_ID_ERC2981);
   */
  function royaltyInfo(
    uint256 _tokenId,
    uint256 _salePrice
  ) external view returns (
    address receiver,
    uint256 royaltyAmount
  ) {
    if (!_exists(_tokenId)) revert NonExistentToken();
    return (
      payable(owner()), 
      _salePrice.mul(1000).div(10000)
    );
  }

  /**
   * @dev See {IERC165-supportsInterface}.
   */
  function supportsInterface(bytes4 interfaceId)
    public view override returns(bool)
  {
    //support ERC721
    return interfaceId == type(IERC721Metadata).interfaceId
      //support ERC2981
      || interfaceId == _INTERFACE_ID_ERC2981
      //support other things
      || super.supportsInterface(interfaceId);
  }

  /**
   * @dev Combines the base token URI and the token CID to form a full 
   * token URI
   */
  function tokenURI(uint256 tokenId) 
    public view override returns(string memory) 
  {
    if (!_exists(tokenId)) revert NonExistentToken();

    //if there is a custom URI
    if (bytes(ambassadorURI[tokenId]).length > 0) {
      //return that
      return ambassadorURI[tokenId];
    }

    //if no offset
    if (randomizer == 0) {
      //use the placeholder
      return previewURI;
    }

    //for example, given offset is 2 and size is 8:
    // - token 5 = ((5 + 2) % 8) + 1 = 8
    // - token 6 = ((6 + 2) % 8) + 1 = 1
    // - token 7 = ((7 + 2) % 8) + 1 = 2
    // - token 8 = ((8 + 2) % 8) + 1 = 3
    uint256 index = tokenId.add(randomizer).mod(MAX_SUPPLY).add(1);
    //ex. https://ipfs.io/Qm123abc/ + 1000 + .json
    return string(
      abi.encodePacked(baseTokenURI(), index.toString(), ".json")
    );
  }

  // ============ Write Methods ===========

  /**
   * @dev Allows anyone to get a token that was approved by the owner
   */
  function authorize(bytes memory proof) 
    external payable 
  {
    address recipient = _msgSender();
    //make sure recipient is a valid address
    if (recipient == address(0)) revert InvalidCall();
    //has the whitelist sale started?
    if (!whitelistStarted) revert InvalidCall();
    //has the sale started?
    if (saleStarted) revert InvalidCall();

    //make sure the minter signed this off
    if (ECDSA.recover(
      ECDSA.toEthSignedMessageHash(
        keccak256(abi.encodePacked("authorized", recipient))
      ),
      proof
    ) != owner()) revert InvalidCall();
  
    //can only mint 1 during the whitelist
    if (minted[recipient] > 0
      //the value sent should be equal or more than the whitelist price
      || WHITELIST_PRICE > msg.value
      //the quantity being minted should not exceed the max supply
      || (totalSupply() + 1) > MAX_SUPPLY
    ) revert InvalidCall();

    minted[recipient] = 1;
    _safeMint(recipient, 1);
  }

  /**
   * @dev Creates a new token for the `recipient`. Its token ID will be 
   * automatically assigned (and available on the emitted 
   * {IERC721-Transfer} event)
   */
  function mint(uint256 quantity) external payable {
    address recipient = _msgSender();
    //make sure recipient is a valid address
    if (recipient == address(0)) revert InvalidCall();
    //has the sale started?
    if(!saleStarted) revert InvalidCall();
  
    if (quantity == 0 
      //the quantity here plus the current amount already minted 
      //should be less than the max purchase amount
      || quantity.add(minted[recipient]) > MAX_PURCHASE
      //the value sent should be the price times quantity
      || quantity.mul(SALE_PRICE) > msg.value
      //the quantity being minted should not exceed the max supply
      || (totalSupply() + quantity) > MAX_SUPPLY
    ) revert InvalidCall();

    minted[recipient] += uint8(quantity);
    _safeMint(recipient, quantity);
  }

  /**
   * @dev Allows an ambassador to redeem their tokens
   */
  function redeem(
    address recipient,
    string memory uri, 
    bool ambassador, 
    bytes memory proof
  ) external virtual {
    //check to see if they redeemed already
    if(ambassadors[recipient] != false) revert InvalidCall();

    //make sure the owner signed this off
    if (ECDSA.recover(
      ECDSA.toEthSignedMessageHash(
        keccak256(abi.encodePacked(
          "redeemable", 
          uri, 
          recipient, 
          ambassador
        ))
      ),
      proof
    ) != owner()) revert InvalidCall();

    uint256 nextTokenId = totalSupply() + 1;

    //if ambassador
    if (ambassador) {
      //mint token
      _safeMint(recipient, 1);
    } else { //they are apart of the founding team
      _safeMint(recipient, 4);
    }

    //add custom uri, so we know what token to customize
    ambassadorURI[nextTokenId] = uri;
    //flag that an ambassador/founder has redeemed
    ambassadors[recipient] = true;
  }

  // ============ Approval Methods ===========

  /**
   * @dev Check if can approve before approving
   */
  function approve(address to, uint256 tokenId) 
    public virtual override canApprove 
  {
    super.approve(to, tokenId);
  }

  /**
   * @dev Check if can approve before approving
   */
  function setApprovalForAll(address operator, bool approved) 
    public virtual override canApprove
  {
    super.setApprovalForAll(operator, approved);
  }

  // ============ Owner Methods ===========

  /**
   * @dev Sets the base URI for the active collection
   */
  function setBaseURI(string memory uri) external onlyOwner {
    _setBaseURI(uri);
  }

  /**
   * @dev Sets the base URI for the active collection
   */
  function startSale(bool start) external onlyOwner {
    saleStarted = start;
  }

  /**
   * @dev Sets the base URI for the active collection
   */
  function startWhitelist(bool start) external onlyOwner {
    whitelistStarted = start;
  }

  /**
   * @dev Allows the proceeds to be withdrawn. This also releases the  
   * collection at the same time to discourage rug pulls. You can now
   * list these NFTs for sale on marketplaces.
   */
  function withdraw() external onlyOwner nonReentrant {
    //cannot withdraw without setting a base URI first
    if (bytes(baseTokenURI()).length == 0) revert InvalidCall();

    //set the randomizer, it's only here we will 
    //set this so it's kind of immutable (a one time deal)
    if (randomizer == 0) {
      randomizer = uint16(block.number - 1) % MAX_SUPPLY;
      if (randomizer == 0) {
        randomizer = 1;
      }
    }

    //now make approvable, it's only here we will 
    //set this so it's kind of immutable (a one time deal)
    if (!approvable) {
      approvable = true;
    }

    payable(_msgSender()).transfer(address(this).balance);
  }
}

File 2 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 4 of 15 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 5 of 15 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 6 of 15 : ERC721BBaseTokenURI.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../ERC721B.sol";

/**
 * @dev ERC721B token where token URIs are determined with a base URI
 */
abstract contract ERC721BBaseTokenURI is ERC721B, IERC721Metadata {
  using Strings for uint256;
  string private _baseTokenURI;

  /**
   * @dev See {IERC721Metadata-tokenURI}.
   */
  function tokenURI(uint256 tokenId) public view virtual returns(string memory) {
    if(!_exists(tokenId)) revert NonExistentToken();
    string memory baseURI = _baseTokenURI;
    return bytes(baseURI).length > 0 ? string(
      abi.encodePacked(baseURI, tokenId.toString())
    ) : "";
  }
  
  /**
   * @dev The base URI for token data ex. https://creatures-api.opensea.io/api/creature/
   * Example Usage: 
   *  Strings.strConcat(baseTokenURI(), Strings.uint2str(tokenId))
   */
  function baseTokenURI() public view returns (string memory) {
    return _baseTokenURI;
  }

  /**
   * @dev Setting base token uri would be acceptable if using IPFS CIDs
   */
  function _setBaseURI(string memory uri) internal virtual {
    _baseTokenURI = uri;
  }
}

File 7 of 15 : ERC721BContractURIStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC721B.sol";

/**
 * @dev ERC721B contract with a URI descriptor
 */
abstract contract ERC721BContractURIStorage is ERC721B {
  //immutable contract uri
  string private _contractURI;

  /**
   * @dev The URI for contract data ex. https://creatures-api.opensea.io/contract/opensea-creatures/contract.json
   * Example Format:
   * {
   *   "name": "OpenSea Creatures",
   *   "description": "OpenSea Creatures are adorable aquatic beings primarily for demonstrating what can be done using the OpenSea platform. Adopt one today to try out all the OpenSea buying, selling, and bidding feature set.",
   *   "image": "https://openseacreatures.io/image.png",
   *   "external_link": "https://openseacreatures.io",
   *   "seller_fee_basis_points": 100, # Indicates a 1% seller fee.
   *   "fee_recipient": "0xA97F337c39cccE66adfeCB2BF99C1DdC54C2D721" # Where seller fees will be paid to.
   * }
   */
  function contractURI() external view returns (string memory) {
    return _contractURI;
  }

  /**
   * @dev Sets contract uri
   */
  function _setContractURI(string memory uri) internal virtual {
    _contractURI = uri;
  }
}

File 8 of 15 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 9 of 15 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 10 of 15 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 11 of 15 : ERC721B.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

error InvalidCall();
error BalanceQueryZeroAddress();
error NonExistentToken();
error ApprovalToCurrentOwner();
error ApprovalOwnerIsOperator();
error NotERC721Receiver();
error ERC721ReceiverNotReceived();

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] 
 * Non-Fungible Token Standard, including the Metadata extension and 
 * token Auto-ID generation.
 *
 * You must provide `name()` `symbol()` and `tokenURI(uint256 tokenId)`
 * to conform with IERC721Metadata
 */
abstract contract ERC721B is Context, ERC165, IERC721 {

  // ============ Storage ============

  // The last token id minted
  uint256 private _lastTokenId;
  // Mapping from token ID to owner address
  mapping(uint256 => address) internal _owners;
  // Mapping owner address to token count
  mapping(address => uint256) internal _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;

  // ============ Read Methods ============

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

  /**
   * @dev Shows the overall amount of tokens generated in the contract
   */
  function totalSupply() public view virtual returns(uint256) {
    return _lastTokenId;
  }

  /**
   * @dev See {IERC721-ownerOf}.
   */
  function ownerOf(uint256 tokenId) 
    public view virtual override returns(address) 
  {
    unchecked {
      //this is the situation when _owners normalized
      uint256 id = tokenId;
      if (_owners[id] != address(0)) {
        return _owners[id];
      }
      //this is the situation when _owners is not normalized
      if (id > 0 && id <= _lastTokenId) {
        //there will never be a case where token 1 is address(0)
        while(true) {
          id--;
          if (id == 0) {
            break;
          } else if (_owners[id] != address(0)) {
            return _owners[id];
          }
        }
      }
    }

    revert NonExistentToken();
  }

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

  // ============ Approval Methods ============

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

    address sender = _msgSender();
    if (sender != owner && !isApprovedForAll(owner, sender)) 
      revert ApprovalToCurrentOwner();

    _approve(to, tokenId, owner);
  }

  /**
   * @dev See {IERC721-getApproved}.
   */
  function getApproved(uint256 tokenId) 
    public view virtual override returns(address) 
  {
    if (!_exists(tokenId)) revert NonExistentToken();
    return _tokenApprovals[tokenId];
  }

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

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

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

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

  /**
   * @dev Approve `operator` to operate on all of `owner` tokens
   *
   * Emits a {ApprovalForAll} event.
   */
  function _setApprovalForAll(
    address owner,
    address operator,
    bool approved
  ) internal virtual {
    if (owner == operator) revert ApprovalOwnerIsOperator();
    _operatorApprovals[owner][operator] = approved;
    emit ApprovalForAll(owner, operator, approved);
  }

  // ============ Mint Methods ============

  /**
   * @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 amount,
    bytes memory _data,
    bool safeCheck
  ) private {
    if(amount == 0 || to == address(0)) revert InvalidCall();
    uint256 startTokenId = _lastTokenId + 1;
    
    _beforeTokenTransfers(address(0), to, startTokenId, amount);
    
    unchecked {
      _lastTokenId += amount;
      _balances[to] += amount;
      _owners[startTokenId] = to;

      _afterTokenTransfers(address(0), to, startTokenId, amount);

      uint256 updatedIndex = startTokenId;
      //if do safe check and,
      //check if contract one time (instead of loop)
      //see: @openzep/utils/Address.sol
      if (safeCheck && to.code.length > 0) {
        //loop emit transfer and received check
        for (uint256 i; i < amount; i++) {
          emit Transfer(address(0), to, updatedIndex);
          if (!_checkOnERC721Received(address(0), to, updatedIndex, _data))
            revert ERC721ReceiverNotReceived();
          updatedIndex++;
        }
        return;
      }

      for (uint256 i; i < amount; i++) {
        emit Transfer(address(0), to, updatedIndex);
        updatedIndex++;
      }
    }
  }

  /**
   * @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 amount) internal virtual {
    _safeMint(to, amount, "");
  }

  /**
   * @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 amount,
    bytes memory _data
  ) internal virtual {
    _mint(to, amount, _data, true);
  }

  // ============ Transfer Methods ============

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

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

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

  /**
   * @dev Internal function to invoke {IERC721Receiver-onERC721Received} 
   * on a target address. The call is not executed if the target address 
   * is not a contract.
   */
  function _checkOnERC721Received(
    address from,
    address to,
    uint256 tokenId,
    bytes memory _data
  ) private returns (bool) {
    try IERC721Receiver(to).onERC721Received(
      _msgSender(), from, tokenId, _data
    ) returns (bytes4 retval) {
      return retval == IERC721Receiver.onERC721Received.selector;
    } catch (bytes memory reason) {
      if (reason.length == 0) {
        revert NotERC721Receiver();
      } else {
        assembly {
          revert(add(32, reason), mload(reason))
        }
      }
    }
  }

  /**
   * @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 tokenId > 0 && tokenId <= _lastTokenId;
  }

  /**
   * @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);
    //see: @openzep/utils/Address.sol
    if (to.code.length > 0
      && !_checkOnERC721Received(from, to, tokenId, _data)
    ) revert ERC721ReceiverNotReceived();
  }

  /**
   * @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) private {
    if (to == address(0)) revert InvalidCall();
    //get owner
    address owner = ERC721B.ownerOf(tokenId);
    //owner should be the `from`
    if (from != owner 
      || !_isApprovedOrOwner(_msgSender(), tokenId, owner)
    ) revert InvalidCall();

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

    unchecked {
      //this is the situation when _owners are normalized
      _balances[to] += 1;
      _balances[from] -= 1;
      _owners[tokenId] = to;
      //this is the situation when _owners are not normalized
      uint256 nextTokenId = tokenId + 1;
      if (nextTokenId <= _lastTokenId && _owners[nextTokenId] == address(0)) {
        _owners[nextTokenId] = from;
      }
    }

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

  // ============ TODO Methods ============

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

  /**
   * @dev Hook that is called after a set of serially-ordered token ids 
   * have been transferred. This includes minting.
   *
   * startTokenId - the first token id to be transferred
   * amount - the amount to be transferred
   *
   * Calling conditions:
   *
   * - when `from` and `to` are both non-zero.
   * - `from` and `to` are never both zero.
   */
  function _afterTokenTransfers(
    address from,
    address to,
    uint256 startTokenId,
    uint256 amount
  ) internal virtual {}
}

File 12 of 15 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

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

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

File 15 of 15 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"string","name":"preview","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalOwnerIsOperator","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"BalanceQueryZeroAddress","type":"error"},{"inputs":[],"name":"ERC721ReceiverNotReceived","type":"error"},{"inputs":[],"name":"InvalidCall","type":"error"},{"inputs":[],"name":"NonExistentToken","type":"error"},{"inputs":[],"name":"NotERC721Receiver","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_PURCHASE","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SALE_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELIST_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ambassadorURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"ambassadors","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"authorize","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","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":"previewURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomizer","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"bool","name":"ambassador","type":"bool"},{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"start","type":"bool"}],"name":"startSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"start","type":"bool"}],"name":"startWhitelist","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":"pure","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":"whitelistStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600e805462ff0000191690553480156200001d57600080fd5b5060405162002c9638038062002c9683398101604081905262000040916200051f565b6200004b3362000097565b600180556200005a82620000e7565b80516200006f90600d906020840190620003a3565b506200008f620000876000546001600160a01b031690565b601e62000100565b505062000676565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8051620000fc906008906020840190620003a3565b5050565b620000fc8282604051806020016040528060008152506200012260201b60201c565b62000131838383600162000136565b505050565b8215806200014b57506001600160a01b038416155b156200016a5760405163574b16a760e11b815260040160405180910390fd5b600060025460016200017d919062000589565b905060028054850190556001600160a01b03851660008181526004602090815260408083208054890190558483526003909152902080546001600160a01b031916909117905580828015620001dc57506000866001600160a01b03163b115b15620002585760005b858110156200024f5760405182906001600160a01b0389169060009060008051602062002c76833981519152908290a4620002246000888488620002a2565b6200024257604051631f11849560e21b815260040160405180910390fd5b60019182019101620001e5565b5050506200029c565b60005b85811015620002985760405182906001600160a01b0389169060009060008051602062002c76833981519152908290a4600191820191016200025b565b5050505b50505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290620002d9903390899088908890600401620005b0565b602060405180830381600087803b158015620002f457600080fd5b505af192505050801562000327575060408051601f3d908101601f19168201909252620003249181019062000606565b60015b62000386573d80801562000358576040519150601f19603f3d011682016040523d82523d6000602084013e6200035d565b606091505b5080516200037e57604051630568cbab60e01b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b828054620003b19062000639565b90600052602060002090601f016020900481019282620003d5576000855562000420565b82601f10620003f057805160ff191683800117855562000420565b8280016001018555821562000420579182015b828111156200042057825182559160200191906001019062000403565b506200042e92915062000432565b5090565b5b808211156200042e576000815560010162000433565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200047c57818101518382015260200162000462565b838111156200029c5750506000910152565b600082601f830112620004a057600080fd5b81516001600160401b0380821115620004bd57620004bd62000449565b604051601f8301601f19908116603f01168101908282118183101715620004e857620004e862000449565b816040528381528660208588010111156200050257600080fd5b620005158460208301602089016200045f565b9695505050505050565b600080604083850312156200053357600080fd5b82516001600160401b03808211156200054b57600080fd5b62000559868387016200048e565b935060208501519150808211156200057057600080fd5b506200057f858286016200048e565b9150509250929050565b60008219821115620005ab57634e487b7160e01b600052601160045260246000fd5b500190565b600060018060a01b038087168352808616602084015250836040830152608060608301528251806080840152620005ef8160a08501602087016200045f565b601f01601f19169190910160a00195945050505050565b6000602082840312156200061957600080fd5b81516001600160e01b0319811681146200063257600080fd5b9392505050565b600181811c908216806200064e57607f821691505b602082108114156200067057634e487b7160e01b600052602260045260246000fd5b50919050565b6125f080620006866000396000f3fe6080604052600436106102255760003560e01c80636352211e11610123578063a22cb465116100ab578063e71035251161006f578063e7103525146106a2578063e8a3d485146106c2578063e985e9c5146106d7578063f10fb584146106f7578063f2fde38b1461071257600080fd5b8063a22cb46514610618578063b88d4fde14610638578063c87b56dd14610658578063d3ff166c14610678578063d547cfb71461068d57600080fd5b80637f205a74116100f25780637f205a74146105795780638da5cb5b1461059557806395d89b41146105b35780639c4c557c146105e5578063a0712d681461060557600080fd5b80636352211e146104fd57806370a082311461051d5780637146bd081461053d578063715018a61461056457600080fd5b806328ce48a0116101b15780633ccfd60b116101755780633ccfd60b1461046957806342842e0e1461047e57806352dd38081461049e57806355f804b3146104be5780635c474f9e146104de57600080fd5b806328ce48a0146103975780632a55205a146103c757806332cb6b0c14610406578063339159d31461042f5780633c14e04a1461044957600080fd5b806317e7f295116101f857806317e7f295146102f957806318160ddd146103225780631d73814b146103375780631e7269c51461034a57806323b872dd1461037757600080fd5b806301ffc9a71461022a57806306fdde031461025f578063081812fc1461029f578063095ea7b3146102d7575b600080fd5b34801561023657600080fd5b5061024a610245366004611fab565b610732565b60405190151581526020015b60405180910390f35b34801561026b57600080fd5b5060408051808201909152600e81526d4772617469747564652047616e6760901b60208201525b6040516102569190612020565b3480156102ab57600080fd5b506102bf6102ba366004612033565b610778565b6040516001600160a01b039091168152602001610256565b3480156102e357600080fd5b506102f76102f2366004612068565b6107bc565b005b34801561030557600080fd5b5061031466b1a2bc2ec5000081565b604051908152602001610256565b34801561032e57600080fd5b50600254610314565b6102f7610345366004612135565b6107f3565b34801561035657600080fd5b5061031461036536600461216a565b600a6020526000908152604090205481565b34801561038357600080fd5b506102f7610392366004612185565b6109c7565b3480156103a357600080fd5b5061024a6103b236600461216a565b600c6020526000908152604090205460ff1681565b3480156103d357600080fd5b506103e76103e23660046121c1565b6109d7565b604080516001600160a01b039093168352602083019190915201610256565b34801561041257600080fd5b5061041c6108ae81565b60405161ffff9091168152602001610256565b34801561043b57600080fd5b50600e5461024a9060ff1681565b34801561045557600080fd5b50610292610464366004612033565b610a30565b34801561047557600080fd5b506102f7610aca565b34801561048a57600080fd5b506102f7610499366004612185565b610c1b565b3480156104aa57600080fd5b506102f76104b93660046121f3565b610c36565b3480156104ca57600080fd5b506102f76104d9366004612135565b610c73565b3480156104ea57600080fd5b50600e5461024a90610100900460ff1681565b34801561050957600080fd5b506102bf610518366004612033565b610ca9565b34801561052957600080fd5b5061031461053836600461216a565b610d66565b34801561054957600080fd5b50610552600581565b60405160ff9091168152602001610256565b34801561057057600080fd5b506102f7610dab565b34801561058557600080fd5b5061031467011c37937e08000081565b3480156105a157600080fd5b506000546001600160a01b03166102bf565b3480156105bf57600080fd5b5060408051808201909152600981526847524154495455444560b81b6020820152610292565b3480156105f157600080fd5b506102f76106003660046121f3565b610de1565b6102f7610613366004612033565b610e25565b34801561062457600080fd5b506102f761063336600461220e565b610f30565b34801561064457600080fd5b506102f7610653366004612241565b610f63565b34801561066457600080fd5b50610292610673366004612033565b610f75565b34801561068457600080fd5b506102926110df565b34801561069957600080fd5b506102926110ec565b3480156106ae57600080fd5b506102f76106bd3660046122a9565b61117e565b3480156106ce57600080fd5b50610292611298565b3480156106e357600080fd5b5061024a6106f2366004612322565b6112a7565b34801561070357600080fd5b5060095461041c9061ffff1681565b34801561071e57600080fd5b506102f761072d36600461216a565b6112d5565b60006001600160e01b03198216635b5e139f60e01b148061076357506001600160e01b0319821663152a902d60e11b145b8061077257506107728261136d565b92915050565b6000610783826113a2565b6107a057604051634a1850bf60e11b815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600e5462010000900460ff166107e55760405163574b16a760e11b815260040160405180910390fd5b6107ef82826113b7565b5050565b33806108125760405163574b16a760e11b815260040160405180910390fd5b600e5460ff166108355760405163574b16a760e11b815260040160405180910390fd5b600e54610100900460ff161561085e5760405163574b16a760e11b815260040160405180910390fd5b60005460405169185d5d1a1bdc9a5e995960b21b60208201526bffffffffffffffffffffffff19606084901b16602a8201526001600160a01b039091169061090e9061090890603e015b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b84611441565b6001600160a01b0316146109355760405163574b16a760e11b815260040160405180910390fd5b6001600160a01b0381166000908152600a602052604090205415158061096157503466b1a2bc2ec50000115b8061098057506108ae61097360025490565b61097e906001612362565b115b1561099e5760405163574b16a760e11b815260040160405180910390fd5b6001600160a01b0381166000908152600a602052604090206001908190556107ef908290611465565b6109d283838361147f565b505050565b6000806109e3846113a2565b610a0057604051634a1850bf60e11b815260040160405180910390fd5b6000546001600160a01b0316610a24612710610a1e866103e86115f7565b9061160a565b915091505b9250929050565b600b6020526000908152604090208054610a499061237a565b80601f0160208091040260200160405190810160405280929190818152602001828054610a759061237a565b8015610ac25780601f10610a9757610100808354040283529160200191610ac2565b820191906000526020600020905b815481529060010190602001808311610aa557829003601f168201915b505050505081565b6000546001600160a01b03163314610afd5760405162461bcd60e51b8152600401610af4906123b5565b60405180910390fd5b60026001541415610b505760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610af4565b6002600155610b5d6110ec565b51610b7b5760405163574b16a760e11b815260040160405180910390fd5b60095461ffff16610bc6576108ae610b946001436123ea565b610b9e9190612417565b6009805461ffff191661ffff929092169182179055610bc6576009805461ffff191660011790555b600e5462010000900460ff16610be857600e805462ff00001916620100001790555b60405133904780156108fc02916000818181858888f19350505050158015610c14573d6000803e3d6000fd5b5060018055565b6109d283838360405180602001604052806000815250610f63565b6000546001600160a01b03163314610c605760405162461bcd60e51b8152600401610af4906123b5565b600e805460ff1916911515919091179055565b6000546001600160a01b03163314610c9d5760405162461bcd60e51b8152600401610af4906123b5565b610ca681611616565b50565b60008181526003602052604081205482906001600160a01b031615610ce6576000908152600360205260409020546001600160a01b031692915050565b600081118015610cf857506002548111155b15610d4c575b6000190180610d0c57610d4c565b6000818152600360205260409020546001600160a01b031615610d47576000908152600360205260409020546001600160a01b031692915050565b610cfe565b50604051634a1850bf60e11b815260040160405180910390fd5b60006001600160a01b038216610d8f576040516316285dcb60e11b815260040160405180910390fd5b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b03163314610dd55760405162461bcd60e51b8152600401610af4906123b5565b610ddf6000611629565b565b6000546001600160a01b03163314610e0b5760405162461bcd60e51b8152600401610af4906123b5565b600e80549115156101000261ff0019909216919091179055565b3380610e445760405163574b16a760e11b815260040160405180910390fd5b600e54610100900460ff16610e6c5760405163574b16a760e11b815260040160405180910390fd5b811580610e9d57506001600160a01b0381166000908152600a6020526040902054600590610e9b908490611679565b115b80610eb8575034610eb68367011c37937e0800006115f7565b115b80610ed757506108ae82610ecb60025490565b610ed59190612362565b115b15610ef55760405163574b16a760e11b815260040160405180910390fd5b6001600160a01b0381166000908152600a60205260408120805460ff85169290610f20908490612362565b909155506107ef90508183611465565b600e5462010000900460ff16610f595760405163574b16a760e11b815260040160405180910390fd5b6107ef8282611685565b610f6f84848484611690565b50505050565b6060610f80826113a2565b610f9d57604051634a1850bf60e11b815260040160405180910390fd5b6000828152600b602052604081208054610fb69061237a565b9050111561105c576000828152600b602052604090208054610fd79061237a565b80601f01602080910402602001604051908101604052809291908181526020018280546110039061237a565b80156110505780601f1061102557610100808354040283529160200191611050565b820191906000526020600020905b81548152906001019060200180831161103357829003601f168201915b50505050509050919050565b60095461ffff1661107457600d8054610fd79061237a565b6009546000906110a49060019061109e906108ae9061109890889061ffff16611679565b906116dc565b90611679565b90506110ae6110ec565b6110b7826116e8565b6040516020016110c8929190612438565b604051602081830303815290604052915050919050565b600d8054610a499061237a565b6060600780546110fb9061237a565b80601f01602080910402602001604051908101604052809291908181526020018280546111279061237a565b80156111745780601f1061114957610100808354040283529160200191611174565b820191906000526020600020905b81548152906001019060200180831161115757829003601f168201915b5050505050905090565b6001600160a01b0384166000908152600c602052604090205460ff16156111b85760405163574b16a760e11b815260040160405180910390fd5b6000546001600160a01b03166001600160a01b03166111ee6111e88587866040516020016108a893929190612477565b83611441565b6001600160a01b0316146112155760405163574b16a760e11b815260040160405180910390fd5b600061122060025490565b61122b906001612362565b905082156112435761123e856001611465565b61124e565b61124e856004611465565b6000818152600b60209081526040909120855161126d92870190611efc565b5050506001600160a01b039092166000908152600c60205260409020805460ff191660011790555050565b6060600880546110fb9061237a565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6000546001600160a01b031633146112ff5760405162461bcd60e51b8152600401610af4906123b5565b6001600160a01b0381166113645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610af4565b610ca681611629565b60006001600160e01b031982166380ac58cd60e01b148061077257506301ffc9a760e01b6001600160e01b0319831614610772565b60008082118015610772575050600254101590565b60006113c282610ca9565b9050806001600160a01b0316836001600160a01b031614156113f75760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b0382168114801590611418575061141682826112a7565b155b156114365760405163250fdee360e21b815260040160405180910390fd5b610f6f8484846117ee565b6000806000611450858561184a565b9150915061145d816118b7565b509392505050565b6107ef828260405180602001604052806000815250611a72565b6001600160a01b0382166114a65760405163574b16a760e11b815260040160405180910390fd5b60006114b182610ca9565b9050806001600160a01b0316846001600160a01b03161415806114dc57506114da338383611a7f565b155b156114fa5760405163574b16a760e11b815260040160405180910390fd5b611506600083866117ee565b6001600160a01b03808416600081815260046020908152604080832080546001908101909155948916835280832080546000190190558683526003909152902080546001600160a01b031916909117905560025490830190811180159061158257506000818152600360205260409020546001600160a01b0316155b156115af57600081815260036020526040902080546001600160a01b0319166001600160a01b0387161790555b5081836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b600061160382846124d2565b9392505050565b600061160382846124f1565b80516107ef906007906020840190611efc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006116038284612362565b6107ef338383611aca565b61169b84848461147f565b6000836001600160a01b03163b1180156116be57506116bc84848484611b6a565b155b15610f6f57604051631f11849560e21b815260040160405180910390fd5b60006116038284612505565b60608161170c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611736578061172081612519565b915061172f9050600a836124f1565b9150611710565b60008167ffffffffffffffff81111561175157611751612092565b6040519080825280601f01601f19166020018201604052801561177b576020820181803683370190505b5090505b84156117e6576117906001836123ea565b915061179d600a86612505565b6117a8906030612362565b60f81b8183815181106117bd576117bd612534565b60200101906001600160f81b031916908160001a9053506117df600a866124f1565b945061177f565b949350505050565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808251604114156118815760208301516040840151606085015160001a61187587828585611c61565b94509450505050610a29565b8251604014156118ab57602083015160408401516118a0868383611d4e565b935093505050610a29565b50600090506002610a29565b60008160048111156118cb576118cb61254a565b14156118d45750565b60018160048111156118e8576118e861254a565b14156119365760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610af4565b600281600481111561194a5761194a61254a565b14156119985760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610af4565b60038160048111156119ac576119ac61254a565b1415611a055760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610af4565b6004816004811115611a1957611a1961254a565b1415610ca65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610af4565b6109d28383836001611d7d565b6000816001600160a01b0316846001600160a01b03161480611aba5750836001600160a01b0316611aaf84610778565b6001600160a01b0316145b806117e657506117e682856112a7565b816001600160a01b0316836001600160a01b03161415611afd5760405163079f14e360e51b815260040160405180910390fd5b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611b9f903390899088908890600401612560565b602060405180830381600087803b158015611bb957600080fd5b505af1925050508015611be9575060408051601f3d908101601f19168201909252611be69181019061259d565b60015b611c44573d808015611c17576040519150601f19603f3d011682016040523d82523d6000602084013e611c1c565b606091505b508051611c3c57604051630568cbab60e01b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611c985750600090506003611d45565b8460ff16601b14158015611cb057508460ff16601c14155b15611cc15750600090506004611d45565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d15573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d3e57600060019250925050611d45565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01611d6f87828885611c61565b935093505050935093915050565b821580611d9157506001600160a01b038416155b15611daf5760405163574b16a760e11b815260040160405180910390fd5b60006002546001611dc09190612362565b905060028054850190556001600160a01b03851660008181526004602090815260408083208054890190558483526003909152902080546001600160a01b031916909117905580828015611e1e57506000866001600160a01b03163b115b15611ea45760005b85811015611e9c5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4611e736000888488611b6a565b611e9057604051631f11849560e21b815260040160405180910390fd5b60019182019101611e26565b505050610f6f565b60005b85811015611ef35760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a460019182019101611ea7565b50505050505050565b828054611f089061237a565b90600052602060002090601f016020900481019282611f2a5760008555611f70565b82601f10611f4357805160ff1916838001178555611f70565b82800160010185558215611f70579182015b82811115611f70578251825591602001919060010190611f55565b50611f7c929150611f80565b5090565b5b80821115611f7c5760008155600101611f81565b6001600160e01b031981168114610ca657600080fd5b600060208284031215611fbd57600080fd5b813561160381611f95565b60005b83811015611fe3578181015183820152602001611fcb565b83811115610f6f5750506000910152565b6000815180845261200c816020860160208601611fc8565b601f01601f19169290920160200192915050565b6020815260006116036020830184611ff4565b60006020828403121561204557600080fd5b5035919050565b80356001600160a01b038116811461206357600080fd5b919050565b6000806040838503121561207b57600080fd5b6120848361204c565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126120b957600080fd5b813567ffffffffffffffff808211156120d4576120d4612092565b604051601f8301601f19908116603f011681019082821181831017156120fc576120fc612092565b8160405283815286602085880101111561211557600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561214757600080fd5b813567ffffffffffffffff81111561215e57600080fd5b6117e6848285016120a8565b60006020828403121561217c57600080fd5b6116038261204c565b60008060006060848603121561219a57600080fd5b6121a38461204c565b92506121b16020850161204c565b9150604084013590509250925092565b600080604083850312156121d457600080fd5b50508035926020909101359150565b8035801515811461206357600080fd5b60006020828403121561220557600080fd5b611603826121e3565b6000806040838503121561222157600080fd5b61222a8361204c565b9150612238602084016121e3565b90509250929050565b6000806000806080858703121561225757600080fd5b6122608561204c565b935061226e6020860161204c565b925060408501359150606085013567ffffffffffffffff81111561229157600080fd5b61229d878288016120a8565b91505092959194509250565b600080600080608085870312156122bf57600080fd5b6122c88561204c565b9350602085013567ffffffffffffffff808211156122e557600080fd5b6122f1888389016120a8565b94506122ff604088016121e3565b9350606087013591508082111561231557600080fd5b5061229d878288016120a8565b6000806040838503121561233557600080fd5b61233e8361204c565b91506122386020840161204c565b634e487b7160e01b600052601160045260246000fd5b600082198211156123755761237561234c565b500190565b600181811c9082168061238e57607f821691505b602082108114156123af57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000828210156123fc576123fc61234c565b500390565b634e487b7160e01b600052601260045260246000fd5b600061ffff8084168061242c5761242c612401565b92169190910692915050565b6000835161244a818460208801611fc8565b83519083019061245e818360208801611fc8565b64173539b7b760d91b9101908152600501949350505050565b6972656465656d61626c6560b01b81526000845161249c81600a850160208901611fc8565b60609490941b6bffffffffffffffffffffffff1916600a929094019182019390935290151560f81b601e820152601f0192915050565b60008160001904831182151516156124ec576124ec61234c565b500290565b60008261250057612500612401565b500490565b60008261251457612514612401565b500690565b600060001982141561252d5761252d61234c565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061259390830184611ff4565b9695505050505050565b6000602082840312156125af57600080fd5b815161160381611f9556fea2646970667358221220a3f99e4fc937eed38185a4dc9517c66f1ddea12896b18104af6054d6f57ada0f64736f6c63430008090033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f697066732e696f2f697066732f516d596f776e33416b71644a724d6a766972576d6a5a47646475504233744d5375707775796e786a7464546764520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005068747470733a2f2f697066732e696f2f697066732f6261666b72656962686a6e706733687a6f7466786a6d76666f347235656e7873776d6a6b3261757979786276746c63323766733362756d65326c6100000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102255760003560e01c80636352211e11610123578063a22cb465116100ab578063e71035251161006f578063e7103525146106a2578063e8a3d485146106c2578063e985e9c5146106d7578063f10fb584146106f7578063f2fde38b1461071257600080fd5b8063a22cb46514610618578063b88d4fde14610638578063c87b56dd14610658578063d3ff166c14610678578063d547cfb71461068d57600080fd5b80637f205a74116100f25780637f205a74146105795780638da5cb5b1461059557806395d89b41146105b35780639c4c557c146105e5578063a0712d681461060557600080fd5b80636352211e146104fd57806370a082311461051d5780637146bd081461053d578063715018a61461056457600080fd5b806328ce48a0116101b15780633ccfd60b116101755780633ccfd60b1461046957806342842e0e1461047e57806352dd38081461049e57806355f804b3146104be5780635c474f9e146104de57600080fd5b806328ce48a0146103975780632a55205a146103c757806332cb6b0c14610406578063339159d31461042f5780633c14e04a1461044957600080fd5b806317e7f295116101f857806317e7f295146102f957806318160ddd146103225780631d73814b146103375780631e7269c51461034a57806323b872dd1461037757600080fd5b806301ffc9a71461022a57806306fdde031461025f578063081812fc1461029f578063095ea7b3146102d7575b600080fd5b34801561023657600080fd5b5061024a610245366004611fab565b610732565b60405190151581526020015b60405180910390f35b34801561026b57600080fd5b5060408051808201909152600e81526d4772617469747564652047616e6760901b60208201525b6040516102569190612020565b3480156102ab57600080fd5b506102bf6102ba366004612033565b610778565b6040516001600160a01b039091168152602001610256565b3480156102e357600080fd5b506102f76102f2366004612068565b6107bc565b005b34801561030557600080fd5b5061031466b1a2bc2ec5000081565b604051908152602001610256565b34801561032e57600080fd5b50600254610314565b6102f7610345366004612135565b6107f3565b34801561035657600080fd5b5061031461036536600461216a565b600a6020526000908152604090205481565b34801561038357600080fd5b506102f7610392366004612185565b6109c7565b3480156103a357600080fd5b5061024a6103b236600461216a565b600c6020526000908152604090205460ff1681565b3480156103d357600080fd5b506103e76103e23660046121c1565b6109d7565b604080516001600160a01b039093168352602083019190915201610256565b34801561041257600080fd5b5061041c6108ae81565b60405161ffff9091168152602001610256565b34801561043b57600080fd5b50600e5461024a9060ff1681565b34801561045557600080fd5b50610292610464366004612033565b610a30565b34801561047557600080fd5b506102f7610aca565b34801561048a57600080fd5b506102f7610499366004612185565b610c1b565b3480156104aa57600080fd5b506102f76104b93660046121f3565b610c36565b3480156104ca57600080fd5b506102f76104d9366004612135565b610c73565b3480156104ea57600080fd5b50600e5461024a90610100900460ff1681565b34801561050957600080fd5b506102bf610518366004612033565b610ca9565b34801561052957600080fd5b5061031461053836600461216a565b610d66565b34801561054957600080fd5b50610552600581565b60405160ff9091168152602001610256565b34801561057057600080fd5b506102f7610dab565b34801561058557600080fd5b5061031467011c37937e08000081565b3480156105a157600080fd5b506000546001600160a01b03166102bf565b3480156105bf57600080fd5b5060408051808201909152600981526847524154495455444560b81b6020820152610292565b3480156105f157600080fd5b506102f76106003660046121f3565b610de1565b6102f7610613366004612033565b610e25565b34801561062457600080fd5b506102f761063336600461220e565b610f30565b34801561064457600080fd5b506102f7610653366004612241565b610f63565b34801561066457600080fd5b50610292610673366004612033565b610f75565b34801561068457600080fd5b506102926110df565b34801561069957600080fd5b506102926110ec565b3480156106ae57600080fd5b506102f76106bd3660046122a9565b61117e565b3480156106ce57600080fd5b50610292611298565b3480156106e357600080fd5b5061024a6106f2366004612322565b6112a7565b34801561070357600080fd5b5060095461041c9061ffff1681565b34801561071e57600080fd5b506102f761072d36600461216a565b6112d5565b60006001600160e01b03198216635b5e139f60e01b148061076357506001600160e01b0319821663152a902d60e11b145b8061077257506107728261136d565b92915050565b6000610783826113a2565b6107a057604051634a1850bf60e11b815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b600e5462010000900460ff166107e55760405163574b16a760e11b815260040160405180910390fd5b6107ef82826113b7565b5050565b33806108125760405163574b16a760e11b815260040160405180910390fd5b600e5460ff166108355760405163574b16a760e11b815260040160405180910390fd5b600e54610100900460ff161561085e5760405163574b16a760e11b815260040160405180910390fd5b60005460405169185d5d1a1bdc9a5e995960b21b60208201526bffffffffffffffffffffffff19606084901b16602a8201526001600160a01b039091169061090e9061090890603e015b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b84611441565b6001600160a01b0316146109355760405163574b16a760e11b815260040160405180910390fd5b6001600160a01b0381166000908152600a602052604090205415158061096157503466b1a2bc2ec50000115b8061098057506108ae61097360025490565b61097e906001612362565b115b1561099e5760405163574b16a760e11b815260040160405180910390fd5b6001600160a01b0381166000908152600a602052604090206001908190556107ef908290611465565b6109d283838361147f565b505050565b6000806109e3846113a2565b610a0057604051634a1850bf60e11b815260040160405180910390fd5b6000546001600160a01b0316610a24612710610a1e866103e86115f7565b9061160a565b915091505b9250929050565b600b6020526000908152604090208054610a499061237a565b80601f0160208091040260200160405190810160405280929190818152602001828054610a759061237a565b8015610ac25780601f10610a9757610100808354040283529160200191610ac2565b820191906000526020600020905b815481529060010190602001808311610aa557829003601f168201915b505050505081565b6000546001600160a01b03163314610afd5760405162461bcd60e51b8152600401610af4906123b5565b60405180910390fd5b60026001541415610b505760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610af4565b6002600155610b5d6110ec565b51610b7b5760405163574b16a760e11b815260040160405180910390fd5b60095461ffff16610bc6576108ae610b946001436123ea565b610b9e9190612417565b6009805461ffff191661ffff929092169182179055610bc6576009805461ffff191660011790555b600e5462010000900460ff16610be857600e805462ff00001916620100001790555b60405133904780156108fc02916000818181858888f19350505050158015610c14573d6000803e3d6000fd5b5060018055565b6109d283838360405180602001604052806000815250610f63565b6000546001600160a01b03163314610c605760405162461bcd60e51b8152600401610af4906123b5565b600e805460ff1916911515919091179055565b6000546001600160a01b03163314610c9d5760405162461bcd60e51b8152600401610af4906123b5565b610ca681611616565b50565b60008181526003602052604081205482906001600160a01b031615610ce6576000908152600360205260409020546001600160a01b031692915050565b600081118015610cf857506002548111155b15610d4c575b6000190180610d0c57610d4c565b6000818152600360205260409020546001600160a01b031615610d47576000908152600360205260409020546001600160a01b031692915050565b610cfe565b50604051634a1850bf60e11b815260040160405180910390fd5b60006001600160a01b038216610d8f576040516316285dcb60e11b815260040160405180910390fd5b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b03163314610dd55760405162461bcd60e51b8152600401610af4906123b5565b610ddf6000611629565b565b6000546001600160a01b03163314610e0b5760405162461bcd60e51b8152600401610af4906123b5565b600e80549115156101000261ff0019909216919091179055565b3380610e445760405163574b16a760e11b815260040160405180910390fd5b600e54610100900460ff16610e6c5760405163574b16a760e11b815260040160405180910390fd5b811580610e9d57506001600160a01b0381166000908152600a6020526040902054600590610e9b908490611679565b115b80610eb8575034610eb68367011c37937e0800006115f7565b115b80610ed757506108ae82610ecb60025490565b610ed59190612362565b115b15610ef55760405163574b16a760e11b815260040160405180910390fd5b6001600160a01b0381166000908152600a60205260408120805460ff85169290610f20908490612362565b909155506107ef90508183611465565b600e5462010000900460ff16610f595760405163574b16a760e11b815260040160405180910390fd5b6107ef8282611685565b610f6f84848484611690565b50505050565b6060610f80826113a2565b610f9d57604051634a1850bf60e11b815260040160405180910390fd5b6000828152600b602052604081208054610fb69061237a565b9050111561105c576000828152600b602052604090208054610fd79061237a565b80601f01602080910402602001604051908101604052809291908181526020018280546110039061237a565b80156110505780601f1061102557610100808354040283529160200191611050565b820191906000526020600020905b81548152906001019060200180831161103357829003601f168201915b50505050509050919050565b60095461ffff1661107457600d8054610fd79061237a565b6009546000906110a49060019061109e906108ae9061109890889061ffff16611679565b906116dc565b90611679565b90506110ae6110ec565b6110b7826116e8565b6040516020016110c8929190612438565b604051602081830303815290604052915050919050565b600d8054610a499061237a565b6060600780546110fb9061237a565b80601f01602080910402602001604051908101604052809291908181526020018280546111279061237a565b80156111745780601f1061114957610100808354040283529160200191611174565b820191906000526020600020905b81548152906001019060200180831161115757829003601f168201915b5050505050905090565b6001600160a01b0384166000908152600c602052604090205460ff16156111b85760405163574b16a760e11b815260040160405180910390fd5b6000546001600160a01b03166001600160a01b03166111ee6111e88587866040516020016108a893929190612477565b83611441565b6001600160a01b0316146112155760405163574b16a760e11b815260040160405180910390fd5b600061122060025490565b61122b906001612362565b905082156112435761123e856001611465565b61124e565b61124e856004611465565b6000818152600b60209081526040909120855161126d92870190611efc565b5050506001600160a01b039092166000908152600c60205260409020805460ff191660011790555050565b6060600880546110fb9061237a565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6000546001600160a01b031633146112ff5760405162461bcd60e51b8152600401610af4906123b5565b6001600160a01b0381166113645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610af4565b610ca681611629565b60006001600160e01b031982166380ac58cd60e01b148061077257506301ffc9a760e01b6001600160e01b0319831614610772565b60008082118015610772575050600254101590565b60006113c282610ca9565b9050806001600160a01b0316836001600160a01b031614156113f75760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b0382168114801590611418575061141682826112a7565b155b156114365760405163250fdee360e21b815260040160405180910390fd5b610f6f8484846117ee565b6000806000611450858561184a565b9150915061145d816118b7565b509392505050565b6107ef828260405180602001604052806000815250611a72565b6001600160a01b0382166114a65760405163574b16a760e11b815260040160405180910390fd5b60006114b182610ca9565b9050806001600160a01b0316846001600160a01b03161415806114dc57506114da338383611a7f565b155b156114fa5760405163574b16a760e11b815260040160405180910390fd5b611506600083866117ee565b6001600160a01b03808416600081815260046020908152604080832080546001908101909155948916835280832080546000190190558683526003909152902080546001600160a01b031916909117905560025490830190811180159061158257506000818152600360205260409020546001600160a01b0316155b156115af57600081815260036020526040902080546001600160a01b0319166001600160a01b0387161790555b5081836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050565b600061160382846124d2565b9392505050565b600061160382846124f1565b80516107ef906007906020840190611efc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006116038284612362565b6107ef338383611aca565b61169b84848461147f565b6000836001600160a01b03163b1180156116be57506116bc84848484611b6a565b155b15610f6f57604051631f11849560e21b815260040160405180910390fd5b60006116038284612505565b60608161170c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611736578061172081612519565b915061172f9050600a836124f1565b9150611710565b60008167ffffffffffffffff81111561175157611751612092565b6040519080825280601f01601f19166020018201604052801561177b576020820181803683370190505b5090505b84156117e6576117906001836123ea565b915061179d600a86612505565b6117a8906030612362565b60f81b8183815181106117bd576117bd612534565b60200101906001600160f81b031916908160001a9053506117df600a866124f1565b945061177f565b949350505050565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000808251604114156118815760208301516040840151606085015160001a61187587828585611c61565b94509450505050610a29565b8251604014156118ab57602083015160408401516118a0868383611d4e565b935093505050610a29565b50600090506002610a29565b60008160048111156118cb576118cb61254a565b14156118d45750565b60018160048111156118e8576118e861254a565b14156119365760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610af4565b600281600481111561194a5761194a61254a565b14156119985760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610af4565b60038160048111156119ac576119ac61254a565b1415611a055760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610af4565b6004816004811115611a1957611a1961254a565b1415610ca65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610af4565b6109d28383836001611d7d565b6000816001600160a01b0316846001600160a01b03161480611aba5750836001600160a01b0316611aaf84610778565b6001600160a01b0316145b806117e657506117e682856112a7565b816001600160a01b0316836001600160a01b03161415611afd5760405163079f14e360e51b815260040160405180910390fd5b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611b9f903390899088908890600401612560565b602060405180830381600087803b158015611bb957600080fd5b505af1925050508015611be9575060408051601f3d908101601f19168201909252611be69181019061259d565b60015b611c44573d808015611c17576040519150601f19603f3d011682016040523d82523d6000602084013e611c1c565b606091505b508051611c3c57604051630568cbab60e01b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611c985750600090506003611d45565b8460ff16601b14158015611cb057508460ff16601c14155b15611cc15750600090506004611d45565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d15573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d3e57600060019250925050611d45565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01611d6f87828885611c61565b935093505050935093915050565b821580611d9157506001600160a01b038416155b15611daf5760405163574b16a760e11b815260040160405180910390fd5b60006002546001611dc09190612362565b905060028054850190556001600160a01b03851660008181526004602090815260408083208054890190558483526003909152902080546001600160a01b031916909117905580828015611e1e57506000866001600160a01b03163b115b15611ea45760005b85811015611e9c5760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4611e736000888488611b6a565b611e9057604051631f11849560e21b815260040160405180910390fd5b60019182019101611e26565b505050610f6f565b60005b85811015611ef35760405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a460019182019101611ea7565b50505050505050565b828054611f089061237a565b90600052602060002090601f016020900481019282611f2a5760008555611f70565b82601f10611f4357805160ff1916838001178555611f70565b82800160010185558215611f70579182015b82811115611f70578251825591602001919060010190611f55565b50611f7c929150611f80565b5090565b5b80821115611f7c5760008155600101611f81565b6001600160e01b031981168114610ca657600080fd5b600060208284031215611fbd57600080fd5b813561160381611f95565b60005b83811015611fe3578181015183820152602001611fcb565b83811115610f6f5750506000910152565b6000815180845261200c816020860160208601611fc8565b601f01601f19169290920160200192915050565b6020815260006116036020830184611ff4565b60006020828403121561204557600080fd5b5035919050565b80356001600160a01b038116811461206357600080fd5b919050565b6000806040838503121561207b57600080fd5b6120848361204c565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126120b957600080fd5b813567ffffffffffffffff808211156120d4576120d4612092565b604051601f8301601f19908116603f011681019082821181831017156120fc576120fc612092565b8160405283815286602085880101111561211557600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561214757600080fd5b813567ffffffffffffffff81111561215e57600080fd5b6117e6848285016120a8565b60006020828403121561217c57600080fd5b6116038261204c565b60008060006060848603121561219a57600080fd5b6121a38461204c565b92506121b16020850161204c565b9150604084013590509250925092565b600080604083850312156121d457600080fd5b50508035926020909101359150565b8035801515811461206357600080fd5b60006020828403121561220557600080fd5b611603826121e3565b6000806040838503121561222157600080fd5b61222a8361204c565b9150612238602084016121e3565b90509250929050565b6000806000806080858703121561225757600080fd5b6122608561204c565b935061226e6020860161204c565b925060408501359150606085013567ffffffffffffffff81111561229157600080fd5b61229d878288016120a8565b91505092959194509250565b600080600080608085870312156122bf57600080fd5b6122c88561204c565b9350602085013567ffffffffffffffff808211156122e557600080fd5b6122f1888389016120a8565b94506122ff604088016121e3565b9350606087013591508082111561231557600080fd5b5061229d878288016120a8565b6000806040838503121561233557600080fd5b61233e8361204c565b91506122386020840161204c565b634e487b7160e01b600052601160045260246000fd5b600082198211156123755761237561234c565b500190565b600181811c9082168061238e57607f821691505b602082108114156123af57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000828210156123fc576123fc61234c565b500390565b634e487b7160e01b600052601260045260246000fd5b600061ffff8084168061242c5761242c612401565b92169190910692915050565b6000835161244a818460208801611fc8565b83519083019061245e818360208801611fc8565b64173539b7b760d91b9101908152600501949350505050565b6972656465656d61626c6560b01b81526000845161249c81600a850160208901611fc8565b60609490941b6bffffffffffffffffffffffff1916600a929094019182019390935290151560f81b601e820152601f0192915050565b60008160001904831182151516156124ec576124ec61234c565b500290565b60008261250057612500612401565b500490565b60008261251457612514612401565b500690565b600060001982141561252d5761252d61234c565b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061259390830184611ff4565b9695505050505050565b6000602082840312156125af57600080fd5b815161160381611f9556fea2646970667358221220a3f99e4fc937eed38185a4dc9517c66f1ddea12896b18104af6054d6f57ada0f64736f6c63430008090033

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

000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f697066732e696f2f697066732f516d596f776e33416b71644a724d6a766972576d6a5a47646475504233744d5375707775796e786a7464546764520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005068747470733a2f2f697066732e696f2f697066732f6261666b72656962686a6e706733687a6f7466786a6d76666f347235656e7873776d6a6b3261757979786276746c63323766733362756d65326c6100000000000000000000000000000000

-----Decoded View---------------
Arg [0] : uri (string): https://ipfs.io/ipfs/QmYown3AkqdJrMjvirWmjZGdduPB3tMSupwuynxjtdTgdR
Arg [1] : preview (string): https://ipfs.io/ipfs/bafkreibhjnpg3hzotfxjmvfo4r5enxswmjk2auyyxbvtlc27fs3bume2la

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [3] : 68747470733a2f2f697066732e696f2f697066732f516d596f776e33416b7164
Arg [4] : 4a724d6a766972576d6a5a47646475504233744d5375707775796e786a746454
Arg [5] : 6764520000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000050
Arg [7] : 68747470733a2f2f697066732e696f2f697066732f6261666b72656962686a6e
Arg [8] : 706733687a6f7466786a6d76666f347235656e7873776d6a6b32617579797862
Arg [9] : 76746c63323766733362756d65326c6100000000000000000000000000000000


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

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