ETH Price: $2,026.38 (+0.09%)

Contract

0xFF9CF325bfA593f7dBDBd7a3e21966Ca53cf7d71
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw179354222023-08-17 15:26:23937 days ago1692285983IN
0xFF9CF325...a53cf7d71
0 ETH0.0026639846.42054759
Allowlist Mint179295782023-08-16 19:49:23938 days ago1692215363IN
0xFF9CF325...a53cf7d71
0.24 ETH0.0016261733.66122796
Allowlist Mint179288312023-08-16 17:18:47938 days ago1692206327IN
0xFF9CF325...a53cf7d71
0.24 ETH0.00874332180
Allowlist Mint179288042023-08-16 17:13:11938 days ago1692205991IN
0xFF9CF325...a53cf7d71
0.12 ETH0.0017756736.75579998
Allowlist Mint179288042023-08-16 17:13:11938 days ago1692205991IN
0xFF9CF325...a53cf7d71
0.12 ETH0.0017752336.75579998
Process Presale ...179287992023-08-16 17:12:11938 days ago1692205931IN
0xFF9CF325...a53cf7d71
0 ETH0.0066086243.23884301
Process Presale ...179287972023-08-16 17:11:47938 days ago1692205907IN
0xFF9CF325...a53cf7d71
0 ETH0.0307191143.86702922
Process Presale ...179287962023-08-16 17:11:35938 days ago1692205895IN
0xFF9CF325...a53cf7d71
0 ETH0.0095655645.44967005
Process Presale ...179287952023-08-16 17:11:23938 days ago1692205883IN
0xFF9CF325...a53cf7d71
0 ETH0.0093777244.55716445
Allowlist Mint179287942023-08-16 17:11:11938 days ago1692205871IN
0xFF9CF325...a53cf7d71
0.24 ETH0.0030802539
Process Presale ...179287932023-08-16 17:10:59938 days ago1692205859IN
0xFF9CF325...a53cf7d71
0 ETH0.0080708644.43036595
Process Presale ...179287912023-08-16 17:10:35938 days ago1692205835IN
0xFF9CF325...a53cf7d71
0 ETH0.0071326946.66774613
Process Presale ...179287902023-08-16 17:10:23938 days ago1692205823IN
0xFF9CF325...a53cf7d71
0 ETH0.0072241647.26620604
Process Presale ...179287882023-08-16 17:09:59938 days ago1692205799IN
0xFF9CF325...a53cf7d71
0 ETH0.0086977647.88146787
Process Presale ...179287872023-08-16 17:09:47938 days ago1692205787IN
0xFF9CF325...a53cf7d71
0 ETH0.0119123749.78486872
Process Presale ...179287852023-08-16 17:09:23938 days ago1692205763IN
0xFF9CF325...a53cf7d71
0 ETH0.0123473851.60289585
Process Presale ...179287842023-08-16 17:09:11938 days ago1692205751IN
0xFF9CF325...a53cf7d71
0 ETH0.0076005749.72898715
Process Presale ...179287822023-08-16 17:08:47938 days ago1692205727IN
0xFF9CF325...a53cf7d71
0 ETH0.0080291952.5333337
Allowlist Mint179287812023-08-16 17:08:35938 days ago1692205715IN
0xFF9CF325...a53cf7d71
0.12 ETH0.0045427857.51749565
Process Presale ...179287802023-08-16 17:08:23938 days ago1692205703IN
0xFF9CF325...a53cf7d71
0 ETH0.0084137446.317906
Process Presale ...179287762023-08-16 17:07:35938 days ago1692205655IN
0xFF9CF325...a53cf7d71
0 ETH0.0121687657.81848124
Process Presale ...179287762023-08-16 17:07:35938 days ago1692205655IN
0xFF9CF325...a53cf7d71
0 ETH0.0641820351.96096713
Process Presale ...179287762023-08-16 17:07:35938 days ago1692205655IN
0xFF9CF325...a53cf7d71
0 ETH0.0131558449.07266798
Oasis Mint179287742023-08-16 17:07:11938 days ago1692205631IN
0xFF9CF325...a53cf7d71
0.24 ETH0.0037153246
Allowlist Mint179287662023-08-16 17:05:35938 days ago1692205535IN
0xFF9CF325...a53cf7d71
0.12 ETH0.0038420948.64581735
View all transactions

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer179354222023-08-17 15:26:23937 days ago1692285983
0xFF9CF325...a53cf7d71
82.656 ETH
Transfer179354222023-08-17 15:26:23937 days ago1692285983
0xFF9CF325...a53cf7d71
20.664 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WildXYZMinterPresale

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 32 : WildXYZMinterPresale.sol
// SPDX-License-Identifier: GPL-3.0-or-later

// ░██╗░░░░░░░██╗░██╗░██╗░░░░░░██████╗░░██╗░░██╗░██╗░░░██╗░███████╗
// ░██║░░██╗░░██║░██║░██║░░░░░░██╔══██╗░╚██╗██╔╝░╚██╗░██╔╝░╚════██║
// ░╚██╗████╗██╔╝░██║░██║░░░░░░██║░░██║░░╚███╔╝░░░╚████╔╝░░░░███╔═╝
// ░░████╔═████║░░██║░██║░░░░░░██║░░██║░░██╔██╗░░░░╚██╔╝░░░██╔══╝░░
// ░░╚██╔╝░╚██╔╝░░██║░███████╗░██████╔╝░██╔╝╚██╗░░░░██║░░░░███████╗
// ░░░╚═╝░░░╚═╝░░░╚═╝░╚══════╝░╚═════╝░░╚═╝░░╚═╝░░░░╚═╝░░░░╚══════╝

// It ain't much, but it's honest work.

pragma solidity ^0.8.17;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';

import '@openzeppelin/contracts/utils/math/Math.sol';

import '../WildNFT.sol';

import '../minter/utils/IOasis.sol';
import '../minter/utils/ISanctionsList.sol';

import './IWildXYZMinter.sol';

