ETH Price: $2,514.04 (-0.14%)

Contract

0x96Aca437DADCfD7Cb0242254C9f87F1896674A1f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040146515552022-04-25 3:55:52921 days ago1650858952IN
 Create: Archetype
0 ETH0.165254254.01759873

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Archetype

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 14 : Archetype.sol
// SPDX-License-Identifier: MIT
// Archetype v0.2.0
//
//        d8888                 888               888
//       d88888                 888               888
//      d88P888                 888               888
//     d88P 888 888d888 .d8888b 88888b.   .d88b.  888888 888  888 88888b.   .d88b.
//    d88P  888 888P"  d88P"    888 "88b d8P  Y8b 888    888  888 888 "88b d8P  Y8b
//   d88P   888 888    888      888  888 88888888 888    888  888 888  888 88888888
//  d8888888888 888    Y88b.    888  888 Y8b.     Y88b.  Y88b 888 888 d88P Y8b.
// d88P     888 888     "Y8888P 888  888  "Y8888   "Y888  "Y88888 88888P"   "Y8888
//                                                            888 888
//                                                       Y8b d88P 888
//                                                        "Y88P"  888

pragma solidity ^0.8.4;
import "./ERC721A-Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

error InvalidConfig();
error MintNotYetStarted();
error WalletUnauthorizedToMint();
error InsufficientEthSent();
error ExcessiveEthSent();
error MaxSupplyExceeded();
error NumberOfMintsExceeded();
error MintingPaused();
error InvalidReferral();
error InvalidSignature();
error BalanceEmpty();
error TransferFailed();
error MaxBatchSizeExceeded();
error WrongPassword();
error LockedForever();

contract Archetype is Initializable, ERC721AUpgradeable, OwnableUpgradeable {
  //
  // EVENTS
  //
  event Invited(bytes32 indexed key, bytes32 indexed cid);
  event Referral(address indexed affiliate, uint128 wad);
  event Withdrawal(address indexed src, uint128 wad);

  //
  // STRUCTS
  //
  struct Auth {
    bytes32 key;
    bytes32[] proof;
  }

  struct Config {
    string unrevealedUri;
    string baseUri;
    address affiliateSigner;
    uint32 maxSupply;
    uint32 maxBatchSize;
    uint32 affiliateFee;
    uint32 platformFee;
  }

  struct Invite {
    uint128 price;
    uint64 start;
    uint64 limit;
  }

  struct Invitelist {
    bytes32 key;
    bytes32 cid;
    Invite invite;
  }

  struct OwnerBalance {
    uint128 owner;
    uint128 platform;
  }

  //
  // VARIABLES
  //
  mapping(bytes32 => Invite) public invites;
  mapping(address => mapping(bytes32 => uint256)) private minted;
  mapping(address => uint128) public affiliateBalance;
  address private constant PLATFORM = 0x86B82972282Dd22348374bC63fd21620F7ED847B;
  // address private constant PLATFORM = 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC; // TEST (account[2])
  bool public revealed;
  bool public uriUnlocked;
  string public provenance;
  bool public provenanceHashUnlocked;
  OwnerBalance public ownerBalance;
  Config public config;

  //
  // METHODS
  //
  function initialize(
    string memory name,
    string memory symbol,
    Config calldata config_
  ) external initializer {
    __ERC721A_init(name, symbol);
    // affiliateFee max is 50%, platformFee min is 5% and max is 50%
    if (config_.affiliateFee > 5000 || config_.platformFee > 5000 || config_.platformFee < 500) {
      revert InvalidConfig();
    }
    config = config_;
    __Ownable_init();
    revealed = false;
    uriUnlocked = true;
    provenanceHashUnlocked = true;
  }

  function mint(
    Auth calldata auth,
    uint256 quantity,
    address affiliate,
    bytes calldata signature
  ) external payable {
    Invite memory i = invites[auth.key];

    if (affiliate != address(0)) {
      if (affiliate == PLATFORM || affiliate == owner() || affiliate == msg.sender) {
        revert InvalidReferral();
      }
      validateAffiliate(affiliate, signature, config.affiliateSigner);
    }

    if (i.limit == 0) {
      revert MintingPaused();
    }

    if (!verify(auth, _msgSender())) {
      revert WalletUnauthorizedToMint();
    }

    if (block.timestamp < i.start) {
      revert MintNotYetStarted();
    }

    if (i.limit < config.maxSupply) {
      uint256 totalAfterMint = minted[_msgSender()][auth.key] + quantity;

      if (totalAfterMint > i.limit) {
        revert NumberOfMintsExceeded();
      }
    }

    if (quantity > config.maxBatchSize) {
      revert MaxBatchSizeExceeded();
    }

    if ((_currentIndex + quantity) > config.maxSupply) {
      revert MaxSupplyExceeded();
    }

    uint256 cost = i.price * quantity;
    if (msg.value < cost) {
      revert InsufficientEthSent();
    }

    if (msg.value > cost) {
      revert ExcessiveEthSent();
    }

    _safeMint(msg.sender, quantity);

    if (i.limit < config.maxSupply) {
      minted[_msgSender()][auth.key] += quantity;
    }

    uint128 value = uint128(msg.value);

    uint128 affiliateWad = 0;
    if (affiliate != address(0)) {
      affiliateWad = (value * config.affiliateFee) / 10000;
      affiliateBalance[affiliate] += affiliateWad;
      emit Referral(affiliate, affiliateWad);
    }

    OwnerBalance memory balance = ownerBalance;
    uint128 platformWad = (value * config.platformFee) / 10000;
    uint128 ownerWad = value - affiliateWad - platformWad;
    ownerBalance = OwnerBalance({
      owner: balance.owner + ownerWad,
      platform: balance.platform + platformWad
    });
  }

  function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
    if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

    if (revealed == false) {
      return string(abi.encodePacked(config.unrevealedUri, Strings.toString(tokenId)));
    }

    return
      bytes(config.baseUri).length != 0
        ? string(abi.encodePacked(config.baseUri, Strings.toString(tokenId)))
        : "";
  }

  function reveal() public onlyOwner {
    revealed = true;
  }

  function _startTokenId() internal view virtual override returns (uint256) {
    return 1;
  }

  /// @notice the password is "forever"
  function lockURI(string memory password) public onlyOwner {
    if (keccak256(abi.encodePacked(password)) != keccak256(abi.encodePacked("forever"))) {
      revert WrongPassword();
    }

    uriUnlocked = false;
  }

  function setUnrevealedURI(string memory _unrevealedURI) public onlyOwner {
    config.unrevealedUri = _unrevealedURI;
  }

  function setBaseURI(string memory baseUri_) public onlyOwner {
    if (!uriUnlocked) {
      revert LockedForever();
    }

    config.baseUri = baseUri_;
  }

  /// @notice Set BAYC-style provenance once it's calculated
  function setProvenanceHash(string memory provenanceHash) public onlyOwner {
    if (!provenanceHashUnlocked) {
      revert LockedForever();
    }

    provenance = provenanceHash;
  }

  /// @notice the password is "forever"
  function lockProvenanceHash(string memory password) public onlyOwner {
    if (keccak256(abi.encodePacked(password)) != keccak256(abi.encodePacked("forever"))) {
      revert WrongPassword();
    }

    provenanceHashUnlocked = false;
  }

  function withdraw() public {
    uint128 wad = 0;

    if (msg.sender == owner() || msg.sender == PLATFORM) {
      OwnerBalance memory balance = ownerBalance;
      if (msg.sender == owner()) {
        wad = balance.owner;
        ownerBalance = OwnerBalance({ owner: 0, platform: balance.platform });
      } else {
        wad = balance.platform;
        ownerBalance = OwnerBalance({ owner: balance.owner, platform: 0 });
      }
    } else {
      wad = affiliateBalance[msg.sender];
      affiliateBalance[msg.sender] = 0;
    }

    if (wad == 0) {
      revert BalanceEmpty();
    }
    (bool success, ) = msg.sender.call{ value: wad }("");
    if (!success) {
      revert TransferFailed();
    }
    emit Withdrawal(msg.sender, wad);
  }

  function setInvites(Invitelist[] calldata invitelist) external onlyOwner {
    for (uint256 i = 0; i < invitelist.length; i++) {
      Invitelist calldata list = invitelist[i];
      invites[list.key] = list.invite;
      emit Invited(list.key, list.cid);
    }
  }

  function setInvite(
    bytes32 _key,
    bytes32 _cid,
    Invite calldata _invite
  ) external onlyOwner {
    invites[_key] = _invite;
    emit Invited(_key, _cid);
  }

  // based on: https://github.com/miguelmota/merkletreejs-solidity/blob/master/contracts/MerkleProof.sol
  function verify(Auth calldata auth, address account) internal pure returns (bool) {
    if (auth.key == "") return true;

    bytes32 computedHash = keccak256(abi.encodePacked(account));
    for (uint256 i = 0; i < auth.proof.length; i++) {
      bytes32 proofElement = auth.proof[i];
      if (computedHash <= proofElement) {
        computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
      } else {
        computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
      }
    }
    return computedHash == auth.key;
  }

  function validateAffiliate(
    address affiliate,
    bytes memory signature,
    address affiliateSigner
  ) internal pure {
    bytes32 signedMessagehash = ECDSA.toEthSignedMessageHash(
      keccak256(abi.encodePacked(affiliate))
    );
    address signer = ECDSA.recover(signedMessagehash, signature);
    if (signer != affiliateSigner) {
      revert InvalidSignature();
    }
  }
}

