ETH Price: $2,401.69 (-3.24%)
 

Overview

TokenID

2363

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Chimpers are a collection of 5,555 generative NFT pixel characters created by @TimpersHD. Chimpers are your digital identity for the Chimpverse and your passport to adventure. !CHIMP

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Chimpers

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.8.0;

/// @artist: Timpers
/// @title: Chimpers Generative
/// @author: manifold.xyz

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";

import "./ERC721CollectionBase.sol";

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                  //
//                                                                                                                  //
//                                                                                                                  //
//                                                                                                                  //
//                                                                 ...                                              //
//                                                                'ON0,                                             //
//                                                      .::c'  .;cd0X0dc:.                                          //
//                                                     .oXNWd. :XWXOkOXMN:                                          //
//                                                   :OOO000OOOO00OkkOXMN:                                          //
//                                             ';;;;:xXX0Okk0XXKkkkkkkKXKd;;;;;.                                    //
//                                            .kWWWWWKkkkkkkkkkkkkkkkkkkOXWWWWNo                                    //
//                      .oxxxxxxxxxxxxxx;  .oxkO00000OkkkkkkkkkkkkkkkkkkkO00000Oxx:                                 //
//                   ..'lKNNNNNNNNNNNNNNx;'lKNXOkkkkkkkkxdoooooooodxkkkkkkkkxddOXNk;'''''''.                        //
//                   ;KNXOkkkkkkkkkkkkkk0NNKOkkkkkkkkkkxl,,'',,''':dkkkkkkkxc,,lkk0NNNNNNNNK;                       //
//                'lok0K0kkxlccccccccokkOKK0kkkkkkkkxoc:;''''''''',:ccdkxocc;'';:ckNMWKKKKK0kdl'                    //
//              ..lXWKkkxxxd;''''''''cdxxkkkkkkkkkxxd:''...........'',lxd:'''.....l0XKOOOkkOXWXl..                  //
//            .l000OOOkkd:;,''''''''',;;lxkkkkkkkxc;;,''.         ..'',;,,''.     ...cKNX0kkOOO00O:                 //
//            .xMMXkkdol:,'''''''''''''';lloxkkkkx:''...    .;::::,....''...   .;::::codoolodkk0XKxc:,              //
//            .xMMXkkl,'''''''''''''''''''':dkkkkx:'..      cNMWWNx.  .'..     cNMWWNx.  .',lxxkkkKWMk.             //
//            .xMMXkkl,'''''''''''''''''''':dkkkkx:'..      cNMO:'.   .'..     cNMO;'.   .'';;:okkKWMk.             //
//            .xMMXkkl,'''''''''''''''''''':xkkkkx:'..      cNM0:,.   .'..     cNMO:,.   .'''''lkkKWMk.             //
//            .xMMXkkl,'''''''''''''''''''':xkkkkx:'..      :XWWWWx.  .'..     cNWWWWx.  .'''''lkkKWMk.             //
//            .xMMXkkxolc,'''''''''''''';lodxkkkkx:''...    .;;;;;,....''...   .;;;;;cdxo:'''',lxkKWMk.             //
//            .lOOO00Okkd:;;,'''''''',;;lxkkkkkkkx:'''''.         ..''''''''.        ;KMXl'',;:okkKWMk.             //
//               .lNWXOkkxxd:''''''''cdxxkkkkkkkkx:''''''..........''''''''''........lXMXl',lxxxkkKWMk.             //
//                .:cxKX0kkxolllllllldkkkkkkkkkkkx:'''''''''''';oddddo;',cdddddc'''''lXMNxlldkk0KKklc,              //
//                   ;0NKOOOOOOOOOOOOkkkkkkkkkkxxd:''''''''''''cOKKKKOc',d0KKK0o,''''lKNX0OOOOOKXXc                 //
//                    ..cKNNNNNNNNNNNKkkkkkkkkxc;;,'''''''''''',:::::;,'';:::::;''''',::l0NNNNXo'..                 //
//                      .ldddddddxKWWKkkkkkkkkd:''.....................................';OMW0xo'                    //
//                                oNWKOkkkkkkkd:'..                                   .';OMX:                       //
//                                .,;dXXKkkkkkd:'.                                    .':0MX:                       //
//                                   lNMXOkkkkd:'.                                    .':0MX:                       //
//                                   cNMXOkkkkd:'.                                    .':0MX:                       //
//                                   .;:dKXKOkd:''...                              ....':0MX:                       //
//                                      ,k0000ko::,'..                            ..',::lx0k,                       //
//                                        .:KWWNNKl''..............................''lKN0;.                         //
//                                         .coooooddddddddddddddddddddddddddddddddddddooc.                          //
//                                               .dNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNd.                             //
//                                                .''''''''''''''''''''''''''''''''''.                              //
//                                                                                                                  //
//                                                                                                                  //
//                                                                                                                  //
//                                                                                                                  //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

contract Chimpers is ERC721CollectionBase, ERC721, AdminControl {

    constructor(address signingAddress) ERC721("Chimpers", "CHIMP") {
        _initialize(
          // Total supply
          5555,
          // Purchase price (0.07 ETH)
          70000000000000000,
          // Purchase limit (0 for no limit)
          0,
          // Transaction limit (0 for no limit)
          0,
          // Presale purchase price (0.07 ETH)
          70000000000000000,
          // Presale purchase limit (0 for no limit)
          0,
          signingAddress,
          // Use dynamic presale purchase limit
          true);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721CollectionBase, ERC721, AdminControl) returns (bool) {
        return ERC721CollectionBase.supportsInterface(interfaceId) || ERC721.supportsInterface(interfaceId) || AdminControl.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Collection-withdraw}.
     */
    function withdraw(address payable recipient, uint256 amount) external override adminRequired {
        _withdraw(recipient, amount);
    }

    /**
     * @dev See {IERC721Collection-setTransferLocked}.
     */
    function setTransferLocked(bool locked) external override adminRequired {
        _setTransferLocked(locked);
    }

    /**
     * @dev See {IERC721Collection-premint}.
     */
    function premint(uint16 amount) external override adminRequired {
        _premint(amount, owner());
    }

    /**
     * @dev See {IERC721Collection-premint}.
     */
    function premint(address[] calldata addresses) external override adminRequired {
        _premint(addresses);
    }

    /**
     * @dev See {IERC721Collection-activate}.
     */
    function activate(uint256 startTime_, uint256 duration, uint256 presaleInterval_, uint256 claimStartTime_, uint256 claimEndTime_) external override adminRequired {
        _activate(startTime_, duration, presaleInterval_, claimStartTime_, claimEndTime_);
    }

    /**
     * @dev See {IERC721Collection-deactivate}.
     */
    function deactivate() external override adminRequired {
        _deactivate();
    }

    /**
     *  @dev See {IERC721Collection-setTokenURIPrefix}.
     */
    function setTokenURIPrefix(string calldata prefix) external override adminRequired {
        _setTokenURIPrefix(prefix);
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return _prefixURI;
    }
    
    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override (ERC721, ERC721CollectionBase) returns (uint256) {
        return ERC721.balanceOf(owner);
    }

    /**
     * @dev mint implementation
     */
    function _mint(address to, uint256 tokenId) internal override (ERC721, ERC721CollectionBase) {
        ERC721._mint(to, tokenId);
    }

    /**
     * @dev See {ERC721-_beforeTokenTranfser}.
     */
    function _beforeTokenTransfer(address from, address, uint256) internal virtual override {
        _validateTokenTransferability(from);
    }
    
    /**
     * @dev Update royalties
     */
    function updateRoyalties(address payable recipient, uint256 bps) external adminRequired {
      _updateRoyalties(recipient, bps);
    }

}

File 2 of 19 : ERC721CollectionBase.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

import "./IERC721Collection.sol";
import "./CollectionBase.sol";

/**
 * ERC721 Collection Drop Contract (Base)
 */
