ETH Price: $3,256.18 (+3.19%)
Gas: 1.36 Gwei
 

Overview

ETH Balance

8.169246231155779727 ETH

Eth Value

$26,600.52 (@ $3,256.18/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Refresh Latest W...212935732024-11-29 13:13:1162 days ago1732885991IN
ENS Nameopendevs.eth
0 ETH0.0003787414.32044116
Mint212891332024-11-28 22:18:5963 days ago1732832339IN
ENS Nameopendevs.eth
0.3 ETH0.001066646.85661063
Withdraw Inactiv...212891172024-11-28 22:15:4763 days ago1732832147IN
ENS Nameopendevs.eth
0 ETH0.001567117.32985609
Refresh Latest W...211736212024-11-12 19:13:5979 days ago1731438839IN
ENS Nameopendevs.eth
0 ETH0.0009358635.3852131
Refresh Latest W...210678082024-10-29 0:47:4794 days ago1730162867IN
ENS Nameopendevs.eth
0 ETH0.0004488816.97225127
Refresh Latest W...210602732024-10-27 23:32:1195 days ago1730071931IN
ENS Nameopendevs.eth
0 ETH0.000184196.96456806
Refresh Latest W...210602542024-10-27 23:28:2395 days ago1730071703IN
ENS Nameopendevs.eth
0 ETH0.000184636.98098354
Withdraw210496362024-10-26 11:56:1196 days ago1729943771IN
ENS Nameopendevs.eth
0 ETH0.000554499.2658453
Withdraw210496322024-10-26 11:55:2396 days ago1729943723IN
ENS Nameopendevs.eth
0 ETH0.000526779.17287322
Withdraw210496262024-10-26 11:54:1196 days ago1729943651IN
ENS Nameopendevs.eth
0 ETH0.000469288.53076167
Withdraw210496222024-10-26 11:53:2396 days ago1729943603IN
ENS Nameopendevs.eth
0 ETH0.000634668.80118462
Refresh Latest W...210495992024-10-26 11:48:4796 days ago1729943327IN
ENS Nameopendevs.eth
0 ETH0.000268110.13698953
Mint210492172024-10-26 10:31:2396 days ago1729938683IN
ENS Nameopendevs.eth
0.1 ETH0.000633965.98447383
Withdraw Inactiv...210492122024-10-26 10:30:2396 days ago1729938623IN
ENS Nameopendevs.eth
0 ETH0.001088935.66504889
Refresh Latest W...210485902024-10-26 8:25:1196 days ago1729931111IN
ENS Nameopendevs.eth
0 ETH0.000171466.48303355
Refresh Latest W...210452372024-10-25 21:11:3597 days ago1729890695IN
ENS Nameopendevs.eth
0 ETH0.00016856.37120889
Refresh Latest W...210389812024-10-25 0:15:1198 days ago1729815311IN
ENS Nameopendevs.eth
0 ETH0.000123794.68080015
Refresh Latest W...210324052024-10-24 2:15:1199 days ago1729736111IN
ENS Nameopendevs.eth
0 ETH0.000205987.78818893
Refresh Latest W...209776862024-10-16 11:00:35106 days ago1729076435IN
ENS Nameopendevs.eth
0 ETH0.0003191812.06838843
Refresh Latest W...209767452024-10-16 7:51:23106 days ago1729065083IN
ENS Nameopendevs.eth
0 ETH0.0002705410.22935339
Refresh Latest W...209766022024-10-16 7:22:35106 days ago1729063355IN
ENS Nameopendevs.eth
0 ETH0.0002950711.15673616
Refresh Latest W...209765922024-10-16 7:20:35106 days ago1729063235IN
ENS Nameopendevs.eth
0 ETH0.0002800310.58803372
Refresh Latest W...209765892024-10-16 7:19:59106 days ago1729063199IN
ENS Nameopendevs.eth
0 ETH0.0002849710.77496576
Refresh Latest W...209765852024-10-16 7:19:11106 days ago1729063151IN
ENS Nameopendevs.eth
0 ETH0.0002707810.2384883
Refresh Latest W...209765722024-10-16 7:16:35106 days ago1729062995IN
ENS Nameopendevs.eth
0 ETH0.0002852310.78469898
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
212891172024-11-28 22:15:4763 days ago1732832147
ENS Nameopendevs.eth
0.27763819 ETH
210496362024-10-26 11:56:1196 days ago1729943771
ENS Nameopendevs.eth
0.02668341 ETH
210496322024-10-26 11:55:2396 days ago1729943723
ENS Nameopendevs.eth
0.02668341 ETH
210496262024-10-26 11:54:1196 days ago1729943651
ENS Nameopendevs.eth
0.02668341 ETH
210496222024-10-26 11:53:2396 days ago1729943603
ENS Nameopendevs.eth
0.02723618 ETH
210492122024-10-26 10:30:2396 days ago1729938623
ENS Nameopendevs.eth
0.13592964 ETH
206577622024-09-01 19:18:47151 days ago1725218327
ENS Nameopendevs.eth
0.02718592 ETH
206577562024-09-01 19:17:35151 days ago1725218255
ENS Nameopendevs.eth
0.30954773 ETH
204368692024-08-01 23:05:47182 days ago1722553547
ENS Nameopendevs.eth
0.02633165 ETH
204368142024-08-01 22:54:47182 days ago1722552887
ENS Nameopendevs.eth
0.02718592 ETH
182787932023-10-04 17:57:35484 days ago1696442255
ENS Nameopendevs.eth
0.15211055 ETH
182787882023-10-04 17:56:35484 days ago1696442195
ENS Nameopendevs.eth
0.71633165 ETH
173514312023-05-27 15:58:11614 days ago1685203091
ENS Nameopendevs.eth
0.44848542 ETH
173514312023-05-27 15:58:11614 days ago1685203091
ENS Nameopendevs.eth
0.00915276 ETH
173511592023-05-27 15:03:11614 days ago1685199791
ENS Nameopendevs.eth
0.71801005 ETH
173511592023-05-27 15:03:11614 days ago1685199791
ENS Nameopendevs.eth
0.01465326 ETH
173510802023-05-27 14:47:23614 days ago1685198843
ENS Nameopendevs.eth
1.45079396 ETH
173510802023-05-27 14:47:23614 days ago1685198843
ENS Nameopendevs.eth
0.02960804 ETH
173509932023-05-27 14:29:59614 days ago1685197799
ENS Nameopendevs.eth
1.47049246 ETH
173509932023-05-27 14:29:59614 days ago1685197799
ENS Nameopendevs.eth
0.03001005 ETH
173508102023-05-27 13:53:11614 days ago1685195591
ENS Nameopendevs.eth
2.84717085 ETH
173508102023-05-27 13:53:11614 days ago1685195591
ENS Nameopendevs.eth
0.05810552 ETH
165797922023-02-07 22:10:47723 days ago1675807847
ENS Nameopendevs.eth
0.04035175 ETH
163348152023-01-04 17:07:47757 days ago1672852067
ENS Nameopendevs.eth
14.70989849 ETH
163348152023-01-04 17:07:47757 days ago1672852067
ENS Nameopendevs.eth
0.30020201 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OpenDevsCrew

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 15 : OpenDevsCrew.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "./extensions/SmartCommunityWallet.sol";

contract OpenDevsCrew is SmartCommunityWallet {
  constructor()
  SmartCommunityWallet(
    /*
     * Once at least one token has been held for the following amount of time
     * the owner will automatically be considered a Diamond Hands Holder.
     *
     * In order to withdraw any funds from the Smart Community Wallet the
     * Diamond Hands Holder status is required.
     *
     * This status can also be verified by external contracts and Dapps.
     */
    90 days,

    /*
     * Diamond Hands Holders who are also owners of the following amount of
     * tokens (or more) are considered Whales. This allows them to perform extra
     * maintenance actions in extreme cases (see below).
     *
     * This status can also be verified by external contracts and Dapps.
     */
    20,

    /*
     * After an address has withdrawn funds from the Smart Community Wallet,
     * then any transfer of ODC tokens from the same address will be rejected
     * for the following amount of time.
     *
     * This is intended to mitigate misconduct such as withdrawing immediately
     * before accepting an offer. People can take this into consideration when
     * placing offers based on the funds associated with a token.
     *
     * If you are wondering why this works on an address basis and not on a
     * token basis, here are some considerations:
     *  - in most situations holders are probably gonna withdraw the funds for
     *    all of the their tokens at once in order to save gas
     *  - storing the required data to perform the same check on a token basis
     *    would be unreasonably expensive in terms of gas consumption
     */
    24 hours,

    /*
     * We don't want any funds to get stuck into this contract for any reasons,
     * but they are attached to the NFTs so only the owner of each token can
     * call the withdraw function.
     *
     * Setting an inactivity time frame makes it possible for Whales to withdraw
     * on behalf of inactive addresses in the following scenarios:
     * 1) a holder completely loses access to his wallet
     * 2) a token is transferred by mistake to any inactive address (e.g. a
     *    random one or the black hole)
     * 3) most human beings are exterminated by an army of AI-crafted NFTs and
     *    the last chance for survivors to fight for their lives is to use the
     *    funds in this contract (hope there is still a Whale out there...)
     */
    2 * 365 days,

    /*
     * Address of the WETH contract in order to support unwrapping.
     */
    address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2),

    /*
     * Donation to the HashLips Lab as a tribute for the educational and open
     * source work done for the Web3 space. (Daniel only, in order to avoid
     * useless round trips).
     */
    2, // %
    _HASHLIPS, // Wallet

    /*
     * MEP's share of mint funds to help with community activities.
     */
    _MEP // Wallet (% is implicitly 98%)
  )
  NftToken(
    // ERC721 token name
    "OpenDevsCrew",

    // ERC721 token symbol
    "ODC",

    // Max supply
    1990,

    // Token price
    0.1 ether,

    // Max batch size (per mint TX)
    10,

    // Hidden metadata URI
    "https://cdn.opendevs.io/tokens/public/hidden/metadata.json",

    // Mint start timestamp (2022-10-28 17:00:00 UTC)
    1666976400
  ) {
    // Initial airdrops
    _mint(_LIARCO, 10);
    _mint(_FREAKS_PIX, 1);

    _mint(_LORVI, 5);
    _mint(_NIKI, 1);
    _mint(_MAPER, 2);
    _mint(_ZEKEL, 2);
    _mint(_LEO, 1);

    _mint(_HASHLIPS, 1);
    _mint(_D_R, 1);
    _mint(_LAINA, 1);

    _mint(_BADER, 1);
    _mint(_PRINCE, 1);

    _mint(_CYGAAR, 1);
    _mint(_VECTORIZED, 1);
  }

  /*
   * Hi, thank you for taking the time to review this code. It may seem strange
   * to read the following lines in a smart contract, but even if the ultimate
   * goal of this project is to create a decentralized brand for people who
   * share common passions and values, it all started with a group of people who
   * bumped into each other (physically or virtually) and somehow made this
   * happen, so I think it's fair to mention some of them here...
   *
   * I have no idea how weird it's gonna be to read this again in a few years,
   * but I wanna use the following comments to thank some of the people who have
   * had the most impact in bringing this idea to life.
   *
   * It has been an amazing journey so far, now let's challenge ourselves once
   * more and build something great together!
   *
   * Marco
   */
  address constant _LIARCO = address(0x4aF801f7DAC719A91f43b24ff0B68e2E422FE37b);

  /*
   * I can't thank Alessandro enough for his amazing work. He is one of the most
   * talented artists I know and I'm extremely grateful for the effort he put in
   * this collection.
   *
   * The tokens look awesome and they really reflect some of the values that are
   * core to this project... just to name a few:
   *   - happiness
   *   - friendliness
   *   - inclusion
   *   - attention to detail
   *   - and much more...
   *
   * ---
   * It has taken a long time to get here, but now it's finally time to give
   * these artworks a new home on the blockchain!
   */
  address constant _FREAKS_PIX = address(0x4372ec603b4E4ddEe322b6d00236854924D5Dc95);

  /*
   * A great friend and a fantastic business partner. Since the day we met,
   * Lorenzo has always made me feel part of his family and his company.
   *
   * ---
   * This is another chapter in our journey, we have challenging goals, but we
   * will work hard until we make it.
   */
  address constant _LORVI = address(0x19a7EF7bc82668358E985789c787bd7bd197dEF9);

  /*
   * Without a friend like Nicola, I wouldn't be here today writing these lines.
   *
   * ---
   * The crypto space was scary at first, but you have always been very
   * supportive and you motivated me to face my fears and combine my web2
   * experience with this exciting new stuff.
   *
   * Thank you.
   */
  address constant _NIKI = address(0x5d3BADdfB2F0Ad614bC073b269cC7c51F392108F);

  /*
   * A hard worker, a teammate and a great friend.
   *
   * ---
   * Despite my countless attempts to exhaust your patience, you always find a
   * way to make me evaluate any situations more rationally.
   *
   * I am very lucky to have you by my side.
   */
  address constant _MAPER = address(0x42E4a2c9710451aB3313398ac888738979476584);

  /*
   * I still remember his application and his presentation project for a job
   * position at our company. Nothing to add...
   *
   * ---
   * You have the right amount of positive unpredictability and enthusiasm in
   * order to make things spicy enough without hurting my OCD.
   *
   * Thank you for your patience, I'm extremely grateful to have you on board.
   */
  address constant _ZEKEL = address(0xE06A96E8046f63370942452dD5dFbC27035C4765);

  /*
   * Web3 is not all about code, art and DeFi. For this space to grow in a
   * sustainable way we have to bring in traditional businesses and show them
   * how these technologies can generate value in real life. Leonardo is helping
   * me finding good opportunities to achieve this result.
   *
   * ---
   * Thank you for your desire to learn new things and challenge yourself every
   * day.
   */
  address constant _LEO = address(0xB2aebb2615a337e1611215A241AeB3607FdFC086);

  /*
   * This guy allowed a huge amount of devs and artists to enter the Web3 space
   * without "exclusive access fees". This required large investments and
   * dedication to something that could have filled someone else's bags for
   * nothing in return. But he did it anyway.
   * It is certainly thanks to his hard work and support that I am here to
   * launch this project.
   *
   * ---
   * Thank you Daniel for the trust and support you show me every day. I can't
   * wait to see all the things we will build together!
   */
  address constant _HASHLIPS = address(0x943590A42C27D08e3744202c4Ae5eD55c2dE240D);

  /*
   * I once called a complete stranger and told him about my idea to protect NFT
   * collections from snipers. Believe me when I say that there is a "me before
   * that call" and a "me after that call"... and those two are not the same
   * person.
   *
   * ---
   * Thank you D.R., that day I found at least two things:
   *   1) a huge opportunity
   *   2) a new good friend
   */
  address constant _D_R = address(0x97D348fe58478a1FA29de4726134815A57834880);

  /*
   * If you could put together the perfect mix of kindness and professionalism
   * in one person, then you would get a "Laina". But I'm pretty sure it is so
   * hard to achieve that she is probably a one-of-a-kind...
   *
   * ---
   * Thank you for your help and support. Your enthusiasm is a source of
   * motivation and great satisfaction.
   */
  address constant _LAINA = address(0x95A97387fa53052C38d66759167D07CB3861A1ec);

  /*
   * The way I got in touch with the DegenToonz community for the first time and
   * the stuff we did together after that day really prove that the web3 space
   * comes from another dimension. This is a once-in-a-lifetime opportunity and
   * we must not waste it.
   *
   * I can't wait to see what's next!
   *
   * ---
   * Thank you Bader and Prince for the trust and for being awesome partners.
   */
  address constant _PRINCE = address(0x85cbF39AfDB506CF9FA9A8Ea419c6De26C342cF0);
  address constant _BADER = address(0xD000874F10bFE76892C96aB0cF54861264455b1e);

  /*
   * Special thanks also go to the maintainers of the ERC721A project.
   * This collection is based on their codebase as most of the NFTs you can find
   * on any EVM-compatible chain.
   *
   * Disclaimer: this DOES NOT mean that this collection is officially endorsed
   *             or supported by any of them. We are simply using their open
   *             source library in our own project.
   *
   * ---
   * Thank you for your hard work. Your contribution to the NFT space is huge
   * and the educational value of your content on all platforms is priceless.
   */
  address constant _CYGAAR = address(0x6dacb7352B4eC1e2B979a05E3cF1F126AD641110);
  address constant _VECTORIZED = address(0x1F5D295778796a8b9f29600A585Ab73D452AcB1c);

  /*
   * The company MEP Srl is sponsoring my work since day one and it's providing
   * support with the launch of this project.
   *
   * ---
   * I wanna thank everyone for this great opportunity.
   */
  address constant _MEP = address(0x999Ee7a6734d06128F398741B604645A5e7C28E2);
}