contract WildXYZMinterPresale is IWildXYZMinter, Ownable, Pausable, ReentrancyGuard {
  // private variables

  mapping(uint256 => Group) private groups;
  uint256 private numGroups;

  /// @dev One-time variable used to set up the contract.
  bool private isSetup = false;

  mapping(uint256 => uint8) private oasisPassMints;

  // public variables

  // presale variables

  struct PresaleMinterInfo {
    State minterState;
    bool isPresaleLive;
    uint256 maxSupply;
    uint256 totalSupply;
    uint256 presaleMaxSupply;
    uint256 presaleTotalSupply;
    uint256 maxPerOasis;
    uint256 maxPerAddress;
    address allowlistSigner;
    Group[] groups;
  }

  uint256 public presaleMaxSupply;
  uint256 public presaleTotalSupply;

  uint256 public numPresaleMints;

  uint256 public presaleStartTime;
  uint256 public presaleEndTime;

  uint256 public presaleGroupIdOasis;
  uint256 public presaleGroupIdAllowlist;

  struct PresalePurchaseInfo {
    address owner;
    uint256 amount;
    uint256 value;
    bool processed;
    uint256 amountProcessed;
  }
  // mapping(uint256 => PresalePurchaseInfo) public presalePurchaseInfo;
  mapping(address => PresalePurchaseInfo) public presalePurchaseInfo;
  address[] public presalePurchaseOwners;
  uint256 public numPresalePurchaseOwners;

  uint256 private constant maxNFTsPerTransaction = 20;

  // mapping(address => uint256) public presaleAddressTotalSupply;

  event PresalePurchase(address indexed owner, uint256 indexed amount, uint256 value, MintType mintType);

  event PresalePurchaseProcessed(address indexed owner, uint256[] tokenIds);

  /// @notice Emitted when we have already processed a presale purchase for minting the actual nft
  error AlreadyProcessedPresalePurchase();

  error PresalePurchaseNotFound();

  error InvalidAllowlistType();

  /// @notice Emitted when the requesting minter is not on an allowlist (either wild allowlist, oasis holder or allowlisted NFT holder)
  error NotOnAllowlist(address _receiver);

  // drop variables

  /// @notice Max supply of NFTs available. Same as NFT contract.
  uint256 public maxSupply;

  /// @notice Wildxyz royalty percentage.
  /// @dev Wildxyz royalty is `wildRoyalty`%. Artist royalty is `100 - wildRoyalty`% (100 - wildRoyalty).
  uint256 public wildRoyalty;

  /// @notice Royalty total denominator.
  uint256 public royaltyTotal = 100;

  /// @notice Wildxyz royalty wallet
  /// @dev This is the wallet that will receive the `wildRoyalty`% of the primary sale eth.
  address payable public wildWallet;

  /// @notice Artist royalty wallet
  /// @dev This is the wallet that will receive the `100 - wildRoyalty`% of the primary sale eth.
  address payable public artistWallet;

  /// @notice The contract admin address.
  address public admin;

  /// @notice The WildNFT contract address.
  WildNFT public nft;

  /// @notice The OFAC sanctions list contract address.
  /// @dev Used to block unsanctioned addresses from minting NFTs.
  ISanctionsList public sanctionsList;

  /// @notice Oasis NFT address.
  IOasis public oasis;

  /// @notice The DelegateCash registry address.
  IDelegationRegistry public delegationRegistry = IDelegationRegistry(0x00000000000076A84feF008CDAbe6409d2FE638B);

  // minter variables

  /// @notice The admin signature signer address.
  address public adminSigner;

  /// @notice The total number of promo minted tokens.
  uint256 public promoMintTotalSupply = 0;

  uint256 public maxPerAddress;

  uint256 public groupIdOasis;
  uint256 public groupIdAllowlist;
  uint256 public groupIdPublicSale;

  mapping(uint256 => address) allowlistedERC721Addresses;
  uint256 public numAllowlistedERC721Addresses;

  mapping(address => uint256) public addressTotalSupply;

  // modifiers

  modifier setupOnce() {
    if (isSetup) revert AlreadySetup();
    isSetup = true;
    _;
  }

  modifier onlyAdmin() {
    if (msg.sender != admin) revert OnlyAdmin();
    _;
  }

  modifier onlyLive() {
    if (getState() != State.Live) revert NotLive();
    _;
  }

  modifier validGroup(uint256 _groupId) {
    _validGroup(_groupId);
    _;
  }

  modifier validateSigner(address _address, bytes memory _signature) {
    if (!verifySignature(_address, _signature)) revert InvalidSignature(_signature);
    _;
  }

  modifier onlyUnsanctioned(address _to) {
    if (sanctionsList.isSanctioned(_to)) revert SanctionedAddress(_to);
    _;
  }

  modifier onlyDelegated(address _vault, address _contract) {
    if (!delegationRegistry.checkDelegateForContract(msg.sender, _vault, _contract)) revert NotDelegated(msg.sender, _vault, _contract);
    _;
  }

  modifier nonZeroAmount(uint256 _amount) {
    _nonZeroAmount(_amount);
    _;
  }

  // modifier validation hooks

  modifier validAllowlistPresalePurchase(address _receiver, uint256 _amount) {
    _validAllowlistPresalePurchase(_receiver, _amount);
    _;
  }

  modifier validOasisPresalePurchase(
    address _receiver,
    address _vault,
    uint256 _amount
  ) {
    _validOasisPresalePurchase(_receiver, _vault, _amount);
    _;
  }

  modifier validOasisMint(
    address _receiver,
    address _vault,
    uint256 _amount
  ) {
    _validOasisMint(_receiver, _vault, _amount);
    _;
  }

  modifier validAllowlistMint(address _receiver, uint256 _amount) {
    _validAllowlistMint(_receiver, _amount);
    _;
  }

  modifier validPublicSaleMint(address _receiver, uint256 _amount) {
    _validPublicSaleMint(_receiver, _amount);
    _;
  }

  /** @notice BaseMinter constructor
   * @param _maxSupply The max supply of the NFT (same as WildNFT)
   * @param _wildRoyalty The royalty percentage for Wildxyz
   * @param _wildWallet The wallet address for Wildxyz
   * @param _artistWallet The wallet address for the artist
   * @param _admin The admin address
   * @param _sanctions The sanctions list contract address
   * @param _nft The WildNFT contract address
   */
  constructor(uint256 _maxSupply, uint256 _wildRoyalty, address _wildWallet, address _artistWallet, address _admin, ISanctionsList _sanctions, WildNFT _nft) {
    maxSupply = _maxSupply;
    wildRoyalty = _wildRoyalty;
    wildWallet = payable(_wildWallet);
    artistWallet = payable(_artistWallet);
    admin = _admin;
    sanctionsList = _sanctions;
    nft = _nft;
  }

  // internal functions

  function _createGroup(string memory _name, uint256 _startTime, uint256 _endTime, uint256 _price) internal onlyOwner returns (uint256 groupId) {
    groupId = numGroups;

    groups[groupId] = Group(_name, groupId, _startTime, _endTime, _price);

    numGroups++;
  }

  // function validation hooks

  function _isGroupLive(uint256 _groupId) internal view returns (bool) {
    return block.timestamp >= groups[_groupId].startTime && (groups[_groupId].endTime == 0 || block.timestamp < groups[_groupId].endTime);
  }

  function _nonZeroAmount(uint256 _amount) internal pure {
    if (_amount < 1) revert ZeroAmount();
  }

  function _validGroup(uint256 _groupId) internal view {
    if (_groupId >= numGroups) revert GroupDoesNotExist(_groupId);
  }

  function _groupAllowed(uint256 _group) internal view {
    if (!_isGroupLive(_group)) revert GroupNotLive(_group);
  }

  function _validPrice(uint256 _amount, uint256 _groupId) internal view {
    if (msg.value < _amount * groups[_groupId].price) revert InsufficientFunds();
  }

  function _validSupply(uint256 _amount) internal view {
    uint256 supplyRemaining = maxSupply - _nftTotalSupply() - (presaleTotalSupply - numPresaleMints);

    if (_amount > supplyRemaining) revert MaxSupplyExceeded();
  }

  function _validMaxPerTransaction(address _receiver, uint256 _amount) internal view {
    if (_amount > maxPerAddress) revert MaxPerAddressExceeded(_receiver, _amount);
  }

  function _validGroupPriceSupply(uint256 _groupId, uint256 _amount) internal view {
    _groupAllowed(_groupId);
    _validPrice(_amount, _groupId);
    _validSupply(_amount);
    _validMaxPerTransaction(msg.sender, _amount);
  }

  function _validPresaleSupply(uint256 _amount) internal view {
    if (presaleTotalSupply + _amount > presaleMaxSupply) revert MaxSupplyExceeded();
  }

  function _validPresaleGroupPriceSupply(uint256 _groupId, uint256 _amount) internal view {
    _groupAllowed(_groupId);
    _validPrice(_amount, _groupId);
    _validPresaleSupply(_amount);
    _validMaxPerTransaction(msg.sender, _amount);
  }

  // public mint validation hooks

  function _validOasisPresalePurchase(address /*_receiver*/, address _vault, uint256 _amount) internal virtual {
    // check oasis ownership
    if (oasis.balanceOf(_vault) == 0) revert ZeroOasisAllowance(_vault);

    _validPresaleGroupPriceSupply(presaleGroupIdOasis, _amount);
  }

  function _validAllowlistPresalePurchase(address /*_receiver*/, uint256 _amount) internal virtual {
    _validPresaleGroupPriceSupply(presaleGroupIdAllowlist, _amount);
  }

  function _validAllowlistMint(address /*_receiver*/, uint256 _amount) internal virtual {
    _validGroupPriceSupply(groupIdAllowlist, _amount);
  }

  function _validOasisMint(address /*_receiver*/, address _vault, uint256 _amount) internal virtual {
    // check oasis ownership
    if (oasis.balanceOf(_vault) == 0) revert ZeroOasisAllowance(_vault);

    _validGroupPriceSupply(groupIdOasis, _amount);
  }

  function _validPublicSaleMint(address /*_receiver*/, uint256 _amount) internal virtual {
    _validGroupPriceSupply(groupIdPublicSale, _amount);
  }

  function _mapAllowlistTypeToMintType(uint256 _allowlistType) internal pure returns (MintType) {
    if (_allowlistType == 1) {
      return MintType.Allowlist;
    } else if (_allowlistType == 2) {
      return MintType.ArtistAllowlist;
    }

    revert InvalidAllowlistType();
  }

  function _isAllowlisted(address _receiver, bytes memory _signature) internal view returns (uint256) {
    // check signer is valid or not
    if (verifySignature(_receiver, _signature)) {
      return 1;
    }

    // check allowlisted NFT ownership
    for (uint256 i = 0; i < numAllowlistedERC721Addresses; i++) {
      address nftAddress = allowlistedERC721Addresses[i];
      if (nftAddress != address(0)) {
        if (IERC721(nftAddress).balanceOf(_receiver) > 0) {
          return 2;
        }
      }
    }

    return 0;
  }

  // on pre-sale puchase hook

  function _onPresalePurchase(address _receiver, uint256 _amount, MintType _mintType) internal virtual {
    PresalePurchaseInfo storage purchaseInfo = presalePurchaseInfo[_receiver];

    if (purchaseInfo.owner == address(0)) {
      purchaseInfo.owner = _receiver;

      presalePurchaseOwners.push(_receiver);

      numPresalePurchaseOwners++;
    }

    purchaseInfo.amount += _amount;
    purchaseInfo.value += msg.value;

    presaleTotalSupply += _amount;

    emit PresalePurchase(_receiver, _amount, msg.value, _mintType);
  }

  // on-mint hooks

  function _onPromoMint(address _receiver, uint256[] memory _tokenIds, MintType _mintType) internal virtual {
    promoMintTotalSupply += _tokenIds.length;

    emit TokenMint(_receiver, _tokenIds, _mintType, msg.value, false, address(0), false, new uint256[](0));
  }

  function _onAllowlistMint(address _receiver, uint256[] memory _tokenIds, MintType _mintType) internal virtual {
    _addAddressTotalSupply(_receiver, _tokenIds.length);

    emit TokenMint(_receiver, _tokenIds, _mintType, msg.value, false, address(0), false, new uint256[](0));
  }

  function _onOasisMint(address _receiver, uint256[] memory _tokenIds) internal virtual {
    _addAddressTotalSupply(_receiver, _tokenIds.length);

    emit TokenMint(_receiver, _tokenIds, MintType.Oasis, msg.value, false, address(0), true, new uint256[](0));
  }

  function _onOasisMintDelegated(address _receiver, address _vault, uint256[] memory _tokenIds) internal virtual {
    _addAddressTotalSupply(_receiver, _tokenIds.length);

    emit TokenMint(_receiver, _tokenIds, MintType.Oasis, msg.value, true, _vault, true, new uint256[](0));
  }

  function _onPublicSaleMint(address _receiver, uint256[] memory _tokenIds) internal virtual {
    _addAddressTotalSupply(_receiver, _tokenIds.length);

    emit TokenMint(_receiver, _tokenIds, MintType.PublicSale, msg.value, false, address(0), false, new uint256[](0));
  }

  // helpers

  /// @dev Withdraws the funds to wild and artist wallets acconting for royalty fees. Only callable by owner.
  function _withdraw() internal virtual {
    // send a fraction of the balance to wild first
    if (wildRoyalty > 0) {
      (bool successWild, ) = wildWallet.call{value: ((address(this).balance * wildRoyalty) / royaltyTotal)}('');
      if (!successWild) revert FailedToWithdraw('wild', wildWallet);
    }

    // then, send the rest to payee
    (bool successPayee, ) = artistWallet.call{value: address(this).balance}('');
    if (!successPayee) revert FailedToWithdraw('artist', artistWallet);
  }

  /// @dev Sets the admin signer address.
  function _setAdminSigner(address _adminSigner) internal {
    adminSigner = _adminSigner;
  }

  /// @dev Wraps the nft.totalSupply call.
  function _nftTotalSupply() internal view virtual returns (uint256) {
    return nft.totalSupply();
  }

  /** @dev Internal mint function. Use if minting only 1 token.
   * @param _receiver Token receiver address.
   * @return tokenId Newly minted Token ID.
   */
  function _mint(address _receiver) internal virtual returns (uint256 tokenId) {
    tokenId = nft.mint(_receiver);
  }

  /** @dev Internal mint multiple function. Use if minting more than 1 token.
   * @param _receiver Token receiver address.
   * @param _amount Amount to mint.
   * @return tokenIds Newly minted Token IDs.
   */
  function _mintMultiple(address _receiver, uint256 _amount) internal virtual returns (uint256[] memory tokenIds) {
    tokenIds = new uint256[](_amount);

    for (uint256 i = 0; i < _amount; i++) {
      uint256 tokenId = nft.mint(_receiver);
      tokenIds[i] = tokenId;
    }
  }

  function _addAddressTotalSupply(address _receiver, uint256 _amount) internal {
    addressTotalSupply[_receiver] += _amount;
  }

  function _promoMint(address _receiver, uint256 _amount, MintType _mintType) internal {
    uint256[] memory tokenIds = _mintMultiple(_receiver, _amount);

    _onPromoMint(_receiver, tokenIds, _mintType);
  }

  function _promoMintBatch(address[] memory _receiver, uint256[] memory _amounts, MintType _mintType) internal {
    if (_receiver.length == 0 || _receiver.length != _amounts.length) revert ArraySizeMismatch();

    // sum amounts to validate total supply
    uint256 totalAmount = 0;
    for (uint256 i = 0; i < _amounts.length; i++) {
      totalAmount += _amounts[i];
    }

    _validSupply(totalAmount);

    for (uint256 i = 0; i < _receiver.length; i++) {
      address to = _receiver[i];
      uint256 amount = _amounts[i];

      uint256[] memory tokenIds = _mintMultiple(to, amount);

      _onPromoMint(to, tokenIds, _mintType);
    }
  }

  function _isPresaleGroup(uint256 _groupId) internal view returns (bool) {
    return _groupId == presaleGroupIdOasis || _groupId == presaleGroupIdAllowlist;
  }

  function _isPresaleLive() internal view returns (bool) {
    return block.timestamp >= presaleStartTime && block.timestamp < presaleEndTime;
  }

  // public admin-only functions

  function setupMinter(uint256[2] memory _startTimes, uint256 _salePrice, uint256 _presaleMaxSupply, uint256 _presaleStartTime, uint256 _presaleEndTime, uint256 _presalePrice, uint256 _maxPerAddress, address _allowlistSigner, IOasis _oasis, address[] memory _allowlistedERC721Addresses) public setupOnce onlyOwner {
    presaleMaxSupply = _presaleMaxSupply;
    presaleStartTime = _presaleStartTime;
    presaleEndTime = _presaleEndTime;

    presaleGroupIdOasis = _createGroup('Presale Oasis', _presaleStartTime, _presaleEndTime, _presalePrice);
    presaleGroupIdAllowlist = _createGroup('Presale Allowlist', _presaleStartTime, _presaleEndTime, _presalePrice);

    groupIdOasis = _createGroup('Oasis', _startTimes[0], 0, _salePrice);
    groupIdAllowlist = _createGroup('Allowlist', _startTimes[0], 0, _salePrice);
    groupIdPublicSale = _createGroup('Public Sale', _startTimes[1], 0, _salePrice);

    maxPerAddress = _maxPerAddress;

    for (uint256 i = 0; i < _allowlistedERC721Addresses.length; i++) {
      allowlistedERC721Addresses[i] = _allowlistedERC721Addresses[i];
    }

    _setAdminSigner(_allowlistSigner);
    oasis = _oasis;
  }

  /** @notice Pause the minter.
   * @dev Sets the minter state to Paused and pauses the minter and any mint functions. Only callable by admin.
   */
  function pause() public virtual onlyAdmin {
    _pause();
  }

  /** @notice Unpause the minter.
   * @dev Resumes normal minter state and any mint functions. Only callable by admin.
   */
  function unpause() public virtual onlyAdmin {
    _unpause();
  }

  /** @notice Sets the admin signer address.
   * @dev Can only be called by the contract admin.
   * @param _adminSigner The new admin signer address.
   */
  function setAdminSigner(address _adminSigner) public onlyAdmin {
    if (_adminSigner == address(0)) revert ZeroAddress();

    _setAdminSigner(_adminSigner);
  }

  /** @notice Sets the DelegateCash contract address.
   * @dev Can only be called by the contract admin.
   * @param _delegationRegistry The new delegation registry contract address.
   */
  function setDelegationRegistry(address _delegationRegistry) external onlyAdmin {
    delegationRegistry = IDelegationRegistry(_delegationRegistry);
  }

  /** @notice Sets the max per address.
   * @dev Sets the given max per address. Only callable by admin.
   * @param _maxPerAddress The new max per address.
   */
  function setMaxPerAddress(uint256 _maxPerAddress) public onlyAdmin {
    maxPerAddress = _maxPerAddress;
  }

  /** @notice Sets the group price.
   * @dev Sets the given group price. Only callable by admin.
   * @param _groupId The group ID. Must be a valid group ID.
   * @param _price The new price of the group. Must be non-zero.
   */
  function setGroupPrice(uint256 _groupId, uint256 _price) public virtual validGroup(_groupId) nonZeroAmount(_price) onlyAdmin {
    groups[_groupId].price = _price;
  }

  /** @notice Sets the group start time.
   * @dev Sets the given group start time. Only callable by admin.
   * @param _groupId The group ID. Must be a valid group ID.
   * @param _startTime The new start time of the group.
   */
  function setGroupStartTime(uint256 _groupId, uint256 _startTime) public virtual validGroup(_groupId) onlyAdmin {
    groups[_groupId].startTime = _startTime;
  }

  /** @notice Sets the group end time.
   * @dev Sets the given group end time. Only callable by admin.
   * @param _groupId The group ID. Must be a valid group ID.
   * @param _endTime The new end time of the group.
   */
  function setGroupEndTime(uint256 _groupId, uint256 _endTime) public virtual validGroup(_groupId) onlyAdmin {
    groups[_groupId].endTime = _endTime;
  }

  function setPresaleStartTime(uint256 _presaleStartTime) public onlyAdmin {
    presaleStartTime = _presaleStartTime;

    groups[presaleGroupIdOasis].startTime = _presaleStartTime;
    groups[presaleGroupIdAllowlist].startTime = _presaleStartTime;
  }

  function setPresaleEndTime(uint256 _presaleEndTime) public onlyAdmin {
    presaleEndTime = _presaleEndTime;

    groups[presaleGroupIdOasis].endTime = _presaleEndTime;
    groups[presaleGroupIdAllowlist].endTime = _presaleEndTime;
  }

  // public only-owner functions

  /** @notice Withdraws funds to wild and artist wallets.
   * @dev Withdraws the funds to wild and artist wallets acconting for royalty fees. Only callable by owner.
   */
  function withdraw() public virtual onlyOwner {
    _withdraw();
  }

  function withdrawToOwner() public virtual onlyOwner {
    (bool successWild, ) = wildWallet.call{value: address(this).balance}('');
    if (!successWild) revert FailedToWithdraw('wild', wildWallet);
  }

  function addAllowlistedNFTAddress(address _nftAddress) public onlyOwner {
    allowlistedERC721Addresses[numAllowlistedERC721Addresses++] = _nftAddress;
  }

  function removeAllowlistedNFTAddress(address _nftAddress) public onlyOwner {
    for (uint256 i = 0; i < numAllowlistedERC721Addresses; i++) {
      if (allowlistedERC721Addresses[i] == _nftAddress) {
        allowlistedERC721Addresses[i] = address(0);
      }
    }
  }

  // only-owner presale functions

  function processPresaleMint(uint256 _index) public onlyOwner {
    address receiver = presalePurchaseOwners[_index];

    if (presalePurchaseInfo[receiver].processed) revert AlreadyProcessedPresalePurchase();

    PresalePurchaseInfo storage purchaseInfo = presalePurchaseInfo[receiver];

    uint256 amount = Math.min(maxNFTsPerTransaction, purchaseInfo.amount - purchaseInfo.amountProcessed);

    uint256[] memory tokenIds = _mintMultiple(receiver, amount);

    emit PresalePurchaseProcessed(receiver, tokenIds);

    //if (purchaseInfo.amountProcessed == 0) {
      emit TokenMint(receiver, tokenIds, MintType.PresalePurchase, purchaseInfo.value, false, address(0), false, new uint256[](0));
    //}

    purchaseInfo.amountProcessed += amount;

    // mark as processed if we have processed all tokens
    if (purchaseInfo.amountProcessed == purchaseInfo.amount) {
      purchaseInfo.processed = true;
    }
   
    numPresaleMints += amount;
  }

  function processPresaleMintBatch(uint256 _fromIndex, uint256 _toIndex) public onlyOwner {
    for (uint256 i = _fromIndex; i < _toIndex; i++) {
      processPresaleMint(i);
    }
  }

  /*function revokePresalePurchase(uint256 _tokenId) public onlyOwner {
    PresalePurchaseInfo storage purchaseInfo = presalePurchaseInfo[_tokenId];

    if (purchaseInfo.processed) revert AlreadyProcessedPresalePurchase();

    purchaseInfo.processed = true;

    addressTotalSupply[purchaseInfo.owner] -= 1;

    presaleTotalSupply += 1;
  }

  function refundPresalePurchase(uint256 _tokenId) public onlyOwner {
    PresalePurchaseInfo storage purchaseInfo = presalePurchaseInfo[_tokenId];

    if (purchaseInfo.processed) revert AlreadyProcessedPresalePurchase();

    address payable receiver = payable(purchaseInfo.owner);
    uint256 price = purchaseInfo.price;

    (bool success, ) = receiver.call{value: price}('');
    if(!success) revert FailedToWithdraw('presale', receiver);

    purchaseInfo.processed = true;

    addressTotalSupply[purchaseInfo.owner] -= 1;

    presaleTotalSupply += 1;
  }*/

  // public functions

  /** @notice Get the current minter state.
   * @dev Returns the current minter state. If groups are not directly one after another (ie presale), it is possible to re-enter Setup state.
   * @return state Minter state (0 = Setup, 1 = Live, 2 = Complete, 3 = Paused).
   */
  function getState() public view virtual returns (State) {
    if (paused()) {
      return State.Paused;
    }

    // if sold out, return Complete state
    // NOTE: this would not work with a ReserveAuction where this minter holds the token!!!!
    if (_nftTotalSupply() == maxSupply) {
      return State.Complete;
    }

    // check if we are in any group using _isGroupLive
    // if we are in a group, return Live state
    // note: if groups are not directly one after another (ie presale), it is possible to re-enter Setup state
    for (uint256 i = 0; i < numGroups; i++) {
      if (_isGroupLive(i)) {
        return State.Live;
      }
    }

    return State.Setup;
  }

  function getUserGroup(address _user, bytes memory _signature) public view returns (uint256) {
    bool isPresaleLive = _isPresaleLive();

    if (oasis.balanceOf(_user) > 0) {
      return isPresaleLive ? presaleGroupIdOasis : groupIdOasis;
    }

    if (_isAllowlisted(_user, _signature) > 0) {
      return isPresaleLive ? presaleGroupIdAllowlist : groupIdAllowlist;
    }

    return groupIdPublicSale;
  }

  // returns user allowance: Y
  function getUserGroupAllowance(uint256 _groupId) public view returns (uint256) {
    uint256 supplyRemaining;

    if (_isPresaleGroup(_groupId)) {
      supplyRemaining = presaleMaxSupply - presaleTotalSupply;
    } else {
      supplyRemaining = maxSupply - _nftTotalSupply() - (presaleTotalSupply - numPresaleMints);
    }

    if (supplyRemaining == 0) {
      return 0;
    }

    return Math.min(maxPerAddress, supplyRemaining);
  }

  function getUserGroupTotalSupply(address _user, uint256 _groupId) public view returns (uint256) {
    if (_isPresaleGroup(_groupId)) {
      return presalePurchaseInfo[_user].amount;
    } else {
      return addressTotalSupply[_user];
    }
  }

  function getMinterInfo() public view returns (PresaleMinterInfo memory) {
    Group[] memory _groups = new Group[](numGroups);
    for (uint256 i = 0; i < numGroups; i++) {
      _groups[i] = groups[i];
    }

    return PresaleMinterInfo(getState(), _isPresaleLive(), maxSupply, _nftTotalSupply(), presaleMaxSupply, presaleTotalSupply, maxPerAddress, maxPerAddress, adminSigner, _groups);
  }

  function getUserInfo(address _user, bytes memory _signature) public view returns (UserInfo memory) {
    uint256 userGroupId = getUserGroup(_user, _signature);

    return UserInfo(userGroupId, getUserGroupAllowance(/*_user, */ userGroupId), getUserGroupTotalSupply(_user, userGroupId), _isGroupLive(userGroupId));
  }

  function getUserMinterInfo(address _user, bytes memory _signature) public view returns (UserInfo memory userInfo, PresaleMinterInfo memory minterInfo) {
    userInfo = getUserInfo(_user, _signature);
    minterInfo = getMinterInfo();
  }

  /** @notice Verifies the signature of the signer for a given address.
   * @param _address The address the message was signed for.
   * @param _signature The signature to verify.
   * @return valid True if the signature is valid, false otherwise.
   */
  function verifySignature(address _address, bytes memory _signature) public view returns (bool valid) {
    if (_signature.length == 65) {
      // we pass the uers _address and this contracts address to
      // verify that it is intended for this contract specifically
      bytes32 addressHash = keccak256(abi.encodePacked(_address, address(this)));
      bytes32 message = ECDSA.toEthSignedMessageHash(addressHash);
      address signerAddress = ECDSA.recover(message, _signature);

      return (signerAddress != address(0) && signerAddress == adminSigner);
    } else {
      return false;
    }
  }

  function getGroups() public view returns (Group[] memory _groups) {
    _groups = new Group[](numGroups);
    for (uint256 i = 0; i < numGroups; i++) {
      _groups[i] = groups[i];
    }
  }

  function getGroup(uint256 _groupId) public view validGroup(_groupId) returns (Group memory) {
    return groups[_groupId];
  }

  function getGroupStartTime(uint256 _groupId) public view validGroup(_groupId) returns (uint256) {
    return groups[_groupId].startTime;
  }

  function getGroupEndTime(uint256 _groupId) public view validGroup(_groupId) returns (uint256) {
    return groups[_groupId].endTime;
  }

  function getGroupPrice(uint256 _groupId) public view validGroup(_groupId) returns (uint256) {
    return groups[_groupId].price;
  }

  // mint functions

  // promo minting

  function promoMint(address _receiver, uint256 _amount, MintType _mintType) external onlyAdmin nonZeroAmount(_amount) {
    _promoMint(_receiver, _amount, _mintType);
  }

  function promoMintBatch(address[] memory _receiver, uint256[] memory _amounts, MintType _mintType) external onlyAdmin {
    _promoMintBatch(_receiver, _amounts, _mintType);
  }

  // public presale purchase

  function allowlistPresalePurchase(uint256 _amount, bytes memory _signature)
    public payable virtual
    onlyUnsanctioned(msg.sender)
    whenNotPaused
    nonReentrant
    onlyLive
    validAllowlistPresalePurchase(msg.sender, _amount)
  {
    uint256 allowlistType = _isAllowlisted(msg.sender, _signature);
    if (allowlistType == 0) revert NotOnAllowlist(msg.sender);

    MintType mintType = _mapAllowlistTypeToMintType(allowlistType);

    _onPresalePurchase(msg.sender, _amount, mintType);
  }

  function oasisPresalePurchase(uint256 _amount)
    public payable virtual
    onlyUnsanctioned(msg.sender)
    whenNotPaused
    nonReentrant
    onlyLive
    validOasisPresalePurchase(msg.sender, msg.sender, _amount)
  {
    _onPresalePurchase(msg.sender, _amount, MintType.Oasis);
  }

  function oasisPresalePurchaseDelegated(uint256 _amount, address _vault)
    public payable virtual
    onlyUnsanctioned(msg.sender)
    whenNotPaused
    nonReentrant
    onlyLive
    onlyDelegated(_vault, address(oasis))
    validOasisPresalePurchase(msg.sender, _vault, _amount)
  {
    _onPresalePurchase(msg.sender, _amount, MintType.Oasis);
  }

  // public minting

  function allowlistMint(uint256 _amount, bytes memory _signature)
    public payable virtual
    onlyUnsanctioned(msg.sender)
    whenNotPaused
    nonReentrant
    onlyLive
    validAllowlistMint(msg.sender, _amount)
  {
    uint256 allowlistType = _isAllowlisted(msg.sender, _signature);
    if (allowlistType == 0) revert NotOnAllowlist(msg.sender);

    MintType mintType = _mapAllowlistTypeToMintType(allowlistType);

    uint256[] memory tokenIds = _mintMultiple(msg.sender, _amount);

    _onAllowlistMint(msg.sender, tokenIds, mintType);
  }

  function oasisMint(uint256 _amount)
    public payable virtual
    onlyUnsanctioned(msg.sender)
    whenNotPaused
    nonReentrant
    onlyLive
    validOasisMint(msg.sender, msg.sender, _amount)
  {
    uint256[] memory tokenIds = _mintMultiple(msg.sender, _amount);

    _onOasisMint(msg.sender, tokenIds);
  }

  function oasisMintDelegated(uint256 _amount, address _vault)
    public payable virtual
    onlyUnsanctioned(msg.sender)
    whenNotPaused
    nonReentrant
    onlyLive
    onlyDelegated(_vault, address(oasis))
    validOasisMint(msg.sender, _vault, _amount)
  {
    uint256[] memory tokenIds = _mintMultiple(msg.sender, _amount);

    _onOasisMintDelegated(msg.sender, _vault, tokenIds);
  }

  function publicSaleMint(uint256 _amount)
    public payable virtual
    onlyUnsanctioned(msg.sender)
    whenNotPaused
    nonReentrant
    onlyLive
    validPublicSaleMint(msg.sender, _amount)
  {
    uint256[] memory tokenIds = _mintMultiple(msg.sender, _amount);

    _onPublicSaleMint(msg.sender, tokenIds);
  }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (finance/PaymentSplitter.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/utils/SafeERC20.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";

/**
 * @title PaymentSplitter
 * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware
 * that the Ether will be split in this way, since it is handled transparently by the contract.
 *
 * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each
 * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim
 * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the
 * time of contract deployment and can't be updated thereafter.
 *
 * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the
 * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release}
 * function.
 *
 * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and
 * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you
 * to run tests before sending real value to this contract.
 */
contract PaymentSplitter is Context {
    event PayeeAdded(address account, uint256 shares);
    event PaymentReleased(address to, uint256 amount);
    event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount);
    event PaymentReceived(address from, uint256 amount);

    uint256 private _totalShares;
    uint256 private _totalReleased;

    mapping(address => uint256) private _shares;
    mapping(address => uint256) private _released;
    address[] private _payees;

    mapping(IERC20 => uint256) private _erc20TotalReleased;
    mapping(IERC20 => mapping(address => uint256)) private _erc20Released;

    /**
     * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at
     * the matching position in the `shares` array.
     *
     * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no
     * duplicates in `payees`.
     */
    constructor(address[] memory payees, uint256[] memory shares_) payable {
        require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch");
        require(payees.length > 0, "PaymentSplitter: no payees");

        for (uint256 i = 0; i < payees.length; i++) {
            _addPayee(payees[i], shares_[i]);
        }
    }

    /**
     * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully
     * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the
     * reliability of the events, and not the actual splitting of Ether.
     *
     * To learn more about this see the Solidity documentation for
     * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback
     * functions].
     */
    receive() external payable virtual {
        emit PaymentReceived(_msgSender(), msg.value);
    }

    /**
     * @dev Getter for the total shares held by payees.
     */
    function totalShares() public view returns (uint256) {
        return _totalShares;
    }

    /**
     * @dev Getter for the total amount of Ether already released.
     */
    function totalReleased() public view returns (uint256) {
        return _totalReleased;
    }

    /**
     * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20
     * contract.
     */
    function totalReleased(IERC20 token) public view returns (uint256) {
        return _erc20TotalReleased[token];
    }

    /**
     * @dev Getter for the amount of shares held by an account.
     */
    function shares(address account) public view returns (uint256) {
        return _shares[account];
    }

    /**
     * @dev Getter for the amount of Ether already released to a payee.
     */
    function released(address account) public view returns (uint256) {
        return _released[account];
    }

    /**
     * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an
     * IERC20 contract.
     */
    function released(IERC20 token, address account) public view returns (uint256) {
        return _erc20Released[token][account];
    }

    /**
     * @dev Getter for the address of the payee number `index`.
     */
    function payee(uint256 index) public view returns (address) {
        return _payees[index];
    }

    /**
     * @dev Getter for the amount of payee's releasable Ether.
     */
    function releasable(address account) public view returns (uint256) {
        uint256 totalReceived = address(this).balance + totalReleased();
        return _pendingPayment(account, totalReceived, released(account));
    }

    /**
     * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an
     * IERC20 contract.
     */
    function releasable(IERC20 token, address account) public view returns (uint256) {
        uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token);
        return _pendingPayment(account, totalReceived, released(token, account));
    }

    /**
     * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the
     * total shares and their previous withdrawals.
     */
    function release(address payable account) public virtual {
        require(_shares[account] > 0, "PaymentSplitter: account has no shares");

        uint256 payment = releasable(account);

        require(payment != 0, "PaymentSplitter: account is not due payment");

        // _totalReleased is the sum of all values in _released.
        // If "_totalReleased += payment" does not overflow, then "_released[account] += payment" cannot overflow.
        _totalReleased += payment;
        unchecked {
            _released[account] += payment;
        }

        Address.sendValue(account, payment);
        emit PaymentReleased(account, payment);
    }

    /**
     * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their
     * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20
     * contract.
     */
    function release(IERC20 token, address account) public virtual {
        require(_shares[account] > 0, "PaymentSplitter: account has no shares");

        uint256 payment = releasable(token, account);

        require(payment != 0, "PaymentSplitter: account is not due payment");

        // _erc20TotalReleased[token] is the sum of all values in _erc20Released[token].
        // If "_erc20TotalReleased[token] += payment" does not overflow, then "_erc20Released[token][account] += payment"
        // cannot overflow.
        _erc20TotalReleased[token] += payment;
        unchecked {
            _erc20Released[token][account] += payment;
        }

        SafeERC20.safeTransfer(token, account, payment);
        emit ERC20PaymentReleased(token, account, payment);
    }

    /**
     * @dev internal logic for computing the pending payment of an `account` given the token historical balances and
     * already released amounts.
     */
    function _pendingPayment(
        address account,
        uint256 totalReceived,
        uint256 alreadyReleased
    ) private view returns (uint256) {
        return (totalReceived * _shares[account]) / _totalShares - alreadyReleased;
    }

    /**
     * @dev Add a new payee to the contract.
     * @param account The address of the payee to add.
     * @param shares_ The number of shares owned by the payee.
     */
    function _addPayee(address account, uint256 shares_) private {
        require(account != address(0), "PaymentSplitter: account is the zero address");
        require(shares_ > 0, "PaymentSplitter: shares are 0");
        require(_shares[account] == 0, "PaymentSplitter: account already has shares");

        _payees.push(account);
        _shares[account] = shares_;
        _totalShares = _totalShares + shares_;
        emit PayeeAdded(account, shares_);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) external view returns (address receiver, uint256 royaltyAmount);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        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) {
        _requireMinted(tokenId);

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

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

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

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

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

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

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

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

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

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

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

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
     * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
     * that `ownerOf(tokenId)` is `a`.
     */
    // solhint-disable-next-line func-name-mixedcase
    function __unsafe_increaseBalance(address account, uint256 amount) internal {
        _balances[account] += amount;
    }
}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

