ETH Price: $3,388.28 (+0.93%)
Gas: 5.47 Gwei

Token

MetaCity (METACITY)
 

Overview

Max Total Supply

187 METACITY

Holders

23

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Balance
3 METACITY
0x3c5a1d9296194b675cdb2910839c08719fa10bf7
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:
Metacity

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 26 : Metacity.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.13;

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./ERC721Opensea.sol";
import "./utils/Helpers.sol";
import "./utils/Security.sol";
import "./Interfaces/IMetacity.sol";
import "./Interfaces/ITraits.sol";
import "./CITY.sol";


contract Metacity is IMetacity, ERC721Opensea, Ownable, Pausable, ReentrancyGuard, Security {

  using ECDSA for bytes32;

  uint256 public startTime = 1669053600; // Monday, November 21, 2022 18:00:00

  // first round
  uint256 public constant firstRoundSupply = 5000;
  uint256 public constant firstRoundPrice = 0.02 ether; // ETH
  uint256 public constant firstRoundMaxWlPerUser = 3;
  // second round
  uint256 public constant secondRoundSupply = 800;
  uint256 public secondRoundPrice = 1 ether; // ETH
  // third round
  uint256 public thirdRoundPrice = 500 ether; // CITY

  uint256 public constant ratChance = 10; // percentage

  uint256 public maxSupply = 15_800;

  // open / close rounds
  bool public firstRoundOpen = true;
  bool public secondRoundOpen = false;
  bool public thirdRoundOpen = false;
  // wl
  bool public wlOnly = true;

  // saving for max per round
  mapping(address => uint256) public firstRoundWlMints;
  mapping(address => bool) public secondRoundMinted;

  // number of tokens that have been minted
  uint16 public totalSupply;
  // mapping from tokenId to an array containing the token's traits
  mapping(uint256 => uint256[]) private tokenTraits;
  // mapping from tokenId to bool isZen
  mapping(uint256 => bool) private isZens;
  // mapping from hashed(tokenTrait) to the tokenId it's associated with
  // used to ensure there are no duplicates
  mapping(uint256 => uint256) public existingCombinations;
  // mint block per token id
  mapping(uint256 => uint256) public mintBlocks;
  // allowed to add traits after mint in game / shop
  mapping(address => bool) public controllers;
  // allowed to sign whitelist addresses
  mapping(address => bool) private signers;
  // reference to $CITY for mint
  CITY public city;
  // reference to Traits
  ITraits public traits;

  /// @dev instantiates contract and rarity tables
  constructor(address _city, address _traits) ERC721Opensea("MetaCity", 'METACITY') { 
    city = CITY(_city);
    traits = ITraits(_traits);
  }

  /** EXTERNAL */

  function mintGen0(uint256 amount, bytes memory sig) external payable nonReentrant whenNotPaused {
    require(block.timestamp >= startTime, "Sale haven't started yet");
    require(firstRoundOpen, "Round is closed");
    require(amount > 0 && totalSupply + amount <= firstRoundSupply, "Round ended");
    require(amount * firstRoundPrice == msg.value, "Invalid payment amount");
    if (wlOnly) {
      require(isWhitelisted(_msgSender(), sig), "Address is not whitelisted");
      require(amount + firstRoundWlMints[_msgSender()] <= firstRoundMaxWlPerUser, "Invalid mint amount"); // max per mint
      firstRoundWlMints[_msgSender()] += amount;
    }

    _mint(amount, ratChance);
  }

  function mintGen1(bytes memory sig) external payable nonReentrant whenNotPaused {
    require(totalSupply >= firstRoundSupply, "Round not started yet");
    require(secondRoundOpen, "Round is closed");
    require(totalSupply + 1 <= (firstRoundSupply + secondRoundSupply), "Round ended");
    require(secondRoundPrice == msg.value, "Invalid payment amount");
    require(!secondRoundMinted[_msgSender()], "Already minted");
    if (wlOnly) {
      require(isWhitelisted(_msgSender(), sig), "Address is not whitelisted");
    }
    secondRoundMinted[_msgSender()] = true;

    _mint(1, 100);
  }

  function mintGen2(uint256 amount) external nonReentrant whenNotPaused {
    require(thirdRoundOpen, "Round is closed");
    require(totalSupply >= (firstRoundSupply + secondRoundSupply), "Round not started yet");
    require(amount > 0 && totalSupply + amount <= maxSupply, "Round ended");

    // payment
    uint256 totalCityCost = amount * thirdRoundPrice;
    city.transferFrom(_msgSender(), address(this), totalCityCost);

    _mint(amount, ratChance);
  }

  function _mint(uint256 amount, uint256 _ratChance) internal {
    uint256 seed;
    for (uint i = 0; i < amount; i++) {
      totalSupply++;
      seed = Helpers.random(totalSupply);
      bool _isZen = (seed & 0xFFFF) % 100 >= _ratChance; // % getting a rat
      generate(totalSupply, seed, _isZen);
      mintBlocks[totalSupply] = block.number;
      _safeMint(_msgSender(), totalSupply);
    }
  }

  /** INTERNAL */

  /**
   * generates traits for a specific token, checking to make sure it's unique
   * @param tokenId the id of the token to generate traits for
   * @param seed a pseudorandom 256 bit number to derive traits from
   */
  function generate(uint256 tokenId, uint256 seed, bool _isZen) internal {
    uint256[] memory t = traits.selectTraits(seed, _isZen);
    isZens[tokenId] = _isZen;
    if (_isZen) { // zens are unique
      uint256 traitsHash = uint256(keccak256(abi.encodePacked(t)));
      if (existingCombinations[traitsHash] == 0) {
        tokenTraits[tokenId] = t;
        existingCombinations[traitsHash] = tokenId;
        return;
      } else {
        return generate(tokenId, Helpers.random(seed), _isZen);
      }
    } else {
      tokenTraits[tokenId] = t;
      return;
    }
  }

  function setTrait(uint256 tokenId, uint256 traitIdx, uint256 traitValue) external {
    require(controllers[_msgSender()], "Only controllers can add traits");
    require(tokenTraits[tokenId].length >= traitIdx, "Trait index invalid");

    if (tokenTraits[tokenId].length == traitIdx) { // new trait
      tokenTraits[tokenId].push(traitValue);
    } else { // edit trait
      tokenTraits[tokenId][traitIdx] = traitValue;
    }
  }

  function getTokenTraits(uint256 tokenId) external view override returns (uint256[] memory) {
    require(mintBlocks[tokenId] < block.number, "Reavel only the next block");
    return tokenTraits[tokenId];
  }

  function tokenURI(uint256 tokenId) public view override returns (string memory) {
    require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
    require(mintBlocks[tokenId] < block.number, "Reavel only the next block");
    return traits.tokenURI(tokenId);
  }

  function level(uint256 tokenId) public view returns (uint256) {
    require(_exists(tokenId), "Query for nonexistent token");
    require(mintBlocks[tokenId] < block.number, "Reavel only the next block");
    return traits.level(tokenId);
  }

  function isZen(uint256 tokenId) public view override returns (bool) {
    require(_exists(tokenId), "Query for nonexistent token");
    require(mintBlocks[tokenId] < block.number, "Reavel only the next block");
    return isZens[tokenId];
  }

  /// @dev check if an address was off chain whitelisted
  /// @param account the address to check
  /// @return isValid boolean
  function isWhitelisted(address account, bytes memory sig) public view returns (bool isValid) {
    return signers[keccak256(abi.encodePacked(account)).toEthSignedMessageHash().recover(sig)];
  }

  /** ADMIN */
  /**
   * @param _traits the address of the Traits
   */
  function setTraits(address _traits) external onlyOwner {
    traits = ITraits(_traits);
  }

  /**
   * allows owner to withdraw funds from minting
   */
  function withdraw(address token) external onlyOwner {
    if (token == address(0))
      payable(owner()).transfer(address(this).balance);
    else
      CITY(token).transfer(owner(), CITY(token).balanceOf(address(this)));
  }

  /**
   * enables owner to pause / unpause minting
   */
  function setPaused(bool _paused) external onlyOwner {
    if (_paused) _pause();
    else _unpause();
  }

  /// @dev // add list of addresses that can sign
    /// @param accounts list of addresses
    function addSigners(address[] memory accounts) external onlyOwner {
        for (uint i = 0; i < accounts.length; i++) {
            if (accounts[i] != address(0)) {
                signers[accounts[i]] = true;
            }
        }
    }

    /// @dev // remove address that can sign
    /// @param account address to remove from signers
    function removeSigner(address account) external onlyOwner {
        signers[account] = false;
    }

  /**
   * enables an address to mint / burn
   * @param controller the address to enable
   */
  function addController(address controller) external onlyOwner {
    controllers[controller] = true;
  }

  /**
   * disables an address from minting / burning
   * @param controller the address to disbale
   */
  function removeController(address controller) external onlyOwner {
    controllers[controller] = false;
  }

  function setFirstRoundOpen(bool _isOpen) external onlyOwner {
    firstRoundOpen = _isOpen;
  }

  function setSecondRoundOpen(bool _isOpen) external onlyOwner {
    secondRoundOpen = _isOpen;
  }

  function setThirdRoundOpen(bool _isOpen) external onlyOwner {
    thirdRoundOpen = _isOpen;
  }

  function setWlOnly(bool _wlOnly) external onlyOwner {
    wlOnly = _wlOnly;
  }

  function setStartTime(uint256 _startTime) external onlyOwner {
    startTime = _startTime;
  }

  function setSecondRoundPrice(uint256 _secondRoundPrice) external onlyOwner {
    secondRoundPrice = _secondRoundPrice;
  }

  function setThirdRoundPrice(uint256 _thirdRoundPrice) external onlyOwner {
    thirdRoundPrice = _thirdRoundPrice;
  }

  function setMaxSupply(uint256 _maxSupply) external onlyOwner {
    require(_maxSupply < maxSupply, "max supply can only be reduced");
    maxSupply = _maxSupply;
  }
}