File 2 of 15 : SmartCommunityWallet.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "../external/IWETH9.sol";
import "./NftToken.sol";

abstract contract SmartCommunityWallet is NftToken {
  enum WithdrawalType {
    REGULAR,
    INACTIVE_FUNDS,
    MINT_FUNDS
  }

  struct TokenData {
    uint256 tokenId;
    address ownerAddress;
    uint64 ownershipStartTimestamp;
    uint256 tokenBalance;
    uint64 ownerLatestActivityTimestamp;
  }

  uint256 public immutable DIAMOND_HANDS_HOLDER_TIME_FRAME;
  uint256 public immutable WHALE_ROLE_THRESHOLD;
  uint256 public immutable ADDRESS_INACTIVITY_TIME_FRAME;
  uint256 public immutable TRANSFER_COOLDOWN_AFTER_WITHDRAWAL;

  IWETH9 public immutable WETH_CONTRACT;

  address public immutable HASHLIPS_LAB_ADDRESS;
  uint256 public immutable HASHLIPS_LAB_MINT_SHARE;
  address public immutable MEP_ADDRESS;

  uint256 public communityBalance = 0;
  uint256 public mintFundsBalance = 0;
  uint256 public totalFundsRaisedByCommunity = 0;

  address public allowedAddressForCustomErc20TokensWithdrawal;

  bool public canUpdateAllowedAddressForCustomErc20TokensWithdrawal = true;

  mapping(uint256 => uint256) public tokenIdToWithdrawnAmount;

  event UntrackedFundsReceived(address indexed from, uint256 amount);
  event Donation(address indexed from, uint256 amount);
  event Withdrawal(WithdrawalType indexed withrawalType, address indexed to, uint256 amount);
  event CustomErc20Withdrawal(address indexed tokenContractAddress, address indexed to, uint256 amount);
  event UpdatedAllowedAddressForCustomErc20TokensWithdrawal(address newAllowedAddress);

  error InsufficientFunds();
  error FailedWithdrawingFunds();
  error TokenOwnershipDoesNotMatch();
  error InvalidDiamondHandsHolderToken();
  error TransferringTooEarlyAfterWithdrawal();
  error InvalidTokenId();
  error OnlyWhalesCanWithdrawOnBehalfOfInactiveAddresses();
  error TokenIsOwnedByAnActiveAddress();
  error CustomErc20TokensWithdrawalDenied();
  error CannotWithdrawWethFundsDirectly();
  error AllowedAddressForCustomErc20TokensWithdrawalIsFrozen();

  constructor(
    uint256 _diamondHandsHolderTimeFrame,
    uint256 _whaleRoleThreshold,
    uint256 _transferCooldownAfterWithdrawal,
    uint256 _addressInactivityTimeFrame,
    address _wethContractAddress,
    uint256 _hashLipsLabMintShare,
    address _hashLipsLabAddress,
    address _mepAddress
  ) {
    DIAMOND_HANDS_HOLDER_TIME_FRAME = _diamondHandsHolderTimeFrame;
    WHALE_ROLE_THRESHOLD = _whaleRoleThreshold;
    TRANSFER_COOLDOWN_AFTER_WITHDRAWAL = _transferCooldownAfterWithdrawal;
    ADDRESS_INACTIVITY_TIME_FRAME = _addressInactivityTimeFrame;

    WETH_CONTRACT = IWETH9(payable(_wethContractAddress));

    HASHLIPS_LAB_MINT_SHARE = _hashLipsLabMintShare;
    HASHLIPS_LAB_ADDRESS = _hashLipsLabAddress;

    MEP_ADDRESS = _mepAddress;

    allowedAddressForCustomErc20TokensWithdrawal = address(0);
  }

  receive() external payable {
    /*
     * Newly received funds are treated as "untracked" until
     * refreshWalletBalance() is run.
     */

     emit UntrackedFundsReceived(msg.sender, msg.value);
  }

  function donate() public payable {
    refreshWalletBalance();

    emit Donation(msg.sender, msg.value);
  }

  function getUntrackedFunds() public view returns (uint256) {
    uint256 rawUntrackedFunds = address(this).balance - communityBalance - mintFundsBalance;

    return rawUntrackedFunds - (rawUntrackedFunds % MAX_SUPPLY);
  }

  function refreshWalletBalance() public {
    _unwrapEth();

    uint256 untrackedFunds = getUntrackedFunds();
    uint256 totalSupply = totalSupply();

    totalFundsRaisedByCommunity += untrackedFunds;

    if (MAX_SUPPLY == totalSupply) {
      communityBalance += untrackedFunds;

      return;
    }

    uint256 communityShare = (untrackedFunds / MAX_SUPPLY) * totalSupply;
    communityBalance += communityShare;
    mintFundsBalance += untrackedFunds - communityShare;
  }

  function getLatestWithdrawalTimestamp(address _owner) public view returns (uint64) {
    return _getAux(_owner);
  }

  function refreshLatestWithdrawalTimestamp() public {
    _setAux(msg.sender, uint64(block.timestamp));
  }

  function getBalanceOfToken(uint256 _tokenId) public view returns (uint256) {
    if (!_exists(_tokenId)) {
      revert InvalidTokenId();
    }

    return _getBalanceOfToken(_tokenId);
  }

  function isDiamondHandsHolder(address _holder, uint256 _diamondHandsHolderTokenId) public view returns (bool) {
    TokenOwnership memory diamondHandsHolderTokenOwnership = _ownershipOf(_diamondHandsHolderTokenId);

    if (diamondHandsHolderTokenOwnership.addr != _holder) {
      revert TokenOwnershipDoesNotMatch();
    }

    if (diamondHandsHolderTokenOwnership.startTimestamp + DIAMOND_HANDS_HOLDER_TIME_FRAME > block.timestamp) {
      return false;
    }

    return true;
  }

  function isWhale(address _holder, uint256 _diamondHandsHolderTokenId) public view returns (bool) {
    return balanceOf(_holder) >= WHALE_ROLE_THRESHOLD && isDiamondHandsHolder(_holder, _diamondHandsHolderTokenId);
  }

  function withdraw(uint256 _diamondHandsHolderTokenId, uint256[] memory _tokenIds) public {
    uint256 withdrawableAmount = 0;

    if (!isDiamondHandsHolder(msg.sender, _diamondHandsHolderTokenId)) {
      revert InvalidDiamondHandsHolderToken();
    }

    refreshLatestWithdrawalTimestamp();

    for (uint16 i = 0; i < _tokenIds.length; i++) {
      if (ownerOf(_tokenIds[i]) != msg.sender) {
        revert TokenOwnershipDoesNotMatch();
      }

      withdrawableAmount += _resetWithdrawableAmount(_tokenIds[i]);
    }

    communityBalance -= withdrawableAmount;

    (bool transferSuccess, ) = payable(msg.sender).call{value: withdrawableAmount}('');

    if (!transferSuccess) {
      revert FailedWithdrawingFunds();
    }

    emit Withdrawal(WithdrawalType.REGULAR, msg.sender, withdrawableAmount);
  }

  function withdrawInactiveFunds(uint256 _diamondHandsHolderTokenId, uint256[] memory _tokenIds) public {
    uint256 withdrawableAmount = 0;

    if (!isWhale(msg.sender, _diamondHandsHolderTokenId)) {
      revert OnlyWhalesCanWithdrawOnBehalfOfInactiveAddresses();
    }

    refreshLatestWithdrawalTimestamp();

    for (uint16 i = 0; i < _tokenIds.length; i++) {
      /*
       * In order to avoid unauthorized withdrawals of new holders' funds we
       * have to make sure that both the latest withdrawal timestamp and the
       * ownership start timestamp are considered when verifying the latest
       * wallet activity.
       */
      uint64 latestWithdrawalTimestamp = getLatestWithdrawalTimestamp(ownerOf(_tokenIds[i]));
      uint64 ownershipStartTimestamp = _ownershipOf(_tokenIds[i]).startTimestamp;
      uint64 latestActivityTimestamp = latestWithdrawalTimestamp > ownershipStartTimestamp ? latestWithdrawalTimestamp : ownershipStartTimestamp;

      if (latestActivityTimestamp + ADDRESS_INACTIVITY_TIME_FRAME > block.timestamp) {
        revert TokenIsOwnedByAnActiveAddress();
      }

      withdrawableAmount += _resetWithdrawableAmount(_tokenIds[i]);
    }

    communityBalance -= withdrawableAmount;

    (bool transferSuccess, ) = payable(msg.sender).call{value: withdrawableAmount}('');

    if (!transferSuccess) {
      revert FailedWithdrawingFunds();
    }

    emit Withdrawal(WithdrawalType.INACTIVE_FUNDS, msg.sender, withdrawableAmount);
  }

  function withdrawMintFunds(uint256 _amount) public onlyOwner {
    if (_amount > mintFundsBalance) {
      revert InsufficientFunds();
    }

    uint256 hashLipsLabAmount = _amount * HASHLIPS_LAB_MINT_SHARE / 100;
    uint256 mepAmount = _amount - hashLipsLabAmount;
    mintFundsBalance -= _amount;

    // HashLips Lab
    // =============================================================================
    (bool transferSuccess, ) = payable(HASHLIPS_LAB_ADDRESS).call{value: hashLipsLabAmount}('');

    if (!transferSuccess) {
      revert FailedWithdrawingFunds();
    }

    emit Withdrawal(WithdrawalType.MINT_FUNDS, HASHLIPS_LAB_ADDRESS, hashLipsLabAmount);
    // =============================================================================

    // MEP
    // =============================================================================
    (transferSuccess, ) = payable(MEP_ADDRESS).call{value: mepAmount}('');

    if (!transferSuccess) {
      revert FailedWithdrawingFunds();
    }

    emit Withdrawal(WithdrawalType.MINT_FUNDS, MEP_ADDRESS, mepAmount);
    // =============================================================================
  }

  function withdrawCustomErc20Funds(address[] memory _erc20TokenAddresses) public {
    if (msg.sender != allowedAddressForCustomErc20TokensWithdrawal) {
      revert CustomErc20TokensWithdrawalDenied();
    }

    for (uint8 i = 0; i < _erc20TokenAddresses.length; i++) {
      address erc20TokenAddress = _erc20TokenAddresses[i];

      if (address(WETH_CONTRACT) == erc20TokenAddress) {
        revert CannotWithdrawWethFundsDirectly();
      }

      IERC20 erc20Token = IERC20(erc20TokenAddress);
      uint256 tokenBalance = erc20Token.balanceOf(address(this));

      if (!erc20Token.transfer(allowedAddressForCustomErc20TokensWithdrawal, tokenBalance)) {
        revert FailedWithdrawingFunds();
      }

      emit CustomErc20Withdrawal(erc20TokenAddress, msg.sender, tokenBalance);
    }
  }

  function updateAllowedAddressForCustomErc20TokensWithdrawal(address _newAllowedAddress) public onlyOwner {
    if (!canUpdateAllowedAddressForCustomErc20TokensWithdrawal) {
      revert AllowedAddressForCustomErc20TokensWithdrawalIsFrozen();
    }

    allowedAddressForCustomErc20TokensWithdrawal = _newAllowedAddress;

    emit UpdatedAllowedAddressForCustomErc20TokensWithdrawal(_newAllowedAddress);
  }

  function freezeAllowedAddressForCustomErc20TokensWithdrawal() public onlyOwner {
    canUpdateAllowedAddressForCustomErc20TokensWithdrawal = false;
  }

  function getTokenData(uint256 _tokenId) public view returns (TokenData memory) {
    TokenOwnership memory ownership = _ownershipOf(_tokenId);

    return TokenData(
      _tokenId,
      ownership.addr,
      ownership.startTimestamp,
      _getBalanceOfToken(_tokenId),
      getLatestWithdrawalTimestamp(ownership.addr)
    );
  }

  function getTokensData(uint256[] memory _tokenIds) public view returns (TokenData[] memory) {
    TokenData[] memory tokensData = new TokenData[](_tokenIds.length);

    for (uint256 i = 0; i < _tokenIds.length; i++) {
      tokensData[i] = getTokenData(_tokenIds[i]);
    }

    return tokensData;
  }

  function getTokensDataInRange(uint256 _startId, uint256 _stopId) public view returns (TokenData[] memory) {
    if (_startId < _startTokenId() || _stopId > totalSupply() || _startId > _stopId) {
      revert InvalidQueryRange();
    }

    _stopId++;

    TokenData[] memory tokensData = new TokenData[](_stopId - _startId);

    for (uint256 i = _startId; i < _stopId; i++) {
      tokensData[i - _startId] = getTokenData(i);
    }

    return tokensData;
  }

  function _getBalanceOfToken(uint256 _tokenId) internal view returns (uint256) {
    return (totalFundsRaisedByCommunity / MAX_SUPPLY) - tokenIdToWithdrawnAmount[_tokenId];
  }

  function _unwrapEth() private {
    uint256 wEthBalance = WETH_CONTRACT.balanceOf(address(this));

    if (wEthBalance != 0) {
      WETH_CONTRACT.withdraw(wEthBalance);
    }
  }

  function _resetWithdrawableAmount(uint256 _tokenId) internal returns (uint256) {
    uint256 withdrawableAmount = _getBalanceOfToken(_tokenId);

    tokenIdToWithdrawnAmount[_tokenId] += withdrawableAmount;

    return withdrawableAmount;
  }

  function _beforeMint(uint256 _startTokenId, uint256 _quantity) internal override {
    refreshWalletBalance();

    uint256 stopId = _startTokenId + _quantity;

    // Withdrawn funds of new tokens must be reset at mint
    for (uint256 i = _startTokenId; i < stopId; i++) {
      _resetWithdrawableAmount(i);
    }

    return;
  }

  function _beforeTokenTransfers(
    address _from,
    address /* _to */,
    uint256 /* _startTokenId */,
    uint256 /* _quantity */
  ) internal view override {
    if (getLatestWithdrawalTimestamp(_from) + TRANSFER_COOLDOWN_AFTER_WITHDRAWAL > block.timestamp) {
      revert TransferringTooEarlyAfterWithdrawal();
    }
  }
}