File 14 of 32 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides a set of functions to operate with Base64 strings.
 *
 * _Available since v4.5._
 */
library Base64 {
    /**
     * @dev Base64 Encoding/Decoding Table
     */
    string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /**
     * @dev Converts a `bytes` to its Bytes64 `string` representation.
     */
    function encode(bytes memory data) internal pure returns (string memory) {
        /**
         * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
         */
        if (data.length == 0) return "";

        // Loads the table into memory
        string memory table = _TABLE;

        // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
        // and split into 4 numbers of 6 bits.
        // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
        // - `data.length + 2`  -> Round up
        // - `/ 3`              -> Number of 3-bytes chunks
        // - `4 *`              -> 4 characters for each chunk
        string memory result = new string(4 * ((data.length + 2) / 3));

        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the lookup table (skip the first "length" byte)
            let tablePtr := add(table, 1)

            // Prepare result pointer, jump over length
            let resultPtr := add(result, 32)

            // Run over the input, 3 bytes at a time
            for {
                let dataPtr := data
                let endPtr := add(data, mload(data))
            } lt(dataPtr, endPtr) {

            } {
                // Advance 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // To write each character, shift the 3 bytes (18 bits) chunk
                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)
                // and apply logical AND with 0x3F which is the number of
                // the previous character in the ASCII table prior to the Base64 Table
                // The result is then added to the table to get the character to write,
                // and finally write it in the result pointer but with a left shift
                // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits

                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance
            }

            // When data `bytes` is not exactly 3 bytes long
            // it is padded with `=` characters at the end
            switch mod(mload(data), 3)
            case 1 {
                mstore8(sub(resultPtr, 1), 0x3d)
                mstore8(sub(resultPtr, 2), 0x3d)
            }
            case 2 {
                mstore8(sub(resultPtr, 1), 0x3d)
            }
        }

        return result;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

    /**
     * @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) {
        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.
            /// @solidity memory-safe-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 {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

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

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

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

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

        // If 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 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @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 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

// SPDX-License-Identifier: GPL-3.0-or-later

// IOasis.sol - Simplified interface for the Oasis NFT contract

pragma solidity ^0.8.17;

interface IOasis {
    function balanceOf(address _address) external view returns (uint256);

    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
}

// SPDX-License-Identifier: GPL-3.0-or-later

// ISanctionsList.sol - Simplified interface for the SanctionsList contract

pragma solidity ^0.8.17;

interface ISanctionsList {
    function isSanctioned(address addr) external view returns (bool);
}

// SPDX-License-Identifier: GPL-3.0-or-later

// ░██╗░░░░░░░██╗░██╗░██╗░░░░░░██████╗░░██╗░░██╗░██╗░░░██╗░███████╗
// ░██║░░██╗░░██║░██║░██║░░░░░░██╔══██╗░╚██╗██╔╝░╚██╗░██╔╝░╚════██║
// ░╚██╗████╗██╔╝░██║░██║░░░░░░██║░░██║░░╚███╔╝░░░╚████╔╝░░░░███╔═╝
// ░░████╔═████║░░██║░██║░░░░░░██║░░██║░░██╔██╗░░░░╚██╔╝░░░██╔══╝░░
// ░░╚██╔╝░╚██╔╝░░██║░███████╗░██████╔╝░██╔╝╚██╗░░░░██║░░░░███████╗
// ░░░╚═╝░░░╚═╝░░░╚═╝░╚══════╝░╚═════╝░░╚═╝░░╚═╝░░░░╚═╝░░░░╚══════╝

pragma solidity ^0.8.17;

interface IDelegationRegistry {
  /** @notice Returns true if the address is delegated to act on your behalf for a token contract or an entire vault
   * @param delegate The hotwallet to act on your behalf
   * @param contract_ The address for the contract you're delegating
   * @param vault The cold wallet who issued the delegation
   */
  function checkDelegateForContract(address delegate, address vault, address contract_) external view returns (bool);
}

interface IWildXYZMinter {
  // enums

  /// @dev States for the minter
  enum State {
    Setup, // also "comingsoon"
    Live, // defer to phases for state name
    Complete, // also "soldout"
    Paused // temporary paused state
  }

  enum MintType {
    // DO NOT CHANGE ORDERING - APPEND ONLY
    // DO NOT CHANGE ORDERING, I WILL FIND YOU AND MAKE YOU PAY FOR YOUR SINS
    // DO NOT CHANGE ORDERING - APPEND ONLY

    // promo mint types
    Promo,
    CreditCard,
    WildPass,
    // groups
    Oasis,
    Allowlist,
    PublicSale,
    // artist
    ArtistAllowlist,
    // presale
    PresalePurchase,
    // not used
    // other
    Auction,
    Raffle,
    DutchAuction
  }

  // structs

  /// @dev Represents a minting group
  struct Group {
    string name;
    uint256 id;
    uint256 startTime;
    uint256 endTime;
    uint256 price;
  }

  struct MinterInfo {
    State minterState;
    uint256 maxSupply;
    uint256 totalSupply;
    uint256 maxPerOasis;
    uint256 maxPerAddress;
    address allowlistSigner;
    Group[] groups;
  }

  struct UserInfo {
    uint256 userGroupId;
    uint256 allowance;
    uint256 totalSupply;
    bool isGroupLive;
  }

  // events

  /** @notice Emitted when a new token is minted
   * @dev Generalized mint event, uses the mintType parameter to distinguish mint types
   * @param to - address of the token owner
   * @param tokenIds - token ID array
   * @param mintType - MintType enum
   * @param amountPaid - amount paid for the mint
   * @param isDelegated - whether or not the mint was delegated
   * @param delegatedVault - address of the delegated vault
   * @param oasisUsed - whether or not an Oasis pass was used. Can be true even if oasisIds is empty (ex. oasis price in public sale).
   * @param oasisIds - Oasis pass ID array (same index/length as tokenId). Empty if ids not specified.
   */
  event TokenMint(address indexed to, uint256[] tokenIds, MintType indexed mintType, uint256 amountPaid, bool isDelegated, address delegatedVault, bool oasisUsed, uint256[] oasisIds);

  // errors

  /// @notice Emitted when trying to call setup twice
  error AlreadySetup();

  /// @notice Emitted when not in live state
  error NotLive();

  /// @notice Emitted when not in complete state
  error NotComplete();

  /// @notice Emitted when group is not allowed to mint yet
  error GroupNotLive(uint256 _groupId);

  /// @notice Emitted when a non-admin tries to call an admin function
  error OnlyAdmin();

  /// @notice Emitted when given a zero address
  error ZeroAddress();

  /// @notice Emitted when given a zero amount
  error ZeroAmount();

  /// @notice Emitted when setting group start time to an invalid value
  error InvalidGroupStartTime(uint256 _startTime);

  /// @notice Emitted when a signature is invalid
  error InvalidSignature(bytes _signature);

  /// @notice Emitted when an OFAC sanctioned address tries to interact with a function
  error SanctionedAddress(address _to);

  /// @notice Emitted when a function is called by a non-delegated address
  error NotDelegated(address _sender, address _vault, address _contract);

  /// @notice Emitted when failing to withdraw to wallet
  error FailedToWithdraw(string _walletName, address _wallet);

  /// @notice Emitted when given a non-existing groupId
  error GroupDoesNotExist(uint256 _groupId);

  /// @notice Emitted when amount requested exceeds nft max supply
  error MaxSupplyExceeded();

  /// @notice Emitted when the value provided is not enough for the function
  error InsufficientFunds();

  /// @notice Emitted when two or more arrays do not match in size
  error ArraySizeMismatch();

  error NotEnoughOasisMints(address _receiver);
  error ZeroOasisAllowance(address _receiver);

  error FailedToMint(address _receiver);

  /// @notice Emitted when a user tries to mint too many toksns
  error MaxPerAddressExceeded(address _receiver, uint256 _amount);

  /// @notice Emitted when a non-admin or non-manager tries to call an admin or manager function
  error OnlyAdminOrManager();

  /// @notice Emitted when presaleMint function receives a non-presale mint type
  error InvalidPresaleMintType(MintType _mintType);

  /// @notice Emitted when presaleMint function fails to mint
  error FailedToPresaleMint(address _receiver, MintType _mintType);

  /// @notice Emitted when presaleMint function is called by a non-presale minter
  error OnlyPresaleMinterOrAdmin();
}