abstract contract ERC721CollectionBase is CollectionBase, IERC721Collection {
    
    using Strings for uint256;

    // Immutable variables that should only be set by the constructor or initializer
    uint16 public transactionLimit;
    uint16 public purchaseMax;
    uint16 public purchaseLimit;
    uint256 public purchasePrice;
    uint16 public presalePurchaseLimit;
    uint256 public presalePurchasePrice;
    bool public useDynamicPresalePurchaseLimit;

    // Minted token information
    uint16 public purchaseCount;
    mapping(address => uint16) internal _addressMintCount;

    // Token URI configuration
    string internal _prefixURI;

    uint256 private _royaltyBps;
    address payable private _royaltyRecipient;
    bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6;
    bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a;
    bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584;

    // Transfer lock
    bool public transferLocked;

    function _initialize(uint16 purchaseMax_, uint256 purchasePrice_, uint16 purchaseLimit_, uint16 transactionLimit_, uint256 presalePurchasePrice_, uint16 presalePurchaseLimit_, address signingAddress, bool useDynamicPresalePurchaseLimit_) internal {
        require(_signingAddress == address(0), "Already initialized");
        purchaseMax = purchaseMax_;
        purchasePrice = purchasePrice_;
        purchaseLimit = purchaseLimit_;
        transactionLimit = transactionLimit_;
        presalePurchasePrice = presalePurchasePrice_;
        presalePurchaseLimit = presalePurchaseLimit_;
        _signingAddress = signingAddress;
        useDynamicPresalePurchaseLimit = useDynamicPresalePurchaseLimit_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165) returns (bool) {
      return interfaceId == type(IERC721Collection).interfaceId ||interfaceId == _INTERFACE_ID_ROYALTIES_CREATORCORE
          || interfaceId == _INTERFACE_ID_ROYALTIES_EIP2981 || interfaceId == _INTERFACE_ID_ROYALTIES_RARIBLE;
    }

    /**
     * Premint tokens to the owner.  Sale must not be active.
     */
    function _premint(uint16 amount, address owner) internal virtual {
        require(!active, "Already active");
        for (uint i = 0; i < amount; i++) {
            _mint(owner);
        }
    }

    /**
     * Premint tokens to the list of addresses.  Sale must not be active.
     */
    function _premint(address[] calldata addresses) internal virtual {
        require(!active, "Already active");
        for (uint i = 0; i < addresses.length; i++) {
            _mint(addresses[i]);
        }
    }

    /**
     * @dev override if you want to perform different mint functionality
     */
    function _mint(address to) internal virtual {
        purchaseCount++;
        
        // Mint token
        _mint(to, purchaseCount);

        emit Unveil(purchaseCount, address(this), purchaseCount);
    }

    /**
     * @dev override to define mint functionality
     */
    function _mint(address to, uint256 tokenId) internal virtual;

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual returns (uint256);

    /**
     * @dev Use a prefix uri for all tokens (<PREFIX><TOKEN_ID>).
     */
    function _setTokenURIPrefix(string calldata prefix) internal virtual {
        _prefixURI = prefix;
    }

    /**
     * Validate price (override for custom pricing mechanics)
     */
    function _validatePrice(uint16 amount) internal virtual {
      require(msg.value == amount*purchasePrice, "Invalid purchase amount sent");
    }


    /**
     * Validate price (override for custom pricing mechanics)
     */
    function _validatePresalePrice(uint16 amount) internal virtual {
      require(msg.value == amount*presalePurchasePrice, "Invalid purchase amount sent");
    }

    /**
     * If enabled, lock token transfers until admin unlocks.
     */
    function _validateTokenTransferability(address from) internal view {
        require(!transferLocked || from == address(0), "Transfer locked until sale ends");
    }

    /**
     * Set whether or not token transfers are locked till end of sale
     */
    function _setTransferLocked(bool locked) internal {
        transferLocked = locked;
    }

    /**
     * @dev See {IERC721Collection-claim}.
     */
    function claim(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external virtual override {
        _validateClaimRestrictions();
        _validateClaimRequest(message, signature, nonce, amount);
        for (uint i = 0; i < amount; i++) {
            _mint(msg.sender);
        }
    }
    
    /**
     * @dev See {IERC721Collection-purchase}.
     */
    function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) public payable virtual override {
        _validatePurchaseRestrictions();

        bool isPresale = _isPresale();
        uint16 mintCount = _addressMintCount[msg.sender];

        // Check purchase amounts
        require(amount <= purchaseRemaining() && ((isPresale && useDynamicPresalePurchaseLimit) || transactionLimit == 0 || amount <= transactionLimit), "Too many requested");

        if (isPresale) {
            require(
                useDynamicPresalePurchaseLimit ||
                (
                    // check amount is under presale limit
                    (presalePurchaseLimit == 0 || (presalePurchaseLimit > mintCount && amount <= (presalePurchaseLimit-mintCount))) &&
                    // check amount is also under purchase limit
                    (purchaseLimit == 0 || (purchaseLimit > mintCount && amount <= (purchaseLimit-mintCount)))
                ),
                "Too many requested"
            );
            _validatePresalePrice(amount);
            _addressMintCount[msg.sender] += amount;
        } else {
            require(purchaseLimit == 0 || (purchaseLimit > mintCount && amount <= (purchaseLimit-_addressMintCount[msg.sender])), "Too many requested");
            _validatePrice(amount);
            if (purchaseLimit != 0) {
                _addressMintCount[msg.sender] += amount;
            }
        }

        if (isPresale && useDynamicPresalePurchaseLimit) {
            _validatePurchaseRequestWithAmount(message, signature, nonce, amount);
        } else {
            _validatePurchaseRequest(message, signature, nonce);
        }
        
        for (uint i = 0; i < amount; i++) {
            _mint(msg.sender);
        }
    }

    /**
     * @dev See {IERC721Collection-state}
     */
    function state() external override view returns(CollectionState memory) {
        return CollectionState(transactionLimit, purchaseMax, purchaseRemaining(), purchasePrice, purchaseLimit, presalePurchasePrice, presalePurchaseLimit, _addressMintCount[msg.sender], active, startTime, endTime, presaleInterval, claimStartTime, claimEndTime, useDynamicPresalePurchaseLimit);
    }

    /**
     * @dev See {IERC721Collection-purchaseRemaining}.
     */
    function purchaseRemaining() public view virtual override returns(uint16) {
        return purchaseMax-purchaseCount;
    }

    /**
     * ROYALTY FUNCTIONS
     */
    function getRoyalties(uint256) external view returns (address payable[] memory recipients, uint256[] memory bps) {
        if (_royaltyRecipient != address(0x0)) {
            recipients = new address payable[](1);
            recipients[0] = _royaltyRecipient;
            bps = new uint256[](1);
            bps[0] = _royaltyBps;
        }
        return (recipients, bps);
    }

    function getFeeRecipients(uint256) external view returns (address payable[] memory recipients) {
        if (_royaltyRecipient != address(0x0)) {
            recipients = new address payable[](1);
            recipients[0] = _royaltyRecipient;
        }
        return recipients;
    }

    function getFeeBps(uint256) external view returns (uint[] memory bps) {
        if (_royaltyRecipient != address(0x0)) {
            bps = new uint256[](1);
            bps[0] = _royaltyBps;
        }
        return bps;
    }

    function royaltyInfo(uint256, uint256 value) external view returns (address, uint256) {
        return (_royaltyRecipient, value*_royaltyBps/10000);
    }

    /**
     * @dev Update royalties
     */
    function _updateRoyalties(address payable recipient, uint256 bps) internal {
        _royaltyRecipient = recipient;
        _royaltyBps = bps;
    }
}

File 3 of 19 : AdminControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IAdminControl.sol";

abstract contract AdminControl is Ownable, IAdminControl, ERC165 {
    using EnumerableSet for EnumerableSet.AddressSet;

    // Track registered admins
    EnumerableSet.AddressSet private _admins;

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

    /**
     * @dev Only allows approved admins to call the specified function
     */
    modifier adminRequired() {
        require(owner() == msg.sender || _admins.contains(msg.sender), "AdminControl: Must be owner or admin");
        _;
    }   

    /**
     * @dev See {IAdminControl-getAdmins}.
     */
    function getAdmins() external view override returns (address[] memory admins) {
        admins = new address[](_admins.length());
        for (uint i = 0; i < _admins.length(); i++) {
            admins[i] = _admins.at(i);
        }
        return admins;
    }

    /**
     * @dev See {IAdminControl-approveAdmin}.
     */
    function approveAdmin(address admin) external override onlyOwner {
        if (!_admins.contains(admin)) {
            emit AdminApproved(admin, msg.sender);
            _admins.add(admin);
        }
    }

    /**
     * @dev See {IAdminControl-revokeAdmin}.
     */
    function revokeAdmin(address admin) external override onlyOwner {
        if (_admins.contains(admin)) {
            emit AdminRevoked(admin, msg.sender);
            _admins.remove(admin);
        }
    }

    /**
     * @dev See {IAdminControl-isAdmin}.
     */
    function isAdmin(address admin) public override view returns (bool) {
        return (owner() == admin || _admins.contains(admin));
    }

}

