ETH Price: $3,385.52 (-0.28%)
Gas: 2 Gwei

Contract

0xf273B9eeb2E6D1DA35004b18291d05f342a518E6
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x60806040140623322022-01-23 14:08:21888 days ago1642946901IN
 Create: StaxxInvaders
0 ETH0.2077466278.69944675

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StaxxInvaders

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 17 : StaxxInvaders.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";

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

//    _____ __                     ____                     __
//   / ___// /_____ __  ___  __   /  _/___ _   ______ _____/ /__  __________
//   \__ \/ __/ __ `/ |/_/ |/_/   / // __ \ | / / __ `/ __  / _ \/ ___/ ___/
//  ___/ / /_/ /_/ />  <_>  <   _/ // / / / |/ / /_/ / /_/ /  __/ /  (__  )
// /____/\__/\__,_/_/|_/_/|_|  /___/_/ /_/|___/\__,_/\__,_/\___/_/  /____/
//
// The minting contract for Staxx Invaders.
//
// The contract provides two paths for minting.
//   1) through an access list (merkle proof) with a free reward allocation
//   2) through the public sale
//
// The access list will go live before the public sale to give existing holders of STAXX a chance
// to mint early.
contract StaxxInvaders is Initializable, ERC721Upgradeable, ERC721PausableUpgradeable, OwnableUpgradeable {
  using MerkleProofUpgradeable for bytes32[];
  using LibAppStorage for LibAppStorage.AppStorage;
  using StringsUpgradeable for uint256;

  /// The price each pass will sell for.
  uint256 public constant price = 0.03 ether;

  // The root hash of the merkle proof used to validate the minting order and image details.
  bytes32 public constant provenanceHash = 0xbc09e38d70d0b6508dd2d7bb5d8a491467f497122c35618eb87c0f5e6510e056;
  string public constant provenanceUri = "ipfs://QmWZsoopdqzuxka5npPE9oEwnDqSH7tFpUza5sPPA8QbNs";

  /// Events.
  event PresaleClaimed(address sender, uint256 paid, uint256 free);
  event ContractInit(bytes32 hash, string name);
  event WithdrawBalance(address caller, uint256 amount);

  event ErrorHandled(string reason);

  struct Args {
    bytes32 rootHash;
    string uri;
    string name;
    string symbol;
    uint40 launchDate;
  }

  struct ArgsV2 {
    bytes32 rootHash;
    uint40 launchDate;
  }

  /// Initialisation function that serves as a constructor for the upgradeable contract.
  function onUpgradeV2(ArgsV2 memory args_) external {
    LibAppStorage.AppStorage storage s = LibAppStorage.appStorage();
    if (!s.v2UpgradeComplete) {
      s.publicLaunchDate = args_.launchDate;
      s.rootHash = args_.rootHash;
      s.v2UpgradeComplete = true;
    }
  }

  /// Fallback to be able to receive ETH payments (just in case!)
  receive() external payable {}

  function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
    require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
    return LibAppStorage.getTokenUri(tokenId);
  }

  /// Minting method for people on the access list that can mint before the public sale and
  /// potentially with a reward of free passes.
  ///
  /// The merkle proof is for the combination of the senders address and number of allocated passes.
  /// These values are encoded to a fixed length padding to help prevent attacking the hash.
  ///
  /// The minter will only pay for any passes they mint beyond those allocated to them. They can
  /// mint as many times as they like, and with as many tokens at a time as they would like. We
  /// track the number of claimed tokens to prevent double dipping.
  function mintPresale(
    uint16 count,
    uint16 free,
    uint16 paid,
    bool vip,
    bytes32[] calldata proof
  ) external payable onlyPresale(vip) {
    LibAppStorage.AppStorage storage s = LibAppStorage.appStorage();
    s.ensureEnoughSupply(count);

    address sender = _msgSender();
    bytes32 leaf = keccak256(abi.encode(sender, free, paid, vip));

    require(proof.verify(s.rootHash, leaf), "Presale Mint: could not verify merkle proof");

    LibAppStorage.Presale storage presale = s.presaleByAddress[_msgSender()];

    (uint16 paidUsed, uint16 freeUsed) = _calculateMintCounts(count, paid, free, presale.paid, presale.free);
    presale.free += freeUsed;
    presale.paid += paidUsed;

    emit PresaleClaimed(sender, paidUsed, freeUsed);

    uint256 cost = paidUsed * price;
    require(msg.value >= cost, "Insufficient funds");

    _safeMintTokens(count);

    if (msg.value > cost) {
      uint256 refund = msg.value - cost;
      (bool success, ) = payable(sender).call{value: refund}("");
      require(success, "Failed to refund additional value");
    }
  }

  /// Perform a regular mint with no limit on passes per transaction. All passes are charged at full
  /// price.
  function mint(uint16 count) external payable onlyPublicSale {
    LibAppStorage.appStorage().ensureSaleLive();
    uint256 cost = count * price;
    require(msg.value >= cost, "Insufficient funds");

    _safeMintTokens(count);

    if (msg.value > cost) {
      uint256 refund = msg.value - cost;
      (bool success, ) = payable(msg.sender).call{value: refund}("");
      require(success, "Failed to refund additional value");
    }
  }

  function _calculateMintCounts(
    uint16 count,
    uint16 paid,
    uint16 free,
    uint16 paidClaimed,
    uint16 freeClaimed
  ) internal pure returns (uint16 paidUsed, uint16 freeUsed) {
    unchecked {
      uint16 paidRemain = LibAppStorage.clamp(int16(paid) - int16(paidClaimed));
      uint16 freeRemain = LibAppStorage.clamp(int16(free) - int16(freeClaimed));

      require(count <= freeRemain + paidRemain, "PRESALE: not enough mints left");
      freeUsed = count > freeRemain ? freeRemain : count;
      paidUsed = count - freeUsed;

      require(freeUsed + paidUsed == count, "OOPS: overflow?");
    }
  }

  function _safeMintTokens(uint16 count) internal {
    LibAppStorage.AppStorage storage s = LibAppStorage.appStorage();
    s.ensureEnoughSupply(count);
    for (uint16 i = 0; i < count; i++) {
      uint256 id = s.nextTokenId();
      _safeMint(msg.sender, id);
    }
  }

  /// Pauses the contract to prevent further sales.
  function pause() external virtual onlyOwner {
    _pause();
  }

  /// Unpauses the contract to allow sales to continue.
  function unpause() external virtual onlyOwner {
    _unpause();
  }

  function total() external pure returns (uint256) {
    return LibAppStorage.TOTAL;
  }

  function totalSupply() external view returns (uint256) {
    return LibAppStorage.appStorage().totalSupply();
  }

  /// Returns the number of free passes claimed by a given wallet.
  function claimed(address addr) external view returns (uint256) {
    return LibAppStorage.appStorage().claimedByAddress[addr];
  }

  /// Returns the number of free passes claimed by a given wallet.
  function presaleClaimed(address addr) external view returns (uint16, uint16) {
    LibAppStorage.Presale memory presale = LibAppStorage.appStorage().presaleByAddress[addr];
    return (presale.free, presale.paid);
  }

  /// Returns the number of free passes claimed by the caller.
  function claimedByMe() external view returns (uint256) {
    return LibAppStorage.appStorage().claimedByAddress[msg.sender];
  }

  /// Returns the number of free passes claimed by the caller.
  function presaleClaimedByMe() external view returns (uint16, uint16) {
    LibAppStorage.Presale memory presale = LibAppStorage.appStorage().presaleByAddress[msg.sender];
    return (presale.free, presale.paid);
  }

  function presaleStartTime() public view returns (uint256) {
    return LibAppStorage.appStorage().publicLaunchDate;
  }

  function vipStartTime() public view returns (uint256) {
    return LibAppStorage.appStorage().publicLaunchDate - 24 hours;
  }

  function publicStartTime() public view returns (uint256) {
    return LibAppStorage.appStorage().publicLaunchDate + 24 hours;
  }

  /// Returns the timestamp of the public sale start time.
  function publicLaunch() external view returns (uint256) {
    return publicStartTime();
  }

  function setSaleStartTime(uint40 launch_) external onlyOwner {
    LibAppStorage.appStorage().publicLaunchDate = launch_;
  }

  function presaleOpen() public view returns (bool) {
    return block.timestamp >= presaleStartTime();
  }

  function saleOpen() public view returns (bool) {
    return block.timestamp >= publicStartTime();
  }

  function vipSaleOpen() public view returns (bool) {
    return block.timestamp >= vipStartTime();
  }

  /// Returns the root hash of the merkle tree proof used to validate the access list.
  function rootHash() external view returns (bytes32) {
    return LibAppStorage.appStorage().rootHash;
  }

  /// Updates the root hash of the merkle proof.
  function setRootHash(bytes32 rootHash_) external onlyOwner {
    LibAppStorage.appStorage().rootHash = rootHash_;
  }

  /// Updates the metadata URI.
  function setURI(string calldata baseURI) external onlyOwner {
    LibAppStorage.appStorage().baseUrl = baseURI;
  }

  /// Transfers the funds out of the contract to the owners wallet.
  function withdraw() public onlyOwner {
    uint256 balance = address(this).balance;
    payable(msg.sender).transfer(balance);
    emit WithdrawBalance(msg.sender, balance);
  }

  modifier onlyPresale(bool vip) {
    if (vip) {
      require(block.timestamp >= vipStartTime(), "VIP sale not open yet");
    } else {
      require(block.timestamp >= presaleStartTime(), "Presale not open yet");
    }
    require(block.timestamp < publicStartTime(), "Presale has closed");
    _;
  }

  modifier onlyPublicSale() {
    require(saleOpen(), "Public sale not open yet");
    _;
  }

  /// DANGER: Here be dragons!
  function destroy() external onlyOwner {
    selfdestruct(payable(msg.sender));
  }

  function _beforeTokenTransfer(
    address from,
    address to,
    uint256 id
  ) internal virtual override(ERC721Upgradeable, ERC721PausableUpgradeable) {
    super._beforeTokenTransfer(from, to, id);
  }
}

