ETH Price: $2,154.36 (+5.45%)

Token

Boys Club Store (powered by Dispatch) (BOYSCLUB)
 

Overview

Max Total Supply

25 BOYSCLUB

Holders

25

Transfers

-
0 (0%)

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

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

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

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x2e70A483...ff24e515f
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
DispatchStore

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "./interfaces/IERC4906.sol";

/// @title Base NFT contract for dispatch ecommerce stores
/// @author Dispatch.co
/// @dev 1 store contract per org
contract DispatchStore is ERC721, IERC4906, Ownable, Pausable, ReentrancyGuard {
  // used to set our prices in USD
  AggregatorV3Interface internal priceFeed;
  // the fee as a percentage
  // 10 percent is the default
  uint8 public DISPATCH_FEE = 10;
  // math in solidity is annoying because decimals don't work. We set ours to a precision range of 4, or
  uint8 public PRECISION_DECIMALS = 1e2;
  // because overflows are scary
  using SafeMath for uint256;
  // because strongly typed languages are also scary
  using Strings for uint256;
  using Strings for address;
  // dispatch wallet to which we send funds
  address payable public dispatchTreasuryAddress;
  // merchant wallet to which we send funds
  address payable public merchantTreasuryAddress;
  // whitelisted addresses can burn + transfer + set prices
  mapping(address => bool) public whiteListedAddress;
  // optional store property which limits the number of NFTs a given address can hold from this collection
  // used to prevent 1 address from buying up all the supply as an optional safety measure
  uint256 public maxStoreBalanceAllowance = 0;
  // base NFT API uri
  string public productBaseURI;
  // we use numerical productIdCounters which map to TokenIds to create "Product associations"
  uint256 public productIdCounter;
  // we use numerical tokenIdCounters which map to productIds to create "Product associations"
  uint256 public tokenIdCounter;
  // maps the nftID to a particular tokenURI
  mapping(uint256 => uint256) public tokenIDtoproductIdCounterMap;

  // productIdCounter to ProductDetails mapping
  mapping(uint256 => ProductDetails) public product;

  // metadata for any product
  struct ProductDetails {
    uint256 productPrice; // optional
    uint256 productTotalSupply; // cannot be set
    uint256 productMaxSupply; // required
    uint256 productBurns; // cannot be set
    string productCollectionUri; // required
    address productTokenGateAddress; // optional
    uint256 productTokenGateTokenId; // optional
  }

  // used when leveraging optional token gating
  IERC1155 private ERC1155TokenGate;
  IERC721 private ERC721TokenGate;

  // fires when address whitelist status changes
  event WhitelistChanged(address indexed _address, bool _isWhitelisted);
  // fires event when the rate changes
  event DispatchRateChanged(uint256 indexed _newRate);
  // fires when an product's details change
  event ProductDetailsChanged(
    uint256 indexed _productId,
    uint256 _productPrice,
    uint256 _productTotalSupply,
    uint256 _productMaxSupply,
    uint256 _productBurns,
    address _productTokenGateAddress,
    uint256 _productTokenGateTokenId
  );
  // fires when a sale is made
  event SaleEvent(
    uint256 indexed _productId, // id of the product
    address _receiver, // who receives the product
    uint256 _amountInBatch, // quantity of the product received
    uint256 _tokenId, // tokenId
    ProductDetails _product, // details of the product purchased
    uint256 _l1Price, // price quoted by the oracle
    string _data // arbitrary string data
  );

  constructor(
    string memory name_,
    string memory symbol_,
    string memory baseURI_,
    address payable dispatchTreasuryAddress_,
    address payable merchantTreasuryAddress_,
    ProductDetails[] memory inventory,
    address[] memory toWhitelist,
    address _priceContractAddr,
    uint8 _dispatchFee
  ) ERC721(name_, symbol_) {
    // set the dispatch fee
    DISPATCH_FEE = _dispatchFee;
    // chainklink oracle to convert USD to ETH
    priceFeed = AggregatorV3Interface(_priceContractAddr);
    // set where the money goes
    setTreasuryAddresses(dispatchTreasuryAddress_, merchantTreasuryAddress_);
    // set base URI
    productBaseURI = baseURI_;
    // create an initial set of products
    createNewProductBulk(inventory);
    // whitelist a set of initial addresses
    for (uint256 i; i < toWhitelist.length; i++) {
      setWhitelistedAddress(toWhitelist[i], true);
    }
  }

  // --------------------- MODIFIERS ---------------------

  modifier _isValidAmount(uint256 _amount, uint256 _productId) {
    // checks that the user is holding the NFT
    require(
      _amount >= 1 && product[_productId].productTotalSupply.add(_amount) <= product[_productId].productMaxSupply,
      "Cannot exceed product total supply."
    );
    _;
  }

  modifier _isWhitelistedAddress() {
    // checks that the user is the owner or is whitelisted
    require(
      msg.sender == owner() || whiteListedAddress[msg.sender] == true,
      "Must be the owner or be whitelisted address."
    );
    _;
  }

  /**
      @notice Verifies the product exists by checking the URI definition
      @param _productId new product base URI
   */
  function _isValidProduct(uint256 _productId) private view {
    // checks that the user is holding the NFT
    require(bytes(product[_productId].productCollectionUri).length > 0, "This product does not exist.");
  }

  /**
      @notice Verifies the product exists by checking the URI definition
      @param _amount amount of tokens
      @param _addr address to accept the tokens
   */
  function _isValidTransferOfSum(uint256 _amount, address _addr) private view {
    // checks that the user is holding the NFT
    if (maxStoreBalanceAllowance > 0 && _addr != address(0)) {
      require(
        balanceOf(_addr).add(_amount) <= maxStoreBalanceAllowance,
        "Cannot exceed the maxStoreBalanceAllowance for a given address."
      );
    }
  }

  // --------------------- OWNER FUNCTIONS ---------------------

  /**
      @notice Allows owner to set the products base URI.
      @param _newUri new product base URI
   */
  function setBaseURI(string memory _newUri) external onlyOwner {
    productBaseURI = _newUri;
  }

  /**
      @notice Allows owner can pause the contract
      @param _shouldPause bool if contract should be paused
   */
  function togglePaused(bool _shouldPause) external onlyOwner {
    if (_shouldPause) {
      _pause();
    } else {
      _unpause();
    }
  }

  /**
      @notice Allows owner to request an update of all metadata
   */
  function refreshAllMetadata() external _isWhitelistedAddress {
    emit BatchMetadataUpdate(0, tokenIdCounter);
  }

  /**
      @notice Allows owner to restrict max NFT ownership - is optional and the value 0 disables it.
      @dev note that setting this value doesnt affect users holding over the new limit
      @param _newMaxStoreBalanceAllowance new max balance an address can hold - setting to 0 disables it
   */
  function setMaxStoreBalanceAllowance(uint256 _newMaxStoreBalanceAllowance) external onlyOwner {
    maxStoreBalanceAllowance = _newMaxStoreBalanceAllowance;
  }

  /**
      @notice Allows owner to set payment addresses.
      @param _newDispatchAddress new address to send dispatch funds
      @param _newMerchantAddress new address to send merchant funds
   */
  function setTreasuryAddresses(address payable _newDispatchAddress, address payable _newMerchantAddress)
    public
    onlyOwner
  {
    require(_newDispatchAddress != address(0), "Dispatch address cannot be null address");
    dispatchTreasuryAddress = _newDispatchAddress;
    merchantTreasuryAddress = _newMerchantAddress;
  }

  /**
      @notice Returns the products base URI. Overrides 721 default function. Only owner can call this function. Emits WhitelistChanged event.
      @param _address address of which we change whitelist status
      @param _bool true or false 
   */
  function setWhitelistedAddress(address _address, bool _bool) public onlyOwner {
    // resets the metadata uri
    whiteListedAddress[_address] = _bool;
    emit WhitelistChanged(_address, _bool);
  }

  /**
      @notice Allows owner to set the dispatchFee percentage take rate. Emits DispatchRateChanged event.
      @param _dispatchFee a value 0 - 99
   */
  function setFees(uint8 _dispatchFee) external onlyOwner {
    require(_dispatchFee < 100, "cannot set a fee above 99");
    DISPATCH_FEE = _dispatchFee;
    emit DispatchRateChanged(_dispatchFee);
  }

  // --------------------- OWNER/ADMIN FUNCTIONS ---------------------

  /**
      @notice Allows whitelisted addresses or owner to edit a product configuration
      @param _productIdCounter product identifier
      @param _productPrice product price
      @param _productMaxSupply product maxSupply
      @param _productCollectionUri productCollectionUri
   */
  function setProductDetails(
    uint256 _productIdCounter,
    uint256 _productPrice,
    uint256 _productMaxSupply,
    string memory _productCollectionUri,
    address _productTokenGateAddress,
    uint256 _productTokenGateTokenId
  ) public _isWhitelistedAddress whenNotPaused nonReentrant {
    // productIDs must be incremental
    require(_productIdCounter <= productIdCounter, "new products must use createNewProduct function.");
    // productCollectionUris are a necessary condition for any product
    require(bytes(_productCollectionUri).length > 0, "productCollectionUri is a necessary condition for any product.");
    // checks that the optional tokenGate is implemented correctly; using a tokenId requires the 1155 interface, otherwise 721 is used
    if (_productTokenGateTokenId > 0) {
      require(
        IERC1155(_productTokenGateAddress).supportsInterface(type(IERC1155).interfaceId),
        "Must use ERC1155 address with a tokenID."
      );
    } else if (_productTokenGateAddress != address(0)) {
      require(
        IERC721(_productTokenGateAddress).supportsInterface(type(IERC721).interfaceId),
        "Must use ERC721 address without a tokenID."
      );
    }
    // set the tokenID as the Product Key for the ProductDetails
    product[_productIdCounter] = ProductDetails(
      _productPrice,
      product[_productIdCounter].productTotalSupply,
      _productMaxSupply,
      product[_productIdCounter].productBurns,
      _productCollectionUri,
      _productTokenGateAddress,
      _productTokenGateTokenId
    );
    // emit the details which changed
    emit ProductDetailsChanged(
      _productIdCounter,
      _productPrice,
      product[_productIdCounter].productTotalSupply,
      _productMaxSupply,
      product[_productIdCounter].productBurns,
      _productTokenGateAddress,
      _productTokenGateTokenId
    );
  }

  /**
      @notice Allows whitelisted addresses or owner to create a product configuration
      @param _productPrice product price
      @param _productMaxSupply product maxSupply
      @param _productCollectionUri productCollectionUri
   */
  function createNewProduct(
    uint256 _productPrice,
    uint256 _productMaxSupply,
    string memory _productCollectionUri,
    address _productTokenGateAddress,
    uint256 _productTokenGateTokenId
  ) public _isWhitelistedAddress whenNotPaused {
    productIdCounter++;
    setProductDetails(
      productIdCounter,
      _productPrice,
      _productMaxSupply,
      _productCollectionUri,
      _productTokenGateAddress,
      _productTokenGateTokenId
    );
  }

  /**
      @notice Allows whitelisted addresses or owner to create a product configuration in bulk
      @dev A struct is used here to make looping through an array easier (otherwise we would need 4 separate arrays as arguments)
      @param _inventory ProductDetails - uint256 productPrice; uint256 productTotalSupply; uint256 productMaxSupply; string productCollectionUri;
   */
  function createNewProductBulk(ProductDetails[] memory _inventory) public _isWhitelistedAddress whenNotPaused {
    for (uint256 i = 0; i < _inventory.length; i++) {
      createNewProduct(
        _inventory[i].productPrice,
        _inventory[i].productMaxSupply,
        _inventory[i].productCollectionUri,
        _inventory[i].productTokenGateAddress,
        _inventory[i].productTokenGateTokenId
      );
    }
  }

  // --------------------- GETTER FUNCTIONS ---------------------

  function totalSupply() public view returns (uint256) {
    return tokenIdCounter;
  }

  /// @notice Returns the price of X tokens
  /// @dev Chainlink returns int256 values; converted to uint in this function
  /// @return uint256
  function getL1PriceForProduct(uint256 _amount, uint256 _productId) public view returns (uint256) {
    _isValidProduct(_productId);
    // get the raw int256 price from the chainlink oracle
    (, int256 oraclePrice, , , ) = priceFeed.latestRoundData();
    // protect against overflows from the priceFeed since int can be negative
    require(oraclePrice >= 0, "price cannot be negative");
    // convert it to uint so we can compare to msg.value
    uint256 ethToUsdPrice = uint256(oraclePrice);
    // get the price for 1 token
    uint256 priceFor1Product = (((product[_productId].productPrice.mul(1e18)).div(ethToUsdPrice)).mul(1e8)).div(
      PRECISION_DECIMALS
    );
    // and then multiply that price by _numTokens and then by 1e18 which converts eth to wei
    return priceFor1Product.mul(_amount);
  }

  /**
      @notice Returns the token's URI which is a combination of the baseUri, the contract address, the productCollectionUri, and the tokenId
      @param _tokenId NFT _tokenId
   */
  function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
    _requireMinted(_tokenId);
    _isValidProduct(tokenIDtoproductIdCounterMap[_tokenId]);
    ProductDetails memory foundProduct = product[tokenIDtoproductIdCounterMap[_tokenId]];
    return
      string(
        abi.encodePacked(
          productBaseURI,
          "/",
          address(this).toHexString(),
          "/",
          foundProduct.productCollectionUri,
          "/",
          tokenIDtoproductIdCounterMap[_tokenId].toString(),
          "/",
          _tokenId.toString()
        )
      );
  }

  /**
      @notice Returns the productDetails of a given tokenId. TokenIds are assigned to productIds which are assigned to productDetails.
      @param _tokenId NFT _tokenId
   */
  function getTokenProductDetails(uint256 _tokenId) public view returns (ProductDetails memory) {
    _isValidProduct(tokenIDtoproductIdCounterMap[_tokenId]);
    return product[tokenIDtoproductIdCounterMap[_tokenId]];
  }

  // --------------------- SETTER / LOGIC FUNCTIONS ---------------------

  /**
      @notice distributes the msg.value between relevant parties
      @dev private function
   */
  function _distributeFunds() private {
    // no merchant address? No problem! We will take it all.
    if (merchantTreasuryAddress == address(0)) {
      (bool sent, ) = (dispatchTreasuryAddress).call{ value: msg.value }("");
      require(sent, "Failed to send funds");
    } else {
      // get the dispatchTotal by calculating the relative % value of the msg.value
      uint256 dispatchTotal = (msg.value.mul(DISPATCH_FEE)).div(uint256(100));
      // get the merchantTotal by subtracting the dispatchTotal from the msg.value
      uint256 merchantTotal = msg.value.sub(dispatchTotal);
      (bool dSent, ) = (dispatchTreasuryAddress).call{ value: dispatchTotal }("");
      (bool mSent, ) = (merchantTreasuryAddress).call{ value: merchantTotal }("");
      require(dSent && mSent, "Failed to send funds to dispatch and merchant");
    }
  }

  /**
      @notice Purchase a product with the L1 token
      @param _amount product amount to purchase
      @param _productId product numerical ID
      @param _data additional data passed to event for logging purposes
   */
  function mint(
    uint256 _amount,
    uint256 _productId,
    string memory _data
  ) external payable _isValidAmount(_amount, _productId) nonReentrant whenNotPaused {
    _handleMint(_amount, _productId, msg.sender, _data);
  }

  /**
      @notice Purchase a product with the L1 token
      @param _amount product amount to purchase
      @param _productId product numerical ID
      @param _data additional data passed to event for logging purposes
      @param _receiver address to receiveNFT
   */
  function mintTo(
    uint256 _amount,
    uint256 _productId,
    string memory _data,
    address _receiver
  ) external payable _isValidAmount(_amount, _productId) nonReentrant whenNotPaused {
    _handleMint(_amount, _productId, _receiver, _data);
  }

  /**
      @notice Purchase a product with the L1 token
      @param _amount product amount to purchase
      @param _productId product numerical ID
      @param _receiver address to receiveNFT
      @param _data additional data passed to event for logging purposes
      @dev private function
   */
  function _handleMint(
    uint256 _amount,
    uint256 _productId,
    address _receiver,
    string memory _data
  ) private {
    uint256 l1Price = getL1PriceForProduct(_amount, _productId);
    // check that the user sent enough ETH
    require(msg.value >= l1Price, "Invalid amount paid.");
    // optional check that the user holds the required token when the product is tokenGated
    if (product[_productId].productTokenGateAddress != address(0)) {
      if (product[_productId].productTokenGateTokenId > 0) {
        require(
          IERC1155(product[_productId].productTokenGateAddress).balanceOf(
            _receiver,
            product[_productId].productTokenGateTokenId
          ) > 0,
          "Address lacks the required 1155 token gate balance > 1."
        );
      } else {
        require(
          IERC721(product[_productId].productTokenGateAddress).balanceOf(_receiver) > 0,
          "Address lacks the required 721 token gate balance > 1."
        );
      }
    }

    if (msg.value > 0) {
      // distribute all the money
      _distributeFunds();
    }
    // add to the product totalSupply
    product[_productId].productTotalSupply = product[_productId].productTotalSupply.add(_amount);
    for (uint256 i = 0; i < _amount; i++) {
      // add to the overall totalSupply
      tokenIdCounter++;
      // map the tokenID to the productID
      tokenIDtoproductIdCounterMap[tokenIdCounter] = _productId;
      // mint token to sender * amount
      _safeMint(_receiver, tokenIdCounter);
      emit SaleEvent(_productId, _receiver, _amount, tokenIdCounter, product[_productId], l1Price.div(_amount), _data);
    }
  }

  /**
      @notice Permissions transfers / burns of a given tokenID
      @dev This function overrides the default behavior
      @param _owner of the asset
      @param _operator msg.sender of the req
   */
  function isApprovedForAll(address _owner, address _operator) public view override returns (bool isOperator) {
    if (whiteListedAddress[_operator] == true) {
      return true;
    }
    // otherwise, use the default ERC1155.isApprovedForAll()
    return ERC721.isApprovedForAll(_owner, _operator);
  }

  function _beforeTokenTransfer(
    address from,
    address to,
    uint256 tokenId, /* firstTokenId */
    uint256 batchSize
  ) internal virtual override {
    // check that the address will not hold more than the maxStoreBalanceAllowance if
    // it's not a burn transfer and maxStoreBalanceAllowance is set above 0
    _isValidTransferOfSum(batchSize, to);
    ERC721._beforeTokenTransfer(from, to, tokenId, batchSize);
  }

  /**
      @notice Sends a token to the NULL address
      @dev Only whitelisted can burn
      @param _tokenId of the asset
   */
  function burn(uint256 _tokenId) public _isWhitelistedAddress whenNotPaused {
    _requireMinted(_tokenId);
    _isValidProduct(tokenIDtoproductIdCounterMap[_tokenId]);
    product[tokenIDtoproductIdCounterMap[_tokenId]].productBurns = product[tokenIDtoproductIdCounterMap[_tokenId]]
      .productBurns
      .add(1);
    _burn(_tokenId);
  }

  /**
      @notice Sends a token to the NULL address AND decrements the supply AND refunds the user
      @dev Only whitelisted can refund
      @param _tokenId of the asset
   */
  function refund(uint256 _tokenId) external payable _isWhitelistedAddress whenNotPaused nonReentrant {
    address currOwner = _ownerOf(_tokenId);
    burn(_tokenId);
    product[tokenIDtoproductIdCounterMap[_tokenId]].productTotalSupply = product[tokenIDtoproductIdCounterMap[_tokenId]]
      .productTotalSupply
      .sub(1);
    (bool sent, ) = (currOwner).call{ value: msg.value }("");
    require(sent, "Failed to send funds");
  }

  /**
      @notice Sends a token to the NULL address
      @dev Only whitelisted can burn
      @param _ids[] of the asset
   */
  function burnBatch(uint256[] memory _ids) public _isWhitelistedAddress whenNotPaused {
    for (uint256 i = 0; i < _ids.length; i++) {
      burn(_ids[i]);
    }
  }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 4 of 19 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

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

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

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

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

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

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");

        _transfer(from, to, tokenId);
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(tokenId) != address(0);
    }

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

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

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

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

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

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

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

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 subtraction 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;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

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

