ETH Price: $3,849.58 (-2.30%)

Contract

0xe7C29cba93ef8017C7824DD0f25923c38d08065c
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
140879532022-01-27 13:29:541052 days ago1643290194  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FNDNFT721

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 1337 runs

Other Settings:
default evmVersion
File 1 of 39 : FNDNFT721.sol
/*
  ・
   * ★
      ・ 。
         ・ ゚☆ 。
      * ★ ゚・。 *  。
            * ☆ 。・゚*.。
         ゚ *.。☆。★ ・
​
                      `                     .-:::::-.`              `-::---...```
                     `-:`               .:+ssssoooo++//:.`       .-/+shhhhhhhhhhhhhyyyssooo:
                    .--::.            .+ossso+/////++/:://-`   .////+shhhhhhhhhhhhhhhhhhhhhy
                  `-----::.         `/+////+++///+++/:--:/+/-  -////+shhhhhhhhhhhhhhhhhhhhhy
                 `------:::-`      `//-.``.-/+ooosso+:-.-/oso- -////+shhhhhhhhhhhhhhhhhhhhhy
                .--------:::-`     :+:.`  .-/osyyyyyyso++syhyo.-////+shhhhhhhhhhhhhhhhhhhhhy
              `-----------:::-.    +o+:-.-:/oyhhhhhhdhhhhhdddy:-////+shhhhhhhhhhhhhhhhhhhhhy
             .------------::::--  `oys+/::/+shhhhhhhdddddddddy/-////+shhhhhhhhhhhhhhhhhhhhhy
            .--------------:::::-` +ys+////+yhhhhhhhddddddddhy:-////+yhhhhhhhhhhhhhhhhhhhhhy
          `----------------::::::-`.ss+/:::+oyhhhhhhhhhhhhhhho`-////+shhhhhhhhhhhhhhhhhhhhhy
         .------------------:::::::.-so//::/+osyyyhhhhhhhhhys` -////+shhhhhhhhhhhhhhhhhhhhhy
       `.-------------------::/:::::..+o+////+oosssyyyyyyys+`  .////+shhhhhhhhhhhhhhhhhhhhhy
       .--------------------::/:::.`   -+o++++++oooosssss/.     `-//+shhhhhhhhhhhhhhhhhhhhyo
     .-------   ``````.......--`        `-/+ooooosso+/-`          `./++++///:::--...``hhhhyo
                                              `````
   * 
      ・ 。
    ・  ゚☆ 。
      * ★ ゚・。 *  。
            * ☆ 。・゚*.。
         ゚ *.。☆。★ ・
    *  ゚。·*・。 ゚*
     ☆゚・。°*. ゚
  ・ ゚*。・゚★。
  ・ *゚。   *
 ・゚*。★・
 ☆∴。 *
・ 。
*/

// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./mixins/OZ/ERC721Upgradeable.sol";

import "./mixins/FoundationTreasuryNode.sol";
import "./mixins/roles/FoundationAdminRole.sol";
import "./mixins/roles/FoundationOperatorRole.sol";
import "./mixins/NFT721Core.sol";
import "./mixins/NFT721Market.sol";
import "./mixins/NFT721Creator.sol";
import "./mixins/NFT721Metadata.sol";
import "./mixins/NFT721Mint.sol";
import "./mixins/NFT721ProxyCall.sol";
import "./mixins/ERC165UpgradeableGap.sol";

/**
 * @title Foundation NFTs implemented using the ERC-721 standard.
 * @dev This top level file holds no data directly to ease future upgrades.
 */
contract FNDNFT721 is
  FoundationTreasuryNode,
  FoundationAdminRole,
  FoundationOperatorRole,
  ERC165UpgradeableGap,
  ERC165,
  ERC721Upgradeable,
  NFT721Core,
  NFT721ProxyCall,
  NFT721Creator,
  NFT721Market,
  NFT721Metadata,
  NFT721Mint
{
  /**
   * @notice Called once to configure the contract after the initial deployment.
   * @dev This farms the initialize call out to inherited contracts as needed.
   */
  function initialize(address payable treasury) public initializer {
    FoundationTreasuryNode._initializeFoundationTreasuryNode(treasury);
    ERC721Upgradeable.__ERC721_init();
    NFT721Mint._initializeNFT721Mint();
  }

  /**
   * @notice Allows a Foundation admin to update NFT config variables.
   * @dev This must be called right after the initial call to `initialize`.
   */
  function adminUpdateConfig(
    address _nftMarket,
    string memory baseURI,
    address proxyCallContract
  ) public onlyFoundationAdmin {
    _updateNFTMarket(_nftMarket);
    _updateBaseURI(baseURI);
    _updateProxyCall(proxyCallContract);
  }

  /**
   * @dev This is a no-op, just an explicit override to address compile errors due to inheritance.
   */
  function _burn(uint256 tokenId) internal override(ERC721Upgradeable, NFT721Creator, NFT721Metadata, NFT721Mint) {
    super._burn(tokenId);
  }

  function supportsInterface(bytes4 interfaceId)
    public
    view
    override(ERC165, NFT721Mint, ERC721Upgradeable, NFT721Creator, NFT721Market)
    returns (bool)
  {
    return super.supportsInterface(interfaceId);
  }
}

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 3 of 39 : ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// solhint-disable

/**
 * From https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v3.4.0/contracts/token/ERC721/ERC721Upgradeable.sol
 * Modified in order to:
 *  - make `_tokenURIs` internal instead of private.
 *  - replace ERC165Upgradeable with ERC165.
 *  - set the name/symbol with constants.
 */

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./EnumerableMap.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "../ERC165UpgradeableGap.sol";

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721Upgradeable is
  Initializable,
  ContextUpgradeable,
  ERC165UpgradeableGap,
  ERC165,
  IERC721,
  IERC721Metadata,
  IERC721Enumerable
{
  using AddressUpgradeable for address;
  using EnumerableSet for EnumerableSet.UintSet;
  using EnumerableMap for EnumerableMap.UintToAddressMap;
  using Strings for uint256;

  // Mapping from holder address to their (enumerable) set of owned tokens
  mapping(address => EnumerableSet.UintSet) private _holderTokens;

  // Enumerable mapping from token ids to their owners
  EnumerableMap.UintToAddressMap private _tokenOwners;

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

  // Token name
  string private ____gap_was_name;

  // Token symbol
  string private ____gap_was_symbol;

  // Optional mapping for token URIs
  mapping(uint256 => string) internal _tokenURIs;

  // Base URI
  string private _baseURI;

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

  function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
    if (
      interfaceId == type(IERC721).interfaceId ||
      interfaceId == type(IERC721Metadata).interfaceId ||
      interfaceId == type(IERC721Enumerable).interfaceId
    ) {
      return true;
    }
    return super.supportsInterface(interfaceId);
  }

  /**
   * @dev See {IERC721-balanceOf}.
   */
  function balanceOf(address owner) public view override returns (uint256) {
    require(owner != address(0), "ERC721: balance query for the zero address");

    return _holderTokens[owner].length();
  }

  /**
   * @dev See {IERC721-ownerOf}.
   */
  function ownerOf(uint256 tokenId) public view override returns (address) {
    return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
  }

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

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

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

    string memory _tokenURI = _tokenURIs[tokenId];

    // If there is no base URI, return the token URI.
    if (bytes(_baseURI).length == 0) {
      return _tokenURI;
    }
    // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
    if (bytes(_tokenURI).length > 0) {
      return string(abi.encodePacked(_baseURI, _tokenURI));
    }
    // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
    return string(abi.encodePacked(_baseURI, tokenId.toString()));
  }

  /**
   * @dev Returns the base URI set via {_setBaseURI}. This will be
   * automatically added as a prefix in {tokenURI} to each token's URI, or
   * to the token ID if no specific URI is set for that token ID.
   */
  function baseURI() public view returns (string memory) {
    return _baseURI;
  }

  /**
   * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
   */
  function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
    return _holderTokens[owner].at(index);
  }

  /**
   * @dev See {IERC721Enumerable-totalSupply}.
   */
  function totalSupply() public view override returns (uint256) {
    // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
    return _tokenOwners.length();
  }

  /**
   * @dev See {IERC721Enumerable-tokenByIndex}.
   */
  function tokenByIndex(uint256 index) public view override returns (uint256) {
    (uint256 tokenId, ) = _tokenOwners.at(index);
    return tokenId;
  }

  /**
   * @dev See {IERC721-approve}.
   */
  function approve(address to, uint256 tokenId) public virtual override {
    address owner = 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 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 {
    require(operator != _msgSender(), "ERC721: approve to caller");

    _operatorApprovals[_msgSender()][operator] = approved;
    emit ApprovalForAll(_msgSender(), operator, approved);
  }

  /**
   * @dev See {IERC721-isApprovedForAll}.
   */
  function isApprovedForAll(address owner, address operator) public view 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 returns (bool) {
    return _tokenOwners.contains(tokenId);
  }

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

  /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     d*
     * - `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);

    _holderTokens[to].add(tokenId);

    _tokenOwners.set(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 = ownerOf(tokenId);

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

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

    // Clear metadata (if any)
    if (bytes(_tokenURIs[tokenId]).length != 0) {
      delete _tokenURIs[tokenId];
    }

    _holderTokens[owner].remove(tokenId);

    _tokenOwners.remove(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(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);

    _holderTokens[from].remove(tokenId);
    _holderTokens[to].add(tokenId);

    _tokenOwners.set(tokenId, to);

    emit Transfer(from, to, tokenId);
  }

  /**
   * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
   *
   * Requirements:
   *
   * - `tokenId` must exist.
   */
  function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
    require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
    _tokenURIs[tokenId] = _tokenURI;
  }

  /**
   * @dev Internal function to set the base URI for all token IDs. It is
   * automatically added as a prefix to the value returned in {tokenURI},
   * or to the token ID if {tokenURI} is empty.
   */
  function _setBaseURI(string memory baseURI_) internal virtual {
    _baseURI = baseURI_;
  }

  /**
   * @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()) {
      return true;
    }
    bytes memory returndata = to.functionCall(
      abi.encodeWithSelector(IERC721Receiver(to).onERC721Received.selector, _msgSender(), from, tokenId, _data),
      "ERC721: transfer to non ERC721Receiver implementer"
    );
    bytes4 retval = abi.decode(returndata, (bytes4));
    return (retval == type(IERC721Receiver).interfaceId);
  }

  function _approve(address to, uint256 tokenId) private {
    _tokenApprovals[tokenId] = to;
    emit Approval(ownerOf(tokenId), to, tokenId);
  }

  /**
   * @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` cannot be the zero address.
   * - `to` cannot be the zero address.
   *
   * 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[41] private __gap;
}

File 4 of 39 : FoundationTreasuryNode.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";

/**
 * @notice A mixin that stores a reference to the Foundation treasury contract.
 */
abstract contract FoundationTreasuryNode is Initializable {
  using AddressUpgradeable for address payable;

  address payable private treasury;

  /**
   * @dev Called once after the initial deployment to set the Foundation treasury address.
   */
  function _initializeFoundationTreasuryNode(address payable _treasury) internal onlyInitializing {
    require(_treasury.isContract(), "FoundationTreasuryNode: Address is not a contract");
    treasury = _treasury;
  }

  /**
   * @notice Returns the address of the Foundation treasury.
   */
  function getFoundationTreasury() public view returns (address payable) {
    return treasury;
  }

  // `______gap` is added to each mixin to allow adding new data slots or additional mixins in an upgrade-safe way.
  uint256[2000] private __gap;
}

File 5 of 39 : FoundationAdminRole.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

import "../../interfaces/IAdminRole.sol";

import "../FoundationTreasuryNode.sol";

/**
 * @notice Allows a contract to leverage the admin role defined by the Foundation treasury.
 */
abstract contract FoundationAdminRole is FoundationTreasuryNode {
  // This file uses 0 data slots (other than what's included via FoundationTreasuryNode)

  modifier onlyFoundationAdmin() {
    require(isAdmin(msg.sender), "FoundationAdminRole: caller does not have the Admin role");
    _;
  }

  /**
   * @notice Returns true if the user is a Foundation admin.
   * @dev This API may be consumed by 3rd party contracts.
   */
  function isAdmin(address user) public view returns (bool) {
    return IAdminRole(getFoundationTreasury()).isAdmin(user);
  }
}

File 6 of 39 : FoundationOperatorRole.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

import "../../interfaces/IOperatorRole.sol";

import "../FoundationTreasuryNode.sol";

/**
 * @notice Allows a contract to leverage the operator role defined by the Foundation treasury.
 */
abstract contract FoundationOperatorRole is FoundationTreasuryNode {
  // This file uses 0 data slots (other than what's included via FoundationTreasuryNode)

  function _isFoundationOperator() internal view returns (bool) {
    return IOperatorRole(getFoundationTreasury()).isOperator(msg.sender);
  }
}

File 7 of 39 : NFT721Core.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

/**
 * @notice A place for common modifiers and functions used by various NFT721 mixins, if any.
 * @dev This also leaves a gap which can be used to add a new mixin to the top of the inheritance tree.
 */
abstract contract NFT721Core {
  // 100 slots used when adding NFT721ProxyCall
  uint256[900] private ______gap;
}

File 8 of 39 : NFT721Market.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

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

import "../interfaces/IFNDNFTMarket.sol";
import "../interfaces/IGetRoyalties.sol";
import "../interfaces/IGetFees.sol";
import "../interfaces/IRoyaltyInfo.sol";

import "./FoundationTreasuryNode.sol";
import "./NFT721Creator.sol";

/**
 * @notice Holds a reference to the Foundation Market and communicates fees to 3rd party marketplaces.
 */