File 2 of 17 : 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 {
        __Context_init_unchained();
        __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);
    }
    uint256[49] private __gap;
}

File 3 of 17 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 a proxied contract can't have 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(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @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 17 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __ERC721_init_unchained(name_, symbol_);
    }

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

    /**
     * @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 virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

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

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

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

File 6 of 17 : 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 7 of 17 : 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 17 : ERC721PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Pausable.sol)

pragma solidity ^0.8.0;

import "../ERC721Upgradeable.sol";
import "../../../security/PausableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev ERC721 token with pausable token transfers, minting and burning.
 *
 * Useful for scenarios such as preventing trades until the end of an evaluation
 * period, or having an emergency switch for freezing all token transfers in the
 * event of a large bug.
 */
abstract contract ERC721PausableUpgradeable is Initializable, ERC721Upgradeable, PausableUpgradeable {
    function __ERC721Pausable_init() internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __Pausable_init_unchained();
        __ERC721Pausable_init_unchained();
    }

    function __ERC721Pausable_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {ERC721-_beforeTokenTransfer}.
     *
     * Requirements:
     *
     * - the contract must not be paused.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, tokenId);

        require(!paused(), "ERC721Pausable: token transfer while paused");
    }
    uint256[50] private __gap;
}

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

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 17 : 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 {
        __Context_init_unchained();
    }

    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;
    }
    uint256[50] private __gap;
}

File 12 of 17 : CountersUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library CountersUpgradeable {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 13 of 17 : 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 14 of 17 : MerkleProofUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProofUpgradeable {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }
        return computedHash;
    }
}

File 15 of 17 : 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 {
        __ERC165_init_unchained();
    }

    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;
    }
    uint256[50] private __gap;
}

File 16 of 17 : 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);
}

File 17 of 17 : LibAppStorage.sol
pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";