File 3 of 15 : IWETH9.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0;

interface IWETH9 {
    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

    function balanceOf(address) external view returns (uint);

    function allowance(address, address) external view returns (uint);

    receive() external payable;

    function deposit() external payable;

    function withdraw(uint wad) external;

    function totalSupply() external view returns (uint);

    function approve(address guy, uint wad) external returns (bool);

    function transfer(address dst, uint wad) external returns (bool);

    function transferFrom(address src, address dst, uint wad) external returns (bool);
}

File 4 of 15 : NftToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";

abstract contract NftToken is Ownable, ERC721AQueryable, IERC2981 {
  uint256 public immutable MAX_SUPPLY;
  uint256 public immutable TOKEN_PRICE;
  uint8 public immutable MAX_BATCH_SIZE;
  uint256 public immutable MINT_START_TIMESTAMP;

  error MintIsNotOpenYet();
  error InvalidMintPrice();
  error RequestedAmountExceedsMaxBatchSize();
  error RequestedAmountExceedsMaxSupply();
  error MetadataIsFrozen();
  error CannotFreezeMetadataBeforeReveal();

  bool public isMetadataFrozen = false;
  string uriPrefix = "";
  string hiddenMetadataUri = "";

  constructor(
    string memory _name,
    string memory _symbol,
    uint256 _maxSupply,
    uint256 _tokenPrice,
    uint8 _maxBatchSize,
    string memory _hiddenMetadataUri,
    uint256 _mintStartTimestamp
  ) ERC721A(_name, _symbol) {
    MAX_SUPPLY = _maxSupply;
    TOKEN_PRICE = _tokenPrice;
    MAX_BATCH_SIZE = _maxBatchSize;
    MINT_START_TIMESTAMP = _mintStartTimestamp;

    setHiddenMetadataUri(_hiddenMetadataUri);
  }

  function _beforeMint(uint256 _startTokenId, uint256 _quantity) internal virtual;

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

  function mint(uint256 _amount) public payable {
    if (block.timestamp < MINT_START_TIMESTAMP) {
      revert MintIsNotOpenYet();
    }

    if (msg.value != TOKEN_PRICE * _amount) {
      revert InvalidMintPrice();
    }

    if (_amount > MAX_BATCH_SIZE) {
      revert RequestedAmountExceedsMaxBatchSize();
    }

    if (totalSupply() + _amount > MAX_SUPPLY) {
      revert RequestedAmountExceedsMaxSupply();
    }

    _beforeMint(_nextTokenId(), _amount);
    _safeMint(msg.sender, _amount);
  }

  function freezeMetadata() public onlyOwner {
    if (bytes(uriPrefix).length == 0) {
      revert CannotFreezeMetadataBeforeReveal();
    }

    isMetadataFrozen = true;
  }

  function setUriPrefix(string memory _uriPrefix) public onlyOwner {
    if (isMetadataFrozen) {
      revert MetadataIsFrozen();
    }

    uriPrefix = _uriPrefix;
  }

  function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner {
    if (isMetadataFrozen) {
      revert MetadataIsFrozen();
    }

    hiddenMetadataUri = _hiddenMetadataUri;
  }

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

    if (bytes(uriPrefix).length == 0) {
      return hiddenMetadataUri;
    }

    return string(abi.encodePacked(uriPrefix, Strings.toString(_tokenId), ".json"));
  }

  function royaltyInfo(uint256 /* _tokenId */, uint256 _salePrice) public view virtual override returns (address, uint256) {
    /*
     * This function enables support for the EIP-2981 standard
     * (https://eips.ethereum.org/EIPS/eip-2981).
     *
     * This means that the contract will suggest a royalty fee of 7% of the sale
     * price to be sent to itself (the Smart Community Wallet) so that it will
     * be split among all the holders without intermediaries.
     *
     * Please keep in mind that it's up to the end-users and/or to the
     * marketplace to second the suggestion.
     */

    return (address(this), _salePrice * 7 / 100);
  }

  function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) {
    return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
  }
}

File 5 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 6 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

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

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

File 7 of 15 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_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) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

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

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

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

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

File 8 of 15 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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);
}

File 9 of 15 : ERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721AQueryable.sol';
import '../ERC721A.sol';

/**
 * @title ERC721AQueryable.
 *
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) {
        TokenOwnership memory ownership;
        if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {
            return ownership;
        }
        ownership = _ownershipAt(tokenId);
        if (ownership.burned) {
            return ownership;
        }
        return _ownershipOf(tokenId);
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] calldata tokenIds)
        external
        view
        virtual
        override
        returns (TokenOwnership[] memory)
    {
        unchecked {
            uint256 tokenIdsLength = tokenIds.length;
            TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
            for (uint256 i; i != tokenIdsLength; ++i) {
                ownerships[i] = explicitOwnershipOf(tokenIds[i]);
            }
            return ownerships;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view virtual override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) revert InvalidQueryRange();
            uint256 tokenIdsIdx;
            uint256 stopLimit = _nextTokenId();
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            // Set `stop = min(stop, stopLimit)`.
            if (stop > stopLimit) {
                stop = stopLimit;
            }
            uint256 tokenIdsMaxLength = balanceOf(owner);
            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
            // to cater for cases where `balanceOf(owner)` is too big.
            if (start < stop) {
                uint256 rangeLength = stop - start;
                if (rangeLength < tokenIdsMaxLength) {
                    tokenIdsMaxLength = rangeLength;
                }
            } else {
                tokenIdsMaxLength = 0;
            }
            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
            if (tokenIdsMaxLength == 0) {
                return tokenIds;
            }
            // We need to call `explicitOwnershipOf(start)`,
            // because the slot at `start` may not be initialized.
            TokenOwnership memory ownership = explicitOwnershipOf(start);
            address currOwnershipAddr;
            // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.
            // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.
            if (!ownership.burned) {
                currOwnershipAddr = ownership.addr;
            }
            for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            // Downsize the array to fit.
            assembly {
                mstore(tokenIds, tokenIdsIdx)
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            TokenOwnership memory ownership;
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }
}

File 10 of 15 : Context.sol
// 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;
    }
}

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

pragma solidity ^0.8.0;

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

File 12 of 15 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of ERC721AQueryable.
 */
interface IERC721AQueryable is IERC721A {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory);
}