File 2 of 14 : ERC721A-Upgradeable.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
// import "./InitializableCustom.sol";

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721AUpgradeable is
  Initializable,
  ContextUpgradeable,
  ERC165Upgradeable,
  IERC721Upgradeable,
  IERC721MetadataUpgradeable
{
  using AddressUpgradeable for address;
  using StringsUpgradeable for uint256;

  // Compiler will pack this into a single 256bit word.
  struct TokenOwnership {
    // The address of the owner.
    address addr;
    // Keeps track of the start time of ownership with minimal overhead for tokenomics.
    uint64 startTimestamp;
    // Whether the token has been burned.
    bool burned;
  }

  // Compiler will pack this into a single 256bit word.
  struct AddressData {
    // Realistically, 2**64-1 is more than enough.
    uint64 balance;
    // Keeps track of mint count with minimal overhead for tokenomics.
    uint64 numberMinted;
    // Keeps track of burn count with minimal overhead for tokenomics.
    uint64 numberBurned;
    // For miscellaneous variable(s) pertaining to the address
    // (e.g. number of whitelist mint slots used).
    // If there are multiple variables, please pack them into a uint64.
    uint64 aux;
  }

  // The tokenId of the next token to be minted.
  uint256 internal _currentIndex;

  // The number of tokens burned.
  uint256 internal _burnCounter;

  // Token name
  string private _name;

  // Token symbol
  string private _symbol;

  // Mapping from token ID to ownership details
  // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details.
  mapping(uint256 => TokenOwnership) internal _ownerships;

  // Mapping owner address to address data
  mapping(address => AddressData) private _addressData;

  // 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;

  function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializing {
    __ERC721A_init_unchained(name_, symbol_);
  }

  function __ERC721A_init_unchained(string memory name_, string memory symbol_)
    internal
    onlyInitializing
  {
    _name = name_;
    _symbol = symbol_;
    _currentIndex = _startTokenId();
  }

  /**
   * To change the starting tokenId, please override this function.
   */
  function _startTokenId() internal view virtual returns (uint256) {
    return 0;
  }

  /**
   * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
   */
  function totalSupply() public view returns (uint256) {
    // Counter underflow is impossible as _burnCounter cannot be incremented
    // more than _currentIndex - _startTokenId() times
    unchecked {
      return _currentIndex - _burnCounter - _startTokenId();
    }
  }

  /**
   * Returns the total amount of tokens minted in the contract.
   */
  function _totalMinted() internal view returns (uint256) {
    // Counter underflow is impossible as _currentIndex does not decrement,
    // and it is initialized to _startTokenId()
    unchecked {
      return _currentIndex - _startTokenId();
    }
  }

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

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

  /**
   * Returns the number of tokens minted by `owner`.
   */
  function _numberMinted(address owner) internal view returns (uint256) {
    return uint256(_addressData[owner].numberMinted);
  }

  /**
   * Returns the number of tokens burned by or on behalf of `owner`.
   */
  function _numberBurned(address owner) internal view returns (uint256) {
    return uint256(_addressData[owner].numberBurned);
  }

  /**
   * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
   */
  function _getAux(address owner) internal view returns (uint64) {
    return _addressData[owner].aux;
  }

  /**
   * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
   * If there are multiple variables, please pack them into a uint64.
   */
  function _setAux(address owner, uint64 aux) internal {
    _addressData[owner].aux = aux;
  }

  /**
   * Gas spent here starts off proportional to the maximum mint batch size.
   * It gradually moves to O(1) as tokens get transferred around in the collection over time.
   */
  function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
    uint256 curr = tokenId;

    unchecked {
      if (_startTokenId() <= curr && curr < _currentIndex) {
        TokenOwnership memory ownership = _ownerships[curr];
        if (!ownership.burned) {
          if (ownership.addr != address(0)) {
            return ownership;
          }
          // Invariant:
          // There will always be an ownership that has an address and is not burned
          // before an ownership that does not have an address and is not burned.
          // Hence, curr will not underflow.
          while (true) {
            curr--;
            ownership = _ownerships[curr];
            if (ownership.addr != address(0)) {
              return ownership;
            }
          }
        }
      }
    }
    revert OwnerQueryForNonexistentToken();
  }

  /**
   * @dev See {IERC721-ownerOf}.
   */
  function ownerOf(uint256 tokenId) public view override returns (address) {
    return _ownershipOf(tokenId).addr;
  }

  /**
   * @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) {
    if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

    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 overriden in child contracts.
   */
  function _baseURI() internal view virtual returns (string memory) {
    return "";
  }

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

    if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
      revert ApprovalCallerNotOwnerNorApproved();
    }

    _approve(to, tokenId, owner);
  }

  /**
   * @dev See {IERC721-getApproved}.
   */
  function getApproved(uint256 tokenId) public view override returns (address) {
    if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

    return _tokenApprovals[tokenId];
  }

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

    _operatorApprovals[_msgSender()][operator] = approved;
    emit ApprovalForAll(_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 {
    _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 {
    _transfer(from, to, tokenId);
    if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) {
      revert TransferToNonERC721ReceiverImplementer();
    }
  }

  /**
   * @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`),
   */
  function _exists(uint256 tokenId) internal view returns (bool) {
    return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned;
  }

  function _safeMint(address to, uint256 quantity) internal {
    _safeMint(to, quantity, "");
  }

  /**
   * @dev Safely mints `quantity` tokens and transfers them to `to`.
   *
   * Requirements:
   *
   * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
   * - `quantity` must be greater than 0.
   *
   * Emits a {Transfer} event.
   */
  function _safeMint(
    address to,
    uint256 quantity,
    bytes memory _data
  ) internal {
    _mint(to, quantity, _data, true);
  }

  /**
   * @dev Mints `quantity` tokens and transfers them to `to`.
   *
   * Requirements:
   *
   * - `to` cannot be the zero address.
   * - `quantity` must be greater than 0.
   *
   * Emits a {Transfer} event.
   */
  function _mint(
    address to,
    uint256 quantity,
    bytes memory _data,
    bool safe
  ) internal {
    uint256 startTokenId = _currentIndex;
    if (to == address(0)) revert MintToZeroAddress();
    if (quantity == 0) revert MintZeroQuantity();

    _beforeTokenTransfers(address(0), to, startTokenId, quantity);

    // Overflows are incredibly unrealistic.
    // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
    // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
    unchecked {
      _addressData[to].balance += uint64(quantity);
      _addressData[to].numberMinted += uint64(quantity);

      _ownerships[startTokenId].addr = to;
      _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

      uint256 updatedIndex = startTokenId;
      uint256 end = updatedIndex + quantity;

      if (safe && to.isContract()) {
        do {
          emit Transfer(address(0), to, updatedIndex);
          if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
          }
        } while (updatedIndex != end);
        // Reentrancy protection
        if (_currentIndex != startTokenId) revert();
      } else {
        do {
          emit Transfer(address(0), to, updatedIndex++);
        } while (updatedIndex != end);
      }
      _currentIndex = updatedIndex;
    }
    _afterTokenTransfers(address(0), to, startTokenId, quantity);
  }

  /**
   * @dev Transfers `tokenId` from `from` to `to`.
   *
   * Requirements:
   *
   * - `to` cannot be the zero address.
   * - `tokenId` token must be owned by `from`.
   *
   * Emits a {Transfer} event.
   */
  function _transfer(
    address from,
    address to,
    uint256 tokenId
  ) private {
    TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

    if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();

    bool isApprovedOrOwner = (_msgSender() == from ||
      isApprovedForAll(from, _msgSender()) ||
      getApproved(tokenId) == _msgSender());

    if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
    if (to == address(0)) revert TransferToZeroAddress();

    _beforeTokenTransfers(from, to, tokenId, 1);

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

    // Underflow of the sender's balance is impossible because we check for
    // ownership above and the recipient's balance can't realistically overflow.
    // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
    unchecked {
      _addressData[from].balance -= 1;
      _addressData[to].balance += 1;

      TokenOwnership storage currSlot = _ownerships[tokenId];
      currSlot.addr = to;
      currSlot.startTimestamp = uint64(block.timestamp);

      // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
      // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
      uint256 nextTokenId = tokenId + 1;
      TokenOwnership storage nextSlot = _ownerships[nextTokenId];
      if (nextSlot.addr == address(0)) {
        // This will suffice for checking _exists(nextTokenId),
        // as a burned slot cannot contain the zero address.
        if (nextTokenId != _currentIndex) {
          nextSlot.addr = from;
          nextSlot.startTimestamp = prevOwnership.startTimestamp;
        }
      }
    }

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

  /**
   * @dev This is equivalent to _burn(tokenId, false)
   */
  function _burn(uint256 tokenId) internal virtual {
    _burn(tokenId, false);
  }

  /**
   * @dev Destroys `tokenId`.
   * The approval is cleared when the token is burned.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   *
   * Emits a {Transfer} event.
   */
  function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
    TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

    address from = prevOwnership.addr;

    if (approvalCheck) {
      bool isApprovedOrOwner = (_msgSender() == from ||
        isApprovedForAll(from, _msgSender()) ||
        getApproved(tokenId) == _msgSender());

      if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
    }

    _beforeTokenTransfers(from, address(0), tokenId, 1);

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

    // Underflow of the sender's balance is impossible because we check for
    // ownership above and the recipient's balance can't realistically overflow.
    // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
    unchecked {
      AddressData storage addressData = _addressData[from];
      addressData.balance -= 1;
      addressData.numberBurned += 1;

      // Keep track of who burned the token, and the timestamp of burning.
      TokenOwnership storage currSlot = _ownerships[tokenId];
      currSlot.addr = from;
      currSlot.startTimestamp = uint64(block.timestamp);
      currSlot.burned = true;

      // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
      // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
      uint256 nextTokenId = tokenId + 1;
      TokenOwnership storage nextSlot = _ownerships[nextTokenId];
      if (nextSlot.addr == address(0)) {
        // This will suffice for checking _exists(nextTokenId),
        // as a burned slot cannot contain the zero address.
        if (nextTokenId != _currentIndex) {
          nextSlot.addr = from;
          nextSlot.startTimestamp = prevOwnership.startTimestamp;
        }
      }
    }

    emit Transfer(from, address(0), tokenId);
    _afterTokenTransfers(from, address(0), tokenId, 1);

    // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
    unchecked {
      _burnCounter++;
    }
  }

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

  /**
   * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received(
    address from,
    address to,
    uint256 tokenId,
    bytes memory _data
  ) private returns (bool) {
    try
      IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data)
    returns (bytes4 retval) {
      return retval == IERC721ReceiverUpgradeable(to).onERC721Received.selector;
    } catch (bytes memory reason) {
      if (reason.length == 0) {
        revert TransferToNonERC721ReceiverImplementer();
      } else {
        assembly {
          revert(add(32, reason), mload(reason))
        }
      }
    }
  }

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

  /**
   * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
   * minting.
   * And also called after one token has been burned.
   *
   * startTokenId - the first token id to be transferred
   * quantity - the amount to be transferred
   *
   * Calling conditions:
   *
   * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
   * transferred to `to`.
   * - When `from` is zero, `tokenId` has been minted for `to`.
   * - When `to` is zero, `tokenId` has been burned by `from`.
   * - `from` and `to` are never both zero.
   */
  function _afterTokenTransfers(
    address from,
    address to,
    uint256 startTokenId,
    uint256 quantity
  ) internal virtual {}

  /**
   * @dev This empty reserved space is put in place to allow future versions to add new
   * variables without shifting down storage in the inheritance chain.
   * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
   */
  uint256[42] private __gap;
}