abstract contract NFT721Market is IGetRoyalties, IGetFees, IRoyaltyInfo, FoundationTreasuryNode, NFT721Creator {
  using AddressUpgradeable for address;

  uint256 private constant ROYALTY_IN_BASIS_POINTS = 1000;
  uint256 private constant ROYALTY_RATIO = 10;

  IFNDNFTMarket private nftMarket;

  event NFTMarketUpdated(address indexed nftMarket);

  /**
   * @notice Returns the address of the Foundation NFTMarket contract.
   */
  function getNFTMarket() public view returns (address) {
    return address(nftMarket);
  }

  function _updateNFTMarket(address _nftMarket) internal {
    require(_nftMarket.isContract(), "NFT721Market: Market address is not a contract");
    nftMarket = IFNDNFTMarket(_nftMarket);

    emit NFTMarketUpdated(_nftMarket);
  }

  function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
    if (
      interfaceId == type(IGetRoyalties).interfaceId ||
      interfaceId == type(IGetFees).interfaceId ||
      interfaceId == type(IRoyaltyInfo).interfaceId
    ) {
      return true;
    }
    return super.supportsInterface(interfaceId);
  }

  /**
   * @notice Returns an array of recipient addresses to which fees should be sent.
   * The expected fee amount is communicated with `getFeeBps`.
   */
  function getFeeRecipients(uint256 id) public view override returns (address payable[] memory) {
    require(_exists(id), "ERC721Metadata: Query for nonexistent token");

    address payable[] memory result = new address payable[](1);
    result[0] = getTokenCreatorPaymentAddress(id);
    return result;
  }

  /**
   * @notice Returns an array of fees in basis points.
   * The expected recipients is communicated with `getFeeRecipients`.
   */
  function getFeeBps(
    uint256 /* id */
  ) public pure override returns (uint256[] memory) {
    uint256[] memory result = new uint256[](1);
    result[0] = ROYALTY_IN_BASIS_POINTS;
    return result;
  }

  /**
   * @notice Get fee recipients and fees in a single call.
   * The data is the same as when calling getFeeRecipients and getFeeBps separately.
   */
  function getRoyalties(uint256 tokenId)
    public
    view
    returns (address payable[] memory recipients, uint256[] memory feesInBasisPoints)
  {
    require(_exists(tokenId), "ERC721Metadata: Query for nonexistent token");
    recipients = new address payable[](1);
    recipients[0] = getTokenCreatorPaymentAddress(tokenId);
    feesInBasisPoints = new uint256[](1);
    feesInBasisPoints[0] = ROYALTY_IN_BASIS_POINTS;
  }

  /**
   * @notice Returns the receiver and the amount to be sent for a secondary sale.
   */
  function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
    external
    view
    returns (address receiver, uint256 royaltyAmount)
  {
    receiver = getTokenCreatorPaymentAddress(_tokenId);
    unchecked {
      royaltyAmount = _salePrice / ROYALTY_RATIO;
    }
  }

  uint256[1000] private ______gap;
}

File 9 of 39 : NFT721Creator.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "./OZ/ERC721Upgradeable.sol";
import "./AccountMigration.sol";
import "../libraries/BytesLibrary.sol";
import "./NFT721ProxyCall.sol";
import "../interfaces/ITokenCreator.sol";

/**
 * @notice Allows each token to be associated with a creator.
 */
abstract contract NFT721Creator is Initializable, AccountMigration, ERC721Upgradeable, ITokenCreator, NFT721ProxyCall {
  using BytesLibrary for bytes;

  mapping(uint256 => address payable) private tokenIdToCreator;

  /**
   * @dev Stores an optional alternate address to receive creator revenue and royalty payments.
   * The target address may be a contract which could split or escrow payments.
   */
  mapping(uint256 => address payable) private tokenIdToCreatorPaymentAddress;

  event TokenCreatorUpdated(address indexed fromCreator, address indexed toCreator, uint256 indexed tokenId);
  event TokenCreatorPaymentAddressSet(
    address indexed fromPaymentAddress,
    address indexed toPaymentAddress,
    uint256 indexed tokenId
  );
  event NFTCreatorMigrated(uint256 indexed tokenId, address indexed originalAddress, address indexed newAddress);
  event NFTOwnerMigrated(uint256 indexed tokenId, address indexed originalAddress, address indexed newAddress);
  event PaymentAddressMigrated(
    uint256 indexed tokenId,
    address indexed originalAddress,
    address indexed newAddress,
    address originalPaymentAddress,
    address newPaymentAddress
  );

  function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
    if (interfaceId == type(ITokenCreator).interfaceId) {
      return true;
    }
    return super.supportsInterface(interfaceId);
  }

  /**
   * @notice Returns the creator's address for a given tokenId.
   */
  function tokenCreator(uint256 tokenId) public view override returns (address payable) {
    return tokenIdToCreator[tokenId];
  }

  /**
   * @notice Returns the payment address for a given tokenId.
   * @dev If an alternate address was not defined, the creator is returned instead.
   */
  function getTokenCreatorPaymentAddress(uint256 tokenId)
    public
    view
    returns (address payable tokenCreatorPaymentAddress)
  {
    tokenCreatorPaymentAddress = tokenIdToCreatorPaymentAddress[tokenId];
    if (tokenCreatorPaymentAddress == address(0)) {
      tokenCreatorPaymentAddress = tokenIdToCreator[tokenId];
    }
  }

  function _updateTokenCreator(uint256 tokenId, address payable creator) internal {
    emit TokenCreatorUpdated(tokenIdToCreator[tokenId], creator, tokenId);

    tokenIdToCreator[tokenId] = creator;
  }

  /**
   * @dev Allow setting a different address to send payments to for both primary sale revenue
   * and secondary sales royalties.
   */
  function _setTokenCreatorPaymentAddress(uint256 tokenId, address payable tokenCreatorPaymentAddress) internal {
    emit TokenCreatorPaymentAddressSet(tokenIdToCreatorPaymentAddress[tokenId], tokenCreatorPaymentAddress, tokenId);
    tokenIdToCreatorPaymentAddress[tokenId] = tokenCreatorPaymentAddress;
  }

  /**
   * @notice Allows the creator to burn if they currently own the NFT.
   */
  function burn(uint256 tokenId) public {
    require(tokenIdToCreator[tokenId] == msg.sender, "NFT721Creator: Caller is not creator");
    require(_isApprovedOrOwner(msg.sender, tokenId), "NFT721Creator: Caller is not owner nor approved");
    _burn(tokenId);
  }

  /**
   * @notice Allows an NFT owner or creator and Foundation to work together in order to update the creator
   * to a new account and/or transfer NFTs to that account.
   * @param signature Message `I authorize Foundation to migrate my account to ${newAccount.address.toLowerCase()}`
   * signed by the original account.
   * @dev This will gracefully skip any NFTs that have been burned or transferred.
   */
  function adminAccountMigration(
    uint256[] calldata createdTokenIds,
    uint256[] calldata ownedTokenIds,
    address originalAddress,
    address payable newAddress,
    bytes calldata signature
  ) public onlyAuthorizedAccountMigration(originalAddress, newAddress, signature) {
    for (uint256 i = 0; i < ownedTokenIds.length; i++) {
      uint256 tokenId = ownedTokenIds[i];
      // Check that the token exists and still owned by the originalAddress
      // so that frontrunning a burn or transfer will not cause the entire tx to revert
      if (_exists(tokenId) && ownerOf(tokenId) == originalAddress) {
        _transfer(originalAddress, newAddress, tokenId);
        emit NFTOwnerMigrated(tokenId, originalAddress, newAddress);
      }
    }

    for (uint256 i = 0; i < createdTokenIds.length; i++) {
      uint256 tokenId = createdTokenIds[i];
      // The creator would be 0 if the token was burned before this call
      if (tokenIdToCreator[tokenId] != address(0)) {
        require(
          tokenIdToCreator[tokenId] == originalAddress,
          "NFT721Creator: Token was not created by the given address"
        );
        _updateTokenCreator(tokenId, newAddress);
        emit NFTCreatorMigrated(tokenId, originalAddress, newAddress);
      }
    }
  }

  /**
   * @notice Allows a split recipient and Foundation to work together in order to update the payment address
   * to a new account.
   * @param signature Message `I authorize Foundation to migrate my account to ${newAccount.address.toLowerCase()}`
   * signed by the original account.
   */
  function adminAccountMigrationForPaymentAddresses(
    uint256[] calldata paymentAddressTokenIds,
    address paymentAddressFactory,
    bytes memory paymentAddressCallData,
    uint256 addressLocationInCallData,
    address originalAddress,
    address payable newAddress,
    bytes calldata signature
  ) public onlyAuthorizedAccountMigration(originalAddress, newAddress, signature) {
    _adminAccountRecoveryForPaymentAddresses(
      paymentAddressTokenIds,
      paymentAddressFactory,
      paymentAddressCallData,
      addressLocationInCallData,
      originalAddress,
      newAddress
    );
  }

  /**
   * @dev Split into a second function to avoid stack too deep errors
   */
  function _adminAccountRecoveryForPaymentAddresses(
    uint256[] calldata paymentAddressTokenIds,
    address paymentAddressFactory,
    bytes memory paymentAddressCallData,
    uint256 addressLocationInCallData,
    address originalAddress,
    address payable newAddress
  ) private {
    // Call the factory and get the originalPaymentAddress
    address payable originalPaymentAddress = _proxyCallAndReturnContractAddress(
      paymentAddressFactory,
      paymentAddressCallData
    );

    // Confirm the original address and swap with the new address
    paymentAddressCallData.replaceAtIf(addressLocationInCallData, originalAddress, newAddress);

    // Call the factory and get the newPaymentAddress
    address payable newPaymentAddress = _proxyCallAndReturnContractAddress(
      paymentAddressFactory,
      paymentAddressCallData
    );

    // For each token, confirm the expected payment address and then update to the new one
    for (uint256 i = 0; i < paymentAddressTokenIds.length; i++) {
      uint256 tokenId = paymentAddressTokenIds[i];
      require(
        tokenIdToCreatorPaymentAddress[tokenId] == originalPaymentAddress,
        "NFT721Creator: Payment address is not the expected value"
      );

      _setTokenCreatorPaymentAddress(tokenId, newPaymentAddress);
      emit PaymentAddressMigrated(tokenId, originalAddress, newAddress, originalPaymentAddress, newPaymentAddress);
    }
  }

  /**
   * @dev Remove the creator record when burned.
   */
  function _burn(uint256 tokenId) internal virtual override {
    delete tokenIdToCreator[tokenId];
    delete tokenIdToCreatorPaymentAddress[tokenId];

    super._burn(tokenId);
  }

  uint256[999] private ______gap;
}

File 10 of 39 : NFT721Metadata.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

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

import "./NFT721Core.sol";
import "./NFT721Creator.sol";

/**
 * @notice A mixin to extend the OpenZeppelin metadata implementation.
 */
abstract contract NFT721Metadata is NFT721Creator {
  using Strings for uint256;

  /**
   * @dev Stores hashes minted by a creator to prevent duplicates.
   */
  mapping(address => mapping(string => bool)) private creatorToIPFSHashToMinted;

  event BaseURIUpdated(string baseURI);
  // These events were used in an older version of the contract
  event TokenIPFSPathUpdated(uint256 indexed tokenId, string indexed indexedTokenIPFSPath, string tokenIPFSPath);
  event NFTMetadataUpdated(string name, string symbol, string baseURI);

  /**
   * @notice Returns the IPFSPath to the metadata JSON file for a given NFT.
   */
  function getTokenIPFSPath(uint256 tokenId) public view returns (string memory) {
    return _tokenURIs[tokenId];
  }

  /**
   * @notice Checks if the creator has already minted a given NFT.
   */
  function getHasCreatorMintedIPFSHash(address creator, string memory tokenIPFSPath) public view returns (bool) {
    return creatorToIPFSHashToMinted[creator][tokenIPFSPath];
  }

  function _updateBaseURI(string memory _baseURI) internal {
    _setBaseURI(_baseURI);

    emit BaseURIUpdated(_baseURI);
  }

  /**
   * @dev The IPFS path should be the CID + file.extension, e.g.
   * `QmfPsfGwLhiJrU8t9HpG4wuyjgPo9bk8go4aQqSu9Qg4h7/metadata.json`
   */
  function _setTokenIPFSPath(uint256 tokenId, string memory _tokenIPFSPath) internal {
    // 46 is the minimum length for an IPFS content hash, it may be longer if paths are used
    require(bytes(_tokenIPFSPath).length >= 46, "NFT721Metadata: Invalid IPFS path");
    require(!creatorToIPFSHashToMinted[msg.sender][_tokenIPFSPath], "NFT721Metadata: NFT was already minted");

    creatorToIPFSHashToMinted[msg.sender][_tokenIPFSPath] = true;
    _setTokenURI(tokenId, _tokenIPFSPath);
  }

  /**
   * @dev When a token is burned, remove record of it allowing that creator to re-mint the same NFT again in the future.
   */
  function _burn(uint256 tokenId) internal virtual override {
    delete creatorToIPFSHashToMinted[msg.sender][_tokenURIs[tokenId]];
    super._burn(tokenId);
  }

  uint256[999] private ______gap;
}

File 11 of 39 : NFT721Mint.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

import "./OZ/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import "./NFT721Creator.sol";
import "./NFT721Market.sol";
import "./NFT721Metadata.sol";
import "./NFT721ProxyCall.sol";

/**
 * @notice Allows creators to mint NFTs.
 */