File 13 of 15 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

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

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

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

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

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

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

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

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

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

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
    }

    /**
     * @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, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & _BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an initialized ownership slot
                        // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                        // before an unintialized ownership slot
                        // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                        // Hence, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @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) public payable virtual override {
        address owner = ownerOf(tokenId);

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

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @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) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

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

    /**
     * @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. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

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

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @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 memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

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

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

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

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

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

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

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

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

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

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

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

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

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

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

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

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }
}

File 14 of 15 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

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

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

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

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

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

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

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

    /**
     * @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 payable;

    /**
     * @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);

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @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);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

File 15 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AllowedAddressForCustomErc20TokensWithdrawalIsFrozen","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CannotFreezeMetadataBeforeReveal","type":"error"},{"inputs":[],"name":"CannotWithdrawWethFundsDirectly","type":"error"},{"inputs":[],"name":"CustomErc20TokensWithdrawalDenied","type":"error"},{"inputs":[],"name":"FailedWithdrawingFunds","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidDiamondHandsHolderToken","type":"error"},{"inputs":[],"name":"InvalidMintPrice","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"InvalidTokenId","type":"error"},{"inputs":[],"name":"MetadataIsFrozen","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintIsNotOpenYet","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OnlyWhalesCanWithdrawOnBehalfOfInactiveAddresses","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"RequestedAmountExceedsMaxBatchSize","type":"error"},{"inputs":[],"name":"RequestedAmountExceedsMaxSupply","type":"error"},{"inputs":[],"name":"TokenIsOwnedByAnActiveAddress","type":"error"},{"inputs":[],"name":"TokenOwnershipDoesNotMatch","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"TransferringTooEarlyAfterWithdrawal","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenContractAddress","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CustomErc20Withdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Donation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UntrackedFundsReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAllowedAddress","type":"address"}],"name":"UpdatedAllowedAddressForCustomErc20TokensWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"enum SmartCommunityWallet.WithdrawalType","name":"withrawalType","type":"uint8"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"ADDRESS_INACTIVITY_TIME_FRAME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DIAMOND_HANDS_HOLDER_TIME_FRAME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HASHLIPS_LAB_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HASHLIPS_LAB_MINT_SHARE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BATCH_SIZE","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MEP_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_START_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRANSFER_COOLDOWN_AFTER_WITHDRAWAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH_CONTRACT","outputs":[{"internalType":"contract IWETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHALE_ROLE_THRESHOLD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowedAddressForCustomErc20TokensWithdrawal","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canUpdateAllowedAddressForCustomErc20TokensWithdrawal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"communityBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"donate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeAllowedAddressForCustomErc20TokensWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freezeMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getBalanceOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getLatestWithdrawalTimestamp","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenData","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"ownerAddress","type":"address"},{"internalType":"uint64","name":"ownershipStartTimestamp","type":"uint64"},{"internalType":"uint256","name":"tokenBalance","type":"uint256"},{"internalType":"uint64","name":"ownerLatestActivityTimestamp","type":"uint64"}],"internalType":"struct SmartCommunityWallet.TokenData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"getTokensData","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"ownerAddress","type":"address"},{"internalType":"uint64","name":"ownershipStartTimestamp","type":"uint64"},{"internalType":"uint256","name":"tokenBalance","type":"uint256"},{"internalType":"uint64","name":"ownerLatestActivityTimestamp","type":"uint64"}],"internalType":"struct SmartCommunityWallet.TokenData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startId","type":"uint256"},{"internalType":"uint256","name":"_stopId","type":"uint256"}],"name":"getTokensDataInRange","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"ownerAddress","type":"address"},{"internalType":"uint64","name":"ownershipStartTimestamp","type":"uint64"},{"internalType":"uint256","name":"tokenBalance","type":"uint256"},{"internalType":"uint64","name":"ownerLatestActivityTimestamp","type":"uint64"}],"internalType":"struct SmartCommunityWallet.TokenData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUntrackedFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_holder","type":"address"},{"internalType":"uint256","name":"_diamondHandsHolderTokenId","type":"uint256"}],"name":"isDiamondHandsHolder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMetadataFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_holder","type":"address"},{"internalType":"uint256","name":"_diamondHandsHolderTokenId","type":"uint256"}],"name":"isWhale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintFundsBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refreshLatestWithdrawalTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"refreshWalletBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_hiddenMetadataUri","type":"string"}],"name":"setHiddenMetadataUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uriPrefix","type":"string"}],"name":"setUriPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToWithdrawnAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalFundsRaisedByCommunity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAllowedAddress","type":"address"}],"name":"updateAllowedAddressForCustomErc20TokensWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_diamondHandsHolderTokenId","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_erc20TokenAddresses","type":"address[]"}],"name":"withdrawCustomErc20Funds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_diamondHandsHolderTokenId","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"withdrawInactiveFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawMintFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6009805460ff19169055610220604081905260006102008190526200002791600a9162000605565b506040805160208101918290526000908190526200004891600b9162000605565b506000600c819055600d819055600e55600f805460ff60a01b1916600160a01b1790553480156200007857600080fd5b506276a7006014620151806303c2670073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2600273943590a42c27d08e3744202c4ae5ed55c2de240d73999ee7a6734d06128f398741b604645a5e7c28e26040518060400160405280600c81526020016b4f70656e446576734372657760a01b815250604051806040016040528060038152602001624f444360e81b8152506107c667016345785d8a0000600a6040518060600160405280603a815260200162004148603a913963635c0a9086866200014433620003c0565b81516200015990600390602085019062000605565b5080516200016f90600490602084019062000605565b50600180555050608085905260a084905260ff831660c05260e0819052620001978262000410565b5050506101009b909b525050506101209690965261016094909452610140929092526001600160a01b03908116610180526101c0919091529081166101a052166101e05250600f80546001600160a01b03191690556200020d734af801f7dac719a91f43b24ff0b68e2e422fe37b600a62000458565b6200022e734372ec603b4e4ddee322b6d00236854924d5dc95600162000458565b6200024f7319a7ef7bc82668358e985789c787bd7bd197def9600562000458565b62000270735d3baddfb2f0ad614bc073b269cc7c51f392108f600162000458565b620002917342e4a2c9710451ab3313398ac888738979476584600262000458565b620002b273e06a96e8046f63370942452dd5dfbc27035c4765600262000458565b620002d373b2aebb2615a337e1611215a241aeb3607fdfc086600162000458565b620002f473943590a42c27d08e3744202c4ae5ed55c2de240d600162000458565b620003157397d348fe58478a1fa29de4726134815a57834880600162000458565b620003367395a97387fa53052c38d66759167d07cb3861a1ec600162000458565b6200035773d000874f10bfe76892c96ab0cf54861264455b1e600162000458565b620003787385cbf39afdb506cf9fa9a8ea419c6de26c342cf0600162000458565b62000399736dacb7352b4ec1e2b979a05e3cf1f126ad641110600162000458565b620003ba731f5d295778796a8b9f29600a585ab73d452acb1c600162000458565b6200070f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6200041a62000540565b60095460ff16156200043f5760405163b087bbf360e01b815260040160405180910390fd5b80516200045490600b90602084019062000605565b5050565b600154816200047a5760405163b562e8dd60e01b815260040160405180910390fd5b620004896000848385620005a1565b6001600160a01b03831660008181526006602090815260408083208054680100000000000000018802019055848352600590915281206001851460e11b4260a01b17831790558284019083908390600080516020620041828339815191528180a4600183015b81811462000518578083600060008051602062004182833981519152600080a4600101620004ef565b50816200053757604051622e076360e81b815260040160405180910390fd5b60015550505050565b6000546001600160a01b031633146200059f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b565b610160514290620005ca866001600160a01b031660009081526006602052604090205460c01c90565b6001600160401b0316620005df9190620006ab565b1115620005ff57604051633670683160e11b815260040160405180910390fd5b50505050565b8280546200061390620006d2565b90600052602060002090601f01602090048101928262000637576000855562000682565b82601f106200065257805160ff191683800117855562000682565b8280016001018555821562000682579182015b828111156200068257825182559160200191906001019062000665565b506200069092915062000694565b5090565b5b8082111562000690576000815560010162000695565b60008219821115620006cd57634e487b7160e01b600052601160045260246000fd5b500190565b600181811c90821680620006e757607f821691505b602082108114156200070957634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161391b6200082d60003960008181610a5c01528181610e850152610f130152600081816107b50152610d32015260008181610a2801528181610d980152610e2301526000818161081e01528181611814015281816129c30152612a5401526000818161088801526128880152600081816104030152611d1f015260008181610c1501526123a6015260008181610509015261115d015260008181610b250152611fcb015260008181610b590152612055015260008181610bb4015261201001526000818161064701528181611bae01528181611bf7015281816120990152818161261301526127b8015261391b6000f3fe6080604052600436106103b05760003560e01c806382651e28116101e7578063b88d4fde1161010d578063d2d8cb67116100a0578063ed88c68e1161006f578063ed88c68e14610c80578063edc0ca4214610c88578063f0a7481b14610c9d578063f2fde38b14610cb357600080fd5b8063d2d8cb6714610ba2578063d33819a814610bd6578063d6de604414610c03578063e985e9c514610c3757600080fd5b8063c87b56dd116100dc578063c87b56dd14610af3578063cec2a29514610b13578063cfdbf25414610b47578063d111515d14610b8d57600080fd5b8063b88d4fde14610a7e578063b898768114610a91578063b9d4cbd714610aa6578063c23dc68f14610ac657600080fd5b806395d89b4111610185578063a22cb46511610154578063a22cb465146109c9578063b09afec1146109e9578063b3aee7ef14610a16578063b4f84cc714610a4a57600080fd5b806395d89b411461096157806399a2557a14610976578063a0712d6814610996578063a1ccaf7e146109a957600080fd5b80638da5cb5b116101c15780638da5cb5b146108f85780638e4cbc83146109165780639395b0871461092c57806394473f011461094157600080fd5b806382651e28146108765780638462151c146108aa57806384eb3318146108d757600080fd5b806332cb6b0c116102d75780635f4aff181161026a578063715018a611610239578063715018a6146107f757806378a3b8231461080c5780637e2214ef146108405780637ec4a6591461085657600080fd5b80635f4aff18146107635780636352211e146107835780636397766f146107a357806370a08231146107d757600080fd5b80634fdd43cb116102a65780634fdd43cb146106e15780635915d806146107015780635bbb2177146107215780635ee8ab041461074e57600080fd5b806332cb6b0c146106355780633dfd542c1461066957806342842e0e146106a15780634b2ee8f8146106b457600080fd5b80630e24495e1161034f57806323b872dd1161031e57806323b872dd146105a357806329ef9c2c146105b65780632a55205a146105d65780632eed80ca1461061557600080fd5b80630e24495e1461052b5780630f185936146105455780631085432f1461056557806318160ddd1461058557600080fd5b806306fdde031161038b57806306fdde031461048a578063081812fc146104ac578063095ea7b3146104e45780630da4693f146104f757600080fd5b806285fe65146103f157806301ffc9a71461043857806302603a391461046857600080fd5b366103ec5760405134815233907f48eecbf8d7be7e10b0c0ab44a0f618c0df5cc32fde648f6368d154973a3e2fc69060200160405180910390a2005b600080fd5b3480156103fd57600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561044457600080fd5b50610458610453366004612f57565b610cd3565b604051901515815260200161042f565b34801561047457600080fd5b50610488610483366004612f74565b610cfe565b005b34801561049657600080fd5b5061049f610f6f565b60405161042f9190612fe5565b3480156104b857600080fd5b506104cc6104c7366004612f74565b611001565b6040516001600160a01b03909116815260200161042f565b6104886104f2366004613014565b611045565b34801561050357600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b34801561053757600080fd5b506009546104589060ff1681565b34801561055157600080fd5b50610425610560366004612f74565b6110e5565b34801561057157600080fd5b50610458610580366004613014565b611116565b34801561059157600080fd5b50610425600254600154036000190190565b6104886105b136600461303e565b6111ae565b3480156105c257600080fd5b50600f546104cc906001600160a01b031681565b3480156105e257600080fd5b506105f66105f136600461307a565b61134c565b604080516001600160a01b03909316835260208301919091520161042f565b34801561062157600080fd5b5061048861063036600461309c565b611372565b34801561064157600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b34801561067557600080fd5b5061068961068436600461309c565b6113f8565b6040516001600160401b03909116815260200161042f565b6104886106af36600461303e565b611419565b3480156106c057600080fd5b506106d46106cf36600461318b565b611439565b60405161042f9190613204565b3480156106ed57600080fd5b506104886106fc36600461329d565b611517565b34801561070d57600080fd5b5061048861071c3660046132e5565b61155a565b34801561072d57600080fd5b5061074161073c36600461332b565b6116be565b60405161042f91906133db565b34801561075a57600080fd5b50610488611789565b34801561076f57600080fd5b5061048861077e36600461341d565b6117ae565b34801561078f57600080fd5b506104cc61079e366004612f74565b6119b3565b3480156107af57600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b3480156107e357600080fd5b506104256107f236600461309c565b6119be565b34801561080357600080fd5b50610488611a0c565b34801561081857600080fd5b506104cc7f000000000000000000000000000000000000000000000000000000000000000081565b34801561084c57600080fd5b50610425600d5481565b34801561086257600080fd5b5061048861087136600461329d565b611a1e565b34801561088257600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b3480156108b657600080fd5b506108ca6108c536600461309c565b611a5d565b60405161042f91906134b4565b3480156108e357600080fd5b50600f5461045890600160a01b900460ff1681565b34801561090457600080fd5b506000546001600160a01b03166104cc565b34801561092257600080fd5b50610425600c5481565b34801561093857600080fd5b50610488611b6c565b34801561094d57600080fd5b5061048861095c3660046132e5565b611c65565b34801561096d57600080fd5b5061049f611e2f565b34801561098257600080fd5b506108ca6109913660046134ec565b611e3e565b6104886109a4366004612f74565b611fc9565b3480156109b557600080fd5b506106d46109c436600461307a565b612112565b3480156109d557600080fd5b506104886109e436600461352d565b61223b565b3480156109f557600080fd5b50610a09610a04366004612f74565b6122a7565b60405161042f9190613564565b348015610a2257600080fd5b506104cc7f000000000000000000000000000000000000000000000000000000000000000081565b348015610a5657600080fd5b506104cc7f000000000000000000000000000000000000000000000000000000000000000081565b610488610a8c366004613572565b612341565b348015610a9d57600080fd5b5061048861238b565b348015610ab257600080fd5b50610458610ac1366004613014565b6123a2565b348015610ad257600080fd5b50610ae6610ae1366004612f74565b6123e1565b60405161042f91906135ed565b348015610aff57600080fd5b5061049f610b0e366004612f74565b612469565b348015610b1f57600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b348015610b5357600080fd5b50610b7b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff909116815260200161042f565b348015610b9957600080fd5b5061048861256a565b348015610bae57600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b348015610be257600080fd5b50610425610bf1366004612f74565b60106020526000908152604090205481565b348015610c0f57600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b348015610c4357600080fd5b50610458610c523660046135fb565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6104886125af565b348015610c9457600080fd5b506104256125ee565b348015610ca957600080fd5b50610425600e5481565b348015610cbf57600080fd5b50610488610cce36600461309c565b612648565b60006001600160e01b0319821663152a902d60e11b1480610cf85750610cf8826126c3565b92915050565b610d06612711565b600d54811115610d295760405163356680b760e01b815260040160405180910390fd5b60006064610d577f000000000000000000000000000000000000000000000000000000000000000084613644565b610d619190613679565b90506000610d6f828461368d565b905082600d6000828254610d83919061368d565b90915550506040516000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169084908381818185875af1925050503d8060008114610df3576040519150601f19603f3d011682016040523d82523d6000602084013e610df8565b606091505b5050905080610e195760405162b845ad60e71b815260040160405180910390fd5b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660026040518581527ff8e30dbf1118fc6e5d75ebae65199193b14ec45bae8eedc935f31458e399bcf89060200160405180910390a36040516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016908390600081818185875af1925050503d8060008114610ee1576040519150601f19603f3d011682016040523d82523d6000602084013e610ee6565b606091505b50508091505080610f095760405162b845ad60e71b815260040160405180910390fd5b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660025b6040518481527ff8e30dbf1118fc6e5d75ebae65199193b14ec45bae8eedc935f31458e399bcf89060200160405180910390a350505050565b606060038054610f7e906136a4565b80601f0160208091040260200160405190810160405280929190818152602001828054610faa906136a4565b8015610ff75780601f10610fcc57610100808354040283529160200191610ff7565b820191906000526020600020905b815481529060010190602001808311610fda57829003601f168201915b5050505050905090565b600061100c8261276b565b611029576040516333d1c03960e21b815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b6000611050826119b3565b9050336001600160a01b038216146110895761106c8133610c52565b611089576040516367d9dca160e11b815260040160405180910390fd5b60008281526007602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006110f08261276b565b61110d576040516307ed98ed60e31b815260040160405180910390fd5b610cf8826127a0565b600080611122836127e7565b9050836001600160a01b031681600001516001600160a01b03161461115a57604051632dfa89a760e11b815260040160405180910390fd5b427f000000000000000000000000000000000000000000000000000000000000000082602001516001600160401b031661119491906136df565b11156111a4576000915050610cf8565b5060019392505050565b60006111b98261281c565b9050836001600160a01b0316816001600160a01b0316146111ec5760405162a1148160e81b815260040160405180910390fd5b60008281526007602052604090208054338082146001600160a01b038816909114176112395761121c8633610c52565b61123957604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661126057604051633a954ecd60e21b815260040160405180910390fd5b61126d8686866001612885565b801561127857600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040902055600160e11b831661130357600184016000818152600560205260409020546113015760015481146113015760008181526005602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b60008030606461135d856007613644565b6113679190613679565b915091509250929050565b61137a612711565b600f54600160a01b900460ff166113a457604051636043fd7560e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f4fe3ac41736d507e306686f3d31c4042ad2e00e90a2009dc2fb2ccce7d455e2e9060200160405180910390a150565b6001600160a01b03811660009081526006602052604081205460c01c610cf8565b61143483838360405180602001604052806000815250612341565b505050565b6060600082516001600160401b03811115611456576114566130b7565b6040519080825280602002602001820160405280156114af57816020015b6040805160a0810182526000808252602080830182905292820181905260608201819052608082015282526000199092019101816114745790505b50905060005b8351811015611510576114e08482815181106114d3576114d36136f7565b60200260200101516122a7565b8282815181106114f2576114f26136f7565b602002602001018190525080806115089061370d565b9150506114b5565b5092915050565b61151f612711565b60095460ff16156115435760405163b087bbf360e01b815260040160405180910390fd5b805161155690600b906020840190612ea8565b5050565b60006115663384611116565b61158357604051630715a23760e01b815260040160405180910390fd5b61158b611789565b60005b82518161ffff16101561163657336001600160a01b03166115cb848361ffff16815181106115be576115be6136f7565b60200260200101516119b3565b6001600160a01b0316146115f257604051632dfa89a760e11b815260040160405180910390fd5b611618838261ffff168151811061160b5761160b6136f7565b60200260200101516128e2565b61162290836136df565b91508061162e81613728565b91505061158e565b5080600c6000828254611649919061368d565b9091555050604051600090339083908381818185875af1925050503d8060008114611690576040519150601f19603f3d011682016040523d82523d6000602084013e611695565b606091505b50509050806116b65760405162b845ad60e71b815260040160405180910390fd5b336000610f36565b6060816000816001600160401b038111156116db576116db6130b7565b60405190808252806020026020018201604052801561172d57816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816116f95790505b50905060005b8281146117805761175b86868381811061174f5761174f6136f7565b905060200201356123e1565b82828151811061176d5761176d6136f7565b6020908102919091010152600101611733565b50949350505050565b33600090815260066020526040902080546001600160c01b03164260c01b179055565b565b600f546001600160a01b031633146117d8576040516275057360e71b815260040160405180910390fd5b60005b81518160ff161015611556576000828260ff16815181106117fe576117fe6136f7565b60200260200101519050806001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316141561185b576040516350c6a56160e01b815260040160405180910390fd5b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156118a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c8919061374a565b600f5460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810183905291925083169063a9059cbb906044016020604051808303816000875af115801561191d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119419190613763565b61195d5760405162b845ad60e71b815260040160405180910390fd5b60405181815233906001600160a01b038516907ff739a0ab172261f2e4e9486fbdca8c228e7d3048da91df26d4a91f69fb47edb99060200160405180910390a350505080806119ab90613780565b9150506117db565b6000610cf88261281c565b60006001600160a01b0382166119e7576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600660205260409020546001600160401b031690565b611a14612711565b6117ac600061291f565b611a26612711565b60095460ff1615611a4a5760405163b087bbf360e01b815260040160405180910390fd5b805161155690600a906020840190612ea8565b60606000806000611a6d856119be565b90506000816001600160401b03811115611a8957611a896130b7565b604051908082528060200260200182016040528015611ab2578160200160208202803683370190505b509050611adf60408051608081018252600080825260208201819052918101829052606081019190915290565b60015b838614611b6057611af28161296f565b9150816040015115611b0357611b58565b81516001600160a01b031615611b1857815194505b876001600160a01b0316856001600160a01b03161415611b585780838780600101985081518110611b4b57611b4b6136f7565b6020026020010181815250505b600101611ae2565b50909695505050505050565b611b746129ab565b6000611b7e6125ee565b90506000611b93600254600154036000190190565b905081600e6000828254611ba791906136df565b90915550507f0000000000000000000000000000000000000000000000000000000000000000811415611bef5781600c6000828254611be691906136df565b90915550505050565b600081611c1c7f000000000000000000000000000000000000000000000000000000000000000085613679565b611c269190613644565b905080600c6000828254611c3a91906136df565b90915550611c4a9050818461368d565b600d6000828254611c5b91906136df565b9091555050505050565b6000611c7133846123a2565b611c8e57604051636457ea4d60e01b815260040160405180910390fd5b611c96611789565b60005b82518161ffff161015611da7576000611cc4610684858461ffff16815181106115be576115be6136f7565b90506000611cee858461ffff1681518110611ce157611ce16136f7565b60200260200101516127e7565b6020015190506000816001600160401b0316836001600160401b031611611d155781611d17565b825b905042611d4d7f00000000000000000000000000000000000000000000000000000000000000006001600160401b0384166136df565b1115611d6c57604051638f329e2960e01b815260040160405180910390fd5b611d85868561ffff168151811061160b5761160b6136f7565b611d8f90866136df565b94505050508080611d9f90613728565b915050611c99565b5080600c6000828254611dba919061368d565b9091555050604051600090339083908381818185875af1925050503d8060008114611e01576040519150601f19603f3d011682016040523d82523d6000602084013e611e06565b606091505b5050905080611e275760405162b845ad60e71b815260040160405180910390fd5b336001610f36565b606060048054610f7e906136a4565b6060818310611e6057604051631960ccad60e11b815260040160405180910390fd5b600080611e6c60015490565b90506001851015611e7c57600194505b80841115611e88578093505b6000611e93876119be565b905084861015611eb25785850381811015611eac578091505b50611eb6565b5060005b6000816001600160401b03811115611ed057611ed06130b7565b604051908082528060200260200182016040528015611ef9578160200160208202803683370190505b50905081611f0c579350611fc292505050565b6000611f17886123e1565b905060008160400151611f28575080515b885b888114158015611f3a5750848714155b15611fb657611f488161296f565b9250826040015115611f5957611fae565b82516001600160a01b031615611f6e57825191505b8a6001600160a01b0316826001600160a01b03161415611fae5780848880600101995081518110611fa157611fa16136f7565b6020026020010181815250505b600101611f2a565b50505092835250909150505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000042101561200a5760405163567f16b160e01b815260040160405180910390fd5b612034817f0000000000000000000000000000000000000000000000000000000000000000613644565b34146120535760405163020b5e0b60e11b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000060ff16811115612097576040516378ed7baf60e11b815260040160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000000000816120ca600254600154036000190190565b6120d491906136df565b11156120f35760405163855dadcb60e01b815260040160405180910390fd5b6121056120ff60015490565b82612abb565b61210f3382612af7565b50565b60606001831080612132575061212f600254600154036000190190565b82115b8061213c57508183115b1561215a57604051631960ccad60e11b815260040160405180910390fd5b816121648161370d565b925060009050612174848461368d565b6001600160401b0381111561218b5761218b6130b7565b6040519080825280602002602001820160405280156121e457816020015b6040805160a0810182526000808252602080830182905292820181905260608201819052608082015282526000199092019101816121a95790505b509050835b83811015612233576121fa816122a7565b82612205878461368d565b81518110612215576122156136f7565b6020026020010181905250808061222b9061370d565b9150506121e9565b509392505050565b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906122db836127e7565b90506040518060a0016040528084815260200182600001516001600160a01b0316815260200182602001516001600160401b0316815260200161231d856127a0565b815260200161232f83600001516113f8565b6001600160401b031690529392505050565b61234c8484846111ae565b6001600160a01b0383163b156123855761236884848484612b11565b612385576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b612393612711565b600f805460ff60a01b19169055565b60007f00000000000000000000000000000000000000000000000000000000000000006123ce846119be565b10158015611fc25750611fc28383611116565b604080516080810182526000808252602082018190529181018290526060810191909152604080516080810182526000808252602082018190529181018290526060810191909152600183108061243a57506001548310155b156124455792915050565b61244e8361296f565b90508060400151156124605792915050565b611fc2836127e7565b60606124748261276b565b61249157604051630a14c4b560e41b815260040160405180910390fd5b600a805461249e906136a4565b1515905061253857600b80546124b3906136a4565b80601f01602080910402602001604051908101604052809291908181526020018280546124df906136a4565b801561252c5780601f106125015761010080835404028352916020019161252c565b820191906000526020600020905b81548152906001019060200180831161250f57829003601f168201915b50505050509050919050565b600a61254383612bfa565b6040516020016125549291906137bc565b6040516020818303038152906040529050919050565b612572612711565b600a805461257f906136a4565b151590506125a057604051639010c6a560e01b815260040160405180910390fd5b6009805460ff19166001179055565b6125b7611b6c565b60405134815233907f5d8bc849764969eb1bcc6d0a2f55999d0167c1ccec240a4f39cf664ca9c4148e9060200160405180910390a2565b600080600d54600c5447612602919061368d565b61260c919061368d565b90506126387f000000000000000000000000000000000000000000000000000000000000000082613877565b612642908261368d565b91505090565b612650612711565b6001600160a01b0381166126ba5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61210f8161291f565b60006301ffc9a760e01b6001600160e01b0319831614806126f457506380ac58cd60e01b6001600160e01b03198316145b80610cf85750506001600160e01b031916635b5e139f60e01b1490565b6000546001600160a01b031633146117ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016126b1565b60008160011115801561277f575060015482105b8015610cf8575050600090815260056020526040902054600160e01b161590565b600081815260106020526040812054600e546127dd907f000000000000000000000000000000000000000000000000000000000000000090613679565b610cf8919061368d565b604080516080810182526000808252602082018190529181018290526060810191909152610cf86128178361281c565b612cf7565b6000818060011161286c5760015481101561286c57600081815260056020526040902054600160e01b811661286a575b80611fc257506000190160008181526005602052604090205461284c565b505b604051636f96cda160e11b815260040160405180910390fd5b427f00000000000000000000000000000000000000000000000000000000000000006128b0866113f8565b6001600160401b03166128c391906136df565b111561238557604051633670683160e11b815260040160405180910390fd5b6000806128ee836127a0565b90508060106000858152602001908152602001600020600082825461291391906136df565b90915550909392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260056020526040902054610cf890612cf7565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a36919061374a565b9050801561210f57604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015612aa057600080fd5b505af1158015612ab4573d6000803e3d6000fd5b5050505050565b612ac3611b6c565b6000612acf82846136df565b9050825b8181101561238557612ae4816128e2565b5080612aef8161370d565b915050612ad3565b611556828260405180602001604052806000815250612d3e565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612b4690339089908890889060040161388b565b6020604051808303816000875af1925050508015612b81575060408051601f3d908101601f19168201909252612b7e918101906138c8565b60015b612bdc573d808015612baf576040519150601f19603f3d011682016040523d82523d6000602084013e612bb4565b606091505b508051612bd4576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606081612c1e5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612c485780612c328161370d565b9150612c419050600a83613679565b9150612c22565b6000816001600160401b03811115612c6257612c626130b7565b6040519080825280601f01601f191660200182016040528015612c8c576020820181803683370190505b5090505b8415612bf257612ca160018361368d565b9150612cae600a86613877565b612cb99060306136df565b60f81b818381518110612cce57612cce6136f7565b60200101906001600160f81b031916908160001a905350612cf0600a86613679565b9450612c90565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b612d488383612da4565b6001600160a01b0383163b15611434576001548281035b612d726000868380600101945086612b11565b612d8f576040516368d2bf6b60e11b815260040160405180910390fd5b818110612d5f578160015414612ab457600080fd5b60015481612dc55760405163b562e8dd60e01b815260040160405180910390fd5b612dd26000848385612885565b6001600160a01b03831660008181526006602090815260408083208054680100000000000000018802019055848352600590915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612e8157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612e49565b5081612e9f57604051622e076360e81b815260040160405180910390fd5b60015550505050565b828054612eb4906136a4565b90600052602060002090601f016020900481019282612ed65760008555612f1c565b82601f10612eef57805160ff1916838001178555612f1c565b82800160010185558215612f1c579182015b82811115612f1c578251825591602001919060010190612f01565b50612f28929150612f2c565b5090565b5b80821115612f285760008155600101612f2d565b6001600160e01b03198116811461210f57600080fd5b600060208284031215612f6957600080fd5b8135611fc281612f41565b600060208284031215612f8657600080fd5b5035919050565b60005b83811015612fa8578181015183820152602001612f90565b838111156123855750506000910152565b60008151808452612fd1816020860160208601612f8d565b601f01601f19169290920160200192915050565b602081526000611fc26020830184612fb9565b80356001600160a01b038116811461300f57600080fd5b919050565b6000806040838503121561302757600080fd5b61303083612ff8565b946020939093013593505050565b60008060006060848603121561305357600080fd5b61305c84612ff8565b925061306a60208501612ff8565b9150604084013590509250925092565b6000806040838503121561308d57600080fd5b50508035926020909101359150565b6000602082840312156130ae57600080fd5b611fc282612ff8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156130f5576130f56130b7565b604052919050565b60006001600160401b03821115613116576131166130b7565b5060051b60200190565b600082601f83011261313157600080fd5b81356020613146613141836130fd565b6130cd565b82815260059290921b8401810191818101908684111561316557600080fd5b8286015b848110156131805780358352918301918301613169565b509695505050505050565b60006020828403121561319d57600080fd5b81356001600160401b038111156131b357600080fd5b612bf284828501613120565b805182526020808201516001600160a01b0316908301526040808201516001600160401b03908116918401919091526060808301519084015260809182015116910152565b6020808252825182820181905260009190848201906040850190845b81811015611b60576132338385516131bf565b9284019260a09290920191600101613220565b60006001600160401b0383111561325f5761325f6130b7565b613272601f8401601f19166020016130cd565b905082815283838301111561328657600080fd5b828260208301376000602084830101529392505050565b6000602082840312156132af57600080fd5b81356001600160401b038111156132c557600080fd5b8201601f810184136132d657600080fd5b612bf284823560208401613246565b600080604083850312156132f857600080fd5b8235915060208301356001600160401b0381111561331557600080fd5b61332185828601613120565b9150509250929050565b6000806020838503121561333e57600080fd5b82356001600160401b038082111561335557600080fd5b818501915085601f83011261336957600080fd5b81358181111561337857600080fd5b8660208260051b850101111561338d57600080fd5b60209290920196919550909350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b81811015611b605761340a83855161339f565b92840192608092909201916001016133f7565b6000602080838503121561343057600080fd5b82356001600160401b0381111561344657600080fd5b8301601f8101851361345757600080fd5b8035613465613141826130fd565b81815260059190911b8201830190838101908783111561348457600080fd5b928401925b828410156134a95761349a84612ff8565b82529284019290840190613489565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611b60578351835292840192918401916001016134d0565b60008060006060848603121561350157600080fd5b61350a84612ff8565b95602085013595506040909401359392505050565b801515811461210f57600080fd5b6000806040838503121561354057600080fd5b61354983612ff8565b915060208301356135598161351f565b809150509250929050565b60a08101610cf882846131bf565b6000806000806080858703121561358857600080fd5b61359185612ff8565b935061359f60208601612ff8565b92506040850135915060608501356001600160401b038111156135c157600080fd5b8501601f810187136135d257600080fd5b6135e187823560208401613246565b91505092959194509250565b60808101610cf8828461339f565b6000806040838503121561360e57600080fd5b61361783612ff8565b915061362560208401612ff8565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561365e5761365e61362e565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261368857613688613663565b500490565b60008282101561369f5761369f61362e565b500390565b600181811c908216806136b857607f821691505b602082108114156136d957634e487b7160e01b600052602260045260246000fd5b50919050565b600082198211156136f2576136f261362e565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156137215761372161362e565b5060010190565b600061ffff808316818114156137405761374061362e565b6001019392505050565b60006020828403121561375c57600080fd5b5051919050565b60006020828403121561377557600080fd5b8151611fc28161351f565b600060ff821660ff8114156137975761379761362e565b60010192915050565b600081516137b2818560208601612f8d565b9290920192915050565b600080845481600182811c9150808316806137d857607f831692505b60208084108214156137f857634e487b7160e01b86526022600452602486fd5b81801561380c576001811461381d5761384a565b60ff1986168952848901965061384a565b60008b81526020902060005b868110156138425781548b820152908501908301613829565b505084890196505b50505050505061386e61385d82866137a0565b64173539b7b760d91b815260050190565b95945050505050565b60008261388657613886613663565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906138be90830184612fb9565b9695505050505050565b6000602082840312156138da57600080fd5b8151611fc281612f4156fea264697066735822122028e9e00206a80185b45af3743c8ca1cbd88b2efcdb43df187943ffe93fb0f65c64736f6c634300080b003368747470733a2f2f63646e2e6f70656e646576732e696f2f746f6b656e732f7075626c69632f68696464656e2f6d657461646174612e6a736f6eddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef

Deployed Bytecode

0x6080604052600436106103b05760003560e01c806382651e28116101e7578063b88d4fde1161010d578063d2d8cb67116100a0578063ed88c68e1161006f578063ed88c68e14610c80578063edc0ca4214610c88578063f0a7481b14610c9d578063f2fde38b14610cb357600080fd5b8063d2d8cb6714610ba2578063d33819a814610bd6578063d6de604414610c03578063e985e9c514610c3757600080fd5b8063c87b56dd116100dc578063c87b56dd14610af3578063cec2a29514610b13578063cfdbf25414610b47578063d111515d14610b8d57600080fd5b8063b88d4fde14610a7e578063b898768114610a91578063b9d4cbd714610aa6578063c23dc68f14610ac657600080fd5b806395d89b4111610185578063a22cb46511610154578063a22cb465146109c9578063b09afec1146109e9578063b3aee7ef14610a16578063b4f84cc714610a4a57600080fd5b806395d89b411461096157806399a2557a14610976578063a0712d6814610996578063a1ccaf7e146109a957600080fd5b80638da5cb5b116101c15780638da5cb5b146108f85780638e4cbc83146109165780639395b0871461092c57806394473f011461094157600080fd5b806382651e28146108765780638462151c146108aa57806384eb3318146108d757600080fd5b806332cb6b0c116102d75780635f4aff181161026a578063715018a611610239578063715018a6146107f757806378a3b8231461080c5780637e2214ef146108405780637ec4a6591461085657600080fd5b80635f4aff18146107635780636352211e146107835780636397766f146107a357806370a08231146107d757600080fd5b80634fdd43cb116102a65780634fdd43cb146106e15780635915d806146107015780635bbb2177146107215780635ee8ab041461074e57600080fd5b806332cb6b0c146106355780633dfd542c1461066957806342842e0e146106a15780634b2ee8f8146106b457600080fd5b80630e24495e1161034f57806323b872dd1161031e57806323b872dd146105a357806329ef9c2c146105b65780632a55205a146105d65780632eed80ca1461061557600080fd5b80630e24495e1461052b5780630f185936146105455780631085432f1461056557806318160ddd1461058557600080fd5b806306fdde031161038b57806306fdde031461048a578063081812fc146104ac578063095ea7b3146104e45780630da4693f146104f757600080fd5b806285fe65146103f157806301ffc9a71461043857806302603a391461046857600080fd5b366103ec5760405134815233907f48eecbf8d7be7e10b0c0ab44a0f618c0df5cc32fde648f6368d154973a3e2fc69060200160405180910390a2005b600080fd5b3480156103fd57600080fd5b506104257f0000000000000000000000000000000000000000000000000000000003c2670081565b6040519081526020015b60405180910390f35b34801561044457600080fd5b50610458610453366004612f57565b610cd3565b604051901515815260200161042f565b34801561047457600080fd5b50610488610483366004612f74565b610cfe565b005b34801561049657600080fd5b5061049f610f6f565b60405161042f9190612fe5565b3480156104b857600080fd5b506104cc6104c7366004612f74565b611001565b6040516001600160a01b03909116815260200161042f565b6104886104f2366004613014565b611045565b34801561050357600080fd5b506104257f000000000000000000000000000000000000000000000000000000000076a70081565b34801561053757600080fd5b506009546104589060ff1681565b34801561055157600080fd5b50610425610560366004612f74565b6110e5565b34801561057157600080fd5b50610458610580366004613014565b611116565b34801561059157600080fd5b50610425600254600154036000190190565b6104886105b136600461303e565b6111ae565b3480156105c257600080fd5b50600f546104cc906001600160a01b031681565b3480156105e257600080fd5b506105f66105f136600461307a565b61134c565b604080516001600160a01b03909316835260208301919091520161042f565b34801561062157600080fd5b5061048861063036600461309c565b611372565b34801561064157600080fd5b506104257f00000000000000000000000000000000000000000000000000000000000007c681565b34801561067557600080fd5b5061068961068436600461309c565b6113f8565b6040516001600160401b03909116815260200161042f565b6104886106af36600461303e565b611419565b3480156106c057600080fd5b506106d46106cf36600461318b565b611439565b60405161042f9190613204565b3480156106ed57600080fd5b506104886106fc36600461329d565b611517565b34801561070d57600080fd5b5061048861071c3660046132e5565b61155a565b34801561072d57600080fd5b5061074161073c36600461332b565b6116be565b60405161042f91906133db565b34801561075a57600080fd5b50610488611789565b34801561076f57600080fd5b5061048861077e36600461341d565b6117ae565b34801561078f57600080fd5b506104cc61079e366004612f74565b6119b3565b3480156107af57600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000281565b3480156107e357600080fd5b506104256107f236600461309c565b6119be565b34801561080357600080fd5b50610488611a0c565b34801561081857600080fd5b506104cc7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b34801561084c57600080fd5b50610425600d5481565b34801561086257600080fd5b5061048861087136600461329d565b611a1e565b34801561088257600080fd5b506104257f000000000000000000000000000000000000000000000000000000000001518081565b3480156108b657600080fd5b506108ca6108c536600461309c565b611a5d565b60405161042f91906134b4565b3480156108e357600080fd5b50600f5461045890600160a01b900460ff1681565b34801561090457600080fd5b506000546001600160a01b03166104cc565b34801561092257600080fd5b50610425600c5481565b34801561093857600080fd5b50610488611b6c565b34801561094d57600080fd5b5061048861095c3660046132e5565b611c65565b34801561096d57600080fd5b5061049f611e2f565b34801561098257600080fd5b506108ca6109913660046134ec565b611e3e565b6104886109a4366004612f74565b611fc9565b3480156109b557600080fd5b506106d46109c436600461307a565b612112565b3480156109d557600080fd5b506104886109e436600461352d565b61223b565b3480156109f557600080fd5b50610a09610a04366004612f74565b6122a7565b60405161042f9190613564565b348015610a2257600080fd5b506104cc7f000000000000000000000000943590a42c27d08e3744202c4ae5ed55c2de240d81565b348015610a5657600080fd5b506104cc7f000000000000000000000000999ee7a6734d06128f398741b604645a5e7c28e281565b610488610a8c366004613572565b612341565b348015610a9d57600080fd5b5061048861238b565b348015610ab257600080fd5b50610458610ac1366004613014565b6123a2565b348015610ad257600080fd5b50610ae6610ae1366004612f74565b6123e1565b60405161042f91906135ed565b348015610aff57600080fd5b5061049f610b0e366004612f74565b612469565b348015610b1f57600080fd5b506104257f00000000000000000000000000000000000000000000000000000000635c0a9081565b348015610b5357600080fd5b50610b7b7f000000000000000000000000000000000000000000000000000000000000000a81565b60405160ff909116815260200161042f565b348015610b9957600080fd5b5061048861256a565b348015610bae57600080fd5b506104257f000000000000000000000000000000000000000000000000016345785d8a000081565b348015610be257600080fd5b50610425610bf1366004612f74565b60106020526000908152604090205481565b348015610c0f57600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000001481565b348015610c4357600080fd5b50610458610c523660046135fb565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6104886125af565b348015610c9457600080fd5b506104256125ee565b348015610ca957600080fd5b50610425600e5481565b348015610cbf57600080fd5b50610488610cce36600461309c565b612648565b60006001600160e01b0319821663152a902d60e11b1480610cf85750610cf8826126c3565b92915050565b610d06612711565b600d54811115610d295760405163356680b760e01b815260040160405180910390fd5b60006064610d577f000000000000000000000000000000000000000000000000000000000000000284613644565b610d619190613679565b90506000610d6f828461368d565b905082600d6000828254610d83919061368d565b90915550506040516000906001600160a01b037f000000000000000000000000943590a42c27d08e3744202c4ae5ed55c2de240d169084908381818185875af1925050503d8060008114610df3576040519150601f19603f3d011682016040523d82523d6000602084013e610df8565b606091505b5050905080610e195760405162b845ad60e71b815260040160405180910390fd5b6001600160a01b037f000000000000000000000000943590a42c27d08e3744202c4ae5ed55c2de240d1660026040518581527ff8e30dbf1118fc6e5d75ebae65199193b14ec45bae8eedc935f31458e399bcf89060200160405180910390a36040516001600160a01b037f000000000000000000000000999ee7a6734d06128f398741b604645a5e7c28e216908390600081818185875af1925050503d8060008114610ee1576040519150601f19603f3d011682016040523d82523d6000602084013e610ee6565b606091505b50508091505080610f095760405162b845ad60e71b815260040160405180910390fd5b6001600160a01b037f000000000000000000000000999ee7a6734d06128f398741b604645a5e7c28e21660025b6040518481527ff8e30dbf1118fc6e5d75ebae65199193b14ec45bae8eedc935f31458e399bcf89060200160405180910390a350505050565b606060038054610f7e906136a4565b80601f0160208091040260200160405190810160405280929190818152602001828054610faa906136a4565b8015610ff75780601f10610fcc57610100808354040283529160200191610ff7565b820191906000526020600020905b815481529060010190602001808311610fda57829003601f168201915b5050505050905090565b600061100c8261276b565b611029576040516333d1c03960e21b815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b6000611050826119b3565b9050336001600160a01b038216146110895761106c8133610c52565b611089576040516367d9dca160e11b815260040160405180910390fd5b60008281526007602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006110f08261276b565b61110d576040516307ed98ed60e31b815260040160405180910390fd5b610cf8826127a0565b600080611122836127e7565b9050836001600160a01b031681600001516001600160a01b03161461115a57604051632dfa89a760e11b815260040160405180910390fd5b427f000000000000000000000000000000000000000000000000000000000076a70082602001516001600160401b031661119491906136df565b11156111a4576000915050610cf8565b5060019392505050565b60006111b98261281c565b9050836001600160a01b0316816001600160a01b0316146111ec5760405162a1148160e81b815260040160405180910390fd5b60008281526007602052604090208054338082146001600160a01b038816909114176112395761121c8633610c52565b61123957604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661126057604051633a954ecd60e21b815260040160405180910390fd5b61126d8686866001612885565b801561127857600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040902055600160e11b831661130357600184016000818152600560205260409020546113015760015481146113015760008181526005602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b60008030606461135d856007613644565b6113679190613679565b915091509250929050565b61137a612711565b600f54600160a01b900460ff166113a457604051636043fd7560e01b815260040160405180910390fd5b600f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f4fe3ac41736d507e306686f3d31c4042ad2e00e90a2009dc2fb2ccce7d455e2e9060200160405180910390a150565b6001600160a01b03811660009081526006602052604081205460c01c610cf8565b61143483838360405180602001604052806000815250612341565b505050565b6060600082516001600160401b03811115611456576114566130b7565b6040519080825280602002602001820160405280156114af57816020015b6040805160a0810182526000808252602080830182905292820181905260608201819052608082015282526000199092019101816114745790505b50905060005b8351811015611510576114e08482815181106114d3576114d36136f7565b60200260200101516122a7565b8282815181106114f2576114f26136f7565b602002602001018190525080806115089061370d565b9150506114b5565b5092915050565b61151f612711565b60095460ff16156115435760405163b087bbf360e01b815260040160405180910390fd5b805161155690600b906020840190612ea8565b5050565b60006115663384611116565b61158357604051630715a23760e01b815260040160405180910390fd5b61158b611789565b60005b82518161ffff16101561163657336001600160a01b03166115cb848361ffff16815181106115be576115be6136f7565b60200260200101516119b3565b6001600160a01b0316146115f257604051632dfa89a760e11b815260040160405180910390fd5b611618838261ffff168151811061160b5761160b6136f7565b60200260200101516128e2565b61162290836136df565b91508061162e81613728565b91505061158e565b5080600c6000828254611649919061368d565b9091555050604051600090339083908381818185875af1925050503d8060008114611690576040519150601f19603f3d011682016040523d82523d6000602084013e611695565b606091505b50509050806116b65760405162b845ad60e71b815260040160405180910390fd5b336000610f36565b6060816000816001600160401b038111156116db576116db6130b7565b60405190808252806020026020018201604052801561172d57816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816116f95790505b50905060005b8281146117805761175b86868381811061174f5761174f6136f7565b905060200201356123e1565b82828151811061176d5761176d6136f7565b6020908102919091010152600101611733565b50949350505050565b33600090815260066020526040902080546001600160c01b03164260c01b179055565b565b600f546001600160a01b031633146117d8576040516275057360e71b815260040160405180910390fd5b60005b81518160ff161015611556576000828260ff16815181106117fe576117fe6136f7565b60200260200101519050806001600160a01b03167f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316141561185b576040516350c6a56160e01b815260040160405180910390fd5b6040516370a0823160e01b815230600482015281906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156118a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c8919061374a565b600f5460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810183905291925083169063a9059cbb906044016020604051808303816000875af115801561191d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119419190613763565b61195d5760405162b845ad60e71b815260040160405180910390fd5b60405181815233906001600160a01b038516907ff739a0ab172261f2e4e9486fbdca8c228e7d3048da91df26d4a91f69fb47edb99060200160405180910390a350505080806119ab90613780565b9150506117db565b6000610cf88261281c565b60006001600160a01b0382166119e7576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600660205260409020546001600160401b031690565b611a14612711565b6117ac600061291f565b611a26612711565b60095460ff1615611a4a5760405163b087bbf360e01b815260040160405180910390fd5b805161155690600a906020840190612ea8565b60606000806000611a6d856119be565b90506000816001600160401b03811115611a8957611a896130b7565b604051908082528060200260200182016040528015611ab2578160200160208202803683370190505b509050611adf60408051608081018252600080825260208201819052918101829052606081019190915290565b60015b838614611b6057611af28161296f565b9150816040015115611b0357611b58565b81516001600160a01b031615611b1857815194505b876001600160a01b0316856001600160a01b03161415611b585780838780600101985081518110611b4b57611b4b6136f7565b6020026020010181815250505b600101611ae2565b50909695505050505050565b611b746129ab565b6000611b7e6125ee565b90506000611b93600254600154036000190190565b905081600e6000828254611ba791906136df565b90915550507f00000000000000000000000000000000000000000000000000000000000007c6811415611bef5781600c6000828254611be691906136df565b90915550505050565b600081611c1c7f00000000000000000000000000000000000000000000000000000000000007c685613679565b611c269190613644565b905080600c6000828254611c3a91906136df565b90915550611c4a9050818461368d565b600d6000828254611c5b91906136df565b9091555050505050565b6000611c7133846123a2565b611c8e57604051636457ea4d60e01b815260040160405180910390fd5b611c96611789565b60005b82518161ffff161015611da7576000611cc4610684858461ffff16815181106115be576115be6136f7565b90506000611cee858461ffff1681518110611ce157611ce16136f7565b60200260200101516127e7565b6020015190506000816001600160401b0316836001600160401b031611611d155781611d17565b825b905042611d4d7f0000000000000000000000000000000000000000000000000000000003c267006001600160401b0384166136df565b1115611d6c57604051638f329e2960e01b815260040160405180910390fd5b611d85868561ffff168151811061160b5761160b6136f7565b611d8f90866136df565b94505050508080611d9f90613728565b915050611c99565b5080600c6000828254611dba919061368d565b9091555050604051600090339083908381818185875af1925050503d8060008114611e01576040519150601f19603f3d011682016040523d82523d6000602084013e611e06565b606091505b5050905080611e275760405162b845ad60e71b815260040160405180910390fd5b336001610f36565b606060048054610f7e906136a4565b6060818310611e6057604051631960ccad60e11b815260040160405180910390fd5b600080611e6c60015490565b90506001851015611e7c57600194505b80841115611e88578093505b6000611e93876119be565b905084861015611eb25785850381811015611eac578091505b50611eb6565b5060005b6000816001600160401b03811115611ed057611ed06130b7565b604051908082528060200260200182016040528015611ef9578160200160208202803683370190505b50905081611f0c579350611fc292505050565b6000611f17886123e1565b905060008160400151611f28575080515b885b888114158015611f3a5750848714155b15611fb657611f488161296f565b9250826040015115611f5957611fae565b82516001600160a01b031615611f6e57825191505b8a6001600160a01b0316826001600160a01b03161415611fae5780848880600101995081518110611fa157611fa16136f7565b6020026020010181815250505b600101611f2a565b50505092835250909150505b9392505050565b7f00000000000000000000000000000000000000000000000000000000635c0a9042101561200a5760405163567f16b160e01b815260040160405180910390fd5b612034817f000000000000000000000000000000000000000000000000016345785d8a0000613644565b34146120535760405163020b5e0b60e11b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000a60ff16811115612097576040516378ed7baf60e11b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000007c6816120ca600254600154036000190190565b6120d491906136df565b11156120f35760405163855dadcb60e01b815260040160405180910390fd5b6121056120ff60015490565b82612abb565b61210f3382612af7565b50565b60606001831080612132575061212f600254600154036000190190565b82115b8061213c57508183115b1561215a57604051631960ccad60e11b815260040160405180910390fd5b816121648161370d565b925060009050612174848461368d565b6001600160401b0381111561218b5761218b6130b7565b6040519080825280602002602001820160405280156121e457816020015b6040805160a0810182526000808252602080830182905292820181905260608201819052608082015282526000199092019101816121a95790505b509050835b83811015612233576121fa816122a7565b82612205878461368d565b81518110612215576122156136f7565b6020026020010181905250808061222b9061370d565b9150506121e9565b509392505050565b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101829052906122db836127e7565b90506040518060a0016040528084815260200182600001516001600160a01b0316815260200182602001516001600160401b0316815260200161231d856127a0565b815260200161232f83600001516113f8565b6001600160401b031690529392505050565b61234c8484846111ae565b6001600160a01b0383163b156123855761236884848484612b11565b612385576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b612393612711565b600f805460ff60a01b19169055565b60007f00000000000000000000000000000000000000000000000000000000000000146123ce846119be565b10158015611fc25750611fc28383611116565b604080516080810182526000808252602082018190529181018290526060810191909152604080516080810182526000808252602082018190529181018290526060810191909152600183108061243a57506001548310155b156124455792915050565b61244e8361296f565b90508060400151156124605792915050565b611fc2836127e7565b60606124748261276b565b61249157604051630a14c4b560e41b815260040160405180910390fd5b600a805461249e906136a4565b1515905061253857600b80546124b3906136a4565b80601f01602080910402602001604051908101604052809291908181526020018280546124df906136a4565b801561252c5780601f106125015761010080835404028352916020019161252c565b820191906000526020600020905b81548152906001019060200180831161250f57829003601f168201915b50505050509050919050565b600a61254383612bfa565b6040516020016125549291906137bc565b6040516020818303038152906040529050919050565b612572612711565b600a805461257f906136a4565b151590506125a057604051639010c6a560e01b815260040160405180910390fd5b6009805460ff19166001179055565b6125b7611b6c565b60405134815233907f5d8bc849764969eb1bcc6d0a2f55999d0167c1ccec240a4f39cf664ca9c4148e9060200160405180910390a2565b600080600d54600c5447612602919061368d565b61260c919061368d565b90506126387f00000000000000000000000000000000000000000000000000000000000007c682613877565b612642908261368d565b91505090565b612650612711565b6001600160a01b0381166126ba5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61210f8161291f565b60006301ffc9a760e01b6001600160e01b0319831614806126f457506380ac58cd60e01b6001600160e01b03198316145b80610cf85750506001600160e01b031916635b5e139f60e01b1490565b6000546001600160a01b031633146117ac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016126b1565b60008160011115801561277f575060015482105b8015610cf8575050600090815260056020526040902054600160e01b161590565b600081815260106020526040812054600e546127dd907f00000000000000000000000000000000000000000000000000000000000007c690613679565b610cf8919061368d565b604080516080810182526000808252602082018190529181018290526060810191909152610cf86128178361281c565b612cf7565b6000818060011161286c5760015481101561286c57600081815260056020526040902054600160e01b811661286a575b80611fc257506000190160008181526005602052604090205461284c565b505b604051636f96cda160e11b815260040160405180910390fd5b427f00000000000000000000000000000000000000000000000000000000000151806128b0866113f8565b6001600160401b03166128c391906136df565b111561238557604051633670683160e11b815260040160405180910390fd5b6000806128ee836127a0565b90508060106000858152602001908152602001600020600082825461291391906136df565b90915550909392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516080810182526000808252602082018190529181018290526060810191909152600082815260056020526040902054610cf890612cf7565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a0823190602401602060405180830381865afa158015612a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a36919061374a565b9050801561210f57604051632e1a7d4d60e01b8152600481018290527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015612aa057600080fd5b505af1158015612ab4573d6000803e3d6000fd5b5050505050565b612ac3611b6c565b6000612acf82846136df565b9050825b8181101561238557612ae4816128e2565b5080612aef8161370d565b915050612ad3565b611556828260405180602001604052806000815250612d3e565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612b4690339089908890889060040161388b565b6020604051808303816000875af1925050508015612b81575060408051601f3d908101601f19168201909252612b7e918101906138c8565b60015b612bdc573d808015612baf576040519150601f19603f3d011682016040523d82523d6000602084013e612bb4565b606091505b508051612bd4576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606081612c1e5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612c485780612c328161370d565b9150612c419050600a83613679565b9150612c22565b6000816001600160401b03811115612c6257612c626130b7565b6040519080825280601f01601f191660200182016040528015612c8c576020820181803683370190505b5090505b8415612bf257612ca160018361368d565b9150612cae600a86613877565b612cb99060306136df565b60f81b818381518110612cce57612cce6136f7565b60200101906001600160f81b031916908160001a905350612cf0600a86613679565b9450612c90565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b612d488383612da4565b6001600160a01b0383163b15611434576001548281035b612d726000868380600101945086612b11565b612d8f576040516368d2bf6b60e11b815260040160405180910390fd5b818110612d5f578160015414612ab457600080fd5b60015481612dc55760405163b562e8dd60e01b815260040160405180910390fd5b612dd26000848385612885565b6001600160a01b03831660008181526006602090815260408083208054680100000000000000018802019055848352600590915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612e8157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612e49565b5081612e9f57604051622e076360e81b815260040160405180910390fd5b60015550505050565b828054612eb4906136a4565b90600052602060002090601f016020900481019282612ed65760008555612f1c565b82601f10612eef57805160ff1916838001178555612f1c565b82800160010185558215612f1c579182015b82811115612f1c578251825591602001919060010190612f01565b50612f28929150612f2c565b5090565b5b80821115612f285760008155600101612f2d565b6001600160e01b03198116811461210f57600080fd5b600060208284031215612f6957600080fd5b8135611fc281612f41565b600060208284031215612f8657600080fd5b5035919050565b60005b83811015612fa8578181015183820152602001612f90565b838111156123855750506000910152565b60008151808452612fd1816020860160208601612f8d565b601f01601f19169290920160200192915050565b602081526000611fc26020830184612fb9565b80356001600160a01b038116811461300f57600080fd5b919050565b6000806040838503121561302757600080fd5b61303083612ff8565b946020939093013593505050565b60008060006060848603121561305357600080fd5b61305c84612ff8565b925061306a60208501612ff8565b9150604084013590509250925092565b6000806040838503121561308d57600080fd5b50508035926020909101359150565b6000602082840312156130ae57600080fd5b611fc282612ff8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156130f5576130f56130b7565b604052919050565b60006001600160401b03821115613116576131166130b7565b5060051b60200190565b600082601f83011261313157600080fd5b81356020613146613141836130fd565b6130cd565b82815260059290921b8401810191818101908684111561316557600080fd5b8286015b848110156131805780358352918301918301613169565b509695505050505050565b60006020828403121561319d57600080fd5b81356001600160401b038111156131b357600080fd5b612bf284828501613120565b805182526020808201516001600160a01b0316908301526040808201516001600160401b03908116918401919091526060808301519084015260809182015116910152565b6020808252825182820181905260009190848201906040850190845b81811015611b60576132338385516131bf565b9284019260a09290920191600101613220565b60006001600160401b0383111561325f5761325f6130b7565b613272601f8401601f19166020016130cd565b905082815283838301111561328657600080fd5b828260208301376000602084830101529392505050565b6000602082840312156132af57600080fd5b81356001600160401b038111156132c557600080fd5b8201601f810184136132d657600080fd5b612bf284823560208401613246565b600080604083850312156132f857600080fd5b8235915060208301356001600160401b0381111561331557600080fd5b61332185828601613120565b9150509250929050565b6000806020838503121561333e57600080fd5b82356001600160401b038082111561335557600080fd5b818501915085601f83011261336957600080fd5b81358181111561337857600080fd5b8660208260051b850101111561338d57600080fd5b60209290920196919550909350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b81811015611b605761340a83855161339f565b92840192608092909201916001016133f7565b6000602080838503121561343057600080fd5b82356001600160401b0381111561344657600080fd5b8301601f8101851361345757600080fd5b8035613465613141826130fd565b81815260059190911b8201830190838101908783111561348457600080fd5b928401925b828410156134a95761349a84612ff8565b82529284019290840190613489565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611b60578351835292840192918401916001016134d0565b60008060006060848603121561350157600080fd5b61350a84612ff8565b95602085013595506040909401359392505050565b801515811461210f57600080fd5b6000806040838503121561354057600080fd5b61354983612ff8565b915060208301356135598161351f565b809150509250929050565b60a08101610cf882846131bf565b6000806000806080858703121561358857600080fd5b61359185612ff8565b935061359f60208601612ff8565b92506040850135915060608501356001600160401b038111156135c157600080fd5b8501601f810187136135d257600080fd5b6135e187823560208401613246565b91505092959194509250565b60808101610cf8828461339f565b6000806040838503121561360e57600080fd5b61361783612ff8565b915061362560208401612ff8565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561365e5761365e61362e565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261368857613688613663565b500490565b60008282101561369f5761369f61362e565b500390565b600181811c908216806136b857607f821691505b602082108114156136d957634e487b7160e01b600052602260045260246000fd5b50919050565b600082198211156136f2576136f261362e565b500190565b634e487b7160e01b600052603260045260246000fd5b60006000198214156137215761372161362e565b5060010190565b600061ffff808316818114156137405761374061362e565b6001019392505050565b60006020828403121561375c57600080fd5b5051919050565b60006020828403121561377557600080fd5b8151611fc28161351f565b600060ff821660ff8114156137975761379761362e565b60010192915050565b600081516137b2818560208601612f8d565b9290920192915050565b600080845481600182811c9150808316806137d857607f831692505b60208084108214156137f857634e487b7160e01b86526022600452602486fd5b81801561380c576001811461381d5761384a565b60ff1986168952848901965061384a565b60008b81526020902060005b868110156138425781548b820152908501908301613829565b505084890196505b50505050505061386e61385d82866137a0565b64173539b7b760d91b815260050190565b95945050505050565b60008261388657613886613663565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906138be90830184612fb9565b9695505050505050565b6000602082840312156138da57600080fd5b8151611fc281612f4156fea264697066735822122028e9e00206a80185b45af3743c8ca1cbd88b2efcdb43df187943ffe93fb0f65c64736f6c634300080b0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.