File 19 of 19 : IERC4906.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

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

/// @title EIP-721 Metadata Update Extension
interface IERC4906 is IERC165 {
    /// @dev This event emits when the metadata of a token is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFT.
    event MetadataUpdate(uint256 _tokenId);

    /// @dev This event emits when the metadata of a range of tokens is changed.
    /// So that the third-party platforms such as NFT market could
    /// timely update the images and related attributes of the NFTs.    
    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"baseURI_","type":"string"},{"internalType":"address payable","name":"dispatchTreasuryAddress_","type":"address"},{"internalType":"address payable","name":"merchantTreasuryAddress_","type":"address"},{"components":[{"internalType":"uint256","name":"productPrice","type":"uint256"},{"internalType":"uint256","name":"productTotalSupply","type":"uint256"},{"internalType":"uint256","name":"productMaxSupply","type":"uint256"},{"internalType":"uint256","name":"productBurns","type":"uint256"},{"internalType":"string","name":"productCollectionUri","type":"string"},{"internalType":"address","name":"productTokenGateAddress","type":"address"},{"internalType":"uint256","name":"productTokenGateTokenId","type":"uint256"}],"internalType":"struct DispatchStore.ProductDetails[]","name":"inventory","type":"tuple[]"},{"internalType":"address[]","name":"toWhitelist","type":"address[]"},{"internalType":"address","name":"_priceContractAddr","type":"address"},{"internalType":"uint8","name":"_dispatchFee","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_newRate","type":"uint256"}],"name":"DispatchRateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_productId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_productPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_productTotalSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_productMaxSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_productBurns","type":"uint256"},{"indexed":false,"internalType":"address","name":"_productTokenGateAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"_productTokenGateTokenId","type":"uint256"}],"name":"ProductDetailsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_productId","type":"uint256"},{"indexed":false,"internalType":"address","name":"_receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountInBatch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"productPrice","type":"uint256"},{"internalType":"uint256","name":"productTotalSupply","type":"uint256"},{"internalType":"uint256","name":"productMaxSupply","type":"uint256"},{"internalType":"uint256","name":"productBurns","type":"uint256"},{"internalType":"string","name":"productCollectionUri","type":"string"},{"internalType":"address","name":"productTokenGateAddress","type":"address"},{"internalType":"uint256","name":"productTokenGateTokenId","type":"uint256"}],"indexed":false,"internalType":"struct DispatchStore.ProductDetails","name":"_product","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"_l1Price","type":"uint256"},{"indexed":false,"internalType":"string","name":"_data","type":"string"}],"name":"SaleEvent","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"},{"indexed":false,"internalType":"bool","name":"_isWhitelisted","type":"bool"}],"name":"WhitelistChanged","type":"event"},{"inputs":[],"name":"DISPATCH_FEE","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRECISION_DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_productPrice","type":"uint256"},{"internalType":"uint256","name":"_productMaxSupply","type":"uint256"},{"internalType":"string","name":"_productCollectionUri","type":"string"},{"internalType":"address","name":"_productTokenGateAddress","type":"address"},{"internalType":"uint256","name":"_productTokenGateTokenId","type":"uint256"}],"name":"createNewProduct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"productPrice","type":"uint256"},{"internalType":"uint256","name":"productTotalSupply","type":"uint256"},{"internalType":"uint256","name":"productMaxSupply","type":"uint256"},{"internalType":"uint256","name":"productBurns","type":"uint256"},{"internalType":"string","name":"productCollectionUri","type":"string"},{"internalType":"address","name":"productTokenGateAddress","type":"address"},{"internalType":"uint256","name":"productTokenGateTokenId","type":"uint256"}],"internalType":"struct DispatchStore.ProductDetails[]","name":"_inventory","type":"tuple[]"}],"name":"createNewProductBulk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dispatchTreasuryAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_productId","type":"uint256"}],"name":"getL1PriceForProduct","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenProductDetails","outputs":[{"components":[{"internalType":"uint256","name":"productPrice","type":"uint256"},{"internalType":"uint256","name":"productTotalSupply","type":"uint256"},{"internalType":"uint256","name":"productMaxSupply","type":"uint256"},{"internalType":"uint256","name":"productBurns","type":"uint256"},{"internalType":"string","name":"productCollectionUri","type":"string"},{"internalType":"address","name":"productTokenGateAddress","type":"address"},{"internalType":"uint256","name":"productTokenGateTokenId","type":"uint256"}],"internalType":"struct DispatchStore.ProductDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isOperator","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxStoreBalanceAllowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merchantTreasuryAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_productId","type":"uint256"},{"internalType":"string","name":"_data","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_productId","type":"uint256"},{"internalType":"string","name":"_data","type":"string"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"mintTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"product","outputs":[{"internalType":"uint256","name":"productPrice","type":"uint256"},{"internalType":"uint256","name":"productTotalSupply","type":"uint256"},{"internalType":"uint256","name":"productMaxSupply","type":"uint256"},{"internalType":"uint256","name":"productBurns","type":"uint256"},{"internalType":"string","name":"productCollectionUri","type":"string"},{"internalType":"address","name":"productTokenGateAddress","type":"address"},{"internalType":"uint256","name":"productTokenGateTokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"productBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"productIdCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refreshAllMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newUri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_dispatchFee","type":"uint8"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxStoreBalanceAllowance","type":"uint256"}],"name":"setMaxStoreBalanceAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_productIdCounter","type":"uint256"},{"internalType":"uint256","name":"_productPrice","type":"uint256"},{"internalType":"uint256","name":"_productMaxSupply","type":"uint256"},{"internalType":"string","name":"_productCollectionUri","type":"string"},{"internalType":"address","name":"_productTokenGateAddress","type":"address"},{"internalType":"uint256","name":"_productTokenGateTokenId","type":"uint256"}],"name":"setProductDetails","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newDispatchAddress","type":"address"},{"internalType":"address payable","name":"_newMerchantAddress","type":"address"}],"name":"setTreasuryAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_bool","type":"bool"}],"name":"setWhitelistedAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_shouldPause","type":"bool"}],"name":"togglePaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIDtoproductIdCounterMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenIdCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whiteListedAddress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