abstract contract NFT721Mint is
  Initializable,
  ERC721Upgradeable,
  NFT721ProxyCall,
  NFT721Creator,
  NFT721Market,
  NFT721Metadata
{
  uint256 private nextTokenId;

  event Minted(
    address indexed creator,
    uint256 indexed tokenId,
    string indexed indexedTokenIPFSPath,
    string tokenIPFSPath
  );

  /**
   * @notice Gets the tokenId of the next NFT minted.
   */
  function getNextTokenId() public view returns (uint256) {
    return nextTokenId;
  }

  /**
   * @dev Called once after the initial deployment to set the initial tokenId.
   */
  function _initializeNFT721Mint() internal onlyInitializing {
    // Use ID 1 for the first NFT tokenId
    nextTokenId = 1;
  }

  /**
   * @notice Allows a creator to mint an NFT.
   */
  function mint(string memory tokenIPFSPath) public returns (uint256 tokenId) {
    tokenId = nextTokenId++;
    _mint(msg.sender, tokenId);
    _updateTokenCreator(tokenId, payable(msg.sender));
    _setTokenIPFSPath(tokenId, tokenIPFSPath);
    emit Minted(msg.sender, tokenId, tokenIPFSPath, tokenIPFSPath);
  }

  /**
   * @notice Allows a creator to mint an NFT and set approval for the Foundation marketplace.
   * This can be used by creators the first time they mint an NFT to save having to issue a separate
   * approval transaction before starting an auction.
   */
  function mintAndApproveMarket(string memory tokenIPFSPath) public returns (uint256 tokenId) {
    tokenId = mint(tokenIPFSPath);
    setApprovalForAll(getNFTMarket(), true);
  }

  /**
   * @notice Allows a creator to mint an NFT and have creator revenue/royalties sent to an alternate address.
   */
  function mintWithCreatorPaymentAddress(string memory tokenIPFSPath, address payable tokenCreatorPaymentAddress)
    public
    returns (uint256 tokenId)
  {
    require(tokenCreatorPaymentAddress != address(0), "NFT721Mint: tokenCreatorPaymentAddress is required");
    tokenId = mint(tokenIPFSPath);
    _setTokenCreatorPaymentAddress(tokenId, tokenCreatorPaymentAddress);
  }

  /**
   * @notice Allows a creator to mint an NFT and have creator revenue/royalties sent to an alternate address.
   * Also sets approval for the Foundation marketplace.  This can be used by creators the first time they mint an NFT to
   * save having to issue a separate approval transaction before starting an auction.
   */
  function mintWithCreatorPaymentAddressAndApproveMarket(
    string memory tokenIPFSPath,
    address payable tokenCreatorPaymentAddress
  ) public returns (uint256 tokenId) {
    tokenId = mintWithCreatorPaymentAddress(tokenIPFSPath, tokenCreatorPaymentAddress);
    setApprovalForAll(getNFTMarket(), true);
  }

  /**
   * @notice Allows a creator to mint an NFT and have creator revenue/royalties sent to an alternate address
   * which is defined by a contract call, typically a proxy contract address representing the payment terms.
   */
  function mintWithCreatorPaymentFactory(
    string memory tokenIPFSPath,
    address paymentAddressFactory,
    bytes memory paymentAddressCallData
  ) public returns (uint256 tokenId) {
    address payable tokenCreatorPaymentAddress = _proxyCallAndReturnContractAddress(
      paymentAddressFactory,
      paymentAddressCallData
    );
    tokenId = mintWithCreatorPaymentAddress(tokenIPFSPath, tokenCreatorPaymentAddress);
  }

  /**
   * @notice Allows a creator to mint an NFT and have creator revenue/royalties sent to an alternate address
   * which is defined by a contract call, typically a proxy contract address representing the payment terms.
   * Also sets approval for the Foundation marketplace.  This can be used by creators the first time they mint an NFT to
   * save having to issue a separate approval transaction before starting an auction.
   */
  function mintWithCreatorPaymentFactoryAndApproveMarket(
    string memory tokenIPFSPath,
    address paymentAddressFactory,
    bytes memory paymentAddressCallData
  ) public returns (uint256 tokenId) {
    tokenId = mintWithCreatorPaymentFactory(tokenIPFSPath, paymentAddressFactory, paymentAddressCallData);
    setApprovalForAll(getNFTMarket(), true);
  }

  /**
   * @dev Explicit override to address compile errors.
   */
  function _burn(uint256 tokenId) internal virtual override(ERC721Upgradeable, NFT721Creator, NFT721Metadata) {
    super._burn(tokenId);
  }

  function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(ERC721Upgradeable, NFT721Creator, NFT721Market)
    returns (bool)
  {
    return super.supportsInterface(interfaceId);
  }

  uint256[1000] private ______gap;
}

File 12 of 39 : NFT721ProxyCall.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "../interfaces/IProxyCall.sol";

/**
 * @notice Forwards arbitrary calls to an external contract to be processed.
 * @dev This is used so that the from address of the calling contract does not have
 * any special permissions (e.g. ERC-20 transfer).
 */
abstract contract NFT721ProxyCall {
  using AddressUpgradeable for address payable;
  using AddressUpgradeable for address;

  IProxyCall private proxyCall;

  event ProxyCallContractUpdated(address indexed proxyCallContract);

  /**
   * @dev Called by the adminUpdateConfig function to set the address of the proxy call contract.
   */
  function _updateProxyCall(address proxyCallContract) internal {
    require(proxyCallContract.isContract(), "NFT721ProxyCall: Proxy call address is not a contract");
    proxyCall = IProxyCall(proxyCallContract);

    emit ProxyCallContractUpdated(proxyCallContract);
  }

  /**
   * @notice Returns the address of the current proxy call contract.
   */
  function proxyCallAddress() external view returns (address) {
    return address(proxyCall);
  }

  /**
   * @dev Used by other mixins to make external calls through the proxy contract.
   * This will fail if the proxyCall address is address(0).
   */
  function _proxyCallAndReturnContractAddress(address externalContract, bytes memory callData)
    internal
    returns (address payable result)
  {
    result = proxyCall.proxyCallAndReturnAddress(externalContract, callData);
    require(result.isContract(), "NFT721ProxyCall: address returned is not a contract");
  }

  // This mixin uses a total of 100 slots
  uint256[99] private ______gap;
}

File 13 of 39 : ERC165UpgradeableGap.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

/**
 * @dev A gap to represent the space previously consumed by the use of ERC165Upgradeable.
 */
abstract contract ERC165UpgradeableGap {
  uint256[50] private ______gap;
}

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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 16 of 39 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

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

File 19 of 39 : 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 20 of 39 : 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 21 of 39 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

        assembly {
            result := store
        }

        return result;
    }
}

File 22 of 39 : EnumerableMap.sol
// SPDX-License-Identifier: MIT

/**
 * From https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/v3.4.2-solc-0.7
 * Modified to support solc 8.
 * Using this due to storage slot changes in OZ 4.*
 */

pragma solidity ^0.8.0;

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
 * supported.
 */
library EnumerableMap {
  // To implement this library for multiple types with as little code
  // repetition as possible, we write it in terms of a generic Map type with
  // bytes32 keys and values.
  // The Map implementation uses private functions, and user-facing
  // implementations (such as Uint256ToAddressMap) are just wrappers around
  // the underlying Map.
  // This means that we can only create new EnumerableMaps for types that fit
  // in bytes32.

  struct MapEntry {
    bytes32 _key;
    bytes32 _value;
  }

  struct Map {
    // Storage of map keys and values
    MapEntry[] _entries;
    // Position of the entry defined by a key in the `entries` array, plus 1
    // because index 0 means a key is not in the map.
    mapping(bytes32 => uint256) _indexes;
  }

  /**
   * @dev Adds a key-value pair to a map, or updates the value for an existing
   * key. O(1).
   *
   * Returns true if the key was added to the map, that is if it was not
   * already present.
   */
  function _set(
    Map storage map,
    bytes32 key,
    bytes32 value
  ) private returns (bool) {
    // We read and store the key's index to prevent multiple reads from the same storage slot
    uint256 keyIndex = map._indexes[key];

    if (keyIndex == 0) {
      // Equivalent to !contains(map, key)
      map._entries.push(MapEntry({ _key: key, _value: value }));
      // The entry is stored at length-1, but we add 1 to all indexes
      // and use 0 as a sentinel value
      map._indexes[key] = map._entries.length;
      return true;
    } else {
      map._entries[keyIndex - 1]._value = value;
      return false;
    }
  }

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

    if (keyIndex != 0) {
      // Equivalent to contains(map, key)
      // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
      // in the array, and then remove the last entry (sometimes called as 'swap and pop').
      // This modifies the order of the array, as noted in {at}.

      uint256 toDeleteIndex = keyIndex - 1;
      uint256 lastIndex = map._entries.length - 1;

      // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
      // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

      MapEntry storage lastEntry = map._entries[lastIndex];

      // Move the last entry to the index where the entry to delete is
      map._entries[toDeleteIndex] = lastEntry;
      // Update the index for the moved entry
      map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based

      // Delete the slot where the moved entry was stored
      map._entries.pop();

      // Delete the index for the deleted slot
      delete map._indexes[key];

      return true;
    } else {
      return false;
    }
  }

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

  /**
   * @dev Returns the number of key-value pairs in the map. O(1).
   */
  function _length(Map storage map) private view returns (uint256) {
    return map._entries.length;
  }

  /**
   * @dev Returns the key-value pair stored at position `index` in the map. O(1).
   *
   * Note that there are no guarantees on the ordering of entries inside the
   * array, and it may change when more entries are added or removed.
   *
   * Requirements:
   *
   * - `index` must be strictly less than {length}.
   */
  function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
    require(map._entries.length > index, "EnumerableMap: index out of bounds");

    MapEntry storage entry = map._entries[index];
    return (entry._key, entry._value);
  }

  /**
   * @dev Tries to returns the value associated with `key`.  O(1).
   * Does not revert if `key` is not in the map.
   */
  function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) {
    uint256 keyIndex = map._indexes[key];
    if (keyIndex == 0) return (false, 0); // Equivalent to contains(map, key)
    return (true, map._entries[keyIndex - 1]._value); // All indexes are 1-based
  }

  /**
   * @dev Returns the value associated with `key`.  O(1).
   *
   * Requirements:
   *
   * - `key` must be in the map.
   */
  function _get(Map storage map, bytes32 key) private view returns (bytes32) {
    uint256 keyIndex = map._indexes[key];
    require(keyIndex != 0, "EnumerableMap: nonexistent key"); // Equivalent to contains(map, key)
    return map._entries[keyIndex - 1]._value; // All indexes are 1-based
  }

  /**
   * @dev Same as {_get}, with a custom error message when `key` is not in the map.
   *
   * CAUTION: This function is deprecated because it requires allocating memory for the error
   * message unnecessarily. For custom revert reasons use {_tryGet}.
   */
  function _get(
    Map storage map,
    bytes32 key,
    string memory errorMessage
  ) private view returns (bytes32) {
    uint256 keyIndex = map._indexes[key];
    require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
    return map._entries[keyIndex - 1]._value; // All indexes are 1-based
  }

  // UintToAddressMap

  struct UintToAddressMap {
    Map _inner;
  }

  /**
   * @dev Adds a key-value pair to a map, or updates the value for an existing
   * key. O(1).
   *
   * Returns true if the key was added to the map, that is if it was not
   * already present.
   */
  function set(
    UintToAddressMap storage map,
    uint256 key,
    address value
  ) internal returns (bool) {
    return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
  }

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

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

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

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

  /**
   * @dev Tries to returns the value associated with `key`.  O(1).
   * Does not revert if `key` is not in the map.
   *
   * _Available since v3.4._
   */
  function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
    (bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
    return (success, address(uint160(uint256(value))));
  }

  /**
   * @dev Returns the value associated with `key`.  O(1).
   *
   * Requirements:
   *
   * - `key` must be in the map.
   */
  function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
    return address(uint160(uint256(_get(map._inner, bytes32(key)))));
  }

  /**
   * @dev Same as {get}, with a custom error message when `key` is not in the map.
   *
   * CAUTION: This function is deprecated because it requires allocating memory for the error
   * message unnecessarily. For custom revert reasons use {tryGet}.
   */
  function get(
    UintToAddressMap storage map,
    uint256 key,
    string memory errorMessage
  ) internal view returns (address) {
    return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage))));
  }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 24 of 39 : 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 25 of 39 : IAdminRole.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

/**
 * @notice Interface for AdminRole which wraps the default admin role from
 * OpenZeppelin's AccessControl for easy integration.
 */
interface IAdminRole {
  function isAdmin(address account) external view returns (bool);
}

File 26 of 39 : IOperatorRole.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

/**
 * @notice Interface for OperatorRole which wraps a role from
 * OpenZeppelin's AccessControl for easy integration.
 */
interface IOperatorRole {
  function isOperator(address account) external view returns (bool);
}

File 27 of 39 : IFNDNFTMarket.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
// solhint-disable

pragma solidity ^0.8.0;

interface IFNDNFTMarket {
  function getFeeConfig()
    external
    view
    returns (
      uint256 primaryFoundationFeeBasisPoints,
      uint256 secondaryFoundationFeeBasisPoints,
      uint256 secondaryCreatorFeeBasisPoints
    );
}

File 28 of 39 : IGetRoyalties.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

interface IGetRoyalties {
  function getRoyalties(uint256 tokenId)
    external
    view
    returns (address payable[] memory recipients, uint256[] memory feesInBasisPoints);
}

File 29 of 39 : IGetFees.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

/**
 * @notice An interface for communicating fees to 3rd party marketplaces.
 * @dev Originally implemented in mainnet contract 0x44d6e8933f8271abcf253c72f9ed7e0e4c0323b3
 */
interface IGetFees {
  function getFeeRecipients(uint256 id) external view returns (address payable[] memory);

  function getFeeBps(uint256 id) external view returns (uint256[] memory);
}

File 30 of 39 : IRoyaltyInfo.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

/**
 * @notice Interface for EIP-2981: NFT Royalty Standard.
 * For more see: https://eips.ethereum.org/EIPS/eip-2981.
 */
interface IRoyaltyInfo {
  /// @notice Called with the sale price to determine how much royalty
  //          is owed and to whom.
  /// @param _tokenId - the NFT asset queried for royalty information
  /// @param _salePrice - the sale price of the NFT asset specified by _tokenId
  /// @return receiver - address of who should be sent the royalty payment
  /// @return royaltyAmount - the royalty payment amount for _salePrice
  function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
    external
    view
    returns (address receiver, uint256 royaltyAmount);
}

File 31 of 39 : AccountMigration.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

import "../libraries/AccountMigrationLibrary.sol";
import "./roles/FoundationOperatorRole.sol";

abstract contract AccountMigration is FoundationOperatorRole {
  using AccountMigrationLibrary for address;

  modifier onlyAuthorizedAccountMigration(
    address originalAddress,
    address payable newAddress,
    bytes memory signature
  ) {
    require(_isFoundationOperator(), "AccountMigration: Caller is not an operator");
    originalAddress.requireAuthorizedAccountMigration(newAddress, signature);
    _;
  }
}

File 32 of 39 : BytesLibrary.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

/**
 * @notice A library for manipulation of byte arrays.
 */
library BytesLibrary {
  /**
   * @dev Replace the address at the given location in a byte array if the contents at that location
   * match the expected address.
   */
  function replaceAtIf(
    bytes memory data,
    uint256 startLocation,
    address expectedAddress,
    address newAddress
  ) internal pure {
    bytes memory expectedData = abi.encodePacked(expectedAddress);
    bytes memory newData = abi.encodePacked(newAddress);
    // An address is 20 bytes long
    for (uint256 i = 0; i < 20; i++) {
      uint256 dataLocation = startLocation + i;
      require(data[dataLocation] == expectedData[i], "Bytes: Data provided does not include the expectedAddress");
      data[dataLocation] = newData[i];
    }
  }

  /**
   * @dev Checks if the call data starts with the given function signature.
   */
  function startsWith(bytes memory callData, bytes4 functionSig) internal pure returns (bool) {
    // A signature is 4 bytes long
    if (callData.length < 4) {
      return false;
    }
    for (uint256 i = 0; i < 4; i++) {
      if (callData[i] != functionSig[i]) {
        return false;
      }
    }

    return true;
  }
}