File 2 of 26 : Security.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.13;

import "@openzeppelin/contracts/utils/Address.sol";

contract Security {
    /// @dev Check if caller is a wallet
  modifier isEOA() {
      require(!(Address.isContract(msg.sender)) && tx.origin == msg.sender, "Only EOA");
      _;
  }
}

File 3 of 26 : Helpers.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

library Helpers {
  /// @dev generates a pseudorandom number
  /// @param seed a value ensure different outcomes for different sources in the same block
  /// @return a pseudorandom value
  function random(uint256 seed) internal view returns (uint256) {
    return uint256(keccak256(abi.encodePacked(
      tx.origin,
      blockhash(block.number - 1),
      block.difficulty,
      block.timestamp,
      seed
    )));
  }

  string internal constant TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

  function base64(bytes memory data) internal pure returns (string memory) {
    if (data.length == 0) return '';
    
    // load the table into memory
    string memory table = TABLE;

    // multiply by 4/3 rounded up
    uint256 encodedLen = 4 * ((data.length + 2) / 3);

    // add some extra buffer at the end required for the writing
    string memory result = new string(encodedLen + 32);

    assembly {
      // set the actual output length
      mstore(result, encodedLen)
      
      // prepare the lookup table
      let tablePtr := add(table, 1)
      
      // input ptr
      let dataPtr := data
      let endPtr := add(dataPtr, mload(data))
      
      // result ptr, jump over length
      let resultPtr := add(result, 32)
      
      // run over the input, 3 bytes at a time
      for {} lt(dataPtr, endPtr) {}
      {
          dataPtr := add(dataPtr, 3)
          
          // read 3 bytes
          let input := mload(dataPtr)
          
          // write 4 characters
          mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F)))))
          resultPtr := add(resultPtr, 1)
          mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F)))))
          resultPtr := add(resultPtr, 1)
          mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr( 6, input), 0x3F)))))
          resultPtr := add(resultPtr, 1)
          mstore(resultPtr, shl(248, mload(add(tablePtr, and(        input,  0x3F)))))
          resultPtr := add(resultPtr, 1)
      }
      
      // padding with '='
      switch mod(mload(data), 3)
      case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) }
      case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) }
    }
    
    return result;
  }

}

File 4 of 26 : ITraits.sol
// SPDX-License-Identifier: MIT LICENSE 

pragma solidity ^0.8.13;

interface ITraits {
  function selectTraits(uint256 seed, bool _isZen) external view returns (uint256[] memory t);
  function tokenURI(uint256 tokenId) external view returns (string memory);
  function level(uint256 tokenId) external view returns (uint256);
}

File 5 of 26 : IMetacity.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.13;

interface IMetacity {
  function getTokenTraits(uint256 tokenId) external view returns (uint256[] memory);
  function isZen(uint256 tokenId) external view returns (bool);
}

File 6 of 26 : ERC721Opensea.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";

/**
 * @title  ExampleERC721
 * @notice This example contract is configured to use the DefaultOperatorFilterer, which automatically registers the
 *         token and subscribes it to OpenSea's curated filters.
 *         Adding the onlyAllowedOperator modifier to the transferFrom and both safeTransferFrom methods ensures that
 *         the msg.sender (operator) is allowed by the OperatorFilterRegistry. Adding the onlyAllowedOperatorApproval
 *         modifier to the approval methods ensures that owners do not approve operators that are not allowed.
 */
abstract contract ERC721Opensea is ERC721, DefaultOperatorFilterer {
    constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {}

    function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
        super.transferFrom(from, to, tokenId);
    }

    function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId);
    }

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
        public
        override
        onlyAllowedOperator(from)
    {
        super.safeTransferFrom(from, to, tokenId, data);
    }
}

File 7 of 26 : CITY.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.13;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract CITY is ERC20, Ownable {

  uint256 public constant MAXIMUM_SUPPLY = 1000000000 ether;
  mapping(address => bool) minters;
  
  constructor() ERC20("MetaCity", "CITY") { }

  /**
   * mints $CITY to a recipient
   * @param to the recipient of the $CITY
   * @param amount the amount of $CITY to mint
   */
  function mint(address to, uint256 amount) external {
    require(minters[msg.sender], "Only minters can mint");
    require(totalSupply() + amount <= MAXIMUM_SUPPLY, "Can't go above Max supply");
    _mint(to, amount);
  }

  /**
   * enables an address to mint / burn
   * @param minter the address to enable
   */
  function addMinter(address minter) external onlyOwner {
    minters[minter] = true;
  }

  /**
   * disables an address from minting / burning
   * @param minter the address to disbale
   */
  function removeMinter(address minter) external onlyOwner {
    minters[minter] = false;
  }
}

File 8 of 26 : OperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";

abstract contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry constant operatorFilterRegistry =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(operatorFilterRegistry).code.length > 0) {
            if (subscribe) {
                operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    operatorFilterRegistry.register(address(this));
                }
            }
        }
    }

    modifier onlyAllowedOperator(address from) virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(operatorFilterRegistry).code.length > 0) {
            // Allow spending tokens from addresses with balance
            // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
            // from an EOA.
            if (from == msg.sender) {
                _;
                return;
            }
            if (
                !(
                    operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)
                        && operatorFilterRegistry.isOperatorAllowed(address(this), from)
                )
            ) {
                revert OperatorNotAllowed(msg.sender);
            }
        }
        _;
    }
}

File 9 of 26 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

File 10 of 26 : DefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {OperatorFilterer} from "./OperatorFilterer.sol";

abstract contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

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

pragma solidity ^0.8.0;

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

File 12 of 26 : 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 13 of 26 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

File 19 of 26 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 20 of 26 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

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

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

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

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

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

        _balances[to] += 1;
        _owners[tokenId] = to;

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

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

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

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

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