// SPDX-License-Identifier: GPL-3.0
// LICENSE
// This is a modified version of the original code from the
// NounsToken.sol— an implementation of OpenZeppelin's ERC-721:
// https://github.com/nounsDAO/nouns-monorepo/blob/master/packages/nouns-contracts/contracts/NounsToken.sol
// The original code is licensed under the GPL-3.0 license
// Thank you to the Nouns team for the inspiration and code!

pragma solidity ^0.8.6;

import {UpdatableOperatorFilterer} from 'operator-filter-registry/src/UpdatableOperatorFilterer.sol';
import {RevokableDefaultOperatorFilterer} from 'operator-filter-registry/src/RevokableDefaultOperatorFilterer.sol';

import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {Strings} from '@openzeppelin/contracts/utils/Strings.sol';
import {Base64} from '@openzeppelin/contracts/utils/Base64.sol';
import {Math} from '@openzeppelin/contracts/utils/math/Math.sol';

import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';

import {ERC2981} from '@openzeppelin/contracts/token/common/ERC2981.sol';

import {IERC165} from '@openzeppelin/contracts/utils/introspection/IERC165.sol';

import {PaymentSplitter} from '@openzeppelin/contracts/finance/PaymentSplitter.sol';

import {WildNFT} from './WildNFT.sol';

interface IWildNFT is IERC721 {
  event TokenCreated(uint256 indexed tokenId, address mintedTo);
  event TokenBurned(uint256 indexed tokenId);
  event MetadataUpdate(uint256 _tokenId);
  event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);

  function mint(address _to) external returns (uint256);

  function burn(uint256 tokenId) external;

  function setMinter(address minter) external;

  function setBaseURI(string memory _newBaseURI) external;

  function totalSupply() external view returns (uint256);

  function maxSupply() external view returns (uint256);
}

abstract contract WildNFT is IWildNFT, Ownable, RevokableDefaultOperatorFilterer, ERC721, ERC2981, PaymentSplitter {
  // An address who has permissions to mint qf tokens
  address public minter;

  // Mapping of operators to whether they are approved or not
  mapping(address => bool) public authorized;

  // Mapping of addresses flagged for denying token interactions
  mapping(address => bool) public blockList;
  uint256 public _currentTokenId;
  uint256 public maxSupply;
  string public baseURI;

  constructor(string memory name_, string memory symbol_, address _minter, uint256 _maxSupply, string memory _baseURI, address[] memory _payees, uint256[] memory _shares, uint96 _feeNumerator) PaymentSplitter(_payees, _shares) ERC721(name_, symbol_) {
    minter = _minter;
    maxSupply = _maxSupply;
    baseURI = _baseURI;
    _setDefaultRoyalty(address(this), _feeNumerator);
  }

  function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165, ERC2981) returns (bool) {
    return super.supportsInterface(interfaceId);
  }

  /**
   * @notice Require that the sender is the minter.
   */
  modifier onlyMinter() {
    require(msg.sender == minter, 'Sender is not the minter');
    _;
  }

  /**
   * @notice updates the deny list
   * @param flaggedOperator the address to be added to the deny list
   * @param status whether the address is to be added or removed from the deny list
   */
  function updateDenyList(address flaggedOperator, bool status) public onlyOwner {
    _updateDenyList(flaggedOperator, status);
  }

  /*
   * @notice Override isApprovedForAll
   * @param owner The owner of the Nouns
   * @param operator The operator to check if approved
   */
  function isApprovedForAll(address _owner, address operator) public view override(IERC721, ERC721) returns (bool) {
    require(blockList[operator] == false, 'Operator has been denied by contract owner.');

    if (authorized[operator] == true) {
      return true;
    }

    return super.isApprovedForAll(_owner, operator);
  }

  /* OS */
  function setApprovalForAll(address operator, bool approved) public override(IERC721, ERC721) onlyAllowedOperatorApproval(operator) {
    super.setApprovalForAll(operator, approved);
  }

  function approve(address operator, uint256 tokenId) public override(IERC721, ERC721) onlyAllowedOperatorApproval(operator) {
    super.approve(operator, tokenId);
  }

  function transferFrom(address from, address to, uint256 tokenId) public override(IERC721, ERC721) onlyAllowedOperator(from) {
    super.transferFrom(from, to, tokenId);
  }

  function safeTransferFrom(address from, address to, uint256 tokenId) public override(IERC721, ERC721) onlyAllowedOperator(from) {
    super.safeTransferFrom(from, to, tokenId);
  }

  function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override(IERC721, ERC721) onlyAllowedOperator(from) {
    super.safeTransferFrom(from, to, tokenId, data);
  }

  function owner() public view virtual override(Ownable, UpdatableOperatorFilterer) returns (address) {
    return Ownable.owner();
  }

  /**
   * @notice sets the authorized operators for interacting with the contract
   * @param operator the address to be added to the authorized operators
   * @param approved whether the address is approved or not within authorized operators
   */
  function setAuthorized(address operator, bool approved) public onlyOwner {
    authorized[operator] = approved;
  }

  /**
   * @notice Set the token minter.
   * @dev Only callable by the owner when not locked.
   * @param _minter The address of the new minter.
   */
  function setMinter(address _minter) external onlyOwner {
    minter = _minter;
  }

  /**
   * @notice updates the deny list
   * @param flaggedOperator The address to be approved.
   * @param status True if the operator is approved, false to revoke approval.
   */
  function _updateDenyList(address flaggedOperator, bool status) internal virtual {
    blockList[flaggedOperator] = status;
  }

  /**
   * @notice Mint a token to the given address.
   * @dev Only callable by the minter.
   * @param _to The address to mint the qf token to.
   * @return The ID of the newly minted qf token.
   */
  function mint(address _to) public override onlyMinter returns (uint256) {
    require(_currentTokenId < maxSupply, 'Max supply reached');
    return _mintTo(_to, _currentTokenId++);
  }

  /**
   * @notice Burn a pass.
   * @dev Only callable by the minter.
   * @param tokenId The ID of the qf token to burn.
   */
  function burn(uint256 tokenId) public override onlyMinter {
    _burn(tokenId);
    emit TokenBurned(tokenId);
  }

  /**
   * @notice Set the base URI.
   * @dev Only callable by the owner.
   * @param _newBaseURI The new base URI.
   */
  function setBaseURI(string memory _newBaseURI) public onlyOwner {
    baseURI = _newBaseURI;
    emit BatchMetadataUpdate(0, maxSupply - 1);
  }

  /// @notice Identical to setBaseURI but callable by minter only.
  function setBaseURIMinter(string memory _newBaseURI) public onlyMinter {
    baseURI = _newBaseURI;
    emit BatchMetadataUpdate(0, maxSupply - 1);
  }

  /** @notice Mints a new token
   * @param to: the address of the new owner looking to mint
   * @param tokenId: the token ID
   * @return the ID of the newly minted token
   */
  function _mintTo(address to, uint256 tokenId) internal returns (uint256) {
    _mint(to, tokenId);
    emit TokenCreated(tokenId, to);

    return tokenId;
  }

  function totalSupply() public view returns (uint256) {
    return _currentTokenId;
  }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    /**
     * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
     *         true if supplied registrant address is not registered.
     */
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);

    /**
     * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
     */
    function register(address registrant) external;

    /**
     * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
     */
    function registerAndSubscribe(address registrant, address subscription) external;

    /**
     * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
     *         address without subscribing.
     */
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;

    /**
     * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
     *         Note that this does not remove any filtered addresses or codeHashes.
     *         Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
     */
    function unregister(address addr) external;

    /**
     * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
     */
    function updateOperator(address registrant, address operator, bool filtered) external;

    /**
     * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
     */
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;

    /**
     * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
     */
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;

    /**
     * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
     */
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;

    /**
     * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
     *         subscription if present.
     *         Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
     *         subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
     *         used.
     */
    function subscribe(address registrant, address registrantToSubscribe) external;

    /**
     * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
     */
    function unsubscribe(address registrant, bool copyExistingEntries) external;

    /**
     * @notice Get the subscription address of a given registrant, if any.
     */
    function subscriptionOf(address addr) external returns (address registrant);

    /**
     * @notice Get the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscribers(address registrant) external returns (address[] memory);

    /**
     * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscriberAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
     */
    function copyEntriesOf(address registrant, address registrantToCopy) external;

    /**
     * @notice Returns true if operator is filtered by a given address or its subscription.
     */
    function isOperatorFiltered(address registrant, address operator) external returns (bool);

    /**
     * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
     */
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);

    /**
     * @notice Returns true if a codeHash is filtered by a given address or its subscription.
     */
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);

    /**
     * @notice Returns a list of filtered operators for a given address or its subscription.
     */
    function filteredOperators(address addr) external returns (address[] memory);

    /**
     * @notice Returns the set of filtered codeHashes for a given address or its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);

    /**
     * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);

    /**
     * @notice Returns true if an address has registered
     */
    function isRegistered(address addr) external returns (bool);

    /**
     * @dev Convenience method to compute the code hash of an arbitrary contract
     */
    function codeHashOf(address addr) external returns (bytes32);
}

File 29 of 32 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;

File 30 of 32 : RevokableDefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {RevokableOperatorFilterer} from "./RevokableOperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION, CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
/**
 * @title  RevokableDefaultOperatorFilterer
 * @notice Inherits from RevokableOperatorFilterer and automatically subscribes to the default OpenSea subscription.
 *         Note that OpenSea will disable creator earnings enforcement if filtered operators begin fulfilling orders
 *         on-chain, eg, if the registry is revoked or bypassed.
 */

abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer {
    /// @dev The constructor that is called when the contract is being deployed.
    constructor()
        RevokableOperatorFilterer(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS, CANONICAL_CORI_SUBSCRIPTION, true)
    {}
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {UpdatableOperatorFilterer} from "./UpdatableOperatorFilterer.sol";
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";

/**
 * @title  RevokableOperatorFilterer
 * @notice This contract is meant to allow contracts to permanently skip OperatorFilterRegistry checks if desired. The
 *         Registry itself has an "unregister" function, but if the contract is ownable, the owner can re-register at
 *         any point. As implemented, this abstract contract allows the contract owner to permanently skip the
 *         OperatorFilterRegistry checks by calling revokeOperatorFilterRegistry. Once done, the registry
 *         address cannot be further updated.
 *         Note that OpenSea will still disable creator earnings enforcement if filtered operators begin fulfilling orders
 *         on-chain, eg, if the registry is revoked or bypassed.
 */
abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer {
    /// @dev Emitted when the registry has already been revoked.
    error RegistryHasBeenRevoked();
    /// @dev Emitted when the initial registry address is attempted to be set to the zero address.
    error InitialRegistryAddressCannotBeZeroAddress();

    event OperatorFilterRegistryRevoked();

    bool public isOperatorFilterRegistryRevoked;

    /// @dev The constructor that is called when the contract is being deployed.
    constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe)
        UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe)
    {
        // don't allow creating a contract with a permanently revoked registry
        if (_registry == address(0)) {
            revert InitialRegistryAddressCannotBeZeroAddress();
        }
    }

    /**
     * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero
     *         address, checks will be permanently bypassed, and the address cannot be updated again. OnlyOwner.
     */
    function updateOperatorFilterRegistryAddress(address newRegistry) public override {
        if (msg.sender != owner()) {
            revert OnlyOwner();
        }
        // if registry has been revoked, do not allow further updates
        if (isOperatorFilterRegistryRevoked) {
            revert RegistryHasBeenRevoked();
        }

        operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
        emit OperatorFilterRegistryAddressUpdated(newRegistry);
    }

    /**
     * @notice Revoke the OperatorFilterRegistry address, permanently bypassing checks. OnlyOwner.
     */
    function revokeOperatorFilterRegistry() public {
        if (msg.sender != owner()) {
            revert OnlyOwner();
        }
        // if registry has been revoked, do not allow further updates
        if (isOperatorFilterRegistryRevoked) {
            revert RegistryHasBeenRevoked();
        }

        // set to zero address to bypass checks
        operatorFilterRegistry = IOperatorFilterRegistry(address(0));
        isOperatorFilterRegistryRevoked = true;
        emit OperatorFilterRegistryRevoked();
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @title  UpdatableOperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry. This contract allows the Owner to update the
 *         OperatorFilterRegistry address via updateOperatorFilterRegistryAddress, including to the zero address,
 *         which will bypass registry checks.
 *         Note that OpenSea will still disable creator earnings enforcement if filtered operators begin fulfilling orders
 *         on-chain, eg, if the registry is revoked or bypassed.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract UpdatableOperatorFilterer {
    /// @dev Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);
    /// @dev Emitted when someone other than the owner is trying to call an only owner function.
    error OnlyOwner();

    event OperatorFilterRegistryAddressUpdated(address newRegistry);

    IOperatorFilterRegistry public operatorFilterRegistry;

    /// @dev The constructor that is called when the contract is being deployed.
    constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) {
        IOperatorFilterRegistry registry = IOperatorFilterRegistry(_registry);
        operatorFilterRegistry = registry;
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(registry).code.length > 0) {
            if (subscribe) {
                registry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    registry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    registry.register(address(this));
                }
            }
        }
    }

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    /**
     * @dev A helper function to check if the operator approval is allowed.
     */
    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    /**
     * @notice Update the address that the contract will make OperatorFilter checks against. When set to the zero
     *         address, checks will be bypassed. OnlyOwner.
     */
    function updateOperatorFilterRegistryAddress(address newRegistry) public virtual {
        if (msg.sender != owner()) {
            revert OnlyOwner();
        }
        operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
        emit OperatorFilterRegistryAddressUpdated(newRegistry);
    }

    /**
     * @dev Assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract.
     */
    function owner() public view virtual returns (address);

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        IOperatorFilterRegistry registry = operatorFilterRegistry;
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(registry) != address(0) && address(registry).code.length > 0) {
            // under normal circumstances, this function will revert rather than return false, but inheriting contracts
            // may specify their own OperatorFilterRegistry implementations, which may behave differently
            if (!registry.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_wildRoyalty","type":"uint256"},{"internalType":"address","name":"_wildWallet","type":"address"},{"internalType":"address","name":"_artistWallet","type":"address"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"contract ISanctionsList","name":"_sanctions","type":"address"},{"internalType":"contract WildNFT","name":"_nft","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyProcessedPresalePurchase","type":"error"},{"inputs":[],"name":"AlreadySetup","type":"error"},{"inputs":[],"name":"ArraySizeMismatch","type":"error"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"FailedToMint","type":"error"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"enum IWildXYZMinter.MintType","name":"_mintType","type":"uint8"}],"name":"FailedToPresaleMint","type":"error"},{"inputs":[{"internalType":"string","name":"_walletName","type":"string"},{"internalType":"address","name":"_wallet","type":"address"}],"name":"FailedToWithdraw","type":"error"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"}],"name":"GroupDoesNotExist","type":"error"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"}],"name":"GroupNotLive","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidAllowlistType","type":"error"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"InvalidGroupStartTime","type":"error"},{"inputs":[{"internalType":"enum IWildXYZMinter.MintType","name":"_mintType","type":"uint8"}],"name":"InvalidPresaleMintType","type":"error"},{"inputs":[{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"MaxPerAddressExceeded","type":"error"},{"inputs":[],"name":"MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"NotComplete","type":"error"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_contract","type":"address"}],"name":"NotDelegated","type":"error"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"NotEnoughOasisMints","type":"error"},{"inputs":[],"name":"NotLive","type":"error"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"NotOnAllowlist","type":"error"},{"inputs":[],"name":"OnlyAdmin","type":"error"},{"inputs":[],"name":"OnlyAdminOrManager","type":"error"},{"inputs":[],"name":"OnlyPresaleMinterOrAdmin","type":"error"},{"inputs":[],"name":"PresalePurchaseNotFound","type":"error"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"SanctionedAddress","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"ZeroOasisAllowance","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"enum IWildXYZMinter.MintType","name":"mintType","type":"uint8"}],"name":"PresalePurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"PresalePurchaseProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":true,"internalType":"enum IWildXYZMinter.MintType","name":"mintType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"amountPaid","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isDelegated","type":"bool"},{"indexed":false,"internalType":"address","name":"delegatedVault","type":"address"},{"indexed":false,"internalType":"bool","name":"oasisUsed","type":"bool"},{"indexed":false,"internalType":"uint256[]","name":"oasisIds","type":"uint256[]"}],"name":"TokenMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"}],"name":"addAllowlistedNFTAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"addressTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"allowlistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"allowlistPresalePurchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"artistWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delegationRegistry","outputs":[{"internalType":"contract IDelegationRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"}],"name":"getGroup","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IWildXYZMinter.Group","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"}],"name":"getGroupEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"}],"name":"getGroupPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"}],"name":"getGroupStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGroups","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IWildXYZMinter.Group[]","name":"_groups","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinterInfo","outputs":[{"components":[{"internalType":"enum IWildXYZMinter.State","name":"minterState","type":"uint8"},{"internalType":"bool","name":"isPresaleLive","type":"bool"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"presaleMaxSupply","type":"uint256"},{"internalType":"uint256","name":"presaleTotalSupply","type":"uint256"},{"internalType":"uint256","name":"maxPerOasis","type":"uint256"},{"internalType":"uint256","name":"maxPerAddress","type":"uint256"},{"internalType":"address","name":"allowlistSigner","type":"address"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IWildXYZMinter.Group[]","name":"groups","type":"tuple[]"}],"internalType":"struct WildXYZMinterPresale.PresaleMinterInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getState","outputs":[{"internalType":"enum IWildXYZMinter.State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"getUserGroup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"}],"name":"getUserGroupAllowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_groupId","type":"uint256"}],"name":"getUserGroupTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"getUserInfo","outputs":[{"components":[{"internalType":"uint256","name":"userGroupId","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"bool","name":"isGroupLive","type":"bool"}],"internalType":"struct IWildXYZMinter.UserInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"getUserMinterInfo","outputs":[{"components":[{"internalType":"uint256","name":"userGroupId","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"bool","name":"isGroupLive","type":"bool"}],"internalType":"struct IWildXYZMinter.UserInfo","name":"userInfo","type":"tuple"},{"components":[{"internalType":"enum IWildXYZMinter.State","name":"minterState","type":"uint8"},{"internalType":"bool","name":"isPresaleLive","type":"bool"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"presaleMaxSupply","type":"uint256"},{"internalType":"uint256","name":"presaleTotalSupply","type":"uint256"},{"internalType":"uint256","name":"maxPerOasis","type":"uint256"},{"internalType":"uint256","name":"maxPerAddress","type":"uint256"},{"internalType":"address","name":"allowlistSigner","type":"address"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IWildXYZMinter.Group[]","name":"groups","type":"tuple[]"}],"internalType":"struct WildXYZMinterPresale.PresaleMinterInfo","name":"minterInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"groupIdAllowlist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"groupIdOasis","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"groupIdPublicSale","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"contract WildNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numAllowlistedERC721Addresses","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numPresaleMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numPresalePurchaseOwners","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oasis","outputs":[{"internalType":"contract IOasis","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"oasisMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_vault","type":"address"}],"name":"oasisMintDelegated","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"oasisPresalePurchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_vault","type":"address"}],"name":"oasisPresalePurchaseDelegated","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleGroupIdAllowlist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleGroupIdOasis","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"presalePurchaseInfo","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bool","name":"processed","type":"bool"},{"internalType":"uint256","name":"amountProcessed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"presalePurchaseOwners","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"processPresaleMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromIndex","type":"uint256"},{"internalType":"uint256","name":"_toIndex","type":"uint256"}],"name":"processPresaleMintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"enum IWildXYZMinter.MintType","name":"_mintType","type":"uint8"}],"name":"promoMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_receiver","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"enum IWildXYZMinter.MintType","name":"_mintType","type":"uint8"}],"name":"promoMintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"promoMintTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"publicSaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"}],"name":"removeAllowlistedNFTAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sanctionsList","outputs":[{"internalType":"contract ISanctionsList","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adminSigner","type":"address"}],"name":"setAdminSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegationRegistry","type":"address"}],"name":"setDelegationRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setGroupEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setGroupPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_groupId","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"setGroupStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPerAddress","type":"uint256"}],"name":"setMaxPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_presaleEndTime","type":"uint256"}],"name":"setPresaleEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_presaleStartTime","type":"uint256"}],"name":"setPresaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[2]","name":"_startTimes","type":"uint256[2]"},{"internalType":"uint256","name":"_salePrice","type":"uint256"},{"internalType":"uint256","name":"_presaleMaxSupply","type":"uint256"},{"internalType":"uint256","name":"_presaleStartTime","type":"uint256"},{"internalType":"uint256","name":"_presaleEndTime","type":"uint256"},{"internalType":"uint256","name":"_presalePrice","type":"uint256"},{"internalType":"uint256","name":"_maxPerAddress","type":"uint256"},{"internalType":"address","name":"_allowlistSigner","type":"address"},{"internalType":"contract IOasis","name":"_oasis","type":"address"},{"internalType":"address[]","name":"_allowlistedERC721Addresses","type":"address[]"}],"name":"setupMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verifySignature","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wildRoyalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wildWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawToOwner","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526004805460ff191690556064601255601980546001600160a01b0319166d76a84fef008cdabe6409d2fe638b1790556000601b553480156200004557600080fd5b50604051620045913803806200459183398101604081905262000068916200015c565b6200007333620000f3565b6000805460ff60a01b1916905560018055601096909655601194909455601380546001600160a01b03199081166001600160a01b03958616179091556014805482169385169390931790925560158054831691841691909117905560178054821693831693909317909255601680549092169216919091179055620001ef565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200015957600080fd5b50565b600080600080600080600060e0888a0312156200017857600080fd5b87519650602088015195506040880151620001938162000143565b6060890151909550620001a68162000143565b6080890151909450620001b98162000143565b60a0890151909350620001cc8162000143565b60c0890151909250620001df8162000143565b8091505092959891949750929550565b61439280620001ff6000396000f3fe6080604052600436106104105760003560e01c80638456cb591161021e578063c726699111610123578063dd6d1cd1116100ab578063ed7fb65e1161007a578063ed7fb65e14610c0d578063ee039b9114610c23578063f2fde38b14610c39578063f851a44014610c59578063ff9d2dcc14610c7957600080fd5b8063dd6d1cd114610b97578063e85a741714610bb7578063eb60679d14610bcd578063ec571c6a14610bed57600080fd5b8063cdd5bcc2116100f2578063cdd5bcc214610af4578063ceb6065414610b14578063cfa0136f14610b41578063d533f8bc14610b61578063d5abeb0114610b8157600080fd5b8063c726699114610a7f578063c72b517614610a9f578063cc0e5d0f14610ac1578063cc4070fd14610ae157600080fd5b8063a7edaabe116101a6578063b79eb83f11610175578063b79eb83f14610a0a578063b975629d14610a2a578063bd9e3c1514610a40578063bebbc6bc14610a56578063c3e0405014610a6c57600080fd5b8063a7edaabe146109a9578063a82524b2146109bf578063b0934e5d146109d5578063b3ab66b0146109f757600080fd5b80639b5b8473116101ed5780639b5b8473146108fc5780639e42eb441461091c578063a3342fba14610949578063a3afda1a14610969578063a6745cb21461098957600080fd5b80638456cb591461081e57806386035738146108335780638da5cb5b146108535780639ad811a01461087157600080fd5b8063333cc17611610324578063639814e0116102ac578063785db5f41161027b578063785db5f4146107855780637892c2bb1461079b5780637bddd65b146107bb5780637bec780a146107db578063838459d41461080857600080fd5b8063639814e01461071a5780636cbb8f4d14610730578063715018a61461075057806373aa9e941461076557600080fd5b80633f4ba83a116102f35780633f4ba83a1461068657806347ccca021461069b5780635b1f3382146106bb5780635b79e140146106db5780635c975abb146106fb57600080fd5b8063333cc1761461061c5780633cb40e161461063c5780633ccfd60b146106515780633e8eef511461066657600080fd5b80631a1bc0dc116103a7578063249b7c1911610376578063249b7c1914610575578063258c1ef51461058b578063281f80f0146105bb578063291132a0146105e9578063296cab55146105fc57600080fd5b80631a1bc0dc146105165780631fbdd72d1461052c578063200b568a1461054c57806320ab3cb01461056257600080fd5b806316e577ab116103e357806316e577ab14610489578063183bbe801461049c5780631865c57d146104bc5780631a1687b8146104de57600080fd5b8063055da0f11461041557806308fc299b1461043e5780630f562b481461045457806315c8f10614610474575b600080fd5b34801561042157600080fd5b5061042b600f5481565b6040519081526020015b60405180910390f35b34801561044a57600080fd5b5061042b60065481565b34801561046057600080fd5b5061042b61046f3660046138ec565b610c99565b6104876104823660046139e5565b610cc1565b005b6104876104973660046138ec565b610e1b565b3480156104a857600080fd5b506104876104b7366004613a51565b610f31565b3480156104c857600080fd5b506104d1610f8f565b6040516104359190613a98565b3480156104ea57600080fd5b506104fe6104f93660046138ec565b610ffb565b6040516001600160a01b039091168152602001610435565b34801561052257600080fd5b5061042b60085481565b34801561053857600080fd5b506019546104fe906001600160a01b031681565b34801561055857600080fd5b5061042b60125481565b6104876105703660046138ec565b611025565b34801561058157600080fd5b5061042b600a5481565b34801561059757600080fd5b506105ab6105a6366004613aa6565b61112a565b6040519015158152602001610435565b3480156105c757600080fd5b506105db6105d6366004613aa6565b6111fb565b604051610435929190613c4d565b6104876105f73660046139e5565b61124d565b34801561060857600080fd5b506104876106173660046138ec565b61138e565b34801561062857600080fd5b5061042b610637366004613aa6565b6113e3565b34801561064857600080fd5b506104876114b5565b34801561065d57600080fd5b5061048761153e565b34801561067257600080fd5b506104876106813660046138ec565b611550565b34801561069257600080fd5b50610487611708565b3480156106a757600080fd5b506016546104fe906001600160a01b031681565b3480156106c757600080fd5b506013546104fe906001600160a01b031681565b3480156106e757600080fd5b5061042b6106f6366004613c8f565b61173b565b34801561070757600080fd5b50600054600160a01b900460ff166105ab565b34801561072657600080fd5b5061042b601c5481565b34801561073c57600080fd5b5061048761074b366004613a51565b61178c565b34801561075c57600080fd5b506104876117e3565b34801561077157600080fd5b50610487610780366004613a51565b6117f5565b34801561079157600080fd5b5061042b60075481565b3480156107a757600080fd5b506104876107b6366004613cbb565b611842565b3480156107c757600080fd5b506104876107d63660046138ec565b61188f565b3480156107e757600080fd5b5061042b6107f6366004613a51565b60226020526000908152604090205481565b34801561081457600080fd5b5061042b601f5481565b34801561082a57600080fd5b506104876118bf565b34801561083f57600080fd5b5061048761084e366004613cbb565b6118f2565b34801561085f57600080fd5b506000546001600160a01b03166104fe565b34801561087d57600080fd5b506108c861088c366004613a51565b600d60205260009081526040902080546001820154600283015460038401546004909401546001600160a01b03909316939192909160ff169085565b604080516001600160a01b03909616865260208601949094529284019190915215156060830152608082015260a001610435565b34801561090857600080fd5b50610487610917366004613cbb565b611948565b34801561092857600080fd5b5061093c610937366004613aa6565b611975565b6040516104359190613cdd565b34801561095557600080fd5b506014546104fe906001600160a01b031681565b34801561097557600080fd5b506018546104fe906001600160a01b031681565b34801561099557600080fd5b506104876109a4366004613cbb565b6119f3565b3480156109b557600080fd5b5061042b600c5481565b3480156109cb57600080fd5b5061042b60095481565b3480156109e157600080fd5b506109ea611a3e565b6040516104359190613d0a565b610487610a053660046138ec565b611c60565b348015610a1657600080fd5b5061042b610a253660046138ec565b611d63565b348015610a3657600080fd5b5061042b601e5481565b348015610a4c57600080fd5b5061042b601b5481565b348015610a6257600080fd5b5061042b60115481565b610487610a7a366004613d1d565b611d86565b348015610a8b57600080fd5b50610487610a9a366004613a51565b611f1e565b348015610aab57600080fd5b50610ab4611f81565b6040516104359190613d4d565b348015610acd57600080fd5b50610487610adc366004613df8565b612117565b610487610aef366004613d1d565b6122fd565b348015610b0057600080fd5b50610487610b0f366004613eec565b6124b1565b348015610b2057600080fd5b50610b34610b2f3660046138ec565b6124f7565b6040516104359190613f2a565b348015610b4d57600080fd5b50610487610b5c3660046138ec565b61260d565b348015610b6d57600080fd5b5061042b610b7c3660046138ec565b612662565b348015610b8d57600080fd5b5061042b60105481565b348015610ba357600080fd5b50610487610bb2366004613f3d565b612685565b348015610bc357600080fd5b5061042b601d5481565b348015610bd957600080fd5b5061042b610be83660046138ec565b6126bb565b348015610bf957600080fd5b506017546104fe906001600160a01b031681565b348015610c1957600080fd5b5061042b600b5481565b348015610c2f57600080fd5b5061042b60215481565b348015610c4557600080fd5b50610487610c54366004613a51565b612739565b348015610c6557600080fd5b506015546104fe906001600160a01b031681565b348015610c8557600080fd5b50601a546104fe906001600160a01b031681565b600081610ca5816127af565b6000838152600260208190526040909120015491505b50919050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015610d0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2e9190613fff565b15610d5c57604051638027911160e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610d646127d4565b610d6c612821565b6001610d76610f8f565b6003811115610d8757610d87613a6e565b14610da55760405163baf13b3f60e01b815260040160405180910390fd5b3383610db1828261287a565b6000610dbd3386612886565b905080600003610de257604051636048a6a360e11b8152336004820152602401610d53565b6000610ded82612965565b90506000610dfb33896129a0565b9050610e08338284612a9d565b5050505050610e1660018055565b505050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015610e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e889190613fff565b15610eb157604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b610eb96127d4565b610ec1612821565b6001610ecb610f8f565b6003811115610edc57610edc613a6e565b14610efa5760405163baf13b3f60e01b815260040160405180910390fd5b333383610f08838383612b24565b6000610f1433876129a0565b9050610f203382612bc9565b50505050610f2d60018055565b5050565b6015546001600160a01b03163314610f5c57604051634755657960e01b815260040160405180910390fd5b6001600160a01b038116610f835760405163d92e233d60e01b815260040160405180910390fd5b610f8c81612c40565b50565b60008054600160a01b900460ff1615610fa85750600390565b601054610fb3612c62565b03610fbe5750600290565b60005b600354811015610ff357610fd481612cd5565b15610fe157600191505090565b80610feb81614037565b915050610fc1565b506000905090565b600e818154811061100b57600080fd5b6000918252602090912001546001600160a01b0316905081565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa15801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190613fff565b156110bb57604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b6110c36127d4565b6110cb612821565b60016110d5610f8f565b60038111156110e6576110e6613a6e565b146111045760405163baf13b3f60e01b815260040160405180910390fd5b333383611112838383612d22565b61111e33866003612dc7565b505050610f2d60018055565b600081516041036111f1576040516bffffffffffffffffffffffff19606085811b8216602084015230901b16603482015260009060480160405160208183030381529060405280519060200120905060006111b2827f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905060006111c08286612eee565b90506001600160a01b038116158015906111e75750601a546001600160a01b038281169116145b93505050506111f5565b5060005b92915050565b61122860405180608001604052806000815260200160008152602001600081526020016000151581525090565b61123061388d565b61123a8484611975565b9150611244611a3e565b90509250929050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015611296573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ba9190613fff565b156112e357604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b6112eb6127d4565b6112f3612821565b60016112fd610f8f565b600381111561130e5761130e613a6e565b1461132c5760405163baf13b3f60e01b815260040160405180910390fd5b33836113388282612f12565b60006113443386612886565b90508060000361136957604051636048a6a360e11b8152336004820152602401610d53565b600061137482612965565b9050611381338883612dc7565b50505050610e1660018055565b6015546001600160a01b031633146113b957604051634755657960e01b815260040160405180910390fd5b6009819055600b5460009081526002602081905260408083208201849055600c5483529091200155565b6000806113ee612f1e565b6018546040516370a0823160e01b81526001600160a01b038781166004830152929350600092909116906370a0823190602401602060405180830381865afa15801561143e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114629190614050565b1115611481578061147557601d54611479565b600b545b9150506111f5565b600061148d8585612886565b11156114aa57806114a057601e54611479565b5050600c546111f5565b5050601f5492915050565b6114bd612f36565b6013546040516000916001600160a01b03169047908381818185875af1925050503d806000811461150a576040519150601f19603f3d011682016040523d82523d6000602084013e61150f565b606091505b5050905080610f8c5760135460405163ba5c362160e01b8152610d53916001600160a01b031690600401614069565b611546612f36565b61154e612f90565b565b611558612f36565b6000600e828154811061156d5761156d614098565b60009182526020808320909101546001600160a01b0316808352600d90915260409091206003015490915060ff16156115b9576040516329eef5b760e21b815260040160405180910390fd5b6001600160a01b0381166000908152600d60205260408120600481015460018201549192916115f4916014916115ef91906140ae565b6130d7565b9050600061160284836129a0565b9050836001600160a01b03167fb31abcda30cad16a8d7bf60f1b5103785402230df64197ed1195a699221ee4a18260405161163d91906140fc565b60405180910390a2600760028401546001600160a01b0386169060008051602061433d8339815191529084906000808080604051908082528060200260200182016040528015611697578160200160208202803683370190505b506040516116aa9695949392919061410f565b60405180910390a3818360040160008282546116c69190614167565b909155505060018301546004840154036116ea5760038301805460ff191660011790555b81600860008282546116fc9190614167565b90915550505050505050565b6015546001600160a01b0316331461173357604051634755657960e01b815260040160405180910390fd5b61154e6130ed565b600061174682613142565b1561176d57506001600160a01b0382166000908152600d60205260409020600101546111f5565b506001600160a01b0382166000908152602260205260409020546111f5565b611794612f36565b602180548291602091600091826117aa83614037565b91905055815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050565b6117eb612f36565b61154e6000613157565b6015546001600160a01b0316331461182057604051634755657960e01b815260040160405180910390fd5b601980546001600160a01b0319166001600160a01b0392909216919091179055565b8161184c816127af565b6015546001600160a01b0316331461187757604051634755657960e01b815260040160405180910390fd5b50600091825260026020819052604090922090910155565b6015546001600160a01b031633146118ba57604051634755657960e01b815260040160405180910390fd5b601c55565b6015546001600160a01b031633146118ea57604051634755657960e01b815260040160405180910390fd5b61154e6131a7565b816118fc816127af565b81611906816131ea565b6015546001600160a01b0316331461193157604051634755657960e01b815260040160405180910390fd5b505060009182526002602052604090912060040155565b611950612f36565b815b81811015610e165761196381611550565b8061196d81614037565b915050611952565b6119a260405180608001604052806000815260200160008152602001600081526020016000151581525090565b60006119ae84846113e3565b905060405180608001604052808281526020016119ca836126bb565b81526020016119d9868461173b565b81526020016119e783612cd5565b15159052949350505050565b816119fd816127af565b6015546001600160a01b03163314611a2857604051634755657960e01b815260040160405180910390fd5b5060009182526002602052604090912060030155565b611a4661388d565b600060035467ffffffffffffffff811115611a6357611a63613905565b604051908082528060200260200182016040528015611ac657816020015b611ab36040518060a0016040528060608152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611a815790505b50905060005b600354811015611bd85760008181526002602052604090819020815160a08101909252805482908290611afe9061417a565b80601f0160208091040260200160405190810160405280929190818152602001828054611b2a9061417a565b8015611b775780601f10611b4c57610100808354040283529160200191611b77565b820191906000526020600020905b815481529060010190602001808311611b5a57829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481525050828281518110611bba57611bba614098565b60200260200101819052508080611bd090614037565b915050611acc565b50604051806101400160405280611bed610f8f565b6003811115611bfe57611bfe613a6e565b8152602001611c0b612f1e565b151581526020016010548152602001611c22612c62565b815260065460208201526007546040820152601c54606082018190526080820152601a546001600160a01b031660a082015260c00191909152919050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015611ca9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccd9190613fff565b15611cf657604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b611cfe6127d4565b611d06612821565b6001611d10610f8f565b6003811115611d2157611d21613a6e565b14611d3f5760405163baf13b3f60e01b815260040160405180910390fd5b3382611d4b828261320c565b6000611d5733866129a0565b905061111e3382613218565b600081611d6f816127af565b505060009081526002602052604090206004015490565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015611dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df39190613fff565b15611e1c57604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b611e246127d4565b611e2c612821565b6001611e36610f8f565b6003811115611e4757611e47613a6e565b14611e655760405163baf13b3f60e01b815260040160405180910390fd5b60185460195460405163090c9a2d60e41b815284926001600160a01b039081169216906390c9a2d090611ea0903390869086906004016141ae565b602060405180830381865afa158015611ebd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee19190613fff565b611f045733828260405163bdca17b360e01b8152600401610d53939291906141ae565b338486611f12838383612d22565b610e0833896003612dc7565b611f26612f36565b60005b602154811015610f2d5760008181526020805260409020546001600160a01b03808416911603611f6f576000818152602080526040902080546001600160a01b03191690555b80611f7981614037565b915050611f29565b606060035467ffffffffffffffff811115611f9e57611f9e613905565b60405190808252806020026020018201604052801561200157816020015b611fee6040518060a0016040528060608152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611fbc5790505b50905060005b6003548110156121135760008181526002602052604090819020815160a081019092528054829082906120399061417a565b80601f01602080910402602001604051908101604052809291908181526020018280546120659061417a565b80156120b25780601f10612087576101008083540402835291602001916120b2565b820191906000526020600020905b81548152906001019060200180831161209557829003601f168201915b505050505081526020016001820154815260200160028201548152602001600382015481526020016004820154815250508282815181106120f5576120f5614098565b6020026020010181905250808061210b90614037565b915050612007565b5090565b60045460ff161561213b57604051637735869160e01b815260040160405180910390fd5b6004805460ff19166001179055612150612f36565b60068890556009879055600a86905560408051808201909152600d81526c50726573616c65204f6173697360981b602082015261218f9088888861324a565b600b55604080518082019091526011815270141c995cd85b1948105b1b1bdddb1a5cdd607a1b60208201526121c69088888861324a565b600c556040805180820190915260058152644f6173697360d81b60208201526121fa908b60005b602002015160008c61324a565b601d55604080518082019091526009815268105b1b1bdddb1a5cdd60ba1b6020820152612229908b60006121ed565b601e5560408051808201909152600b81526a5075626c69632053616c6560a81b602082015261225a908b60016121ed565b601f55601c84905560005b81518110156122c85781818151811061228057612280614098565b6020908102919091018101516000838152918052604090912080546001600160a01b0319166001600160a01b03909216919091179055806122c081614037565b915050612265565b506122d283612c40565b50601880546001600160a01b0319166001600160a01b03929092169190911790555050505050505050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015612346573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236a9190613fff565b1561239357604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b61239b6127d4565b6123a3612821565b60016123ad610f8f565b60038111156123be576123be613a6e565b146123dc5760405163baf13b3f60e01b815260040160405180910390fd5b60185460195460405163090c9a2d60e41b815284926001600160a01b039081169216906390c9a2d090612417903390869086906004016141ae565b602060405180830381865afa158015612434573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124589190613fff565b61247b5733828260405163bdca17b360e01b8152600401610d53939291906141ae565b338486612489838383612b24565b6000612495338a6129a0565b90506124a23389836132e7565b505050505050610e1660018055565b6015546001600160a01b031633146124dc57604051634755657960e01b815260040160405180910390fd5b816124e6816131ea565b6124f184848461331a565b50505050565b6125296040518060a0016040528060608152602001600081526020016000815260200160008152602001600081525090565b81612533816127af565b60008381526002602052604090819020815160a0810190925280548290829061255b9061417a565b80601f01602080910402602001604051908101604052809291908181526020018280546125879061417a565b80156125d45780601f106125a9576101008083540402835291602001916125d4565b820191906000526020600020905b8154815290600101906020018083116125b757829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481525050915050919050565b6015546001600160a01b0316331461263857604051634755657960e01b815260040160405180910390fd5b600a819055600b546000908152600260205260408082206003908101849055600c54835291200155565b60008161266e816127af565b505060009081526002602052604090206003015490565b6015546001600160a01b031633146126b057604051634755657960e01b815260040160405180910390fd5b610e16838383613333565b6000806126c783613142565b156126e3576007546006546126dc91906140ae565b9050612715565b6008546007546126f391906140ae565b6126fb612c62565b60105461270891906140ae565b61271291906140ae565b90505b806000036127265750600092915050565b612732601c54826130d7565b9392505050565b612741612f36565b6001600160a01b0381166127a65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d53565b610f8c81613157565b6003548110610f8c57604051630eda8f7f60e21b815260048101829052602401610d53565b600054600160a01b900460ff161561154e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d53565b6002600154036128735760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d53565b6002600155565b610f2d601e548261342f565b6000612892838361112a565b1561289f575060016111f5565b60005b60215481101561295b5760008181526020805260409020546001600160a01b03168015612948576040516370a0823160e01b81526001600160a01b038681166004830152600091908316906370a0823190602401602060405180830381865afa158015612913573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129379190614050565b1115612948576002925050506111f5565b508061295381614037565b9150506128a2565b5060009392505050565b60008160010361297757506004919050565b8160020361298757506006919050565b60405163f06cbb1760e01b815260040160405180910390fd5b60608167ffffffffffffffff8111156129bb576129bb613905565b6040519080825280602002602001820160405280156129e4578160200160208202803683370190505b50905060005b82811015612a96576016546040516335313c2160e11b81526001600160a01b0386811660048301526000921690636a627842906024016020604051808303816000875af1158015612a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a639190614050565b905080838381518110612a7857612a78614098565b60209081029190910101525080612a8e81614037565b9150506129ea565b5092915050565b612aa8838351613455565b80600a811115612aba57612aba613a6e565b6001600160a01b03841660008051602061433d833981519152843460008080805b604051908082528060200260200182016040528015612b04578160200160208202803683370190505b50604051612b179695949392919061410f565b60405180910390a3505050565b6018546040516370a0823160e01b81526001600160a01b038481166004830152909116906370a0823190602401602060405180830381865afa158015612b6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b929190614050565b600003612bbd57604051638c1aeecd60e01b81526001600160a01b0383166004820152602401610d53565b610e16601d548261342f565b612bd4828251613455565b60036001600160a01b03831660008051602061433d83398151915283346000806001815b604051908082528060200260200182016040528015612c21578160200160208202803683370190505b50604051612c349695949392919061410f565b60405180910390a35050565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b601654604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015612cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cd09190614050565b905090565b60008181526002602081905260408220015442108015906111f5575060008281526002602052604090206003015415806111f5575050600090815260026020526040902060030154421090565b6018546040516370a0823160e01b81526001600160a01b038481166004830152909116906370a0823190602401602060405180830381865afa158015612d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d909190614050565b600003612dbb57604051638c1aeecd60e01b81526001600160a01b0383166004820152602401610d53565b610e16600b5482613486565b6001600160a01b038084166000908152600d602052604090208054909116612e555780546001600160a01b0385166001600160a01b031991821681178355600e805460018101825560009182527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd018054909316909117909155600f805491612e4f83614037565b91905055505b82816001016000828254612e699190614167565b9250508190555034816002016000828254612e849190614167565b925050819055508260076000828254612e9d9190614167565b9250508190555082846001600160a01b03167fc90d7274aedd5ec938fabf22ac9ec32edca0e6709f625c8a40de55318a2364063485604051612ee09291906141d1565b60405180910390a350505050565b6000806000612efd85856134a2565b91509150612f0a816134e7565b509392505050565b610f2d600c5482613486565b60006009544210158015612cd0575050600a54421090565b6000546001600160a01b0316331461154e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d53565b60115415613035576013546012546011546000926001600160a01b03169190612fb990476141f5565b612fc3919061420c565b604051600081818185875af1925050503d8060008114612fff576040519150601f19603f3d011682016040523d82523d6000602084013e613004565b606091505b50509050806130335760135460405163ba5c362160e01b8152610d53916001600160a01b031690600401614069565b505b6014546040516000916001600160a01b03169047908381818185875af1925050503d8060008114613082576040519150601f19603f3d011682016040523d82523d6000602084013e613087565b606091505b5050905080610f8c576014546040805163ba5c362160e01b815260048101919091526006604482015265185c9d1a5cdd60d21b60648201526001600160a01b039091166024820152608401610d53565b60008183106130e65781612732565b5090919050565b6130f5613631565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000600b548214806111f5575050600c541490565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6131af6127d4565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586131253390565b6001811015610f8c57604051631f2a200560e01b815260040160405180910390fd5b610f2d601f548261342f565b613223828251613455565b60056001600160a01b03831660008051602061433d83398151915283346000808080612bf8565b6000613254612f36565b506003546040805160a0810182528681526020808201849052818301879052606082018690526080820185905260008481526002909152919091208151819061329d908261427c565b506020820151600182015560408201516002820155606082015160038083019190915560809092015160049091015580549060006132da83614037565b9190505550949350505050565b6132f2838251613455565b60036001600160a01b03841660008051602061433d8339815191528334600187816000612adb565b600061332684846129a0565b90506124f1848284613681565b8251158061334357508151835114155b156133615760405163cc6e40b360e01b815260040160405180910390fd5b6000805b83518110156133a75783818151811061338057613380614098565b6020026020010151826133939190614167565b91508061339f81614037565b915050613365565b506133b1816136ac565b60005b84518110156134285760008582815181106133d1576133d1614098565b6020026020010151905060008583815181106133ef576133ef614098565b60200260200101519050600061340583836129a0565b9050613412838288613681565b505050808061342090614037565b9150506133b4565b5050505050565b61343882613700565b6134428183613728565b61344b816136ac565b610f2d3382613764565b6001600160a01b0382166000908152602260205260408120805483929061347d908490614167565b90915550505050565b61348f82613700565b6134998183613728565b61344b81613799565b60008082516041036134d85760208301516040840151606085015160001a6134cc878285856137c9565b945094505050506134e0565b506000905060025b9250929050565b60008160048111156134fb576134fb613a6e565b036135035750565b600181600481111561351757613517613a6e565b036135645760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610d53565b600281600481111561357857613578613a6e565b036135c55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610d53565b60038160048111156135d9576135d9613a6e565b03610f8c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610d53565b600054600160a01b900460ff1661154e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610d53565b8151601b60008282546136949190614167565b90915550819050600a811115612aba57612aba613a6e565b60006008546007546136be91906140ae565b6136c6612c62565b6010546136d391906140ae565b6136dd91906140ae565b905080821115610f2d57604051638a164f6360e01b815260040160405180910390fd5b61370981612cd5565b610f8c5760405162f157e160e11b815260048101829052602401610d53565b60008181526002602052604090206004015461374490836141f5565b341015610f2d5760405163356680b760e01b815260040160405180910390fd5b601c54811115610f2d5760405163c5de480160e01b81526001600160a01b038316600482015260248101829052604401610d53565b600654816007546137aa9190614167565b1115610f8c57604051638a164f6360e01b815260040160405180910390fd5b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156138005750600090506003613884565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613854573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661387d57600060019250925050613884565b9150600090505b94509492505050565b604080516101408101909152806000815260200160001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001606081525090565b6000602082840312156138fe57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561393e5761393e613905565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561396d5761396d613905565b604052919050565b600082601f83011261398657600080fd5b813567ffffffffffffffff8111156139a0576139a0613905565b6139b3601f8201601f1916602001613944565b8181528460208386010111156139c857600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156139f857600080fd5b82359150602083013567ffffffffffffffff811115613a1657600080fd5b613a2285828601613975565b9150509250929050565b6001600160a01b0381168114610f8c57600080fd5b8035613a4c81613a2c565b919050565b600060208284031215613a6357600080fd5b813561273281613a2c565b634e487b7160e01b600052602160045260246000fd5b60048110613a9457613a94613a6e565b9052565b602081016111f58284613a84565b60008060408385031215613ab957600080fd5b8235613ac481613a2c565b9150602083013567ffffffffffffffff811115613a1657600080fd5b6000815160a0845280518060a086015260005b81811015613b1057602081840181015160c0888401015201613af3565b50600060c082870101526020840151602086015260408401516040860152606084015160608601526080840151608086015260c0601f19601f8301168601019250505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015613ba1578284038952613b8f848351613ae0565b98850198935090840190600101613b77565b5091979650505050505050565b6000610140613bbe848451613a84565b6020830151613bd1602086018215159052565b5060408301516040850152606083015160608501526080830151608085015260a083015160a085015260c083015160c085015260e083015160e085015261010080840151613c29828701826001600160a01b03169052565b5050610120808401518282870152613c4383870182613b59565b9695505050505050565b82518152602080840151908201526040808401519082015260608084015115159082015260a060808201526000613c8760a0830184613bae565b949350505050565b60008060408385031215613ca257600080fd5b8235613cad81613a2c565b946020939093013593505050565b60008060408385031215613cce57600080fd5b50508035926020909101359150565b815181526020808301519082015260408083015190820152606080830151151590820152608081016111f5565b6020815260006127326020830184613bae565b60008060408385031215613d3057600080fd5b823591506020830135613d4281613a2c565b809150509250929050565b6020815260006127326020830184613b59565b600067ffffffffffffffff821115613d7a57613d7a613905565b5060051b60200190565b600082601f830112613d9557600080fd5b81356020613daa613da583613d60565b613944565b82815260059290921b84018101918181019086841115613dc957600080fd5b8286015b84811015613ded578035613de081613a2c565b8352918301918301613dcd565b509695505050505050565b6000806000806000806000806000806101608b8d031215613e1857600080fd5b8b601f8c0112613e2757600080fd5b613e2f61391b565b8060408d018e811115613e4157600080fd5b8d5b81811015613e5b578035845260209384019301613e43565b50909b503599505060608b0135975060808b0135965060a08b0135955060c08b0135945060e08b01359350613e936101008c01613a41565b9250613ea26101208c01613a41565b91506101408b013567ffffffffffffffff811115613ebf57600080fd5b613ecb8d828e01613d84565b9150509295989b9194979a5092959850565b8035600b8110613a4c57600080fd5b600080600060608486031215613f0157600080fd5b8335613f0c81613a2c565b925060208401359150613f2160408501613edd565b90509250925092565b6020815260006127326020830184613ae0565b600080600060608486031215613f5257600080fd5b833567ffffffffffffffff80821115613f6a57600080fd5b613f7687838801613d84565b9450602091508186013581811115613f8d57600080fd5b86019050601f81018713613fa057600080fd5b8035613fae613da582613d60565b81815260059190911b82018301908381019089831115613fcd57600080fd5b928401925b82841015613feb57833582529284019290840190613fd2565b8096505050505050613f2160408501613edd565b60006020828403121561401157600080fd5b8151801515811461273257600080fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161404957614049614021565b5060010190565b60006020828403121561406257600080fd5b5051919050565b6040808252600490820152631dda5b1960e21b60608201526001600160a01b0391909116602082015260800190565b634e487b7160e01b600052603260045260246000fd5b818103818111156111f5576111f5614021565b600081518084526020808501945080840160005b838110156140f1578151875295820195908201906001016140d5565b509495945050505050565b60208152600061273260208301846140c1565b60c08152600061412260c08301896140c1565b6020830188905286151560408401526001600160a01b0386166060840152841515608084015282810360a084015261415a81856140c1565b9998505050505050505050565b808201808211156111f5576111f5614021565b600181811c9082168061418e57607f821691505b602082108103610cbb57634e487b7160e01b600052602260045260246000fd5b6001600160a01b0393841681529183166020830152909116604082015260600190565b82815260408101600b83106141e8576141e8613a6e565b8260208301529392505050565b80820281158282048414176111f5576111f5614021565b60008261422957634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610e1657600081815260208120601f850160051c810160208610156142555750805b601f850160051c820191505b8181101561427457828155600101614261565b505050505050565b815167ffffffffffffffff81111561429657614296613905565b6142aa816142a4845461417a565b8461422e565b602080601f8311600181146142df57600084156142c75750858301515b600019600386901b1c1916600185901b178555614274565b600085815260208120601f198616915b8281101561430e578886015182559484019460019091019084016142ef565b508582101561432c5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fe96cf551c818da56faa6ddb7fd002e845e11366de7e533273e38729d7720c9215a26469706673582212208dabcff8079bf5dbc457b62d7bea422f0cc6a103b66949ac816ee0a670f6f3a964736f6c6343000812003300000000000000000000000000000000000000000000000000000000000003e70000000000000000000000000000000000000000000000000000000000000014000000000000000000000000700ee751fbf4bfd89c0163a479b8a506f0067d7f0000000000000000000000004bf3805b23c99f8e0a5797e86fd0232a04a2a6290000000000000000000000009daf56fb5d08b1dad7e6a46e0d5e814f41d1b7f900000000000000000000000040c57923924b5c5c5455c48d93317139addac8fb000000000000000000000000c92ab2dff994dd77c0d2fe09f21d5cf9ea2bcc0a