File 33 of 39 : ITokenCreator.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

interface ITokenCreator {
  function tokenCreator(uint256 tokenId) external view returns (address payable);
}

File 34 of 39 : AccountMigrationLibrary.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

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

/**
 * @notice Checks for a valid signature authorizing the migration of an account to a new address.
 * @dev This is shared by both the NFT contracts and FNDNFTMarket, and the same signature authorizes both.
 */
library AccountMigrationLibrary {
  using ECDSA for bytes;
  using SignatureChecker for address;
  using Strings for uint256;

  // From https://ethereum.stackexchange.com/questions/8346/convert-address-to-string
  function _toAsciiString(address x) private pure returns (string memory) {
    bytes memory s = new bytes(42);
    s[0] = "0";
    s[1] = "x";
    for (uint256 i = 0; i < 20; i++) {
      bytes1 b = bytes1(uint8(uint256(uint160(x)) / (2**(8 * (19 - i)))));
      bytes1 hi = bytes1(uint8(b) / 16);
      bytes1 lo = bytes1(uint8(b) - 16 * uint8(hi));
      s[2 * i + 2] = _char(hi);
      s[2 * i + 3] = _char(lo);
    }
    return string(s);
  }

  function _char(bytes1 b) private pure returns (bytes1 c) {
    if (uint8(b) < 10) return bytes1(uint8(b) + 0x30);
    else return bytes1(uint8(b) + 0x57);
  }

  /**
   * @dev Confirms the msg.sender is a Foundation operator and that the signature provided is valid.
   * @param signature Message `I authorize Foundation to migrate my account to ${newAccount.address.toLowerCase()}`
   * signed by the original account.
   */
  function requireAuthorizedAccountMigration(
    address originalAddress,
    address newAddress,
    bytes memory signature
  ) internal view {
    require(originalAddress != newAddress, "AccountMigration: Cannot migrate to the same account");
    bytes32 hash = abi
      .encodePacked("I authorize Foundation to migrate my account to ", _toAsciiString(newAddress))
      .toEthSignedMessageHash();
    require(
      originalAddress.isValidSignatureNow(hash, signature),
      "AccountMigration: Signature must be from the original account"
    );
  }
}

File 35 of 39 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

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

File 36 of 39 : SignatureChecker.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/SignatureChecker.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";
import "../Address.sol";
import "../../interfaces/IERC1271.sol";

/**
 * @dev Signature verification helper: Provide a single mechanism to verify both private-key (EOA) ECDSA signature and
 * ERC1271 contract signatures. Using this instead of ECDSA.recover in your contract will make them compatible with
 * smart contract wallets such as Argent and Gnosis.
 *
 * Note: unlike ECDSA signatures, contract signature's are revocable, and the outcome of this function can thus change
 * through time. It could return true at block N and false at block N+1 (or the opposite).
 *
 * _Available since v4.1._
 */
library SignatureChecker {
    function isValidSignatureNow(
        address signer,
        bytes32 hash,
        bytes memory signature
    ) internal view returns (bool) {
        (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);
        if (error == ECDSA.RecoverError.NoError && recovered == signer) {
            return true;
        }

        (bool success, bytes memory result) = signer.staticcall(
            abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
        );
        return (success && result.length == 32 && abi.decode(result, (bytes4)) == IERC1271.isValidSignature.selector);
    }
}

File 37 of 39 : Address.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 Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

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

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

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

File 38 of 39 : IERC1271.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC1271 standard signature validation method for
 * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
 *
 * _Available since v4.1._
 */
interface IERC1271 {
    /**
     * @dev Should return whether the signature provided is valid for the provided data
     * @param hash      Hash of the data to be signed
     * @param signature Signature byte array associated with _data
     */
    function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}

File 39 of 39 : IProxyCall.sol
// SPDX-License-Identifier: MIT OR Apache-2.0

pragma solidity ^0.8.0;

interface IProxyCall {
  function proxyCallAndReturnAddress(address externalContract, bytes calldata callData)
    external
    returns (address payable result);
}

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

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":"string","name":"baseURI","type":"string"}],"name":"BaseURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"string","name":"indexedTokenIPFSPath","type":"string"},{"indexed":false,"internalType":"string","name":"tokenIPFSPath","type":"string"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"originalAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"NFTCreatorMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftMarket","type":"address"}],"name":"NFTMarketUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"string","name":"baseURI","type":"string"}],"name":"NFTMetadataUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"originalAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"NFTOwnerMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"originalAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"},{"indexed":false,"internalType":"address","name":"originalPaymentAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newPaymentAddress","type":"address"}],"name":"PaymentAddressMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"proxyCallContract","type":"address"}],"name":"ProxyCallContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromPaymentAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toPaymentAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenCreatorPaymentAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromCreator","type":"address"},{"indexed":true,"internalType":"address","name":"toCreator","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenCreatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"string","name":"indexedTokenIPFSPath","type":"string"},{"indexed":false,"internalType":"string","name":"tokenIPFSPath","type":"string"}],"name":"TokenIPFSPathUpdated","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"},{"inputs":[{"internalType":"uint256[]","name":"createdTokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"ownedTokenIds","type":"uint256[]"},{"internalType":"address","name":"originalAddress","type":"address"},{"internalType":"address payable","name":"newAddress","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"adminAccountMigration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"paymentAddressTokenIds","type":"uint256[]"},{"internalType":"address","name":"paymentAddressFactory","type":"address"},{"internalType":"bytes","name":"paymentAddressCallData","type":"bytes"},{"internalType":"uint256","name":"addressLocationInCallData","type":"uint256"},{"internalType":"address","name":"originalAddress","type":"address"},{"internalType":"address payable","name":"newAddress","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"adminAccountMigrationForPaymentAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftMarket","type":"address"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"address","name":"proxyCallContract","type":"address"}],"name":"adminUpdateConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","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":"uint256","name":"","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFoundationTreasury","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"tokenIPFSPath","type":"string"}],"name":"getHasCreatorMintedIPFSHash","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNFTMarket","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyalties","outputs":[{"internalType":"address payable[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"feesInBasisPoints","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenCreatorPaymentAddress","outputs":[{"internalType":"address payable","name":"tokenCreatorPaymentAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenIPFSPath","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"treasury","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenIPFSPath","type":"string"}],"name":"mint","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"tokenIPFSPath","type":"string"}],"name":"mintAndApproveMarket","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"tokenIPFSPath","type":"string"},{"internalType":"address payable","name":"tokenCreatorPaymentAddress","type":"address"}],"name":"mintWithCreatorPaymentAddress","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"tokenIPFSPath","type":"string"},{"internalType":"address payable","name":"tokenCreatorPaymentAddress","type":"address"}],"name":"mintWithCreatorPaymentAddressAndApproveMarket","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"tokenIPFSPath","type":"string"},{"internalType":"address","name":"paymentAddressFactory","type":"address"},{"internalType":"bytes","name":"paymentAddressCallData","type":"bytes"}],"name":"mintWithCreatorPaymentFactory","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"tokenIPFSPath","type":"string"},{"internalType":"address","name":"paymentAddressFactory","type":"address"},{"internalType":"bytes","name":"paymentAddressCallData","type":"bytes"}],"name":"mintWithCreatorPaymentFactoryAndApproveMarket","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyCallAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenCreator","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"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"}]

