ETH Price: $3,471.18 (+0.63%)
Gas: 7 Gwei

Token

Luna Sky (LunaSky)
 

Overview

Max Total Supply

10,306 LunaSky

Holders

6

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

0xe8b90fc2ff729c2372f05e8fc8f1be8262d0c0eb
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
NFT

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.8.7;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract NFT is ERC1155, Ownable {
  mapping (uint256 => address) public creators;
  mapping (uint256 => uint256) public tokenSupply;
  mapping (uint256 => Fees[]) public creatorFees;
  mapping (uint256 => uint256) public initialPrice;
  mapping (uint256 => string) customUri;
  // mapping (uint256 => MysteryBDetails) mysteryBoxes; // collection => token => {reveal count, total sold}
  // mapping (address => mapping (uint256 => uint32)) reveals;
  mapping (uint256 => uint32) private serviceFees;
  // mapping (uint256 => CollectionDetails) private collectionDetails; // collention => (child limit, [nft1, nft2, nft3])
  mapping (uint256 => uint256) private tokenPoolId;

  bool private enableMint = true;
  bool private enableChangeToken = false;
  // mapping(uint256 => mapping(address => uint256)) private balances;
  // Contract name
  string public name;
  // Contract symbol
  string public symbol;

  struct Fees {
    address receiver;
    uint32 percent;
  }

  // struct CollectionDetails {
  //   uint256 childLimit;
  //   uint256[] nfts;
  // }


  // struct MysteryBDetails {
  //   uint32 revealItems;
  //   uint256 totalSold;
  // }

  // uint256 public serviceFees = 200;
  address public marketplaceAddress; 

  struct TokenInfo {IERC20 paytoken; }
  TokenInfo[] public AllowedCrypto;

  /**
   * @dev Require _msgSender() to be the creator of the token id
   */
  modifier creatorOnly(uint256 _id) {
    require(creators[_id] == _msgSender(), "ERC1155Tradable#creatorOnly: ONLY_CREATOR_ALLOWED");
    _;
  }

  /**
   * @dev Require _msgSender() to own more than 0 of the token id
   */
  modifier ownersOnly(uint256 _id) {
    require(balanceOf(_msgSender(), _id) > 0, "ERC1155Tradable#ownersOnly: ONLY_OWNERS_ALLOWED");
    _;
  }

  event Mint(
    address indexed to, 
    uint256 indexed id,
    string indexed tokenUri,
    uint256  qty
  );

  constructor(
    string memory _name,
    string memory _symbol,
    string memory _uri,
    // address _proxyRegistryAddress
    address _marketplaceAddress
  ) ERC1155(_uri) {
    name = _name;
    symbol = _symbol;
    marketplaceAddress = _marketplaceAddress;
    // proxyRegistryAddress = _proxyRegistryAddress;
    // _initializeEIP712(name);
  }

  function uri(
    uint256 _id
  ) override public view returns (string memory) {
    require(_exists(_id), "ERC1155Tradable#uri: NONEXISTENT_TOKEN");
    // We have to convert string to bytes to check for existence
    bytes memory customUriBytes = bytes(customUri[_id]);
    if (customUriBytes.length > 0) {
        return customUri[_id];
    } else {
        return super.uri(_id);
    }
  }

  function _exists(
    uint256 _id
  ) internal view returns (bool) {
    return creators[_id] != address(0);
  }

  function exists(
    uint256 _id
  ) external view returns (bool) {
    return _exists(_id);
  }

  /**
    * @dev Returns the total quantity for a token ID
    * @param _id uint256 ID of the token to query
    * @return amount of token in existence
    */
  function totalSupply(
    uint256 _id
  ) public view returns (uint256) {
    return tokenSupply[_id];
  }

  /**
   * @dev Sets a new URI for all token types, by relying on the token type ID
    * substitution mechanism
    * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
   * @param _newURI New URI for all tokens
   */
  function setURI(
    string memory _newURI
  ) public onlyOwner {
    _setURI(_newURI);
  }

  /**
   * @dev Will update the base URI for the token
   * @param _tokenId The token to update. _msgSender() must be its creator.
   * @param _newURI New URI for the token.
   */
  function setCustomURI(
    uint256 _tokenId,
    string memory _newURI
  ) public creatorOnly(_tokenId)  { 
    customUri[_tokenId] = _newURI;
    emit URI(_newURI, _tokenId);
  }

  function setCreator(
    address _to,
    uint256[] memory _ids
  ) public {
    require(_to != address(0), "ERC1155Tradable#setCreator: INVALID_ADDRESS.");
    for (uint256 i = 0; i < _ids.length; i++) {
      uint256 id = _ids[i];
      _setCreator(_to, id);
    }
  }

  function _setCreator(address _to, uint256 _id) internal creatorOnly(_id)
  {
      creators[_id] = _to;
  }

  function setCreatorOnlyOwner(address _to, uint256[] calldata _ids) external onlyOwner  {
    for (uint256 i = 0; i < _ids.length; i++) {
      creators[_ids[i]] = _to;
    }
  }

  function initiateToken(uint256 _tokenId, address _owner, uint256 _price, uint256 _supply, address[] calldata _creators, 
    uint32[] calldata _creatorFees, uint32 _serviceFees, uint256 _pId) external {
    require(!_exists(_tokenId), "tokenId already exists");
    tokenSupply[_tokenId] = _supply;
    creators[_tokenId] = _owner;
    initialPrice[_tokenId] = _price;
    serviceFees[_tokenId] = _serviceFees;
    tokenPoolId[_tokenId] = _pId;

    for (uint8 i=0; i<_creators.length; i++) {
      creatorFees[_tokenId].push(Fees(_creators[i], _creatorFees[i]));
    }

    // if(_mysteryBoxChilds > 0) {
    //   mysteryBoxes[_tokenId] = MysteryBDetails(_mysteryBoxChilds, 0); // n childs and zero sold till now
    // }
    // collectionDetails[_collectionId].childLimit = _mbContentLimits;
  }

  function initiateTokenMint(uint256 _tokenId, address _owner, string calldata _tokenURI, uint256 _supply, address[] calldata _creators, 
    uint32[] calldata _creatorFees, uint32 _serviceFees, uint256 _pId) external {
    require(enableMint, "Minting Paused");
    require(!_exists(_tokenId), "tokenId already exists");
    tokenSupply[_tokenId] = _supply;
    creators[_tokenId] = _owner;
    serviceFees[_tokenId] = _serviceFees;
    tokenPoolId[_tokenId] = _pId;

    for (uint8 i=0; i<_creators.length; i++) {
      creatorFees[_tokenId].push(Fees(_creators[i], _creatorFees[i]));
    }

    // if(_mysteryBoxChilds > 0) {
    //   mysteryBoxes[_tokenId] = MysteryBDetails(_mysteryBoxChilds, 0); // n childs and zero sold till now
    // }
    _mintOne(_owner, _tokenId, _tokenURI, _supply);
  }

  function setCreatorFees(uint256 _tokenId, address[] calldata _creators, uint8[] calldata _creatorFees) external creatorOnly(_tokenId) {
    require(_exists(_tokenId), "Invalid tokenId");
    
    delete creatorFees[_tokenId]; // delete before adding new
    for (uint8 i=0; i<_creators.length; i++) {
      creatorFees[_tokenId].push(Fees(_creators[i], _creatorFees[i]));
    }
  }

  function setServiceFees(uint256 _tokenId, uint32 _serviceFees) external onlyOwner{
    serviceFees[_tokenId] = _serviceFees;
  }

  function getServiceFees(uint256 _tokenId) external view onlyOwner returns (uint32){
    return serviceFees[_tokenId];
  }

  function setEnableMint(bool _enableMint) external onlyOwner{
    enableMint = _enableMint;
  }

  function getEnableMint() external view onlyOwner returns (bool){
    return enableMint;
  }

  function setEnableChangeToken(bool _enableTc) external onlyOwner{
    enableChangeToken = _enableTc;
  }

  function getEnableChangeToken() external view onlyOwner returns (bool){
    return enableChangeToken;
  }  

  function mint(address _to, uint256[] calldata _tokenIds, string[] calldata _tokenURIs, uint256[] calldata _qty, uint256 _pId, uint256 cost) external payable {
    require(enableMint, "Minting Paused");
    
    for (uint256 i = 0; i < _tokenIds.length; ++i) {
      require(_exists(_tokenIds[i]), "ERC1155Tradable#uri: NONEXISTENT_TOKEN");

      ///Normal
      if(_pId == 99999){ 
        require(initialPrice[_tokenIds[i]]*_qty[i] <= msg.value, "Insufficient fund sent");
      }
      else{
        //// item / token pool id == given pool id
        if(tokenPoolId[i] == _pId && _pId != 99999) {
            require(initialPrice[_tokenIds[i]]*_qty[i] <= cost, "Insufficient fund sent");
        }
        else {
          revert("Not Allowed");
        }
      }
     
      _mintOne(_to, _tokenIds[i], _tokenURIs[i], _qty[i]);
      // TODO send creator fees
      _sendCreatorEarnings(_tokenIds[i], _pId, cost);
    }
  }

  // function getTotalSoldChildsMB(uint256 _collectionId) view internal returns (uint256){
  //   uint256 soldNfts = 0;
  //   for (uint256 i = 0; i < collectionDetails[_collectionId].nfts.length; ++i) {
  //     soldNfts += mysteryBoxes[_collectionId][collectionDetails[_collectionId].nfts[i]].totalSold * mysteryBoxes[_collectionId][collectionDetails[_collectionId].nfts[i]].revealItems;
  //   }
  //   return soldNfts;
  // }

  function _mintOne(address _to, uint256 _tokenId, string calldata _tokenURI, uint256 _qty) internal {
    require(_exists(_tokenId), "Invalid tokenId");
    require(enableMint, "Minting Paused");

    // require(collectionDetails[_collectionId].childLimit >= getTotalSoldChildsMB(_collectionId), "No more Boxes left");

    // TODO fix the issue of partial fail
    if (bytes(_tokenURI).length > 0) {
      customUri[_tokenId] = _tokenURI;
      emit URI(_tokenURI, _tokenId);
    }
    _mint(_to, _tokenId, _qty, "");
    emit Mint(_to, _tokenId, _tokenURI, _qty);
    setApprovalForAll(marketplaceAddress, true);
  }

  /*
  * Only for Creators to premint their tokens
  */
  function create(address _to, uint256 _tokenId, string calldata _tokenURI, uint256 _qty) external creatorOnly(_tokenId){
    _mintOne(_to, _tokenId, _tokenURI, _qty);
  }

  function _sendCreatorEarnings(uint256 _tokenId, uint256 _pId, uint256 cost) internal {
    uint256 fees = 0;
    /////Non ERC 20 token
    if(_pId == 99999) {
        //// normal payment transfer
        payable(creators[_tokenId]).transfer(msg.value - fees - (msg.value*serviceFees[_tokenId]/10000));
    }
    else {
		uint256 totalCost = (cost - fees - (cost*serviceFees[_tokenId]/10000));
        IERC20 paytoken;
        TokenInfo storage tokens = AllowedCrypto[_pId];
        paytoken = tokens.paytoken;
        paytoken.transferFrom(msg.sender, creators[_tokenId], totalCost);
    }
    // disable creaor earning from minting form the main contract
    // for (uint256 i = 0; i < creatorFees[_tokenId].length; ++i) {
    //   fees += msg.value*creatorFees[_tokenId][i].percent/10000;
    //   payable(creatorFees[_tokenId][i].receiver).transfer(msg.value*creatorFees[_tokenId][i].percent/10000);
    // }
    
  }

  function bulkCreate(address _to, uint256[] calldata _tokenIds, string[] calldata _tokenURIs, uint256[] calldata _qty) external {
    require(enableMint, "Minting Paused");
    for (uint256 i = 0; i < _tokenIds.length; ++i) {
      this.create(_to, _tokenIds[i], _tokenURIs[i], _qty[i]);
    }
  }

  // function reveal(uint256 _tokenId, uint256[] calldata _revealItems, string[] calldata _tokenURIs, uint256[] calldata _qty) external ownersOnly(_tokenId){
  //   require(enableMint, "Minting Paused");
  //   require(mysteryBoxes[_tokenId].revealItems > 0, "Not a mystery Box");
  //   uint256 balance = this.balanceOf(_msgSender(), _tokenId);
  //   require(balance >= _revealItems.length, "Reveal limit exceeded");

  //   // revealItems
  //   for (uint256 i = 0; i < _revealItems.length; ++i) {
  //     _mintOne(_msgSender(), _revealItems[i], _tokenURIs[i], _qty[i]);
  //   }

  //   _burn(_msgSender(), _tokenId, _revealItems.length);
  //   // mapping (uint256 => uint32) mysteryBoxes;
  //   // mapping (address => mapping (uint256 => uint32)) reveals;

  // }

  function burn(address account, uint256 _tokenId, uint256 amount) external creatorOnly(_tokenId) {
    _burn(account, _tokenId, amount);
  }

  function burnBatch(address[] calldata _accounts, uint256[] calldata _tokenIds, uint256[] calldata _amounts) external {
    for (uint256 i = 0; i < _tokenIds.length; ++i) {
      this.burn(_accounts[i], _tokenIds[i], _amounts[i]);
    }
  }

  function withdrawFunds(uint256 withdrawAmount) external onlyOwner {
    require(address(this).balance > 0 && withdrawAmount <= address(this).balance, "Insufficient Fund");
    (bool success, ) = msg.sender.call{value: withdrawAmount}("");
    require(success, "Withdraw failed.");
  }
  
  function transferFund(uint256 transferAmount, address transferTo) external onlyOwner {
      require(address(this).balance > 0 && transferAmount <= address(this).balance, "Insufficient Fund");
      (bool success,) = transferTo.call{value: transferAmount}("");
      require(success, "Transfer Failed");
  }

  function addCurrency(IERC20 _paytoken) public onlyOwner {
    AllowedCrypto.push( TokenInfo({paytoken: _paytoken}) );
  }

  function withdrawToken(uint256 _pid) public payable onlyOwner() {
    TokenInfo storage tokens = AllowedCrypto[_pid];
    IERC20 paytoken;
    paytoken = tokens.paytoken;
    paytoken.transfer(msg.sender, paytoken.balanceOf(address(this)));
  }

  function setMarketplaceAddress(address _address) external onlyOwner{
    marketplaceAddress = _address;
  }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 3 of 12 : SafeMath.sol
// 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;
        }
    }
}