Deployed Bytecode

0x6080604052600436106104105760003560e01c80638456cb591161021e578063c726699111610123578063dd6d1cd1116100ab578063ed7fb65e1161007a578063ed7fb65e14610c0d578063ee039b9114610c23578063f2fde38b14610c39578063f851a44014610c59578063ff9d2dcc14610c7957600080fd5b8063dd6d1cd114610b97578063e85a741714610bb7578063eb60679d14610bcd578063ec571c6a14610bed57600080fd5b8063cdd5bcc2116100f2578063cdd5bcc214610af4578063ceb6065414610b14578063cfa0136f14610b41578063d533f8bc14610b61578063d5abeb0114610b8157600080fd5b8063c726699114610a7f578063c72b517614610a9f578063cc0e5d0f14610ac1578063cc4070fd14610ae157600080fd5b8063a7edaabe116101a6578063b79eb83f11610175578063b79eb83f14610a0a578063b975629d14610a2a578063bd9e3c1514610a40578063bebbc6bc14610a56578063c3e0405014610a6c57600080fd5b8063a7edaabe146109a9578063a82524b2146109bf578063b0934e5d146109d5578063b3ab66b0146109f757600080fd5b80639b5b8473116101ed5780639b5b8473146108fc5780639e42eb441461091c578063a3342fba14610949578063a3afda1a14610969578063a6745cb21461098957600080fd5b80638456cb591461081e57806386035738146108335780638da5cb5b146108535780639ad811a01461087157600080fd5b8063333cc17611610324578063639814e0116102ac578063785db5f41161027b578063785db5f4146107855780637892c2bb1461079b5780637bddd65b146107bb5780637bec780a146107db578063838459d41461080857600080fd5b8063639814e01461071a5780636cbb8f4d14610730578063715018a61461075057806373aa9e941461076557600080fd5b80633f4ba83a116102f35780633f4ba83a1461068657806347ccca021461069b5780635b1f3382146106bb5780635b79e140146106db5780635c975abb146106fb57600080fd5b8063333cc1761461061c5780633cb40e161461063c5780633ccfd60b146106515780633e8eef511461066657600080fd5b80631a1bc0dc116103a7578063249b7c1911610376578063249b7c1914610575578063258c1ef51461058b578063281f80f0146105bb578063291132a0146105e9578063296cab55146105fc57600080fd5b80631a1bc0dc146105165780631fbdd72d1461052c578063200b568a1461054c57806320ab3cb01461056257600080fd5b806316e577ab116103e357806316e577ab14610489578063183bbe801461049c5780631865c57d146104bc5780631a1687b8146104de57600080fd5b8063055da0f11461041557806308fc299b1461043e5780630f562b481461045457806315c8f10614610474575b600080fd5b34801561042157600080fd5b5061042b600f5481565b6040519081526020015b60405180910390f35b34801561044a57600080fd5b5061042b60065481565b34801561046057600080fd5b5061042b61046f3660046138ec565b610c99565b6104876104823660046139e5565b610cc1565b005b6104876104973660046138ec565b610e1b565b3480156104a857600080fd5b506104876104b7366004613a51565b610f31565b3480156104c857600080fd5b506104d1610f8f565b6040516104359190613a98565b3480156104ea57600080fd5b506104fe6104f93660046138ec565b610ffb565b6040516001600160a01b039091168152602001610435565b34801561052257600080fd5b5061042b60085481565b34801561053857600080fd5b506019546104fe906001600160a01b031681565b34801561055857600080fd5b5061042b60125481565b6104876105703660046138ec565b611025565b34801561058157600080fd5b5061042b600a5481565b34801561059757600080fd5b506105ab6105a6366004613aa6565b61112a565b6040519015158152602001610435565b3480156105c757600080fd5b506105db6105d6366004613aa6565b6111fb565b604051610435929190613c4d565b6104876105f73660046139e5565b61124d565b34801561060857600080fd5b506104876106173660046138ec565b61138e565b34801561062857600080fd5b5061042b610637366004613aa6565b6113e3565b34801561064857600080fd5b506104876114b5565b34801561065d57600080fd5b5061048761153e565b34801561067257600080fd5b506104876106813660046138ec565b611550565b34801561069257600080fd5b50610487611708565b3480156106a757600080fd5b506016546104fe906001600160a01b031681565b3480156106c757600080fd5b506013546104fe906001600160a01b031681565b3480156106e757600080fd5b5061042b6106f6366004613c8f565b61173b565b34801561070757600080fd5b50600054600160a01b900460ff166105ab565b34801561072657600080fd5b5061042b601c5481565b34801561073c57600080fd5b5061048761074b366004613a51565b61178c565b34801561075c57600080fd5b506104876117e3565b34801561077157600080fd5b50610487610780366004613a51565b6117f5565b34801561079157600080fd5b5061042b60075481565b3480156107a757600080fd5b506104876107b6366004613cbb565b611842565b3480156107c757600080fd5b506104876107d63660046138ec565b61188f565b3480156107e757600080fd5b5061042b6107f6366004613a51565b60226020526000908152604090205481565b34801561081457600080fd5b5061042b601f5481565b34801561082a57600080fd5b506104876118bf565b34801561083f57600080fd5b5061048761084e366004613cbb565b6118f2565b34801561085f57600080fd5b506000546001600160a01b03166104fe565b34801561087d57600080fd5b506108c861088c366004613a51565b600d60205260009081526040902080546001820154600283015460038401546004909401546001600160a01b03909316939192909160ff169085565b604080516001600160a01b03909616865260208601949094529284019190915215156060830152608082015260a001610435565b34801561090857600080fd5b50610487610917366004613cbb565b611948565b34801561092857600080fd5b5061093c610937366004613aa6565b611975565b6040516104359190613cdd565b34801561095557600080fd5b506014546104fe906001600160a01b031681565b34801561097557600080fd5b506018546104fe906001600160a01b031681565b34801561099557600080fd5b506104876109a4366004613cbb565b6119f3565b3480156109b557600080fd5b5061042b600c5481565b3480156109cb57600080fd5b5061042b60095481565b3480156109e157600080fd5b506109ea611a3e565b6040516104359190613d0a565b610487610a053660046138ec565b611c60565b348015610a1657600080fd5b5061042b610a253660046138ec565b611d63565b348015610a3657600080fd5b5061042b601e5481565b348015610a4c57600080fd5b5061042b601b5481565b348015610a6257600080fd5b5061042b60115481565b610487610a7a366004613d1d565b611d86565b348015610a8b57600080fd5b50610487610a9a366004613a51565b611f1e565b348015610aab57600080fd5b50610ab4611f81565b6040516104359190613d4d565b348015610acd57600080fd5b50610487610adc366004613df8565b612117565b610487610aef366004613d1d565b6122fd565b348015610b0057600080fd5b50610487610b0f366004613eec565b6124b1565b348015610b2057600080fd5b50610b34610b2f3660046138ec565b6124f7565b6040516104359190613f2a565b348015610b4d57600080fd5b50610487610b5c3660046138ec565b61260d565b348015610b6d57600080fd5b5061042b610b7c3660046138ec565b612662565b348015610b8d57600080fd5b5061042b60105481565b348015610ba357600080fd5b50610487610bb2366004613f3d565b612685565b348015610bc357600080fd5b5061042b601d5481565b348015610bd957600080fd5b5061042b610be83660046138ec565b6126bb565b348015610bf957600080fd5b506017546104fe906001600160a01b031681565b348015610c1957600080fd5b5061042b600b5481565b348015610c2f57600080fd5b5061042b60215481565b348015610c4557600080fd5b50610487610c54366004613a51565b612739565b348015610c6557600080fd5b506015546104fe906001600160a01b031681565b348015610c8557600080fd5b50601a546104fe906001600160a01b031681565b600081610ca5816127af565b6000838152600260208190526040909120015491505b50919050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015610d0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2e9190613fff565b15610d5c57604051638027911160e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610d646127d4565b610d6c612821565b6001610d76610f8f565b6003811115610d8757610d87613a6e565b14610da55760405163baf13b3f60e01b815260040160405180910390fd5b3383610db1828261287a565b6000610dbd3386612886565b905080600003610de257604051636048a6a360e11b8152336004820152602401610d53565b6000610ded82612965565b90506000610dfb33896129a0565b9050610e08338284612a9d565b5050505050610e1660018055565b505050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015610e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e889190613fff565b15610eb157604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b610eb96127d4565b610ec1612821565b6001610ecb610f8f565b6003811115610edc57610edc613a6e565b14610efa5760405163baf13b3f60e01b815260040160405180910390fd5b333383610f08838383612b24565b6000610f1433876129a0565b9050610f203382612bc9565b50505050610f2d60018055565b5050565b6015546001600160a01b03163314610f5c57604051634755657960e01b815260040160405180910390fd5b6001600160a01b038116610f835760405163d92e233d60e01b815260040160405180910390fd5b610f8c81612c40565b50565b60008054600160a01b900460ff1615610fa85750600390565b601054610fb3612c62565b03610fbe5750600290565b60005b600354811015610ff357610fd481612cd5565b15610fe157600191505090565b80610feb81614037565b915050610fc1565b506000905090565b600e818154811061100b57600080fd5b6000918252602090912001546001600160a01b0316905081565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa15801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190613fff565b156110bb57604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b6110c36127d4565b6110cb612821565b60016110d5610f8f565b60038111156110e6576110e6613a6e565b146111045760405163baf13b3f60e01b815260040160405180910390fd5b333383611112838383612d22565b61111e33866003612dc7565b505050610f2d60018055565b600081516041036111f1576040516bffffffffffffffffffffffff19606085811b8216602084015230901b16603482015260009060480160405160208183030381529060405280519060200120905060006111b2827f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905060006111c08286612eee565b90506001600160a01b038116158015906111e75750601a546001600160a01b038281169116145b93505050506111f5565b5060005b92915050565b61122860405180608001604052806000815260200160008152602001600081526020016000151581525090565b61123061388d565b61123a8484611975565b9150611244611a3e565b90509250929050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015611296573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ba9190613fff565b156112e357604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b6112eb6127d4565b6112f3612821565b60016112fd610f8f565b600381111561130e5761130e613a6e565b1461132c5760405163baf13b3f60e01b815260040160405180910390fd5b33836113388282612f12565b60006113443386612886565b90508060000361136957604051636048a6a360e11b8152336004820152602401610d53565b600061137482612965565b9050611381338883612dc7565b50505050610e1660018055565b6015546001600160a01b031633146113b957604051634755657960e01b815260040160405180910390fd5b6009819055600b5460009081526002602081905260408083208201849055600c5483529091200155565b6000806113ee612f1e565b6018546040516370a0823160e01b81526001600160a01b038781166004830152929350600092909116906370a0823190602401602060405180830381865afa15801561143e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114629190614050565b1115611481578061147557601d54611479565b600b545b9150506111f5565b600061148d8585612886565b11156114aa57806114a057601e54611479565b5050600c546111f5565b5050601f5492915050565b6114bd612f36565b6013546040516000916001600160a01b03169047908381818185875af1925050503d806000811461150a576040519150601f19603f3d011682016040523d82523d6000602084013e61150f565b606091505b5050905080610f8c5760135460405163ba5c362160e01b8152610d53916001600160a01b031690600401614069565b611546612f36565b61154e612f90565b565b611558612f36565b6000600e828154811061156d5761156d614098565b60009182526020808320909101546001600160a01b0316808352600d90915260409091206003015490915060ff16156115b9576040516329eef5b760e21b815260040160405180910390fd5b6001600160a01b0381166000908152600d60205260408120600481015460018201549192916115f4916014916115ef91906140ae565b6130d7565b9050600061160284836129a0565b9050836001600160a01b03167fb31abcda30cad16a8d7bf60f1b5103785402230df64197ed1195a699221ee4a18260405161163d91906140fc565b60405180910390a2600760028401546001600160a01b0386169060008051602061433d8339815191529084906000808080604051908082528060200260200182016040528015611697578160200160208202803683370190505b506040516116aa9695949392919061410f565b60405180910390a3818360040160008282546116c69190614167565b909155505060018301546004840154036116ea5760038301805460ff191660011790555b81600860008282546116fc9190614167565b90915550505050505050565b6015546001600160a01b0316331461173357604051634755657960e01b815260040160405180910390fd5b61154e6130ed565b600061174682613142565b1561176d57506001600160a01b0382166000908152600d60205260409020600101546111f5565b506001600160a01b0382166000908152602260205260409020546111f5565b611794612f36565b602180548291602091600091826117aa83614037565b91905055815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050565b6117eb612f36565b61154e6000613157565b6015546001600160a01b0316331461182057604051634755657960e01b815260040160405180910390fd5b601980546001600160a01b0319166001600160a01b0392909216919091179055565b8161184c816127af565b6015546001600160a01b0316331461187757604051634755657960e01b815260040160405180910390fd5b50600091825260026020819052604090922090910155565b6015546001600160a01b031633146118ba57604051634755657960e01b815260040160405180910390fd5b601c55565b6015546001600160a01b031633146118ea57604051634755657960e01b815260040160405180910390fd5b61154e6131a7565b816118fc816127af565b81611906816131ea565b6015546001600160a01b0316331461193157604051634755657960e01b815260040160405180910390fd5b505060009182526002602052604090912060040155565b611950612f36565b815b81811015610e165761196381611550565b8061196d81614037565b915050611952565b6119a260405180608001604052806000815260200160008152602001600081526020016000151581525090565b60006119ae84846113e3565b905060405180608001604052808281526020016119ca836126bb565b81526020016119d9868461173b565b81526020016119e783612cd5565b15159052949350505050565b816119fd816127af565b6015546001600160a01b03163314611a2857604051634755657960e01b815260040160405180910390fd5b5060009182526002602052604090912060030155565b611a4661388d565b600060035467ffffffffffffffff811115611a6357611a63613905565b604051908082528060200260200182016040528015611ac657816020015b611ab36040518060a0016040528060608152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611a815790505b50905060005b600354811015611bd85760008181526002602052604090819020815160a08101909252805482908290611afe9061417a565b80601f0160208091040260200160405190810160405280929190818152602001828054611b2a9061417a565b8015611b775780601f10611b4c57610100808354040283529160200191611b77565b820191906000526020600020905b815481529060010190602001808311611b5a57829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481525050828281518110611bba57611bba614098565b60200260200101819052508080611bd090614037565b915050611acc565b50604051806101400160405280611bed610f8f565b6003811115611bfe57611bfe613a6e565b8152602001611c0b612f1e565b151581526020016010548152602001611c22612c62565b815260065460208201526007546040820152601c54606082018190526080820152601a546001600160a01b031660a082015260c00191909152919050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015611ca9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccd9190613fff565b15611cf657604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b611cfe6127d4565b611d06612821565b6001611d10610f8f565b6003811115611d2157611d21613a6e565b14611d3f5760405163baf13b3f60e01b815260040160405180910390fd5b3382611d4b828261320c565b6000611d5733866129a0565b905061111e3382613218565b600081611d6f816127af565b505060009081526002602052604090206004015490565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015611dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df39190613fff565b15611e1c57604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b611e246127d4565b611e2c612821565b6001611e36610f8f565b6003811115611e4757611e47613a6e565b14611e655760405163baf13b3f60e01b815260040160405180910390fd5b60185460195460405163090c9a2d60e41b815284926001600160a01b039081169216906390c9a2d090611ea0903390869086906004016141ae565b602060405180830381865afa158015611ebd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee19190613fff565b611f045733828260405163bdca17b360e01b8152600401610d53939291906141ae565b338486611f12838383612d22565b610e0833896003612dc7565b611f26612f36565b60005b602154811015610f2d5760008181526020805260409020546001600160a01b03808416911603611f6f576000818152602080526040902080546001600160a01b03191690555b80611f7981614037565b915050611f29565b606060035467ffffffffffffffff811115611f9e57611f9e613905565b60405190808252806020026020018201604052801561200157816020015b611fee6040518060a0016040528060608152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611fbc5790505b50905060005b6003548110156121135760008181526002602052604090819020815160a081019092528054829082906120399061417a565b80601f01602080910402602001604051908101604052809291908181526020018280546120659061417a565b80156120b25780601f10612087576101008083540402835291602001916120b2565b820191906000526020600020905b81548152906001019060200180831161209557829003601f168201915b505050505081526020016001820154815260200160028201548152602001600382015481526020016004820154815250508282815181106120f5576120f5614098565b6020026020010181905250808061210b90614037565b915050612007565b5090565b60045460ff161561213b57604051637735869160e01b815260040160405180910390fd5b6004805460ff19166001179055612150612f36565b60068890556009879055600a86905560408051808201909152600d81526c50726573616c65204f6173697360981b602082015261218f9088888861324a565b600b55604080518082019091526011815270141c995cd85b1948105b1b1bdddb1a5cdd607a1b60208201526121c69088888861324a565b600c556040805180820190915260058152644f6173697360d81b60208201526121fa908b60005b602002015160008c61324a565b601d55604080518082019091526009815268105b1b1bdddb1a5cdd60ba1b6020820152612229908b60006121ed565b601e5560408051808201909152600b81526a5075626c69632053616c6560a81b602082015261225a908b60016121ed565b601f55601c84905560005b81518110156122c85781818151811061228057612280614098565b6020908102919091018101516000838152918052604090912080546001600160a01b0319166001600160a01b03909216919091179055806122c081614037565b915050612265565b506122d283612c40565b50601880546001600160a01b0319166001600160a01b03929092169190911790555050505050505050565b60175460405163df592f7d60e01b81523360048201819052916001600160a01b03169063df592f7d90602401602060405180830381865afa158015612346573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236a9190613fff565b1561239357604051638027911160e01b81526001600160a01b0382166004820152602401610d53565b61239b6127d4565b6123a3612821565b60016123ad610f8f565b60038111156123be576123be613a6e565b146123dc5760405163baf13b3f60e01b815260040160405180910390fd5b60185460195460405163090c9a2d60e41b815284926001600160a01b039081169216906390c9a2d090612417903390869086906004016141ae565b602060405180830381865afa158015612434573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124589190613fff565b61247b5733828260405163bdca17b360e01b8152600401610d53939291906141ae565b338486612489838383612b24565b6000612495338a6129a0565b90506124a23389836132e7565b505050505050610e1660018055565b6015546001600160a01b031633146124dc57604051634755657960e01b815260040160405180910390fd5b816124e6816131ea565b6124f184848461331a565b50505050565b6125296040518060a0016040528060608152602001600081526020016000815260200160008152602001600081525090565b81612533816127af565b60008381526002602052604090819020815160a0810190925280548290829061255b9061417a565b80601f01602080910402602001604051908101604052809291908181526020018280546125879061417a565b80156125d45780601f106125a9576101008083540402835291602001916125d4565b820191906000526020600020905b8154815290600101906020018083116125b757829003601f168201915b50505050508152602001600182015481526020016002820154815260200160038201548152602001600482015481525050915050919050565b6015546001600160a01b0316331461263857604051634755657960e01b815260040160405180910390fd5b600a819055600b546000908152600260205260408082206003908101849055600c54835291200155565b60008161266e816127af565b505060009081526002602052604090206003015490565b6015546001600160a01b031633146126b057604051634755657960e01b815260040160405180910390fd5b610e16838383613333565b6000806126c783613142565b156126e3576007546006546126dc91906140ae565b9050612715565b6008546007546126f391906140ae565b6126fb612c62565b60105461270891906140ae565b61271291906140ae565b90505b806000036127265750600092915050565b612732601c54826130d7565b9392505050565b612741612f36565b6001600160a01b0381166127a65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d53565b610f8c81613157565b6003548110610f8c57604051630eda8f7f60e21b815260048101829052602401610d53565b600054600160a01b900460ff161561154e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610d53565b6002600154036128735760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d53565b6002600155565b610f2d601e548261342f565b6000612892838361112a565b1561289f575060016111f5565b60005b60215481101561295b5760008181526020805260409020546001600160a01b03168015612948576040516370a0823160e01b81526001600160a01b038681166004830152600091908316906370a0823190602401602060405180830381865afa158015612913573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129379190614050565b1115612948576002925050506111f5565b508061295381614037565b9150506128a2565b5060009392505050565b60008160010361297757506004919050565b8160020361298757506006919050565b60405163f06cbb1760e01b815260040160405180910390fd5b60608167ffffffffffffffff8111156129bb576129bb613905565b6040519080825280602002602001820160405280156129e4578160200160208202803683370190505b50905060005b82811015612a96576016546040516335313c2160e11b81526001600160a01b0386811660048301526000921690636a627842906024016020604051808303816000875af1158015612a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a639190614050565b905080838381518110612a7857612a78614098565b60209081029190910101525080612a8e81614037565b9150506129ea565b5092915050565b612aa8838351613455565b80600a811115612aba57612aba613a6e565b6001600160a01b03841660008051602061433d833981519152843460008080805b604051908082528060200260200182016040528015612b04578160200160208202803683370190505b50604051612b179695949392919061410f565b60405180910390a3505050565b6018546040516370a0823160e01b81526001600160a01b038481166004830152909116906370a0823190602401602060405180830381865afa158015612b6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b929190614050565b600003612bbd57604051638c1aeecd60e01b81526001600160a01b0383166004820152602401610d53565b610e16601d548261342f565b612bd4828251613455565b60036001600160a01b03831660008051602061433d83398151915283346000806001815b604051908082528060200260200182016040528015612c21578160200160208202803683370190505b50604051612c349695949392919061410f565b60405180910390a35050565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b601654604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015612cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cd09190614050565b905090565b60008181526002602081905260408220015442108015906111f5575060008281526002602052604090206003015415806111f5575050600090815260026020526040902060030154421090565b6018546040516370a0823160e01b81526001600160a01b038481166004830152909116906370a0823190602401602060405180830381865afa158015612d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d909190614050565b600003612dbb57604051638c1aeecd60e01b81526001600160a01b0383166004820152602401610d53565b610e16600b5482613486565b6001600160a01b038084166000908152600d602052604090208054909116612e555780546001600160a01b0385166001600160a01b031991821681178355600e805460018101825560009182527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd018054909316909117909155600f805491612e4f83614037565b91905055505b82816001016000828254612e699190614167565b9250508190555034816002016000828254612e849190614167565b925050819055508260076000828254612e9d9190614167565b9250508190555082846001600160a01b03167fc90d7274aedd5ec938fabf22ac9ec32edca0e6709f625c8a40de55318a2364063485604051612ee09291906141d1565b60405180910390a350505050565b6000806000612efd85856134a2565b91509150612f0a816134e7565b509392505050565b610f2d600c5482613486565b60006009544210158015612cd0575050600a54421090565b6000546001600160a01b0316331461154e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d53565b60115415613035576013546012546011546000926001600160a01b03169190612fb990476141f5565b612fc3919061420c565b604051600081818185875af1925050503d8060008114612fff576040519150601f19603f3d011682016040523d82523d6000602084013e613004565b606091505b50509050806130335760135460405163ba5c362160e01b8152610d53916001600160a01b031690600401614069565b505b6014546040516000916001600160a01b03169047908381818185875af1925050503d8060008114613082576040519150601f19603f3d011682016040523d82523d6000602084013e613087565b606091505b5050905080610f8c576014546040805163ba5c362160e01b815260048101919091526006604482015265185c9d1a5cdd60d21b60648201526001600160a01b039091166024820152608401610d53565b60008183106130e65781612732565b5090919050565b6130f5613631565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000600b548214806111f5575050600c541490565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6131af6127d4565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586131253390565b6001811015610f8c57604051631f2a200560e01b815260040160405180910390fd5b610f2d601f548261342f565b613223828251613455565b60056001600160a01b03831660008051602061433d83398151915283346000808080612bf8565b6000613254612f36565b506003546040805160a0810182528681526020808201849052818301879052606082018690526080820185905260008481526002909152919091208151819061329d908261427c565b506020820151600182015560408201516002820155606082015160038083019190915560809092015160049091015580549060006132da83614037565b9190505550949350505050565b6132f2838251613455565b60036001600160a01b03841660008051602061433d8339815191528334600187816000612adb565b600061332684846129a0565b90506124f1848284613681565b8251158061334357508151835114155b156133615760405163cc6e40b360e01b815260040160405180910390fd5b6000805b83518110156133a75783818151811061338057613380614098565b6020026020010151826133939190614167565b91508061339f81614037565b915050613365565b506133b1816136ac565b60005b84518110156134285760008582815181106133d1576133d1614098565b6020026020010151905060008583815181106133ef576133ef614098565b60200260200101519050600061340583836129a0565b9050613412838288613681565b505050808061342090614037565b9150506133b4565b5050505050565b61343882613700565b6134428183613728565b61344b816136ac565b610f2d3382613764565b6001600160a01b0382166000908152602260205260408120805483929061347d908490614167565b90915550505050565b61348f82613700565b6134998183613728565b61344b81613799565b60008082516041036134d85760208301516040840151606085015160001a6134cc878285856137c9565b945094505050506134e0565b506000905060025b9250929050565b60008160048111156134fb576134fb613a6e565b036135035750565b600181600481111561351757613517613a6e565b036135645760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610d53565b600281600481111561357857613578613a6e565b036135c55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610d53565b60038160048111156135d9576135d9613a6e565b03610f8c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610d53565b600054600160a01b900460ff1661154e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610d53565b8151601b60008282546136949190614167565b90915550819050600a811115612aba57612aba613a6e565b60006008546007546136be91906140ae565b6136c6612c62565b6010546136d391906140ae565b6136dd91906140ae565b905080821115610f2d57604051638a164f6360e01b815260040160405180910390fd5b61370981612cd5565b610f8c5760405162f157e160e11b815260048101829052602401610d53565b60008181526002602052604090206004015461374490836141f5565b341015610f2d5760405163356680b760e01b815260040160405180910390fd5b601c54811115610f2d5760405163c5de480160e01b81526001600160a01b038316600482015260248101829052604401610d53565b600654816007546137aa9190614167565b1115610f8c57604051638a164f6360e01b815260040160405180910390fd5b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156138005750600090506003613884565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613854573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661387d57600060019250925050613884565b9150600090505b94509492505050565b604080516101408101909152806000815260200160001515815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001606081525090565b6000602082840312156138fe57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561393e5761393e613905565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561396d5761396d613905565b604052919050565b600082601f83011261398657600080fd5b813567ffffffffffffffff8111156139a0576139a0613905565b6139b3601f8201601f1916602001613944565b8181528460208386010111156139c857600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156139f857600080fd5b82359150602083013567ffffffffffffffff811115613a1657600080fd5b613a2285828601613975565b9150509250929050565b6001600160a01b0381168114610f8c57600080fd5b8035613a4c81613a2c565b919050565b600060208284031215613a6357600080fd5b813561273281613a2c565b634e487b7160e01b600052602160045260246000fd5b60048110613a9457613a94613a6e565b9052565b602081016111f58284613a84565b60008060408385031215613ab957600080fd5b8235613ac481613a2c565b9150602083013567ffffffffffffffff811115613a1657600080fd5b6000815160a0845280518060a086015260005b81811015613b1057602081840181015160c0888401015201613af3565b50600060c082870101526020840151602086015260408401516040860152606084015160608601526080840151608086015260c0601f19601f8301168601019250505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015613ba1578284038952613b8f848351613ae0565b98850198935090840190600101613b77565b5091979650505050505050565b6000610140613bbe848451613a84565b6020830151613bd1602086018215159052565b5060408301516040850152606083015160608501526080830151608085015260a083015160a085015260c083015160c085015260e083015160e085015261010080840151613c29828701826001600160a01b03169052565b5050610120808401518282870152613c4383870182613b59565b9695505050505050565b82518152602080840151908201526040808401519082015260608084015115159082015260a060808201526000613c8760a0830184613bae565b949350505050565b60008060408385031215613ca257600080fd5b8235613cad81613a2c565b946020939093013593505050565b60008060408385031215613cce57600080fd5b50508035926020909101359150565b815181526020808301519082015260408083015190820152606080830151151590820152608081016111f5565b6020815260006127326020830184613bae565b60008060408385031215613d3057600080fd5b823591506020830135613d4281613a2c565b809150509250929050565b6020815260006127326020830184613b59565b600067ffffffffffffffff821115613d7a57613d7a613905565b5060051b60200190565b600082601f830112613d9557600080fd5b81356020613daa613da583613d60565b613944565b82815260059290921b84018101918181019086841115613dc957600080fd5b8286015b84811015613ded578035613de081613a2c565b8352918301918301613dcd565b509695505050505050565b6000806000806000806000806000806101608b8d031215613e1857600080fd5b8b601f8c0112613e2757600080fd5b613e2f61391b565b8060408d018e811115613e4157600080fd5b8d5b81811015613e5b578035845260209384019301613e43565b50909b503599505060608b0135975060808b0135965060a08b0135955060c08b0135945060e08b01359350613e936101008c01613a41565b9250613ea26101208c01613a41565b91506101408b013567ffffffffffffffff811115613ebf57600080fd5b613ecb8d828e01613d84565b9150509295989b9194979a5092959850565b8035600b8110613a4c57600080fd5b600080600060608486031215613f0157600080fd5b8335613f0c81613a2c565b925060208401359150613f2160408501613edd565b90509250925092565b6020815260006127326020830184613ae0565b600080600060608486031215613f5257600080fd5b833567ffffffffffffffff80821115613f6a57600080fd5b613f7687838801613d84565b9450602091508186013581811115613f8d57600080fd5b86019050601f81018713613fa057600080fd5b8035613fae613da582613d60565b81815260059190911b82018301908381019089831115613fcd57600080fd5b928401925b82841015613feb57833582529284019290840190613fd2565b8096505050505050613f2160408501613edd565b60006020828403121561401157600080fd5b8151801515811461273257600080fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161404957614049614021565b5060010190565b60006020828403121561406257600080fd5b5051919050565b6040808252600490820152631dda5b1960e21b60608201526001600160a01b0391909116602082015260800190565b634e487b7160e01b600052603260045260246000fd5b818103818111156111f5576111f5614021565b600081518084526020808501945080840160005b838110156140f1578151875295820195908201906001016140d5565b509495945050505050565b60208152600061273260208301846140c1565b60c08152600061412260c08301896140c1565b6020830188905286151560408401526001600160a01b0386166060840152841515608084015282810360a084015261415a81856140c1565b9998505050505050505050565b808201808211156111f5576111f5614021565b600181811c9082168061418e57607f821691505b602082108103610cbb57634e487b7160e01b600052602260045260246000fd5b6001600160a01b0393841681529183166020830152909116604082015260600190565b82815260408101600b83106141e8576141e8613a6e565b8260208301529392505050565b80820281158282048414176111f5576111f5614021565b60008261422957634e487b7160e01b600052601260045260246000fd5b500490565b601f821115610e1657600081815260208120601f850160051c810160208610156142555750805b601f850160051c820191505b8181101561427457828155600101614261565b505050505050565b815167ffffffffffffffff81111561429657614296613905565b6142aa816142a4845461417a565b8461422e565b602080601f8311600181146142df57600084156142c75750858301515b600019600386901b1c1916600185901b178555614274565b600085815260208120601f198616915b8281101561430e578886015182559484019460019091019084016142ef565b508582101561432c5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fe96cf551c818da56faa6ddb7fd002e845e11366de7e533273e38729d7720c9215a26469706673582212208dabcff8079bf5dbc457b62d7bea422f0cc6a103b66949ac816ee0a670f6f3a964736f6c63430008120033

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