File 21 of 26 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 22 of 26 : 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 23 of 26 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

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

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

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

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_city","type":"address"},{"internalType":"address","name":"_traits","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"addController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"}],"name":"addSigners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"city","outputs":[{"internalType":"contract CITY","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"existingCombinations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstRoundMaxWlPerUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstRoundOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstRoundPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstRoundSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"firstRoundWlMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenTraits","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"isValid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isZen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"level","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"mintGen0","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"mintGen1","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintGen2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ratChance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"}],"name":"removeController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"secondRoundMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondRoundOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondRoundPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondRoundSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isOpen","type":"bool"}],"name":"setFirstRoundOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isOpen","type":"bool"}],"name":"setSecondRoundOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_secondRoundPrice","type":"uint256"}],"name":"setSecondRoundPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"setStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isOpen","type":"bool"}],"name":"setThirdRoundOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_thirdRoundPrice","type":"uint256"}],"name":"setThirdRoundPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"traitIdx","type":"uint256"},{"internalType":"uint256","name":"traitValue","type":"uint256"}],"name":"setTrait","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_traits","type":"address"}],"name":"setTraits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_wlOnly","type":"bool"}],"name":"setWlOnly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[],"name":"thirdRoundOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"thirdRoundPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traits","outputs":[{"internalType":"contract ITraits","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wlOnly","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405263637bbca0600855670de0b6b3a7640000600955681b1ae4d6e2ef500000600a55613db8600b55600c805463ffffffff191663010000011790553480156200004b57600080fd5b5060405162003eb838038062003eb88339810160408190526200006e91620003ba565b604051806040016040528060088152602001674d6574614369747960c01b815250604051806040016040528060088152602001674d4554414349545960c01b815250733cc6cdda760b79bafa08df41ecfa224f810dceb6600183838160009080519060200190620000e1929190620002f7565b508051620000f7906001906020840190620002f7565b5050506daaeb6d7670e522a718067333cd4e3b156200023f5780156200018d57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200016e57600080fd5b505af115801562000183573d6000803e3d6000fd5b505050506200023f565b6001600160a01b03821615620001de5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000153565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200022557600080fd5b505af11580156200023a573d6000803e3d6000fd5b505050505b505050506200025d62000257620002a160201b60201c565b620002a5565b6006805460ff60a01b191690556001600755601680546001600160a01b039384166001600160a01b031991821617909155601780549290931691161790556200042e565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200030590620003f2565b90600052602060002090601f01602090048101928262000329576000855562000374565b82601f106200034457805160ff191683800117855562000374565b8280016001018555821562000374579182015b828111156200037457825182559160200191906001019062000357565b506200038292915062000386565b5090565b5b8082111562000382576000815560010162000387565b80516001600160a01b0381168114620003b557600080fd5b919050565b60008060408385031215620003ce57600080fd5b620003d9836200039d565b9150620003e9602084016200039d565b90509250929050565b600181811c908216806200040757607f821691505b6020821081036200042857634e487b7160e01b600052602260045260246000fd5b50919050565b613a7a806200043e6000396000f3fe6080604052600436106103a25760003560e01c80637995e6e8116101e7578063d5abeb011161010d578063e9cda080116100a0578063f75859f71161006f578063f75859f714610b07578063f91a0b8814610b21578063fd0160fe14610b41578063fe5ceee714610b6157600080fd5b8063e9cda08014610a86578063eaa099e514610aa6578063f2fde38b14610ac7578063f6a74ed714610ae757600080fd5b8063e1fc334f116100dc578063e1fc334f146109e2578063e6fc9f0014610a02578063e8906a2d14610a1d578063e985e9c514610a3d57600080fd5b8063d5abeb0114610969578063da8c229e1461097f578063db33e624146109af578063dd312d78146109c257600080fd5b8063a1b8f37411610185578063b88d4fde11610154578063b88d4fde146108dc578063c87b56dd146108fc578063d007029d1461091c578063d0fb0f8c1461093c57600080fd5b8063a1b8f37414610859578063a22cb46514610886578063a5abef95146108a6578063a7fc7a07146108bc57600080fd5b80638da5cb5b116101c15780638da5cb5b146107e357806394e568471461080157806395d89b411461082e578063a13fc6fe1461084357600080fd5b80637995e6e81461078e57806384332344146107ae5780638c7299f0146107c357600080fd5b80633a07a345116102cc5780636352211e1161026a57806370a082311161023957806370a082311461072e578063715018a61461074e578063786ac1911461076357806378e979251461077857600080fd5b80636352211e146106b85780636f4f7366146106d85780636f8b44b0146106f85780636fa2ea291461071857600080fd5b80634aced088116102a65780634aced0881461064657806351cff8d9146106665780635c975abb146106865780635eadfa0f146106a557600080fd5b80633a07a345146105d65780633e0a322d1461060657806342842e0e1461062657600080fd5b806312422d8f1161034457806323b872dd1161031357806323b872dd146105615780632526952e1461058157806327d9d4b01461059757806327eb97ff146105b757600080fd5b806312422d8f146104d357806316c38b3c146104f357806318160ddd146105135780631f0a8fa71461054157600080fd5b8063081812fc11610380578063081812fc1461042c578063095ea7b3146104645780630bccfcd1146104865780630e316ab7146104b357600080fd5b806301ffc9a7146103a757806305c58df2146103dc57806306fdde031461040a575b600080fd5b3480156103b357600080fd5b506103c76103c23660046130f2565b610b81565b60405190151581526020015b60405180910390f35b3480156103e857600080fd5b506103fc6103f7366004613116565b610bd3565b6040519081526020016103d3565b34801561041657600080fd5b5061041f610cd6565b6040516103d39190613187565b34801561043857600080fd5b5061044c610447366004613116565b610d68565b6040516001600160a01b0390911681526020016103d3565b34801561047057600080fd5b5061048461047f3660046131b6565b610d8f565b005b34801561049257600080fd5b506103fc6104a13660046131e0565b600d6020526000908152604090205481565b3480156104bf57600080fd5b506104846104ce3660046131e0565b610ea4565b3480156104df57600080fd5b50600c546103c79062010000900460ff1681565b3480156104ff57600080fd5b5061048461050e366004613209565b610ecd565b34801561051f57600080fd5b50600f5461052e9061ffff1681565b60405161ffff90911681526020016103d3565b34801561054d57600080fd5b506103c761055c3660046132eb565b610eee565b34801561056d57600080fd5b5061048461057c366004613339565b610fae565b34801561058d57600080fd5b506103fc600a5481565b3480156105a357600080fd5b506104846105b2366004613116565b61110a565b3480156105c357600080fd5b50600c546103c790610100900460ff1681565b3480156105e257600080fd5b506103c76105f13660046131e0565b600e6020526000908152604090205460ff1681565b34801561061257600080fd5b50610484610621366004613116565b611117565b34801561063257600080fd5b50610484610641366004613339565b611124565b34801561065257600080fd5b50610484610661366004613209565b611275565b34801561067257600080fd5b506104846106813660046131e0565b611290565b34801561069257600080fd5b50600654600160a01b900460ff166103c7565b6104846106b3366004613375565b6113db565b3480156106c457600080fd5b5061044c6106d3366004613116565b611619565b3480156106e457600080fd5b506104846106f33660046131e0565b611679565b34801561070457600080fd5b50610484610713366004613116565b6116a3565b34801561072457600080fd5b506103fc61138881565b34801561073a57600080fd5b506103fc6107493660046131e0565b611701565b34801561075a57600080fd5b50610484611787565b34801561076f57600080fd5b506103fc600a81565b34801561078457600080fd5b506103fc60085481565b34801561079a57600080fd5b506104846107a93660046133a6565b61179b565b3480156107ba57600080fd5b506103fc600381565b3480156107cf57600080fd5b506104846107de366004613116565b6118be565b3480156107ef57600080fd5b506006546001600160a01b031661044c565b34801561080d57600080fd5b5061082161081c366004613116565b611a57565b6040516103d391906133d2565b34801561083a57600080fd5b5061041f611ae7565b34801561084f57600080fd5b506103fc60095481565b34801561086557600080fd5b506103fc610874366004613116565b60126020526000908152604090205481565b34801561089257600080fd5b506104846108a1366004613416565b611af6565b3480156108b257600080fd5b506103fc61032081565b3480156108c857600080fd5b506104846108d73660046131e0565b611b01565b3480156108e857600080fd5b506104846108f736600461344d565b611b2d565b34801561090857600080fd5b5061041f610917366004613116565b611c8c565b34801561092857600080fd5b506103c7610937366004613116565b611da9565b34801561094857600080fd5b506103fc610957366004613116565b60136020526000908152604090205481565b34801561097557600080fd5b506103fc600b5481565b34801561098b57600080fd5b506103c761099a3660046131e0565b60146020526000908152604090205460ff1681565b6104846109bd3660046134b5565b611e50565b3480156109ce57600080fd5b506104846109dd366004613116565b61206c565b3480156109ee57600080fd5b5060175461044c906001600160a01b031681565b348015610a0e57600080fd5b506103fc66470de4df82000081565b348015610a2957600080fd5b50610484610a3836600461350e565b612079565b348015610a4957600080fd5b506103c7610a583660046135a6565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610a9257600080fd5b50610484610aa1366004613209565b61212a565b348015610ab257600080fd5b50600c546103c7906301000000900460ff1681565b348015610ad357600080fd5b50610484610ae23660046131e0565b612150565b348015610af357600080fd5b50610484610b023660046131e0565b6121c6565b348015610b1357600080fd5b50600c546103c79060ff1681565b348015610b2d57600080fd5b50610484610b3c366004613209565b6121ef565b348015610b4d57600080fd5b5060165461044c906001600160a01b031681565b348015610b6d57600080fd5b50610484610b7c366004613209565b612213565b60006001600160e01b031982166380ac58cd60e01b1480610bb257506001600160e01b03198216635b5e139f60e01b145b80610bcd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000818152600260205260408120546001600160a01b0316610c3c5760405162461bcd60e51b815260206004820152601b60248201527f517565727920666f72206e6f6e6578697374656e7420746f6b656e000000000060448201526064015b60405180910390fd5b6000828152601360205260409020544311610c695760405162461bcd60e51b8152600401610c33906135d9565b6017546040516302e2c6f960e11b8152600481018490526001600160a01b03909116906305c58df290602401602060405180830381865afa158015610cb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcd9190613610565b606060008054610ce590613629565b80601f0160208091040260200160405190810160405280929190818152602001828054610d1190613629565b8015610d5e5780601f10610d3357610100808354040283529160200191610d5e565b820191906000526020600020905b815481529060010190602001808311610d4157829003601f168201915b5050505050905090565b6000610d7382612235565b506000908152600460205260409020546001600160a01b031690565b6000610d9a82611619565b9050806001600160a01b0316836001600160a01b031603610e075760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c33565b336001600160a01b0382161480610e235750610e238133610a58565b610e955760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610c33565b610e9f8383612294565b505050565b610eac612302565b6001600160a01b03166000908152601560205260409020805460ff19169055565b610ed5612302565b8015610ee657610ee361235c565b50565b610ee36123bc565b600060156000610f8a84610f8487604051602001610f24919060609190911b6bffffffffffffffffffffffff1916815260140190565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b906123f8565b6001600160a01b0316815260208101919091526040016000205460ff169392505050565b826daaeb6d7670e522a718067333cd4e3b156110f957336001600160a01b03821603610fe457610fdf84848461241c565b611104565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611033573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110579190613663565b80156110da5750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156110b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110da9190613663565b6110f957604051633b79c77360e21b8152336004820152602401610c33565b61110484848461241c565b50505050565b611112612302565b600a55565b61111f612302565b600855565b826daaeb6d7670e522a718067333cd4e3b1561126a57336001600160a01b0382160361115557610fdf84848461244d565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156111a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c89190613663565b801561124b5750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611227573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124b9190613663565b61126a57604051633b79c77360e21b8152336004820152602401610c33565b61110484848461244d565b61127d612302565b600c805460ff1916911515919091179055565b611298612302565b6001600160a01b0381166112e3576006546040516001600160a01b03909116904780156108fc02916000818181858888f193505050501580156112df573d6000803e3d6000fd5b5050565b806001600160a01b031663a9059cbb6113046006546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038516906370a0823190602401602060405180830381865afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c9190613610565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156113b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112df9190613663565b6002600754036113fd5760405162461bcd60e51b8152600401610c3390613680565b600260075561140a612468565b60085442101561145c5760405162461bcd60e51b815260206004820152601860248201527f53616c6520686176656e277420737461727465642079657400000000000000006044820152606401610c33565b600c5460ff1661147e5760405162461bcd60e51b8152600401610c33906136b7565b6000821180156114a25750600f546113889061149f90849061ffff166136f6565b11155b6114be5760405162461bcd60e51b8152600401610c339061370e565b346114d066470de4df82000084613733565b146115165760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081c185e5b595b9d08185b5bdd5b9d60521b6044820152606401610c33565b600c546301000000900460ff161561160557611533335b82610eee565b61157f5760405162461bcd60e51b815260206004820152601a60248201527f41646472657373206973206e6f742077686974656c69737465640000000000006044820152606401610c33565b336000908152600d602052604090205460039061159c90846136f6565b11156115e05760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b6044820152606401610c33565b336000908152600d6020526040812080548492906115ff9084906136f6565b90915550505b61161082600a6124b5565b50506001600755565b6000818152600260205260408120546001600160a01b031680610bcd5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610c33565b611681612302565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6116ab612302565b600b5481106116fc5760405162461bcd60e51b815260206004820152601e60248201527f6d617820737570706c792063616e206f6e6c79206265207265647563656400006044820152606401610c33565b600b55565b60006001600160a01b03821661176b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610c33565b506001600160a01b031660009081526003602052604090205490565b61178f612302565b6117996000612564565b565b3360009081526014602052604090205460ff166117fa5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920636f6e74726f6c6c6572732063616e2061646420747261697473006044820152606401610c33565b60008381526010602052604090205482111561184e5760405162461bcd60e51b8152602060048201526013602482015272151c985a5d081a5b99195e081a5b9d985b1a59606a1b6044820152606401610c33565b60008381526010602052604090205482900361188a57600083815260106020908152604082208054600181018255908352912001819055505050565b60008381526010602052604090208054829190849081106118ad576118ad613752565b600091825260209091200155505050565b6002600754036118e05760405162461bcd60e51b8152600401610c3390613680565b60026007556118ed612468565b600c5462010000900460ff166119155760405162461bcd60e51b8152600401610c33906136b7565b6119236103206113886136f6565b600f5461ffff1610156119705760405162461bcd60e51b8152602060048201526015602482015274149bdd5b99081b9bdd081cdd185c9d1959081e595d605a1b6044820152606401610c33565b6000811180156119935750600b54600f5461199090839061ffff166136f6565b11155b6119af5760405162461bcd60e51b8152600401610c339061370e565b6000600a54826119bf9190613733565b6016549091506001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018490526064016020604051808303816000875af1158015611a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4b9190613663565b5061161082600a6124b5565b6000818152601360205260409020546060904311611a875760405162461bcd60e51b8152600401610c33906135d9565b60008281526010602090815260409182902080548351818402810184019094528084529091830182828015611adb57602002820191906000526020600020905b815481526020019060010190808311611ac7575b50505050509050919050565b606060018054610ce590613629565b6112df3383836125b6565b611b09612302565b6001600160a01b03166000908152601460205260409020805460ff19166001179055565b836daaeb6d7670e522a718067333cd4e3b15611c7957336001600160a01b03821603611b6457611b5f85858585612684565b611c85565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611bb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd79190613663565b8015611c5a5750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5a9190613663565b611c7957604051633b79c77360e21b8152336004820152602401610c33565b611c8585858585612684565b5050505050565b6000818152600260205260409020546060906001600160a01b0316611d0b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c33565b6000828152601360205260409020544311611d385760405162461bcd60e51b8152600401610c33906135d9565b60175460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd90602401600060405180830381865afa158015611d81573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bcd9190810190613768565b6000818152600260205260408120546001600160a01b0316611e0d5760405162461bcd60e51b815260206004820152601b60248201527f517565727920666f72206e6f6e6578697374656e7420746f6b656e00000000006044820152606401610c33565b6000828152601360205260409020544311611e3a5760405162461bcd60e51b8152600401610c33906135d9565b5060009081526011602052604090205460ff1690565b600260075403611e725760405162461bcd60e51b8152600401610c3390613680565b6002600755611e7f612468565b600f5461138861ffff9091161015611ed15760405162461bcd60e51b8152602060048201526015602482015274149bdd5b99081b9bdd081cdd185c9d1959081e595d605a1b6044820152606401610c33565b600c54610100900460ff16611ef85760405162461bcd60e51b8152600401610c33906136b7565b611f066103206113886136f6565b600f54611f189061ffff1660016137df565b61ffff161115611f3a5760405162461bcd60e51b8152600401610c339061370e565b3460095414611f845760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081c185e5b595b9d08185b5bdd5b9d60521b6044820152606401610c33565b336000908152600e602052604090205460ff1615611fd55760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b6044820152606401610c33565b600c546301000000900460ff161561203c57611ff03361152d565b61203c5760405162461bcd60e51b815260206004820152601a60248201527f41646472657373206973206e6f742077686974656c69737465640000000000006044820152606401610c33565b336000908152600e60205260409020805460ff191660019081179091556120649060646124b5565b506001600755565b612074612302565b600955565b612081612302565b60005b81518110156112df5760006001600160a01b03168282815181106120aa576120aa613752565b60200260200101516001600160a01b031614612118576001601560008484815181106120d8576120d8613752565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061212281613805565b915050612084565b612132612302565b600c805491151563010000000263ff00000019909216919091179055565b612158612302565b6001600160a01b0381166121bd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c33565b610ee381612564565b6121ce612302565b6001600160a01b03166000908152601460205260409020805460ff19169055565b6121f7612302565b600c8054911515620100000262ff000019909216919091179055565b61221b612302565b600c80549115156101000261ff0019909216919091179055565b6000818152600260205260409020546001600160a01b0316610ee35760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610c33565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122c982611619565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6006546001600160a01b031633146117995760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c33565b612364612468565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861239f3390565b6040516001600160a01b03909116815260200160405180910390a1565b6123c46126b6565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361239f565b60008060006124078585612706565b915091506124148161274b565b509392505050565b6124263382612901565b6124425760405162461bcd60e51b8152600401610c339061381e565b610e9f838383612980565b610e9f83838360405180602001604052806000815250611b2d565b600654600160a01b900460ff16156117995760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c33565b6000805b8381101561110457600f805461ffff169060006124d58361386c565b82546101009290920a61ffff818102199093169183160217909155600f546124fe925016612b1c565b9150600083612512606461ffff861661388d565b600f5491111591506125299061ffff168483612b81565b600f5461ffff16600090815260136020526040902043905561255133600f5461ffff16612ccc565b508061255c81613805565b9150506124b9565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036126175760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c33565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61268e3383612901565b6126aa5760405162461bcd60e51b8152600401610c339061381e565b61110484848484612ce6565b600654600160a01b900460ff166117995760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c33565b600080825160410361273c5760208301516040840151606085015160001a61273087828585612d19565b94509450505050612744565b506000905060025b9250929050565b600081600481111561275f5761275f6138af565b036127675750565b600181600481111561277b5761277b6138af565b036127c85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c33565b60028160048111156127dc576127dc6138af565b036128295760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c33565b600381600481111561283d5761283d6138af565b036128955760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c33565b60048160048111156128a9576128a96138af565b03610ee35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c33565b60008061290d83611619565b9050806001600160a01b0316846001600160a01b0316148061295457506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806129785750836001600160a01b031661296d84610d68565b6001600160a01b0316145b949350505050565b826001600160a01b031661299382611619565b6001600160a01b0316146129f75760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c33565b6001600160a01b038216612a595760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c33565b612a64600082612294565b6001600160a01b0383166000908152600360205260408120805460019290612a8d9084906138c5565b90915550506001600160a01b0382166000908152600360205260408120805460019290612abb9084906136f6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600032612b2a6001436138c5565b60405160609290921b6bffffffffffffffffffffffff191660208301524060348201524460548201524260748201526094810183905260b40160408051601f19818403018152919052805160209091012092915050565b601754604051634940f9c960e11b81526004810184905282151560248201526000916001600160a01b031690639281f39290604401600060405180830381865afa158015612bd3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612bfb91908101906138dc565b6000858152601160205260409020805460ff19168415801591909117909155909150612cad57600081604051602001612c349190613962565b60408051601f19818403018152918152815160209283012060008181526012909352908220549092509003612c9a5760008581526010602090815260409091208351612c829285019061307c565b50600090815260126020526040902093909355505050565b611c8585612ca786612b1c565b85612b81565b60008481526010602090815260409091208251611c859284019061307c565b6112df828260405180602001604052806000815250612e06565b612cf1848484612980565b612cfd84848484612e39565b6111045760405162461bcd60e51b8152600401610c3390613998565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612d505750600090506003612dfd565b8460ff16601b14158015612d6857508460ff16601c14155b15612d795750600090506004612dfd565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612dcd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612df657600060019250925050612dfd565b9150600090505b94509492505050565b612e108383612f3a565b612e1d6000848484612e39565b610e9f5760405162461bcd60e51b8152600401610c3390613998565b60006001600160a01b0384163b15612f2f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612e7d9033908990889088906004016139ea565b6020604051808303816000875af1925050508015612eb8575060408051601f3d908101601f19168201909252612eb591810190613a27565b60015b612f15573d808015612ee6576040519150601f19603f3d011682016040523d82523d6000602084013e612eeb565b606091505b508051600003612f0d5760405162461bcd60e51b8152600401610c3390613998565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612978565b506001949350505050565b6001600160a01b038216612f905760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c33565b6000818152600260205260409020546001600160a01b031615612ff55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c33565b6001600160a01b038216600090815260036020526040812080546001929061301e9084906136f6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280548282559060005260206000209081019282156130b7579160200282015b828111156130b757825182559160200191906001019061309c565b506130c39291506130c7565b5090565b5b808211156130c357600081556001016130c8565b6001600160e01b031981168114610ee357600080fd5b60006020828403121561310457600080fd5b813561310f816130dc565b9392505050565b60006020828403121561312857600080fd5b5035919050565b60005b8381101561314a578181015183820152602001613132565b838111156111045750506000910152565b6000815180845261317381602086016020860161312f565b601f01601f19169290920160200192915050565b60208152600061310f602083018461315b565b80356001600160a01b03811681146131b157600080fd5b919050565b600080604083850312156131c957600080fd5b6131d28361319a565b946020939093013593505050565b6000602082840312156131f257600080fd5b61310f8261319a565b8015158114610ee357600080fd5b60006020828403121561321b57600080fd5b813561310f816131fb565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561326557613265613226565b604052919050565b600067ffffffffffffffff82111561328757613287613226565b50601f01601f191660200190565b600082601f8301126132a657600080fd5b81356132b96132b48261326d565b61323c565b8181528460208386010111156132ce57600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156132fe57600080fd5b6133078361319a565b9150602083013567ffffffffffffffff81111561332357600080fd5b61332f85828601613295565b9150509250929050565b60008060006060848603121561334e57600080fd5b6133578461319a565b92506133656020850161319a565b9150604084013590509250925092565b6000806040838503121561338857600080fd5b82359150602083013567ffffffffffffffff81111561332357600080fd5b6000806000606084860312156133bb57600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b8181101561340a578351835292840192918401916001016133ee565b50909695505050505050565b6000806040838503121561342957600080fd5b6134328361319a565b91506020830135613442816131fb565b809150509250929050565b6000806000806080858703121561346357600080fd5b61346c8561319a565b935061347a6020860161319a565b925060408501359150606085013567ffffffffffffffff81111561349d57600080fd5b6134a987828801613295565b91505092959194509250565b6000602082840312156134c757600080fd5b813567ffffffffffffffff8111156134de57600080fd5b61297884828501613295565b600067ffffffffffffffff82111561350457613504613226565b5060051b60200190565b6000602080838503121561352157600080fd5b823567ffffffffffffffff81111561353857600080fd5b8301601f8101851361354957600080fd5b80356135576132b4826134ea565b81815260059190911b8201830190838101908783111561357657600080fd5b928401925b8284101561359b5761358c8461319a565b8252928401929084019061357b565b979650505050505050565b600080604083850312156135b957600080fd5b6135c28361319a565b91506135d06020840161319a565b90509250929050565b6020808252601a908201527f52656176656c206f6e6c7920746865206e65787420626c6f636b000000000000604082015260600190565b60006020828403121561362257600080fd5b5051919050565b600181811c9082168061363d57607f821691505b60208210810361365d57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561367557600080fd5b815161310f816131fb565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600f908201526e149bdd5b99081a5cc818db1bdcd959608a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115613709576137096136e0565b500190565b6020808252600b908201526a149bdd5b9908195b99195960aa1b604082015260600190565b600081600019048311821515161561374d5761374d6136e0565b500290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561377a57600080fd5b815167ffffffffffffffff81111561379157600080fd5b8201601f810184136137a257600080fd5b80516137b06132b48261326d565b8181528560208385010111156137c557600080fd5b6137d682602083016020860161312f565b95945050505050565b600061ffff8083168185168083038211156137fc576137fc6136e0565b01949350505050565b600060018201613817576138176136e0565b5060010190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b600061ffff808316818103613883576138836136e0565b6001019392505050565b6000826138aa57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052602160045260246000fd5b6000828210156138d7576138d76136e0565b500390565b600060208083850312156138ef57600080fd5b825167ffffffffffffffff81111561390657600080fd5b8301601f8101851361391757600080fd5b80516139256132b4826134ea565b81815260059190911b8201830190838101908783111561394457600080fd5b928401925b8284101561359b57835182529284019290840190613949565b815160009082906020808601845b8381101561398c57815185529382019390820190600101613970565b50929695505050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613a1d9083018461315b565b9695505050505050565b600060208284031215613a3957600080fd5b815161310f816130dc56fea264697066735822122083b7b4cd155c594b681bb8e1469028fbebcae29a4a5b12d84dc9f362068fc52564736f6c634300080d0033000000000000000000000000d2af8c0f53a4308b628c6e9409326314ed2cf6d4000000000000000000000000188ca0fd98f7d1d498254a9ab450b8fba2356ea2

Deployed Bytecode

0x6080604052600436106103a25760003560e01c80637995e6e8116101e7578063d5abeb011161010d578063e9cda080116100a0578063f75859f71161006f578063f75859f714610b07578063f91a0b8814610b21578063fd0160fe14610b41578063fe5ceee714610b6157600080fd5b8063e9cda08014610a86578063eaa099e514610aa6578063f2fde38b14610ac7578063f6a74ed714610ae757600080fd5b8063e1fc334f116100dc578063e1fc334f146109e2578063e6fc9f0014610a02578063e8906a2d14610a1d578063e985e9c514610a3d57600080fd5b8063d5abeb0114610969578063da8c229e1461097f578063db33e624146109af578063dd312d78146109c257600080fd5b8063a1b8f37411610185578063b88d4fde11610154578063b88d4fde146108dc578063c87b56dd146108fc578063d007029d1461091c578063d0fb0f8c1461093c57600080fd5b8063a1b8f37414610859578063a22cb46514610886578063a5abef95146108a6578063a7fc7a07146108bc57600080fd5b80638da5cb5b116101c15780638da5cb5b146107e357806394e568471461080157806395d89b411461082e578063a13fc6fe1461084357600080fd5b80637995e6e81461078e57806384332344146107ae5780638c7299f0146107c357600080fd5b80633a07a345116102cc5780636352211e1161026a57806370a082311161023957806370a082311461072e578063715018a61461074e578063786ac1911461076357806378e979251461077857600080fd5b80636352211e146106b85780636f4f7366146106d85780636f8b44b0146106f85780636fa2ea291461071857600080fd5b80634aced088116102a65780634aced0881461064657806351cff8d9146106665780635c975abb146106865780635eadfa0f146106a557600080fd5b80633a07a345146105d65780633e0a322d1461060657806342842e0e1461062657600080fd5b806312422d8f1161034457806323b872dd1161031357806323b872dd146105615780632526952e1461058157806327d9d4b01461059757806327eb97ff146105b757600080fd5b806312422d8f146104d357806316c38b3c146104f357806318160ddd146105135780631f0a8fa71461054157600080fd5b8063081812fc11610380578063081812fc1461042c578063095ea7b3146104645780630bccfcd1146104865780630e316ab7146104b357600080fd5b806301ffc9a7146103a757806305c58df2146103dc57806306fdde031461040a575b600080fd5b3480156103b357600080fd5b506103c76103c23660046130f2565b610b81565b60405190151581526020015b60405180910390f35b3480156103e857600080fd5b506103fc6103f7366004613116565b610bd3565b6040519081526020016103d3565b34801561041657600080fd5b5061041f610cd6565b6040516103d39190613187565b34801561043857600080fd5b5061044c610447366004613116565b610d68565b6040516001600160a01b0390911681526020016103d3565b34801561047057600080fd5b5061048461047f3660046131b6565b610d8f565b005b34801561049257600080fd5b506103fc6104a13660046131e0565b600d6020526000908152604090205481565b3480156104bf57600080fd5b506104846104ce3660046131e0565b610ea4565b3480156104df57600080fd5b50600c546103c79062010000900460ff1681565b3480156104ff57600080fd5b5061048461050e366004613209565b610ecd565b34801561051f57600080fd5b50600f5461052e9061ffff1681565b60405161ffff90911681526020016103d3565b34801561054d57600080fd5b506103c761055c3660046132eb565b610eee565b34801561056d57600080fd5b5061048461057c366004613339565b610fae565b34801561058d57600080fd5b506103fc600a5481565b3480156105a357600080fd5b506104846105b2366004613116565b61110a565b3480156105c357600080fd5b50600c546103c790610100900460ff1681565b3480156105e257600080fd5b506103c76105f13660046131e0565b600e6020526000908152604090205460ff1681565b34801561061257600080fd5b50610484610621366004613116565b611117565b34801561063257600080fd5b50610484610641366004613339565b611124565b34801561065257600080fd5b50610484610661366004613209565b611275565b34801561067257600080fd5b506104846106813660046131e0565b611290565b34801561069257600080fd5b50600654600160a01b900460ff166103c7565b6104846106b3366004613375565b6113db565b3480156106c457600080fd5b5061044c6106d3366004613116565b611619565b3480156106e457600080fd5b506104846106f33660046131e0565b611679565b34801561070457600080fd5b50610484610713366004613116565b6116a3565b34801561072457600080fd5b506103fc61138881565b34801561073a57600080fd5b506103fc6107493660046131e0565b611701565b34801561075a57600080fd5b50610484611787565b34801561076f57600080fd5b506103fc600a81565b34801561078457600080fd5b506103fc60085481565b34801561079a57600080fd5b506104846107a93660046133a6565b61179b565b3480156107ba57600080fd5b506103fc600381565b3480156107cf57600080fd5b506104846107de366004613116565b6118be565b3480156107ef57600080fd5b506006546001600160a01b031661044c565b34801561080d57600080fd5b5061082161081c366004613116565b611a57565b6040516103d391906133d2565b34801561083a57600080fd5b5061041f611ae7565b34801561084f57600080fd5b506103fc60095481565b34801561086557600080fd5b506103fc610874366004613116565b60126020526000908152604090205481565b34801561089257600080fd5b506104846108a1366004613416565b611af6565b3480156108b257600080fd5b506103fc61032081565b3480156108c857600080fd5b506104846108d73660046131e0565b611b01565b3480156108e857600080fd5b506104846108f736600461344d565b611b2d565b34801561090857600080fd5b5061041f610917366004613116565b611c8c565b34801561092857600080fd5b506103c7610937366004613116565b611da9565b34801561094857600080fd5b506103fc610957366004613116565b60136020526000908152604090205481565b34801561097557600080fd5b506103fc600b5481565b34801561098b57600080fd5b506103c761099a3660046131e0565b60146020526000908152604090205460ff1681565b6104846109bd3660046134b5565b611e50565b3480156109ce57600080fd5b506104846109dd366004613116565b61206c565b3480156109ee57600080fd5b5060175461044c906001600160a01b031681565b348015610a0e57600080fd5b506103fc66470de4df82000081565b348015610a2957600080fd5b50610484610a3836600461350e565b612079565b348015610a4957600080fd5b506103c7610a583660046135a6565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610a9257600080fd5b50610484610aa1366004613209565b61212a565b348015610ab257600080fd5b50600c546103c7906301000000900460ff1681565b348015610ad357600080fd5b50610484610ae23660046131e0565b612150565b348015610af357600080fd5b50610484610b023660046131e0565b6121c6565b348015610b1357600080fd5b50600c546103c79060ff1681565b348015610b2d57600080fd5b50610484610b3c366004613209565b6121ef565b348015610b4d57600080fd5b5060165461044c906001600160a01b031681565b348015610b6d57600080fd5b50610484610b7c366004613209565b612213565b60006001600160e01b031982166380ac58cd60e01b1480610bb257506001600160e01b03198216635b5e139f60e01b145b80610bcd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000818152600260205260408120546001600160a01b0316610c3c5760405162461bcd60e51b815260206004820152601b60248201527f517565727920666f72206e6f6e6578697374656e7420746f6b656e000000000060448201526064015b60405180910390fd5b6000828152601360205260409020544311610c695760405162461bcd60e51b8152600401610c33906135d9565b6017546040516302e2c6f960e11b8152600481018490526001600160a01b03909116906305c58df290602401602060405180830381865afa158015610cb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcd9190613610565b606060008054610ce590613629565b80601f0160208091040260200160405190810160405280929190818152602001828054610d1190613629565b8015610d5e5780601f10610d3357610100808354040283529160200191610d5e565b820191906000526020600020905b815481529060010190602001808311610d4157829003601f168201915b5050505050905090565b6000610d7382612235565b506000908152600460205260409020546001600160a01b031690565b6000610d9a82611619565b9050806001600160a01b0316836001600160a01b031603610e075760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c33565b336001600160a01b0382161480610e235750610e238133610a58565b610e955760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610c33565b610e9f8383612294565b505050565b610eac612302565b6001600160a01b03166000908152601560205260409020805460ff19169055565b610ed5612302565b8015610ee657610ee361235c565b50565b610ee36123bc565b600060156000610f8a84610f8487604051602001610f24919060609190911b6bffffffffffffffffffffffff1916815260140190565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b906123f8565b6001600160a01b0316815260208101919091526040016000205460ff169392505050565b826daaeb6d7670e522a718067333cd4e3b156110f957336001600160a01b03821603610fe457610fdf84848461241c565b611104565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611033573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110579190613663565b80156110da5750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156110b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110da9190613663565b6110f957604051633b79c77360e21b8152336004820152602401610c33565b61110484848461241c565b50505050565b611112612302565b600a55565b61111f612302565b600855565b826daaeb6d7670e522a718067333cd4e3b1561126a57336001600160a01b0382160361115557610fdf84848461244d565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156111a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c89190613663565b801561124b5750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611227573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124b9190613663565b61126a57604051633b79c77360e21b8152336004820152602401610c33565b61110484848461244d565b61127d612302565b600c805460ff1916911515919091179055565b611298612302565b6001600160a01b0381166112e3576006546040516001600160a01b03909116904780156108fc02916000818181858888f193505050501580156112df573d6000803e3d6000fd5b5050565b806001600160a01b031663a9059cbb6113046006546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b038516906370a0823190602401602060405180830381865afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c9190613610565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156113b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112df9190613663565b6002600754036113fd5760405162461bcd60e51b8152600401610c3390613680565b600260075561140a612468565b60085442101561145c5760405162461bcd60e51b815260206004820152601860248201527f53616c6520686176656e277420737461727465642079657400000000000000006044820152606401610c33565b600c5460ff1661147e5760405162461bcd60e51b8152600401610c33906136b7565b6000821180156114a25750600f546113889061149f90849061ffff166136f6565b11155b6114be5760405162461bcd60e51b8152600401610c339061370e565b346114d066470de4df82000084613733565b146115165760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081c185e5b595b9d08185b5bdd5b9d60521b6044820152606401610c33565b600c546301000000900460ff161561160557611533335b82610eee565b61157f5760405162461bcd60e51b815260206004820152601a60248201527f41646472657373206973206e6f742077686974656c69737465640000000000006044820152606401610c33565b336000908152600d602052604090205460039061159c90846136f6565b11156115e05760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b6044820152606401610c33565b336000908152600d6020526040812080548492906115ff9084906136f6565b90915550505b61161082600a6124b5565b50506001600755565b6000818152600260205260408120546001600160a01b031680610bcd5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610c33565b611681612302565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6116ab612302565b600b5481106116fc5760405162461bcd60e51b815260206004820152601e60248201527f6d617820737570706c792063616e206f6e6c79206265207265647563656400006044820152606401610c33565b600b55565b60006001600160a01b03821661176b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610c33565b506001600160a01b031660009081526003602052604090205490565b61178f612302565b6117996000612564565b565b3360009081526014602052604090205460ff166117fa5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920636f6e74726f6c6c6572732063616e2061646420747261697473006044820152606401610c33565b60008381526010602052604090205482111561184e5760405162461bcd60e51b8152602060048201526013602482015272151c985a5d081a5b99195e081a5b9d985b1a59606a1b6044820152606401610c33565b60008381526010602052604090205482900361188a57600083815260106020908152604082208054600181018255908352912001819055505050565b60008381526010602052604090208054829190849081106118ad576118ad613752565b600091825260209091200155505050565b6002600754036118e05760405162461bcd60e51b8152600401610c3390613680565b60026007556118ed612468565b600c5462010000900460ff166119155760405162461bcd60e51b8152600401610c33906136b7565b6119236103206113886136f6565b600f5461ffff1610156119705760405162461bcd60e51b8152602060048201526015602482015274149bdd5b99081b9bdd081cdd185c9d1959081e595d605a1b6044820152606401610c33565b6000811180156119935750600b54600f5461199090839061ffff166136f6565b11155b6119af5760405162461bcd60e51b8152600401610c339061370e565b6000600a54826119bf9190613733565b6016549091506001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018490526064016020604051808303816000875af1158015611a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4b9190613663565b5061161082600a6124b5565b6000818152601360205260409020546060904311611a875760405162461bcd60e51b8152600401610c33906135d9565b60008281526010602090815260409182902080548351818402810184019094528084529091830182828015611adb57602002820191906000526020600020905b815481526020019060010190808311611ac7575b50505050509050919050565b606060018054610ce590613629565b6112df3383836125b6565b611b09612302565b6001600160a01b03166000908152601460205260409020805460ff19166001179055565b836daaeb6d7670e522a718067333cd4e3b15611c7957336001600160a01b03821603611b6457611b5f85858585612684565b611c85565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611bb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd79190613663565b8015611c5a5750604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5a9190613663565b611c7957604051633b79c77360e21b8152336004820152602401610c33565b611c8585858585612684565b5050505050565b6000818152600260205260409020546060906001600160a01b0316611d0b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c33565b6000828152601360205260409020544311611d385760405162461bcd60e51b8152600401610c33906135d9565b60175460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd90602401600060405180830381865afa158015611d81573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bcd9190810190613768565b6000818152600260205260408120546001600160a01b0316611e0d5760405162461bcd60e51b815260206004820152601b60248201527f517565727920666f72206e6f6e6578697374656e7420746f6b656e00000000006044820152606401610c33565b6000828152601360205260409020544311611e3a5760405162461bcd60e51b8152600401610c33906135d9565b5060009081526011602052604090205460ff1690565b600260075403611e725760405162461bcd60e51b8152600401610c3390613680565b6002600755611e7f612468565b600f5461138861ffff9091161015611ed15760405162461bcd60e51b8152602060048201526015602482015274149bdd5b99081b9bdd081cdd185c9d1959081e595d605a1b6044820152606401610c33565b600c54610100900460ff16611ef85760405162461bcd60e51b8152600401610c33906136b7565b611f066103206113886136f6565b600f54611f189061ffff1660016137df565b61ffff161115611f3a5760405162461bcd60e51b8152600401610c339061370e565b3460095414611f845760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081c185e5b595b9d08185b5bdd5b9d60521b6044820152606401610c33565b336000908152600e602052604090205460ff1615611fd55760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b6044820152606401610c33565b600c546301000000900460ff161561203c57611ff03361152d565b61203c5760405162461bcd60e51b815260206004820152601a60248201527f41646472657373206973206e6f742077686974656c69737465640000000000006044820152606401610c33565b336000908152600e60205260409020805460ff191660019081179091556120649060646124b5565b506001600755565b612074612302565b600955565b612081612302565b60005b81518110156112df5760006001600160a01b03168282815181106120aa576120aa613752565b60200260200101516001600160a01b031614612118576001601560008484815181106120d8576120d8613752565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061212281613805565b915050612084565b612132612302565b600c805491151563010000000263ff00000019909216919091179055565b612158612302565b6001600160a01b0381166121bd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c33565b610ee381612564565b6121ce612302565b6001600160a01b03166000908152601460205260409020805460ff19169055565b6121f7612302565b600c8054911515620100000262ff000019909216919091179055565b61221b612302565b600c80549115156101000261ff0019909216919091179055565b6000818152600260205260409020546001600160a01b0316610ee35760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610c33565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122c982611619565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6006546001600160a01b031633146117995760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c33565b612364612468565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861239f3390565b6040516001600160a01b03909116815260200160405180910390a1565b6123c46126b6565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361239f565b60008060006124078585612706565b915091506124148161274b565b509392505050565b6124263382612901565b6124425760405162461bcd60e51b8152600401610c339061381e565b610e9f838383612980565b610e9f83838360405180602001604052806000815250611b2d565b600654600160a01b900460ff16156117995760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c33565b6000805b8381101561110457600f805461ffff169060006124d58361386c565b82546101009290920a61ffff818102199093169183160217909155600f546124fe925016612b1c565b9150600083612512606461ffff861661388d565b600f5491111591506125299061ffff168483612b81565b600f5461ffff16600090815260136020526040902043905561255133600f5461ffff16612ccc565b508061255c81613805565b9150506124b9565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036126175760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c33565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61268e3383612901565b6126aa5760405162461bcd60e51b8152600401610c339061381e565b61110484848484612ce6565b600654600160a01b900460ff166117995760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c33565b600080825160410361273c5760208301516040840151606085015160001a61273087828585612d19565b94509450505050612744565b506000905060025b9250929050565b600081600481111561275f5761275f6138af565b036127675750565b600181600481111561277b5761277b6138af565b036127c85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c33565b60028160048111156127dc576127dc6138af565b036128295760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c33565b600381600481111561283d5761283d6138af565b036128955760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c33565b60048160048111156128a9576128a96138af565b03610ee35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610c33565b60008061290d83611619565b9050806001600160a01b0316846001600160a01b0316148061295457506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806129785750836001600160a01b031661296d84610d68565b6001600160a01b0316145b949350505050565b826001600160a01b031661299382611619565b6001600160a01b0316146129f75760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c33565b6001600160a01b038216612a595760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c33565b612a64600082612294565b6001600160a01b0383166000908152600360205260408120805460019290612a8d9084906138c5565b90915550506001600160a01b0382166000908152600360205260408120805460019290612abb9084906136f6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600032612b2a6001436138c5565b60405160609290921b6bffffffffffffffffffffffff191660208301524060348201524460548201524260748201526094810183905260b40160408051601f19818403018152919052805160209091012092915050565b601754604051634940f9c960e11b81526004810184905282151560248201526000916001600160a01b031690639281f39290604401600060405180830381865afa158015612bd3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612bfb91908101906138dc565b6000858152601160205260409020805460ff19168415801591909117909155909150612cad57600081604051602001612c349190613962565b60408051601f19818403018152918152815160209283012060008181526012909352908220549092509003612c9a5760008581526010602090815260409091208351612c829285019061307c565b50600090815260126020526040902093909355505050565b611c8585612ca786612b1c565b85612b81565b60008481526010602090815260409091208251611c859284019061307c565b6112df828260405180602001604052806000815250612e06565b612cf1848484612980565b612cfd84848484612e39565b6111045760405162461bcd60e51b8152600401610c3390613998565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612d505750600090506003612dfd565b8460ff16601b14158015612d6857508460ff16601c14155b15612d795750600090506004612dfd565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612dcd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612df657600060019250925050612dfd565b9150600090505b94509492505050565b612e108383612f3a565b612e1d6000848484612e39565b610e9f5760405162461bcd60e51b8152600401610c3390613998565b60006001600160a01b0384163b15612f2f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612e7d9033908990889088906004016139ea565b6020604051808303816000875af1925050508015612eb8575060408051601f3d908101601f19168201909252612eb591810190613a27565b60015b612f15573d808015612ee6576040519150601f19603f3d011682016040523d82523d6000602084013e612eeb565b606091505b508051600003612f0d5760405162461bcd60e51b8152600401610c3390613998565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612978565b506001949350505050565b6001600160a01b038216612f905760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c33565b6000818152600260205260409020546001600160a01b031615612ff55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c33565b6001600160a01b038216600090815260036020526040812080546001929061301e9084906136f6565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280548282559060005260206000209081019282156130b7579160200282015b828111156130b757825182559160200191906001019061309c565b506130c39291506130c7565b5090565b5b808211156130c357600081556001016130c8565b6001600160e01b031981168114610ee357600080fd5b60006020828403121561310457600080fd5b813561310f816130dc565b9392505050565b60006020828403121561312857600080fd5b5035919050565b60005b8381101561314a578181015183820152602001613132565b838111156111045750506000910152565b6000815180845261317381602086016020860161312f565b601f01601f19169290920160200192915050565b60208152600061310f602083018461315b565b80356001600160a01b03811681146131b157600080fd5b919050565b600080604083850312156131c957600080fd5b6131d28361319a565b946020939093013593505050565b6000602082840312156131f257600080fd5b61310f8261319a565b8015158114610ee357600080fd5b60006020828403121561321b57600080fd5b813561310f816131fb565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561326557613265613226565b604052919050565b600067ffffffffffffffff82111561328757613287613226565b50601f01601f191660200190565b600082601f8301126132a657600080fd5b81356132b96132b48261326d565b61323c565b8181528460208386010111156132ce57600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156132fe57600080fd5b6133078361319a565b9150602083013567ffffffffffffffff81111561332357600080fd5b61332f85828601613295565b9150509250929050565b60008060006060848603121561334e57600080fd5b6133578461319a565b92506133656020850161319a565b9150604084013590509250925092565b6000806040838503121561338857600080fd5b82359150602083013567ffffffffffffffff81111561332357600080fd5b6000806000606084860312156133bb57600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b8181101561340a578351835292840192918401916001016133ee565b50909695505050505050565b6000806040838503121561342957600080fd5b6134328361319a565b91506020830135613442816131fb565b809150509250929050565b6000806000806080858703121561346357600080fd5b61346c8561319a565b935061347a6020860161319a565b925060408501359150606085013567ffffffffffffffff81111561349d57600080fd5b6134a987828801613295565b91505092959194509250565b6000602082840312156134c757600080fd5b813567ffffffffffffffff8111156134de57600080fd5b61297884828501613295565b600067ffffffffffffffff82111561350457613504613226565b5060051b60200190565b6000602080838503121561352157600080fd5b823567ffffffffffffffff81111561353857600080fd5b8301601f8101851361354957600080fd5b80356135576132b4826134ea565b81815260059190911b8201830190838101908783111561357657600080fd5b928401925b8284101561359b5761358c8461319a565b8252928401929084019061357b565b979650505050505050565b600080604083850312156135b957600080fd5b6135c28361319a565b91506135d06020840161319a565b90509250929050565b6020808252601a908201527f52656176656c206f6e6c7920746865206e65787420626c6f636b000000000000604082015260600190565b60006020828403121561362257600080fd5b5051919050565b600181811c9082168061363d57607f821691505b60208210810361365d57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561367557600080fd5b815161310f816131fb565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600f908201526e149bdd5b99081a5cc818db1bdcd959608a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115613709576137096136e0565b500190565b6020808252600b908201526a149bdd5b9908195b99195960aa1b604082015260600190565b600081600019048311821515161561374d5761374d6136e0565b500290565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561377a57600080fd5b815167ffffffffffffffff81111561379157600080fd5b8201601f810184136137a257600080fd5b80516137b06132b48261326d565b8181528560208385010111156137c557600080fd5b6137d682602083016020860161312f565b95945050505050565b600061ffff8083168185168083038211156137fc576137fc6136e0565b01949350505050565b600060018201613817576138176136e0565b5060010190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b600061ffff808316818103613883576138836136e0565b6001019392505050565b6000826138aa57634e487b7160e01b600052601260045260246000fd5b500690565b634e487b7160e01b600052602160045260246000fd5b6000828210156138d7576138d76136e0565b500390565b600060208083850312156138ef57600080fd5b825167ffffffffffffffff81111561390657600080fd5b8301601f8101851361391757600080fd5b80516139256132b4826134ea565b81815260059190911b8201830190838101908783111561394457600080fd5b928401925b8284101561359b57835182529284019290840190613949565b815160009082906020808601845b8381101561398c57815185529382019390820190600101613970565b50929695505050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613a1d9083018461315b565b9695505050505050565b600060208284031215613a3957600080fd5b815161310f816130dc56fea264697066735822122083b7b4cd155c594b681bb8e1469028fbebcae29a4a5b12d84dc9f362068fc52564736f6c634300080d0033

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

000000000000000000000000d2af8c0f53a4308b628c6e9409326314ed2cf6d4000000000000000000000000188ca0fd98f7d1d498254a9ab450b8fba2356ea2

-----Decoded View---------------
Arg [0] : _city (address): 0xD2Af8c0F53a4308b628C6e9409326314ED2cF6d4
Arg [1] : _traits (address): 0x188Ca0FD98f7D1D498254a9ab450b8FBA2356eA2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000d2af8c0f53a4308b628c6e9409326314ed2cf6d4
Arg [1] : 000000000000000000000000188ca0fd98f7d1d498254a9ab450b8fba2356ea2


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.