0x60806040526008805461ffff60a01b191661320560a11b1790556000600c553480156200002b57600080fd5b50604051620050d7380380620050d78339810160408190526200004e9162000d7c565b888860006200005e838262000f33565b5060016200006d828262000f33565b5050506200008a620000846200015360201b60201c565b62000157565b6006805460ff60a01b191690556001600755600880546001600160a81b031916600160a01b60ff8416026001600160a01b031916176001600160a01b038416179055620000d88686620001a9565b600d620000e6888262000f33565b50620000f2846200024d565b60005b835181101562000143576200012e84828151811062000118576200011862000fff565b60200260200101516001620003b260201b60201c565b806200013a8162001015565b915050620000f5565b5050505050505050505062001068565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620001b36200041b565b6001600160a01b0382166200021f5760405162461bcd60e51b815260206004820152602760248201527f446973706174636820616464726573732063616e6e6f74206265206e756c6c206044820152666164647265737360c81b60648201526084015b60405180910390fd5b600980546001600160a01b039384166001600160a01b031991821617909155600a8054929093169116179055565b6006546001600160a01b03163314806200027b5750336000908152600b602052604090205460ff1615156001145b620002cd5760405162461bcd60e51b815260206004820152602c6024820152600080516020620050b783398151915260448201526b3a32b21030b2323932b9b99760a11b606482015260840162000216565b620002d762000479565b60005b8151811015620003ae5762000399828281518110620002fd57620002fd62000fff565b6020026020010151600001518383815181106200031e576200031e62000fff565b6020026020010151604001518484815181106200033f576200033f62000fff565b60200260200101516080015185858151811062000360576200036062000fff565b602002602001015160a0015186868151811062000381576200038162000fff565b602002602001015160c00151620004cf60201b60201c565b80620003a58162001015565b915050620002da565b5050565b620003bc6200041b565b6001600160a01b0382166000818152600b6020908152604091829020805460ff191685151590811790915591519182527fb840a1dbd8b09a3dc45161bba92dfb9aba643c0e44c085a447f839d1d02cf13b910160405180910390a25050565b6006546001600160a01b03163314620004775760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000216565b565b6200048d600654600160a01b900460ff1690565b15620004775760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640162000216565b6006546001600160a01b0316331480620004fd5750336000908152600b602052604090205460ff1615156001145b6200054f5760405162461bcd60e51b815260206004820152602c6024820152600080516020620050b783398151915260448201526b3a32b21030b2323932b9b99760a11b606482015260840162000216565b6200055962000479565b600e80549060006200056b8362001015565b9091555050600e54620005839086868686866200058a565b5050505050565b6006546001600160a01b0316331480620005b85750336000908152600b602052604090205460ff1615156001145b6200060a5760405162461bcd60e51b815260206004820152602c6024820152600080516020620050b783398151915260448201526b3a32b21030b2323932b9b99760a11b606482015260840162000216565b6200061462000479565b6200061e62000a33565b600e548611156200068b5760405162461bcd60e51b815260206004820152603060248201527f6e65772070726f6475637473206d75737420757365206372656174654e65775060448201526f3937b23ab1ba10333ab731ba34b7b71760811b606482015260840162000216565b6000835111620007045760405162461bcd60e51b815260206004820152603e60248201527f70726f64756374436f6c6c656374696f6e5572692069732061206e656365737360448201527f61727920636f6e646974696f6e20666f7220616e792070726f647563742e0000606482015260840162000216565b8015620007e2576040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa15801562000757573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200077d91906200103d565b620007dc5760405162461bcd60e51b815260206004820152602860248201527f4d757374207573652045524331313535206164647265737320776974682061206044820152673a37b5b2b724a21760c11b606482015260840162000216565b620008c5565b6001600160a01b03821615620008c5576040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156200083e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200086491906200103d565b620008c55760405162461bcd60e51b815260206004820152602a60248201527f4d7573742075736520455243373231206164647265737320776974686f75742060448201526930903a37b5b2b724a21760b11b606482015260840162000216565b6040518060e001604052808681526020016011600089815260200190815260200160002060010154815260200185815260200160116000898152602001908152602001600020600301548152602001848152602001836001600160a01b0316815260200182815250601160008881526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040190816200097f919062000f33565b5060a0828101516005830180546001600160a01b0319166001600160a01b0392831617905560c093840151600690930192909255600089815260116020908152604091829020600181015460039091015483518c8152928301919091528183018a9052606082015292861660808401529082018490525188927fa53c0adbaf8a2485c730b832ac266634bab632b2ede02a05c01cda6367e44399928290030190a262000a2b6001600755565b505050505050565b60026007540362000a875760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000216565b6002600755565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b038111828210171562000ac95762000ac962000a8e565b60405290565b604051601f8201601f191681016001600160401b038111828210171562000afa5762000afa62000a8e565b604052919050565b600082601f83011262000b1457600080fd5b81516001600160401b0381111562000b305762000b3062000a8e565b602062000b46601f8301601f1916820162000acf565b828152858284870101111562000b5b57600080fd5b60005b8381101562000b7b57858101830151828201840152820162000b5e565b506000928101909101919091529392505050565b6001600160a01b038116811462000ba557600080fd5b50565b805162000bb58162000b8f565b919050565b60006001600160401b0382111562000bd65762000bd662000a8e565b5060051b60200190565b600082601f83011262000bf257600080fd5b8151602062000c0b62000c058362000bba565b62000acf565b82815260059290921b8401810191818101908684111562000c2b57600080fd5b8286015b8481101562000cf25780516001600160401b038082111562000c515760008081fd5b9088019060e0828b03601f190181131562000c6c5760008081fd5b62000c7662000aa4565b87840151815260408085015189830152606080860151828401526080915081860151818401525060a0808601518581111562000cb25760008081fd5b62000cc28f8c838a010162000b02565b838501525060c0945062000cd885870162000ba8565b908301525092015190820152835291830191830162000c2f565b509695505050505050565b600082601f83011262000d0f57600080fd5b8151602062000d2262000c058362000bba565b82815260059290921b8401810191818101908684111562000d4257600080fd5b8286015b8481101562000cf257805162000d5c8162000b8f565b835291830191830162000d46565b805160ff8116811462000bb557600080fd5b60008060008060008060008060006101208a8c03121562000d9c57600080fd5b89516001600160401b038082111562000db457600080fd5b62000dc28d838e0162000b02565b9a5060208c015191508082111562000dd957600080fd5b62000de78d838e0162000b02565b995060408c015191508082111562000dfe57600080fd5b62000e0c8d838e0162000b02565b985062000e1c60608d0162000ba8565b975062000e2c60808d0162000ba8565b965060a08c015191508082111562000e4357600080fd5b62000e518d838e0162000be0565b955060c08c015191508082111562000e6857600080fd5b5062000e778c828d0162000cfd565b93505062000e8860e08b0162000ba8565b915062000e996101008b0162000d6a565b90509295985092959850929598565b600181811c9082168062000ebd57607f821691505b60208210810362000ede57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000f2e57600081815260208120601f850160051c8101602086101562000f0d5750805b601f850160051c820191505b8181101562000a2b5782815560010162000f19565b505050565b81516001600160401b0381111562000f4f5762000f4f62000a8e565b62000f678162000f60845462000ea8565b8462000ee4565b602080601f83116001811462000f9f576000841562000f865750858301515b600019600386901b1c1916600185901b17855562000a2b565b600085815260208120601f198616915b8281101562000fd05788860151825594840194600190910190840162000faf565b508582101562000fef5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b6000600182016200103657634e487b7160e01b600052601160045260246000fd5b5060010190565b6000602082840312156200105057600080fd5b815180151581146200106157600080fd5b9392505050565b61403f80620010786000396000f3fe60806040526004361061027d5760003560e01c8063715018a61161014f578063b88d4fde116100c1578063c87b56dd1161007a578063c87b56dd14610792578063da541e09146107b2578063e4623c1b146107d2578063e4d57be5146107f2578063e985e9c514610813578063f2fde38b1461083357600080fd5b8063b88d4fde146106c0578063bed20a87146106e0578063c166d13d146106f5578063c1c8526414610725578063c6e64e5314610752578063c7c4dd771461076557600080fd5b806384c5e8241161011357806384c5e824146106225780638da5cb5b1461063757806395d89b411461065557806398bdf6f51461066a578063a22cb46514610680578063a74a28d6146106a057600080fd5b8063715018a61461057a578063767c0f011461058f578063780bd3f1146105af5780637b337a36146105e25780637fb5bb771461060257600080fd5b80633570aa26116101f357806355f804b3116101ac57806355f804b3146104a85780635c975abb146104c857806360ebfee6146104e75780636352211e1461051a578063701812a71461053a57806370a082311461055a57600080fd5b80633570aa26146103f55780633d099196146104155780634228ff481461042857806342842e0e1461044857806342966c68146104685780634690a1f51461048857600080fd5b806318160ddd1161024557806318160ddd146103575780631a497d2b1461036c578063217c498d1461038c57806323b872dd146103ac578063278ecde1146103cc578063342ae8c6146103df57600080fd5b806301ffc9a71461028257806306fdde03146102b7578063081812fc146102d9578063095ea7b314610311578063129c02dd14610333575b600080fd5b34801561028e57600080fd5b506102a261029d3660046131ad565b610853565b60405190151581526020015b60405180910390f35b3480156102c357600080fd5b506102cc6108a5565b6040516102ae919061321a565b3480156102e557600080fd5b506102f96102f436600461322d565b610937565b6040516001600160a01b0390911681526020016102ae565b34801561031d57600080fd5b5061033161032c36600461326b565b61095e565b005b34801561033f57600080fd5b50610349600c5481565b6040519081526020016102ae565b34801561036357600080fd5b50600f54610349565b34801561037857600080fd5b5061033161038736600461337c565b610a78565b34801561039857600080fd5b506103316103a73660046133e6565b610af5565b3480156103b857600080fd5b506103316103c736600461341f565b610b91565b6103316103da36600461322d565b610bc2565b3480156103eb57600080fd5b50610349600e5481565b34801561040157600080fd5b50600a546102f9906001600160a01b031681565b610331610423366004613460565b610d2c565b34801561043457600080fd5b5061033161044336600461322d565b610daa565b34801561045457600080fd5b5061033161046336600461341f565b610db7565b34801561047457600080fd5b5061033161048336600461322d565b610dd2565b34801561049457600080fd5b506103316104a33660046134e5565b610e96565b3480156104b457600080fd5b506103316104c3366004613618565b610fa7565b3480156104d457600080fd5b50600654600160a01b900460ff166102a2565b3480156104f357600080fd5b5060085461050890600160a81b900460ff1681565b60405160ff90911681526020016102ae565b34801561052657600080fd5b506102f961053536600461322d565b610fbb565b34801561054657600080fd5b5061033161055536600461364c565b61101b565b34801561056657600080fd5b5061034961057536600461366f565b6110c0565b34801561058657600080fd5b50610331611146565b34801561059b57600080fd5b506103316105aa36600461368c565b61115a565b3480156105bb57600080fd5b506105cf6105ca36600461322d565b6115ac565b6040516102ae9796959493929190613702565b3480156105ee57600080fd5b506103316105fd36600461375a565b61167b565b34801561060e57600080fd5b5061034961061d366004613788565b6116e2565b34801561062e57600080fd5b506102cc611818565b34801561064357600080fd5b506006546001600160a01b03166102f9565b34801561066157600080fd5b506102cc6118a6565b34801561067657600080fd5b50610349600f5481565b34801561068c57600080fd5b5061033161069b36600461375a565b6118b5565b3480156106ac57600080fd5b506009546102f9906001600160a01b031681565b3480156106cc57600080fd5b506103316106db3660046137aa565b6118c0565b3480156106ec57600080fd5b506103316118f8565b34801561070157600080fd5b506102a261071036600461366f565b600b6020526000908152604090205460ff1681565b34801561073157600080fd5b5061034961074036600461322d565b60106020526000908152604090205481565b610331610760366004613829565b611982565b34801561077157600080fd5b5061078561078036600461322d565b6119f8565b6040516102ae9190613878565b34801561079e57600080fd5b506102cc6107ad36600461322d565b611b68565b3480156107be57600080fd5b506103316107cd3660046138e8565b611ce7565b3480156107de57600080fd5b506103316107ed366004613905565b611d05565b3480156107fe57600080fd5b5060085461050890600160a01b900460ff1681565b34801561081f57600080fd5b506102a261082e3660046133e6565b611d96565b34801561083f57600080fd5b5061033161084e36600461366f565b611df4565b60006001600160e01b031982166380ac58cd60e01b148061088457506001600160e01b03198216635b5e139f60e01b145b8061089f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546108b490613995565b80601f01602080910402602001604051908101604052809291908181526020018280546108e090613995565b801561092d5780601f106109025761010080835404028352916020019161092d565b820191906000526020600020905b81548152906001019060200180831161091057829003601f168201915b5050505050905090565b600061094282611e6a565b506000908152600460205260409020546001600160a01b031690565b600061096982610fbb565b9050806001600160a01b0316836001600160a01b0316036109db5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806109f757506109f78133611d96565b610a695760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016109d2565b610a738383611ec9565b505050565b6006546001600160a01b0316331480610aa55750336000908152600b602052604090205460ff1615156001145b610ac15760405162461bcd60e51b81526004016109d2906139cf565b610ac9611f37565b600e8054906000610ad983613a31565b9190505550610aee600e54868686868661115a565b5050505050565b610afd611f84565b6001600160a01b038216610b635760405162461bcd60e51b815260206004820152602760248201527f446973706174636820616464726573732063616e6e6f74206265206e756c6c206044820152666164647265737360c81b60648201526084016109d2565b600980546001600160a01b039384166001600160a01b031991821617909155600a8054929093169116179055565b610b9b3382611fde565b610bb75760405162461bcd60e51b81526004016109d290613a4a565b610a7383838361203d565b6006546001600160a01b0316331480610bef5750336000908152600b602052604090205460ff1615156001145b610c0b5760405162461bcd60e51b81526004016109d2906139cf565b610c13611f37565b610c1b6121ae565b6000818152600260205260409020546001600160a01b0316610c3c82610dd2565b600082815260106020908152604080832054835260119091529020600190810154610c6691612207565b600083815260106020908152604080832054835260119091528082206001019290925590516001600160a01b0383169034908381818185875af1925050503d8060008114610cd0576040519150601f19603f3d011682016040523d82523d6000602084013e610cd5565b606091505b5050905080610d1d5760405162461bcd60e51b81526020600482015260146024820152734661696c656420746f2073656e642066756e647360601b60448201526064016109d2565b5050610d296001600755565b50565b838360018210158015610d60575060008181526011602052604090206002810154600190910154610d5d9084612213565b11155b610d7c5760405162461bcd60e51b81526004016109d290613a97565b610d846121ae565b610d8c611f37565b610d988686858761221f565b610da26001600755565b505050505050565b610db2611f84565b600c55565b610a73838383604051806020016040528060008152506118c0565b6006546001600160a01b0316331480610dff5750336000908152600b602052604090205460ff1615156001145b610e1b5760405162461bcd60e51b81526004016109d2906139cf565b610e23611f37565b610e2c81611e6a565b600081815260106020526040902054610e4490612583565b60008181526010602090815260408083205483526011909152902060030154610e6e906001612213565b60008281526010602090815260408083205483526011909152902060030155610d29816125ee565b6006546001600160a01b0316331480610ec35750336000908152600b602052604090205460ff1615156001145b610edf5760405162461bcd60e51b81526004016109d2906139cf565b610ee7611f37565b60005b8151811015610fa357610f91828281518110610f0857610f08613ada565b602002602001015160000151838381518110610f2657610f26613ada565b602002602001015160400151848481518110610f4457610f44613ada565b602002602001015160800151858581518110610f6257610f62613ada565b602002602001015160a00151868681518110610f8057610f80613ada565b602002602001015160c00151610a78565b80610f9b81613a31565b915050610eea565b5050565b610faf611f84565b600d610fa38282613b36565b6000818152600260205260408120546001600160a01b03168061089f5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016109d2565b611023611f84565b60648160ff16106110765760405162461bcd60e51b815260206004820152601960248201527f63616e6e6f74207365742061206665652061626f76652039390000000000000060448201526064016109d2565b6008805460ff60a01b1916600160a01b60ff8416908102919091179091556040517f3b45ac5335d21c47c35e4f865ab1795264f1536f4469084781a739b9a5e5d2b090600090a250565b60006001600160a01b03821661112a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016109d2565b506001600160a01b031660009081526003602052604090205490565b61114e611f84565b6111586000612691565b565b6006546001600160a01b03163314806111875750336000908152600b602052604090205460ff1615156001145b6111a35760405162461bcd60e51b81526004016109d2906139cf565b6111ab611f37565b6111b36121ae565b600e5486111561121e5760405162461bcd60e51b815260206004820152603060248201527f6e65772070726f6475637473206d75737420757365206372656174654e65775060448201526f3937b23ab1ba10333ab731ba34b7b71760811b60648201526084016109d2565b60008351116112955760405162461bcd60e51b815260206004820152603e60248201527f70726f64756374436f6c6c656374696f6e5572692069732061206e656365737360448201527f61727920636f6e646974696f6e20666f7220616e792070726f647563742e000060648201526084016109d2565b801561136c576040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156112e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130a9190613bf5565b6113675760405162461bcd60e51b815260206004820152602860248201527f4d757374207573652045524331313535206164647265737320776974682061206044820152673a37b5b2b724a21760c11b60648201526084016109d2565b611449565b6001600160a01b03821615611449576040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156113c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ea9190613bf5565b6114495760405162461bcd60e51b815260206004820152602a60248201527f4d7573742075736520455243373231206164647265737320776974686f75742060448201526930903a37b5b2b724a21760b11b60648201526084016109d2565b6040518060e001604052808681526020016011600089815260200190815260200160002060010154815260200185815260200160116000898152602001908152602001600020600301548152602001848152602001836001600160a01b0316815260200182815250601160008881526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040190816115019190613b36565b5060a0828101516005830180546001600160a01b0319166001600160a01b0392831617905560c093840151600690930192909255600089815260116020908152604091829020600181015460039091015483518c8152928301919091528183018a9052606082015292861660808401529082018490525188927fa53c0adbaf8a2485c730b832ac266634bab632b2ede02a05c01cda6367e44399928290030190a2610da26001600755565b6011602052600090815260409020805460018201546002830154600384015460048501805494959394929391926115e290613995565b80601f016020809104026020016040519081016040528092919081815260200182805461160e90613995565b801561165b5780601f106116305761010080835404028352916020019161165b565b820191906000526020600020905b81548152906001019060200180831161163e57829003601f168201915b50505050600583015460069093015491926001600160a01b031691905087565b611683611f84565b6001600160a01b0382166000818152600b6020908152604091829020805460ff191685151590811790915591519182527fb840a1dbd8b09a3dc45161bba92dfb9aba643c0e44c085a447f839d1d02cf13b910160405180910390a25050565b60006116ed82612583565b60085460408051633fabe5a360e21b815290516000926001600160a01b03169163feaf968c9160048083019260a09291908290030181865afa158015611737573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175b9190613c2c565b50505091505060008112156117b25760405162461bcd60e51b815260206004820152601860248201527f70726963652063616e6e6f74206265206e65676174697665000000000000000060448201526064016109d2565b600854600084815260116020526040812054839261180291600160a81b90910460ff16906117f6906305f5e100906117fc9087908490670de0b6b3a76400006126e3565b906126ef565b906126e3565b905061180e81876126e3565b9695505050505050565b600d805461182590613995565b80601f016020809104026020016040519081016040528092919081815260200182805461185190613995565b801561189e5780601f106118735761010080835404028352916020019161189e565b820191906000526020600020905b81548152906001019060200180831161188157829003601f168201915b505050505081565b6060600180546108b490613995565b610fa33383836126fb565b6118ca3383611fde565b6118e65760405162461bcd60e51b81526004016109d290613a4a565b6118f2848484846127c9565b50505050565b6006546001600160a01b03163314806119255750336000908152600b602052604090205460ff1615156001145b6119415760405162461bcd60e51b81526004016109d2906139cf565b600f54604080516000815260208101929092527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c91015b60405180910390a1565b8282600182101580156119b65750600081815260116020526040902060028101546001909101546119b39084612213565b11155b6119d25760405162461bcd60e51b81526004016109d290613a97565b6119da6121ae565b6119e2611f37565b6119ee8585338661221f565b610aee6001600755565b611a416040518060e00160405280600081526020016000815260200160008152602001600081526020016060815260200160006001600160a01b03168152602001600081525090565b600082815260106020526040902054611a5990612583565b60116000601060008581526020019081526020016000205481526020019081526020016000206040518060e001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482018054611ac290613995565b80601f0160208091040260200160405190810160405280929190818152602001828054611aee90613995565b8015611b3b5780601f10611b1057610100808354040283529160200191611b3b565b820191906000526020600020905b815481529060010190602001808311611b1e57829003601f168201915b505050918352505060058201546001600160a01b0316602082015260069091015460409091015292915050565b6060611b7382611e6a565b600082815260106020526040902054611b8b90612583565b600082815260106020908152604080832054835260118252808320815160e0810183528154815260018201549381019390935260028101549183019190915260038101546060830152600481018054608084019190611be990613995565b80601f0160208091040260200160405190810160405280929190818152602001828054611c1590613995565b8015611c625780601f10611c3757610100808354040283529160200191611c62565b820191906000526020600020905b815481529060010190602001808311611c4557829003601f168201915b505050918352505060058201546001600160a01b031660208201526006909101546040909101529050600d611c96306127fc565b6080830151600086815260106020526040902054611cb390612812565b611cbc87612812565b604051602001611cd0959493929190613c98565b604051602081830303815290604052915050919050565b611cef611f84565b8015611cfd57610d296128a4565b610d296128ff565b6006546001600160a01b0316331480611d325750336000908152600b602052604090205460ff1615156001145b611d4e5760405162461bcd60e51b81526004016109d2906139cf565b611d56611f37565b60005b8151811015610fa357611d84828281518110611d7757611d77613ada565b6020026020010151610dd2565b80611d8e81613a31565b915050611d59565b6001600160a01b0381166000908152600b602052604081205460ff161515600103611dc35750600161089f565b6001600160a01b0380841660009081526005602090815260408083209386168352929052205460ff165b9392505050565b611dfc611f84565b6001600160a01b038116611e615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109d2565b610d2981612691565b6000818152600260205260409020546001600160a01b0316610d295760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016109d2565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611efe82610fbb565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600654600160a01b900460ff16156111585760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109d2565b6006546001600160a01b031633146111585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d2565b600080611fea83610fbb565b9050806001600160a01b0316846001600160a01b0316148061201157506120118185611d96565b806120355750836001600160a01b031661202a84610937565b6001600160a01b0316145b949350505050565b826001600160a01b031661205082610fbb565b6001600160a01b0316146120765760405162461bcd60e51b81526004016109d290613d70565b6001600160a01b0382166120d85760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109d2565b6120e5838383600161293b565b826001600160a01b03166120f882610fbb565b6001600160a01b03161461211e5760405162461bcd60e51b81526004016109d290613d70565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6002600754036122005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109d2565b6002600755565b6000611ded8284613db5565b6000611ded8284613dc8565b600061222b85856116e2565b9050803410156122745760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21030b6b7bab73a103830b4b21760611b60448201526064016109d2565b6000848152601160205260409020600501546001600160a01b03161561249557600084815260116020526040902060060154156123ac5760008481526011602052604080822060058101546006909101549151627eeac760e11b81526001600160a01b038781166004830152602482019390935291169062fdd58e90604401602060405180830381865afa158015612310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123349190613ddb565b116123a75760405162461bcd60e51b815260206004820152603760248201527f41646472657373206c61636b732074686520726571756972656420313135352060448201527f746f6b656e20676174652062616c616e6365203e20312e00000000000000000060648201526084016109d2565b612495565b6000848152601160205260408082206005015490516370a0823160e01b81526001600160a01b038681166004830152909116906370a0823190602401602060405180830381865afa158015612405573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124299190613ddb565b116124955760405162461bcd60e51b815260206004820152603660248201527f41646472657373206c61636b732074686520726571756972656420373231207460448201527537b5b2b71033b0ba32903130b630b731b2901f10189760511b60648201526084016109d2565b34156124a3576124a361294a565b6000848152601160205260409020600101546124bf9086612213565b6000858152601160205260408120600101919091555b85811015610da257600f80549060006124ed83613a31565b9091555050600f8054600090815260106020526040902086905554612513908590612b44565b600f54600086815260116020526040902086917f742d174ef4c6e426f5f84aa20c697c59735a206837ec50e907cf1c1c7c563e3b9187918a9161255688846126ef565b8960405161256996959493929190613df4565b60405180910390a28061257b81613a31565b9150506124d5565b6000818152601160205260408120600401805461259f90613995565b905011610d295760405162461bcd60e51b815260206004820152601c60248201527f546869732070726f6475637420646f6573206e6f742065786973742e0000000060448201526064016109d2565b60006125f982610fbb565b905061260981600084600161293b565b61261282610fbb565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611ded8284613f17565b6000611ded8284613f2e565b816001600160a01b0316836001600160a01b03160361275c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109d2565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6127d484848461203d565b6127e084848484612b5e565b6118f25760405162461bcd60e51b81526004016109d290613f50565b606061089f6001600160a01b0383166014612c5f565b6060600061281f83612dfa565b60010190506000816001600160401b0381111561283e5761283e613297565b6040519080825280601f01601f191660200182016040528015612868576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287257509392505050565b6128ac611f37565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586128e73390565b6040516001600160a01b039091168152602001611978565b612907612ed2565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336128e7565b6129458184612f22565b6118f2565b600a546001600160a01b03166129f4576009546040516000916001600160a01b03169034908381818185875af1925050503d80600081146129a7576040519150601f19603f3d011682016040523d82523d6000602084013e6129ac565b606091505b5050905080610d295760405162461bcd60e51b81526020600482015260146024820152734661696c656420746f2073656e642066756e647360601b60448201526064016109d2565b600854600090612a16906064906117f6903490600160a01b900460ff166126e3565b90506000612a243483612207565b6009546040519192506000916001600160a01b039091169084908381818185875af1925050503d8060008114612a76576040519150601f19603f3d011682016040523d82523d6000602084013e612a7b565b606091505b5050600a546040519192506000916001600160a01b039091169084908381818185875af1925050503d8060008114612acf576040519150601f19603f3d011682016040523d82523d6000602084013e612ad4565b606091505b50509050818015612ae25750805b6118f25760405162461bcd60e51b815260206004820152602d60248201527f4661696c656420746f2073656e642066756e647320746f20646973706174636860448201526c08185b99081b595c98da185b9d609a1b60648201526084016109d2565b610fa3828260405180602001604052806000815250612fcb565b60006001600160a01b0384163b15612c5457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612ba2903390899088908890600401613fa2565b6020604051808303816000875af1925050508015612bdd575060408051601f3d908101601f19168201909252612bda91810190613fd5565b60015b612c3a573d808015612c0b576040519150601f19603f3d011682016040523d82523d6000602084013e612c10565b606091505b508051600003612c325760405162461bcd60e51b81526004016109d290613f50565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612035565b506001949350505050565b60606000612c6e836002613f17565b612c79906002613dc8565b6001600160401b03811115612c9057612c90613297565b6040519080825280601f01601f191660200182016040528015612cba576020820181803683370190505b509050600360fc1b81600081518110612cd557612cd5613ada565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d0457612d04613ada565b60200101906001600160f81b031916908160001a9053506000612d28846002613f17565b612d33906001613dc8565b90505b6001811115612dab576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612d6757612d67613ada565b1a60f81b828281518110612d7d57612d7d613ada565b60200101906001600160f81b031916908160001a90535060049490941c93612da481613ff2565b9050612d36565b508315611ded5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109d2565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612e395772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612e65576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612e8357662386f26fc10000830492506010015b6305f5e1008310612e9b576305f5e100830492506008015b6127108310612eaf57612710830492506004015b60648310612ec1576064830492506002015b600a831061089f5760010192915050565b600654600160a01b900460ff166111585760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109d2565b6000600c54118015612f3c57506001600160a01b03811615155b15610fa357600c54612f5783612f51846110c0565b90612213565b1115610fa35760405162461bcd60e51b815260206004820152603f60248201527f43616e6e6f742065786365656420746865206d617853746f726542616c616e6360448201527f65416c6c6f77616e636520666f72206120676976656e20616464726573732e0060648201526084016109d2565b612fd58383612ffe565b612fe26000848484612b5e565b610a735760405162461bcd60e51b81526004016109d290613f50565b6001600160a01b0382166130545760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109d2565b6000818152600260205260409020546001600160a01b0316156130b95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109d2565b6130c760008383600161293b565b6000818152600260205260409020546001600160a01b03161561312c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109d2565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b031981168114610d2957600080fd5b6000602082840312156131bf57600080fd5b8135611ded81613197565b60005b838110156131e55781810151838201526020016131cd565b50506000910152565b600081518084526132068160208601602086016131ca565b601f01601f19169290920160200192915050565b602081526000611ded60208301846131ee565b60006020828403121561323f57600080fd5b5035919050565b6001600160a01b0381168114610d2957600080fd5b803561326681613246565b919050565b6000806040838503121561327e57600080fd5b823561328981613246565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156132cf576132cf613297565b60405290565b604051601f8201601f191681016001600160401b03811182821017156132fd576132fd613297565b604052919050565b60006001600160401b0383111561331e5761331e613297565b613331601f8401601f19166020016132d5565b905082815283838301111561334557600080fd5b828260208301376000602084830101529392505050565b600082601f83011261336d57600080fd5b611ded83833560208501613305565b600080600080600060a0868803121561339457600080fd5b853594506020860135935060408601356001600160401b038111156133b857600080fd5b6133c48882890161335c565b93505060608601356133d581613246565b949793965091946080013592915050565b600080604083850312156133f957600080fd5b823561340481613246565b9150602083013561341481613246565b809150509250929050565b60008060006060848603121561343457600080fd5b833561343f81613246565b9250602084013561344f81613246565b929592945050506040919091013590565b6000806000806080858703121561347657600080fd5b843593506020850135925060408501356001600160401b0381111561349a57600080fd5b6134a68782880161335c565b92505060608501356134b781613246565b939692955090935050565b60006001600160401b038211156134db576134db613297565b5060051b60200190565b600060208083850312156134f857600080fd5b82356001600160401b038082111561350f57600080fd5b818501915085601f83011261352357600080fd5b8135613536613531826134c2565b6132d5565b81815260059190911b8301840190848101908883111561355557600080fd5b8585015b8381101561360b5780358581111561357057600080fd5b860160e0818c03601f190112156135875760008081fd5b61358f6132ad565b8882013581526040808301358a830152606080840135828401526080915081840135818401525060a080840135898111156135ca5760008081fd5b6135d88f8d8388010161335c565b838501525060c091506135ec82850161325b565b9083015260e09290920135918101919091528352918601918601613559565b5098975050505050505050565b60006020828403121561362a57600080fd5b81356001600160401b0381111561364057600080fd5b6120358482850161335c565b60006020828403121561365e57600080fd5b813560ff81168114611ded57600080fd5b60006020828403121561368157600080fd5b8135611ded81613246565b60008060008060008060c087890312156136a557600080fd5b86359550602087013594506040870135935060608701356001600160401b038111156136d057600080fd5b6136dc89828a0161335c565b93505060808701356136ed81613246565b8092505060a087013590509295509295509295565b87815286602082015285604082015284606082015260e06080820152600061372d60e08301866131ee565b6001600160a01b039490941660a08301525060c0015295945050505050565b8015158114610d2957600080fd5b6000806040838503121561376d57600080fd5b823561377881613246565b915060208301356134148161374c565b6000806040838503121561379b57600080fd5b50508035926020909101359150565b600080600080608085870312156137c057600080fd5b84356137cb81613246565b935060208501356137db81613246565b92506040850135915060608501356001600160401b038111156137fd57600080fd5b8501601f8101871361380e57600080fd5b61381d87823560208401613305565b91505092959194509250565b60008060006060848603121561383e57600080fd5b833592506020840135915060408401356001600160401b0381111561386257600080fd5b61386e8682870161335c565b9150509250925092565b60208152815160208201526020820151604082015260408201516060820152606082015160808201526000608083015160e060a08401526138bd6101008401826131ee565b60a08501516001600160a01b031660c0858101919091529094015160e0909301929092525090919050565b6000602082840312156138fa57600080fd5b8135611ded8161374c565b6000602080838503121561391857600080fd5b82356001600160401b0381111561392e57600080fd5b8301601f8101851361393f57600080fd5b803561394d613531826134c2565b81815260059190911b8201830190838101908783111561396c57600080fd5b928401925b8284101561398a57833582529284019290840190613971565b979650505050505050565b600181811c908216806139a957607f821691505b6020821081036139c957634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602c908201527f4d75737420626520746865206f776e6572206f722062652077686974656c697360408201526b3a32b21030b2323932b9b99760a11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600060018201613a4357613a43613a1b565b5060010190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526023908201527f43616e6e6f74206578636565642070726f6475637420746f74616c2073757070604082015262363c9760e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b601f821115610a7357600081815260208120601f850160051c81016020861015613b175750805b601f850160051c820191505b81811015610da257828155600101613b23565b81516001600160401b03811115613b4f57613b4f613297565b613b6381613b5d8454613995565b84613af0565b602080601f831160018114613b985760008415613b805750858301515b600019600386901b1c1916600185901b178555610da2565b600085815260208120601f198616915b82811015613bc757888601518255948401946001909101908401613ba8565b5085821015613be55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215613c0757600080fd5b8151611ded8161374c565b805169ffffffffffffffffffff8116811461326657600080fd5b600080600080600060a08688031215613c4457600080fd5b613c4d86613c12565b9450602086015193506040860151925060608601519150613c7060808701613c12565b90509295509295909350565b60008151613c8e8185602086016131ca565b9290920192915050565b6000808754613ca681613995565b60018281168015613cbe5760018114613cd357613d02565b60ff1984168752821515830287019450613d02565b8b60005260208060002060005b85811015613cf95781548a820152908401908201613ce0565b50505082870194505b50602f60f81b845289519250613d1e8382860160208d016131ca565b613d61613d5b613d48613d55613d48613d4286898b0101602f60f81b815260010190565b8e613c7c565b602f60f81b815260010190565b8b613c7c565b88613c7c565b9b9a5050505050505050505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b8181038181111561089f5761089f613a1b565b8082018082111561089f5761089f613a1b565b600060208284031215613ded57600080fd5b5051919050565b60018060a01b038716815260006020878184015286604084015260c06060840152855460c084015260018087015460e0850152600287015461010085015260038701546101208501526004870160e061014086015260008154613e5681613995565b806101a08901526101c085831660008114613e785760018114613e9257613ec0565b60ff1984168a83015282151560051b8a0182019450613ec0565b856000528760002060005b84811015613eb85781548c8201850152908801908901613e9d565b8b0183019550505b5050505060058901546001600160a01b03166001600160a01b0381166101608801529350600689015461018087015287608087015285810360a0870152613f0781886131ee565b9c9b505050505050505050505050565b808202811582820484141761089f5761089f613a1b565b600082613f4b57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061180e908301846131ee565b600060208284031215613fe757600080fd5b8151611ded81613197565b60008161400157614001613a1b565b50600019019056fea2646970667358221220343957976f080b973c388b1f000cd214d180fcfc893e25f784787de20bbe0c2964736f6c634300081100334d75737420626520746865206f776e6572206f722062652077686974656c69730000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000174d0a47fc6e7e2bb6bb7aad7d05c5380c5c5b20000000000000000000000000d8fbc75dfc8562e4807cb5e08ac1abdbe723be9e000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000025426f797320436c75622053746f72652028706f7765726564206279204469737061746368290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008424f5953434c5542000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004468747470733a2f2f64697370617463682d656e676167656d656e742d6170692d73746167696e672e64697370617463682e636f2f70726f647563742f657468657265756d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000652c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000176d61696e2d6368617261637465722d6e65636b6c6163650000000000000000000000000000000000000000000000000000000000000000000000000000000007000000000000000000000000d6fa132a7bb86a732cb0292ee269e67b2e59b116000000000000000000000000fea1761dc4179d39285350d5c55baa4c28dad6f20000000000000000000000000d908b104339370be7e5e20a572533752f01c17f000000000000000000000000b89597cbd7d9c97c12dd2f59cedb57427f3c10e50000000000000000000000006bcb562df0b0d94e3460b7c4700c605006b90711000000000000000000000000bde0cb3f7d30a3e1b5071ca6df7bace994a9aa020000000000000000000000001c0bdf2380013fe93894128424c2b9cdd2466a24

