Contract 0x5bA208535C9Fd47b32406810bA7F907fd4958b34

 
Txn Hash
Method
Block
From
To
Value
0x710a56b9fe0aef5f795772a5858d534a9ab11f90f7cbf917ec7a0ad5f5b5b12dMint155459362022-09-16 11:39:5913 days 3 hrs agoENS Name esthereum.eth IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00077475 7.39817746
0x88966c1e3734a7f97575f7166dc492158ff3bec6c6b48d2200e7763a00dc1613Set Approval For...155413112022-09-15 19:56:5913 days 19 hrs ago0x9a7cc574888579b564331aeb110e1b8f576863e3 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.0003683 12.76219737
0xde26b17ae49e581df70da0b12793e6d64ad284b5c5f08703a38ef7e0b55b5bc0Set Approval For...155413112022-09-15 19:56:5913 days 19 hrs ago0x9a7cc574888579b564331aeb110e1b8f576863e3 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.0003683 12.76219737
0x5fc77b98a747131c38366dd69a0bcf4cc376b6f8d2ac274552a2730a7663847eSet Approval For...155413112022-09-15 19:56:5913 days 19 hrs ago0x9a7cc574888579b564331aeb110e1b8f576863e3 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00062227 12.76219737
0x3cd0528312839813c5f88716dcde01f5535b5c43ad575cd006e59fa39612fd87Mint155279702022-09-13 16:34:2915 days 22 hrs agoENS Name hwtyh.eth IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00198031 18.91016986
0x26b2149fcb3399742fe0866cbccb13d55da6c8ad350d0cc3ca73703ea713cbe8Mint155170662022-09-11 21:22:4917 days 17 hrs ago0x069fcaf86e9445964b7261d57f69122930589236 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00157186 9.1550464
0xa7d481ffa4364dcae33bd1f492706ceaa0ee2667f10abddc5796fcf7265170dfMint155169152022-09-11 20:52:4917 days 18 hrs ago0x069fcaf86e9445964b7261d57f69122930589236 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00339911 16.50907162
0x98024537f40f6e3352575f2b1f5d4bbbe1e823b1f2545f822fd4708e841c6b65Set Approval For...155144012022-09-11 10:47:5218 days 4 hrs ago0x21086a5f133090c1e6e7ed409ab884fc6fbec0ed IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.0003632 7.44890648
0x883d7f92fe78c72188efd2083b7bc440c217f79159ed6fcd9ae37b3947c164dcMint155084662022-09-10 11:04:3319 days 4 hrs ago0x326f0a378392e13e27539692a6109adf4833db00 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00083261 7.95074089
0xb4251b02445571bf5eb19edcfd628449a134f866d20cc4efddf36094434dce81Mint155084482022-09-10 11:00:4819 days 4 hrs ago0x21086a5f133090c1e6e7ed409ab884fc6fbec0ed IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00209929 6.83663932
0x781cda1e419e57a69ba9a4bc570992de074f7c7fe88de639c213d3ee403c532eMint155079942022-09-10 9:12:5819 days 5 hrs ago0x9a7cc574888579b564331aeb110e1b8f576863e3 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00219409 6.60157408
0xc8c97880f4c428d7c1874298b7649d5286530fb9c7d4ca5eeda2c87f74ac48edSet Invite155056712022-09-10 0:04:4919 days 15 hrs ago0xd7642f697f74b993ca47fc99a22cc6e71c4ed4aa IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00053794 14.87115637
0xe5997ddbfbcf6669c55cac86cf44cb5c72ec249552951113d02c7635283303b8Set Invite155056572022-09-10 0:02:2119 days 15 hrs ago0xd7642f697f74b993ca47fc99a22cc6e71c4ed4aa IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.0005628 17.51639948
0x9e7a6346900672327e6ce08cc14b421ae1107e4166a8ab523515f894ed0f06a6Mint155026762022-09-09 12:10:4020 days 2 hrs ago0xdbbce16edee36909115d374a886ae0cd6be56eb6 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00222633 18.65195086
0x66423010a487c149ec7ff4675fa799587e8ae0797c77d18062836c8440d5b28eSet Approval For...155024022022-09-09 11:03:3220 days 4 hrs ago0x2e77299f9e3a82686b5054e8754628ce2f322493 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00069518 14.25753653
0x9bf8c3d0cb73d73822f48c45c76cfeb706c60f2ec12cad4722970f9c8bed995eMint155023572022-09-09 10:54:2020 days 4 hrs ago0x2e77299f9e3a82686b5054e8754628ce2f322493 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00374504 31.37973689
0xe8c58af0cae6fd471938da86bbf5ebb02366d6b2b4127cf6bdcb88b8c139153bMint155016632022-09-09 8:12:0820 days 6 hrs ago0x52f76f9c2b777cf6b15fbaeb0d6f24ee5ac2f91b IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00095494 8
0x9819d2acbf192f9e4dc9b99f6fb21de643facc71cc694e01408c1ecb1dd144fdMint155005682022-09-09 3:52:4720 days 11 hrs ago0x42ff9ed7d0a256c912515e5b4f0d7a5212a56b97 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00133915 11.21680893
0xd8c6492541b11cb4d4e5dfa2d83853dca7b558872aab40cde7e9079b7e016b28Set Invite154999312022-09-09 1:23:4920 days 13 hrs ago0xd7642f697f74b993ca47fc99a22cc6e71c4ed4aa IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00055716 15.37186702
0xddcee2931fc639f74dcf181df5a254af841b8e353e99b58559d83421cc5e4d75Mint154996152022-09-09 0:05:2420 days 15 hrs ago0x61c2d87a5189116c88d4ce7f5ef66c11d2a3b986 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.0011327 9.48646866
0x24e28c2a9b9bfc861f0d90cf4c2f507d116b4857f5ac9f22422567c2eedfb04eMint154995932022-09-09 0:02:1520 days 15 hrs agoENS Name quarisma.eth IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00172485 14.44864926
0x4bb93c7deb77a0e0a661dc3c890f9c579423cb8a1bad9396fc34094c3989798dMint154989672022-09-08 21:36:3620 days 17 hrs ago0x7ddb7205dfe81d1cfe4c48c2274b44991b6f4494 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00274666 23.01006635
0x83f460c86fdac1cee11e7afb1877946a12fb3bde5313325e2ccbf96b6f76d88cMint154986712022-09-08 20:31:1020 days 18 hrs ago0x31ba77ec1cbb88ed6c0b125ca32aab972618f062 IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.0048847 40.92480742
0xbffcef23a198faecfee2028ae095b9522c2c35054a74742e06a6b81df817b29dMint154980162022-09-08 17:53:0920 days 21 hrs ago0xbbc50bf7d1b91f7d63033c80ac2a9af60b58617f IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.0004441815
0xe49a86c573815fd973bf08f995fa93a3c3d3fbec1d7ab78236ce1e91f03ff5c1Set Invite154977252022-09-08 16:49:5120 days 22 hrs ago0xd7642f697f74b993ca47fc99a22cc6e71c4ed4aa IN  0x5ba208535c9fd47b32406810ba7f907fd4958b340 Ether0.00153453 28.77226263
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x5c493a18937485c4744c9fbe83cfaef56381808d094472eb67dc7ed85efa16e9150668712022-07-03 2:29:5188 days 12 hrs ago 0x4d70631664f1cec37d33f289a3293662d70741c3  Contract Creation0 Ether
[ Download CSV Export 
Loading

Minimal Proxy Contract for 0xcc11f660e119cf5c320d46a6ee5b3a9b5e26a70c

Contract Name:
F0

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
Decompile ByteCode

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : F0.sol
// SPDX-License-Identifier: BUSL-1.1
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//
//  ███████╗░█████╗░░█████╗░████████╗░█████╗░██████╗░██╗░█████╗░  ░░░░░░  ███████╗░█████╗░
//  ██╔════╝██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗██║██╔══██╗  ░░░░░░  ██╔════╝██╔══██╗
//  █████╗░░███████║██║░░╚═╝░░░██║░░░██║░░██║██████╔╝██║███████║  █████╗  █████╗░░██║░░██║
//  ██╔══╝░░██╔══██║██║░░██╗░░░██║░░░██║░░██║██╔══██╗██║██╔══██║  ╚════╝  ██╔══╝░░██║░░██║
//  ██║░░░░░██║░░██║╚█████╔╝░░░██║░░░╚█████╔╝██║░░██║██║██║░░██║  ░░░░░░  ██║░░░░░╚█████╔╝
//  ╚═╝░░░░░╚═╝░░╚═╝░╚════╝░░░░╚═╝░░░░╚════╝░╚═╝░░╚═╝╚═╝╚═╝░░╚═╝  ░░░░░░  ╚═╝░░░░░░╚════╝░
//
//  ## THE LAUNCHERS ##
//  The following humans have brought the FACTORIA F0 contract into existence through crowdfunding:
//
//  0x3B31925EeC78dA3CF15c4503604c13b0eEBC57e5	0.1742069 ETH       Emblem Vault + Circuits of Value
//  0x1593110441AB4C5F2C133F21B0743B2b43E297cB	0.1000000 ETH       EmilySnow.eth
//  0x334Ce5048e1Dc1cfCbF6A692e7ce6Bd950Ad82ec	0.0750000 ETH       Las Vegas (@artsyassets) -- Shoutout to @skogard @chusla & Bob Marley
//  0xCe5A9AA866ca82f06Df0d0868CB27C044A9086Ef	0.0731200 ETH       Ramon Torres Batiz
//  0x298b25385E67B471faa64CB1CA17F31684016629	0.0400000 ETH       Apes4Good @Apes4Good + good frens @HeyGoodFrens
//  0x701Ee76fc23173B1568f12dEa8a4122fbC55abD1	0.0222000 ETH       Hansel Loh
//  0x48A64aDbb34837F3Bf4d40BCc40C85bBCa1A3a84	0.0170000 ETH       Arvind "POG" Alexander
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
pragma solidity ^0.8.4;
//import 'hardhat/console.sol';
import "./F0ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
contract F0 is Initializable, ERC721Upgradeable, OwnableUpgradeable {
  /**********************************************************
  *
  *   EVENTS
  *
  **********************************************************/
  event Invited(bytes32 indexed key, bytes32 indexed cid);
  event NSUpdated(string name, string symbol);
  event Configured(Config config);
  event WithdrawerUpdated(Withdrawer withdrawer);

  /**********************************************************
  *
  *   DATA STRUCTURES
  *
  **********************************************************/
  struct Config {
    string placeholder;
    string base;
    uint64 supply;
    bool permanent;
  }
  struct Invite {
    uint128 price;
    uint64 start;
    uint64 limit;
  }
  struct Auth {
    bytes32 key;
    bytes32[] proof;
  }
  struct Withdrawer {
    address account;
    bool permanent;
  }
  struct Invitelist {
    bytes32 key;
    bytes32 cid;
    Invite invite;
  }

  /**********************************************************
  *
  *  VARIABLES
  *
  **********************************************************/
  mapping (bytes32 => Invite) public invite;
  Config public config;
  Withdrawer public withdrawer;
  uint public nextId;
  uint private feeUsed;
  string public URI;
  address public royalty;
  mapping (address => mapping(bytes32 => uint)) private minted;

  /**********************************************************
  *
  *  INITIALIZER
  *
  **********************************************************/
  function initialize(string memory name, string memory symbol, Config calldata _config) initializer external {
    __ERC721_init(name, symbol);
    __Ownable_init();
    setConfig(_config);
  }

  /**********************************************************
  *
  *  ADMIN
  *
  **********************************************************/
  function setConfig(Config calldata _config) public onlyOwner {
    require(!config.permanent, "1");
    config = _config;
    emit Configured(_config);
  }
  function setNS(string calldata name_, string calldata symbol_) external onlyOwner {
    require(!config.permanent, "2");
    _name = name_; 
    _symbol = symbol_;
    emit NSUpdated(_name, _symbol);
  }
  function setURI (string calldata _uri) external onlyOwner {
    URI = _uri;
  }
  function setWithdrawer(Withdrawer calldata _withdrawer) external onlyOwner {
    require(!withdrawer.permanent, "3");
    withdrawer = _withdrawer; 
    emit WithdrawerUpdated(_withdrawer);
  }
  function setInvites(Invitelist[] calldata invitelist) external onlyOwner {
    if (nextId==0) nextId = 1;  // delay nextId setting until the first invite is made.
    for(uint i=0; i<invitelist.length; i++) {
      Invitelist calldata list = invitelist[i];
      invite[list.key] = list.invite;
      emit Invited(list.key, list.cid);
    }
  }
  function setInvite(bytes32 _key, bytes32 _cid, Invite calldata _invite) external onlyOwner {
    if (nextId==0) nextId = 1;  // delay nextId setting until the first invite is made.
    invite[_key] = _invite;
    emit Invited(_key, _cid);
  }
  function withdraw() external payable {
    /****************************************************************************************************
    *
    *  Authorization
    *   - Either the owner or the withdrawer (in case it's set) can initiate withdraw()
    *
    ****************************************************************************************************/
    require(_msgSender() == owner() || _msgSender() == withdrawer.account, "4");

    /****************************************************************************************************
    *
    *  Fee => 1% of revenue with 1ETH cap
    *   - compute 1%
    *   - if paying 1% exceeds the 1ETH total fee used, only pay enough to reach 1ETH
    *   - update the total fee used
    *
    ****************************************************************************************************/
    uint balance = address(this).balance;
    uint fee = 0;
    if (feeUsed < 1 ether) {
      fee = balance/100;
      if (feeUsed + fee > 1 ether) fee = 1 ether - feeUsed;
      feeUsed += fee;
    }

    /****************************************************************************************************
    *
    *   - if the withdrawer.account is not set (0x0 address), withdraw balance-fee to owner
    *   - if the withdrawer.account is set, withdraw balance-fee to withdrawer.account
    *
    ****************************************************************************************************/
    (bool sent1, ) = payable(
      withdrawer.account == address(0) ? owner() : withdrawer.account
    ).call{value: balance-fee}("");
    require(sent1, "5");

    /****************************************************************************************************
    *
    *   - the fee is sent to 0x502b2FE7Cc3488fcfF2E16158615AF87b4Ab5C41
    *
    ****************************************************************************************************/
    (bool sent2, ) = payable(address(0x502b2FE7Cc3488fcfF2E16158615AF87b4Ab5C41)).call{value: fee}("");
    require(sent2, "6");
  }

  /**********************************************************
  *
  *  TOKEN
  *
  **********************************************************/
  function mint(Auth calldata auth, uint _count) external payable {
    uint n = nextId;
    Invite memory i = invite[auth.key];
    require(verify(auth, _msgSender()), "7");
    require(i.price * _count == msg.value, "8");
    require(i.start <= block.timestamp, "9");
    require(minted[_msgSender()][auth.key] + _count <= i.limit, "10");
    require(n+_count-1 <= config.supply, "11");
    for(uint k=0; k<_count; k++) {
      _safeMint(_msgSender(), n+k);
    }
    nextId = n + _count;
    minted[_msgSender()][auth.key] += _count;
  }
  function gift(address _receiver, uint _count) external onlyOwner {
    // first time: nextId is 0 => n is 1
    // after that: nextId is 1 or greater => n is the same as nextId
    uint n = (nextId > 0 ? nextId : 1);
    require(_count > 0, "12");
    require(n+_count-1 <= config.supply, "13");
    for(uint k=0; k<_count; k++) {
      _safeMint(_receiver, n+k);
    }
    nextId = n + _count;
  }
  function burn(uint _tokenId) external {
    require(_isApprovedOrOwner(_msgSender(), _tokenId), "14");
    _burn(_tokenId);
  }
  function tokenURI(uint tokenId) public view override(ERC721Upgradeable) returns (string memory) {
    require(tokenId > 0 && tokenId <= config.supply, "15");
    if (bytes(config.base).length > 0) {
      return string(abi.encodePacked(config.base, _toString(tokenId), ".json"));
    } else {
      return bytes(config.placeholder).length > 0 ?  config.placeholder : "ipfs://bafkreieqcdphcfojcd2vslsxrhzrjqr6cxjlyuekpghzehfexi5c3w55eq";
    }
  }

  /**********************************************************
  *
  *  ROYALTY
  *
  **********************************************************/
  function setRoyalty(address _address) external onlyOwner {
    require(!config.permanent, "16");
    royalty = _address;
  }
  function royaltyInfo(uint tokenId, uint value) external view returns (address receiver, uint256 royaltyAmount) {
    if (royalty == address(0)) {
      // Default: No royalty
      return (royalty, 0);
    } else {
      // If the royalty address is set, call the contract to get the royalty values
      (, bytes memory r) = royalty.staticcall(abi.encodeWithSignature("get(address,uint256,uint256)", address(this), tokenId, value));
      return abi.decode(r, (address,uint));
    }
  }
  function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable) returns (bool) {
    return (interfaceId == 0x2a55205a || super.supportsInterface(interfaceId));
  }

  /**********************************************************
  *
  *  UTIL
  *
  **********************************************************/
  function _toString(uint value) internal pure returns (string memory) {
    uint temp = value;
    uint digits;
    while (temp != 0) {
      digits++;
      temp /= 10;
    }
    bytes memory buffer = new bytes(digits);
    while (value != 0) {
      digits--;
      buffer[digits] = bytes1(uint8(48 + uint(value % 10)));
      value /= 10;
    }
    return string(buffer);
  }
  function verify(Auth calldata auth, address account) internal pure returns (bool) {
    if (auth.key == "") return true; 
    bytes32 computedHash = keccak256(abi.encodePacked(account));
    for (uint256 i = 0; i < auth.proof.length; i++) {
      bytes32 proofElement = auth.proof[i];
      if (computedHash <= proofElement) {
        computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
      } else {
        computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
      }
    }
    return computedHash == auth.key;
  }
}