608060405234801561001057600080fd5b50614afe806100206000396000f3fe608060405234801561001057600080fd5b50600436106102d35760003560e01c80636352211e11610186578063bb3bafd6116100e3578063d85d3d2711610097578063ec5f752e11610071578063ec5f752e146106a2578063edf9f57d146106b5578063f7a2da23146106c857600080fd5b8063d85d3d271461063f578063dac28cce14610652578063e985e9c51461066557600080fd5b8063c87b56dd116100c8578063c87b56dd14610610578063caa0f92a14610623578063d2c0fa5a1461062c57600080fd5b8063bb3bafd6146105dc578063c4d66de8146105fd57600080fd5b806395d89b411161013a578063a2805dcb1161011f578063a2805dcb14610596578063b88d4fde146105a9578063b9c4d9fb146105bc57600080fd5b806395d89b411461054a578063a22cb4651461058357600080fd5b806370a082311161016b57806370a082311461051157806384f4e5c01461052457806389ca8b711461053757600080fd5b80636352211e146104f65780636c0360eb1461050957600080fd5b80632f745c591161023457806342966c68116101e85780635174e853116101cd5780635174e853146104be57806358f05b93146104d1578063605eb5f5146104e457600080fd5b806342966c68146104985780634f6ccce7146104ab57600080fd5b80633fd7ca41116102195780633fd7ca411461044957806340c1a0641461045b57806342842e0e1461048557600080fd5b80632f745c59146104235780633d78bede1461043657600080fd5b806318160ddd1161028b57806324d7806c1161027057806324d7806c146103cb57806329f87c38146103de5780632a55205a146103f157600080fd5b806318160ddd146103a257806323b872dd146103b857600080fd5b8063081812fc116102bc578063081812fc14610342578063095ea7b31461036d5780630ebd4c7f1461038257600080fd5b806301ffc9a7146102d857806306fdde0314610300575b600080fd5b6102eb6102e6366004613dc0565b6106df565b60405190151581526020015b60405180910390f35b60408051808201909152600a81527f466f756e646174696f6e0000000000000000000000000000000000000000000060208201525b6040516102f79190613e35565b610355610350366004613e48565b6106f0565b6040516001600160a01b0390911681526020016102f7565b61038061037b366004613e81565b61077e565b005b610395610390366004613e48565b6108b0565b6040516102f79190613ee8565b6103aa6108fd565b6040519081526020016102f7565b6103806103c6366004613efb565b61090f565b6102eb6103d9366004613f3c565b610996565b6103aa6103ec366004613ffc565b610a2e565b6104046103ff366004614074565b610a50565b604080516001600160a01b0390931683526020830191909152016102f7565b6103aa610431366004613e81565b610a68565b61038061044436600461411d565b610a92565b611038546001600160a01b0316610355565b610355610469366004613e48565b6000908152610c4f60205260409020546001600160a01b031690565b610380610493366004613efb565b610b77565b6103806104a6366004613e48565b610b92565b6103aa6104b9366004613e48565b610ca6565b6103aa6104cc3660046141f8565b610cbd565b6103aa6104df36600461422d565b610cec565b610beb546001600160a01b0316610355565b610355610504366004613e48565b610d10565b610335610d39565b6103aa61051f366004613f3c565b610dcc565b61038061053236600461427f565b610e6c565b6102eb610545366004614342565b61112b565b60408051808201909152600381527f464e4400000000000000000000000000000000000000000000000000000000006020820152610335565b6103806105913660046143a0565b61116d565b6103806105a43660046143ce565b611233565b6103806105b7366004614432565b6112c9565b6105cf6105ca366004613e48565b611357565b6040516102f791906144d7565b6105ef6105ea366004613e48565b611430565b6040516102f79291906144ea565b61038061060b366004613f3c565b611547565b61033561061e366004613e48565b611629565b611809546103aa565b6103aa61063a36600461422d565b6117ac565b6103aa61064d3660046141f8565b61183f565b610335610660366004613e48565b6118d2565b6102eb61067336600461450f565b6001600160a01b0391821660009081526108396020908152604080832093909416825291909152205460ff1690565b6103556106b0366004613e48565b611975565b6103aa6106c3366004613ffc565b6119b0565b6000546201000090046001600160a01b0316610355565b60006106ea826119d5565b92915050565b60006106fb826119e0565b6107615760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b50600090815261083860205260409020546001600160a01b031690565b600061078982610d10565b9050806001600160a01b0316836001600160a01b031614156108135760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610758565b336001600160a01b038216148061082f575061082f8133610673565b6108a15760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610758565b6108ab83836119ee565b505050565b60408051600180825281830190925260609160009190602080830190803683370190505090506103e8816000815181106108ec576108ec61453d565b602090810291909101015292915050565b600061090a610836611a6a565b905090565b6109193382611a74565b61098b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610758565b6108ab838383611b5f565b600080546201000090046001600160a01b03166040517f24d7806c0000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015291909116906324d7806c90602401602060405180830381865afa158015610a0a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ea9190614553565b600080610a3b8484611d10565b9050610a4785826117ac565b95945050505050565b600080610a5c84611975565b94600a90930493505050565b6001600160a01b038216600090815261083560205260408120610a8b9083611e1f565b9392505050565b838383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ad49250611e2b915050565b610b465760405162461bcd60e51b815260206004820152602b60248201527f4163636f756e744d6967726174696f6e3a2043616c6c6572206973206e6f742060448201527f616e206f70657261746f720000000000000000000000000000000000000000006064820152608401610758565b610b5a6001600160a01b0384168383611ec1565b610b698c8c8c8c8c8c8c612003565b505050505050505050505050565b6108ab838383604051806020016040528060008152506112c9565b6000818152610c4f60205260409020546001600160a01b03163314610c1e5760405162461bcd60e51b8152602060048201526024808201527f4e465437323143726561746f723a2043616c6c6572206973206e6f742063726560448201527f61746f72000000000000000000000000000000000000000000000000000000006064820152608401610758565b610c283382611a74565b610c9a5760405162461bcd60e51b815260206004820152602f60248201527f4e465437323143726561746f723a2043616c6c6572206973206e6f74206f776e60448201527f6572206e6f7220617070726f76656400000000000000000000000000000000006064820152608401610758565b610ca381612160565b50565b600080610cb561083684612169565b509392505050565b6000610cc88261183f565b9050610ce7610ce0611038546001600160a01b031690565b600161116d565b919050565b6000610cf883836117ac565b90506106ea610ce0611038546001600160a01b031690565b60006106ea82604051806060016040528060298152602001614aa0602991396108369190612187565b606061083d8054610d4990614586565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7590614586565b8015610dc25780601f10610d9757610100808354040283529160200191610dc2565b820191906000526020600020905b815481529060010190602001808311610da557829003601f168201915b5050505050905090565b60006001600160a01b038216610e4a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610758565b6001600160a01b0382166000908152610835602052604090206106ea90611a6a565b838383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610eae9250611e2b915050565b610f205760405162461bcd60e51b815260206004820152602b60248201527f4163636f756e744d6967726174696f6e3a2043616c6c6572206973206e6f742060448201527f616e206f70657261746f720000000000000000000000000000000000000000006064820152608401610758565b610f346001600160a01b0384168383611ec1565b60005b88811015610fef5760008a8a83818110610f5357610f5361453d565b905060200201359050610f65816119e0565b8015610f8a5750886001600160a01b0316610f7f82610d10565b6001600160a01b0316145b15610fdc57610f9a898983611b5f565b876001600160a01b0316896001600160a01b0316827fde55f075ebd46256cd6bd57d8fb53e0406f687db372e90ae8c18e72be46f5c1660405160405180910390a45b5080610fe7816145d7565b915050610f37565b5060005b8a811015610b695760008c8c8381811061100f5761100f61453d565b602090810292909201356000818152610c4f909352604090922054919250506001600160a01b031615611118576000818152610c4f60205260409020546001600160a01b038a81169116146110cc5760405162461bcd60e51b815260206004820152603960248201527f4e465437323143726561746f723a20546f6b656e20776173206e6f742063726560448201527f617465642062792074686520676976656e2061646472657373000000000000006064820152608401610758565b6110d68189612194565b876001600160a01b0316896001600160a01b0316827f58120fb31972ff9fad76eb87119474a58fc38d6b9b842bb3067a4a329eaa64f660405160405180910390a45b5080611123816145d7565b915050610ff3565b6001600160a01b0382166000908152611421602052604080822090516111529084906145f2565b9081526040519081900360200190205460ff16905092915050565b6001600160a01b0382163314156111c65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610758565b336000818152610839602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61123c33610996565b6112ae5760405162461bcd60e51b815260206004820152603860248201527f466f756e646174696f6e41646d696e526f6c653a2063616c6c657220646f657360448201527f206e6f742068617665207468652041646d696e20726f6c6500000000000000006064820152608401610758565b6112b783612217565b6112c0826122ec565b6108ab8161232f565b6112d33383611a74565b6113455760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610758565b61135184848484612404565b50505050565b6060611362826119e0565b6113d45760405162461bcd60e51b815260206004820152602b60248201527f4552433732314d657461646174613a20517565727920666f72206e6f6e65786960448201527f7374656e7420746f6b656e0000000000000000000000000000000000000000006064820152608401610758565b604080516001808252818301909252600091602080830190803683370190505090506113ff83611975565b816000815181106114125761141261453d565b6001600160a01b039092166020928302919091019091015292915050565b60608061143c836119e0565b6114ae5760405162461bcd60e51b815260206004820152602b60248201527f4552433732314d657461646174613a20517565727920666f72206e6f6e65786960448201527f7374656e7420746f6b656e0000000000000000000000000000000000000000006064820152608401610758565b60408051600180825281830190925290602080830190803683370190505091506114d783611975565b826000815181106114ea576114ea61453d565b6001600160a01b03929092166020928302919091018201526040805160018082528183019092529182810190803683370190505090506103e8816000815181106115365761153661453d565b602002602001018181525050915091565b600054610100900460ff166115625760005460ff1615611566565b303b155b6115d85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610758565b600054610100900460ff161580156115fa576000805461ffff19166101011790555b6116038261248d565b61160b6125b5565b61161361262a565b8015611625576000805461ff00191690555b5050565b6060611634826119e0565b6116a65760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610758565b600082815261083c6020526040812080546116c090614586565b80601f01602080910402602001604051908101604052809291908181526020018280546116ec90614586565b80156117395780601f1061170e57610100808354040283529160200191611739565b820191906000526020600020905b81548152906001019060200180831161171c57829003601f168201915b5050505050905061083d805461174e90614586565b1515905061175c5792915050565b80511561178f5761083d816040516020016117789291906146a8565b604051602081830303815290604052915050919050565b61083d61179b8461269d565b6040516020016117789291906146a8565b60006001600160a01b03821661182a5760405162461bcd60e51b815260206004820152603260248201527f4e46543732314d696e743a20746f6b656e43726561746f725061796d656e744160448201527f64647265737320697320726571756972656400000000000000000000000000006064820152608401610758565b6118338361183f565b90506106ea818361279b565b611809805460009182611851836145d7565b919050559050611861338261281e565b61186b8133612194565b6118758183612938565b8160405161188391906145f2565b604051809103902081336001600160a01b03167fe2406cfd356cfbe4e42d452bde96d27f48c423e5f02b5d78695893308399519d856040516118c59190613e35565b60405180910390a4919050565b600081815261083c602052604090208054606091906118f090614586565b80601f016020809104026020016040519081016040528092919081815260200182805461191c90614586565b80156119695780601f1061193e57610100808354040283529160200191611969565b820191906000526020600020905b81548152906001019060200180831161194c57829003601f168201915b50505050509050919050565b6000818152610c5060205260409020546001600160a01b031680610ce757506000908152610c4f60205260409020546001600160a01b031690565b60006119bd848484610a2e565b9050610a8b610ce0611038546001600160a01b031690565b60006106ea82612aa2565b60006106ea61083683612b4f565b600081815261083860205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190611a3182610d10565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006106ea825490565b6000611a7f826119e0565b611ae05760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610758565b6000611aeb83610d10565b9050806001600160a01b0316846001600160a01b03161480611b265750836001600160a01b0316611b1b846106f0565b6001600160a01b0316145b80611b5757506001600160a01b038082166000908152610839602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611b7282610d10565b6001600160a01b031614611bee5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610758565b6001600160a01b038216611c695760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610758565b611c746000826119ee565b6001600160a01b038316600090815261083560205260409020611c979082612b67565b506001600160a01b038216600090815261083560205260409020611cbb9082612b73565b50611cc96108368284612b7f565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b610beb546040517fa1453b0e0000000000000000000000000000000000000000000000000000000081526000916001600160a01b03169063a1453b0e90611d5d90869086906004016146cd565b6020604051808303816000875af1158015611d7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da091906146ef565b90506001600160a01b0381163b6106ea5760405162461bcd60e51b815260206004820152603360248201527f4e465437323150726f787943616c6c3a20616464726573732072657475726e6560448201527f64206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608401610758565b6000610a8b8383612b95565b600080546201000090046001600160a01b03166040517f6d70f7ae0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b039190911690636d70f7ae90602401602060405180830381865afa158015611e9d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090a9190614553565b816001600160a01b0316836001600160a01b03161415611f495760405162461bcd60e51b815260206004820152603460248201527f4163636f756e744d6967726174696f6e3a2043616e6e6f74206d69677261746560448201527f20746f207468652073616d65206163636f756e740000000000000000000000006064820152608401610758565b6000611f7b611f5784612bbf565b604051602001611f67919061470c565b604051602081830303815290604052612d8b565b9050611f916001600160a01b0385168284612dc6565b6113515760405162461bcd60e51b815260206004820152603d60248201527f4163636f756e744d6967726174696f6e3a205369676e6174757265206d75737460448201527f2062652066726f6d20746865206f726967696e616c206163636f756e740000006064820152608401610758565b600061200f8686611d10565b905061201d85858585612f40565b60006120298787611d10565b905060005b888110156121545760008a8a8381811061204a5761204a61453d565b602090810292909201356000818152610c50909352604090922054919250506001600160a01b038581169116146120e95760405162461bcd60e51b815260206004820152603860248201527f4e465437323143726561746f723a205061796d656e742061646472657373206960448201527f73206e6f74207468652065787065637465642076616c756500000000000000006064820152608401610758565b6120f3818461279b565b604080516001600160a01b0386811682528581166020830152808816929089169184917f806ccd3ad4c360726b134c8c9d1ce9842006fbcf915e66449802d74b608bed84910160405180910390a4508061214c816145d7565b91505061202e565b50505050505050505050565b610ca3816130ee565b600080808061217886866130f7565b909450925050505b9250929050565b6000611b578484846131af565b6000828152610c4f602052604080822054905184926001600160a01b038086169316917febd529444fe852bfccb40075e8f8cae7612ea20edebdf5143c72718ccb157f759190a46000918252610c4f6020526040909120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6001600160a01b0381163b6122945760405162461bcd60e51b815260206004820152602e60248201527f4e46543732314d61726b65743a204d61726b657420616464726573732069732060448201527f6e6f74206120636f6e74726163740000000000000000000000000000000000006064820152608401610758565b611038805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f07e7630580d612127ff5f3bd98a1ef992bb87b379fef3b98f2e2ca1ad8e27dd890600090a250565b6122f581613218565b7f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad816040516123249190613e35565b60405180910390a150565b6001600160a01b0381163b6123ac5760405162461bcd60e51b815260206004820152603560248201527f4e465437323150726f787943616c6c3a2050726f78792063616c6c206164647260448201527f657373206973206e6f74206120636f6e747261637400000000000000000000006064820152608401610758565b610beb805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f7213e3d637e4ef4968f947d5f602103307355f708bfd5bfce9d87da7c78f852190600090a250565b61240f848484611b5f565b61241b8484848461322c565b6113515760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610758565b600054610100900460ff166124f85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610758565b6001600160a01b0381163b6125755760405162461bcd60e51b815260206004820152603160248201527f466f756e646174696f6e54726561737572794e6f64653a20416464726573732060448201527f6973206e6f74206120636f6e74726163740000000000000000000000000000006064820152608401610758565b600080546001600160a01b0390921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909216919091179055565b600054610100900460ff166126205760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610758565b612628613327565b565b600054610100900460ff166126955760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610758565b600161180955565b6060816126c15750506040805180820190915260018152600360fc1b602082015290565b8160005b81156126eb57806126d5816145d7565b91506126e49050600a83614777565b91506126c5565b60008167ffffffffffffffff81111561270657612706613f59565b6040519080825280601f01601f191660200182016040528015612730576020820181803683370190505b5090505b8415611b575761274560018361478b565b9150612752600a866147a2565b61275d9060306147b6565b60f81b8183815181106127725761277261453d565b60200101906001600160f81b031916908160001a905350612794600a86614777565b9450612734565b6000828152610c50602052604080822054905184926001600160a01b038086169316917f296490d14aadeb9208962e029edf126e34fe835b4ed9dc8c91602df4d04766959190a46000918252610c506020526040909120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6001600160a01b0382166128745760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610758565b61287d816119e0565b156128ca5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610758565b6001600160a01b0382166000908152610835602052604090206128ed9082612b73565b506128fb6108368284612b7f565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b602e815110156129b05760405162461bcd60e51b815260206004820152602160248201527f4e46543732314d657461646174613a20496e76616c696420495046532070617460448201527f68000000000000000000000000000000000000000000000000000000000000006064820152608401610758565b33600090815261142160205260409081902090516129cf9083906145f2565b9081526040519081900360200190205460ff1615612a555760405162461bcd60e51b815260206004820152602660248201527f4e46543732314d657461646174613a204e46542077617320616c72656164792060448201527f6d696e74656400000000000000000000000000000000000000000000000000006064820152608401610758565b336000908152611421602052604090819020905160019190612a789084906145f2565b908152604051908190036020019020805491151560ff199092169190911790556116258282613392565b60006001600160e01b031982167fbb3bafd6000000000000000000000000000000000000000000000000000000001480612b0557506001600160e01b031982167fb779958400000000000000000000000000000000000000000000000000000000145b80612b3957506001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000145b15612b4657506001919050565b6106ea8261341c565b60008181526001830160205260408120541515610a8b565b6000610a8b8383613461565b6000610a8b8383613554565b6000611b5784846001600160a01b0385166135a3565b6000826000018281548110612bac57612bac61453d565b9060005260206000200154905092915050565b60408051602a808252606082810190935260009190602082018180368337019050509050600360fc1b81600081518110612bfb57612bfb61453d565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612c4657612c4661453d565b60200101906001600160f81b031916908160001a90535060005b6014811015612d84576000612c7682601361478b565b612c819060086147ce565b612c8c9060026148d1565b612c9f906001600160a01b038716614777565b60f81b9050600060108260f81c612cb691906148dd565b60f81b905060008160f81c6010612ccd91906148ff565b8360f81c612cdb9190614920565b60f81b9050612ce982613644565b85612cf58660026147ce565b612d009060026147b6565b81518110612d1057612d1061453d565b60200101906001600160f81b031916908160001a905350612d3081613644565b85612d3c8660026147ce565b612d479060036147b6565b81518110612d5757612d5761453d565b60200101906001600160f81b031916908160001a9053505050508080612d7c906145d7565b915050612c60565b5092915050565b6000612d97825161269d565b82604051602001612da9929190614943565b604051602081830303815290604052805190602001209050919050565b6000806000612dd5858561367a565b90925090506000816004811115612dee57612dee61499e565b148015612e0c5750856001600160a01b0316826001600160a01b0316145b15612e1c57600192505050610a8b565b600080876001600160a01b0316631626ba7e60e01b8888604051602401612e449291906149b4565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909416939093179092529051612e9791906145f2565b600060405180830381855afa9150503d8060008114612ed2576040519150601f19603f3d011682016040523d82523d6000602084013e612ed7565b606091505b5091509150818015612eea575080516020145b8015612f34575080517f1626ba7e0000000000000000000000000000000000000000000000000000000090612f2890830160209081019084016149cd565b6001600160e01b031916145b98975050505050505050565b60408051606084811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081166020840152835160148185030181526034840185529185901b16605483015282516048818403018152606890920190925260005b60148110156130e5576000612fb682886147b6565b9050838281518110612fca57612fca61453d565b602001015160f81c60f81b6001600160f81b031916888281518110612ff157612ff161453d565b01602001517fff00000000000000000000000000000000000000000000000000000000000000161461308b5760405162461bcd60e51b815260206004820152603960248201527f42797465733a20446174612070726f766964656420646f6573206e6f7420696e60448201527f636c7564652074686520657870656374656441646472657373000000000000006064820152608401610758565b82828151811061309d5761309d61453d565b602001015160f81c60f81b8882815181106130ba576130ba61453d565b60200101906001600160f81b031916908160001a9053505080806130dd906145d7565b915050612fa1565b50505050505050565b610ca3816136e7565b8154600090819083106131725760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e60448201527f64730000000000000000000000000000000000000000000000000000000000006064820152608401610758565b60008460000184815481106131895761318961453d565b906000526020600020906002020190508060000154816001015492509250509250929050565b600082815260018401602052604081205482816131df5760405162461bcd60e51b81526004016107589190613e35565b50846131ec60018361478b565b815481106131fc576131fc61453d565b9060005260206000209060020201600101549150509392505050565b80516116259061083d906020840190613cdb565b60006001600160a01b0384163b61324557506001611b57565b60006132f0630a85bd0160e11b3388878760405160240161326994939291906149ea565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051806060016040528060328152602001614a6e603291396001600160a01b0388169190613734565b905060008180602001905181019061330891906149cd565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b600054610100900460ff166126285760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610758565b61339b826119e0565b6133fc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732314d657461646174613a2055524920736574206f66206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610758565b600082815261083c6020908152604090912082516108ab92840190613cdb565b60006001600160e01b031982167f40c1a06400000000000000000000000000000000000000000000000000000000141561345857506001919050565b6106ea82613743565b6000818152600183016020526040812054801561354a57600061348560018361478b565b85549091506000906134999060019061478b565b90508181146134fe5760008660000182815481106134b9576134b961453d565b90600052602060002001549050808760000184815481106134dc576134dc61453d565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061350f5761350f614a26565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106ea565b60009150506106ea565b600081815260018301602052604081205461359b575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106ea565b5060006106ea565b600082815260018401602052604081205480613608575050604080518082018252838152602080820184815286546001818101895560008981528481209551600290930290950191825591519082015586548684528188019092529290912055610a8b565b828561361560018461478b565b815481106136255761362561453d565b9060005260206000209060020201600101819055506000915050610a8b565b6000600a60f883901c101561366b5761366260f883901c6030614a3c565b60f81b92915050565b61366260f883901c6057614a3c565b6000808251604114156136b15760208301516040840151606085015160001a6136a587828585613819565b94509450505050612180565b8251604014156136db57602083015160408401516136d0868383613906565b935093505050612180565b50600090506002612180565b3360009081526114216020908152604080832084845261083c909252918290209151909161371491614a61565b908152604051908190036020019020805460ff19169055610ca38161394e565b6060611b578484600085613997565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806137a657506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806137da57506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b156137e757506001919050565b7f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146106ea565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561385057506000905060036138fd565b8460ff16601b1415801561386857508460ff16601c14155b1561387957506000905060046138fd565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156138cd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166138f6576000600192509250506138fd565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b0161394087828885613819565b935093505050935093915050565b6000818152610c4f60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19908116909155610c5090925290912080549091169055610ca381613ad6565b606082471015613a0f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610758565b843b613a5d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610758565b600080866001600160a01b03168587604051613a7991906145f2565b60006040518083038185875af1925050503d8060008114613ab6576040519150601f19603f3d011682016040523d82523d6000602084013e613abb565b606091505b5091509150613acb828286613b94565b979650505050505050565b6000613ae182610d10565b9050613aee6000836119ee565b600082815261083c602052604090208054613b0890614586565b159050613b2757600082815261083c60205260408120613b2791613d5f565b6001600160a01b038116600090815261083560205260409020613b4a9083612b67565b50613b5761083683613bcd565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60608315613ba3575081610a8b565b825115613bb35782518084602001fd5b8160405162461bcd60e51b81526004016107589190613e35565b6000610a8b83836000818152600183016020526040812054801561354a576000613bf860018361478b565b8554909150600090613c0c9060019061478b565b90506000866000018281548110613c2557613c2561453d565b9060005260206000209060020201905080876000018481548110613c4b57613c4b61453d565b60009182526020909120825460029092020190815560019182015490820155613c759084906147b6565b815460009081526001890160205260409020558654879080613c9957613c99614a26565b60008281526020808220600260001990940193840201828155600190810183905592909355888152898201909252604082209190915594506106ea9350505050565b828054613ce790614586565b90600052602060002090601f016020900481019282613d095760008555613d4f565b82601f10613d2257805160ff1916838001178555613d4f565b82800160010185558215613d4f579182015b82811115613d4f578251825591602001919060010190613d34565b50613d5b929150613d95565b5090565b508054613d6b90614586565b6000825580601f10613d7b575050565b601f016020900490600052602060002090810190610ca391905b5b80821115613d5b5760008155600101613d96565b6001600160e01b031981168114610ca357600080fd5b600060208284031215613dd257600080fd5b8135610a8b81613daa565b60005b83811015613df8578181015183820152602001613de0565b838111156113515750506000910152565b60008151808452613e21816020860160208601613ddd565b601f01601f19169290920160200192915050565b602081526000610a8b6020830184613e09565b600060208284031215613e5a57600080fd5b5035919050565b6001600160a01b0381168114610ca357600080fd5b8035610ce781613e61565b60008060408385031215613e9457600080fd5b8235613e9f81613e61565b946020939093013593505050565b600081518084526020808501945080840160005b83811015613edd57815187529582019590820190600101613ec1565b509495945050505050565b602081526000610a8b6020830184613ead565b600080600060608486031215613f1057600080fd5b8335613f1b81613e61565b92506020840135613f2b81613e61565b929592945050506040919091013590565b600060208284031215613f4e57600080fd5b8135610a8b81613e61565b634e487b7160e01b600052604160045260246000fd5b600082601f830112613f8057600080fd5b813567ffffffffffffffff80821115613f9b57613f9b613f59565b604051601f8301601f19908116603f01168101908282118183101715613fc357613fc3613f59565b81604052838152866020858801011115613fdc57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561401157600080fd5b833567ffffffffffffffff8082111561402957600080fd5b61403587838801613f6f565b94506020860135915061404782613e61565b9092506040850135908082111561405d57600080fd5b5061406a86828701613f6f565b9150509250925092565b6000806040838503121561408757600080fd5b50508035926020909101359150565b60008083601f8401126140a857600080fd5b50813567ffffffffffffffff8111156140c057600080fd5b6020830191508360208260051b850101111561218057600080fd5b60008083601f8401126140ed57600080fd5b50813567ffffffffffffffff81111561410557600080fd5b60208301915083602082850101111561218057600080fd5b600080600080600080600080600060e08a8c03121561413b57600080fd5b893567ffffffffffffffff8082111561415357600080fd5b61415f8d838e01614096565b909b50995060208c0135915061417482613e61565b90975060408b0135908082111561418a57600080fd5b6141968d838e01613f6f565b975060608c0135965060808c013591506141af82613e61565b8195506141be60a08d01613e76565b945060c08c01359150808211156141d457600080fd5b506141e18c828d016140db565b915080935050809150509295985092959850929598565b60006020828403121561420a57600080fd5b813567ffffffffffffffff81111561422157600080fd5b611b5784828501613f6f565b6000806040838503121561424057600080fd5b823567ffffffffffffffff81111561425757600080fd5b61426385828601613f6f565b925050602083013561427481613e61565b809150509250929050565b60008060008060008060008060a0898b03121561429b57600080fd5b883567ffffffffffffffff808211156142b357600080fd5b6142bf8c838d01614096565b909a50985060208b01359150808211156142d857600080fd5b6142e48c838d01614096565b909850965060408b013591506142f982613e61565b90945060608a01359061430b82613e61565b90935060808a0135908082111561432157600080fd5b5061432e8b828c016140db565b999c989b5096995094979396929594505050565b6000806040838503121561435557600080fd5b823561436081613e61565b9150602083013567ffffffffffffffff81111561437c57600080fd5b61438885828601613f6f565b9150509250929050565b8015158114610ca357600080fd5b600080604083850312156143b357600080fd5b82356143be81613e61565b9150602083013561427481614392565b6000806000606084860312156143e357600080fd5b83356143ee81613e61565b9250602084013567ffffffffffffffff81111561440a57600080fd5b61441686828701613f6f565b925050604084013561442781613e61565b809150509250925092565b6000806000806080858703121561444857600080fd5b843561445381613e61565b9350602085013561446381613e61565b925060408501359150606085013567ffffffffffffffff81111561448657600080fd5b61449287828801613f6f565b91505092959194509250565b600081518084526020808501945080840160005b83811015613edd5781516001600160a01b0316875295820195908201906001016144b2565b602081526000610a8b602083018461449e565b6040815260006144fd604083018561449e565b8281036020840152610a478185613ead565b6000806040838503121561452257600080fd5b823561452d81613e61565b9150602083013561427481613e61565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561456557600080fd5b8151610a8b81614392565b634e487b7160e01b600052601260045260246000fd5b600181811c9082168061459a57607f821691505b602082108114156145bb57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156145eb576145eb6145c1565b5060010190565b60008251614604818460208701613ddd565b9190910192915050565b8054600090600181811c908083168061462857607f831692505b602080841082141561464a57634e487b7160e01b600052602260045260246000fd5b81801561465e576001811461466f5761469c565b60ff1986168952848901965061469c565b60008881526020902060005b868110156146945781548b82015290850190830161467b565b505084890196505b50505050505092915050565b60006146b4828561460e565b83516146c4818360208801613ddd565b01949350505050565b6001600160a01b0383168152604060208201526000611b576040830184613e09565b60006020828403121561470157600080fd5b8151610a8b81613e61565b7f4920617574686f72697a6520466f756e646174696f6e20746f206d696772617481527f65206d79206163636f756e7420746f200000000000000000000000000000000060208201526000825161476a816030850160208701613ddd565b9190910160300192915050565b60008261478657614786614570565b500490565b60008282101561479d5761479d6145c1565b500390565b6000826147b1576147b1614570565b500690565b600082198211156147c9576147c96145c1565b500190565b60008160001904831182151516156147e8576147e86145c1565b500290565b600181815b8085111561482857816000190482111561480e5761480e6145c1565b8085161561481b57918102915b93841c93908002906147f2565b509250929050565b60008261483f575060016106ea565b8161484c575060006106ea565b8160018114614862576002811461486c57614888565b60019150506106ea565b60ff84111561487d5761487d6145c1565b50506001821b6106ea565b5060208310610133831016604e8410600b84101617156148ab575081810a6106ea565b6148b583836147ed565b80600019048211156148c9576148c96145c1565b029392505050565b6000610a8b8383614830565b600060ff8316806148f0576148f0614570565b8060ff84160491505092915050565b600060ff821660ff84168160ff04811182151516156148c9576148c96145c1565b600060ff821660ff84168082101561493a5761493a6145c1565b90039392505050565b7f19457468657265756d205369676e6564204d6573736167653a0a00000000000081526000835161497b81601a850160208801613ddd565b83519083019061499281601a840160208801613ddd565b01601a01949350505050565b634e487b7160e01b600052602160045260246000fd5b828152604060208201526000611b576040830184613e09565b6000602082840312156149df57600080fd5b8151610a8b81613daa565b60006001600160a01b03808716835280861660208401525083604083015260806060830152614a1c6080830184613e09565b9695505050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168060ff03821115614a5957614a596145c1565b019392505050565b6000610a8b828461460e56fe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656ea264697066735822122081d748604e763375c6387fe85d19428be02dececd3ee8b409473096b3284d3a364736f6c634300080b0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102d35760003560e01c80636352211e11610186578063bb3bafd6116100e3578063d85d3d2711610097578063ec5f752e11610071578063ec5f752e146106a2578063edf9f57d146106b5578063f7a2da23146106c857600080fd5b8063d85d3d271461063f578063dac28cce14610652578063e985e9c51461066557600080fd5b8063c87b56dd116100c8578063c87b56dd14610610578063caa0f92a14610623578063d2c0fa5a1461062c57600080fd5b8063bb3bafd6146105dc578063c4d66de8146105fd57600080fd5b806395d89b411161013a578063a2805dcb1161011f578063a2805dcb14610596578063b88d4fde146105a9578063b9c4d9fb146105bc57600080fd5b806395d89b411461054a578063a22cb4651461058357600080fd5b806370a082311161016b57806370a082311461051157806384f4e5c01461052457806389ca8b711461053757600080fd5b80636352211e146104f65780636c0360eb1461050957600080fd5b80632f745c591161023457806342966c68116101e85780635174e853116101cd5780635174e853146104be57806358f05b93146104d1578063605eb5f5146104e457600080fd5b806342966c68146104985780634f6ccce7146104ab57600080fd5b80633fd7ca41116102195780633fd7ca411461044957806340c1a0641461045b57806342842e0e1461048557600080fd5b80632f745c59146104235780633d78bede1461043657600080fd5b806318160ddd1161028b57806324d7806c1161027057806324d7806c146103cb57806329f87c38146103de5780632a55205a146103f157600080fd5b806318160ddd146103a257806323b872dd146103b857600080fd5b8063081812fc116102bc578063081812fc14610342578063095ea7b31461036d5780630ebd4c7f1461038257600080fd5b806301ffc9a7146102d857806306fdde0314610300575b600080fd5b6102eb6102e6366004613dc0565b6106df565b60405190151581526020015b60405180910390f35b60408051808201909152600a81527f466f756e646174696f6e0000000000000000000000000000000000000000000060208201525b6040516102f79190613e35565b610355610350366004613e48565b6106f0565b6040516001600160a01b0390911681526020016102f7565b61038061037b366004613e81565b61077e565b005b610395610390366004613e48565b6108b0565b6040516102f79190613ee8565b6103aa6108fd565b6040519081526020016102f7565b6103806103c6366004613efb565b61090f565b6102eb6103d9366004613f3c565b610996565b6103aa6103ec366004613ffc565b610a2e565b6104046103ff366004614074565b610a50565b604080516001600160a01b0390931683526020830191909152016102f7565b6103aa610431366004613e81565b610a68565b61038061044436600461411d565b610a92565b611038546001600160a01b0316610355565b610355610469366004613e48565b6000908152610c4f60205260409020546001600160a01b031690565b610380610493366004613efb565b610b77565b6103806104a6366004613e48565b610b92565b6103aa6104b9366004613e48565b610ca6565b6103aa6104cc3660046141f8565b610cbd565b6103aa6104df36600461422d565b610cec565b610beb546001600160a01b0316610355565b610355610504366004613e48565b610d10565b610335610d39565b6103aa61051f366004613f3c565b610dcc565b61038061053236600461427f565b610e6c565b6102eb610545366004614342565b61112b565b60408051808201909152600381527f464e4400000000000000000000000000000000000000000000000000000000006020820152610335565b6103806105913660046143a0565b61116d565b6103806105a43660046143ce565b611233565b6103806105b7366004614432565b6112c9565b6105cf6105ca366004613e48565b611357565b6040516102f791906144d7565b6105ef6105ea366004613e48565b611430565b6040516102f79291906144ea565b61038061060b366004613f3c565b611547565b61033561061e366004613e48565b611629565b611809546103aa565b6103aa61063a36600461422d565b6117ac565b6103aa61064d3660046141f8565b61183f565b610335610660366004613e48565b6118d2565b6102eb61067336600461450f565b6001600160a01b0391821660009081526108396020908152604080832093909416825291909152205460ff1690565b6103556106b0366004613e48565b611975565b6103aa6106c3366004613ffc565b6119b0565b6000546201000090046001600160a01b0316610355565b60006106ea826119d5565b92915050565b60006106fb826119e0565b6107615760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b50600090815261083860205260409020546001600160a01b031690565b600061078982610d10565b9050806001600160a01b0316836001600160a01b031614156108135760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610758565b336001600160a01b038216148061082f575061082f8133610673565b6108a15760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610758565b6108ab83836119ee565b505050565b60408051600180825281830190925260609160009190602080830190803683370190505090506103e8816000815181106108ec576108ec61453d565b602090810291909101015292915050565b600061090a610836611a6a565b905090565b6109193382611a74565b61098b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610758565b6108ab838383611b5f565b600080546201000090046001600160a01b03166040517f24d7806c0000000000000000000000000000000000000000000000000000000081526001600160a01b03848116600483015291909116906324d7806c90602401602060405180830381865afa158015610a0a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ea9190614553565b600080610a3b8484611d10565b9050610a4785826117ac565b95945050505050565b600080610a5c84611975565b94600a90930493505050565b6001600160a01b038216600090815261083560205260408120610a8b9083611e1f565b9392505050565b838383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ad49250611e2b915050565b610b465760405162461bcd60e51b815260206004820152602b60248201527f4163636f756e744d6967726174696f6e3a2043616c6c6572206973206e6f742060448201527f616e206f70657261746f720000000000000000000000000000000000000000006064820152608401610758565b610b5a6001600160a01b0384168383611ec1565b610b698c8c8c8c8c8c8c612003565b505050505050505050505050565b6108ab838383604051806020016040528060008152506112c9565b6000818152610c4f60205260409020546001600160a01b03163314610c1e5760405162461bcd60e51b8152602060048201526024808201527f4e465437323143726561746f723a2043616c6c6572206973206e6f742063726560448201527f61746f72000000000000000000000000000000000000000000000000000000006064820152608401610758565b610c283382611a74565b610c9a5760405162461bcd60e51b815260206004820152602f60248201527f4e465437323143726561746f723a2043616c6c6572206973206e6f74206f776e60448201527f6572206e6f7220617070726f76656400000000000000000000000000000000006064820152608401610758565b610ca381612160565b50565b600080610cb561083684612169565b509392505050565b6000610cc88261183f565b9050610ce7610ce0611038546001600160a01b031690565b600161116d565b919050565b6000610cf883836117ac565b90506106ea610ce0611038546001600160a01b031690565b60006106ea82604051806060016040528060298152602001614aa0602991396108369190612187565b606061083d8054610d4990614586565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7590614586565b8015610dc25780601f10610d9757610100808354040283529160200191610dc2565b820191906000526020600020905b815481529060010190602001808311610da557829003601f168201915b5050505050905090565b60006001600160a01b038216610e4a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610758565b6001600160a01b0382166000908152610835602052604090206106ea90611a6a565b838383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610eae9250611e2b915050565b610f205760405162461bcd60e51b815260206004820152602b60248201527f4163636f756e744d6967726174696f6e3a2043616c6c6572206973206e6f742060448201527f616e206f70657261746f720000000000000000000000000000000000000000006064820152608401610758565b610f346001600160a01b0384168383611ec1565b60005b88811015610fef5760008a8a83818110610f5357610f5361453d565b905060200201359050610f65816119e0565b8015610f8a5750886001600160a01b0316610f7f82610d10565b6001600160a01b0316145b15610fdc57610f9a898983611b5f565b876001600160a01b0316896001600160a01b0316827fde55f075ebd46256cd6bd57d8fb53e0406f687db372e90ae8c18e72be46f5c1660405160405180910390a45b5080610fe7816145d7565b915050610f37565b5060005b8a811015610b695760008c8c8381811061100f5761100f61453d565b602090810292909201356000818152610c4f909352604090922054919250506001600160a01b031615611118576000818152610c4f60205260409020546001600160a01b038a81169116146110cc5760405162461bcd60e51b815260206004820152603960248201527f4e465437323143726561746f723a20546f6b656e20776173206e6f742063726560448201527f617465642062792074686520676976656e2061646472657373000000000000006064820152608401610758565b6110d68189612194565b876001600160a01b0316896001600160a01b0316827f58120fb31972ff9fad76eb87119474a58fc38d6b9b842bb3067a4a329eaa64f660405160405180910390a45b5080611123816145d7565b915050610ff3565b6001600160a01b0382166000908152611421602052604080822090516111529084906145f2565b9081526040519081900360200190205460ff16905092915050565b6001600160a01b0382163314156111c65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610758565b336000818152610839602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61123c33610996565b6112ae5760405162461bcd60e51b815260206004820152603860248201527f466f756e646174696f6e41646d696e526f6c653a2063616c6c657220646f657360448201527f206e6f742068617665207468652041646d696e20726f6c6500000000000000006064820152608401610758565b6112b783612217565b6112c0826122ec565b6108ab8161232f565b6112d33383611a74565b6113455760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610758565b61135184848484612404565b50505050565b6060611362826119e0565b6113d45760405162461bcd60e51b815260206004820152602b60248201527f4552433732314d657461646174613a20517565727920666f72206e6f6e65786960448201527f7374656e7420746f6b656e0000000000000000000000000000000000000000006064820152608401610758565b604080516001808252818301909252600091602080830190803683370190505090506113ff83611975565b816000815181106114125761141261453d565b6001600160a01b039092166020928302919091019091015292915050565b60608061143c836119e0565b6114ae5760405162461bcd60e51b815260206004820152602b60248201527f4552433732314d657461646174613a20517565727920666f72206e6f6e65786960448201527f7374656e7420746f6b656e0000000000000000000000000000000000000000006064820152608401610758565b60408051600180825281830190925290602080830190803683370190505091506114d783611975565b826000815181106114ea576114ea61453d565b6001600160a01b03929092166020928302919091018201526040805160018082528183019092529182810190803683370190505090506103e8816000815181106115365761153661453d565b602002602001018181525050915091565b600054610100900460ff166115625760005460ff1615611566565b303b155b6115d85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610758565b600054610100900460ff161580156115fa576000805461ffff19166101011790555b6116038261248d565b61160b6125b5565b61161361262a565b8015611625576000805461ff00191690555b5050565b6060611634826119e0565b6116a65760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610758565b600082815261083c6020526040812080546116c090614586565b80601f01602080910402602001604051908101604052809291908181526020018280546116ec90614586565b80156117395780601f1061170e57610100808354040283529160200191611739565b820191906000526020600020905b81548152906001019060200180831161171c57829003601f168201915b5050505050905061083d805461174e90614586565b1515905061175c5792915050565b80511561178f5761083d816040516020016117789291906146a8565b604051602081830303815290604052915050919050565b61083d61179b8461269d565b6040516020016117789291906146a8565b60006001600160a01b03821661182a5760405162461bcd60e51b815260206004820152603260248201527f4e46543732314d696e743a20746f6b656e43726561746f725061796d656e744160448201527f64647265737320697320726571756972656400000000000000000000000000006064820152608401610758565b6118338361183f565b90506106ea818361279b565b611809805460009182611851836145d7565b919050559050611861338261281e565b61186b8133612194565b6118758183612938565b8160405161188391906145f2565b604051809103902081336001600160a01b03167fe2406cfd356cfbe4e42d452bde96d27f48c423e5f02b5d78695893308399519d856040516118c59190613e35565b60405180910390a4919050565b600081815261083c602052604090208054606091906118f090614586565b80601f016020809104026020016040519081016040528092919081815260200182805461191c90614586565b80156119695780601f1061193e57610100808354040283529160200191611969565b820191906000526020600020905b81548152906001019060200180831161194c57829003601f168201915b50505050509050919050565b6000818152610c5060205260409020546001600160a01b031680610ce757506000908152610c4f60205260409020546001600160a01b031690565b60006119bd848484610a2e565b9050610a8b610ce0611038546001600160a01b031690565b60006106ea82612aa2565b60006106ea61083683612b4f565b600081815261083860205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190611a3182610d10565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006106ea825490565b6000611a7f826119e0565b611ae05760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610758565b6000611aeb83610d10565b9050806001600160a01b0316846001600160a01b03161480611b265750836001600160a01b0316611b1b846106f0565b6001600160a01b0316145b80611b5757506001600160a01b038082166000908152610839602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611b7282610d10565b6001600160a01b031614611bee5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610758565b6001600160a01b038216611c695760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610758565b611c746000826119ee565b6001600160a01b038316600090815261083560205260409020611c979082612b67565b506001600160a01b038216600090815261083560205260409020611cbb9082612b73565b50611cc96108368284612b7f565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b610beb546040517fa1453b0e0000000000000000000000000000000000000000000000000000000081526000916001600160a01b03169063a1453b0e90611d5d90869086906004016146cd565b6020604051808303816000875af1158015611d7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da091906146ef565b90506001600160a01b0381163b6106ea5760405162461bcd60e51b815260206004820152603360248201527f4e465437323150726f787943616c6c3a20616464726573732072657475726e6560448201527f64206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608401610758565b6000610a8b8383612b95565b600080546201000090046001600160a01b03166040517f6d70f7ae0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b039190911690636d70f7ae90602401602060405180830381865afa158015611e9d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090a9190614553565b816001600160a01b0316836001600160a01b03161415611f495760405162461bcd60e51b815260206004820152603460248201527f4163636f756e744d6967726174696f6e3a2043616e6e6f74206d69677261746560448201527f20746f207468652073616d65206163636f756e740000000000000000000000006064820152608401610758565b6000611f7b611f5784612bbf565b604051602001611f67919061470c565b604051602081830303815290604052612d8b565b9050611f916001600160a01b0385168284612dc6565b6113515760405162461bcd60e51b815260206004820152603d60248201527f4163636f756e744d6967726174696f6e3a205369676e6174757265206d75737460448201527f2062652066726f6d20746865206f726967696e616c206163636f756e740000006064820152608401610758565b600061200f8686611d10565b905061201d85858585612f40565b60006120298787611d10565b905060005b888110156121545760008a8a8381811061204a5761204a61453d565b602090810292909201356000818152610c50909352604090922054919250506001600160a01b038581169116146120e95760405162461bcd60e51b815260206004820152603860248201527f4e465437323143726561746f723a205061796d656e742061646472657373206960448201527f73206e6f74207468652065787065637465642076616c756500000000000000006064820152608401610758565b6120f3818461279b565b604080516001600160a01b0386811682528581166020830152808816929089169184917f806ccd3ad4c360726b134c8c9d1ce9842006fbcf915e66449802d74b608bed84910160405180910390a4508061214c816145d7565b91505061202e565b50505050505050505050565b610ca3816130ee565b600080808061217886866130f7565b909450925050505b9250929050565b6000611b578484846131af565b6000828152610c4f602052604080822054905184926001600160a01b038086169316917febd529444fe852bfccb40075e8f8cae7612ea20edebdf5143c72718ccb157f759190a46000918252610c4f6020526040909120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6001600160a01b0381163b6122945760405162461bcd60e51b815260206004820152602e60248201527f4e46543732314d61726b65743a204d61726b657420616464726573732069732060448201527f6e6f74206120636f6e74726163740000000000000000000000000000000000006064820152608401610758565b611038805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f07e7630580d612127ff5f3bd98a1ef992bb87b379fef3b98f2e2ca1ad8e27dd890600090a250565b6122f581613218565b7f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad816040516123249190613e35565b60405180910390a150565b6001600160a01b0381163b6123ac5760405162461bcd60e51b815260206004820152603560248201527f4e465437323150726f787943616c6c3a2050726f78792063616c6c206164647260448201527f657373206973206e6f74206120636f6e747261637400000000000000000000006064820152608401610758565b610beb805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040517f7213e3d637e4ef4968f947d5f602103307355f708bfd5bfce9d87da7c78f852190600090a250565b61240f848484611b5f565b61241b8484848461322c565b6113515760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610758565b600054610100900460ff166124f85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610758565b6001600160a01b0381163b6125755760405162461bcd60e51b815260206004820152603160248201527f466f756e646174696f6e54726561737572794e6f64653a20416464726573732060448201527f6973206e6f74206120636f6e74726163740000000000000000000000000000006064820152608401610758565b600080546001600160a01b0390921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909216919091179055565b600054610100900460ff166126205760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610758565b612628613327565b565b600054610100900460ff166126955760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610758565b600161180955565b6060816126c15750506040805180820190915260018152600360fc1b602082015290565b8160005b81156126eb57806126d5816145d7565b91506126e49050600a83614777565b91506126c5565b60008167ffffffffffffffff81111561270657612706613f59565b6040519080825280601f01601f191660200182016040528015612730576020820181803683370190505b5090505b8415611b575761274560018361478b565b9150612752600a866147a2565b61275d9060306147b6565b60f81b8183815181106127725761277261453d565b60200101906001600160f81b031916908160001a905350612794600a86614777565b9450612734565b6000828152610c50602052604080822054905184926001600160a01b038086169316917f296490d14aadeb9208962e029edf126e34fe835b4ed9dc8c91602df4d04766959190a46000918252610c506020526040909120805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6001600160a01b0382166128745760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610758565b61287d816119e0565b156128ca5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610758565b6001600160a01b0382166000908152610835602052604090206128ed9082612b73565b506128fb6108368284612b7f565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b602e815110156129b05760405162461bcd60e51b815260206004820152602160248201527f4e46543732314d657461646174613a20496e76616c696420495046532070617460448201527f68000000000000000000000000000000000000000000000000000000000000006064820152608401610758565b33600090815261142160205260409081902090516129cf9083906145f2565b9081526040519081900360200190205460ff1615612a555760405162461bcd60e51b815260206004820152602660248201527f4e46543732314d657461646174613a204e46542077617320616c72656164792060448201527f6d696e74656400000000000000000000000000000000000000000000000000006064820152608401610758565b336000908152611421602052604090819020905160019190612a789084906145f2565b908152604051908190036020019020805491151560ff199092169190911790556116258282613392565b60006001600160e01b031982167fbb3bafd6000000000000000000000000000000000000000000000000000000001480612b0557506001600160e01b031982167fb779958400000000000000000000000000000000000000000000000000000000145b80612b3957506001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000145b15612b4657506001919050565b6106ea8261341c565b60008181526001830160205260408120541515610a8b565b6000610a8b8383613461565b6000610a8b8383613554565b6000611b5784846001600160a01b0385166135a3565b6000826000018281548110612bac57612bac61453d565b9060005260206000200154905092915050565b60408051602a808252606082810190935260009190602082018180368337019050509050600360fc1b81600081518110612bfb57612bfb61453d565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612c4657612c4661453d565b60200101906001600160f81b031916908160001a90535060005b6014811015612d84576000612c7682601361478b565b612c819060086147ce565b612c8c9060026148d1565b612c9f906001600160a01b038716614777565b60f81b9050600060108260f81c612cb691906148dd565b60f81b905060008160f81c6010612ccd91906148ff565b8360f81c612cdb9190614920565b60f81b9050612ce982613644565b85612cf58660026147ce565b612d009060026147b6565b81518110612d1057612d1061453d565b60200101906001600160f81b031916908160001a905350612d3081613644565b85612d3c8660026147ce565b612d479060036147b6565b81518110612d5757612d5761453d565b60200101906001600160f81b031916908160001a9053505050508080612d7c906145d7565b915050612c60565b5092915050565b6000612d97825161269d565b82604051602001612da9929190614943565b604051602081830303815290604052805190602001209050919050565b6000806000612dd5858561367a565b90925090506000816004811115612dee57612dee61499e565b148015612e0c5750856001600160a01b0316826001600160a01b0316145b15612e1c57600192505050610a8b565b600080876001600160a01b0316631626ba7e60e01b8888604051602401612e449291906149b4565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909416939093179092529051612e9791906145f2565b600060405180830381855afa9150503d8060008114612ed2576040519150601f19603f3d011682016040523d82523d6000602084013e612ed7565b606091505b5091509150818015612eea575080516020145b8015612f34575080517f1626ba7e0000000000000000000000000000000000000000000000000000000090612f2890830160209081019084016149cd565b6001600160e01b031916145b98975050505050505050565b60408051606084811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000009081166020840152835160148185030181526034840185529185901b16605483015282516048818403018152606890920190925260005b60148110156130e5576000612fb682886147b6565b9050838281518110612fca57612fca61453d565b602001015160f81c60f81b6001600160f81b031916888281518110612ff157612ff161453d565b01602001517fff00000000000000000000000000000000000000000000000000000000000000161461308b5760405162461bcd60e51b815260206004820152603960248201527f42797465733a20446174612070726f766964656420646f6573206e6f7420696e60448201527f636c7564652074686520657870656374656441646472657373000000000000006064820152608401610758565b82828151811061309d5761309d61453d565b602001015160f81c60f81b8882815181106130ba576130ba61453d565b60200101906001600160f81b031916908160001a9053505080806130dd906145d7565b915050612fa1565b50505050505050565b610ca3816136e7565b8154600090819083106131725760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e60448201527f64730000000000000000000000000000000000000000000000000000000000006064820152608401610758565b60008460000184815481106131895761318961453d565b906000526020600020906002020190508060000154816001015492509250509250929050565b600082815260018401602052604081205482816131df5760405162461bcd60e51b81526004016107589190613e35565b50846131ec60018361478b565b815481106131fc576131fc61453d565b9060005260206000209060020201600101549150509392505050565b80516116259061083d906020840190613cdb565b60006001600160a01b0384163b61324557506001611b57565b60006132f0630a85bd0160e11b3388878760405160240161326994939291906149ea565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051806060016040528060328152602001614a6e603291396001600160a01b0388169190613734565b905060008180602001905181019061330891906149cd565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b600054610100900460ff166126285760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610758565b61339b826119e0565b6133fc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732314d657461646174613a2055524920736574206f66206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610758565b600082815261083c6020908152604090912082516108ab92840190613cdb565b60006001600160e01b031982167f40c1a06400000000000000000000000000000000000000000000000000000000141561345857506001919050565b6106ea82613743565b6000818152600183016020526040812054801561354a57600061348560018361478b565b85549091506000906134999060019061478b565b90508181146134fe5760008660000182815481106134b9576134b961453d565b90600052602060002001549050808760000184815481106134dc576134dc61453d565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061350f5761350f614a26565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106ea565b60009150506106ea565b600081815260018301602052604081205461359b575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106ea565b5060006106ea565b600082815260018401602052604081205480613608575050604080518082018252838152602080820184815286546001818101895560008981528481209551600290930290950191825591519082015586548684528188019092529290912055610a8b565b828561361560018461478b565b815481106136255761362561453d565b9060005260206000209060020201600101819055506000915050610a8b565b6000600a60f883901c101561366b5761366260f883901c6030614a3c565b60f81b92915050565b61366260f883901c6057614a3c565b6000808251604114156136b15760208301516040840151606085015160001a6136a587828585613819565b94509450505050612180565b8251604014156136db57602083015160408401516136d0868383613906565b935093505050612180565b50600090506002612180565b3360009081526114216020908152604080832084845261083c909252918290209151909161371491614a61565b908152604051908190036020019020805460ff19169055610ca38161394e565b6060611b578484600085613997565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806137a657506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806137da57506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b156137e757506001919050565b7f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146106ea565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561385057506000905060036138fd565b8460ff16601b1415801561386857508460ff16601c14155b1561387957506000905060046138fd565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156138cd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166138f6576000600192509250506138fd565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b0161394087828885613819565b935093505050935093915050565b6000818152610c4f60209081526040808320805473ffffffffffffffffffffffffffffffffffffffff19908116909155610c5090925290912080549091169055610ca381613ad6565b606082471015613a0f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610758565b843b613a5d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610758565b600080866001600160a01b03168587604051613a7991906145f2565b60006040518083038185875af1925050503d8060008114613ab6576040519150601f19603f3d011682016040523d82523d6000602084013e613abb565b606091505b5091509150613acb828286613b94565b979650505050505050565b6000613ae182610d10565b9050613aee6000836119ee565b600082815261083c602052604090208054613b0890614586565b159050613b2757600082815261083c60205260408120613b2791613d5f565b6001600160a01b038116600090815261083560205260409020613b4a9083612b67565b50613b5761083683613bcd565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60608315613ba3575081610a8b565b825115613bb35782518084602001fd5b8160405162461bcd60e51b81526004016107589190613e35565b6000610a8b83836000818152600183016020526040812054801561354a576000613bf860018361478b565b8554909150600090613c0c9060019061478b565b90506000866000018281548110613c2557613c2561453d565b9060005260206000209060020201905080876000018481548110613c4b57613c4b61453d565b60009182526020909120825460029092020190815560019182015490820155613c759084906147b6565b815460009081526001890160205260409020558654879080613c9957613c99614a26565b60008281526020808220600260001990940193840201828155600190810183905592909355888152898201909252604082209190915594506106ea9350505050565b828054613ce790614586565b90600052602060002090601f016020900481019282613d095760008555613d4f565b82601f10613d2257805160ff1916838001178555613d4f565b82800160010185558215613d4f579182015b82811115613d4f578251825591602001919060010190613d34565b50613d5b929150613d95565b5090565b508054613d6b90614586565b6000825580601f10613d7b575050565b601f016020900490600052602060002090810190610ca391905b5b80821115613d5b5760008155600101613d96565b6001600160e01b031981168114610ca357600080fd5b600060208284031215613dd257600080fd5b8135610a8b81613daa565b60005b83811015613df8578181015183820152602001613de0565b838111156113515750506000910152565b60008151808452613e21816020860160208601613ddd565b601f01601f19169290920160200192915050565b602081526000610a8b6020830184613e09565b600060208284031215613e5a57600080fd5b5035919050565b6001600160a01b0381168114610ca357600080fd5b8035610ce781613e61565b60008060408385031215613e9457600080fd5b8235613e9f81613e61565b946020939093013593505050565b600081518084526020808501945080840160005b83811015613edd57815187529582019590820190600101613ec1565b509495945050505050565b602081526000610a8b6020830184613ead565b600080600060608486031215613f1057600080fd5b8335613f1b81613e61565b92506020840135613f2b81613e61565b929592945050506040919091013590565b600060208284031215613f4e57600080fd5b8135610a8b81613e61565b634e487b7160e01b600052604160045260246000fd5b600082601f830112613f8057600080fd5b813567ffffffffffffffff80821115613f9b57613f9b613f59565b604051601f8301601f19908116603f01168101908282118183101715613fc357613fc3613f59565b81604052838152866020858801011115613fdc57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561401157600080fd5b833567ffffffffffffffff8082111561402957600080fd5b61403587838801613f6f565b94506020860135915061404782613e61565b9092506040850135908082111561405d57600080fd5b5061406a86828701613f6f565b9150509250925092565b6000806040838503121561408757600080fd5b50508035926020909101359150565b60008083601f8401126140a857600080fd5b50813567ffffffffffffffff8111156140c057600080fd5b6020830191508360208260051b850101111561218057600080fd5b60008083601f8401126140ed57600080fd5b50813567ffffffffffffffff81111561410557600080fd5b60208301915083602082850101111561218057600080fd5b600080600080600080600080600060e08a8c03121561413b57600080fd5b893567ffffffffffffffff8082111561415357600080fd5b61415f8d838e01614096565b909b50995060208c0135915061417482613e61565b90975060408b0135908082111561418a57600080fd5b6141968d838e01613f6f565b975060608c0135965060808c013591506141af82613e61565b8195506141be60a08d01613e76565b945060c08c01359150808211156141d457600080fd5b506141e18c828d016140db565b915080935050809150509295985092959850929598565b60006020828403121561420a57600080fd5b813567ffffffffffffffff81111561422157600080fd5b611b5784828501613f6f565b6000806040838503121561424057600080fd5b823567ffffffffffffffff81111561425757600080fd5b61426385828601613f6f565b925050602083013561427481613e61565b809150509250929050565b60008060008060008060008060a0898b03121561429b57600080fd5b883567ffffffffffffffff808211156142b357600080fd5b6142bf8c838d01614096565b909a50985060208b01359150808211156142d857600080fd5b6142e48c838d01614096565b909850965060408b013591506142f982613e61565b90945060608a01359061430b82613e61565b90935060808a0135908082111561432157600080fd5b5061432e8b828c016140db565b999c989b5096995094979396929594505050565b6000806040838503121561435557600080fd5b823561436081613e61565b9150602083013567ffffffffffffffff81111561437c57600080fd5b61438885828601613f6f565b9150509250929050565b8015158114610ca357600080fd5b600080604083850312156143b357600080fd5b82356143be81613e61565b9150602083013561427481614392565b6000806000606084860312156143e357600080fd5b83356143ee81613e61565b9250602084013567ffffffffffffffff81111561440a57600080fd5b61441686828701613f6f565b925050604084013561442781613e61565b809150509250925092565b6000806000806080858703121561444857600080fd5b843561445381613e61565b9350602085013561446381613e61565b925060408501359150606085013567ffffffffffffffff81111561448657600080fd5b61449287828801613f6f565b91505092959194509250565b600081518084526020808501945080840160005b83811015613edd5781516001600160a01b0316875295820195908201906001016144b2565b602081526000610a8b602083018461449e565b6040815260006144fd604083018561449e565b8281036020840152610a478185613ead565b6000806040838503121561452257600080fd5b823561452d81613e61565b9150602083013561427481613e61565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561456557600080fd5b8151610a8b81614392565b634e487b7160e01b600052601260045260246000fd5b600181811c9082168061459a57607f821691505b602082108114156145bb57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156145eb576145eb6145c1565b5060010190565b60008251614604818460208701613ddd565b9190910192915050565b8054600090600181811c908083168061462857607f831692505b602080841082141561464a57634e487b7160e01b600052602260045260246000fd5b81801561465e576001811461466f5761469c565b60ff1986168952848901965061469c565b60008881526020902060005b868110156146945781548b82015290850190830161467b565b505084890196505b50505050505092915050565b60006146b4828561460e565b83516146c4818360208801613ddd565b01949350505050565b6001600160a01b0383168152604060208201526000611b576040830184613e09565b60006020828403121561470157600080fd5b8151610a8b81613e61565b7f4920617574686f72697a6520466f756e646174696f6e20746f206d696772617481527f65206d79206163636f756e7420746f200000000000000000000000000000000060208201526000825161476a816030850160208701613ddd565b9190910160300192915050565b60008261478657614786614570565b500490565b60008282101561479d5761479d6145c1565b500390565b6000826147b1576147b1614570565b500690565b600082198211156147c9576147c96145c1565b500190565b60008160001904831182151516156147e8576147e86145c1565b500290565b600181815b8085111561482857816000190482111561480e5761480e6145c1565b8085161561481b57918102915b93841c93908002906147f2565b509250929050565b60008261483f575060016106ea565b8161484c575060006106ea565b8160018114614862576002811461486c57614888565b60019150506106ea565b60ff84111561487d5761487d6145c1565b50506001821b6106ea565b5060208310610133831016604e8410600b84101617156148ab575081810a6106ea565b6148b583836147ed565b80600019048211156148c9576148c96145c1565b029392505050565b6000610a8b8383614830565b600060ff8316806148f0576148f0614570565b8060ff84160491505092915050565b600060ff821660ff84168160ff04811182151516156148c9576148c96145c1565b600060ff821660ff84168082101561493a5761493a6145c1565b90039392505050565b7f19457468657265756d205369676e6564204d6573736167653a0a00000000000081526000835161497b81601a850160208801613ddd565b83519083019061499281601a840160208801613ddd565b01601a01949350505050565b634e487b7160e01b600052602160045260246000fd5b828152604060208201526000611b576040830184613e09565b6000602082840312156149df57600080fd5b8151610a8b81613daa565b60006001600160a01b03808716835280861660208401525083604083015260806060830152614a1c6080830184613e09565b9695505050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168060ff03821115614a5957614a596145c1565b019392505050565b6000610a8b828461460e56fe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656ea264697066735822122081d748604e763375c6387fe85d19428be02dececd3ee8b409473096b3284d3a364736f6c634300080b0033

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.