library LibAppStorage {
  using StringsUpgradeable for uint256;
  using CountersUpgradeable for CountersUpgradeable.Counter;

  /// Total number of passes to sell.
  uint256 public constant TOTAL = 10500;
  bytes32 constant STORAGE_POSITION = keccak256("staxx.minting.storage");

  struct Presale {
    uint16 free;
    uint16 paid;
    uint32[7] __padding;
  }

  struct AppStorage {
    CountersUpgradeable.Counter counter;
    // Timestamp of the public launch.
    uint40 publicLaunchDate;
    // The root hash of the merkle proof used to validate the presale list.
    bytes32 rootHash;
    // Keep track of the number of passes claimed from the access list to prevent double dipping.
    mapping(address => uint256) claimedByAddress;
    string baseUrl;
    bool v2UpgradeComplete;
    // Keep track of the number of passes claimed from the presale list to prevent double dipping.
    mapping(address => Presale) presaleByAddress;
  }

  function appStorage() internal pure returns (AppStorage storage ds) {
    bytes32 position = STORAGE_POSITION;
    assembly {
      ds.slot := position
    }
  }

  function abs(int256 x) internal pure returns (uint256) {
    return uint256(x >= 0 ? x : -x);
  }

  function min(uint256 x, uint256 y) internal pure returns (uint256) {
    return uint256(x < y ? x : y);
  }

  function clamp(int16 x) internal pure returns (uint16) {
    return uint16(x > 0 ? x : int16(0));
  }

  function getTokenUri(uint256 tokenId) internal view returns (string memory) {
    return string(abi.encodePacked(appStorage().baseUrl, tokenId.toString(), ".json"));
  }

  function totalSupply(AppStorage storage s) internal view returns (uint256) {
    return s.counter.current();
  }

  function nextTokenId(AppStorage storage s) internal returns (uint256) {
    s.counter.increment();
    return totalSupply(s);
  }

  function ensureEnoughSupply(AppStorage storage s, uint40 count) internal view {
    require(totalSupply(s) + count <= TOTAL, "Not enough supply to mint");
  }

  function ensureSaleLive(AppStorage storage s) internal view {
    require(block.timestamp >= s.publicLaunchDate, "Public sale has not started yet");
  }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"ContractInit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"ErrorHandled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"paid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"free","type":"uint256"}],"name":"PresaleClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawBalance","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"claimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimedByMe","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"destroy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"uint16","name":"count","type":"uint16"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"count","type":"uint16"},{"internalType":"uint16","name":"free","type":"uint16"},{"internalType":"uint16","name":"paid","type":"uint16"},{"internalType":"bool","name":"vip","type":"bool"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintPresale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"rootHash","type":"bytes32"},{"internalType":"uint40","name":"launchDate","type":"uint40"}],"internalType":"struct StaxxInvaders.ArgsV2","name":"args_","type":"tuple"}],"name":"onUpgradeV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"presaleClaimed","outputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleClaimedByMe","outputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenanceHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenanceUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicLaunch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rootHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":[],"name":"saleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"rootHash_","type":"bytes32"}],"name":"setRootHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint40","name":"launch_","type":"uint40"}],"name":"setSaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","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":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vipSaleOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vipStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50612eca806100206000396000f3fe60806040526004361061026b5760003560e01c806370a0823111610144578063ad908c3f116100b6578063c884ef831161007a578063c884ef8314610706578063e985e9c51461075b578063f2fde38b146107a4578063f80a1dd8146107c4578063f9765bc1146107e4578063fb819a641461080457600080fd5b8063ad908c3f14610668578063b88d4fde1461067d578063bee6348a1461069d578063c6ab67a3146106b2578063c87b56dd146106e657600080fd5b80638da5cb5b116101085780638da5cb5b146105bc57806395d89b41146105da57806399288dbb146105ef578063a035b1fe14610604578063a22cb4651461061f578063a82524b21461063f57600080fd5b806370a082311461052d578063715018a61461054d5780637218ea771461056257806383197ef0146105925780638456cb59146105a757600080fd5b806323cf0a22116101dd57806342842e0e116101a157806342842e0e146104965780634cdf6b1f146104b65780634d416716146104cb5780635c975abb146104e05780635fd1bbc4146104f85780636352211e1461050d57600080fd5b806323cf0a22146104245780632d7eae66146104375780632ddbd13a146104575780633ccfd60b1461046c5780633f4ba83a1461048157600080fd5b8063095ea7b31161022f578063095ea7b31461037357806318160ddd146103935780631bc2aa68146103a85780631d80009a146103bd5780631e668c0b146103f157806323b872dd1461040457600080fd5b806301ffc9a71461027757806302fe5305146102ac578063032deb39146102ce57806306fdde0314610319578063081812fc1461033b57600080fd5b3661027257005b600080fd5b34801561028357600080fd5b506102976102923660046125a6565b610824565b60405190151581526020015b60405180910390f35b3480156102b857600080fd5b506102cc6102c73660046125ca565b610876565b005b3480156102da57600080fd5b503360009081527ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2760205260409020545b6040519081526020016102a3565b34801561032557600080fd5b5061032e6108d9565b6040516102a39190612694565b34801561034757600080fd5b5061035b6103563660046126a7565b61096b565b6040516001600160a01b0390911681526020016102a3565b34801561037f57600080fd5b506102cc61038e3660046126dc565b610a00565b34801561039f57600080fd5b5061030b610b11565b3480156103b457600080fd5b50610297610b2f565b3480156103c957600080fd5b507ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e265461030b565b6102cc6103ff366004612728565b610b41565b34801561041057600080fd5b506102cc61041f3660046127df565b610f5f565b6102cc61043236600461281b565b610f90565b34801561044357600080fd5b506102cc6104523660046126a7565b6110e8565b34801561046357600080fd5b5061290461030b565b34801561047857600080fd5b506102cc611136565b34801561048d57600080fd5b506102cc6111cc565b3480156104a257600080fd5b506102cc6104b13660046127df565b611200565b3480156104c257600080fd5b5061030b61121b565b3480156104d757600080fd5b5061032e611225565b3480156104ec57600080fd5b5060975460ff16610297565b34801561050457600080fd5b5061030b611241565b34801561051957600080fd5b5061035b6105283660046126a7565b611274565b34801561053957600080fd5b5061030b610548366004612836565b6112eb565b34801561055957600080fd5b506102cc611372565b34801561056e57600080fd5b506105776113a6565b6040805161ffff9384168152929091166020830152016102a3565b34801561059e57600080fd5b506102cc611470565b3480156105b357600080fd5b506102cc61149d565b3480156105c857600080fd5b5060fb546001600160a01b031661035b565b3480156105e657600080fd5b5061032e6114cf565b3480156105fb57600080fd5b506102976114de565b34801561061057600080fd5b5061030b666a94d74f43000081565b34801561062b57600080fd5b506102cc61063a366004612851565b6114e8565b34801561064b57600080fd5b50600080516020612e758339815191525464ffffffffff1661030b565b34801561067457600080fd5b5061030b6114f3565b34801561068957600080fd5b506102cc6106983660046128cb565b61151b565b3480156106a957600080fd5b5061029761154d565b3480156106be57600080fd5b5061030b7fbc09e38d70d0b6508dd2d7bb5d8a491467f497122c35618eb87c0f5e6510e05681565b3480156106f257600080fd5b5061032e6107013660046126a7565b61156c565b34801561071257600080fd5b5061030b610721366004612836565b6001600160a01b031660009081527ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e27602052604090205490565b34801561076757600080fd5b5061029761077636600461298b565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b3480156107b057600080fd5b506102cc6107bf366004612836565b6115f4565b3480156107d057600080fd5b506102cc6107df3660046129ca565b61168f565b3480156107f057600080fd5b506105776107ff366004612836565b6116e4565b34801561081057600080fd5b506102cc61081f3660046129e5565b6117b8565b60006001600160e01b031982166380ac58cd60e01b148061085557506001600160e01b03198216635b5e139f60e01b145b8061087057506301ffc9a760e01b6001600160e01b03198316145b92915050565b60fb546001600160a01b031633146108a95760405162461bcd60e51b81526004016108a090612a39565b60405180910390fd5b6108d47ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e288383612500565b505050565b6060606580546108e890612a6e565b80601f016020809104026020016040519081016040528092919081815260200182805461091490612a6e565b80156109615780601f1061093657610100808354040283529160200191610961565b820191906000526020600020905b81548152906001019060200180831161094457829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166109e45760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108a0565b506000908152606960205260409020546001600160a01b031690565b6000610a0b82611274565b9050806001600160a01b0316836001600160a01b03161415610a795760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108a0565b336001600160a01b0382161480610a955750610a958133610776565b610b075760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108a0565b6108d4838361182c565b6000610b2a600080516020612e2083398151915261189a565b905090565b6000610b396114f3565b421015905090565b828015610b9c57610b506114f3565b421015610b975760405162461bcd60e51b8152602060048201526015602482015274159254081cd85b19481b9bdd081bdc195b881e595d605a1b60448201526064016108a0565b610bf9565b600080516020612e758339815191525464ffffffffff16421015610bf95760405162461bcd60e51b8152602060048201526014602482015273141c995cd85b19481b9bdd081bdc195b881e595d60621b60448201526064016108a0565b610c01611241565b4210610c445760405162461bcd60e51b8152602060048201526012602482015271141c995cd85b19481a185cc818db1bdcd95960721b60448201526064016108a0565b600080516020612e20833981519152610c618161ffff8a166118a4565b600033604080516001600160a01b038316602082015261ffff808c16928201929092529089166060820152871515608082015290915060009060a001604051602081830303815290604052805190602001209050610cfb8360020154828888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509294939250506119109050565b610d5b5760405162461bcd60e51b815260206004820152602b60248201527f50726573616c65204d696e743a20636f756c64206e6f7420766572696679206d60448201526a32b935b63290383937b7b360a91b60648201526084016108a0565b336000908152600684016020526040812080549091908190610d8f908e908d908f9061ffff62010000820481169116611926565b8454919350915081908490600090610dac90849061ffff16612abf565b92506101000a81548161ffff021916908361ffff160217905550818360000160028282829054906101000a900461ffff16610de79190612abf565b92506101000a81548161ffff021916908361ffff1602179055507fb77b46beaad01ac4ea98a08ba197ee5592755072314f9e264b8f2fff7c2e092c858383604051610e54939291906001600160a01b0393909316835261ffff918216602084015216604082015260600190565b60405180910390a16000610e73666a94d74f43000061ffff8516612ae5565b905080341015610eba5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064016108a0565b610ec38e611a16565b80341115610f4f576000610ed78234612b04565b90506000876001600160a01b03168260405160006040518083038185875af1925050503d8060008114610f26576040519150601f19603f3d011682016040523d82523d6000602084013e610f2b565b606091505b5050905080610f4c5760405162461bcd60e51b81526004016108a090612b1b565b50505b5050505050505050505050505050565b610f693382611a70565b610f855760405162461bcd60e51b81526004016108a090612b5c565b6108d4838383611b67565b610f986114de565b610fe45760405162461bcd60e51b815260206004820152601860248201527f5075626c69632073616c65206e6f74206f70656e20796574000000000000000060448201526064016108a0565b610ffb600080516020612e20833981519152611d12565b6000611012666a94d74f43000061ffff8416612ae5565b9050803410156110595760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064016108a0565b61106282611a16565b803411156110e45760006110768234612b04565b604051909150600090339083908381818185875af1925050503d80600081146110bb576040519150601f19603f3d011682016040523d82523d6000602084013e6110c0565b606091505b50509050806110e15760405162461bcd60e51b81526004016108a090612b1b565b50505b5050565b60fb546001600160a01b031633146111125760405162461bcd60e51b81526004016108a090612a39565b7ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2655565b60fb546001600160a01b031633146111605760405162461bcd60e51b81526004016108a090612a39565b6040514790339082156108fc029083906000818181858888f1935050505015801561118f573d6000803e3d6000fd5b5060408051338152602081018390527f0875ab8e60d8ffe0781ba5e1d1adadeb6250bc1bee87d3094cc6ac4eb9f88512910160405180910390a150565b60fb546001600160a01b031633146111f65760405162461bcd60e51b81526004016108a090612a39565b6111fe611d6d565b565b6108d48383836040518060200160405280600081525061151b565b6000610b2a611241565b604051806060016040528060358152602001612e406035913981565b600080516020612e75833981519152546000906112689064ffffffffff1662015180612bad565b64ffffffffff16905090565b6000818152606760205260408120546001600160a01b0316806108705760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016108a0565b60006001600160a01b0382166113565760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016108a0565b506001600160a01b031660009081526068602052604090205490565b60fb546001600160a01b0316331461139c5760405162461bcd60e51b81526004016108a090612a39565b6111fe6000611e00565b3360009081527ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2a602090815260408083208151606081018352815461ffff8082168352620100009091041693810193909352815160e08101808452859485949093929084019160018401906007908288855b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116114185750505092909352505082516020909301519296929550919350505050565b60fb546001600160a01b0316331461149a5760405162461bcd60e51b81526004016108a090612a39565b33ff5b60fb546001600160a01b031633146114c75760405162461bcd60e51b81526004016108a090612a39565b6111fe611e52565b6060606680546108e890612a6e565b6000610b39611241565b6110e4338383611ecd565b600080516020612e758339815191525460009061126890620151809064ffffffffff16612bcd565b6115253383611a70565b6115415760405162461bcd60e51b81526004016108a090612b5c565b6110e184848484611f9c565b6000610b39600080516020612e758339815191525464ffffffffff1690565b6000818152606760205260409020546060906001600160a01b03166115eb5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016108a0565b61087082611fcf565b60fb546001600160a01b0316331461161e5760405162461bcd60e51b81526004016108a090612a39565b6001600160a01b0381166116835760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108a0565b61168c81611e00565b50565b60fb546001600160a01b031633146116b95760405162461bcd60e51b81526004016108a090612a39565b600080516020612e75833981519152805464ffffffffff191664ffffffffff92909216919091179055565b6001600160a01b03811660009081527ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2a602090815260408083208151606081018352815461ffff8082168352620100009091041693810193909352815160e08101808452859485949093929084019160018401906007908288855b82829054906101000a900463ffffffff1663ffffffff168152602001906004019060208260030104928301926001038202915080841161175f575050509290935250508251602090930151929792965091945050505050565b7ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2954600080516020612e208339815191529060ff166110e45760208201516001828101805464ffffffffff191664ffffffffff9093169290921790915591516002820155600501805460ff19169091179055565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061186182611274565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000610870825490565b6129048164ffffffffff166118b88461189a565b6118c29190612bf3565b11156110e45760405162461bcd60e51b815260206004820152601960248201527f4e6f7420656e6f75676820737570706c7920746f206d696e740000000000000060448201526064016108a0565b60008261191d8584612022565b14949350505050565b60008060006119368588036120ce565b905060006119458588036120ce565b905081810161ffff168961ffff1611156119a15760405162461bcd60e51b815260206004820152601e60248201527f50524553414c453a206e6f7420656e6f756768206d696e7473206c656674000060448201526064016108a0565b8061ffff168961ffff16116119b657886119b8565b805b925082890393508861ffff1684840161ffff1614611a0a5760405162461bcd60e51b815260206004820152600f60248201526e4f4f50533a206f766572666c6f773f60881b60448201526064016108a0565b50509550959350505050565b600080516020612e20833981519152611a338161ffff84166118a4565b60005b8261ffff168161ffff1610156108d4576000611a51836120e5565b9050611a5d33826120f7565b5080611a6881612c0b565b915050611a36565b6000818152606760205260408120546001600160a01b0316611ae95760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108a0565b6000611af483611274565b9050806001600160a01b0316846001600160a01b03161480611b2f5750836001600160a01b0316611b248461096b565b6001600160a01b0316145b80611b5f57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611b7a82611274565b6001600160a01b031614611be25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016108a0565b6001600160a01b038216611c445760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108a0565b611c4f838383612111565b611c5a60008261182c565b6001600160a01b0383166000908152606860205260408120805460019290611c83908490612b04565b90915550506001600160a01b0382166000908152606860205260408120805460019290611cb1908490612bf3565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600181015464ffffffffff1642101561168c5760405162461bcd60e51b815260206004820152601f60248201527f5075626c69632073616c6520686173206e6f742073746172746564207965740060448201526064016108a0565b60975460ff16611db65760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108a0565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60975460ff1615611e985760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108a0565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611de33390565b816001600160a01b0316836001600160a01b03161415611f2f5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108a0565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611fa7848484611b67565b611fb38484848461211c565b6110e15760405162461bcd60e51b81526004016108a090612c2d565b60607ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e28611ffb8361221a565b60405160200161200c929190612c9b565b6040516020818303038152906040529050919050565b600081815b84518110156120c657600085828151811061204457612044612d56565b602002602001015190508083116120865760408051602081018590529081018290526060016040516020818303038152906040528051906020012092506120b3565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806120be81612d6c565b915050612027565b509392505050565b6000808260010b136120e1576000610870565b5090565b8054600101815560006108708261189a565b6110e4828260405180602001604052806000815250612318565b6108d483838361234b565b60006001600160a01b0384163b1561220f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612160903390899088908890600401612d87565b6020604051808303816000875af192505050801561219b575060408051601f3d908101601f1916820190925261219891810190612dc4565b60015b6121f5573d8080156121c9576040519150601f19603f3d011682016040523d82523d6000602084013e6121ce565b606091505b5080516121ed5760405162461bcd60e51b81526004016108a090612c2d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611b5f565b506001949350505050565b60608161223e5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612268578061225281612d6c565b91506122619050600a83612df7565b9150612242565b60008167ffffffffffffffff81111561228357612283612884565b6040519080825280601f01601f1916602001820160405280156122ad576020820181803683370190505b5090505b8415611b5f576122c2600183612b04565b91506122cf600a86612e0b565b6122da906030612bf3565b60f81b8183815181106122ef576122ef612d56565b60200101906001600160f81b031916908160001a905350612311600a86612df7565b94506122b1565b61232283836123b2565b61232f600084848461211c565b6108d45760405162461bcd60e51b81526004016108a090612c2d565b60975460ff16156108d45760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b60648201526084016108a0565b6001600160a01b0382166124085760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108a0565b6000818152606760205260409020546001600160a01b03161561246d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108a0565b61247960008383612111565b6001600160a01b03821660009081526068602052604081208054600192906124a2908490612bf3565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461250c90612a6e565b90600052602060002090601f01602090048101928261252e5760008555612574565b82601f106125475782800160ff19823516178555612574565b82800160010185558215612574579182015b82811115612574578235825591602001919060010190612559565b506120e19291505b808211156120e1576000815560010161257c565b6001600160e01b03198116811461168c57600080fd5b6000602082840312156125b857600080fd5b81356125c381612590565b9392505050565b600080602083850312156125dd57600080fd5b823567ffffffffffffffff808211156125f557600080fd5b818501915085601f83011261260957600080fd5b81358181111561261857600080fd5b86602082850101111561262a57600080fd5b60209290920196919550909350505050565b60005b8381101561265757818101518382015260200161263f565b838111156110e15750506000910152565b6000815180845261268081602086016020860161263c565b601f01601f19169290920160200192915050565b6020815260006125c36020830184612668565b6000602082840312156126b957600080fd5b5035919050565b80356001600160a01b03811681146126d757600080fd5b919050565b600080604083850312156126ef57600080fd5b6126f8836126c0565b946020939093013593505050565b803561ffff811681146126d757600080fd5b803580151581146126d757600080fd5b60008060008060008060a0878903121561274157600080fd5b61274a87612706565b955061275860208801612706565b945061276660408801612706565b935061277460608801612718565b9250608087013567ffffffffffffffff8082111561279157600080fd5b818901915089601f8301126127a557600080fd5b8135818111156127b457600080fd5b8a60208260051b85010111156127c957600080fd5b6020830194508093505050509295509295509295565b6000806000606084860312156127f457600080fd5b6127fd846126c0565b925061280b602085016126c0565b9150604084013590509250925092565b60006020828403121561282d57600080fd5b6125c382612706565b60006020828403121561284857600080fd5b6125c3826126c0565b6000806040838503121561286457600080fd5b61286d836126c0565b915061287b60208401612718565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156128c3576128c3612884565b604052919050565b600080600080608085870312156128e157600080fd5b6128ea856126c0565b935060206128f98187016126c0565b935060408601359250606086013567ffffffffffffffff8082111561291d57600080fd5b818801915088601f83011261293157600080fd5b81358181111561294357612943612884565b612955601f8201601f1916850161289a565b9150808252898482850101111561296b57600080fd5b808484018584013760008482840101525080935050505092959194509250565b6000806040838503121561299e57600080fd5b6129a7836126c0565b915061287b602084016126c0565b803564ffffffffff811681146126d757600080fd5b6000602082840312156129dc57600080fd5b6125c3826129b5565b6000604082840312156129f757600080fd5b6040516040810181811067ffffffffffffffff82111715612a1a57612a1a612884565b60405282358152612a2d602084016129b5565b60208201529392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680612a8257607f821691505b60208210811415612aa357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600061ffff808316818516808303821115612adc57612adc612aa9565b01949350505050565b6000816000190483118215151615612aff57612aff612aa9565b500290565b600082821015612b1657612b16612aa9565b500390565b60208082526021908201527f4661696c656420746f20726566756e64206164646974696f6e616c2076616c756040820152606560f81b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600064ffffffffff808316818516808303821115612adc57612adc612aa9565b600064ffffffffff83811690831681811015612beb57612beb612aa9565b039392505050565b60008219821115612c0657612c06612aa9565b500190565b600061ffff80831681811415612c2357612c23612aa9565b6001019392505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008151612c9181856020860161263c565b9290920192915050565b600080845481600182811c915080831680612cb757607f831692505b6020808410821415612cd757634e487b7160e01b86526022600452602486fd5b818015612ceb5760018114612cfc57612d29565b60ff19861689528489019650612d29565b60008b81526020902060005b86811015612d215781548b820152908501908301612d08565b505084890196505b505050505050612d4d612d3c8286612c7f565b64173539b7b760d91b815260050190565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415612d8057612d80612aa9565b5060010190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612dba90830184612668565b9695505050505050565b600060208284031215612dd657600080fd5b81516125c381612590565b634e487b7160e01b600052601260045260246000fd5b600082612e0657612e06612de1565b500490565b600082612e1a57612e1a612de1565b50069056fefef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e24697066733a2f2f516d575a736f6f7064717a75786b61356e705045396f45776e4471534837744670557a6135735050413851624e73fef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e25a264697066735822122024fcdbe72cf50870332ffbde2934dc48d3365cc3ee37aff796f6087377f1155b64736f6c634300080b0033