File 4 of 12 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

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

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `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 memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - 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[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * 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 _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

File 8 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 12 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

File 10 of 12 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 11 of 12 : IERC1155.sol
// 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;
}

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"address","name":"_marketplaceAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"string","name":"tokenUri","type":"string"},{"indexed":false,"internalType":"uint256","name":"qty","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"AllowedCrypto","outputs":[{"internalType":"contract IERC20","name":"paytoken","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_paytoken","type":"address"}],"name":"addCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"_tokenURIs","type":"string[]"},{"internalType":"uint256[]","name":"_qty","type":"uint256[]"}],"name":"bulkCreate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"uint256","name":"_qty","type":"uint256"}],"name":"create","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"creatorFees","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint32","name":"percent","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEnableChangeToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEnableMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getServiceFees","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"initialPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_supply","type":"uint256"},{"internalType":"address[]","name":"_creators","type":"address[]"},{"internalType":"uint32[]","name":"_creatorFees","type":"uint32[]"},{"internalType":"uint32","name":"_serviceFees","type":"uint32"},{"internalType":"uint256","name":"_pId","type":"uint256"}],"name":"initiateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"uint256","name":"_supply","type":"uint256"},{"internalType":"address[]","name":"_creators","type":"address[]"},{"internalType":"uint32[]","name":"_creatorFees","type":"uint32[]"},{"internalType":"uint32","name":"_serviceFees","type":"uint32"},{"internalType":"uint256","name":"_pId","type":"uint256"}],"name":"initiateTokenMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketplaceAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"_tokenURIs","type":"string[]"},{"internalType":"uint256[]","name":"_qty","type":"uint256[]"},{"internalType":"uint256","name":"_pId","type":"uint256"},{"internalType":"uint256","name":"cost","type":"uint256"}],"name":"mint","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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","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":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"setCreator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address[]","name":"_creators","type":"address[]"},{"internalType":"uint8[]","name":"_creatorFees","type":"uint8[]"}],"name":"setCreatorFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"setCreatorOnlyOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_newURI","type":"string"}],"name":"setCustomURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enableTc","type":"bool"}],"name":"setEnableChangeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enableMint","type":"bool"}],"name":"setEnableMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setMarketplaceAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint32","name":"_serviceFees","type":"uint32"}],"name":"setServiceFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newURI","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"transferAmount","type":"uint256"},{"internalType":"address","name":"transferTo","type":"address"}],"name":"transferFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"withdrawAmount","type":"uint256"}],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"payable","type":"function"}]

6080604052600b805461ffff191660011790553480156200001f57600080fd5b50604051620044a6380380620044a6833981016040819052620000429162000278565b816200004e81620000b0565b506200005a33620000c9565b83516200006f90600c9060208701906200011b565b5082516200008590600d9060208601906200011b565b50600e80546001600160a01b0319166001600160a01b0392909216919091179055506200037e915050565b8051620000c59060029060208401906200011b565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b82805462000129906200032b565b90600052602060002090601f0160209004810192826200014d576000855562000198565b82601f106200016857805160ff191683800117855562000198565b8280016001018555821562000198579182015b82811115620001985782518255916020019190600101906200017b565b50620001a6929150620001aa565b5090565b5b80821115620001a65760008155600101620001ab565b600082601f830112620001d357600080fd5b81516001600160401b0380821115620001f057620001f062000368565b604051601f8301601f19908116603f011681019082821181831017156200021b576200021b62000368565b816040528381526020925086838588010111156200023857600080fd5b600091505b838210156200025c57858201830151818301840152908201906200023d565b838211156200026e5760008385830101525b9695505050505050565b600080600080608085870312156200028f57600080fd5b84516001600160401b0380821115620002a757600080fd5b620002b588838901620001c1565b95506020870151915080821115620002cc57600080fd5b620002da88838901620001c1565b94506040870151915080821115620002f157600080fd5b506200030087828801620001c1565b606087015190935090506001600160a01b03811681146200032057600080fd5b939692955090935050565b600181811c908216806200034057607f821691505b602082108114156200036257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b614118806200038e6000396000f3fe6080604052600436106102665760003560e01c80638da5cb5b11610144578063d128d017116100b6578063e985e9c51161007a578063e985e9c5146107b2578063f242432a146107fb578063f2fde38b1461081b578063f5298aca1461083b578063f669b2631461085b578063f9dd3f5a1461087b57600080fd5b8063d128d017146106ee578063d2a6b51a1461070e578063daa17f491461072e578063dc9405b41461074e578063e53db90d1461079257600080fd5b8063a22cb46511610108578063a22cb4651461060b578063b47cc5561461062b578063bac0545d1461064b578063bd85b0391461066b578063cca4d25014610698578063cd53d08e146106b857600080fd5b80638da5cb5b1461058e5780638fb4bd1d146105ac57806395801044146105c157806395d89b41146105d65780639c5ded7b146105eb57600080fd5b80632a36c108116101dd5780634e1273f4116101a15780634e1273f4146104d95780634f558e791461050657806350baa62214610526578063715018a614610539578063749bfcbc1461054e5780638ab234b61461056e57600080fd5b80632a36c108146104395780632eb2c2d61461045957806331d703661461047957806339e95f5d146104995780633adf80b4146104b957600080fd5b8063155dd5ee1161022f578063155dd5ee14610332578063237af259146103525780632693ebf21461038757806326c91cad146103b457806327e32d0b146103ec57806328ea16631461041957600080fd5b8062fdd58e1461026b57806301ffc9a71461029e57806302fe5305146102ce57806306fdde03146102f05780630e89341c14610312575b600080fd5b34801561027757600080fd5b5061028b61028636600461347c565b61088e565b6040519081526020015b60405180910390f35b3480156102aa57600080fd5b506102be6102b93660046136db565b610925565b6040519015158152602001610295565b3480156102da57600080fd5b506102ee6102e9366004613715565b610977565b005b3480156102fc57600080fd5b506103056109ad565b6040516102959190613c70565b34801561031e57600080fd5b5061030561032d366004613751565b610a3b565b34801561033e57600080fd5b506102ee61034d366004613751565b610bba565b34801561035e57600080fd5b5061037261036d366004613751565b610cc3565b60405163ffffffff9091168152602001610295565b34801561039357600080fd5b5061028b6103a2366004613751565b60056020526000908152604090205481565b3480156103c057600080fd5b506103d46103cf366004613751565b610d0c565b6040516001600160a01b039091168152602001610295565b3480156103f857600080fd5b5061028b610407366004613751565b60076020526000908152604090205481565b34801561042557600080fd5b506102ee610434366004613295565b610d36565b34801561044557600080fd5b506102ee610454366004613540565b610e2d565b34801561046557600080fd5b506102ee61047436600461312c565b610f18565b34801561048557600080fd5b506102ee6104943660046136a1565b610faf565b3480156104a557600080fd5b506102ee6104b436600461393c565b610ff3565b3480156104c557600080fd5b506102ee6104d43660046139b5565b611176565b3480156104e557600080fd5b506104f96104f43660046135d9565b61120b565b6040516102959190613c1b565b34801561051257600080fd5b506102be610521366004613751565b611334565b6102ee610534366004613751565b61133f565b34801561054557600080fd5b506102ee611494565b34801561055a57600080fd5b506102ee610569366004613783565b6114ca565b34801561057a57600080fd5b506102ee6105893660046130d6565b6115de565b34801561059a57600080fd5b506003546001600160a01b03166103d4565b3480156105b857600080fd5b506102be61166b565b3480156105cd57600080fd5b506102be6116a8565b3480156105e257600080fd5b506103056116df565b3480156105f757600080fd5b506102ee6106063660046137a8565b6116ec565b34801561061757600080fd5b506102ee61062636600461344e565b6118be565b34801561063757600080fd5b506102ee6106463660046130d6565b6118c9565b34801561065757600080fd5b506102ee610666366004613241565b611915565b34801561067757600080fd5b5061028b610686366004613751565b60009081526005602052604090205490565b3480156106a457600080fd5b506102ee6106b33660046136a1565b6119ad565b3480156106c457600080fd5b506103d46106d3366004613751565b6004602052600090815260409020546001600160a01b031681565b3480156106fa57600080fd5b506102ee610709366004613883565b6119ea565b34801561071a57600080fd5b506102ee6107293660046133ff565b611b89565b34801561073a57600080fd5b50600e546103d4906001600160a01b031681565b34801561075a57600080fd5b5061076e6107693660046139f1565b611c3b565b604080516001600160a01b03909316835263ffffffff909116602083015201610295565b34801561079e57600080fd5b506102ee6107ad3660046134a8565b611c81565b3480156107be57600080fd5b506102be6107cd3660046130f3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561080757600080fd5b506102ee6108163660046131d9565b611cce565b34801561082757600080fd5b506102ee6108363660046130d6565b611d55565b34801561084757600080fd5b506102ee61085636600461350b565b611ded565b34801561086757600080fd5b506102ee610876366004613a13565b611e30565b6102ee610889366004613341565b611e82565b60006001600160a01b0383166108ff5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061095657506001600160e01b031982166303a24d0760e21b145b8061097157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6003546001600160a01b031633146109a15760405162461bcd60e51b81526004016108f690613da0565b6109aa8161209f565b50565b600c80546109ba90613f27565b80601f01602080910402602001604051908101604052809291908181526020018280546109e690613f27565b8015610a335780601f10610a0857610100808354040283529160200191610a33565b820191906000526020600020905b815481529060010190602001808311610a1657829003601f168201915b505050505081565b6060610a46826120b2565b610a625760405162461bcd60e51b81526004016108f690613d10565b60008281526008602052604081208054610a7b90613f27565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa790613f27565b8015610af45780601f10610ac957610100808354040283529160200191610af4565b820191906000526020600020905b815481529060010190602001808311610ad757829003601f168201915b50505050509050600081511115610ba45760008381526008602052604090208054610b1e90613f27565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4a90613f27565b8015610b975780601f10610b6c57610100808354040283529160200191610b97565b820191906000526020600020905b815481529060010190602001808311610b7a57829003601f168201915b5050505050915050919050565b610bad836120cf565b9392505050565b50919050565b6003546001600160a01b03163314610be45760405162461bcd60e51b81526004016108f690613da0565b600047118015610bf45750478111155b610c345760405162461bcd60e51b8152602060048201526011602482015270125b9cdd59999a58da595b9d08119d5b99607a1b60448201526064016108f6565b604051600090339083908381818185875af1925050503d8060008114610c76576040519150601f19603f3d011682016040523d82523d6000602084013e610c7b565b606091505b5050905080610cbf5760405162461bcd60e51b815260206004820152601060248201526f2bb4ba34323930bb903330b4b632b21760811b60448201526064016108f6565b5050565b6003546000906001600160a01b03163314610cf05760405162461bcd60e51b81526004016108f690613da0565b5060008181526009602052604090205463ffffffff165b919050565b600f8181548110610d1c57600080fd5b6000918252602090912001546001600160a01b0316905081565b600b5460ff16610d585760405162461bcd60e51b81526004016108f690613dd5565b60005b85811015610e23573063e53db90d89898985818110610d7c57610d7c613fd9565b90506020020135888886818110610d9557610d95613fd9565b9050602002810190610da79190613e4e565b888888818110610db957610db9613fd9565b905060200201356040518663ffffffff1660e01b8152600401610de0959493929190613be1565b600060405180830381600087803b158015610dfa57600080fd5b505af1158015610e0e573d6000803e3d6000fd5b5050505080610e1c90613f88565b9050610d5b565b5050505050505050565b60005b83811015610f0f573063f5298aca888884818110610e5057610e50613fd9565b9050602002016020810190610e6591906130d6565b878785818110610e7757610e77613fd9565b90506020020135868686818110610e9057610e90613fd9565b6040516001600160e01b031960e088901b1681526001600160a01b039095166004860152602485019390935250602090910201356044820152606401600060405180830381600087803b158015610ee657600080fd5b505af1158015610efa573d6000803e3d6000fd5b5050505080610f0890613f88565b9050610e30565b50505050505050565b6001600160a01b038516331480610f345750610f3485336107cd565b610f9b5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016108f6565b610fa88585858585612163565b5050505050565b6003546001600160a01b03163314610fd95760405162461bcd60e51b81526004016108f690613da0565b600b80549115156101000261ff0019909216919091179055565b60008581526004602052604090205485906001600160a01b0316331461102b5760405162461bcd60e51b81526004016108f690613dfd565b611034866120b2565b6110725760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b60448201526064016108f6565b600086815260066020526040812061108991612df7565b60005b60ff8116851115610f0f5760066000888152602001908152602001600020604051806040016040528088888560ff168181106110ca576110ca613fd9565b90506020020160208101906110df91906130d6565b6001600160a01b0316815260200186868560ff1681811061110257611102613fd9565b90506020020160208101906111179190613a5a565b60ff16905281546001810183556000928352602092839020825191018054939092015163ffffffff16600160a01b026001600160c01b03199093166001600160a01b03909116179190911790558061116e81613fa3565b91505061108c565b60008281526004602052604090205482906001600160a01b031633146111ae5760405162461bcd60e51b81526004016108f690613dfd565b600083815260086020908152604090912083516111cd92850190612e15565b50827f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b836040516111fe9190613c70565b60405180910390a2505050565b606081518351146112705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016108f6565b600083516001600160401b0381111561128b5761128b613fef565b6040519080825280602002602001820160405280156112b4578160200160208202803683370190505b50905060005b845181101561132c576112ff8582815181106112d8576112d8613fd9565b60200260200101518583815181106112f2576112f2613fd9565b602002602001015161088e565b82828151811061131157611311613fd9565b602090810291909101015261132581613f88565b90506112ba565b509392505050565b6000610971826120b2565b6003546001600160a01b031633146113695760405162461bcd60e51b81526004016108f690613da0565b6000600f828154811061137e5761137e613fd9565b600091825260209091200180546040516370a0823160e01b81523060048201529192506001600160a01b031690819063a9059cbb90339083906370a082319060240160206040518083038186803b1580156113d857600080fd5b505afa1580156113ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611410919061376a565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561145657600080fd5b505af115801561146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148e91906136be565b50505050565b6003546001600160a01b031633146114be5760405162461bcd60e51b81526004016108f690613da0565b6114c86000612338565b565b6003546001600160a01b031633146114f45760405162461bcd60e51b81526004016108f690613da0565b6000471180156115045750478211155b6115445760405162461bcd60e51b8152602060048201526011602482015270125b9cdd59999a58da595b9d08119d5b99607a1b60448201526064016108f6565b6000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114611591576040519150601f19603f3d011682016040523d82523d6000602084013e611596565b606091505b50509050806115d95760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8811985a5b1959608a1b60448201526064016108f6565b505050565b6003546001600160a01b031633146116085760405162461bcd60e51b81526004016108f690613da0565b60408051602081019091526001600160a01b039182168152600f805460018101825560009190915290517f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290910180546001600160a01b03191691909216179055565b6003546000906001600160a01b031633146116985760405162461bcd60e51b81526004016108f690613da0565b50600b54610100900460ff165b90565b6003546000906001600160a01b031633146116d55760405162461bcd60e51b81526004016108f690613da0565b50600b5460ff1690565b600d80546109ba90613f27565b600b5460ff1661170e5760405162461bcd60e51b81526004016108f690613dd5565b6117178b6120b2565b1561175d5760405162461bcd60e51b8152602060048201526016602482015275746f6b656e496420616c72656164792065786973747360501b60448201526064016108f6565b60008b81526005602090815260408083208a90556004825280832080546001600160a01b0319166001600160a01b038f1617905560098252808320805463ffffffff191663ffffffff8716179055600a90915281208290555b60ff81168611156118a357600660008d8152602001908152602001600020604051806040016040528089898560ff168181106117f4576117f4613fd9565b905060200201602081019061180991906130d6565b6001600160a01b0316815260200187878560ff1681811061182c5761182c613fd9565b90506020020160208101906118419190613a3f565b63ffffffff908116909152825460018101845560009384526020938490208351910180549490930151909116600160a01b026001600160c01b03199093166001600160a01b03909116179190911790558061189b81613fa3565b9150506117b6565b506118b18a8c8b8b8b61238a565b5050505050505050505050565b610cbf3383836124dc565b6003546001600160a01b031633146118f35760405162461bcd60e51b81526004016108f690613da0565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b0316331461193f5760405162461bcd60e51b81526004016108f690613da0565b60005b8181101561148e57836004600085858581811061196157611961613fd9565b90506020020135815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080806119a590613f88565b915050611942565b6003546001600160a01b031633146119d75760405162461bcd60e51b81526004016108f690613da0565b600b805460ff1916911515919091179055565b6119f38a6120b2565b15611a395760405162461bcd60e51b8152602060048201526016602482015275746f6b656e496420616c72656164792065786973747360501b60448201526064016108f6565b60008a81526005602090815260408083208a90556004825280832080546001600160a01b0319166001600160a01b038e16179055600782528083208b905560098252808320805463ffffffff191663ffffffff8716179055600a90915281208290555b60ff81168611156118b157600660008c8152602001908152602001600020604051806040016040528089898560ff16818110611ada57611ada613fd9565b9050602002016020810190611aef91906130d6565b6001600160a01b0316815260200187878560ff16818110611b1257611b12613fd9565b9050602002016020810190611b279190613a3f565b63ffffffff908116909152825460018101845560009384526020938490208351910180549490930151909116600160a01b026001600160c01b03199093166001600160a01b039091161791909117905580611b8181613fa3565b915050611a9c565b6001600160a01b038216611bf45760405162461bcd60e51b815260206004820152602c60248201527f455243313135355472616461626c652373657443726561746f723a20494e564160448201526b2624a22fa0a2222922a9a99760a11b60648201526084016108f6565b60005b81518110156115d9576000828281518110611c1457611c14613fd9565b60200260200101519050611c2884826125bd565b5080611c3381613f88565b915050611bf7565b60066020528160005260406000208181548110611c5757600080fd5b6000918252602090912001546001600160a01b0381169250600160a01b900463ffffffff16905082565b60008481526004602052604090205484906001600160a01b03163314611cb95760405162461bcd60e51b81526004016108f690613dfd565b611cc6868686868661238a565b505050505050565b6001600160a01b038516331480611cea5750611cea85336107cd565b611d485760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108f6565b610fa88585858585612624565b6003546001600160a01b03163314611d7f5760405162461bcd60e51b81526004016108f690613da0565b6001600160a01b038116611de45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108f6565b6109aa81612338565b60008281526004602052604090205482906001600160a01b03163314611e255760405162461bcd60e51b81526004016108f690613dfd565b61148e84848461274e565b6003546001600160a01b03163314611e5a5760405162461bcd60e51b81526004016108f690613da0565b600091825260096020526040909120805463ffffffff191663ffffffff909216919091179055565b600b5460ff16611ea45760405162461bcd60e51b81526004016108f690613dd5565b60005b8781101561209357611ed0898983818110611ec457611ec4613fd9565b905060200201356120b2565b611eec5760405162461bcd60e51b81526004016108f690613d10565b826201869f1415611f935734858583818110611f0a57611f0a613fd9565b90506020020135600760008c8c86818110611f2757611f27613fd9565b90506020020135815260200190815260200160002054611f479190613ef1565b1115611f8e5760405162461bcd60e51b8152602060048201526016602482015275125b9cdd59999a58da595b9d08199d5b99081cd95b9d60521b60448201526064016108f6565b612001565b6000818152600a602052604090205483148015611fb35750826201869f14155b15611fcb5781858583818110611f0a57611f0a613fd9565b60405162461bcd60e51b815260206004820152600b60248201526a139bdd08105b1b1bddd95960aa1b60448201526064016108f6565b6120608a8a8a8481811061201757612017613fd9565b9050602002013589898581811061203057612030613fd9565b90506020028101906120429190613e4e565b89898781811061205457612054613fd9565b9050602002013561238a565b61208389898381811061207557612075613fd9565b9050602002013584846128ca565b61208c81613f88565b9050611ea7565b50505050505050505050565b8051610cbf906002906020840190612e15565b6000908152600460205260409020546001600160a01b0316151590565b6060600280546120de90613f27565b80601f016020809104026020016040519081016040528092919081815260200182805461210a90613f27565b80156121575780601f1061212c57610100808354040283529160200191612157565b820191906000526020600020905b81548152906001019060200180831161213a57829003601f168201915b50505050509050919050565b81518351146121c55760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108f6565b6001600160a01b0384166121eb5760405162461bcd60e51b81526004016108f690613ccb565b3360005b84518110156122d257600085828151811061220c5761220c613fd9565b60200260200101519050600085838151811061222a5761222a613fd9565b602090810291909101810151600084815280835260408082206001600160a01b038e16835290935291909120549091508181101561227a5760405162461bcd60e51b81526004016108f690613d56565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906122b7908490613eb7565b92505081905550505050806122cb90613f88565b90506121ef565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612322929190613c2e565b60405180910390a4611cc6818787878787612a6c565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612393846120b2565b6123d15760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b60448201526064016108f6565b600b5460ff166123f35760405162461bcd60e51b81526004016108f690613dd5565b811561244e576000848152600860205260409020612412908484612e99565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051612445929190613c5c565b60405180910390a25b61246985858360405180602001604052806000815250612bd7565b8282604051612479929190613b2e565b604051809103902084866001600160a01b03167f704496b72f6d3fd6e462fa31e27faddedde127bc9942bc94320e0c115b00cedf846040516124bd91815260200190565b60405180910390a4600e54610fa8906001600160a01b031660016118be565b816001600160a01b0316836001600160a01b031614156125505760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016108f6565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008181526004602052604090205481906001600160a01b031633146125f55760405162461bcd60e51b81526004016108f690613dfd565b50600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03841661264a5760405162461bcd60e51b81526004016108f690613ccb565b33600061265685612ce2565b9050600061266385612ce2565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156126a65760405162461bcd60e51b81526004016108f690613d56565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906126e3908490613eb7565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612743848a8a8a8a8a612d2d565b505050505050505050565b6001600160a01b0383166127b05760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016108f6565b3360006127bc84612ce2565b905060006127c984612ce2565b60408051602080820183526000918290528882528181528282206001600160a01b038b16835290522054909150848110156128525760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016108f6565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610f0f565b6000826201869f1415612962576000848152600460209081526040808320546009909252909120546001600160a01b03909116906108fc90612710906129169063ffffffff1634613ef1565b6129209190613ecf565b61292a8434613f10565b6129349190613f10565b6040518115909202916000818181858888f1935050505015801561295c573d6000803e3d6000fd5b5061148e565b600084815260096020526040812054612710906129859063ffffffff1685613ef1565b61298f9190613ecf565b6129998385613f10565b6129a39190613f10565b9050600080600f86815481106129bb576129bb613fd9565b600091825260208083209190910180548a84526004928390526040938490205493516323b872dd60e01b815233938101939093526001600160a01b0393841660248401526044830187905292909216935090915082906323b872dd90606401602060405180830381600087803b158015612a3457600080fd5b505af1158015612a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2391906136be565b6001600160a01b0384163b15611cc65760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612ab09089908990889088908890600401613b3e565b602060405180830381600087803b158015612aca57600080fd5b505af1925050508015612afa575060408051601f3d908101601f19168201909252612af7918101906136f8565b60015b612ba757612b06614005565b806308c379a01415612b405750612b1b614020565b80612b265750612b42565b8060405162461bcd60e51b81526004016108f69190613c70565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016108f6565b6001600160e01b0319811663bc197c8160e01b14610f0f5760405162461bcd60e51b81526004016108f690613c83565b6001600160a01b038416612c375760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108f6565b336000612c4385612ce2565b90506000612c5085612ce2565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290612c82908490613eb7565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610f0f83600089898989612d2d565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612d1c57612d1c613fd9565b602090810291909101015292915050565b6001600160a01b0384163b15611cc65760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612d719089908990889088908890600401613b9c565b602060405180830381600087803b158015612d8b57600080fd5b505af1925050508015612dbb575060408051601f3d908101601f19168201909252612db8918101906136f8565b60015b612dc757612b06614005565b6001600160e01b0319811663f23a6e6160e01b14610f0f5760405162461bcd60e51b81526004016108f690613c83565b50805460008255906000526020600020908101906109aa9190612f0d565b828054612e2190613f27565b90600052602060002090601f016020900481019282612e435760008555612e89565b82601f10612e5c57805160ff1916838001178555612e89565b82800160010185558215612e89579182015b82811115612e89578251825591602001919060010190612e6e565b50612e95929150612f2c565b5090565b828054612ea590613f27565b90600052602060002090601f016020900481019282612ec75760008555612e89565b82601f10612ee05782800160ff19823516178555612e89565b82800160010185558215612e89579182015b82811115612e89578235825591602001919060010190612ef2565b5b80821115612e955780546001600160c01b0319168155600101612f0e565b5b80821115612e955760008155600101612f2d565b8035610d07816140a9565b60008083601f840112612f5e57600080fd5b5081356001600160401b03811115612f7557600080fd5b6020830191508360208260051b8501011115612f9057600080fd5b9250929050565b600082601f830112612fa857600080fd5b81356020612fb582613e94565b604051612fc28282613f5c565b8381528281019150858301600585901b87018401881015612fe257600080fd5b60005b8581101561300157813584529284019290840190600101612fe5565b5090979650505050505050565b600082601f83011261301f57600080fd5b81356001600160401b0381111561303857613038613fef565b60405161304f601f8301601f191660200182613f5c565b81815284602083860101111561306457600080fd5b816020850160208301376000918101602001919091529392505050565b60008083601f84011261309357600080fd5b5081356001600160401b038111156130aa57600080fd5b602083019150836020828501011115612f9057600080fd5b803563ffffffff81168114610d0757600080fd5b6000602082840312156130e857600080fd5b8135610bad816140a9565b6000806040838503121561310657600080fd5b8235613111816140a9565b91506020830135613121816140a9565b809150509250929050565b600080600080600060a0868803121561314457600080fd5b853561314f816140a9565b9450602086013561315f816140a9565b935060408601356001600160401b038082111561317b57600080fd5b61318789838a01612f97565b9450606088013591508082111561319d57600080fd5b6131a989838a01612f97565b935060808801359150808211156131bf57600080fd5b506131cc8882890161300e565b9150509295509295909350565b600080600080600060a086880312156131f157600080fd5b85356131fc816140a9565b9450602086013561320c816140a9565b9350604086013592506060860135915060808601356001600160401b0381111561323557600080fd5b6131cc8882890161300e565b60008060006040848603121561325657600080fd5b8335613261816140a9565b925060208401356001600160401b0381111561327c57600080fd5b61328886828701612f4c565b9497909650939450505050565b60008060008060008060006080888a0312156132b057600080fd5b87356132bb816140a9565b965060208801356001600160401b03808211156132d757600080fd5b6132e38b838c01612f4c565b909850965060408a01359150808211156132fc57600080fd5b6133088b838c01612f4c565b909650945060608a013591508082111561332157600080fd5b5061332e8a828b01612f4c565b989b979a50959850939692959293505050565b600080600080600080600080600060c08a8c03121561335f57600080fd5b893561336a816140a9565b985060208a01356001600160401b038082111561338657600080fd5b6133928d838e01612f4c565b909a50985060408c01359150808211156133ab57600080fd5b6133b78d838e01612f4c565b909850965060608c01359150808211156133d057600080fd5b506133dd8c828d01612f4c565b9a9d999c50979a96999598959660808101359660a09091013595509350505050565b6000806040838503121561341257600080fd5b823561341d816140a9565b915060208301356001600160401b0381111561343857600080fd5b61344485828601612f97565b9150509250929050565b6000806040838503121561346157600080fd5b823561346c816140a9565b91506020830135613121816140be565b6000806040838503121561348f57600080fd5b823561349a816140a9565b946020939093013593505050565b6000806000806000608086880312156134c057600080fd5b85356134cb816140a9565b94506020860135935060408601356001600160401b038111156134ed57600080fd5b6134f988828901613081565b96999598509660600135949350505050565b60008060006060848603121561352057600080fd5b833561352b816140a9565b95602085013595506040909401359392505050565b6000806000806000806060878903121561355957600080fd5b86356001600160401b038082111561357057600080fd5b61357c8a838b01612f4c565b9098509650602089013591508082111561359557600080fd5b6135a18a838b01612f4c565b909650945060408901359150808211156135ba57600080fd5b506135c789828a01612f4c565b979a9699509497509295939492505050565b600080604083850312156135ec57600080fd5b82356001600160401b038082111561360357600080fd5b818501915085601f83011261361757600080fd5b8135602061362482613e94565b6040516136318282613f5c565b8381528281019150858301600585901b870184018b101561365157600080fd5b600096505b8487101561367d578035613669816140a9565b835260019690960195918301918301613656565b509650508601359250508082111561369457600080fd5b5061344485828601612f97565b6000602082840312156136b357600080fd5b8135610bad816140be565b6000602082840312156136d057600080fd5b8151610bad816140be565b6000602082840312156136ed57600080fd5b8135610bad816140cc565b60006020828403121561370a57600080fd5b8151610bad816140cc565b60006020828403121561372757600080fd5b81356001600160401b0381111561373d57600080fd5b6137498482850161300e565b949350505050565b60006020828403121561376357600080fd5b5035919050565b60006020828403121561377c57600080fd5b5051919050565b6000806040838503121561379657600080fd5b823591506020830135613121816140a9565b60008060008060008060008060008060006101008c8e0312156137ca57600080fd5b8b359a506137da60208d01612f41565b99506001600160401b038060408e013511156137f557600080fd5b6138058e60408f01358f01613081565b909a50985060608d0135975060808d013581101561382257600080fd5b6138328e60808f01358f01612f4c565b909750955060a08d013581101561384857600080fd5b506138598d60a08e01358e01612f4c565b909450925061386a60c08d016130c2565b915060e08c013590509295989b509295989b9093969950565b6000806000806000806000806000806101008b8d0312156138a357600080fd5b8a35995060208b01356138b5816140a9565b985060408b0135975060608b0135965060808b01356001600160401b03808211156138df57600080fd5b6138eb8e838f01612f4c565b909850965060a08d013591508082111561390457600080fd5b506139118d828e01612f4c565b9095509350613924905060c08c016130c2565b915060e08b013590509295989b9194979a5092959850565b60008060008060006060868803121561395457600080fd5b8535945060208601356001600160401b038082111561397257600080fd5b61397e89838a01612f4c565b9096509450604088013591508082111561399757600080fd5b506139a488828901612f4c565b969995985093965092949392505050565b600080604083850312156139c857600080fd5b8235915060208301356001600160401b038111156139e557600080fd5b6134448582860161300e565b60008060408385031215613a0457600080fd5b50508035926020909101359150565b60008060408385031215613a2657600080fd5b82359150613a36602084016130c2565b90509250929050565b600060208284031215613a5157600080fd5b610bad826130c2565b600060208284031215613a6c57600080fd5b813560ff81168114610bad57600080fd5b600081518084526020808501945080840160005b83811015613aad57815187529582019590820190600101613a91565b509495945050505050565b6000815180845260005b81811015613ade57602081850181015186830182015201613ac2565b81811115613af0576000602083870101525b50601f01601f19169290920160200192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8183823760009101908152919050565b6001600160a01b0386811682528516602082015260a060408201819052600090613b6a90830186613a7d565b8281036060840152613b7c8186613a7d565b90508281036080840152613b908185613ab8565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613bd690830184613ab8565b979650505050505050565b60018060a01b0386168152846020820152608060408201526000613c09608083018587613b05565b90508260608301529695505050505050565b602081526000610bad6020830184613a7d565b604081526000613c416040830185613a7d565b8281036020840152613c538185613a7d565b95945050505050565b602081526000613749602083018486613b05565b602081526000610bad6020830184613ab8565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526026908201527f455243313135355472616461626c65237572693a204e4f4e4558495354454e546040820152652faa27a5a2a760d11b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600e908201526d135a5b9d1a5b99c814185d5cd95960921b604082015260600190565b60208082526031908201527f455243313135355472616461626c652363726561746f724f6e6c793a204f4e4c6040820152701657d0d491505513d497d0531313d5d151607a1b606082015260800190565b6000808335601e19843603018112613e6557600080fd5b8301803591506001600160401b03821115613e7f57600080fd5b602001915036819003821315612f9057600080fd5b60006001600160401b03821115613ead57613ead613fef565b5060051b60200190565b60008219821115613eca57613eca613fc3565b500190565b600082613eec57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615613f0b57613f0b613fc3565b500290565b600082821015613f2257613f22613fc3565b500390565b600181811c90821680613f3b57607f821691505b60208210811415610bb457634e487b7160e01b600052602260045260246000fd5b601f8201601f191681016001600160401b0381118282101715613f8157613f81613fef565b6040525050565b6000600019821415613f9c57613f9c613fc3565b5060010190565b600060ff821660ff811415613fba57613fba613fc3565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156116a55760046000803e5060005160e01c90565b600060443d101561402e5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561405d57505050505090565b82850191508151818111156140755750505050505090565b843d870101602082850101111561408f5750505050505090565b61409e60208286010187613f5c565b509095945050505050565b6001600160a01b03811681146109aa57600080fd5b80151581146109aa57600080fd5b6001600160e01b0319811681146109aa57600080fdfea2646970667358221220b70abd16f93754b5be92e16e7eeba4cd6daff89571c75534555322b2da0d152e64736f6c63430008070033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000002462cc77b61dc05459cbc5c4d77465707a35bd7300000000000000000000000000000000000000000000000000000000000000084c756e6120536b7900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074c756e61536b7900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001368747470733a2f2f6c756e61736b792e636f6d00000000000000000000000000

Deployed Bytecode

0x6080604052600436106102665760003560e01c80638da5cb5b11610144578063d128d017116100b6578063e985e9c51161007a578063e985e9c5146107b2578063f242432a146107fb578063f2fde38b1461081b578063f5298aca1461083b578063f669b2631461085b578063f9dd3f5a1461087b57600080fd5b8063d128d017146106ee578063d2a6b51a1461070e578063daa17f491461072e578063dc9405b41461074e578063e53db90d1461079257600080fd5b8063a22cb46511610108578063a22cb4651461060b578063b47cc5561461062b578063bac0545d1461064b578063bd85b0391461066b578063cca4d25014610698578063cd53d08e146106b857600080fd5b80638da5cb5b1461058e5780638fb4bd1d146105ac57806395801044146105c157806395d89b41146105d65780639c5ded7b146105eb57600080fd5b80632a36c108116101dd5780634e1273f4116101a15780634e1273f4146104d95780634f558e791461050657806350baa62214610526578063715018a614610539578063749bfcbc1461054e5780638ab234b61461056e57600080fd5b80632a36c108146104395780632eb2c2d61461045957806331d703661461047957806339e95f5d146104995780633adf80b4146104b957600080fd5b8063155dd5ee1161022f578063155dd5ee14610332578063237af259146103525780632693ebf21461038757806326c91cad146103b457806327e32d0b146103ec57806328ea16631461041957600080fd5b8062fdd58e1461026b57806301ffc9a71461029e57806302fe5305146102ce57806306fdde03146102f05780630e89341c14610312575b600080fd5b34801561027757600080fd5b5061028b61028636600461347c565b61088e565b6040519081526020015b60405180910390f35b3480156102aa57600080fd5b506102be6102b93660046136db565b610925565b6040519015158152602001610295565b3480156102da57600080fd5b506102ee6102e9366004613715565b610977565b005b3480156102fc57600080fd5b506103056109ad565b6040516102959190613c70565b34801561031e57600080fd5b5061030561032d366004613751565b610a3b565b34801561033e57600080fd5b506102ee61034d366004613751565b610bba565b34801561035e57600080fd5b5061037261036d366004613751565b610cc3565b60405163ffffffff9091168152602001610295565b34801561039357600080fd5b5061028b6103a2366004613751565b60056020526000908152604090205481565b3480156103c057600080fd5b506103d46103cf366004613751565b610d0c565b6040516001600160a01b039091168152602001610295565b3480156103f857600080fd5b5061028b610407366004613751565b60076020526000908152604090205481565b34801561042557600080fd5b506102ee610434366004613295565b610d36565b34801561044557600080fd5b506102ee610454366004613540565b610e2d565b34801561046557600080fd5b506102ee61047436600461312c565b610f18565b34801561048557600080fd5b506102ee6104943660046136a1565b610faf565b3480156104a557600080fd5b506102ee6104b436600461393c565b610ff3565b3480156104c557600080fd5b506102ee6104d43660046139b5565b611176565b3480156104e557600080fd5b506104f96104f43660046135d9565b61120b565b6040516102959190613c1b565b34801561051257600080fd5b506102be610521366004613751565b611334565b6102ee610534366004613751565b61133f565b34801561054557600080fd5b506102ee611494565b34801561055a57600080fd5b506102ee610569366004613783565b6114ca565b34801561057a57600080fd5b506102ee6105893660046130d6565b6115de565b34801561059a57600080fd5b506003546001600160a01b03166103d4565b3480156105b857600080fd5b506102be61166b565b3480156105cd57600080fd5b506102be6116a8565b3480156105e257600080fd5b506103056116df565b3480156105f757600080fd5b506102ee6106063660046137a8565b6116ec565b34801561061757600080fd5b506102ee61062636600461344e565b6118be565b34801561063757600080fd5b506102ee6106463660046130d6565b6118c9565b34801561065757600080fd5b506102ee610666366004613241565b611915565b34801561067757600080fd5b5061028b610686366004613751565b60009081526005602052604090205490565b3480156106a457600080fd5b506102ee6106b33660046136a1565b6119ad565b3480156106c457600080fd5b506103d46106d3366004613751565b6004602052600090815260409020546001600160a01b031681565b3480156106fa57600080fd5b506102ee610709366004613883565b6119ea565b34801561071a57600080fd5b506102ee6107293660046133ff565b611b89565b34801561073a57600080fd5b50600e546103d4906001600160a01b031681565b34801561075a57600080fd5b5061076e6107693660046139f1565b611c3b565b604080516001600160a01b03909316835263ffffffff909116602083015201610295565b34801561079e57600080fd5b506102ee6107ad3660046134a8565b611c81565b3480156107be57600080fd5b506102be6107cd3660046130f3565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561080757600080fd5b506102ee6108163660046131d9565b611cce565b34801561082757600080fd5b506102ee6108363660046130d6565b611d55565b34801561084757600080fd5b506102ee61085636600461350b565b611ded565b34801561086757600080fd5b506102ee610876366004613a13565b611e30565b6102ee610889366004613341565b611e82565b60006001600160a01b0383166108ff5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061095657506001600160e01b031982166303a24d0760e21b145b8061097157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6003546001600160a01b031633146109a15760405162461bcd60e51b81526004016108f690613da0565b6109aa8161209f565b50565b600c80546109ba90613f27565b80601f01602080910402602001604051908101604052809291908181526020018280546109e690613f27565b8015610a335780601f10610a0857610100808354040283529160200191610a33565b820191906000526020600020905b815481529060010190602001808311610a1657829003601f168201915b505050505081565b6060610a46826120b2565b610a625760405162461bcd60e51b81526004016108f690613d10565b60008281526008602052604081208054610a7b90613f27565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa790613f27565b8015610af45780601f10610ac957610100808354040283529160200191610af4565b820191906000526020600020905b815481529060010190602001808311610ad757829003601f168201915b50505050509050600081511115610ba45760008381526008602052604090208054610b1e90613f27565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4a90613f27565b8015610b975780601f10610b6c57610100808354040283529160200191610b97565b820191906000526020600020905b815481529060010190602001808311610b7a57829003601f168201915b5050505050915050919050565b610bad836120cf565b9392505050565b50919050565b6003546001600160a01b03163314610be45760405162461bcd60e51b81526004016108f690613da0565b600047118015610bf45750478111155b610c345760405162461bcd60e51b8152602060048201526011602482015270125b9cdd59999a58da595b9d08119d5b99607a1b60448201526064016108f6565b604051600090339083908381818185875af1925050503d8060008114610c76576040519150601f19603f3d011682016040523d82523d6000602084013e610c7b565b606091505b5050905080610cbf5760405162461bcd60e51b815260206004820152601060248201526f2bb4ba34323930bb903330b4b632b21760811b60448201526064016108f6565b5050565b6003546000906001600160a01b03163314610cf05760405162461bcd60e51b81526004016108f690613da0565b5060008181526009602052604090205463ffffffff165b919050565b600f8181548110610d1c57600080fd5b6000918252602090912001546001600160a01b0316905081565b600b5460ff16610d585760405162461bcd60e51b81526004016108f690613dd5565b60005b85811015610e23573063e53db90d89898985818110610d7c57610d7c613fd9565b90506020020135888886818110610d9557610d95613fd9565b9050602002810190610da79190613e4e565b888888818110610db957610db9613fd9565b905060200201356040518663ffffffff1660e01b8152600401610de0959493929190613be1565b600060405180830381600087803b158015610dfa57600080fd5b505af1158015610e0e573d6000803e3d6000fd5b5050505080610e1c90613f88565b9050610d5b565b5050505050505050565b60005b83811015610f0f573063f5298aca888884818110610e5057610e50613fd9565b9050602002016020810190610e6591906130d6565b878785818110610e7757610e77613fd9565b90506020020135868686818110610e9057610e90613fd9565b6040516001600160e01b031960e088901b1681526001600160a01b039095166004860152602485019390935250602090910201356044820152606401600060405180830381600087803b158015610ee657600080fd5b505af1158015610efa573d6000803e3d6000fd5b5050505080610f0890613f88565b9050610e30565b50505050505050565b6001600160a01b038516331480610f345750610f3485336107cd565b610f9b5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b60648201526084016108f6565b610fa88585858585612163565b5050505050565b6003546001600160a01b03163314610fd95760405162461bcd60e51b81526004016108f690613da0565b600b80549115156101000261ff0019909216919091179055565b60008581526004602052604090205485906001600160a01b0316331461102b5760405162461bcd60e51b81526004016108f690613dfd565b611034866120b2565b6110725760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b60448201526064016108f6565b600086815260066020526040812061108991612df7565b60005b60ff8116851115610f0f5760066000888152602001908152602001600020604051806040016040528088888560ff168181106110ca576110ca613fd9565b90506020020160208101906110df91906130d6565b6001600160a01b0316815260200186868560ff1681811061110257611102613fd9565b90506020020160208101906111179190613a5a565b60ff16905281546001810183556000928352602092839020825191018054939092015163ffffffff16600160a01b026001600160c01b03199093166001600160a01b03909116179190911790558061116e81613fa3565b91505061108c565b60008281526004602052604090205482906001600160a01b031633146111ae5760405162461bcd60e51b81526004016108f690613dfd565b600083815260086020908152604090912083516111cd92850190612e15565b50827f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b836040516111fe9190613c70565b60405180910390a2505050565b606081518351146112705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016108f6565b600083516001600160401b0381111561128b5761128b613fef565b6040519080825280602002602001820160405280156112b4578160200160208202803683370190505b50905060005b845181101561132c576112ff8582815181106112d8576112d8613fd9565b60200260200101518583815181106112f2576112f2613fd9565b602002602001015161088e565b82828151811061131157611311613fd9565b602090810291909101015261132581613f88565b90506112ba565b509392505050565b6000610971826120b2565b6003546001600160a01b031633146113695760405162461bcd60e51b81526004016108f690613da0565b6000600f828154811061137e5761137e613fd9565b600091825260209091200180546040516370a0823160e01b81523060048201529192506001600160a01b031690819063a9059cbb90339083906370a082319060240160206040518083038186803b1580156113d857600080fd5b505afa1580156113ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611410919061376a565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561145657600080fd5b505af115801561146a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148e91906136be565b50505050565b6003546001600160a01b031633146114be5760405162461bcd60e51b81526004016108f690613da0565b6114c86000612338565b565b6003546001600160a01b031633146114f45760405162461bcd60e51b81526004016108f690613da0565b6000471180156115045750478211155b6115445760405162461bcd60e51b8152602060048201526011602482015270125b9cdd59999a58da595b9d08119d5b99607a1b60448201526064016108f6565b6000816001600160a01b03168360405160006040518083038185875af1925050503d8060008114611591576040519150601f19603f3d011682016040523d82523d6000602084013e611596565b606091505b50509050806115d95760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8811985a5b1959608a1b60448201526064016108f6565b505050565b6003546001600160a01b031633146116085760405162461bcd60e51b81526004016108f690613da0565b60408051602081019091526001600160a01b039182168152600f805460018101825560009190915290517f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290910180546001600160a01b03191691909216179055565b6003546000906001600160a01b031633146116985760405162461bcd60e51b81526004016108f690613da0565b50600b54610100900460ff165b90565b6003546000906001600160a01b031633146116d55760405162461bcd60e51b81526004016108f690613da0565b50600b5460ff1690565b600d80546109ba90613f27565b600b5460ff1661170e5760405162461bcd60e51b81526004016108f690613dd5565b6117178b6120b2565b1561175d5760405162461bcd60e51b8152602060048201526016602482015275746f6b656e496420616c72656164792065786973747360501b60448201526064016108f6565b60008b81526005602090815260408083208a90556004825280832080546001600160a01b0319166001600160a01b038f1617905560098252808320805463ffffffff191663ffffffff8716179055600a90915281208290555b60ff81168611156118a357600660008d8152602001908152602001600020604051806040016040528089898560ff168181106117f4576117f4613fd9565b905060200201602081019061180991906130d6565b6001600160a01b0316815260200187878560ff1681811061182c5761182c613fd9565b90506020020160208101906118419190613a3f565b63ffffffff908116909152825460018101845560009384526020938490208351910180549490930151909116600160a01b026001600160c01b03199093166001600160a01b03909116179190911790558061189b81613fa3565b9150506117b6565b506118b18a8c8b8b8b61238a565b5050505050505050505050565b610cbf3383836124dc565b6003546001600160a01b031633146118f35760405162461bcd60e51b81526004016108f690613da0565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b0316331461193f5760405162461bcd60e51b81526004016108f690613da0565b60005b8181101561148e57836004600085858581811061196157611961613fd9565b90506020020135815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080806119a590613f88565b915050611942565b6003546001600160a01b031633146119d75760405162461bcd60e51b81526004016108f690613da0565b600b805460ff1916911515919091179055565b6119f38a6120b2565b15611a395760405162461bcd60e51b8152602060048201526016602482015275746f6b656e496420616c72656164792065786973747360501b60448201526064016108f6565b60008a81526005602090815260408083208a90556004825280832080546001600160a01b0319166001600160a01b038e16179055600782528083208b905560098252808320805463ffffffff191663ffffffff8716179055600a90915281208290555b60ff81168611156118b157600660008c8152602001908152602001600020604051806040016040528089898560ff16818110611ada57611ada613fd9565b9050602002016020810190611aef91906130d6565b6001600160a01b0316815260200187878560ff16818110611b1257611b12613fd9565b9050602002016020810190611b279190613a3f565b63ffffffff908116909152825460018101845560009384526020938490208351910180549490930151909116600160a01b026001600160c01b03199093166001600160a01b039091161791909117905580611b8181613fa3565b915050611a9c565b6001600160a01b038216611bf45760405162461bcd60e51b815260206004820152602c60248201527f455243313135355472616461626c652373657443726561746f723a20494e564160448201526b2624a22fa0a2222922a9a99760a11b60648201526084016108f6565b60005b81518110156115d9576000828281518110611c1457611c14613fd9565b60200260200101519050611c2884826125bd565b5080611c3381613f88565b915050611bf7565b60066020528160005260406000208181548110611c5757600080fd5b6000918252602090912001546001600160a01b0381169250600160a01b900463ffffffff16905082565b60008481526004602052604090205484906001600160a01b03163314611cb95760405162461bcd60e51b81526004016108f690613dfd565b611cc6868686868661238a565b505050505050565b6001600160a01b038516331480611cea5750611cea85336107cd565b611d485760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b60648201526084016108f6565b610fa88585858585612624565b6003546001600160a01b03163314611d7f5760405162461bcd60e51b81526004016108f690613da0565b6001600160a01b038116611de45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108f6565b6109aa81612338565b60008281526004602052604090205482906001600160a01b03163314611e255760405162461bcd60e51b81526004016108f690613dfd565b61148e84848461274e565b6003546001600160a01b03163314611e5a5760405162461bcd60e51b81526004016108f690613da0565b600091825260096020526040909120805463ffffffff191663ffffffff909216919091179055565b600b5460ff16611ea45760405162461bcd60e51b81526004016108f690613dd5565b60005b8781101561209357611ed0898983818110611ec457611ec4613fd9565b905060200201356120b2565b611eec5760405162461bcd60e51b81526004016108f690613d10565b826201869f1415611f935734858583818110611f0a57611f0a613fd9565b90506020020135600760008c8c86818110611f2757611f27613fd9565b90506020020135815260200190815260200160002054611f479190613ef1565b1115611f8e5760405162461bcd60e51b8152602060048201526016602482015275125b9cdd59999a58da595b9d08199d5b99081cd95b9d60521b60448201526064016108f6565b612001565b6000818152600a602052604090205483148015611fb35750826201869f14155b15611fcb5781858583818110611f0a57611f0a613fd9565b60405162461bcd60e51b815260206004820152600b60248201526a139bdd08105b1b1bddd95960aa1b60448201526064016108f6565b6120608a8a8a8481811061201757612017613fd9565b9050602002013589898581811061203057612030613fd9565b90506020028101906120429190613e4e565b89898781811061205457612054613fd9565b9050602002013561238a565b61208389898381811061207557612075613fd9565b9050602002013584846128ca565b61208c81613f88565b9050611ea7565b50505050505050505050565b8051610cbf906002906020840190612e15565b6000908152600460205260409020546001600160a01b0316151590565b6060600280546120de90613f27565b80601f016020809104026020016040519081016040528092919081815260200182805461210a90613f27565b80156121575780601f1061212c57610100808354040283529160200191612157565b820191906000526020600020905b81548152906001019060200180831161213a57829003601f168201915b50505050509050919050565b81518351146121c55760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016108f6565b6001600160a01b0384166121eb5760405162461bcd60e51b81526004016108f690613ccb565b3360005b84518110156122d257600085828151811061220c5761220c613fd9565b60200260200101519050600085838151811061222a5761222a613fd9565b602090810291909101810151600084815280835260408082206001600160a01b038e16835290935291909120549091508181101561227a5760405162461bcd60e51b81526004016108f690613d56565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906122b7908490613eb7565b92505081905550505050806122cb90613f88565b90506121ef565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612322929190613c2e565b60405180910390a4611cc6818787878787612a6c565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612393846120b2565b6123d15760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b60448201526064016108f6565b600b5460ff166123f35760405162461bcd60e51b81526004016108f690613dd5565b811561244e576000848152600860205260409020612412908484612e99565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051612445929190613c5c565b60405180910390a25b61246985858360405180602001604052806000815250612bd7565b8282604051612479929190613b2e565b604051809103902084866001600160a01b03167f704496b72f6d3fd6e462fa31e27faddedde127bc9942bc94320e0c115b00cedf846040516124bd91815260200190565b60405180910390a4600e54610fa8906001600160a01b031660016118be565b816001600160a01b0316836001600160a01b031614156125505760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016108f6565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008181526004602052604090205481906001600160a01b031633146125f55760405162461bcd60e51b81526004016108f690613dfd565b50600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03841661264a5760405162461bcd60e51b81526004016108f690613ccb565b33600061265685612ce2565b9050600061266385612ce2565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156126a65760405162461bcd60e51b81526004016108f690613d56565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906126e3908490613eb7565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612743848a8a8a8a8a612d2d565b505050505050505050565b6001600160a01b0383166127b05760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016108f6565b3360006127bc84612ce2565b905060006127c984612ce2565b60408051602080820183526000918290528882528181528282206001600160a01b038b16835290522054909150848110156128525760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016108f6565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610f0f565b6000826201869f1415612962576000848152600460209081526040808320546009909252909120546001600160a01b03909116906108fc90612710906129169063ffffffff1634613ef1565b6129209190613ecf565b61292a8434613f10565b6129349190613f10565b6040518115909202916000818181858888f1935050505015801561295c573d6000803e3d6000fd5b5061148e565b600084815260096020526040812054612710906129859063ffffffff1685613ef1565b61298f9190613ecf565b6129998385613f10565b6129a39190613f10565b9050600080600f86815481106129bb576129bb613fd9565b600091825260208083209190910180548a84526004928390526040938490205493516323b872dd60e01b815233938101939093526001600160a01b0393841660248401526044830187905292909216935090915082906323b872dd90606401602060405180830381600087803b158015612a3457600080fd5b505af1158015612a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2391906136be565b6001600160a01b0384163b15611cc65760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612ab09089908990889088908890600401613b3e565b602060405180830381600087803b158015612aca57600080fd5b505af1925050508015612afa575060408051601f3d908101601f19168201909252612af7918101906136f8565b60015b612ba757612b06614005565b806308c379a01415612b405750612b1b614020565b80612b265750612b42565b8060405162461bcd60e51b81526004016108f69190613c70565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016108f6565b6001600160e01b0319811663bc197c8160e01b14610f0f5760405162461bcd60e51b81526004016108f690613c83565b6001600160a01b038416612c375760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016108f6565b336000612c4385612ce2565b90506000612c5085612ce2565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290612c82908490613eb7565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610f0f83600089898989612d2d565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612d1c57612d1c613fd9565b602090810291909101015292915050565b6001600160a01b0384163b15611cc65760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612d719089908990889088908890600401613b9c565b602060405180830381600087803b158015612d8b57600080fd5b505af1925050508015612dbb575060408051601f3d908101601f19168201909252612db8918101906136f8565b60015b612dc757612b06614005565b6001600160e01b0319811663f23a6e6160e01b14610f0f5760405162461bcd60e51b81526004016108f690613c83565b50805460008255906000526020600020908101906109aa9190612f0d565b828054612e2190613f27565b90600052602060002090601f016020900481019282612e435760008555612e89565b82601f10612e5c57805160ff1916838001178555612e89565b82800160010185558215612e89579182015b82811115612e89578251825591602001919060010190612e6e565b50612e95929150612f2c565b5090565b828054612ea590613f27565b90600052602060002090601f016020900481019282612ec75760008555612e89565b82601f10612ee05782800160ff19823516178555612e89565b82800160010185558215612e89579182015b82811115612e89578235825591602001919060010190612ef2565b5b80821115612e955780546001600160c01b0319168155600101612f0e565b5b80821115612e955760008155600101612f2d565b8035610d07816140a9565b60008083601f840112612f5e57600080fd5b5081356001600160401b03811115612f7557600080fd5b6020830191508360208260051b8501011115612f9057600080fd5b9250929050565b600082601f830112612fa857600080fd5b81356020612fb582613e94565b604051612fc28282613f5c565b8381528281019150858301600585901b87018401881015612fe257600080fd5b60005b8581101561300157813584529284019290840190600101612fe5565b5090979650505050505050565b600082601f83011261301f57600080fd5b81356001600160401b0381111561303857613038613fef565b60405161304f601f8301601f191660200182613f5c565b81815284602083860101111561306457600080fd5b816020850160208301376000918101602001919091529392505050565b60008083601f84011261309357600080fd5b5081356001600160401b038111156130aa57600080fd5b602083019150836020828501011115612f9057600080fd5b803563ffffffff81168114610d0757600080fd5b6000602082840312156130e857600080fd5b8135610bad816140a9565b6000806040838503121561310657600080fd5b8235613111816140a9565b91506020830135613121816140a9565b809150509250929050565b600080600080600060a0868803121561314457600080fd5b853561314f816140a9565b9450602086013561315f816140a9565b935060408601356001600160401b038082111561317b57600080fd5b61318789838a01612f97565b9450606088013591508082111561319d57600080fd5b6131a989838a01612f97565b935060808801359150808211156131bf57600080fd5b506131cc8882890161300e565b9150509295509295909350565b600080600080600060a086880312156131f157600080fd5b85356131fc816140a9565b9450602086013561320c816140a9565b9350604086013592506060860135915060808601356001600160401b0381111561323557600080fd5b6131cc8882890161300e565b60008060006040848603121561325657600080fd5b8335613261816140a9565b925060208401356001600160401b0381111561327c57600080fd5b61328886828701612f4c565b9497909650939450505050565b60008060008060008060006080888a0312156132b057600080fd5b87356132bb816140a9565b965060208801356001600160401b03808211156132d757600080fd5b6132e38b838c01612f4c565b909850965060408a01359150808211156132fc57600080fd5b6133088b838c01612f4c565b909650945060608a013591508082111561332157600080fd5b5061332e8a828b01612f4c565b989b979a50959850939692959293505050565b600080600080600080600080600060c08a8c03121561335f57600080fd5b893561336a816140a9565b985060208a01356001600160401b038082111561338657600080fd5b6133928d838e01612f4c565b909a50985060408c01359150808211156133ab57600080fd5b6133b78d838e01612f4c565b909850965060608c01359150808211156133d057600080fd5b506133dd8c828d01612f4c565b9a9d999c50979a96999598959660808101359660a09091013595509350505050565b6000806040838503121561341257600080fd5b823561341d816140a9565b915060208301356001600160401b0381111561343857600080fd5b61344485828601612f97565b9150509250929050565b6000806040838503121561346157600080fd5b823561346c816140a9565b91506020830135613121816140be565b6000806040838503121561348f57600080fd5b823561349a816140a9565b946020939093013593505050565b6000806000806000608086880312156134c057600080fd5b85356134cb816140a9565b94506020860135935060408601356001600160401b038111156134ed57600080fd5b6134f988828901613081565b96999598509660600135949350505050565b60008060006060848603121561352057600080fd5b833561352b816140a9565b95602085013595506040909401359392505050565b6000806000806000806060878903121561355957600080fd5b86356001600160401b038082111561357057600080fd5b61357c8a838b01612f4c565b9098509650602089013591508082111561359557600080fd5b6135a18a838b01612f4c565b909650945060408901359150808211156135ba57600080fd5b506135c789828a01612f4c565b979a9699509497509295939492505050565b600080604083850312156135ec57600080fd5b82356001600160401b038082111561360357600080fd5b818501915085601f83011261361757600080fd5b8135602061362482613e94565b6040516136318282613f5c565b8381528281019150858301600585901b870184018b101561365157600080fd5b600096505b8487101561367d578035613669816140a9565b835260019690960195918301918301613656565b509650508601359250508082111561369457600080fd5b5061344485828601612f97565b6000602082840312156136b357600080fd5b8135610bad816140be565b6000602082840312156136d057600080fd5b8151610bad816140be565b6000602082840312156136ed57600080fd5b8135610bad816140cc565b60006020828403121561370a57600080fd5b8151610bad816140cc565b60006020828403121561372757600080fd5b81356001600160401b0381111561373d57600080fd5b6137498482850161300e565b949350505050565b60006020828403121561376357600080fd5b5035919050565b60006020828403121561377c57600080fd5b5051919050565b6000806040838503121561379657600080fd5b823591506020830135613121816140a9565b60008060008060008060008060008060006101008c8e0312156137ca57600080fd5b8b359a506137da60208d01612f41565b99506001600160401b038060408e013511156137f557600080fd5b6138058e60408f01358f01613081565b909a50985060608d0135975060808d013581101561382257600080fd5b6138328e60808f01358f01612f4c565b909750955060a08d013581101561384857600080fd5b506138598d60a08e01358e01612f4c565b909450925061386a60c08d016130c2565b915060e08c013590509295989b509295989b9093969950565b6000806000806000806000806000806101008b8d0312156138a357600080fd5b8a35995060208b01356138b5816140a9565b985060408b0135975060608b0135965060808b01356001600160401b03808211156138df57600080fd5b6138eb8e838f01612f4c565b909850965060a08d013591508082111561390457600080fd5b506139118d828e01612f4c565b9095509350613924905060c08c016130c2565b915060e08b013590509295989b9194979a5092959850565b60008060008060006060868803121561395457600080fd5b8535945060208601356001600160401b038082111561397257600080fd5b61397e89838a01612f4c565b9096509450604088013591508082111561399757600080fd5b506139a488828901612f4c565b969995985093965092949392505050565b600080604083850312156139c857600080fd5b8235915060208301356001600160401b038111156139e557600080fd5b6134448582860161300e565b60008060408385031215613a0457600080fd5b50508035926020909101359150565b60008060408385031215613a2657600080fd5b82359150613a36602084016130c2565b90509250929050565b600060208284031215613a5157600080fd5b610bad826130c2565b600060208284031215613a6c57600080fd5b813560ff81168114610bad57600080fd5b600081518084526020808501945080840160005b83811015613aad57815187529582019590820190600101613a91565b509495945050505050565b6000815180845260005b81811015613ade57602081850181015186830182015201613ac2565b81811115613af0576000602083870101525b50601f01601f19169290920160200192915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8183823760009101908152919050565b6001600160a01b0386811682528516602082015260a060408201819052600090613b6a90830186613a7d565b8281036060840152613b7c8186613a7d565b90508281036080840152613b908185613ab8565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613bd690830184613ab8565b979650505050505050565b60018060a01b0386168152846020820152608060408201526000613c09608083018587613b05565b90508260608301529695505050505050565b602081526000610bad6020830184613a7d565b604081526000613c416040830185613a7d565b8281036020840152613c538185613a7d565b95945050505050565b602081526000613749602083018486613b05565b602081526000610bad6020830184613ab8565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526026908201527f455243313135355472616461626c65237572693a204e4f4e4558495354454e546040820152652faa27a5a2a760d11b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600e908201526d135a5b9d1a5b99c814185d5cd95960921b604082015260600190565b60208082526031908201527f455243313135355472616461626c652363726561746f724f6e6c793a204f4e4c6040820152701657d0d491505513d497d0531313d5d151607a1b606082015260800190565b6000808335601e19843603018112613e6557600080fd5b8301803591506001600160401b03821115613e7f57600080fd5b602001915036819003821315612f9057600080fd5b60006001600160401b03821115613ead57613ead613fef565b5060051b60200190565b60008219821115613eca57613eca613fc3565b500190565b600082613eec57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615613f0b57613f0b613fc3565b500290565b600082821015613f2257613f22613fc3565b500390565b600181811c90821680613f3b57607f821691505b60208210811415610bb457634e487b7160e01b600052602260045260246000fd5b601f8201601f191681016001600160401b0381118282101715613f8157613f81613fef565b6040525050565b6000600019821415613f9c57613f9c613fc3565b5060010190565b600060ff821660ff811415613fba57613fba613fc3565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156116a55760046000803e5060005160e01c90565b600060443d101561402e5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561405d57505050505090565b82850191508151818111156140755750505050505090565b843d870101602082850101111561408f5750505050505090565b61409e60208286010187613f5c565b509095945050505050565b6001600160a01b03811681146109aa57600080fd5b80151581146109aa57600080fd5b6001600160e01b0319811681146109aa57600080fdfea2646970667358221220b70abd16f93754b5be92e16e7eeba4cd6daff89571c75534555322b2da0d152e64736f6c63430008070033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000002462cc77b61dc05459cbc5c4d77465707a35bd7300000000000000000000000000000000000000000000000000000000000000084c756e6120536b7900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074c756e61536b7900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001368747470733a2f2f6c756e61736b792e636f6d00000000000000000000000000

-----Decoded View---------------
Arg [0] : _name (string): Luna Sky
Arg [1] : _symbol (string): LunaSky
Arg [2] : _uri (string): https://lunasky.com
Arg [3] : _marketplaceAddress (address): 0x2462Cc77b61DC05459cbc5C4d77465707A35bD73

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000002462cc77b61dc05459cbc5c4d77465707a35bd73
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [5] : 4c756e6120536b79000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [7] : 4c756e61536b7900000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000013
Arg [9] : 68747470733a2f2f6c756e61736b792e636f6d00000000000000000000000000


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.