File 3 of 14 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;
import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.

        require(!_initialized, "Initializable: contract is already initialized");
        // require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
            _initialized = true;
        }

    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 4 of 14 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {

        _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);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 5 of 14 : 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 6 of 14 : 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));
    }
}

File 7 of 14 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 8 of 14 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
    /**
     * @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 10 of 14 : AddressUpgradeable.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 AddressUpgradeable {
    /**
     * @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 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 14 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 12 of 14 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    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 13 of 14 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 14 of 14 : IERC165Upgradeable.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 IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceEmpty","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"ExcessiveEthSent","type":"error"},{"inputs":[],"name":"InsufficientEthSent","type":"error"},{"inputs":[],"name":"InvalidConfig","type":"error"},{"inputs":[],"name":"InvalidReferral","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"LockedForever","type":"error"},{"inputs":[],"name":"MaxBatchSizeExceeded","type":"error"},{"inputs":[],"name":"MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"MintNotYetStarted","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"MintingPaused","type":"error"},{"inputs":[],"name":"NumberOfMintsExceeded","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"WalletUnauthorizedToMint","type":"error"},{"inputs":[],"name":"WrongPassword","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"key","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"cid","type":"bytes32"}],"name":"Invited","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":"affiliate","type":"address"},{"indexed":false,"internalType":"uint128","name":"wad","type":"uint128"}],"name":"Referral","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":true,"internalType":"address","name":"src","type":"address"},{"indexed":false,"internalType":"uint128","name":"wad","type":"uint128"}],"name":"Withdrawal","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"affiliateBalance","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"string","name":"unrevealedUri","type":"string"},{"internalType":"string","name":"baseUri","type":"string"},{"internalType":"address","name":"affiliateSigner","type":"address"},{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"maxBatchSize","type":"uint32"},{"internalType":"uint32","name":"affiliateFee","type":"uint32"},{"internalType":"uint32","name":"platformFee","type":"uint32"}],"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":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"components":[{"internalType":"string","name":"unrevealedUri","type":"string"},{"internalType":"string","name":"baseUri","type":"string"},{"internalType":"address","name":"affiliateSigner","type":"address"},{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"maxBatchSize","type":"uint32"},{"internalType":"uint32","name":"affiliateFee","type":"uint32"},{"internalType":"uint32","name":"platformFee","type":"uint32"}],"internalType":"struct Archetype.Config","name":"config_","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"invites","outputs":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"limit","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"password","type":"string"}],"name":"lockProvenanceHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"password","type":"string"}],"name":"lockURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"internalType":"struct Archetype.Auth","name":"auth","type":"tuple"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"affiliate","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerBalance","outputs":[{"internalType":"uint128","name":"owner","type":"uint128"},{"internalType":"uint128","name":"platform","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenance","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenanceHashUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"baseUri_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"},{"internalType":"bytes32","name":"_cid","type":"bytes32"},{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"limit","type":"uint64"}],"internalType":"struct Archetype.Invite","name":"_invite","type":"tuple"}],"name":"setInvite","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"bytes32","name":"cid","type":"bytes32"},{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"limit","type":"uint64"}],"internalType":"struct Archetype.Invite","name":"invite","type":"tuple"}],"internalType":"struct Archetype.Invitelist[]","name":"invitelist","type":"tuple[]"}],"name":"setInvites","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"provenanceHash","type":"string"}],"name":"setProvenanceHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_unrevealedURI","type":"string"}],"name":"setUnrevealedURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uriUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061365e806100206000396000f3fe60806040526004361061020f5760003560e01c806379502c5511610118578063bedcf003116100a0578063e072e16d1161006f578063e072e16d1461069c578063e4963dd5146106bb578063e985e9c5146106db578063f2fde38b146106fb578063fe2c7fee1461071b57600080fd5b8063bedcf003146105f1578063c87b56dd1461063c578063d7b403281461065c578063de6cd0db1461067c57600080fd5b8063a15947c4116100e7578063a15947c4146104fb578063a22cb4651461051b578063a475b5dd1461053b578063a5aa4aa414610550578063b88d4fde146105d157600080fd5b806379502c55146104525780638da5cb5b1461047a57806395d89b4114610498578063978a4509146104ad57600080fd5b80633ccfd60b1161019b57806355f804b31161016a57806355f804b3146103bd5780636352211e146103dd5780636f5ba15a146103fd57806370a082311461041d578063715018a61461043d57600080fd5b80633ccfd60b1461035b57806342842e0e146103705780634a21a2df1461039057806351830227146103a357600080fd5b80630f7309e8116101e25780630f7309e8146102c557806310969523146102da57806318160ddd146102fa57806323b872dd146103215780632cb020e51461034157600080fd5b806301ffc9a71461021457806306fdde0314610249578063081812fc1461026b578063095ea7b3146102a3575b600080fd5b34801561022057600080fd5b5061023461022f366004612bf2565b61073b565b60405190151581526020015b60405180910390f35b34801561025557600080fd5b5061025e61078d565b6040516102409190612eb9565b34801561027757600080fd5b5061028b610286366004612b9b565b61081f565b6040516001600160a01b039091168152602001610240565b3480156102af57600080fd5b506102c36102be366004612b01565b610863565b005b3480156102d157600080fd5b5061025e6108f1565b3480156102e657600080fd5b506102c36102f5366004612c2a565b61097f565b34801561030657600080fd5b5060665460655403600019015b604051908152602001610240565b34801561032d57600080fd5b506102c361033c366004612a14565b6109ec565b34801561034d57600080fd5b5060ce546102349060ff1681565b34801561036757600080fd5b506102c36109f7565b34801561037c57600080fd5b506102c361038b366004612a14565b610bea565b6102c361039e366004612ce5565b610c05565b3480156103af57600080fd5b5060cc546102349060ff1681565b3480156103c957600080fd5b506102c36103d8366004612c2a565b611102565b3480156103e957600080fd5b5061028b6103f8366004612b9b565b611167565b34801561040957600080fd5b506102c3610418366004612b2c565b611179565b34801561042957600080fd5b506103136104383660046129c0565b611240565b34801561044957600080fd5b506102c361128e565b34801561045e57600080fd5b506104676112c4565b6040516102409796959493929190612ecc565b34801561048657600080fd5b506097546001600160a01b031661028b565b3480156104a457600080fd5b5061025e61141f565b3480156104b957600080fd5b506104e36104c83660046129c0565b60cb602052600090815260409020546001600160801b031681565b6040516001600160801b039091168152602001610240565b34801561050757600080fd5b506102c3610516366004612c2a565b61142e565b34801561052757600080fd5b506102c3610536366004612ad0565b6114d6565b34801561054757600080fd5b506102c361156c565b34801561055c57600080fd5b506105a261056b366004612b9b565b60c9602052600090815260409020546001600160801b038116906001600160401b03600160801b8204811691600160c01b90041683565b604080516001600160801b0390941684526001600160401b039283166020850152911690820152606001610240565b3480156105dd57600080fd5b506102c36105ec366004612a54565b6115a5565b3480156105fd57600080fd5b5060cf5461061c906001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610240565b34801561064857600080fd5b5061025e610657366004612b9b565b6115f6565b34801561066857600080fd5b506102c3610677366004612c5c565b61168f565b34801561068857600080fd5b506102c3610697366004612c2a565b6117ed565b3480156106a857600080fd5b5060cc5461023490610100900460ff1681565b3480156106c757600080fd5b506102c36106d6366004612bb3565b611896565b3480156106e757600080fd5b506102346106f63660046129dc565b61190e565b34801561070757600080fd5b506102c36107163660046129c0565b61193c565b34801561072757600080fd5b506102c3610736366004612c2a565b6119d7565b60006001600160e01b031982166380ac58cd60e01b148061076c57506001600160e01b03198216635b5e139f60e01b145b8061078757506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606067805461079c9061327c565b80601f01602080910402602001604051908101604052809291908181526020018280546107c89061327c565b80156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b5050505050905090565b600061082a82611a14565b610847576040516333d1c03960e21b815260040160405180910390fd5b506000908152606b60205260409020546001600160a01b031690565b600061086e82611167565b9050806001600160a01b0316836001600160a01b031614156108a35760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906108c357506108c1813361190e565b155b156108e1576040516367d9dca160e11b815260040160405180910390fd5b6108ec838383611a4d565b505050565b60cd80546108fe9061327c565b80601f016020809104026020016040519081016040528092919081815260200182805461092a9061327c565b80156109775780601f1061094c57610100808354040283529160200191610977565b820191906000526020600020905b81548152906001019060200180831161095a57829003601f168201915b505050505081565b6097546001600160a01b031633146109b25760405162461bcd60e51b81526004016109a990612f30565b60405180910390fd5b60ce5460ff166109d55760405163249fab5d60e01b815260040160405180910390fd5b80516109e89060cd90602084019061288c565b5050565b6108ec838383611aa9565b6000610a0b6097546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610a3d5750337386b82972282dd22348374bc63fd21620f7ed847b145b15610ae5576040805180820190915260cf546001600160801b038082168352600160801b9091041660208201526097546001600160a01b0316331415610ab157805160408051808201909152600081526020808401516001600160801b03169101819052600160801b0260cf559150610adf565b6020808201516040805180820190915283516001600160801b03168082526000919093015260cf9190915591505b50610b0f565b5033600090815260cb6020526040902080546001600160801b031981169091556001600160801b03165b6001600160801b038116610b36576040516321cd723f60e21b815260040160405180910390fd5b60405160009033906001600160801b038416908381818185875af1925050503d8060008114610b81576040519150601f19603f3d011682016040523d82523d6000602084013e610b86565b606091505b5050905080610ba8576040516312171d8360e31b815260040160405180910390fd5b6040516001600160801b038316815233907f8bb044d1bb6a7b421504ef7f7045b22152b504f683e8c1bcbc8222af46cb68b39060200160405180910390a25050565b6108ec838383604051806020016040528060008152506115a5565b8435600090815260c96020908152604091829020825160608101845290546001600160801b03811682526001600160401b03600160801b8204811693830193909352600160c01b9004909116918101919091526001600160a01b03841615610d1d576001600160a01b0384167386b82972282dd22348374bc63fd21620f7ed847b1480610c9f57506097546001600160a01b038581169116145b80610cb257506001600160a01b03841633145b15610cd05760405163119833d760e11b815260040160405180910390fd5b610d1d8484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060d2546001600160a01b03169150611c979050565b60408101516001600160401b0316610d48576040516375ab03ab60e11b815260040160405180910390fd5b610d528633611d54565b610d6f5760405163d838648f60e01b815260040160405180910390fd5b80602001516001600160401b0316421015610d9d57604051630e91d3a160e11b815260040160405180910390fd5b60d2546040820151600160a01b90910463ffffffff166001600160401b039091161015610e1d5733600090815260ca6020908152604080832089358452909152812054610deb90879061305d565b905081604001516001600160401b0316811115610e1b576040516315fcbc9d60e01b815260040160405180910390fd5b505b60d254600160c01b900463ffffffff16851115610e4d57604051637a7e96df60e01b815260040160405180910390fd5b60d254606554600160a01b90910463ffffffff1690610e6d90879061305d565b1115610e8c57604051638a164f6360e01b815260040160405180910390fd5b8051600090610ea59087906001600160801b03166130de565b905080341015610ec85760405163f244866f60e01b815260040160405180910390fd5b80341115610ee9576040516301b2422760e61b815260040160405180910390fd5b610ef33387611e71565b60d2546040830151600160a01b90910463ffffffff166001600160401b039091161015610f4b5733600090815260ca602090815260408083208a35845290915281208054889290610f4590849061305d565b90915550505b3460006001600160a01b038716156110305760d25461271090610f7b90600160e01b900463ffffffff16846130af565b610f859190613075565b6001600160a01b038816600090815260cb6020526040812080549293508392909190610fbb9084906001600160801b031661303b565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550866001600160a01b03167f5e627b23e8981317689f5541931b5e9805545e7601aa2c86e84217555368dc038260405161102791906001600160801b0391909116815260200190565b60405180910390a25b6040805180820190915260cf546001600160801b038082168352600160801b90910416602082015260d354600090612710906110729063ffffffff16866130af565b61107c9190613075565b905060008161108b85876130fd565b61109591906130fd565b905060405180604001604052808285600001516110b2919061303b565b6001600160801b031681526020018385602001516110d0919061303b565b6001600160801b0390811690915281516020909201518116600160801b0291161760cf55505050505050505050505050565b6097546001600160a01b0316331461112c5760405162461bcd60e51b81526004016109a990612f30565b60cc54610100900460ff166111545760405163249fab5d60e01b815260040160405180910390fd5b80516109e89060d190602084019061288c565b600061117282611e8b565b5192915050565b6097546001600160a01b031633146111a35760405162461bcd60e51b81526004016109a990612f30565b60005b818110156108ec57368383838181106111cf57634e487b7160e01b600052603260045260246000fd5b60a002919091018035600090815260c9602052604090819020919350830191506111f98282613571565b50506040516020820135908235907fe9a0c17645ed78ccc9996259f00297ffc75e6b9d22cd605ccc9992cc8ca3f4c190600090a35080611238816132b7565b9150506111a6565b60006001600160a01b038216611269576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152606a60205260409020546001600160401b031690565b6097546001600160a01b031633146112b85760405162461bcd60e51b81526004016109a990612f30565b6112c26000611fb2565b565b60d0805481906112d39061327c565b80601f01602080910402602001604051908101604052809291908181526020018280546112ff9061327c565b801561134c5780601f106113215761010080835404028352916020019161134c565b820191906000526020600020905b81548152906001019060200180831161132f57829003601f168201915b5050505050908060010180546113619061327c565b80601f016020809104026020016040519081016040528092919081815260200182805461138d9061327c565b80156113da5780601f106113af576101008083540402835291602001916113da565b820191906000526020600020905b8154815290600101906020018083116113bd57829003601f168201915b505050600284015460039094015492936001600160a01b0381169363ffffffff600160a01b830481169450600160c01b830481169350600160e01b9092048216911687565b60606068805461079c9061327c565b6097546001600160a01b031633146114585760405162461bcd60e51b81526004016109a990612f30565b604051663337b932bb32b960c91b602082015260270160405160208183030381529060405280519060200120816040516020016114959190612de0565b60405160208183030381529060405280519060200120146114c957604051635ee88f9760e01b815260040160405180910390fd5b5060ce805460ff19169055565b6001600160a01b0382163314156115005760405163b06307db60e01b815260040160405180910390fd5b336000818152606c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6097546001600160a01b031633146115965760405162461bcd60e51b81526004016109a990612f30565b60cc805460ff19166001179055565b6115b0848484611aa9565b6001600160a01b0383163b151580156115d257506115d084848484612004565b155b156115f0576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b606061160182611a14565b61161e57604051630a14c4b560e41b815260040160405180910390fd5b60cc5460ff1661165a5760d0611633836120fc565b604051602001611644929190612dfc565b6040516020818303038152906040529050919050565b60d180546116679061327c565b151590506116845760405180602001604052806000815250610787565b60d1611633836120fc565b60005460ff16156116f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016109a9565b600054610100900460ff1615801561171b576000805461ff0019166101001790555b6117258484612215565b61138861173860c0840160a08501612d98565b63ffffffff161180611760575061138861175860e0840160c08501612d98565b63ffffffff16115b8061178157506101f461177960e0840160c08501612d98565b63ffffffff16105b1561179f576040516306b7c75960e31b815260040160405180910390fd5b8160d06117ac828261335a565b9050506117b7612246565b60cc805461ffff191661010017905560ce805460ff1916600117905580156115f0576000805461ffff1916600117905550505050565b6097546001600160a01b031633146118175760405162461bcd60e51b81526004016109a990612f30565b604051663337b932bb32b960c91b602082015260270160405160208183030381529060405280519060200120816040516020016118549190612de0565b604051602081830303815290604052805190602001201461188857604051635ee88f9760e01b815260040160405180910390fd5b5060cc805461ff0019169055565b6097546001600160a01b031633146118c05760405162461bcd60e51b81526004016109a990612f30565b600083815260c96020526040902081906118da8282613571565b5050604051829084907fe9a0c17645ed78ccc9996259f00297ffc75e6b9d22cd605ccc9992cc8ca3f4c190600090a3505050565b6001600160a01b039182166000908152606c6020908152604080832093909416825291909152205460ff1690565b6097546001600160a01b031633146119665760405162461bcd60e51b81526004016109a990612f30565b6001600160a01b0381166119cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109a9565b6119d481611fb2565b50565b6097546001600160a01b03163314611a015760405162461bcd60e51b81526004016109a990612f30565b80516109e89060d090602084019061288c565b600081600111158015611a28575060655482105b8015610787575050600090815260696020526040902054600160e01b900460ff161590565b6000828152606b602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611ab482611e8b565b9050836001600160a01b031681600001516001600160a01b031614611aeb5760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611b095750611b09853361190e565b80611b24575033611b198461081f565b6001600160a01b0316145b905080611b4457604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416611b6b57604051633a954ecd60e21b815260040160405180910390fd5b611b7760008487611a4d565b6001600160a01b038581166000908152606a60209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652606990945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116611c4b576065548214611c4b57805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60408051606085901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a333200000000605484015260708084019190915283518084039091018152609090920190925280519101206000611d208285612275565b9050826001600160a01b0316816001600160a01b031614611c9057604051638baa579f60e01b815260040160405180910390fd5b60008235611d6457506001610787565b6040516bffffffffffffffffffffffff19606084901b16602082015260009060340160405160208183030381529060405280519060200120905060005b611dae6020860186612fb0565b9050811015611e65576000611dc66020870187612fb0565b83818110611de457634e487b7160e01b600052603260045260246000fd5b905060200201359050808311611e25576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250611e52565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080611e5d816132b7565b915050611da1565b50833514905092915050565b6109e8828260405180602001604052806000815250612299565b60408051606081018252600080825260208201819052918101919091528180600111158015611ebb575060655481105b15611f9957600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290611f975780516001600160a01b031615611f2e579392505050565b5060001901600081815260696020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215611f92579392505050565b611f2e565b505b604051636f96cda160e11b815260040160405180910390fd5b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612039903390899088908890600401612e7c565b602060405180830381600087803b15801561205357600080fd5b505af1925050508015612083575060408051601f3d908101601f1916820190925261208091810190612c0e565b60015b6120de573d8080156120b1576040519150601f19603f3d011682016040523d82523d6000602084013e6120b6565b606091505b5080516120d6576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060816121205750506040805180820190915260018152600360fc1b602082015290565b8160005b811561214a5780612134816132b7565b91506121439050600a8361309b565b9150612124565b6000816001600160401b0381111561217257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561219c576020820181803683370190505b5090505b84156120f4576121b1600183613125565b91506121be600a866132d2565b6121c990603061305d565b60f81b8183815181106121ec57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535061220e600a8661309b565b94506121a0565b600054610100900460ff1661223c5760405162461bcd60e51b81526004016109a990612f65565b6109e882826122a6565b600054610100900460ff1661226d5760405162461bcd60e51b81526004016109a990612f65565b6112c26122fe565b6000806000612284858561232e565b915091506122918161239e565b509392505050565b6108ec838383600161259f565b600054610100900460ff166122cd5760405162461bcd60e51b81526004016109a990612f65565b81516122e090606790602085019061288c565b5080516122f490606890602084019061288c565b5060016065555050565b600054610100900460ff166123255760405162461bcd60e51b81526004016109a990612f65565b6112c233611fb2565b6000808251604114156123655760208301516040840151606085015160001a61235987828585612766565b94509450505050612397565b82516040141561238f5760208301516040840151612384868383612853565b935093505050612397565b506000905060025b9250929050565b60008160048111156123c057634e487b7160e01b600052602160045260246000fd5b14156123c95750565b60018160048111156123eb57634e487b7160e01b600052602160045260246000fd5b14156124395760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109a9565b600281600481111561245b57634e487b7160e01b600052602160045260246000fd5b14156124a95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109a9565b60038160048111156124cb57634e487b7160e01b600052602160045260246000fd5b14156125245760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109a9565b600481600481111561254657634e487b7160e01b600052602160045260246000fd5b14156119d45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016109a9565b6065546001600160a01b0385166125c857604051622e076360e81b815260040160405180910390fd5b836125e65760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0385166000818152606a6020908152604080832080546001600160801b031981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452606990925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561268e57506001600160a01b0387163b15155b15612717575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46126df6000888480600101955088612004565b6126fc576040516368d2bf6b60e11b815260040160405180910390fd5b8082141561269457826065541461271257600080fd5b61275d565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415612718575b50606555611c90565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561279d575060009050600361284a565b8460ff16601b141580156127b557508460ff16601c14155b156127c6575060009050600461284a565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561281a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128435760006001925092505061284a565b9150600090505b94509492505050565b6000806001600160ff1b0383168161287060ff86901c601b61305d565b905061287e87828885612766565b935093505050935093915050565b8280546128989061327c565b90600052602060002090601f0160209004810192826128ba5760008555612900565b82601f106128d357805160ff1916838001178555612900565b82800160010185558215612900579182015b828111156129005782518255916020019190600101906128e5565b5061290c929150612910565b5090565b5b8082111561290c5760008155600101612911565b60006001600160401b038084111561293f5761293f613312565b604051601f8501601f19908116603f0116810190828211818310171561296757612967613312565b8160405280935085815286868601111561298057600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126129aa578081fd5b6129b983833560208501612925565b9392505050565b6000602082840312156129d1578081fd5b81356129b9816135eb565b600080604083850312156129ee578081fd5b82356129f9816135eb565b91506020830135612a09816135eb565b809150509250929050565b600080600060608486031215612a28578081fd5b8335612a33816135eb565b92506020840135612a43816135eb565b929592945050506040919091013590565b60008060008060808587031215612a69578081fd5b8435612a74816135eb565b93506020850135612a84816135eb565b92506040850135915060608501356001600160401b03811115612aa5578182fd5b8501601f81018713612ab5578182fd5b612ac487823560208401612925565b91505092959194509250565b60008060408385031215612ae2578182fd5b8235612aed816135eb565b915060208301358015158114612a09578182fd5b60008060408385031215612b13578182fd5b8235612b1e816135eb565b946020939093013593505050565b60008060208385031215612b3e578182fd5b82356001600160401b0380821115612b54578384fd5b818501915085601f830112612b67578384fd5b813581811115612b75578485fd5b86602060a083028501011115612b89578485fd5b60209290920196919550909350505050565b600060208284031215612bac578081fd5b5035919050565b600080600083850360a0811215612bc8578384fd5b84359350602085013592506060603f1982011215612be4578182fd5b506040840190509250925092565b600060208284031215612c03578081fd5b81356129b981613600565b600060208284031215612c1f578081fd5b81516129b981613600565b600060208284031215612c3b578081fd5b81356001600160401b03811115612c50578182fd5b6120f48482850161299a565b600080600060608486031215612c70578081fd5b83356001600160401b0380821115612c86578283fd5b612c928783880161299a565b94506020860135915080821115612ca7578283fd5b612cb38783880161299a565b93506040860135915080821115612cc8578283fd5b50840160e08187031215612cda578182fd5b809150509250925092565b600080600080600060808688031215612cfc578283fd5b85356001600160401b0380821115612d12578485fd5b908701906040828a031215612d25578485fd5b90955060208701359450604087013590612d3e826135eb565b90935060608701359080821115612d53578283fd5b818801915088601f830112612d66578283fd5b813581811115612d74578384fd5b896020828501011115612d85578384fd5b9699959850939650602001949392505050565b600060208284031215612da9578081fd5b81356129b981613616565b60008151808452612dcc816020860160208601613250565b601f01601f19169290920160200192915050565b60008251612df2818460208701613250565b9190910192915050565b6000808454612e0a8161327c565b60018281168015612e225760018114612e3357612e5f565b60ff19841687528287019450612e5f565b8886526020808720875b85811015612e565781548a820152908401908201612e3d565b50505082870194505b505050508351612e73818360208801613250565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612eaf90830184612db4565b9695505050505050565b6020815260006129b96020830184612db4565b60e081526000612edf60e083018a612db4565b8281036020840152612ef1818a612db4565b6001600160a01b03989098166040840152505063ffffffff9485166060820152928416608084015290831660a083015290911660c09091015292915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000808335601e19843603018112612fc6578283fd5b8301803591506001600160401b03821115612fdf578283fd5b6020019150600581901b360382131561239757600080fd5b6000808335601e1984360301811261300d578182fd5b8301803591506001600160401b03821115613026578283fd5b60200191503681900382131561239757600080fd5b60006001600160801b03808316818516808303821115612e7357612e736132e6565b60008219821115613070576130706132e6565b500190565b60006001600160801b038084168061308f5761308f6132fc565b92169190910492915050565b6000826130aa576130aa6132fc565b500490565b60006001600160801b03808316818516818304811182151516156130d5576130d56132e6565b02949350505050565b60008160001904831182151516156130f8576130f86132e6565b500290565b60006001600160801b038381169083168181101561311d5761311d6132e6565b039392505050565b600082821015613137576131376132e6565b500390565b5b818110156109e8576000815560010161313d565b6001600160401b0383111561316857613168613312565b613172815461327c565b600080601f8611601f8411818117156131915760008681526020902092505b80156131c057601f880160051c830160208910156131ac5750825b6131be601f870160051c85018261313c565b505b5080600181146131f4576000945087156131db578387013594505b600188901b60001960038a901b1c198616178655613246565b601f198816945082845b8681101561321e57888601358255602095860195600190920191016131fe565b508886101561323b5760001960f88a60031b161c19858901351681555b5060018860011b0186555b5050505050505050565b60005b8381101561326b578181015183820152602001613253565b838111156115f05750506000910152565b600181811c9082168061329057607f821691505b602082108114156132b157634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156132cb576132cb6132e6565b5060010190565b6000826132e1576132e16132fc565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60008135610787816135eb565b6000813561078781613616565b600081356001600160401b0381168114610787578182fd5b6133648283612ff7565b6001600160401b0381111561337b5761337b613312565b613385835461327c565b600080601f8411601f8411818117156133a45760008881526020902092505b80156133d357601f860160051c830160208710156133bf5750825b6133d1601f870160051c85018261313c565b505b508060018114613407576000945085156133ee578387013594505b600186901b600019600388901b1c198616178855613459565b601f198616945082845b868110156134315788860135825560209586019560019092019101613411565b508686101561344e5760001960f88860031b161c19858901351681555b5060018660011b0188555b5050505050505061346d6020830183612ff7565b61347b818360018601613151565b5050600281016134ad61349060408501613328565b82546001600160a01b0319166001600160a01b0391909116178255565b6134e06134bc60608501613335565b82805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b6135136134ef60808501613335565b82805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b61354661352260a08501613335565b8280546001600160e01b031660e09290921b6001600160e01b031916919091179055565b506109e861355660c08401613335565b6003830163ffffffff821663ffffffff198254161781555050565b81356001600160801b03811680821461358957600080fd5b82546001600160801b0319811682178455915067ffffffffffffffff60801b6135b460208601613342565b60801b166001600160401b0360c01b818382861617178555806135d960408801613342565b60c01b16838317178555505050505050565b6001600160a01b03811681146119d457600080fd5b6001600160e01b0319811681146119d457600080fd5b63ffffffff811681146119d457600080fdfea2646970667358221220178f2f90700adbad6ac49ef2508a32964b95aa4a1b0dbcfd77689f52d0c6cad764736f6c63430008040033

Deployed Bytecode

0x60806040526004361061020f5760003560e01c806379502c5511610118578063bedcf003116100a0578063e072e16d1161006f578063e072e16d1461069c578063e4963dd5146106bb578063e985e9c5146106db578063f2fde38b146106fb578063fe2c7fee1461071b57600080fd5b8063bedcf003146105f1578063c87b56dd1461063c578063d7b403281461065c578063de6cd0db1461067c57600080fd5b8063a15947c4116100e7578063a15947c4146104fb578063a22cb4651461051b578063a475b5dd1461053b578063a5aa4aa414610550578063b88d4fde146105d157600080fd5b806379502c55146104525780638da5cb5b1461047a57806395d89b4114610498578063978a4509146104ad57600080fd5b80633ccfd60b1161019b57806355f804b31161016a57806355f804b3146103bd5780636352211e146103dd5780636f5ba15a146103fd57806370a082311461041d578063715018a61461043d57600080fd5b80633ccfd60b1461035b57806342842e0e146103705780634a21a2df1461039057806351830227146103a357600080fd5b80630f7309e8116101e25780630f7309e8146102c557806310969523146102da57806318160ddd146102fa57806323b872dd146103215780632cb020e51461034157600080fd5b806301ffc9a71461021457806306fdde0314610249578063081812fc1461026b578063095ea7b3146102a3575b600080fd5b34801561022057600080fd5b5061023461022f366004612bf2565b61073b565b60405190151581526020015b60405180910390f35b34801561025557600080fd5b5061025e61078d565b6040516102409190612eb9565b34801561027757600080fd5b5061028b610286366004612b9b565b61081f565b6040516001600160a01b039091168152602001610240565b3480156102af57600080fd5b506102c36102be366004612b01565b610863565b005b3480156102d157600080fd5b5061025e6108f1565b3480156102e657600080fd5b506102c36102f5366004612c2a565b61097f565b34801561030657600080fd5b5060665460655403600019015b604051908152602001610240565b34801561032d57600080fd5b506102c361033c366004612a14565b6109ec565b34801561034d57600080fd5b5060ce546102349060ff1681565b34801561036757600080fd5b506102c36109f7565b34801561037c57600080fd5b506102c361038b366004612a14565b610bea565b6102c361039e366004612ce5565b610c05565b3480156103af57600080fd5b5060cc546102349060ff1681565b3480156103c957600080fd5b506102c36103d8366004612c2a565b611102565b3480156103e957600080fd5b5061028b6103f8366004612b9b565b611167565b34801561040957600080fd5b506102c3610418366004612b2c565b611179565b34801561042957600080fd5b506103136104383660046129c0565b611240565b34801561044957600080fd5b506102c361128e565b34801561045e57600080fd5b506104676112c4565b6040516102409796959493929190612ecc565b34801561048657600080fd5b506097546001600160a01b031661028b565b3480156104a457600080fd5b5061025e61141f565b3480156104b957600080fd5b506104e36104c83660046129c0565b60cb602052600090815260409020546001600160801b031681565b6040516001600160801b039091168152602001610240565b34801561050757600080fd5b506102c3610516366004612c2a565b61142e565b34801561052757600080fd5b506102c3610536366004612ad0565b6114d6565b34801561054757600080fd5b506102c361156c565b34801561055c57600080fd5b506105a261056b366004612b9b565b60c9602052600090815260409020546001600160801b038116906001600160401b03600160801b8204811691600160c01b90041683565b604080516001600160801b0390941684526001600160401b039283166020850152911690820152606001610240565b3480156105dd57600080fd5b506102c36105ec366004612a54565b6115a5565b3480156105fd57600080fd5b5060cf5461061c906001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610240565b34801561064857600080fd5b5061025e610657366004612b9b565b6115f6565b34801561066857600080fd5b506102c3610677366004612c5c565b61168f565b34801561068857600080fd5b506102c3610697366004612c2a565b6117ed565b3480156106a857600080fd5b5060cc5461023490610100900460ff1681565b3480156106c757600080fd5b506102c36106d6366004612bb3565b611896565b3480156106e757600080fd5b506102346106f63660046129dc565b61190e565b34801561070757600080fd5b506102c36107163660046129c0565b61193c565b34801561072757600080fd5b506102c3610736366004612c2a565b6119d7565b60006001600160e01b031982166380ac58cd60e01b148061076c57506001600160e01b03198216635b5e139f60e01b145b8061078757506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606067805461079c9061327c565b80601f01602080910402602001604051908101604052809291908181526020018280546107c89061327c565b80156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b5050505050905090565b600061082a82611a14565b610847576040516333d1c03960e21b815260040160405180910390fd5b506000908152606b60205260409020546001600160a01b031690565b600061086e82611167565b9050806001600160a01b0316836001600160a01b031614156108a35760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906108c357506108c1813361190e565b155b156108e1576040516367d9dca160e11b815260040160405180910390fd5b6108ec838383611a4d565b505050565b60cd80546108fe9061327c565b80601f016020809104026020016040519081016040528092919081815260200182805461092a9061327c565b80156109775780601f1061094c57610100808354040283529160200191610977565b820191906000526020600020905b81548152906001019060200180831161095a57829003601f168201915b505050505081565b6097546001600160a01b031633146109b25760405162461bcd60e51b81526004016109a990612f30565b60405180910390fd5b60ce5460ff166109d55760405163249fab5d60e01b815260040160405180910390fd5b80516109e89060cd90602084019061288c565b5050565b6108ec838383611aa9565b6000610a0b6097546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610a3d5750337386b82972282dd22348374bc63fd21620f7ed847b145b15610ae5576040805180820190915260cf546001600160801b038082168352600160801b9091041660208201526097546001600160a01b0316331415610ab157805160408051808201909152600081526020808401516001600160801b03169101819052600160801b0260cf559150610adf565b6020808201516040805180820190915283516001600160801b03168082526000919093015260cf9190915591505b50610b0f565b5033600090815260cb6020526040902080546001600160801b031981169091556001600160801b03165b6001600160801b038116610b36576040516321cd723f60e21b815260040160405180910390fd5b60405160009033906001600160801b038416908381818185875af1925050503d8060008114610b81576040519150601f19603f3d011682016040523d82523d6000602084013e610b86565b606091505b5050905080610ba8576040516312171d8360e31b815260040160405180910390fd5b6040516001600160801b038316815233907f8bb044d1bb6a7b421504ef7f7045b22152b504f683e8c1bcbc8222af46cb68b39060200160405180910390a25050565b6108ec838383604051806020016040528060008152506115a5565b8435600090815260c96020908152604091829020825160608101845290546001600160801b03811682526001600160401b03600160801b8204811693830193909352600160c01b9004909116918101919091526001600160a01b03841615610d1d576001600160a01b0384167386b82972282dd22348374bc63fd21620f7ed847b1480610c9f57506097546001600160a01b038581169116145b80610cb257506001600160a01b03841633145b15610cd05760405163119833d760e11b815260040160405180910390fd5b610d1d8484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060d2546001600160a01b03169150611c979050565b60408101516001600160401b0316610d48576040516375ab03ab60e11b815260040160405180910390fd5b610d528633611d54565b610d6f5760405163d838648f60e01b815260040160405180910390fd5b80602001516001600160401b0316421015610d9d57604051630e91d3a160e11b815260040160405180910390fd5b60d2546040820151600160a01b90910463ffffffff166001600160401b039091161015610e1d5733600090815260ca6020908152604080832089358452909152812054610deb90879061305d565b905081604001516001600160401b0316811115610e1b576040516315fcbc9d60e01b815260040160405180910390fd5b505b60d254600160c01b900463ffffffff16851115610e4d57604051637a7e96df60e01b815260040160405180910390fd5b60d254606554600160a01b90910463ffffffff1690610e6d90879061305d565b1115610e8c57604051638a164f6360e01b815260040160405180910390fd5b8051600090610ea59087906001600160801b03166130de565b905080341015610ec85760405163f244866f60e01b815260040160405180910390fd5b80341115610ee9576040516301b2422760e61b815260040160405180910390fd5b610ef33387611e71565b60d2546040830151600160a01b90910463ffffffff166001600160401b039091161015610f4b5733600090815260ca602090815260408083208a35845290915281208054889290610f4590849061305d565b90915550505b3460006001600160a01b038716156110305760d25461271090610f7b90600160e01b900463ffffffff16846130af565b610f859190613075565b6001600160a01b038816600090815260cb6020526040812080549293508392909190610fbb9084906001600160801b031661303b565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550866001600160a01b03167f5e627b23e8981317689f5541931b5e9805545e7601aa2c86e84217555368dc038260405161102791906001600160801b0391909116815260200190565b60405180910390a25b6040805180820190915260cf546001600160801b038082168352600160801b90910416602082015260d354600090612710906110729063ffffffff16866130af565b61107c9190613075565b905060008161108b85876130fd565b61109591906130fd565b905060405180604001604052808285600001516110b2919061303b565b6001600160801b031681526020018385602001516110d0919061303b565b6001600160801b0390811690915281516020909201518116600160801b0291161760cf55505050505050505050505050565b6097546001600160a01b0316331461112c5760405162461bcd60e51b81526004016109a990612f30565b60cc54610100900460ff166111545760405163249fab5d60e01b815260040160405180910390fd5b80516109e89060d190602084019061288c565b600061117282611e8b565b5192915050565b6097546001600160a01b031633146111a35760405162461bcd60e51b81526004016109a990612f30565b60005b818110156108ec57368383838181106111cf57634e487b7160e01b600052603260045260246000fd5b60a002919091018035600090815260c9602052604090819020919350830191506111f98282613571565b50506040516020820135908235907fe9a0c17645ed78ccc9996259f00297ffc75e6b9d22cd605ccc9992cc8ca3f4c190600090a35080611238816132b7565b9150506111a6565b60006001600160a01b038216611269576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152606a60205260409020546001600160401b031690565b6097546001600160a01b031633146112b85760405162461bcd60e51b81526004016109a990612f30565b6112c26000611fb2565b565b60d0805481906112d39061327c565b80601f01602080910402602001604051908101604052809291908181526020018280546112ff9061327c565b801561134c5780601f106113215761010080835404028352916020019161134c565b820191906000526020600020905b81548152906001019060200180831161132f57829003601f168201915b5050505050908060010180546113619061327c565b80601f016020809104026020016040519081016040528092919081815260200182805461138d9061327c565b80156113da5780601f106113af576101008083540402835291602001916113da565b820191906000526020600020905b8154815290600101906020018083116113bd57829003601f168201915b505050600284015460039094015492936001600160a01b0381169363ffffffff600160a01b830481169450600160c01b830481169350600160e01b9092048216911687565b60606068805461079c9061327c565b6097546001600160a01b031633146114585760405162461bcd60e51b81526004016109a990612f30565b604051663337b932bb32b960c91b602082015260270160405160208183030381529060405280519060200120816040516020016114959190612de0565b60405160208183030381529060405280519060200120146114c957604051635ee88f9760e01b815260040160405180910390fd5b5060ce805460ff19169055565b6001600160a01b0382163314156115005760405163b06307db60e01b815260040160405180910390fd5b336000818152606c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6097546001600160a01b031633146115965760405162461bcd60e51b81526004016109a990612f30565b60cc805460ff19166001179055565b6115b0848484611aa9565b6001600160a01b0383163b151580156115d257506115d084848484612004565b155b156115f0576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b606061160182611a14565b61161e57604051630a14c4b560e41b815260040160405180910390fd5b60cc5460ff1661165a5760d0611633836120fc565b604051602001611644929190612dfc565b6040516020818303038152906040529050919050565b60d180546116679061327c565b151590506116845760405180602001604052806000815250610787565b60d1611633836120fc565b60005460ff16156116f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016109a9565b600054610100900460ff1615801561171b576000805461ff0019166101001790555b6117258484612215565b61138861173860c0840160a08501612d98565b63ffffffff161180611760575061138861175860e0840160c08501612d98565b63ffffffff16115b8061178157506101f461177960e0840160c08501612d98565b63ffffffff16105b1561179f576040516306b7c75960e31b815260040160405180910390fd5b8160d06117ac828261335a565b9050506117b7612246565b60cc805461ffff191661010017905560ce805460ff1916600117905580156115f0576000805461ffff1916600117905550505050565b6097546001600160a01b031633146118175760405162461bcd60e51b81526004016109a990612f30565b604051663337b932bb32b960c91b602082015260270160405160208183030381529060405280519060200120816040516020016118549190612de0565b604051602081830303815290604052805190602001201461188857604051635ee88f9760e01b815260040160405180910390fd5b5060cc805461ff0019169055565b6097546001600160a01b031633146118c05760405162461bcd60e51b81526004016109a990612f30565b600083815260c96020526040902081906118da8282613571565b5050604051829084907fe9a0c17645ed78ccc9996259f00297ffc75e6b9d22cd605ccc9992cc8ca3f4c190600090a3505050565b6001600160a01b039182166000908152606c6020908152604080832093909416825291909152205460ff1690565b6097546001600160a01b031633146119665760405162461bcd60e51b81526004016109a990612f30565b6001600160a01b0381166119cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016109a9565b6119d481611fb2565b50565b6097546001600160a01b03163314611a015760405162461bcd60e51b81526004016109a990612f30565b80516109e89060d090602084019061288c565b600081600111158015611a28575060655482105b8015610787575050600090815260696020526040902054600160e01b900460ff161590565b6000828152606b602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000611ab482611e8b565b9050836001600160a01b031681600001516001600160a01b031614611aeb5760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611b095750611b09853361190e565b80611b24575033611b198461081f565b6001600160a01b0316145b905080611b4457604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416611b6b57604051633a954ecd60e21b815260040160405180910390fd5b611b7760008487611a4d565b6001600160a01b038581166000908152606a60209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652606990945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116611c4b576065548214611c4b57805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60408051606085901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a333200000000605484015260708084019190915283518084039091018152609090920190925280519101206000611d208285612275565b9050826001600160a01b0316816001600160a01b031614611c9057604051638baa579f60e01b815260040160405180910390fd5b60008235611d6457506001610787565b6040516bffffffffffffffffffffffff19606084901b16602082015260009060340160405160208183030381529060405280519060200120905060005b611dae6020860186612fb0565b9050811015611e65576000611dc66020870187612fb0565b83818110611de457634e487b7160e01b600052603260045260246000fd5b905060200201359050808311611e25576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250611e52565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b5080611e5d816132b7565b915050611da1565b50833514905092915050565b6109e8828260405180602001604052806000815250612299565b60408051606081018252600080825260208201819052918101919091528180600111158015611ebb575060655481105b15611f9957600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290611f975780516001600160a01b031615611f2e579392505050565b5060001901600081815260696020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215611f92579392505050565b611f2e565b505b604051636f96cda160e11b815260040160405180910390fd5b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612039903390899088908890600401612e7c565b602060405180830381600087803b15801561205357600080fd5b505af1925050508015612083575060408051601f3d908101601f1916820190925261208091810190612c0e565b60015b6120de573d8080156120b1576040519150601f19603f3d011682016040523d82523d6000602084013e6120b6565b606091505b5080516120d6576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060816121205750506040805180820190915260018152600360fc1b602082015290565b8160005b811561214a5780612134816132b7565b91506121439050600a8361309b565b9150612124565b6000816001600160401b0381111561217257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561219c576020820181803683370190505b5090505b84156120f4576121b1600183613125565b91506121be600a866132d2565b6121c990603061305d565b60f81b8183815181106121ec57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535061220e600a8661309b565b94506121a0565b600054610100900460ff1661223c5760405162461bcd60e51b81526004016109a990612f65565b6109e882826122a6565b600054610100900460ff1661226d5760405162461bcd60e51b81526004016109a990612f65565b6112c26122fe565b6000806000612284858561232e565b915091506122918161239e565b509392505050565b6108ec838383600161259f565b600054610100900460ff166122cd5760405162461bcd60e51b81526004016109a990612f65565b81516122e090606790602085019061288c565b5080516122f490606890602084019061288c565b5060016065555050565b600054610100900460ff166123255760405162461bcd60e51b81526004016109a990612f65565b6112c233611fb2565b6000808251604114156123655760208301516040840151606085015160001a61235987828585612766565b94509450505050612397565b82516040141561238f5760208301516040840151612384868383612853565b935093505050612397565b506000905060025b9250929050565b60008160048111156123c057634e487b7160e01b600052602160045260246000fd5b14156123c95750565b60018160048111156123eb57634e487b7160e01b600052602160045260246000fd5b14156124395760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109a9565b600281600481111561245b57634e487b7160e01b600052602160045260246000fd5b14156124a95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109a9565b60038160048111156124cb57634e487b7160e01b600052602160045260246000fd5b14156125245760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109a9565b600481600481111561254657634e487b7160e01b600052602160045260246000fd5b14156119d45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016109a9565b6065546001600160a01b0385166125c857604051622e076360e81b815260040160405180910390fd5b836125e65760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0385166000818152606a6020908152604080832080546001600160801b031981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452606990925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561268e57506001600160a01b0387163b15155b15612717575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46126df6000888480600101955088612004565b6126fc576040516368d2bf6b60e11b815260040160405180910390fd5b8082141561269457826065541461271257600080fd5b61275d565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415612718575b50606555611c90565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561279d575060009050600361284a565b8460ff16601b141580156127b557508460ff16601c14155b156127c6575060009050600461284a565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561281a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128435760006001925092505061284a565b9150600090505b94509492505050565b6000806001600160ff1b0383168161287060ff86901c601b61305d565b905061287e87828885612766565b935093505050935093915050565b8280546128989061327c565b90600052602060002090601f0160209004810192826128ba5760008555612900565b82601f106128d357805160ff1916838001178555612900565b82800160010185558215612900579182015b828111156129005782518255916020019190600101906128e5565b5061290c929150612910565b5090565b5b8082111561290c5760008155600101612911565b60006001600160401b038084111561293f5761293f613312565b604051601f8501601f19908116603f0116810190828211818310171561296757612967613312565b8160405280935085815286868601111561298057600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126129aa578081fd5b6129b983833560208501612925565b9392505050565b6000602082840312156129d1578081fd5b81356129b9816135eb565b600080604083850312156129ee578081fd5b82356129f9816135eb565b91506020830135612a09816135eb565b809150509250929050565b600080600060608486031215612a28578081fd5b8335612a33816135eb565b92506020840135612a43816135eb565b929592945050506040919091013590565b60008060008060808587031215612a69578081fd5b8435612a74816135eb565b93506020850135612a84816135eb565b92506040850135915060608501356001600160401b03811115612aa5578182fd5b8501601f81018713612ab5578182fd5b612ac487823560208401612925565b91505092959194509250565b60008060408385031215612ae2578182fd5b8235612aed816135eb565b915060208301358015158114612a09578182fd5b60008060408385031215612b13578182fd5b8235612b1e816135eb565b946020939093013593505050565b60008060208385031215612b3e578182fd5b82356001600160401b0380821115612b54578384fd5b818501915085601f830112612b67578384fd5b813581811115612b75578485fd5b86602060a083028501011115612b89578485fd5b60209290920196919550909350505050565b600060208284031215612bac578081fd5b5035919050565b600080600083850360a0811215612bc8578384fd5b84359350602085013592506060603f1982011215612be4578182fd5b506040840190509250925092565b600060208284031215612c03578081fd5b81356129b981613600565b600060208284031215612c1f578081fd5b81516129b981613600565b600060208284031215612c3b578081fd5b81356001600160401b03811115612c50578182fd5b6120f48482850161299a565b600080600060608486031215612c70578081fd5b83356001600160401b0380821115612c86578283fd5b612c928783880161299a565b94506020860135915080821115612ca7578283fd5b612cb38783880161299a565b93506040860135915080821115612cc8578283fd5b50840160e08187031215612cda578182fd5b809150509250925092565b600080600080600060808688031215612cfc578283fd5b85356001600160401b0380821115612d12578485fd5b908701906040828a031215612d25578485fd5b90955060208701359450604087013590612d3e826135eb565b90935060608701359080821115612d53578283fd5b818801915088601f830112612d66578283fd5b813581811115612d74578384fd5b896020828501011115612d85578384fd5b9699959850939650602001949392505050565b600060208284031215612da9578081fd5b81356129b981613616565b60008151808452612dcc816020860160208601613250565b601f01601f19169290920160200192915050565b60008251612df2818460208701613250565b9190910192915050565b6000808454612e0a8161327c565b60018281168015612e225760018114612e3357612e5f565b60ff19841687528287019450612e5f565b8886526020808720875b85811015612e565781548a820152908401908201612e3d565b50505082870194505b505050508351612e73818360208801613250565b01949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612eaf90830184612db4565b9695505050505050565b6020815260006129b96020830184612db4565b60e081526000612edf60e083018a612db4565b8281036020840152612ef1818a612db4565b6001600160a01b03989098166040840152505063ffffffff9485166060820152928416608084015290831660a083015290911660c09091015292915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000808335601e19843603018112612fc6578283fd5b8301803591506001600160401b03821115612fdf578283fd5b6020019150600581901b360382131561239757600080fd5b6000808335601e1984360301811261300d578182fd5b8301803591506001600160401b03821115613026578283fd5b60200191503681900382131561239757600080fd5b60006001600160801b03808316818516808303821115612e7357612e736132e6565b60008219821115613070576130706132e6565b500190565b60006001600160801b038084168061308f5761308f6132fc565b92169190910492915050565b6000826130aa576130aa6132fc565b500490565b60006001600160801b03808316818516818304811182151516156130d5576130d56132e6565b02949350505050565b60008160001904831182151516156130f8576130f86132e6565b500290565b60006001600160801b038381169083168181101561311d5761311d6132e6565b039392505050565b600082821015613137576131376132e6565b500390565b5b818110156109e8576000815560010161313d565b6001600160401b0383111561316857613168613312565b613172815461327c565b600080601f8611601f8411818117156131915760008681526020902092505b80156131c057601f880160051c830160208910156131ac5750825b6131be601f870160051c85018261313c565b505b5080600181146131f4576000945087156131db578387013594505b600188901b60001960038a901b1c198616178655613246565b601f198816945082845b8681101561321e57888601358255602095860195600190920191016131fe565b508886101561323b5760001960f88a60031b161c19858901351681555b5060018860011b0186555b5050505050505050565b60005b8381101561326b578181015183820152602001613253565b838111156115f05750506000910152565b600181811c9082168061329057607f821691505b602082108114156132b157634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156132cb576132cb6132e6565b5060010190565b6000826132e1576132e16132fc565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60008135610787816135eb565b6000813561078781613616565b600081356001600160401b0381168114610787578182fd5b6133648283612ff7565b6001600160401b0381111561337b5761337b613312565b613385835461327c565b600080601f8411601f8411818117156133a45760008881526020902092505b80156133d357601f860160051c830160208710156133bf5750825b6133d1601f870160051c85018261313c565b505b508060018114613407576000945085156133ee578387013594505b600186901b600019600388901b1c198616178855613459565b601f198616945082845b868110156134315788860135825560209586019560019092019101613411565b508686101561344e5760001960f88860031b161c19858901351681555b5060018660011b0188555b5050505050505061346d6020830183612ff7565b61347b818360018601613151565b5050600281016134ad61349060408501613328565b82546001600160a01b0319166001600160a01b0391909116178255565b6134e06134bc60608501613335565b82805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b6135136134ef60808501613335565b82805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b61354661352260a08501613335565b8280546001600160e01b031660e09290921b6001600160e01b031916919091179055565b506109e861355660c08401613335565b6003830163ffffffff821663ffffffff198254161781555050565b81356001600160801b03811680821461358957600080fd5b82546001600160801b0319811682178455915067ffffffffffffffff60801b6135b460208601613342565b60801b166001600160401b0360c01b818382861617178555806135d960408801613342565b60c01b16838317178555505050505050565b6001600160a01b03811681146119d457600080fd5b6001600160e01b0319811681146119d457600080fd5b63ffffffff811681146119d457600080fdfea2646970667358221220178f2f90700adbad6ac49ef2508a32964b95aa4a1b0dbcfd77689f52d0c6cad764736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.