Deployed Bytecode

0x60806040526004361061027d5760003560e01c8063715018a61161014f578063b88d4fde116100c1578063c87b56dd1161007a578063c87b56dd14610792578063da541e09146107b2578063e4623c1b146107d2578063e4d57be5146107f2578063e985e9c514610813578063f2fde38b1461083357600080fd5b8063b88d4fde146106c0578063bed20a87146106e0578063c166d13d146106f5578063c1c8526414610725578063c6e64e5314610752578063c7c4dd771461076557600080fd5b806384c5e8241161011357806384c5e824146106225780638da5cb5b1461063757806395d89b411461065557806398bdf6f51461066a578063a22cb46514610680578063a74a28d6146106a057600080fd5b8063715018a61461057a578063767c0f011461058f578063780bd3f1146105af5780637b337a36146105e25780637fb5bb771461060257600080fd5b80633570aa26116101f357806355f804b3116101ac57806355f804b3146104a85780635c975abb146104c857806360ebfee6146104e75780636352211e1461051a578063701812a71461053a57806370a082311461055a57600080fd5b80633570aa26146103f55780633d099196146104155780634228ff481461042857806342842e0e1461044857806342966c68146104685780634690a1f51461048857600080fd5b806318160ddd1161024557806318160ddd146103575780631a497d2b1461036c578063217c498d1461038c57806323b872dd146103ac578063278ecde1146103cc578063342ae8c6146103df57600080fd5b806301ffc9a71461028257806306fdde03146102b7578063081812fc146102d9578063095ea7b314610311578063129c02dd14610333575b600080fd5b34801561028e57600080fd5b506102a261029d3660046131ad565b610853565b60405190151581526020015b60405180910390f35b3480156102c357600080fd5b506102cc6108a5565b6040516102ae919061321a565b3480156102e557600080fd5b506102f96102f436600461322d565b610937565b6040516001600160a01b0390911681526020016102ae565b34801561031d57600080fd5b5061033161032c36600461326b565b61095e565b005b34801561033f57600080fd5b50610349600c5481565b6040519081526020016102ae565b34801561036357600080fd5b50600f54610349565b34801561037857600080fd5b5061033161038736600461337c565b610a78565b34801561039857600080fd5b506103316103a73660046133e6565b610af5565b3480156103b857600080fd5b506103316103c736600461341f565b610b91565b6103316103da36600461322d565b610bc2565b3480156103eb57600080fd5b50610349600e5481565b34801561040157600080fd5b50600a546102f9906001600160a01b031681565b610331610423366004613460565b610d2c565b34801561043457600080fd5b5061033161044336600461322d565b610daa565b34801561045457600080fd5b5061033161046336600461341f565b610db7565b34801561047457600080fd5b5061033161048336600461322d565b610dd2565b34801561049457600080fd5b506103316104a33660046134e5565b610e96565b3480156104b457600080fd5b506103316104c3366004613618565b610fa7565b3480156104d457600080fd5b50600654600160a01b900460ff166102a2565b3480156104f357600080fd5b5060085461050890600160a81b900460ff1681565b60405160ff90911681526020016102ae565b34801561052657600080fd5b506102f961053536600461322d565b610fbb565b34801561054657600080fd5b5061033161055536600461364c565b61101b565b34801561056657600080fd5b5061034961057536600461366f565b6110c0565b34801561058657600080fd5b50610331611146565b34801561059b57600080fd5b506103316105aa36600461368c565b61115a565b3480156105bb57600080fd5b506105cf6105ca36600461322d565b6115ac565b6040516102ae9796959493929190613702565b3480156105ee57600080fd5b506103316105fd36600461375a565b61167b565b34801561060e57600080fd5b5061034961061d366004613788565b6116e2565b34801561062e57600080fd5b506102cc611818565b34801561064357600080fd5b506006546001600160a01b03166102f9565b34801561066157600080fd5b506102cc6118a6565b34801561067657600080fd5b50610349600f5481565b34801561068c57600080fd5b5061033161069b36600461375a565b6118b5565b3480156106ac57600080fd5b506009546102f9906001600160a01b031681565b3480156106cc57600080fd5b506103316106db3660046137aa565b6118c0565b3480156106ec57600080fd5b506103316118f8565b34801561070157600080fd5b506102a261071036600461366f565b600b6020526000908152604090205460ff1681565b34801561073157600080fd5b5061034961074036600461322d565b60106020526000908152604090205481565b610331610760366004613829565b611982565b34801561077157600080fd5b5061078561078036600461322d565b6119f8565b6040516102ae9190613878565b34801561079e57600080fd5b506102cc6107ad36600461322d565b611b68565b3480156107be57600080fd5b506103316107cd3660046138e8565b611ce7565b3480156107de57600080fd5b506103316107ed366004613905565b611d05565b3480156107fe57600080fd5b5060085461050890600160a01b900460ff1681565b34801561081f57600080fd5b506102a261082e3660046133e6565b611d96565b34801561083f57600080fd5b5061033161084e36600461366f565b611df4565b60006001600160e01b031982166380ac58cd60e01b148061088457506001600160e01b03198216635b5e139f60e01b145b8061089f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546108b490613995565b80601f01602080910402602001604051908101604052809291908181526020018280546108e090613995565b801561092d5780601f106109025761010080835404028352916020019161092d565b820191906000526020600020905b81548152906001019060200180831161091057829003601f168201915b5050505050905090565b600061094282611e6a565b506000908152600460205260409020546001600160a01b031690565b600061096982610fbb565b9050806001600160a01b0316836001600160a01b0316036109db5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806109f757506109f78133611d96565b610a695760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016109d2565b610a738383611ec9565b505050565b6006546001600160a01b0316331480610aa55750336000908152600b602052604090205460ff1615156001145b610ac15760405162461bcd60e51b81526004016109d2906139cf565b610ac9611f37565b600e8054906000610ad983613a31565b9190505550610aee600e54868686868661115a565b5050505050565b610afd611f84565b6001600160a01b038216610b635760405162461bcd60e51b815260206004820152602760248201527f446973706174636820616464726573732063616e6e6f74206265206e756c6c206044820152666164647265737360c81b60648201526084016109d2565b600980546001600160a01b039384166001600160a01b031991821617909155600a8054929093169116179055565b610b9b3382611fde565b610bb75760405162461bcd60e51b81526004016109d290613a4a565b610a7383838361203d565b6006546001600160a01b0316331480610bef5750336000908152600b602052604090205460ff1615156001145b610c0b5760405162461bcd60e51b81526004016109d2906139cf565b610c13611f37565b610c1b6121ae565b6000818152600260205260409020546001600160a01b0316610c3c82610dd2565b600082815260106020908152604080832054835260119091529020600190810154610c6691612207565b600083815260106020908152604080832054835260119091528082206001019290925590516001600160a01b0383169034908381818185875af1925050503d8060008114610cd0576040519150601f19603f3d011682016040523d82523d6000602084013e610cd5565b606091505b5050905080610d1d5760405162461bcd60e51b81526020600482015260146024820152734661696c656420746f2073656e642066756e647360601b60448201526064016109d2565b5050610d296001600755565b50565b838360018210158015610d60575060008181526011602052604090206002810154600190910154610d5d9084612213565b11155b610d7c5760405162461bcd60e51b81526004016109d290613a97565b610d846121ae565b610d8c611f37565b610d988686858761221f565b610da26001600755565b505050505050565b610db2611f84565b600c55565b610a73838383604051806020016040528060008152506118c0565b6006546001600160a01b0316331480610dff5750336000908152600b602052604090205460ff1615156001145b610e1b5760405162461bcd60e51b81526004016109d2906139cf565b610e23611f37565b610e2c81611e6a565b600081815260106020526040902054610e4490612583565b60008181526010602090815260408083205483526011909152902060030154610e6e906001612213565b60008281526010602090815260408083205483526011909152902060030155610d29816125ee565b6006546001600160a01b0316331480610ec35750336000908152600b602052604090205460ff1615156001145b610edf5760405162461bcd60e51b81526004016109d2906139cf565b610ee7611f37565b60005b8151811015610fa357610f91828281518110610f0857610f08613ada565b602002602001015160000151838381518110610f2657610f26613ada565b602002602001015160400151848481518110610f4457610f44613ada565b602002602001015160800151858581518110610f6257610f62613ada565b602002602001015160a00151868681518110610f8057610f80613ada565b602002602001015160c00151610a78565b80610f9b81613a31565b915050610eea565b5050565b610faf611f84565b600d610fa38282613b36565b6000818152600260205260408120546001600160a01b03168061089f5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016109d2565b611023611f84565b60648160ff16106110765760405162461bcd60e51b815260206004820152601960248201527f63616e6e6f74207365742061206665652061626f76652039390000000000000060448201526064016109d2565b6008805460ff60a01b1916600160a01b60ff8416908102919091179091556040517f3b45ac5335d21c47c35e4f865ab1795264f1536f4469084781a739b9a5e5d2b090600090a250565b60006001600160a01b03821661112a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016109d2565b506001600160a01b031660009081526003602052604090205490565b61114e611f84565b6111586000612691565b565b6006546001600160a01b03163314806111875750336000908152600b602052604090205460ff1615156001145b6111a35760405162461bcd60e51b81526004016109d2906139cf565b6111ab611f37565b6111b36121ae565b600e5486111561121e5760405162461bcd60e51b815260206004820152603060248201527f6e65772070726f6475637473206d75737420757365206372656174654e65775060448201526f3937b23ab1ba10333ab731ba34b7b71760811b60648201526084016109d2565b60008351116112955760405162461bcd60e51b815260206004820152603e60248201527f70726f64756374436f6c6c656374696f6e5572692069732061206e656365737360448201527f61727920636f6e646974696f6e20666f7220616e792070726f647563742e000060648201526084016109d2565b801561136c576040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156112e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130a9190613bf5565b6113675760405162461bcd60e51b815260206004820152602860248201527f4d757374207573652045524331313535206164647265737320776974682061206044820152673a37b5b2b724a21760c11b60648201526084016109d2565b611449565b6001600160a01b03821615611449576040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa1580156113c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ea9190613bf5565b6114495760405162461bcd60e51b815260206004820152602a60248201527f4d7573742075736520455243373231206164647265737320776974686f75742060448201526930903a37b5b2b724a21760b11b60648201526084016109d2565b6040518060e001604052808681526020016011600089815260200190815260200160002060010154815260200185815260200160116000898152602001908152602001600020600301548152602001848152602001836001600160a01b0316815260200182815250601160008881526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040190816115019190613b36565b5060a0828101516005830180546001600160a01b0319166001600160a01b0392831617905560c093840151600690930192909255600089815260116020908152604091829020600181015460039091015483518c8152928301919091528183018a9052606082015292861660808401529082018490525188927fa53c0adbaf8a2485c730b832ac266634bab632b2ede02a05c01cda6367e44399928290030190a2610da26001600755565b6011602052600090815260409020805460018201546002830154600384015460048501805494959394929391926115e290613995565b80601f016020809104026020016040519081016040528092919081815260200182805461160e90613995565b801561165b5780601f106116305761010080835404028352916020019161165b565b820191906000526020600020905b81548152906001019060200180831161163e57829003601f168201915b50505050600583015460069093015491926001600160a01b031691905087565b611683611f84565b6001600160a01b0382166000818152600b6020908152604091829020805460ff191685151590811790915591519182527fb840a1dbd8b09a3dc45161bba92dfb9aba643c0e44c085a447f839d1d02cf13b910160405180910390a25050565b60006116ed82612583565b60085460408051633fabe5a360e21b815290516000926001600160a01b03169163feaf968c9160048083019260a09291908290030181865afa158015611737573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175b9190613c2c565b50505091505060008112156117b25760405162461bcd60e51b815260206004820152601860248201527f70726963652063616e6e6f74206265206e65676174697665000000000000000060448201526064016109d2565b600854600084815260116020526040812054839261180291600160a81b90910460ff16906117f6906305f5e100906117fc9087908490670de0b6b3a76400006126e3565b906126ef565b906126e3565b905061180e81876126e3565b9695505050505050565b600d805461182590613995565b80601f016020809104026020016040519081016040528092919081815260200182805461185190613995565b801561189e5780601f106118735761010080835404028352916020019161189e565b820191906000526020600020905b81548152906001019060200180831161188157829003601f168201915b505050505081565b6060600180546108b490613995565b610fa33383836126fb565b6118ca3383611fde565b6118e65760405162461bcd60e51b81526004016109d290613a4a565b6118f2848484846127c9565b50505050565b6006546001600160a01b03163314806119255750336000908152600b602052604090205460ff1615156001145b6119415760405162461bcd60e51b81526004016109d2906139cf565b600f54604080516000815260208101929092527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c91015b60405180910390a1565b8282600182101580156119b65750600081815260116020526040902060028101546001909101546119b39084612213565b11155b6119d25760405162461bcd60e51b81526004016109d290613a97565b6119da6121ae565b6119e2611f37565b6119ee8585338661221f565b610aee6001600755565b611a416040518060e00160405280600081526020016000815260200160008152602001600081526020016060815260200160006001600160a01b03168152602001600081525090565b600082815260106020526040902054611a5990612583565b60116000601060008581526020019081526020016000205481526020019081526020016000206040518060e001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482018054611ac290613995565b80601f0160208091040260200160405190810160405280929190818152602001828054611aee90613995565b8015611b3b5780601f10611b1057610100808354040283529160200191611b3b565b820191906000526020600020905b815481529060010190602001808311611b1e57829003601f168201915b505050918352505060058201546001600160a01b0316602082015260069091015460409091015292915050565b6060611b7382611e6a565b600082815260106020526040902054611b8b90612583565b600082815260106020908152604080832054835260118252808320815160e0810183528154815260018201549381019390935260028101549183019190915260038101546060830152600481018054608084019190611be990613995565b80601f0160208091040260200160405190810160405280929190818152602001828054611c1590613995565b8015611c625780601f10611c3757610100808354040283529160200191611c62565b820191906000526020600020905b815481529060010190602001808311611c4557829003601f168201915b505050918352505060058201546001600160a01b031660208201526006909101546040909101529050600d611c96306127fc565b6080830151600086815260106020526040902054611cb390612812565b611cbc87612812565b604051602001611cd0959493929190613c98565b604051602081830303815290604052915050919050565b611cef611f84565b8015611cfd57610d296128a4565b610d296128ff565b6006546001600160a01b0316331480611d325750336000908152600b602052604090205460ff1615156001145b611d4e5760405162461bcd60e51b81526004016109d2906139cf565b611d56611f37565b60005b8151811015610fa357611d84828281518110611d7757611d77613ada565b6020026020010151610dd2565b80611d8e81613a31565b915050611d59565b6001600160a01b0381166000908152600b602052604081205460ff161515600103611dc35750600161089f565b6001600160a01b0380841660009081526005602090815260408083209386168352929052205460ff165b9392505050565b611dfc611f84565b6001600160a01b038116611e615760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109d2565b610d2981612691565b6000818152600260205260409020546001600160a01b0316610d295760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016109d2565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611efe82610fbb565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600654600160a01b900460ff16156111585760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016109d2565b6006546001600160a01b031633146111585760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d2565b600080611fea83610fbb565b9050806001600160a01b0316846001600160a01b0316148061201157506120118185611d96565b806120355750836001600160a01b031661202a84610937565b6001600160a01b0316145b949350505050565b826001600160a01b031661205082610fbb565b6001600160a01b0316146120765760405162461bcd60e51b81526004016109d290613d70565b6001600160a01b0382166120d85760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016109d2565b6120e5838383600161293b565b826001600160a01b03166120f882610fbb565b6001600160a01b03161461211e5760405162461bcd60e51b81526004016109d290613d70565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6002600754036122005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109d2565b6002600755565b6000611ded8284613db5565b6000611ded8284613dc8565b600061222b85856116e2565b9050803410156122745760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21030b6b7bab73a103830b4b21760611b60448201526064016109d2565b6000848152601160205260409020600501546001600160a01b03161561249557600084815260116020526040902060060154156123ac5760008481526011602052604080822060058101546006909101549151627eeac760e11b81526001600160a01b038781166004830152602482019390935291169062fdd58e90604401602060405180830381865afa158015612310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123349190613ddb565b116123a75760405162461bcd60e51b815260206004820152603760248201527f41646472657373206c61636b732074686520726571756972656420313135352060448201527f746f6b656e20676174652062616c616e6365203e20312e00000000000000000060648201526084016109d2565b612495565b6000848152601160205260408082206005015490516370a0823160e01b81526001600160a01b038681166004830152909116906370a0823190602401602060405180830381865afa158015612405573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124299190613ddb565b116124955760405162461bcd60e51b815260206004820152603660248201527f41646472657373206c61636b732074686520726571756972656420373231207460448201527537b5b2b71033b0ba32903130b630b731b2901f10189760511b60648201526084016109d2565b34156124a3576124a361294a565b6000848152601160205260409020600101546124bf9086612213565b6000858152601160205260408120600101919091555b85811015610da257600f80549060006124ed83613a31565b9091555050600f8054600090815260106020526040902086905554612513908590612b44565b600f54600086815260116020526040902086917f742d174ef4c6e426f5f84aa20c697c59735a206837ec50e907cf1c1c7c563e3b9187918a9161255688846126ef565b8960405161256996959493929190613df4565b60405180910390a28061257b81613a31565b9150506124d5565b6000818152601160205260408120600401805461259f90613995565b905011610d295760405162461bcd60e51b815260206004820152601c60248201527f546869732070726f6475637420646f6573206e6f742065786973742e0000000060448201526064016109d2565b60006125f982610fbb565b905061260981600084600161293b565b61261282610fbb565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000611ded8284613f17565b6000611ded8284613f2e565b816001600160a01b0316836001600160a01b03160361275c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109d2565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6127d484848461203d565b6127e084848484612b5e565b6118f25760405162461bcd60e51b81526004016109d290613f50565b606061089f6001600160a01b0383166014612c5f565b6060600061281f83612dfa565b60010190506000816001600160401b0381111561283e5761283e613297565b6040519080825280601f01601f191660200182016040528015612868576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287257509392505050565b6128ac611f37565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586128e73390565b6040516001600160a01b039091168152602001611978565b612907612ed2565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336128e7565b6129458184612f22565b6118f2565b600a546001600160a01b03166129f4576009546040516000916001600160a01b03169034908381818185875af1925050503d80600081146129a7576040519150601f19603f3d011682016040523d82523d6000602084013e6129ac565b606091505b5050905080610d295760405162461bcd60e51b81526020600482015260146024820152734661696c656420746f2073656e642066756e647360601b60448201526064016109d2565b600854600090612a16906064906117f6903490600160a01b900460ff166126e3565b90506000612a243483612207565b6009546040519192506000916001600160a01b039091169084908381818185875af1925050503d8060008114612a76576040519150601f19603f3d011682016040523d82523d6000602084013e612a7b565b606091505b5050600a546040519192506000916001600160a01b039091169084908381818185875af1925050503d8060008114612acf576040519150601f19603f3d011682016040523d82523d6000602084013e612ad4565b606091505b50509050818015612ae25750805b6118f25760405162461bcd60e51b815260206004820152602d60248201527f4661696c656420746f2073656e642066756e647320746f20646973706174636860448201526c08185b99081b595c98da185b9d609a1b60648201526084016109d2565b610fa3828260405180602001604052806000815250612fcb565b60006001600160a01b0384163b15612c5457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612ba2903390899088908890600401613fa2565b6020604051808303816000875af1925050508015612bdd575060408051601f3d908101601f19168201909252612bda91810190613fd5565b60015b612c3a573d808015612c0b576040519150601f19603f3d011682016040523d82523d6000602084013e612c10565b606091505b508051600003612c325760405162461bcd60e51b81526004016109d290613f50565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612035565b506001949350505050565b60606000612c6e836002613f17565b612c79906002613dc8565b6001600160401b03811115612c9057612c90613297565b6040519080825280601f01601f191660200182016040528015612cba576020820181803683370190505b509050600360fc1b81600081518110612cd557612cd5613ada565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d0457612d04613ada565b60200101906001600160f81b031916908160001a9053506000612d28846002613f17565b612d33906001613dc8565b90505b6001811115612dab576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612d6757612d67613ada565b1a60f81b828281518110612d7d57612d7d613ada565b60200101906001600160f81b031916908160001a90535060049490941c93612da481613ff2565b9050612d36565b508315611ded5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109d2565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612e395772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612e65576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612e8357662386f26fc10000830492506010015b6305f5e1008310612e9b576305f5e100830492506008015b6127108310612eaf57612710830492506004015b60648310612ec1576064830492506002015b600a831061089f5760010192915050565b600654600160a01b900460ff166111585760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016109d2565b6000600c54118015612f3c57506001600160a01b03811615155b15610fa357600c54612f5783612f51846110c0565b90612213565b1115610fa35760405162461bcd60e51b815260206004820152603f60248201527f43616e6e6f742065786365656420746865206d617853746f726542616c616e6360448201527f65416c6c6f77616e636520666f72206120676976656e20616464726573732e0060648201526084016109d2565b612fd58383612ffe565b612fe26000848484612b5e565b610a735760405162461bcd60e51b81526004016109d290613f50565b6001600160a01b0382166130545760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109d2565b6000818152600260205260409020546001600160a01b0316156130b95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109d2565b6130c760008383600161293b565b6000818152600260205260409020546001600160a01b03161561312c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109d2565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b031981168114610d2957600080fd5b6000602082840312156131bf57600080fd5b8135611ded81613197565b60005b838110156131e55781810151838201526020016131cd565b50506000910152565b600081518084526132068160208601602086016131ca565b601f01601f19169290920160200192915050565b602081526000611ded60208301846131ee565b60006020828403121561323f57600080fd5b5035919050565b6001600160a01b0381168114610d2957600080fd5b803561326681613246565b919050565b6000806040838503121561327e57600080fd5b823561328981613246565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156132cf576132cf613297565b60405290565b604051601f8201601f191681016001600160401b03811182821017156132fd576132fd613297565b604052919050565b60006001600160401b0383111561331e5761331e613297565b613331601f8401601f19166020016132d5565b905082815283838301111561334557600080fd5b828260208301376000602084830101529392505050565b600082601f83011261336d57600080fd5b611ded83833560208501613305565b600080600080600060a0868803121561339457600080fd5b853594506020860135935060408601356001600160401b038111156133b857600080fd5b6133c48882890161335c565b93505060608601356133d581613246565b949793965091946080013592915050565b600080604083850312156133f957600080fd5b823561340481613246565b9150602083013561341481613246565b809150509250929050565b60008060006060848603121561343457600080fd5b833561343f81613246565b9250602084013561344f81613246565b929592945050506040919091013590565b6000806000806080858703121561347657600080fd5b843593506020850135925060408501356001600160401b0381111561349a57600080fd5b6134a68782880161335c565b92505060608501356134b781613246565b939692955090935050565b60006001600160401b038211156134db576134db613297565b5060051b60200190565b600060208083850312156134f857600080fd5b82356001600160401b038082111561350f57600080fd5b818501915085601f83011261352357600080fd5b8135613536613531826134c2565b6132d5565b81815260059190911b8301840190848101908883111561355557600080fd5b8585015b8381101561360b5780358581111561357057600080fd5b860160e0818c03601f190112156135875760008081fd5b61358f6132ad565b8882013581526040808301358a830152606080840135828401526080915081840135818401525060a080840135898111156135ca5760008081fd5b6135d88f8d8388010161335c565b838501525060c091506135ec82850161325b565b9083015260e09290920135918101919091528352918601918601613559565b5098975050505050505050565b60006020828403121561362a57600080fd5b81356001600160401b0381111561364057600080fd5b6120358482850161335c565b60006020828403121561365e57600080fd5b813560ff81168114611ded57600080fd5b60006020828403121561368157600080fd5b8135611ded81613246565b60008060008060008060c087890312156136a557600080fd5b86359550602087013594506040870135935060608701356001600160401b038111156136d057600080fd5b6136dc89828a0161335c565b93505060808701356136ed81613246565b8092505060a087013590509295509295509295565b87815286602082015285604082015284606082015260e06080820152600061372d60e08301866131ee565b6001600160a01b039490941660a08301525060c0015295945050505050565b8015158114610d2957600080fd5b6000806040838503121561376d57600080fd5b823561377881613246565b915060208301356134148161374c565b6000806040838503121561379b57600080fd5b50508035926020909101359150565b600080600080608085870312156137c057600080fd5b84356137cb81613246565b935060208501356137db81613246565b92506040850135915060608501356001600160401b038111156137fd57600080fd5b8501601f8101871361380e57600080fd5b61381d87823560208401613305565b91505092959194509250565b60008060006060848603121561383e57600080fd5b833592506020840135915060408401356001600160401b0381111561386257600080fd5b61386e8682870161335c565b9150509250925092565b60208152815160208201526020820151604082015260408201516060820152606082015160808201526000608083015160e060a08401526138bd6101008401826131ee565b60a08501516001600160a01b031660c0858101919091529094015160e0909301929092525090919050565b6000602082840312156138fa57600080fd5b8135611ded8161374c565b6000602080838503121561391857600080fd5b82356001600160401b0381111561392e57600080fd5b8301601f8101851361393f57600080fd5b803561394d613531826134c2565b81815260059190911b8201830190838101908783111561396c57600080fd5b928401925b8284101561398a57833582529284019290840190613971565b979650505050505050565b600181811c908216806139a957607f821691505b6020821081036139c957634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602c908201527f4d75737420626520746865206f776e6572206f722062652077686974656c697360408201526b3a32b21030b2323932b9b99760a11b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b600060018201613a4357613a43613a1b565b5060010190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526023908201527f43616e6e6f74206578636565642070726f6475637420746f74616c2073757070604082015262363c9760e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b601f821115610a7357600081815260208120601f850160051c81016020861015613b175750805b601f850160051c820191505b81811015610da257828155600101613b23565b81516001600160401b03811115613b4f57613b4f613297565b613b6381613b5d8454613995565b84613af0565b602080601f831160018114613b985760008415613b805750858301515b600019600386901b1c1916600185901b178555610da2565b600085815260208120601f198616915b82811015613bc757888601518255948401946001909101908401613ba8565b5085821015613be55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215613c0757600080fd5b8151611ded8161374c565b805169ffffffffffffffffffff8116811461326657600080fd5b600080600080600060a08688031215613c4457600080fd5b613c4d86613c12565b9450602086015193506040860151925060608601519150613c7060808701613c12565b90509295509295909350565b60008151613c8e8185602086016131ca565b9290920192915050565b6000808754613ca681613995565b60018281168015613cbe5760018114613cd357613d02565b60ff1984168752821515830287019450613d02565b8b60005260208060002060005b85811015613cf95781548a820152908401908201613ce0565b50505082870194505b50602f60f81b845289519250613d1e8382860160208d016131ca565b613d61613d5b613d48613d55613d48613d4286898b0101602f60f81b815260010190565b8e613c7c565b602f60f81b815260010190565b8b613c7c565b88613c7c565b9b9a5050505050505050505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b8181038181111561089f5761089f613a1b565b8082018082111561089f5761089f613a1b565b600060208284031215613ded57600080fd5b5051919050565b60018060a01b038716815260006020878184015286604084015260c06060840152855460c084015260018087015460e0850152600287015461010085015260038701546101208501526004870160e061014086015260008154613e5681613995565b806101a08901526101c085831660008114613e785760018114613e9257613ec0565b60ff1984168a83015282151560051b8a0182019450613ec0565b856000528760002060005b84811015613eb85781548c8201850152908801908901613e9d565b8b0183019550505b5050505060058901546001600160a01b03166001600160a01b0381166101608801529350600689015461018087015287608087015285810360a0870152613f0781886131ee565b9c9b505050505050505050505050565b808202811582820484141761089f5761089f613a1b565b600082613f4b57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061180e908301846131ee565b600060208284031215613fe757600080fd5b8151611ded81613197565b60008161400157614001613a1b565b50600019019056fea2646970667358221220343957976f080b973c388b1f000cd214d180fcfc893e25f784787de20bbe0c2964736f6c63430008110033

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.