File 4 of 19 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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: balance query for the zero address");
        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: owner query for nonexistent token");
        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) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        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 owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        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: transfer caller is not 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: transfer caller is not 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) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        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 a {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 a {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 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 {
                    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 5 of 19 : CollectionBase.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

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

import "./ICollectionBase.sol";

/**
 * Collection Drop Contract (Base)
 */
abstract contract CollectionBase is ICollectionBase {
    
    using ECDSA for bytes32;
    using Strings for uint256;

    // Immutable variables that should only be set by the constructor or initializer
    address internal _signingAddress;

    // Message nonces
    mapping(bytes32 => bool) private _usedNonces;

    // Sale start/end control
    bool public active;
    uint256 public startTime;
    uint256 public endTime;
    uint256 public presaleInterval;

    // Claim period start/end control
    uint256 public claimStartTime;
    uint256 public claimEndTime;

    /**
     * Withdraw funds
     */
    function _withdraw(address payable recipient, uint256 amount) internal {
        (bool success,) = recipient.call{value:amount}("");
        require(success);
    }

    /**
     * Activate the sale
     */
    function _activate(uint256 startTime_, uint256 duration, uint256 presaleInterval_, uint256 claimStartTime_, uint256 claimEndTime_) internal virtual {
        require(!active, "Already active");
        require(startTime_ > block.timestamp, "Cannot activate in the past");
        require(presaleInterval_ <= duration, "Presale Interval cannot be longer than the sale");
        require(claimStartTime_ <= claimEndTime_ && claimEndTime_ <= startTime_, "Invalid claim times");
        startTime = startTime_;
        endTime = startTime + duration;
        presaleInterval = presaleInterval_;
        claimStartTime = claimStartTime_;
        claimEndTime = claimEndTime_;
        active = true;

        emit CollectionActivated(startTime, endTime, presaleInterval, claimStartTime, claimEndTime);
    }

    /**
     * Deactivate the sale
     */
    function _deactivate() internal virtual {
        startTime = 0;
        endTime = 0;
        active = false;
        claimStartTime = 0;
        claimEndTime = 0;

        emit CollectionDeactivated();
    }

    function _getNonceBytes32(string memory nonce) internal pure returns(bytes32 nonceBytes32) {
        bytes memory nonceBytes = bytes(nonce);
        require(nonceBytes.length <= 32, "Invalid nonce");
        assembly {
            nonceBytes32 := mload(add(nonce, 32))
        }
    }

    /**
     * Validate claim signature
     */
    function _validateClaimRequest(bytes32 message, bytes calldata signature, string calldata nonce, uint16 amount) internal virtual {
        _validatePurchaseRequestWithAmount(message, signature, nonce, amount);
    }

    /**
     * Validate claim restrictions
     */
    function _validateClaimRestrictions() internal virtual {
        require(active, "Inactive");
        require(block.timestamp >= claimStartTime && block.timestamp <= claimEndTime, "Outside claim period.");
    }

    /**
     * Validate purchase signature
     */
    function _validatePurchaseRequest(bytes32 message, bytes calldata signature, string calldata nonce) internal virtual { 
        // Verify nonce usage/re-use
        bytes32 nonceBytes32 = _getNonceBytes32(nonce);
        require(!_usedNonces[nonceBytes32], "Cannot replay transaction");
        // Verify valid message based on input variables
        bytes32 expectedMessage = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", (20+bytes(nonce).length).toString(), msg.sender, nonce));
        require(message == expectedMessage, "Malformed message");
        // Verify signature was performed by the expected signing address
        address signer = message.recover(signature);
        require(signer == _signingAddress, "Invalid signature");

        _usedNonces[nonceBytes32] = true;
    }

    /**
     * Validate purchase signature with amount
     */
    function _validatePurchaseRequestWithAmount(bytes32 message, bytes calldata signature, string calldata nonce, uint16 amount) internal virtual {
        // Verify nonce usage/re-use
        bytes32 nonceBytes32 = _getNonceBytes32(nonce);
        require(!_usedNonces[nonceBytes32], "Cannot replay transaction");
        // Verify valid message based on input variables
        bytes32 expectedMessage = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", (20+bytes(nonce).length+bytes(uint256(amount).toString()).length).toString(), msg.sender, nonce, uint256(amount).toString()));
        require(message == expectedMessage, "Malformed message");
        // Verify signature was performed by the expected signing address
        address signer = message.recover(signature);
        require(signer == _signingAddress, "Invalid signature");

        _usedNonces[nonceBytes32] = true;
    }

    /**
     * Perform purchase restriciton checks. Override if more logic is needed
     */
    function _validatePurchaseRestrictions() internal virtual {
        require(active, "Inactive");
        require(block.timestamp >= startTime, "Purchasing not active");
    }

    /**
     * @dev See {ICollectionBase-nonceUsed}.
     */
    function nonceUsed(string memory nonce) external view override returns(bool) {
        bytes32 nonceBytes32 = _getNonceBytes32(nonce);
        return _usedNonces[nonceBytes32];
    }

    /**
     * @dev Check if currently in presale
     */
    function _isPresale() internal view returns (bool) {
        return block.timestamp > startTime && block.timestamp - startTime < presaleInterval;
    }
}

File 6 of 19 : IERC721Collection.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

import "./ICollectionBase.sol";

/**
 * @dev ERC721 Collection Interface
 */
interface IERC721Collection is ICollectionBase, IERC165 {

    event Unveil(uint256 collectibleId, address tokenAddress, uint256 tokenId);

    struct CollectionState {
        uint16 transactionLimit;
        uint16 purchaseMax;
        uint16 purchaseRemaining;
        uint256 purchasePrice;
        uint16 purchaseLimit;
        uint256 presalePurchasePrice;
        uint16 presalePurchaseLimit;
        uint16 purchaseCount;
        bool active;
        uint256 startTime;
        uint256 endTime;
        uint256 presaleInterval;
        uint256 claimStartTime;
        uint256 claimEndTime;
        bool useDynamicPresalePurchaseLimit;
    }

    /**
     * @dev Pre-mint
     */
    function premint(uint16 amount) external;

    function premint(address[] calldata addresses) external;

    /**
     *  @dev set the tokenURI prefix
     */
    function setTokenURIPrefix(string calldata prefix) external;

    /**
     * @dev Withdraw funds
     */
    function withdraw(address payable recipient, uint256 amount) external;

    /**
     * @dev Set whether or not token transfers are locked until end of sale.
     * @param locked Whether or not transfers are locked
     */
    function setTransferLocked(bool locked) external;

    /**
     * @dev Activate the contract
     */
    function activate(uint256 startTime_, uint256 duration, uint256 presaleInterval_, uint256 claimStartTime_, uint256 claimEndTime_) external;

    /**
     * @dev Deactivate the contract
     */
    function deactivate() external;

    /**
     * @dev claim
     */
    function claim(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external;
    
    /**
     * @dev purchase
     */
    function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external payable;

    /**
     * @dev returns the collection state
     */
    function state() external view returns(CollectionState memory);

    /**
     * @dev Get number of tokens left
     */
    function purchaseRemaining() external view returns(uint16);

}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 19 : 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 12 of 19 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 13 of 19 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

    /**
     * @dev 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 14 of 19 : IAdminControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @dev Interface for admin control
 */
interface IAdminControl is IERC165 {

    event AdminApproved(address indexed account, address indexed sender);
    event AdminRevoked(address indexed account, address indexed sender);

    /**
     * @dev gets address of all admins
     */
    function getAdmins() external view returns (address[] memory);

    /**
     * @dev add an admin.  Can only be called by contract owner.
     */
    function approveAdmin(address admin) external;

    /**
     * @dev remove an admin.  Can only be called by contract owner.
     */
    function revokeAdmin(address admin) external;

    /**
     * @dev checks whether or not given address is an admin
     * Returns True if they are
     */
    function isAdmin(address admin) external view returns (bool);

}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 16 of 19 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 17 of 19 : ICollectionBase.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @author: manifold.xyz

/**
 * @dev Collection Interface
 */
interface ICollectionBase {

    event CollectionActivated(uint256 startTime, uint256 endTime, uint256 presaleInterval, uint256 claimStartTime, uint256 claimEndTime);
    event CollectionDeactivated();

    /**
     * @dev Check if nonce has been used
     */
    function nonceUsed(string memory nonce) external view returns(bool);
}

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

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = 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));
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"signingAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"presaleInterval","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimStartTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimEndTime","type":"uint256"}],"name":"CollectionActivated","type":"event"},{"anonymous":false,"inputs":[],"name":"CollectionDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"collectibleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unveil","type":"event"},{"inputs":[{"internalType":"uint256","name":"startTime_","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"presaleInterval_","type":"uint256"},{"internalType":"uint256","name":"claimStartTime_","type":"uint256"},{"internalType":"uint256","name":"claimEndTime_","type":"uint256"}],"name":"activate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"active","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"approveAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"amount","type":"uint16"},{"internalType":"bytes32","name":"message","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"string","name":"nonce","type":"string"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deactivate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAdmins","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint256[]","name":"bps","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address payable[]","name":"recipients","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getRoyalties","outputs":[{"internalType":"address payable[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"bps","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"nonce","type":"string"}],"name":"nonceUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"internalType":"uint16","name":"amount","type":"uint16"}],"name":"premint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"premint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"presaleInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presalePurchaseLimit","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presalePurchasePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"amount","type":"uint16"},{"internalType":"bytes32","name":"message","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"string","name":"nonce","type":"string"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"purchaseCount","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"purchaseLimit","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"purchaseMax","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"purchasePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"purchaseRemaining","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"}],"name":"setTokenURIPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"locked","type":"bool"}],"name":"setTransferLocked","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"state","outputs":[{"components":[{"internalType":"uint16","name":"transactionLimit","type":"uint16"},{"internalType":"uint16","name":"purchaseMax","type":"uint16"},{"internalType":"uint16","name":"purchaseRemaining","type":"uint16"},{"internalType":"uint256","name":"purchasePrice","type":"uint256"},{"internalType":"uint16","name":"purchaseLimit","type":"uint16"},{"internalType":"uint256","name":"presalePurchasePrice","type":"uint256"},{"internalType":"uint16","name":"presalePurchaseLimit","type":"uint16"},{"internalType":"uint16","name":"purchaseCount","type":"uint16"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"presaleInterval","type":"uint256"},{"internalType":"uint256","name":"claimStartTime","type":"uint256"},{"internalType":"uint256","name":"claimEndTime","type":"uint256"},{"internalType":"bool","name":"useDynamicPresalePurchaseLimit","type":"bool"}],"internalType":"struct IERC721Collection.CollectionState","name":"","type":"tuple"}],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transactionLimit","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"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":[],"name":"transferLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"bps","type":"uint256"}],"name":"updateRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useDynamicPresalePurchaseLimit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620042f7380380620042f78339810160408190526200003491620002e6565b604051806040016040528060088152602001674368696d7065727360c01b8152506040518060400160405280600581526020016404348494d560dc1b8152506200008d62000087620000ed60201b60201c565b620000f1565b8151620000a290601190602085019062000240565b508051620000b890601290602084019062000240565b505050620000e66115b366f8b0a10e47000060008066f8b0a10e47000060008760016200014360201b60201c565b5062000355565b3390565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000546001600160a01b031615620001a15760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a656400000000000000000000000000604482015260640160405180910390fd5b6008805460099890985563ffffffff60b01b19909716600160b01b61ffff998a160261ffff60c01b191617600160c01b968916969096029590951761ffff60a01b1916600160a01b9488169490940293909317909455600b55600a805461ffff19169390941692909217909255600080546001600160a01b0319166001600160a01b03909216919091179055600c805460ff1916911515919091179055565b8280546200024e9062000318565b90600052602060002090601f016020900481019282620002725760008555620002bd565b82601f106200028d57805160ff1916838001178555620002bd565b82800160010185558215620002bd579182015b82811115620002bd578251825591602001919060010190620002a0565b50620002cb929150620002cf565b5090565b5b80821115620002cb5760008155600101620002d0565b600060208284031215620002f957600080fd5b81516001600160a01b03811681146200031157600080fd5b9392505050565b600181811c908216806200032d57607f821691505b602082108114156200034f57634e487b7160e01b600052602260045260246000fd5b50919050565b613f9280620003656000396000f3fe6080604052600436106102ff5760003560e01c806378e9792511610190578063bb3bafd6116100dc578063e59bb7a811610095578063f2fde38b1161006f578063f2fde38b14610926578063f3fef3a314610946578063f474307014610966578063fe73ad771461098157600080fd5b8063e59bb7a8146108c4578063e985e9c5146108e4578063f19605d61461090457600080fd5b8063bb3bafd614610806578063c19d93fb14610834578063c87b56dd14610856578063c8a84a8214610876578063defd6c5f14610898578063e3b9398b146108ae57600080fd5b806395d89b4111610149578063a6a11bb111610123578063a6a11bb114610790578063b0ad3541146107a6578063b88d4fde146107b9578063b9c4d9fb146107d957600080fd5b806395d89b411461073b57806399e0dd7c14610750578063a22cb4651461077057600080fd5b806378e979251461069157806381960b5c146106a7578063850217d8146106bd5780638da5cb5b146106dd578063923c235b146106fb578063956447d81461071b57600080fd5b80633197cbb61161024f57806351b42b00116102085780636c2f5acd116101e25780636c2f5acd1461061c5780636d73e6691461063c57806370a082311461065c578063715018a61461067c57600080fd5b806351b42b00146105cd57806355461d6d146105e25780636352211e146105fc57600080fd5b80633197cbb61461051157806331ae450b1461053557806335e60bd41461055757806336ef89af1461057757806340d1d2551461059757806342842e0e146105ad57600080fd5b806312686aae116102bc57806324d7806c1161029657806324d7806c146104725780632a55205a146104925780632b85ed9c146104d15780632d345670146104f157600080fd5b806312686aae146103fc578063188866571461041d57806323b872dd1461045257600080fd5b806301ffc9a71461030457806302fb0c5e1461033957806306fdde0314610353578063081812fc14610375578063095ea7b3146103ad5780630ebd4c7f146103cf575b600080fd5b34801561031057600080fd5b5061032461031f366004613660565b610996565b60405190151581526020015b60405180910390f35b34801561034557600080fd5b506002546103249060ff1681565b34801561035f57600080fd5b506103686109c5565b6040516103309190613ae9565b34801561038157600080fd5b506103956103903660046137ca565b610a57565b6040516001600160a01b039091168152602001610330565b3480156103b957600080fd5b506103cd6103c8366004613475565b610af1565b005b3480156103db57600080fd5b506103ef6103ea3660046137ca565b610c07565b6040516103309190613ad6565b34801561040857600080fd5b5060105461032490600160a01b900460ff1681565b34801561042957600080fd5b5060085461043f90600160c01b900461ffff1681565b60405161ffff9091168152602001610330565b34801561045e57600080fd5b506103cd61046d3660046134da565b610c63565b34801561047e57600080fd5b5061032461048d366004613458565b610c94565b34801561049e57600080fd5b506104b26104ad3660046137e3565b610ccd565b604080516001600160a01b039093168352602083019190915201610330565b3480156104dd57600080fd5b50600c5461043f90610100900461ffff1681565b3480156104fd57600080fd5b506103cd61050c366004613458565b610d08565b34801561051d57600080fd5b5061052760045481565b604051908152602001610330565b34801561054157600080fd5b5061054a610d88565b6040516103309190613a48565b34801561056357600080fd5b506103cd610572366004613645565b610e37565b34801561058357600080fd5b506103cd610592366004613740565b610e9b565b3480156105a357600080fd5b5061052760075481565b3480156105b957600080fd5b506103cd6105c83660046134da565b610ee4565b3480156105d957600080fd5b506103cd610eff565b3480156105ee57600080fd5b50600c546103249060ff1681565b34801561060857600080fd5b506103956106173660046137ca565b610f53565b34801561062857600080fd5b506103cd610637366004613475565b610fca565b34801561064857600080fd5b506103cd610657366004613458565b611039565b34801561066857600080fd5b50610527610677366004613458565b6110b3565b34801561068857600080fd5b506103cd6110be565b34801561069d57600080fd5b5061052760035481565b3480156106b357600080fd5b50610527600b5481565b3480156106c957600080fd5b506103cd6106d8366004613725565b6110f2565b3480156106e957600080fd5b506008546001600160a01b0316610395565b34801561070757600080fd5b506103246107163660046136dc565b611157565b34801561072757600080fd5b506103cd610736366004613805565b61117c565b34801561074757600080fd5b506103686111da565b34801561075c57600080fd5b506103cd61076b36600461369a565b6111e9565b34801561077c57600080fd5b506103cd61078b36600461359b565b61123d565b34801561079c57600080fd5b5061052760065481565b6103cd6107b4366004613740565b611248565b3480156107c557600080fd5b506103cd6107d436600461351b565b611540565b3480156107e557600080fd5b506107f96107f43660046137ca565b611578565b6040516103309190613a95565b34801561081257600080fd5b506108266108213660046137ca565b6115f1565b604051610330929190613aa8565b34801561084057600080fd5b506108496116a5565b6040516103309190613c6c565b34801561086257600080fd5b506103686108713660046137ca565b6117ef565b34801561088257600080fd5b5060085461043f90600160b01b900461ffff1681565b3480156108a457600080fd5b5061052760095481565b3480156108ba57600080fd5b5061052760055481565b3480156108d057600080fd5b506103cd6108df3660046135d0565b6118ca565b3480156108f057600080fd5b506103246108ff3660046134a1565b61191e565b34801561091057600080fd5b5060085461043f90600160a01b900461ffff1681565b34801561093257600080fd5b506103cd610941366004613458565b61194c565b34801561095257600080fd5b506103cd610961366004613475565b6119e4565b34801561097257600080fd5b50600a5461043f9061ffff1681565b34801561098d57600080fd5b5061043f611a38565b60006109a182611a64565b806109b057506109b082611ad0565b806109bf57506109bf82611b20565b92915050565b6060601180546109d490613e21565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0090613e21565b8015610a4d5780601f10610a2257610100808354040283529160200191610a4d565b820191906000526020600020905b815481529060010190602001808311610a3057829003601f168201915b5050505050905090565b6000818152601360205260408120546001600160a01b0316610ad55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152601560205260409020546001600160a01b031690565b6000610afc82610f53565b9050806001600160a01b0316836001600160a01b03161415610b6a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610acc565b336001600160a01b0382161480610b865750610b86813361191e565b610bf85760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610acc565b610c028383611b45565b505050565b6010546060906001600160a01b031615610c5e576040805160018082528183019092529060208083019080368337019050509050600f5481600081518110610c5157610c51613f05565b6020026020010181815250505b919050565b610c6d3382611bb3565b610c895760405162461bcd60e51b8152600401610acc90613bd7565b610c02838383611c8a565b6000816001600160a01b0316610cb26008546001600160a01b031690565b6001600160a01b031614806109bf57506109bf601783611e31565b601054600f5460009182916001600160a01b039091169061271090610cf29086613d9c565b610cfc9190613d88565b915091505b9250929050565b6008546001600160a01b03163314610d325760405162461bcd60e51b8152600401610acc90613b7a565b610d3d601782611e31565b15610d855760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a3610d83601782611e53565b505b50565b6060610d946017611e68565b67ffffffffffffffff811115610dac57610dac613f1b565b604051908082528060200260200182016040528015610dd5578160200160208202803683370190505b50905060005b610de56017611e68565b811015610e3357610df7601782611e72565b828281518110610e0957610e09613f05565b6001600160a01b039092166020928302919091019091015280610e2b81613e7e565b915050610ddb565b5090565b33610e4a6008546001600160a01b031690565b6001600160a01b03161480610e655750610e65601733611e31565b610e815760405162461bcd60e51b8152600401610acc90613c28565b6010805460ff60a01b1916600160a01b8315150217905550565b610ea3611e7e565b610eb185858585858b611f13565b60005b8661ffff16811015610edb57610ec933611f29565b80610ed381613e7e565b915050610eb4565b50505050505050565b610c0283838360405180602001604052806000815250611540565b33610f126008546001600160a01b031690565b6001600160a01b03161480610f2d5750610f2d601733611e31565b610f495760405162461bcd60e51b8152600401610acc90613c28565b610f51611fbf565b565b6000818152601360205260408120546001600160a01b0316806109bf5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610acc565b33610fdd6008546001600160a01b031690565b6001600160a01b03161480610ff85750610ff8601733611e31565b6110145760405162461bcd60e51b8152600401610acc90613c28565b601080546001600160a01b0319166001600160a01b038416179055600f819055610d83565b6008546001600160a01b031633146110635760405162461bcd60e51b8152600401610acc90613b7a565b61106e601782611e31565b610d855760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a3610d83601782612008565b60006109bf8261201d565b6008546001600160a01b031633146110e85760405162461bcd60e51b8152600401610acc90613b7a565b610f5160006120a4565b336111056008546001600160a01b031690565b6001600160a01b031614806111205750611120601733611e31565b61113c5760405162461bcd60e51b8152600401610acc90613c28565b610d85816111526008546001600160a01b031690565b6120f6565b60008061116383612143565b60009081526001602052604090205460ff169392505050565b3361118f6008546001600160a01b031690565b6001600160a01b031614806111aa57506111aa601733611e31565b6111c65760405162461bcd60e51b8152600401610acc90613c28565b6111d38585858585612194565b5050505050565b6060601280546109d490613e21565b336111fc6008546001600160a01b031690565b6001600160a01b031614806112175750611217601733611e31565b6112335760405162461bcd60e51b8152600401610acc90613c28565b610d83828261234a565b610d83338383612356565b611250612425565b600061125a6124ac565b336000908152600d602052604090205490915061ffff16611279611a38565b61ffff168861ffff16111580156112cc575081801561129a5750600c5460ff165b806112b05750600854600160a01b900461ffff16155b806112cc575060085461ffff600160a01b909104811690891611155b6112e85760405162461bcd60e51b8152600401610acc90613b4e565b81156113fb57600c5460ff16806113945750600a5461ffff1615806113395750600a5461ffff80831691161180156113395750600a5461132d90829061ffff16613dbb565b61ffff168861ffff1611155b80156113945750600854600160c01b900461ffff161580611394575060085461ffff808316600160c01b909204161180156113945750600854611388908290600160c01b900461ffff16613dbb565b61ffff168861ffff1611155b6113b05760405162461bcd60e51b8152600401610acc90613b4e565b6113b9886124d0565b336000908152600d6020526040812080548a92906113dc90849061ffff16613d53565b92506101000a81548161ffff021916908361ffff1602179055506114d7565b600854600160c01b900461ffff161580611461575060085461ffff808316600160c01b909204161180156114615750336000908152600d60205260409020546008546114559161ffff90811691600160c01b900416613dbb565b61ffff168861ffff1611155b61147d5760405162461bcd60e51b8152600401610acc90613b4e565b6114868861252f565b600854600160c01b900461ffff16156114d757336000908152600d6020526040812080548a92906114bc90849061ffff16613d53565b92506101000a81548161ffff021916908361ffff1602179055505b8180156114e65750600c5460ff165b156114fe576114f987878787878d612540565b61150b565b61150b8787878787612749565b60005b8861ffff168110156115355761152333611f29565b8061152d81613e7e565b91505061150e565b505050505050505050565b61154a3383611bb3565b6115665760405162461bcd60e51b8152600401610acc90613bd7565b61157284848484612926565b50505050565b6010546060906001600160a01b031615610c5e576040805160018082528183019092529060208083019080368337505060105482519293506001600160a01b0316918391506000906115cc576115cc613f05565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b60105460609081906001600160a01b0316156116a0576040805160018082528183019092529060208083019080368337505060105482519294506001600160a01b03169184915060009061164757611647613f05565b6001600160a01b0392909216602092830291909101820152604080516001808252818301909252918281019080368337019050509050600f548160008151811061169357611693613f05565b6020026020010181815250505b915091565b604080516101e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c0810191909152604080516101e08101825260085461ffff600160a01b820481168352600160b01b909104166020820152908101611753611a38565b61ffff9081168252600954602080840191909152600854600160c01b90048216604080850191909152600b546060850152600a5483166080850152336000908152600d9092529020541660a082015260025460ff908116151560c083015260035460e0830152600454610100830152600554610120830152600654610140830152600754610160830152600c5416151561018090910152919050565b6000818152601360205260409020546060906001600160a01b031661186e5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610acc565b6000611878612959565b9050600081511161189857604051806020016040528060008152506118c3565b806118a284612968565b6040516020016118b39291906138e0565b6040516020818303038152906040525b9392505050565b336118dd6008546001600160a01b031690565b6001600160a01b031614806118f857506118f8601733611e31565b6119145760405162461bcd60e51b8152600401610acc90613c28565b610d838282612a66565b6001600160a01b03918216600090815260166020908152604080832093909416825291909152205460ff1690565b6008546001600160a01b031633146119765760405162461bcd60e51b8152600401610acc90613b7a565b6001600160a01b0381166119db5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610acc565b610d85816120a4565b336119f76008546001600160a01b031690565b6001600160a01b03161480611a125750611a12601733611e31565b611a2e5760405162461bcd60e51b8152600401610acc90613c28565b610d838282612ad5565b600c54600854600091611a5f9161ffff610100909204821691600160b01b90910416613dbb565b905090565b60006001600160e01b0319821663421d6bc160e01b1480611a9557506001600160e01b03198216635d9dd7eb60e11b145b80611ab057506001600160e01b0319821663152a902d60e11b145b806109bf57506001600160e01b03198216632dde656160e21b1492915050565b60006001600160e01b031982166380ac58cd60e01b1480611b0157506001600160e01b03198216635b5e139f60e01b145b806109bf57506301ffc9a760e01b6001600160e01b03198316146109bf565b60006001600160e01b03198216632a9f3abf60e11b14806109bf57506109bf82611ad0565b600081815260156020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611b7a82610f53565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152601360205260408120546001600160a01b0316611c2c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610acc565b6000611c3783610f53565b9050806001600160a01b0316846001600160a01b03161480611c5e5750611c5e818561191e565b80611c825750836001600160a01b0316611c7784610a57565b6001600160a01b0316145b949350505050565b826001600160a01b0316611c9d82610f53565b6001600160a01b031614611d015760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610acc565b6001600160a01b038216611d635760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610acc565b611d6e838383612b35565b611d79600082611b45565b6001600160a01b0383166000908152601460205260408120805460019290611da2908490613dde565b90915550506001600160a01b0382166000908152601460205260408120805460019290611dd0908490613d70565b909155505060008181526013602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038116600090815260018301602052604081205415156118c3565b60006118c3836001600160a01b038416612b3e565b60006109bf825490565b60006118c38383612c31565b60025460ff16611ebb5760405162461bcd60e51b8152602060048201526008602482015267496e61637469766560c01b6044820152606401610acc565b6006544210158015611ecf57506007544211155b610f515760405162461bcd60e51b815260206004820152601560248201527427baba39b4b2329031b630b4b6903832b934b7b21760591b6044820152606401610acc565b611f21868686868686612540565b505050505050565b600c8054610100900461ffff16906001611f4283613e5c565b825461ffff91821661010093840a9081029083021990911617909255600c54611f719350849291900416612c5b565b600c546040805161010090920461ffff16808352306020840152908201527f7a607f1ab973d85727d0ff44300699ee672c0e1d76f35013f36c02772f524ba39060600160405180910390a150565b6000600381905560048190556002805460ff19169055600681905560078190556040517fb02389feab3af620e2374d4d559b436ea226b1e6c9c31fe77dfbff3d40cbe9ba9190a1565b60006118c3836001600160a01b038416612c65565b60006001600160a01b0382166120885760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610acc565b506001600160a01b031660009081526014602052604090205490565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60025460ff16156121195760405162461bcd60e51b8152600401610acc90613baf565b60005b8261ffff16811015610c025761213182611f29565b8061213b81613e7e565b91505061211c565b60008082905060208151111561218b5760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964206e6f6e636560981b6044820152606401610acc565b50506020015190565b60025460ff16156121b75760405162461bcd60e51b8152600401610acc90613baf565b4285116122065760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f7420616374697661746520696e20746865207061737400000000006044820152606401610acc565b8383111561226e5760405162461bcd60e51b815260206004820152602f60248201527f50726573616c6520496e74657276616c2063616e6e6f74206265206c6f6e676560448201526e72207468616e207468652073616c6560881b6064820152608401610acc565b80821115801561227e5750848111155b6122c05760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420636c61696d2074696d657360681b6044820152606401610acc565b60038590556122cf8486613d70565b60048190556005849055600683905560078290556002805460ff1916600117905560035460408051918252602082019290925290810184905260608101839052608081018290527fe512d106f8172b08abfd2fc5ddfdb7e2401381780ae29e29f1352b862f1d27319060a00160405180910390a15050505050565b610c02600e83836132ee565b816001600160a01b0316836001600160a01b031614156123b85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610acc565b6001600160a01b03838116600081815260166020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60025460ff166124625760405162461bcd60e51b8152602060048201526008602482015267496e61637469766560c01b6044820152606401610acc565b600354421015610f515760405162461bcd60e51b815260206004820152601560248201527450757263686173696e67206e6f742061637469766560581b6044820152606401610acc565b600060035442118015611a5f57506005546003546124ca9042613dde565b10905090565b600b546124e19061ffff8316613d9c565b3414610d855760405162461bcd60e51b815260206004820152601c60248201527f496e76616c696420707572636861736520616d6f756e742073656e74000000006044820152606401610acc565b6009546124e19061ffff8316613d9c565b600061258184848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061214392505050565b60008181526001602052604090205490915060ff16156125df5760405162461bcd60e51b815260206004820152601960248201527821b0b73737ba103932b83630bc903a3930b739b0b1ba34b7b760391b6044820152606401610acc565b600061260c6125f18461ffff16612968565b516125fd866014613d70565b6126079190613d70565b612968565b33868661261c8761ffff16612968565b60405160200161263095949392919061397f565b60405160208183030381529060405280519060200120905080881461268b5760405162461bcd60e51b81526020600482015260116024820152704d616c666f726d6564206d65737361676560781b6044820152606401610acc565b60006126cf88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d93925050612cb49050565b6000549091506001600160a01b038083169116146127235760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610acc565b50506000908152600160208190526040909120805460ff19169091179055505050505050565b600061278a83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061214392505050565b60008181526001602052604090205490915060ff16156127e85760405162461bcd60e51b815260206004820152601960248201527821b0b73737ba103932b83630bc903a3930b739b0b1ba34b7b760391b6044820152606401610acc565b60006127f8612607846014613d70565b33858560405160200161280e949392919061390f565b6040516020818303038152906040528051906020012090508087146128695760405162461bcd60e51b81526020600482015260116024820152704d616c666f726d6564206d65737361676560781b6044820152606401610acc565b60006128ad87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c93925050612cb49050565b6000549091506001600160a01b038083169116146129015760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610acc565b50506000908152600160208190526040909120805460ff191690911790555050505050565b612931848484611c8a565b61293d84848484612cd8565b6115725760405162461bcd60e51b8152600401610acc90613afc565b6060600e80546109d490613e21565b60608161298c5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156129b657806129a081613e7e565b91506129af9050600a83613d88565b9150612990565b60008167ffffffffffffffff8111156129d1576129d1613f1b565b6040519080825280601f01601f1916602001820160405280156129fb576020820181803683370190505b5090505b8415611c8257612a10600183613dde565b9150612a1d600a86613e99565b612a28906030613d70565b60f81b818381518110612a3d57612a3d613f05565b60200101906001600160f81b031916908160001a905350612a5f600a86613d88565b94506129ff565b60025460ff1615612a895760405162461bcd60e51b8152600401610acc90613baf565b60005b81811015610c0257612ac3838383818110612aa957612aa9613f05565b9050602002016020810190612abe9190613458565b611f29565b80612acd81613e7e565b915050612a8c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612b22576040519150601f19603f3d011682016040523d82523d6000602084013e612b27565b606091505b5050905080610c0257600080fd5b610c0283612de5565b60008181526001830160205260408120548015612c27576000612b62600183613dde565b8554909150600090612b7690600190613dde565b9050818114612bdb576000866000018281548110612b9657612b96613f05565b9060005260206000200154905080876000018481548110612bb957612bb9613f05565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612bec57612bec613eef565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506109bf565b60009150506109bf565b6000826000018281548110612c4857612c48613f05565b9060005260206000200154905092915050565b610d838282612e51565b6000818152600183016020526040812054612cac575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556109bf565b5060006109bf565b6000806000612cc38585612fa0565b91509150612cd08161300d565b509392505050565b60006001600160a01b0384163b15612dda57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612d1c903390899088908890600401613a0b565b602060405180830381600087803b158015612d3657600080fd5b505af1925050508015612d66575060408051601f3d908101601f19168201909252612d639181019061367d565b60015b612dc0573d808015612d94576040519150601f19603f3d011682016040523d82523d6000602084013e612d99565b606091505b508051612db85760405162461bcd60e51b8152600401610acc90613afc565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611c82565b506001949350505050565b601054600160a01b900460ff161580612e0557506001600160a01b038116155b610d855760405162461bcd60e51b815260206004820152601f60248201527f5472616e73666572206c6f636b656420756e74696c2073616c6520656e6473006044820152606401610acc565b6001600160a01b038216612ea75760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610acc565b6000818152601360205260409020546001600160a01b031615612f0c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610acc565b612f1860008383612b35565b6001600160a01b0382166000908152601460205260408120805460019290612f41908490613d70565b909155505060008181526013602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610d83565b600080825160411415612fd75760208301516040840151606085015160001a612fcb878285856131c8565b94509450505050610d01565b8251604014156130015760208301516040840151612ff68683836132b5565b935093505050610d01565b50600090506002610d01565b600081600481111561302157613021613ed9565b141561302a5750565b600181600481111561303e5761303e613ed9565b141561308c5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610acc565b60028160048111156130a0576130a0613ed9565b14156130ee5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610acc565b600381600481111561310257613102613ed9565b141561315b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610acc565b600481600481111561316f5761316f613ed9565b1415610d855760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610acc565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156131ff57506000905060036132ac565b8460ff16601b1415801561321757508460ff16601c14155b1561322857506000905060046132ac565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561327c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166132a5576000600192509250506132ac565b9150600090505b94509492505050565b6000806001600160ff1b038316816132d260ff86901c601b613d70565b90506132e0878288856131c8565b935093505050935093915050565b8280546132fa90613e21565b90600052602060002090601f01602090048101928261331c5760008555613362565b82601f106133355782800160ff19823516178555613362565b82800160010185558215613362579182015b82811115613362578235825591602001919060010190613347565b50610e339291505b80821115610e33576000815560010161336a565b600067ffffffffffffffff8084111561339957613399613f1b565b604051601f8501601f19908116603f011681019082821181831017156133c1576133c1613f1b565b816040528093508581528686860111156133da57600080fd5b858560208301376000602087830101525050509392505050565b80358015158114610c5e57600080fd5b60008083601f84011261341657600080fd5b50813567ffffffffffffffff81111561342e57600080fd5b602083019150836020828501011115610d0157600080fd5b803561ffff81168114610c5e57600080fd5b60006020828403121561346a57600080fd5b81356118c381613f31565b6000806040838503121561348857600080fd5b823561349381613f31565b946020939093013593505050565b600080604083850312156134b457600080fd5b82356134bf81613f31565b915060208301356134cf81613f31565b809150509250929050565b6000806000606084860312156134ef57600080fd5b83356134fa81613f31565b9250602084013561350a81613f31565b929592945050506040919091013590565b6000806000806080858703121561353157600080fd5b843561353c81613f31565b9350602085013561354c81613f31565b925060408501359150606085013567ffffffffffffffff81111561356f57600080fd5b8501601f8101871361358057600080fd5b61358f8782356020840161337e565b91505092959194509250565b600080604083850312156135ae57600080fd5b82356135b981613f31565b91506135c7602084016133f4565b90509250929050565b600080602083850312156135e357600080fd5b823567ffffffffffffffff808211156135fb57600080fd5b818501915085601f83011261360f57600080fd5b81358181111561361e57600080fd5b8660208260051b850101111561363357600080fd5b60209290920196919550909350505050565b60006020828403121561365757600080fd5b6118c3826133f4565b60006020828403121561367257600080fd5b81356118c381613f46565b60006020828403121561368f57600080fd5b81516118c381613f46565b600080602083850312156136ad57600080fd5b823567ffffffffffffffff8111156136c457600080fd5b6136d085828601613404565b90969095509350505050565b6000602082840312156136ee57600080fd5b813567ffffffffffffffff81111561370557600080fd5b8201601f8101841361371657600080fd5b611c828482356020840161337e565b60006020828403121561373757600080fd5b6118c382613446565b6000806000806000806080878903121561375957600080fd5b61376287613446565b955060208701359450604087013567ffffffffffffffff8082111561378657600080fd5b6137928a838b01613404565b909650945060608901359150808211156137ab57600080fd5b506137b889828a01613404565b979a9699509497509295939492505050565b6000602082840312156137dc57600080fd5b5035919050565b600080604083850312156137f657600080fd5b50508035926020909101359150565b600080600080600060a0868803121561381d57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b600081518084526020808501945080840160005b838110156138795781516001600160a01b031687529582019590820190600101613854565b509495945050505050565b600081518084526020808501945080840160005b8381101561387957815187529582019590820190600101613898565b600081518084526138cc816020860160208601613df5565b601f01601f19169290920160200192915050565b600083516138f2818460208801613df5565b835190830190613906818360208801613df5565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a00000000000081526000855161394781601a850160208a01613df5565b606086901b6bffffffffffffffffffffffff1916601a918401918201528385602e83013760009301602e019283525090949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152600086516139b781601a850160208b01613df5565b606087901b6bffffffffffffffffffffffff1916601a918401918201528486602e8301378481019050602e81016000815284516139f8818360208901613df5565b91909101602e0198975050505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613a3e908301846138b4565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613a895783516001600160a01b031683529284019291840191600101613a64565b50909695505050505050565b6020815260006118c36020830184613840565b604081526000613abb6040830185613840565b8281036020840152613acd8185613884565b95945050505050565b6020815260006118c36020830184613884565b6020815260006118c360208301846138b4565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b602080825260129082015271151bdbc81b585b9e481c995c5d595cdd195960721b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600e908201526d416c72656164792061637469766560901b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b815161ffff1681526101e081016020830151613c8e602084018261ffff169052565b506040830151613ca4604084018261ffff169052565b50606083015160608301526080830151613cc4608084018261ffff169052565b5060a083015160a083015260c0830151613ce460c084018261ffff169052565b5060e0830151613cfa60e084018261ffff169052565b506101008381015115159083015261012080840151908301526101408084015190830152610160808401519083015261018080840151908301526101a080840151908301526101c0928301511515929091019190915290565b600061ffff80831681851680830382111561390657613906613ead565b60008219821115613d8357613d83613ead565b500190565b600082613d9757613d97613ec3565b500490565b6000816000190483118215151615613db657613db6613ead565b500290565b600061ffff83811690831681811015613dd657613dd6613ead565b039392505050565b600082821015613df057613df0613ead565b500390565b60005b83811015613e10578181015183820152602001613df8565b838111156115725750506000910152565b600181811c90821680613e3557607f821691505b60208210811415613e5657634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff80831681811415613e7457613e74613ead565b6001019392505050565b6000600019821415613e9257613e92613ead565b5060010190565b600082613ea857613ea8613ec3565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610d8557600080fd5b6001600160e01b031981168114610d8557600080fdfea2646970667358221220338dec048b4c86b673cb2b065d1bb364ec80797084965d0dca0f9611dfff710764736f6c63430008070033000000000000000000000000720b18fdbc5ed327d67b56f94a2748470b658b96