00000000000000000000000000000000000000000000000000000000000003e70000000000000000000000000000000000000000000000000000000000000014000000000000000000000000700ee751fbf4bfd89c0163a479b8a506f0067d7f0000000000000000000000004bf3805b23c99f8e0a5797e86fd0232a04a2a6290000000000000000000000009daf56fb5d08b1dad7e6a46e0d5e814f41d1b7f900000000000000000000000040c57923924b5c5c5455c48d93317139addac8fb000000000000000000000000c92ab2dff994dd77c0d2fe09f21d5cf9ea2bcc0a

-----Decoded View---------------
Arg [0] : _maxSupply (uint256): 999
Arg [1] : _wildRoyalty (uint256): 20
Arg [2] : _wildWallet (address): 0x700Ee751fBF4BFd89C0163a479b8a506f0067d7f
Arg [3] : _artistWallet (address): 0x4BF3805B23c99f8E0a5797E86fd0232A04a2a629
Arg [4] : _admin (address): 0x9DAF56fB5d08b1dad7e6A46e0d5E814F41d1b7F9
Arg [5] : _sanctions (address): 0x40C57923924B5c5c5455c48D93317139ADDaC8fb
Arg [6] : _nft (address): 0xc92AB2DfF994dd77c0D2fe09F21d5CF9ea2BcC0a

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000003e7
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [2] : 000000000000000000000000700ee751fbf4bfd89c0163a479b8a506f0067d7f
Arg [3] : 0000000000000000000000004bf3805b23c99f8e0a5797e86fd0232a04a2a629
Arg [4] : 0000000000000000000000009daf56fb5d08b1dad7e6a46e0d5e814f41d1b7f9
Arg [5] : 00000000000000000000000040c57923924b5c5c5455c48d93317139addac8fb
Arg [6] : 000000000000000000000000c92ab2dff994dd77c0d2fe09f21d5cf9ea2bcc0a


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ 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.