Deployed Bytecode

0x60806040526004361061026b5760003560e01c806370a0823111610144578063ad908c3f116100b6578063c884ef831161007a578063c884ef8314610706578063e985e9c51461075b578063f2fde38b146107a4578063f80a1dd8146107c4578063f9765bc1146107e4578063fb819a641461080457600080fd5b8063ad908c3f14610668578063b88d4fde1461067d578063bee6348a1461069d578063c6ab67a3146106b2578063c87b56dd146106e657600080fd5b80638da5cb5b116101085780638da5cb5b146105bc57806395d89b41146105da57806399288dbb146105ef578063a035b1fe14610604578063a22cb4651461061f578063a82524b21461063f57600080fd5b806370a082311461052d578063715018a61461054d5780637218ea771461056257806383197ef0146105925780638456cb59146105a757600080fd5b806323cf0a22116101dd57806342842e0e116101a157806342842e0e146104965780634cdf6b1f146104b65780634d416716146104cb5780635c975abb146104e05780635fd1bbc4146104f85780636352211e1461050d57600080fd5b806323cf0a22146104245780632d7eae66146104375780632ddbd13a146104575780633ccfd60b1461046c5780633f4ba83a1461048157600080fd5b8063095ea7b31161022f578063095ea7b31461037357806318160ddd146103935780631bc2aa68146103a85780631d80009a146103bd5780631e668c0b146103f157806323b872dd1461040457600080fd5b806301ffc9a71461027757806302fe5305146102ac578063032deb39146102ce57806306fdde0314610319578063081812fc1461033b57600080fd5b3661027257005b600080fd5b34801561028357600080fd5b506102976102923660046125a6565b610824565b60405190151581526020015b60405180910390f35b3480156102b857600080fd5b506102cc6102c73660046125ca565b610876565b005b3480156102da57600080fd5b503360009081527ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2760205260409020545b6040519081526020016102a3565b34801561032557600080fd5b5061032e6108d9565b6040516102a39190612694565b34801561034757600080fd5b5061035b6103563660046126a7565b61096b565b6040516001600160a01b0390911681526020016102a3565b34801561037f57600080fd5b506102cc61038e3660046126dc565b610a00565b34801561039f57600080fd5b5061030b610b11565b3480156103b457600080fd5b50610297610b2f565b3480156103c957600080fd5b507ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e265461030b565b6102cc6103ff366004612728565b610b41565b34801561041057600080fd5b506102cc61041f3660046127df565b610f5f565b6102cc61043236600461281b565b610f90565b34801561044357600080fd5b506102cc6104523660046126a7565b6110e8565b34801561046357600080fd5b5061290461030b565b34801561047857600080fd5b506102cc611136565b34801561048d57600080fd5b506102cc6111cc565b3480156104a257600080fd5b506102cc6104b13660046127df565b611200565b3480156104c257600080fd5b5061030b61121b565b3480156104d757600080fd5b5061032e611225565b3480156104ec57600080fd5b5060975460ff16610297565b34801561050457600080fd5b5061030b611241565b34801561051957600080fd5b5061035b6105283660046126a7565b611274565b34801561053957600080fd5b5061030b610548366004612836565b6112eb565b34801561055957600080fd5b506102cc611372565b34801561056e57600080fd5b506105776113a6565b6040805161ffff9384168152929091166020830152016102a3565b34801561059e57600080fd5b506102cc611470565b3480156105b357600080fd5b506102cc61149d565b3480156105c857600080fd5b5060fb546001600160a01b031661035b565b3480156105e657600080fd5b5061032e6114cf565b3480156105fb57600080fd5b506102976114de565b34801561061057600080fd5b5061030b666a94d74f43000081565b34801561062b57600080fd5b506102cc61063a366004612851565b6114e8565b34801561064b57600080fd5b50600080516020612e758339815191525464ffffffffff1661030b565b34801561067457600080fd5b5061030b6114f3565b34801561068957600080fd5b506102cc6106983660046128cb565b61151b565b3480156106a957600080fd5b5061029761154d565b3480156106be57600080fd5b5061030b7fbc09e38d70d0b6508dd2d7bb5d8a491467f497122c35618eb87c0f5e6510e05681565b3480156106f257600080fd5b5061032e6107013660046126a7565b61156c565b34801561071257600080fd5b5061030b610721366004612836565b6001600160a01b031660009081527ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e27602052604090205490565b34801561076757600080fd5b5061029761077636600461298b565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b3480156107b057600080fd5b506102cc6107bf366004612836565b6115f4565b3480156107d057600080fd5b506102cc6107df3660046129ca565b61168f565b3480156107f057600080fd5b506105776107ff366004612836565b6116e4565b34801561081057600080fd5b506102cc61081f3660046129e5565b6117b8565b60006001600160e01b031982166380ac58cd60e01b148061085557506001600160e01b03198216635b5e139f60e01b145b8061087057506301ffc9a760e01b6001600160e01b03198316145b92915050565b60fb546001600160a01b031633146108a95760405162461bcd60e51b81526004016108a090612a39565b60405180910390fd5b6108d47ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e288383612500565b505050565b6060606580546108e890612a6e565b80601f016020809104026020016040519081016040528092919081815260200182805461091490612a6e565b80156109615780601f1061093657610100808354040283529160200191610961565b820191906000526020600020905b81548152906001019060200180831161094457829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b03166109e45760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108a0565b506000908152606960205260409020546001600160a01b031690565b6000610a0b82611274565b9050806001600160a01b0316836001600160a01b03161415610a795760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108a0565b336001600160a01b0382161480610a955750610a958133610776565b610b075760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108a0565b6108d4838361182c565b6000610b2a600080516020612e2083398151915261189a565b905090565b6000610b396114f3565b421015905090565b828015610b9c57610b506114f3565b421015610b975760405162461bcd60e51b8152602060048201526015602482015274159254081cd85b19481b9bdd081bdc195b881e595d605a1b60448201526064016108a0565b610bf9565b600080516020612e758339815191525464ffffffffff16421015610bf95760405162461bcd60e51b8152602060048201526014602482015273141c995cd85b19481b9bdd081bdc195b881e595d60621b60448201526064016108a0565b610c01611241565b4210610c445760405162461bcd60e51b8152602060048201526012602482015271141c995cd85b19481a185cc818db1bdcd95960721b60448201526064016108a0565b600080516020612e20833981519152610c618161ffff8a166118a4565b600033604080516001600160a01b038316602082015261ffff808c16928201929092529089166060820152871515608082015290915060009060a001604051602081830303815290604052805190602001209050610cfb8360020154828888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509294939250506119109050565b610d5b5760405162461bcd60e51b815260206004820152602b60248201527f50726573616c65204d696e743a20636f756c64206e6f7420766572696679206d60448201526a32b935b63290383937b7b360a91b60648201526084016108a0565b336000908152600684016020526040812080549091908190610d8f908e908d908f9061ffff62010000820481169116611926565b8454919350915081908490600090610dac90849061ffff16612abf565b92506101000a81548161ffff021916908361ffff160217905550818360000160028282829054906101000a900461ffff16610de79190612abf565b92506101000a81548161ffff021916908361ffff1602179055507fb77b46beaad01ac4ea98a08ba197ee5592755072314f9e264b8f2fff7c2e092c858383604051610e54939291906001600160a01b0393909316835261ffff918216602084015216604082015260600190565b60405180910390a16000610e73666a94d74f43000061ffff8516612ae5565b905080341015610eba5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064016108a0565b610ec38e611a16565b80341115610f4f576000610ed78234612b04565b90506000876001600160a01b03168260405160006040518083038185875af1925050503d8060008114610f26576040519150601f19603f3d011682016040523d82523d6000602084013e610f2b565b606091505b5050905080610f4c5760405162461bcd60e51b81526004016108a090612b1b565b50505b5050505050505050505050505050565b610f693382611a70565b610f855760405162461bcd60e51b81526004016108a090612b5c565b6108d4838383611b67565b610f986114de565b610fe45760405162461bcd60e51b815260206004820152601860248201527f5075626c69632073616c65206e6f74206f70656e20796574000000000000000060448201526064016108a0565b610ffb600080516020612e20833981519152611d12565b6000611012666a94d74f43000061ffff8416612ae5565b9050803410156110595760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064016108a0565b61106282611a16565b803411156110e45760006110768234612b04565b604051909150600090339083908381818185875af1925050503d80600081146110bb576040519150601f19603f3d011682016040523d82523d6000602084013e6110c0565b606091505b50509050806110e15760405162461bcd60e51b81526004016108a090612b1b565b50505b5050565b60fb546001600160a01b031633146111125760405162461bcd60e51b81526004016108a090612a39565b7ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2655565b60fb546001600160a01b031633146111605760405162461bcd60e51b81526004016108a090612a39565b6040514790339082156108fc029083906000818181858888f1935050505015801561118f573d6000803e3d6000fd5b5060408051338152602081018390527f0875ab8e60d8ffe0781ba5e1d1adadeb6250bc1bee87d3094cc6ac4eb9f88512910160405180910390a150565b60fb546001600160a01b031633146111f65760405162461bcd60e51b81526004016108a090612a39565b6111fe611d6d565b565b6108d48383836040518060200160405280600081525061151b565b6000610b2a611241565b604051806060016040528060358152602001612e406035913981565b600080516020612e75833981519152546000906112689064ffffffffff1662015180612bad565b64ffffffffff16905090565b6000818152606760205260408120546001600160a01b0316806108705760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016108a0565b60006001600160a01b0382166113565760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016108a0565b506001600160a01b031660009081526068602052604090205490565b60fb546001600160a01b0316331461139c5760405162461bcd60e51b81526004016108a090612a39565b6111fe6000611e00565b3360009081527ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2a602090815260408083208151606081018352815461ffff8082168352620100009091041693810193909352815160e08101808452859485949093929084019160018401906007908288855b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116114185750505092909352505082516020909301519296929550919350505050565b60fb546001600160a01b0316331461149a5760405162461bcd60e51b81526004016108a090612a39565b33ff5b60fb546001600160a01b031633146114c75760405162461bcd60e51b81526004016108a090612a39565b6111fe611e52565b6060606680546108e890612a6e565b6000610b39611241565b6110e4338383611ecd565b600080516020612e758339815191525460009061126890620151809064ffffffffff16612bcd565b6115253383611a70565b6115415760405162461bcd60e51b81526004016108a090612b5c565b6110e184848484611f9c565b6000610b39600080516020612e758339815191525464ffffffffff1690565b6000818152606760205260409020546060906001600160a01b03166115eb5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016108a0565b61087082611fcf565b60fb546001600160a01b0316331461161e5760405162461bcd60e51b81526004016108a090612a39565b6001600160a01b0381166116835760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108a0565b61168c81611e00565b50565b60fb546001600160a01b031633146116b95760405162461bcd60e51b81526004016108a090612a39565b600080516020612e75833981519152805464ffffffffff191664ffffffffff92909216919091179055565b6001600160a01b03811660009081527ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2a602090815260408083208151606081018352815461ffff8082168352620100009091041693810193909352815160e08101808452859485949093929084019160018401906007908288855b82829054906101000a900463ffffffff1663ffffffff168152602001906004019060208260030104928301926001038202915080841161175f575050509290935250508251602090930151929792965091945050505050565b7ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e2954600080516020612e208339815191529060ff166110e45760208201516001828101805464ffffffffff191664ffffffffff9093169290921790915591516002820155600501805460ff19169091179055565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061186182611274565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000610870825490565b6129048164ffffffffff166118b88461189a565b6118c29190612bf3565b11156110e45760405162461bcd60e51b815260206004820152601960248201527f4e6f7420656e6f75676820737570706c7920746f206d696e740000000000000060448201526064016108a0565b60008261191d8584612022565b14949350505050565b60008060006119368588036120ce565b905060006119458588036120ce565b905081810161ffff168961ffff1611156119a15760405162461bcd60e51b815260206004820152601e60248201527f50524553414c453a206e6f7420656e6f756768206d696e7473206c656674000060448201526064016108a0565b8061ffff168961ffff16116119b657886119b8565b805b925082890393508861ffff1684840161ffff1614611a0a5760405162461bcd60e51b815260206004820152600f60248201526e4f4f50533a206f766572666c6f773f60881b60448201526064016108a0565b50509550959350505050565b600080516020612e20833981519152611a338161ffff84166118a4565b60005b8261ffff168161ffff1610156108d4576000611a51836120e5565b9050611a5d33826120f7565b5080611a6881612c0b565b915050611a36565b6000818152606760205260408120546001600160a01b0316611ae95760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108a0565b6000611af483611274565b9050806001600160a01b0316846001600160a01b03161480611b2f5750836001600160a01b0316611b248461096b565b6001600160a01b0316145b80611b5f57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611b7a82611274565b6001600160a01b031614611be25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016108a0565b6001600160a01b038216611c445760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108a0565b611c4f838383612111565b611c5a60008261182c565b6001600160a01b0383166000908152606860205260408120805460019290611c83908490612b04565b90915550506001600160a01b0382166000908152606860205260408120805460019290611cb1908490612bf3565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600181015464ffffffffff1642101561168c5760405162461bcd60e51b815260206004820152601f60248201527f5075626c69632073616c6520686173206e6f742073746172746564207965740060448201526064016108a0565b60975460ff16611db65760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108a0565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60975460ff1615611e985760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108a0565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611de33390565b816001600160a01b0316836001600160a01b03161415611f2f5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108a0565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611fa7848484611b67565b611fb38484848461211c565b6110e15760405162461bcd60e51b81526004016108a090612c2d565b60607ffef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e28611ffb8361221a565b60405160200161200c929190612c9b565b6040516020818303038152906040529050919050565b600081815b84518110156120c657600085828151811061204457612044612d56565b602002602001015190508083116120865760408051602081018590529081018290526060016040516020818303038152906040528051906020012092506120b3565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806120be81612d6c565b915050612027565b509392505050565b6000808260010b136120e1576000610870565b5090565b8054600101815560006108708261189a565b6110e4828260405180602001604052806000815250612318565b6108d483838361234b565b60006001600160a01b0384163b1561220f57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612160903390899088908890600401612d87565b6020604051808303816000875af192505050801561219b575060408051601f3d908101601f1916820190925261219891810190612dc4565b60015b6121f5573d8080156121c9576040519150601f19603f3d011682016040523d82523d6000602084013e6121ce565b606091505b5080516121ed5760405162461bcd60e51b81526004016108a090612c2d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611b5f565b506001949350505050565b60608161223e5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612268578061225281612d6c565b91506122619050600a83612df7565b9150612242565b60008167ffffffffffffffff81111561228357612283612884565b6040519080825280601f01601f1916602001820160405280156122ad576020820181803683370190505b5090505b8415611b5f576122c2600183612b04565b91506122cf600a86612e0b565b6122da906030612bf3565b60f81b8183815181106122ef576122ef612d56565b60200101906001600160f81b031916908160001a905350612311600a86612df7565b94506122b1565b61232283836123b2565b61232f600084848461211c565b6108d45760405162461bcd60e51b81526004016108a090612c2d565b60975460ff16156108d45760405162461bcd60e51b815260206004820152602b60248201527f4552433732315061757361626c653a20746f6b656e207472616e73666572207760448201526a1a1a5b19481c185d5cd95960aa1b60648201526084016108a0565b6001600160a01b0382166124085760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108a0565b6000818152606760205260409020546001600160a01b03161561246d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108a0565b61247960008383612111565b6001600160a01b03821660009081526068602052604081208054600192906124a2908490612bf3565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461250c90612a6e565b90600052602060002090601f01602090048101928261252e5760008555612574565b82601f106125475782800160ff19823516178555612574565b82800160010185558215612574579182015b82811115612574578235825591602001919060010190612559565b506120e19291505b808211156120e1576000815560010161257c565b6001600160e01b03198116811461168c57600080fd5b6000602082840312156125b857600080fd5b81356125c381612590565b9392505050565b600080602083850312156125dd57600080fd5b823567ffffffffffffffff808211156125f557600080fd5b818501915085601f83011261260957600080fd5b81358181111561261857600080fd5b86602082850101111561262a57600080fd5b60209290920196919550909350505050565b60005b8381101561265757818101518382015260200161263f565b838111156110e15750506000910152565b6000815180845261268081602086016020860161263c565b601f01601f19169290920160200192915050565b6020815260006125c36020830184612668565b6000602082840312156126b957600080fd5b5035919050565b80356001600160a01b03811681146126d757600080fd5b919050565b600080604083850312156126ef57600080fd5b6126f8836126c0565b946020939093013593505050565b803561ffff811681146126d757600080fd5b803580151581146126d757600080fd5b60008060008060008060a0878903121561274157600080fd5b61274a87612706565b955061275860208801612706565b945061276660408801612706565b935061277460608801612718565b9250608087013567ffffffffffffffff8082111561279157600080fd5b818901915089601f8301126127a557600080fd5b8135818111156127b457600080fd5b8a60208260051b85010111156127c957600080fd5b6020830194508093505050509295509295509295565b6000806000606084860312156127f457600080fd5b6127fd846126c0565b925061280b602085016126c0565b9150604084013590509250925092565b60006020828403121561282d57600080fd5b6125c382612706565b60006020828403121561284857600080fd5b6125c3826126c0565b6000806040838503121561286457600080fd5b61286d836126c0565b915061287b60208401612718565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156128c3576128c3612884565b604052919050565b600080600080608085870312156128e157600080fd5b6128ea856126c0565b935060206128f98187016126c0565b935060408601359250606086013567ffffffffffffffff8082111561291d57600080fd5b818801915088601f83011261293157600080fd5b81358181111561294357612943612884565b612955601f8201601f1916850161289a565b9150808252898482850101111561296b57600080fd5b808484018584013760008482840101525080935050505092959194509250565b6000806040838503121561299e57600080fd5b6129a7836126c0565b915061287b602084016126c0565b803564ffffffffff811681146126d757600080fd5b6000602082840312156129dc57600080fd5b6125c3826129b5565b6000604082840312156129f757600080fd5b6040516040810181811067ffffffffffffffff82111715612a1a57612a1a612884565b60405282358152612a2d602084016129b5565b60208201529392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680612a8257607f821691505b60208210811415612aa357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600061ffff808316818516808303821115612adc57612adc612aa9565b01949350505050565b6000816000190483118215151615612aff57612aff612aa9565b500290565b600082821015612b1657612b16612aa9565b500390565b60208082526021908201527f4661696c656420746f20726566756e64206164646974696f6e616c2076616c756040820152606560f81b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600064ffffffffff808316818516808303821115612adc57612adc612aa9565b600064ffffffffff83811690831681811015612beb57612beb612aa9565b039392505050565b60008219821115612c0657612c06612aa9565b500190565b600061ffff80831681811415612c2357612c23612aa9565b6001019392505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008151612c9181856020860161263c565b9290920192915050565b600080845481600182811c915080831680612cb757607f831692505b6020808410821415612cd757634e487b7160e01b86526022600452602486fd5b818015612ceb5760018114612cfc57612d29565b60ff19861689528489019650612d29565b60008b81526020902060005b86811015612d215781548b820152908501908301612d08565b505084890196505b505050505050612d4d612d3c8286612c7f565b64173539b7b760d91b815260050190565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415612d8057612d80612aa9565b5060010190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612dba90830184612668565b9695505050505050565b600060208284031215612dd657600080fd5b81516125c381612590565b634e487b7160e01b600052601260045260246000fd5b600082612e0657612e06612de1565b500490565b600082612e1a57612e1a612de1565b50069056fefef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e24697066733a2f2f516d575a736f6f7064717a75786b61356e705045396f45776e4471534837744670557a6135735050413851624e73fef720c38aad7454c32d10720d88088680569bb01047cae602877ca9299e8e25a264697066735822122024fcdbe72cf50870332ffbde2934dc48d3365cc3ee37aff796f6087377f1155b64736f6c634300080b0033

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.