Deployed Bytecode

0x6080604052600436106102ff5760003560e01c806378e9792511610190578063bb3bafd6116100dc578063e59bb7a811610095578063f2fde38b1161006f578063f2fde38b14610926578063f3fef3a314610946578063f474307014610966578063fe73ad771461098157600080fd5b8063e59bb7a8146108c4578063e985e9c5146108e4578063f19605d61461090457600080fd5b8063bb3bafd614610806578063c19d93fb14610834578063c87b56dd14610856578063c8a84a8214610876578063defd6c5f14610898578063e3b9398b146108ae57600080fd5b806395d89b4111610149578063a6a11bb111610123578063a6a11bb114610790578063b0ad3541146107a6578063b88d4fde146107b9578063b9c4d9fb146107d957600080fd5b806395d89b411461073b57806399e0dd7c14610750578063a22cb4651461077057600080fd5b806378e979251461069157806381960b5c146106a7578063850217d8146106bd5780638da5cb5b146106dd578063923c235b146106fb578063956447d81461071b57600080fd5b80633197cbb61161024f57806351b42b00116102085780636c2f5acd116101e25780636c2f5acd1461061c5780636d73e6691461063c57806370a082311461065c578063715018a61461067c57600080fd5b806351b42b00146105cd57806355461d6d146105e25780636352211e146105fc57600080fd5b80633197cbb61461051157806331ae450b1461053557806335e60bd41461055757806336ef89af1461057757806340d1d2551461059757806342842e0e146105ad57600080fd5b806312686aae116102bc57806324d7806c1161029657806324d7806c146104725780632a55205a146104925780632b85ed9c146104d15780632d345670146104f157600080fd5b806312686aae146103fc578063188866571461041d57806323b872dd1461045257600080fd5b806301ffc9a71461030457806302fb0c5e1461033957806306fdde0314610353578063081812fc14610375578063095ea7b3146103ad5780630ebd4c7f146103cf575b600080fd5b34801561031057600080fd5b5061032461031f366004613660565b610996565b60405190151581526020015b60405180910390f35b34801561034557600080fd5b506002546103249060ff1681565b34801561035f57600080fd5b506103686109c5565b6040516103309190613ae9565b34801561038157600080fd5b506103956103903660046137ca565b610a57565b6040516001600160a01b039091168152602001610330565b3480156103b957600080fd5b506103cd6103c8366004613475565b610af1565b005b3480156103db57600080fd5b506103ef6103ea3660046137ca565b610c07565b6040516103309190613ad6565b34801561040857600080fd5b5060105461032490600160a01b900460ff1681565b34801561042957600080fd5b5060085461043f90600160c01b900461ffff1681565b60405161ffff9091168152602001610330565b34801561045e57600080fd5b506103cd61046d3660046134da565b610c63565b34801561047e57600080fd5b5061032461048d366004613458565b610c94565b34801561049e57600080fd5b506104b26104ad3660046137e3565b610ccd565b604080516001600160a01b039093168352602083019190915201610330565b3480156104dd57600080fd5b50600c5461043f90610100900461ffff1681565b3480156104fd57600080fd5b506103cd61050c366004613458565b610d08565b34801561051d57600080fd5b5061052760045481565b604051908152602001610330565b34801561054157600080fd5b5061054a610d88565b6040516103309190613a48565b34801561056357600080fd5b506103cd610572366004613645565b610e37565b34801561058357600080fd5b506103cd610592366004613740565b610e9b565b3480156105a357600080fd5b5061052760075481565b3480156105b957600080fd5b506103cd6105c83660046134da565b610ee4565b3480156105d957600080fd5b506103cd610eff565b3480156105ee57600080fd5b50600c546103249060ff1681565b34801561060857600080fd5b506103956106173660046137ca565b610f53565b34801561062857600080fd5b506103cd610637366004613475565b610fca565b34801561064857600080fd5b506103cd610657366004613458565b611039565b34801561066857600080fd5b50610527610677366004613458565b6110b3565b34801561068857600080fd5b506103cd6110be565b34801561069d57600080fd5b5061052760035481565b3480156106b357600080fd5b50610527600b5481565b3480156106c957600080fd5b506103cd6106d8366004613725565b6110f2565b3480156106e957600080fd5b506008546001600160a01b0316610395565b34801561070757600080fd5b506103246107163660046136dc565b611157565b34801561072757600080fd5b506103cd610736366004613805565b61117c565b34801561074757600080fd5b506103686111da565b34801561075c57600080fd5b506103cd61076b36600461369a565b6111e9565b34801561077c57600080fd5b506103cd61078b36600461359b565b61123d565b34801561079c57600080fd5b5061052760065481565b6103cd6107b4366004613740565b611248565b3480156107c557600080fd5b506103cd6107d436600461351b565b611540565b3480156107e557600080fd5b506107f96107f43660046137ca565b611578565b6040516103309190613a95565b34801561081257600080fd5b506108266108213660046137ca565b6115f1565b604051610330929190613aa8565b34801561084057600080fd5b506108496116a5565b6040516103309190613c6c565b34801561086257600080fd5b506103686108713660046137ca565b6117ef565b34801561088257600080fd5b5060085461043f90600160b01b900461ffff1681565b3480156108a457600080fd5b5061052760095481565b3480156108ba57600080fd5b5061052760055481565b3480156108d057600080fd5b506103cd6108df3660046135d0565b6118ca565b3480156108f057600080fd5b506103246108ff3660046134a1565b61191e565b34801561091057600080fd5b5060085461043f90600160a01b900461ffff1681565b34801561093257600080fd5b506103cd610941366004613458565b61194c565b34801561095257600080fd5b506103cd610961366004613475565b6119e4565b34801561097257600080fd5b50600a5461043f9061ffff1681565b34801561098d57600080fd5b5061043f611a38565b60006109a182611a64565b806109b057506109b082611ad0565b806109bf57506109bf82611b20565b92915050565b6060601180546109d490613e21565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0090613e21565b8015610a4d5780601f10610a2257610100808354040283529160200191610a4d565b820191906000526020600020905b815481529060010190602001808311610a3057829003601f168201915b5050505050905090565b6000818152601360205260408120546001600160a01b0316610ad55760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152601560205260409020546001600160a01b031690565b6000610afc82610f53565b9050806001600160a01b0316836001600160a01b03161415610b6a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610acc565b336001600160a01b0382161480610b865750610b86813361191e565b610bf85760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610acc565b610c028383611b45565b505050565b6010546060906001600160a01b031615610c5e576040805160018082528183019092529060208083019080368337019050509050600f5481600081518110610c5157610c51613f05565b6020026020010181815250505b919050565b610c6d3382611bb3565b610c895760405162461bcd60e51b8152600401610acc90613bd7565b610c02838383611c8a565b6000816001600160a01b0316610cb26008546001600160a01b031690565b6001600160a01b031614806109bf57506109bf601783611e31565b601054600f5460009182916001600160a01b039091169061271090610cf29086613d9c565b610cfc9190613d88565b915091505b9250929050565b6008546001600160a01b03163314610d325760405162461bcd60e51b8152600401610acc90613b7a565b610d3d601782611e31565b15610d855760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a3610d83601782611e53565b505b50565b6060610d946017611e68565b67ffffffffffffffff811115610dac57610dac613f1b565b604051908082528060200260200182016040528015610dd5578160200160208202803683370190505b50905060005b610de56017611e68565b811015610e3357610df7601782611e72565b828281518110610e0957610e09613f05565b6001600160a01b039092166020928302919091019091015280610e2b81613e7e565b915050610ddb565b5090565b33610e4a6008546001600160a01b031690565b6001600160a01b03161480610e655750610e65601733611e31565b610e815760405162461bcd60e51b8152600401610acc90613c28565b6010805460ff60a01b1916600160a01b8315150217905550565b610ea3611e7e565b610eb185858585858b611f13565b60005b8661ffff16811015610edb57610ec933611f29565b80610ed381613e7e565b915050610eb4565b50505050505050565b610c0283838360405180602001604052806000815250611540565b33610f126008546001600160a01b031690565b6001600160a01b03161480610f2d5750610f2d601733611e31565b610f495760405162461bcd60e51b8152600401610acc90613c28565b610f51611fbf565b565b6000818152601360205260408120546001600160a01b0316806109bf5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610acc565b33610fdd6008546001600160a01b031690565b6001600160a01b03161480610ff85750610ff8601733611e31565b6110145760405162461bcd60e51b8152600401610acc90613c28565b601080546001600160a01b0319166001600160a01b038416179055600f819055610d83565b6008546001600160a01b031633146110635760405162461bcd60e51b8152600401610acc90613b7a565b61106e601782611e31565b610d855760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a3610d83601782612008565b60006109bf8261201d565b6008546001600160a01b031633146110e85760405162461bcd60e51b8152600401610acc90613b7a565b610f5160006120a4565b336111056008546001600160a01b031690565b6001600160a01b031614806111205750611120601733611e31565b61113c5760405162461bcd60e51b8152600401610acc90613c28565b610d85816111526008546001600160a01b031690565b6120f6565b60008061116383612143565b60009081526001602052604090205460ff169392505050565b3361118f6008546001600160a01b031690565b6001600160a01b031614806111aa57506111aa601733611e31565b6111c65760405162461bcd60e51b8152600401610acc90613c28565b6111d38585858585612194565b5050505050565b6060601280546109d490613e21565b336111fc6008546001600160a01b031690565b6001600160a01b031614806112175750611217601733611e31565b6112335760405162461bcd60e51b8152600401610acc90613c28565b610d83828261234a565b610d83338383612356565b611250612425565b600061125a6124ac565b336000908152600d602052604090205490915061ffff16611279611a38565b61ffff168861ffff16111580156112cc575081801561129a5750600c5460ff165b806112b05750600854600160a01b900461ffff16155b806112cc575060085461ffff600160a01b909104811690891611155b6112e85760405162461bcd60e51b8152600401610acc90613b4e565b81156113fb57600c5460ff16806113945750600a5461ffff1615806113395750600a5461ffff80831691161180156113395750600a5461132d90829061ffff16613dbb565b61ffff168861ffff1611155b80156113945750600854600160c01b900461ffff161580611394575060085461ffff808316600160c01b909204161180156113945750600854611388908290600160c01b900461ffff16613dbb565b61ffff168861ffff1611155b6113b05760405162461bcd60e51b8152600401610acc90613b4e565b6113b9886124d0565b336000908152600d6020526040812080548a92906113dc90849061ffff16613d53565b92506101000a81548161ffff021916908361ffff1602179055506114d7565b600854600160c01b900461ffff161580611461575060085461ffff808316600160c01b909204161180156114615750336000908152600d60205260409020546008546114559161ffff90811691600160c01b900416613dbb565b61ffff168861ffff1611155b61147d5760405162461bcd60e51b8152600401610acc90613b4e565b6114868861252f565b600854600160c01b900461ffff16156114d757336000908152600d6020526040812080548a92906114bc90849061ffff16613d53565b92506101000a81548161ffff021916908361ffff1602179055505b8180156114e65750600c5460ff165b156114fe576114f987878787878d612540565b61150b565b61150b8787878787612749565b60005b8861ffff168110156115355761152333611f29565b8061152d81613e7e565b91505061150e565b505050505050505050565b61154a3383611bb3565b6115665760405162461bcd60e51b8152600401610acc90613bd7565b61157284848484612926565b50505050565b6010546060906001600160a01b031615610c5e576040805160018082528183019092529060208083019080368337505060105482519293506001600160a01b0316918391506000906115cc576115cc613f05565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b60105460609081906001600160a01b0316156116a0576040805160018082528183019092529060208083019080368337505060105482519294506001600160a01b03169184915060009061164757611647613f05565b6001600160a01b0392909216602092830291909101820152604080516001808252818301909252918281019080368337019050509050600f548160008151811061169357611693613f05565b6020026020010181815250505b915091565b604080516101e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c0810191909152604080516101e08101825260085461ffff600160a01b820481168352600160b01b909104166020820152908101611753611a38565b61ffff9081168252600954602080840191909152600854600160c01b90048216604080850191909152600b546060850152600a5483166080850152336000908152600d9092529020541660a082015260025460ff908116151560c083015260035460e0830152600454610100830152600554610120830152600654610140830152600754610160830152600c5416151561018090910152919050565b6000818152601360205260409020546060906001600160a01b031661186e5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610acc565b6000611878612959565b9050600081511161189857604051806020016040528060008152506118c3565b806118a284612968565b6040516020016118b39291906138e0565b6040516020818303038152906040525b9392505050565b336118dd6008546001600160a01b031690565b6001600160a01b031614806118f857506118f8601733611e31565b6119145760405162461bcd60e51b8152600401610acc90613c28565b610d838282612a66565b6001600160a01b03918216600090815260166020908152604080832093909416825291909152205460ff1690565b6008546001600160a01b031633146119765760405162461bcd60e51b8152600401610acc90613b7a565b6001600160a01b0381166119db5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610acc565b610d85816120a4565b336119f76008546001600160a01b031690565b6001600160a01b03161480611a125750611a12601733611e31565b611a2e5760405162461bcd60e51b8152600401610acc90613c28565b610d838282612ad5565b600c54600854600091611a5f9161ffff610100909204821691600160b01b90910416613dbb565b905090565b60006001600160e01b0319821663421d6bc160e01b1480611a9557506001600160e01b03198216635d9dd7eb60e11b145b80611ab057506001600160e01b0319821663152a902d60e11b145b806109bf57506001600160e01b03198216632dde656160e21b1492915050565b60006001600160e01b031982166380ac58cd60e01b1480611b0157506001600160e01b03198216635b5e139f60e01b145b806109bf57506301ffc9a760e01b6001600160e01b03198316146109bf565b60006001600160e01b03198216632a9f3abf60e11b14806109bf57506109bf82611ad0565b600081815260156020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611b7a82610f53565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152601360205260408120546001600160a01b0316611c2c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610acc565b6000611c3783610f53565b9050806001600160a01b0316846001600160a01b03161480611c5e5750611c5e818561191e565b80611c825750836001600160a01b0316611c7784610a57565b6001600160a01b0316145b949350505050565b826001600160a01b0316611c9d82610f53565b6001600160a01b031614611d015760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610acc565b6001600160a01b038216611d635760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610acc565b611d6e838383612b35565b611d79600082611b45565b6001600160a01b0383166000908152601460205260408120805460019290611da2908490613dde565b90915550506001600160a01b0382166000908152601460205260408120805460019290611dd0908490613d70565b909155505060008181526013602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038116600090815260018301602052604081205415156118c3565b60006118c3836001600160a01b038416612b3e565b60006109bf825490565b60006118c38383612c31565b60025460ff16611ebb5760405162461bcd60e51b8152602060048201526008602482015267496e61637469766560c01b6044820152606401610acc565b6006544210158015611ecf57506007544211155b610f515760405162461bcd60e51b815260206004820152601560248201527427baba39b4b2329031b630b4b6903832b934b7b21760591b6044820152606401610acc565b611f21868686868686612540565b505050505050565b600c8054610100900461ffff16906001611f4283613e5c565b825461ffff91821661010093840a9081029083021990911617909255600c54611f719350849291900416612c5b565b600c546040805161010090920461ffff16808352306020840152908201527f7a607f1ab973d85727d0ff44300699ee672c0e1d76f35013f36c02772f524ba39060600160405180910390a150565b6000600381905560048190556002805460ff19169055600681905560078190556040517fb02389feab3af620e2374d4d559b436ea226b1e6c9c31fe77dfbff3d40cbe9ba9190a1565b60006118c3836001600160a01b038416612c65565b60006001600160a01b0382166120885760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610acc565b506001600160a01b031660009081526014602052604090205490565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60025460ff16156121195760405162461bcd60e51b8152600401610acc90613baf565b60005b8261ffff16811015610c025761213182611f29565b8061213b81613e7e565b91505061211c565b60008082905060208151111561218b5760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964206e6f6e636560981b6044820152606401610acc565b50506020015190565b60025460ff16156121b75760405162461bcd60e51b8152600401610acc90613baf565b4285116122065760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f7420616374697661746520696e20746865207061737400000000006044820152606401610acc565b8383111561226e5760405162461bcd60e51b815260206004820152602f60248201527f50726573616c6520496e74657276616c2063616e6e6f74206265206c6f6e676560448201526e72207468616e207468652073616c6560881b6064820152608401610acc565b80821115801561227e5750848111155b6122c05760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420636c61696d2074696d657360681b6044820152606401610acc565b60038590556122cf8486613d70565b60048190556005849055600683905560078290556002805460ff1916600117905560035460408051918252602082019290925290810184905260608101839052608081018290527fe512d106f8172b08abfd2fc5ddfdb7e2401381780ae29e29f1352b862f1d27319060a00160405180910390a15050505050565b610c02600e83836132ee565b816001600160a01b0316836001600160a01b031614156123b85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610acc565b6001600160a01b03838116600081815260166020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60025460ff166124625760405162461bcd60e51b8152602060048201526008602482015267496e61637469766560c01b6044820152606401610acc565b600354421015610f515760405162461bcd60e51b815260206004820152601560248201527450757263686173696e67206e6f742061637469766560581b6044820152606401610acc565b600060035442118015611a5f57506005546003546124ca9042613dde565b10905090565b600b546124e19061ffff8316613d9c565b3414610d855760405162461bcd60e51b815260206004820152601c60248201527f496e76616c696420707572636861736520616d6f756e742073656e74000000006044820152606401610acc565b6009546124e19061ffff8316613d9c565b600061258184848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061214392505050565b60008181526001602052604090205490915060ff16156125df5760405162461bcd60e51b815260206004820152601960248201527821b0b73737ba103932b83630bc903a3930b739b0b1ba34b7b760391b6044820152606401610acc565b600061260c6125f18461ffff16612968565b516125fd866014613d70565b6126079190613d70565b612968565b33868661261c8761ffff16612968565b60405160200161263095949392919061397f565b60405160208183030381529060405280519060200120905080881461268b5760405162461bcd60e51b81526020600482015260116024820152704d616c666f726d6564206d65737361676560781b6044820152606401610acc565b60006126cf88888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d93925050612cb49050565b6000549091506001600160a01b038083169116146127235760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610acc565b50506000908152600160208190526040909120805460ff19169091179055505050505050565b600061278a83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061214392505050565b60008181526001602052604090205490915060ff16156127e85760405162461bcd60e51b815260206004820152601960248201527821b0b73737ba103932b83630bc903a3930b739b0b1ba34b7b760391b6044820152606401610acc565b60006127f8612607846014613d70565b33858560405160200161280e949392919061390f565b6040516020818303038152906040528051906020012090508087146128695760405162461bcd60e51b81526020600482015260116024820152704d616c666f726d6564206d65737361676560781b6044820152606401610acc565b60006128ad87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c93925050612cb49050565b6000549091506001600160a01b038083169116146129015760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610acc565b50506000908152600160208190526040909120805460ff191690911790555050505050565b612931848484611c8a565b61293d84848484612cd8565b6115725760405162461bcd60e51b8152600401610acc90613afc565b6060600e80546109d490613e21565b60608161298c5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156129b657806129a081613e7e565b91506129af9050600a83613d88565b9150612990565b60008167ffffffffffffffff8111156129d1576129d1613f1b565b6040519080825280601f01601f1916602001820160405280156129fb576020820181803683370190505b5090505b8415611c8257612a10600183613dde565b9150612a1d600a86613e99565b612a28906030613d70565b60f81b818381518110612a3d57612a3d613f05565b60200101906001600160f81b031916908160001a905350612a5f600a86613d88565b94506129ff565b60025460ff1615612a895760405162461bcd60e51b8152600401610acc90613baf565b60005b81811015610c0257612ac3838383818110612aa957612aa9613f05565b9050602002016020810190612abe9190613458565b611f29565b80612acd81613e7e565b915050612a8c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612b22576040519150601f19603f3d011682016040523d82523d6000602084013e612b27565b606091505b5050905080610c0257600080fd5b610c0283612de5565b60008181526001830160205260408120548015612c27576000612b62600183613dde565b8554909150600090612b7690600190613dde565b9050818114612bdb576000866000018281548110612b9657612b96613f05565b9060005260206000200154905080876000018481548110612bb957612bb9613f05565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612bec57612bec613eef565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506109bf565b60009150506109bf565b6000826000018281548110612c4857612c48613f05565b9060005260206000200154905092915050565b610d838282612e51565b6000818152600183016020526040812054612cac575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556109bf565b5060006109bf565b6000806000612cc38585612fa0565b91509150612cd08161300d565b509392505050565b60006001600160a01b0384163b15612dda57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612d1c903390899088908890600401613a0b565b602060405180830381600087803b158015612d3657600080fd5b505af1925050508015612d66575060408051601f3d908101601f19168201909252612d639181019061367d565b60015b612dc0573d808015612d94576040519150601f19603f3d011682016040523d82523d6000602084013e612d99565b606091505b508051612db85760405162461bcd60e51b8152600401610acc90613afc565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611c82565b506001949350505050565b601054600160a01b900460ff161580612e0557506001600160a01b038116155b610d855760405162461bcd60e51b815260206004820152601f60248201527f5472616e73666572206c6f636b656420756e74696c2073616c6520656e6473006044820152606401610acc565b6001600160a01b038216612ea75760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610acc565b6000818152601360205260409020546001600160a01b031615612f0c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610acc565b612f1860008383612b35565b6001600160a01b0382166000908152601460205260408120805460019290612f41908490613d70565b909155505060008181526013602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610d83565b600080825160411415612fd75760208301516040840151606085015160001a612fcb878285856131c8565b94509450505050610d01565b8251604014156130015760208301516040840151612ff68683836132b5565b935093505050610d01565b50600090506002610d01565b600081600481111561302157613021613ed9565b141561302a5750565b600181600481111561303e5761303e613ed9565b141561308c5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610acc565b60028160048111156130a0576130a0613ed9565b14156130ee5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610acc565b600381600481111561310257613102613ed9565b141561315b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610acc565b600481600481111561316f5761316f613ed9565b1415610d855760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610acc565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156131ff57506000905060036132ac565b8460ff16601b1415801561321757508460ff16601c14155b1561322857506000905060046132ac565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561327c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166132a5576000600192509250506132ac565b9150600090505b94509492505050565b6000806001600160ff1b038316816132d260ff86901c601b613d70565b90506132e0878288856131c8565b935093505050935093915050565b8280546132fa90613e21565b90600052602060002090601f01602090048101928261331c5760008555613362565b82601f106133355782800160ff19823516178555613362565b82800160010185558215613362579182015b82811115613362578235825591602001919060010190613347565b50610e339291505b80821115610e33576000815560010161336a565b600067ffffffffffffffff8084111561339957613399613f1b565b604051601f8501601f19908116603f011681019082821181831017156133c1576133c1613f1b565b816040528093508581528686860111156133da57600080fd5b858560208301376000602087830101525050509392505050565b80358015158114610c5e57600080fd5b60008083601f84011261341657600080fd5b50813567ffffffffffffffff81111561342e57600080fd5b602083019150836020828501011115610d0157600080fd5b803561ffff81168114610c5e57600080fd5b60006020828403121561346a57600080fd5b81356118c381613f31565b6000806040838503121561348857600080fd5b823561349381613f31565b946020939093013593505050565b600080604083850312156134b457600080fd5b82356134bf81613f31565b915060208301356134cf81613f31565b809150509250929050565b6000806000606084860312156134ef57600080fd5b83356134fa81613f31565b9250602084013561350a81613f31565b929592945050506040919091013590565b6000806000806080858703121561353157600080fd5b843561353c81613f31565b9350602085013561354c81613f31565b925060408501359150606085013567ffffffffffffffff81111561356f57600080fd5b8501601f8101871361358057600080fd5b61358f8782356020840161337e565b91505092959194509250565b600080604083850312156135ae57600080fd5b82356135b981613f31565b91506135c7602084016133f4565b90509250929050565b600080602083850312156135e357600080fd5b823567ffffffffffffffff808211156135fb57600080fd5b818501915085601f83011261360f57600080fd5b81358181111561361e57600080fd5b8660208260051b850101111561363357600080fd5b60209290920196919550909350505050565b60006020828403121561365757600080fd5b6118c3826133f4565b60006020828403121561367257600080fd5b81356118c381613f46565b60006020828403121561368f57600080fd5b81516118c381613f46565b600080602083850312156136ad57600080fd5b823567ffffffffffffffff8111156136c457600080fd5b6136d085828601613404565b90969095509350505050565b6000602082840312156136ee57600080fd5b813567ffffffffffffffff81111561370557600080fd5b8201601f8101841361371657600080fd5b611c828482356020840161337e565b60006020828403121561373757600080fd5b6118c382613446565b6000806000806000806080878903121561375957600080fd5b61376287613446565b955060208701359450604087013567ffffffffffffffff8082111561378657600080fd5b6137928a838b01613404565b909650945060608901359150808211156137ab57600080fd5b506137b889828a01613404565b979a9699509497509295939492505050565b6000602082840312156137dc57600080fd5b5035919050565b600080604083850312156137f657600080fd5b50508035926020909101359150565b600080600080600060a0868803121561381d57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b600081518084526020808501945080840160005b838110156138795781516001600160a01b031687529582019590820190600101613854565b509495945050505050565b600081518084526020808501945080840160005b8381101561387957815187529582019590820190600101613898565b600081518084526138cc816020860160208601613df5565b601f01601f19169290920160200192915050565b600083516138f2818460208801613df5565b835190830190613906818360208801613df5565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a00000000000081526000855161394781601a850160208a01613df5565b606086901b6bffffffffffffffffffffffff1916601a918401918201528385602e83013760009301602e019283525090949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152600086516139b781601a850160208b01613df5565b606087901b6bffffffffffffffffffffffff1916601a918401918201528486602e8301378481019050602e81016000815284516139f8818360208901613df5565b91909101602e0198975050505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613a3e908301846138b4565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613a895783516001600160a01b031683529284019291840191600101613a64565b50909695505050505050565b6020815260006118c36020830184613840565b604081526000613abb6040830185613840565b8281036020840152613acd8185613884565b95945050505050565b6020815260006118c36020830184613884565b6020815260006118c360208301846138b4565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b602080825260129082015271151bdbc81b585b9e481c995c5d595cdd195960721b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600e908201526d416c72656164792061637469766560901b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b815161ffff1681526101e081016020830151613c8e602084018261ffff169052565b506040830151613ca4604084018261ffff169052565b50606083015160608301526080830151613cc4608084018261ffff169052565b5060a083015160a083015260c0830151613ce460c084018261ffff169052565b5060e0830151613cfa60e084018261ffff169052565b506101008381015115159083015261012080840151908301526101408084015190830152610160808401519083015261018080840151908301526101a080840151908301526101c0928301511515929091019190915290565b600061ffff80831681851680830382111561390657613906613ead565b60008219821115613d8357613d83613ead565b500190565b600082613d9757613d97613ec3565b500490565b6000816000190483118215151615613db657613db6613ead565b500290565b600061ffff83811690831681811015613dd657613dd6613ead565b039392505050565b600082821015613df057613df0613ead565b500390565b60005b83811015613e10578181015183820152602001613df8565b838111156115725750506000910152565b600181811c90821680613e3557607f821691505b60208210811415613e5657634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff80831681811415613e7457613e74613ead565b6001019392505050565b6000600019821415613e9257613e92613ead565b5060010190565b600082613ea857613ea8613ec3565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610d8557600080fd5b6001600160e01b031981168114610d8557600080fdfea2646970667358221220338dec048b4c86b673cb2b065d1bb364ec80797084965d0dca0f9611dfff710764736f6c63430008070033

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

000000000000000000000000720b18fdbc5ed327d67b56f94a2748470b658b96

-----Decoded View---------------
Arg [0] : signingAddress (address): 0x720B18fdbC5Ed327D67B56f94a2748470B658b96

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000720b18fdbc5ed327d67b56f94a2748470b658b96


Loading...
Loading
Loading...
Loading
[ 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.