File 2 of 12 : F0ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
/***************************************************************************************************
*
* This file is identical to
* @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol
* with one exception:
* 
* _name and _symbol are "internal" types inatead of "private" 
*   => so the inheriting F0.sol contract can dynamically update it using setNS()
* 
***************************************************************************************************/
pragma solidity ^0.8.0;

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

    // Token name
    string internal _name;

    // Token symbol
    string internal _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        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 virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

File 3 of 12 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

    function __Ownable_init_unchained() internal initializer {
        _setOwner(_msgSender());
    }

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

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

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
    uint256[49] private __gap;
}

File 4 of 12 : Initializable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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.
 */
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() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

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

        _;

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

File 5 of 12 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 6 of 12 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 7 of 12 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

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

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

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

File 8 of 12 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

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 9 of 12 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

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 initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    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 10 of 12 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

File 11 of 12 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    function __ERC165_init_unchained() internal initializer {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

File 12 of 12 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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":[{"components":[{"internalType":"string","name":"placeholder","type":"string"},{"internalType":"string","name":"base","type":"string"},{"internalType":"uint64","name":"supply","type":"uint64"},{"internalType":"bool","name":"permanent","type":"bool"}],"indexed":false,"internalType":"struct F0.Config","name":"config","type":"tuple"}],"name":"Configured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"key","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"cid","type":"bytes32"}],"name":"Invited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"}],"name":"NSUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"permanent","type":"bool"}],"indexed":false,"internalType":"struct F0.Withdrawer","name":"withdrawer","type":"tuple"}],"name":"WithdrawerUpdated","type":"event"},{"inputs":[],"name":"URI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"string","name":"placeholder","type":"string"},{"internalType":"string","name":"base","type":"string"},{"internalType":"uint64","name":"supply","type":"uint64"},{"internalType":"bool","name":"permanent","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"gift","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"components":[{"internalType":"string","name":"placeholder","type":"string"},{"internalType":"string","name":"base","type":"string"},{"internalType":"uint64","name":"supply","type":"uint64"},{"internalType":"bool","name":"permanent","type":"bool"}],"internalType":"struct F0.Config","name":"_config","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"invite","outputs":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"limit","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"internalType":"struct F0.Auth","name":"auth","type":"tuple"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royalty","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"value","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":[{"components":[{"internalType":"string","name":"placeholder","type":"string"},{"internalType":"string","name":"base","type":"string"},{"internalType":"uint64","name":"supply","type":"uint64"},{"internalType":"bool","name":"permanent","type":"bool"}],"internalType":"struct F0.Config","name":"_config","type":"tuple"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"},{"internalType":"bytes32","name":"_cid","type":"bytes32"},{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"limit","type":"uint64"}],"internalType":"struct F0.Invite","name":"_invite","type":"tuple"}],"name":"setInvite","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"bytes32","name":"cid","type":"bytes32"},{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"limit","type":"uint64"}],"internalType":"struct F0.Invite","name":"invite","type":"tuple"}],"internalType":"struct F0.Invitelist[]","name":"invitelist","type":"tuple[]"}],"name":"setInvites","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"name":"setNS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"permanent","type":"bool"}],"internalType":"struct F0.Withdrawer","name":"_withdrawer","type":"tuple"}],"name":"setWithdrawer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdrawer","outputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"permanent","type":"bool"}],"stateMutability":"view","type":"function"}]

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.