ETH Price: $2,468.31 (+1.31%)

Token

WeAreAllInvestors (WAAI)
 

Overview

Max Total Supply

89 WAAI

Holders

44

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
Null: 0x000...000
Balance
0 WAAI
0x0000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
WeAreAllInvestors

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 17 : WeAreAllInvestors.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./ERC721PsiKO.sol";
import "../openzeppelin/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/*
  It saves bytecode to revert on custom errors instead of using require
  statements. We are just declaring these errors for reverting with upon various
  conditions later in this contract. Thanks, Chiru Labs!
*/
error CannotMintBeyondCapacity();

/**
  @title WeAreAllInvestors: An ERC721 compliant implementation of ERC721PsiKO
                     developed for the Babson Blockchain Ventures graduate course
                     taught by timeout.

                     All mints are handled through the StoreFront contract,
                     and we have also included a sweep functionality for any
                     spurrious ERC20 tokens sent to this contract.

  @author timeout
*/
contract WeAreAllInvestors is ERC721PsiKO, ReentrancyGuard {

    /**
      The metadata URI to which token IDs are appended for generating `tokenUri`
      results. The URI will always naively slap a decimal token ID to the end of
      this provided URI.
    */
    string public metadataUri;

    // The total mint capacity of this contract
    uint256 public immutable capacity;

    /**
      Construct a new instance of this ERC-721 contract.

      @param _name The name to assign to this item collection contract.
      @param _symbol The ticker symbol of this item collection.
      @param _metadataURI The metadata URI to perform later token ID substitution
        with.
      @param _capacity The maximum number of tokens that may be minted.
    */
    constructor (
      string memory _name,
      string memory _symbol,
      string memory _metadataURI,
      uint256 _capacity
    ) ERC721PsiKO(_name, _symbol) {
      metadataUri = _metadataURI;
      capacity = _capacity;
    }

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

    /**
      Allow the caller, either the owner of a token or an approved manager, to
      burn a specific token ID. In order for the token to be eligible for burning,
      transfer of the token must not be locked.

      @param _id The token ID to burn.
    */
    function burn(
      uint256 _id
    ) external {
      _burn(_id);
    }

    /**
      @dev This function allows permissioned minters of this contract to mint one or
      more tokens dictated by the `_amount` parameter. Any minted tokens are sent
      to the `_recipient` address.

      @param _recipient The recipient of the tokens being minted.
      @param _amount The amount of tokens to mint.
    */
    function mint_Qgo(
      address _recipient,
      uint256 _amount
    ) external onlyAdmin {
      if (_nextMintId - 1 + _amount > capacity) { revert CannotMintBeyondCapacity(); }
      _mint(_recipient, _amount);
    }

    /**
      @dev Allow owner to sweep contract and send any (we assume, incorrectly sent) 
           ERC20 token) to another address.

      @param token token to sweep the balance from
      @param amount amount of token to sweep
      @param destination address to send the swept tokens to
    */
    function sweep(
      address token,
      address destination,
      uint256 amount
    ) external onlyOwner nonReentrant {
        IERC20(token).transfer(destination, amount);
    }

    /**
      @dev Allow the item collection owner to update the metadata URI of this
           collection.
   
      @param _metadataURI The new URI to update to.
    */
    function setMetadataURI (
      string calldata _metadataURI
    ) external virtual onlyOwner {
      metadataUri = _metadataURI;
    }
}

File 2 of 17 : ERC721PsiKO.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "../openzeppelin/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "../openzeppelin/utils/Address.sol";
import "@openzeppelin/contracts/utils/StorageSlot.sol";
import "solidity-bits/contracts/BitMaps.sol";
import "../openzeppelin/access/Ownable.sol";

/*
  It saves bytecode to revert on custom errors instead of using require
  statements. We are just declaring these errors for reverting with upon various
  conditions later in this contract.
*/
error CannotQueryZeroAddress();
error TokenDoesNotExist();
error CallerNotOwnerNorApprovedForAll();
error CannotApproveToCaller();
error NotApprovedOrOwner();
error ERC721NotImplemented();
error CannotMintZeroTokens();
error CannotMintOrTransferToZeroAddress();
error SupplyExceeded();
error TransferToNonERC721ReceiverImplementer();
error NotAnAdmin();
error TransferIsLockedGlobally();
error TransferIsLocked();

/**
  @title ERC721PsiKO: An ERC721 compliant implementation providing 
                      batch minting at a fixed gas cost (as seen by
                      Chiru Labs' ERC721A), as well as token transfer
                      and on-chain metadata querying through the use of
                      bitmaps (as seen by estarriolvetch's ERC721Psi).
                      We then do some additional gas efficient techniques,
                      disable all mentions to ID==0, and tweak a tad the
                      burning functionalities.

  @author timeout
*/
contract ERC721PsiKO is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable, Ownable{
    using Address for address;
    using Strings for uint256;
    using BitMaps for BitMaps.BitMap;

    BitMaps.BitMap private _batchHead;
    BitMaps.BitMap private _burnedToken;

    string private _name;
    string private _symbol;

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

    mapping(uint256 => address) private _tokenApprovals;
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // Whether or not transfer is locked for all items.
    bool public allTransfersLocked;

    // Whether or not the transfer of a particular token ID is locked.
    mapping ( uint256 => bool ) public transferLocks;

    // A mapping to track administrative callers who have been set by the owner.
    mapping ( address => bool ) private administrators;

    // The burn-to address
    address public immutable burnAddress = address(0x000000000000000000000000000000000000dEaD);

    /**
      A modifier to see if a caller is an approved administrator.
    */
    modifier onlyAdmin () {
      if (_msgSender() != owner() && !administrators[_msgSender()]) {
        revert NotAnAdmin();
      }
      _;
    }

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

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) 
        public 
        view 
        virtual 
        override 
        returns (uint) 
    {
        if (owner == address(0)) { revert CannotQueryZeroAddress(); }

        uint count;
        for( uint i = 1; i < _nextMintId; ++i ){
            if(_exists(i)){
                if( owner == ownerOf(i)){
                    ++count;
                }
            }
        }
        return count;
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        if (tokenId < 1) { revert TokenDoesNotExist(); }
        (address owner, ) = _ownerAndBatchHeadOf(tokenId);
        return owner;
    }

    function _tokenExists(uint256 tokenId) internal view {
        if (!_exists(tokenId)) { revert TokenDoesNotExist(); }
    }

    function _approvedOrOwnerCheck(address spender, uint256 tokenId) internal view {
       if (!_isApprovedOrOwner(spender, tokenId)) { revert NotApprovedOrOwner(); }
    }

    function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){
        _tokenExists(tokenId);
        tokenIdBatchHead = _getBatchHead(tokenId);
        owner = _owners[tokenIdBatchHead];
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _tokenExists(tokenId);

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

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

    /**
      This function allows the owner to lock the transfer of all token IDs. This
      is designed to prevent whitelisted presale users from using the secondary
      market to undercut the auction before the sale has ended.

      @param _locked The status of the lock; true to lock, false to unlock.
    */
    function lockAllTransfers (
      bool _locked
    ) external onlyOwner {
      allTransfersLocked = _locked;
    }

    /**
      This function allows an administrative caller to lock the transfer of
      particular token IDs. This is designed for a non-escrow staking contract
      that comes later to lock a user's NFT while still letting them keep it in
      their wallet.

      @param _id The ID of the token to lock.
      @param _locked The status of the lock; true to lock, false to unlock.
    */
    function lockTransfer (
      uint256 _id,
      bool _locked
    ) external onlyAdmin {
      transferLocks[_id] = _locked;
    }

    /**
      This function allows the original owner of the contract to add or remove
      other addresses as administrators. Administrators may perform mints and may
      lock token transfers.

      @param _newAdmin The new admin to update permissions for.
      @param _isAdmin Whether or not the new admin should be an admin.
    */
    function setAdmin (
      address _newAdmin,
      bool _isAdmin
    ) external onlyOwner {
      administrators[_newAdmin] = _isAdmin;
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) external virtual override {
        address owner = ownerOf(tokenId);
        if ( _msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert CallerNotOwnerNorApprovedForAll(); }

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        _tokenExists(tokenId);
        return _tokenApprovals[tokenId];
    }

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

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        _approvedOrOwnerCheck(_msgSender(), tokenId);

        _transfer(from, to, tokenId);
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        _approvedOrOwnerCheck(_msgSender(), tokenId);
        _safeTransfer(from, to, tokenId, _data);
    }

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

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        if (_burnedToken.get(tokenId) || tokenId == 0) return false;
        return tokenId < _nextMintId;
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId)
        internal
        view
        virtual
        returns (bool)
    {
        _tokenExists(tokenId);
        address owner = ownerOf(tokenId);
        return (spender == owner ||
            getApproved(tokenId) == spender ||
            isApprovedForAll(owner, spender));
    }

    /**
     * @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.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, "");
    }

    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        uint256 startTokenId = _nextMintId;
        _mint(to, quantity);
        if (!_checkOnERC721Received(address(0), to, startTokenId, quantity, _data)) { revert ERC721NotImplemented(); }
    }

    function _mint(
        address to,
        uint256 quantity
    ) internal virtual {
        uint256 tokenIdBatchHead = _nextMintId;
        
        if (quantity <= 0) { revert CannotMintZeroTokens(); }
        if (to == address(0)) { revert CannotMintOrTransferToZeroAddress(); }
        
        /**
          Inspired by the Chiru Labs implementation, we use unchecked math here.
          Only enormous minting counts that are unrealistic for our purposes would
          cause an overflow.
        */
        unchecked {
          _beforeTokenTransfers(address(0), to, tokenIdBatchHead, quantity);
          _nextMintId += quantity;
          _owners[tokenIdBatchHead] = to;
          _batchHead.set(tokenIdBatchHead);
          _afterTokenTransfers(address(0), to, tokenIdBatchHead, quantity);
          
          // Emit events
          uint256 updatedIndex = tokenIdBatchHead;
          for (uint256 i; i < quantity; i++) {
            emit Transfer(address(0), to, updatedIndex);
            updatedIndex++;
          }
        }
    }

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

        bool isApprovedOrOwner = (_msgSender() == owner)
          || (isApprovedForAll(owner, _msgSender()))
          || (getApproved(tokenId) == _msgSender());

        if (owner != from || !isApprovedOrOwner) { revert NotApprovedOrOwner(); }
        if (to == address(0)) { revert CannotMintOrTransferToZeroAddress(); }
        if (allTransfersLocked) { revert TransferIsLockedGlobally(); }
        if (transferLocks[tokenId]) { revert TransferIsLocked(); }

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        uint256 nextTokenId = tokenId + 1;

        if(!_batchHead.get(nextTokenId) &&  
            nextTokenId < _nextMintId
        ) {
            _owners[nextTokenId] = from;
            _batchHead.set(nextTokenId);
        }

        _owners[tokenId] = to;
        if(tokenId != tokenIdBatchHead) {
            _batchHead.set(tokenId);
        }

        emit Transfer(from, to, tokenId);

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

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

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

    function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) {
        tokenIdBatchHead = _batchHead.scanForward(tokenId); 
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
      unchecked {
        return _nextMintId - 1 - _burned();
      }
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256 tokenId) {
        if ( index >= totalSupply()) { revert SupplyExceeded(); }
        
        uint count;
        for(uint i = 1; i < _nextMintId; i++){
            if(_exists(i)){
                if(count == index) return i;
                else count++;
            }
        }
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) {
        uint count;
        for(uint i = 1; i < _nextMintId; i++){
            if(_exists(i) && owner == ownerOf(i)){
                if(count == index) return i;
                else count++;
            }
        }

        revert SupplyExceeded();
    }

    /**
     * @dev Destroys `tokenId`.
     *  Allow the caller, either the owner of a token or an approved manager, to
     *  burn a specific token ID. In order for the token to be eligible for burning,
     *  transfer of the token must not be locked.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address previousOwner = ownerOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == previousOwner)
          || (isApprovedForAll(previousOwner, _msgSender()))
          || (getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) { revert NotApprovedOrOwner(); }
        if (allTransfersLocked) { revert TransferIsLockedGlobally(); }
        if (transferLocks[tokenId]) { revert TransferIsLocked(); }

        _beforeTokenTransfers(previousOwner, burnAddress, tokenId, 1);

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

        _burnedToken.set(tokenId);
        
        emit Transfer(previousOwner, burnAddress, tokenId);

        _afterTokenTransfers(previousOwner, burnAddress, tokenId, 1);
    }

    /**
     * @dev Returns number of token burned.
     */
    function _burned() internal view returns (uint256 burned){
        uint256 supply = _nextMintId - 1;
        uint256 totalBucket = (supply >> 8) + 1;

        for(uint256 i=0; i < totalBucket; i++) {
            uint256 bucket = _burnedToken.getBucket(i);
            burned += _popcount(bucket);
        }
    }

    /**
     * @dev Returns number of set bits.
     */
    function _popcount(uint256 x) private pure returns (uint256 count) {
        unchecked{
            for (count=0; x!=0; count++)
                x &= x - 1;
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     *
     * 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`.
     */
    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.
     *
     * 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` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

File 3 of 17 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/*
  It saves bytecode to revert on custom errors instead of using require
  statements. We are just declaring these errors for reverting with upon various
  conditions later in this contract.
*/
error ReentrantCall();

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _notEntered will be true
        if(_status == _ENTERED) { revert ReentrantCall(); } 

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

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

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

File 5 of 17 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 8 of 17 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 9 of 17 : 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 10 of 17 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/*
  It saves bytecode to revert on custom errors instead of using require
  statements. We are just declaring these errors for reverting with upon various
  conditions later in this contract.
*/
error HexLengthInsufficient();

/**
 * @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;
        }
        if (value != 0) { revert HexLengthInsufficient(); }
        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 11 of 17 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 12 of 17 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/*
  It saves bytecode to revert on custom errors instead of using require
  statements. We are just declaring these errors for reverting with upon various
  conditions later in this contract.
*/
error InsufficientBalance();
error RecipientMayHaveReverted();
error CallToNonContract();

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) { revert InsufficientBalance(); }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) { revert RecipientMayHaveReverted(); }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        if (address(this).balance < value) { revert InsufficientBalance(); }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 13 of 17 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
}

File 14 of 17 : BitMaps.sol
// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */
pragma solidity ^0.8.0;

import "./BitScan.sol";

/**
 * @dev This Library is a modified version of Openzeppelin's BitMaps library.
 * Functions of finding the index of the closest set bit from a given index are added.
 * The indexing of each bucket is modifed to count from the MSB to the LSB instead of from the LSB to the MSB.
 * The modification of indexing makes finding the closest previous set bit more efficient in gas usage.
*/

/**
 * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
 * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
 */

library BitMaps {
    using BitScan for uint256;
    uint256 private constant MASK_INDEX_ZERO = (1 << 255);
    uint256 private constant MASK_FULL = type(uint256).max;

    struct BitMap {
        mapping(uint256 => uint256) _data;
    }

    /**
     * @dev Returns whether the bit at `index` is set.
     */
    function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        return bitmap._data[bucket] & mask != 0;
    }

    /**
     * @dev Sets the bit at `index` to the boolean `value`.
     */
    function setTo(
        BitMap storage bitmap,
        uint256 index,
        bool value
    ) internal {
        if (value) {
            set(bitmap, index);
        } else {
            unset(bitmap, index);
        }
    }

    /**
     * @dev Sets the bit at `index`.
     */
    function set(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] |= mask;
    }

    /**
     * @dev Unsets the bit at `index`.
     */
    function unset(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] &= ~mask;
    }


    /**
     * @dev Consecutively sets `amount` of bits starting from the bit at `startIndex`.
     */    
    function setBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] |= MASK_FULL << (256 - amount) >> bucketStartIndex;
            } else {
                bitmap._data[bucket] |= MASK_FULL >> bucketStartIndex;
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = MASK_FULL;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] |= MASK_FULL << (256 - amount);
            }
        }
    }


    /**
     * @dev Consecutively unsets `amount` of bits starting from the bit at `startIndex`.
     */    
    function unsetBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount) >> bucketStartIndex);
            } else {
                bitmap._data[bucket] &= ~(MASK_FULL >> bucketStartIndex);
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = 0;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount));
            }
        }
    }


    /**
     * @dev Find the closest index of the set bit before `index`.
     */
    function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256 setBitIndex) {
        uint256 bucket = index >> 8;

        // index within the bucket
        uint256 bucketIndex = (index & 0xff);

        // load a bitboard from the bitmap.
        uint256 bb = bitmap._data[bucket];

        // offset the bitboard to scan from `bucketIndex`.
        bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex)
        
        if(bb > 0) {
            unchecked {
                setBitIndex = (bucket << 8) | (bucketIndex -  bb.bitScanForward256());    
            }
        } else {
            while(true) {
                require(bucket > 0, "BitMaps: The set bit before the index doesn't exist.");
                unchecked {
                    bucket--;
                }
                // No offset. Always scan from the least significiant bit now.
                bb = bitmap._data[bucket];
                
                if(bb > 0) {
                    unchecked {
                        setBitIndex = (bucket << 8) | (255 -  bb.bitScanForward256());
                        break;
                    }
                } 
            }
        }
    }

    function getBucket(BitMap storage bitmap, uint256 bucket) internal view returns (uint256) {
        return bitmap._data[bucket];
    }
}

File 15 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

/*
  It saves bytecode to revert on custom errors instead of using require
  statements. We are just declaring these errors for reverting with upon various
  conditions later in this contract.
*/
error CallerNotOwner();
error OwnerZeroAddress();

/**
 * @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 {
        if (owner() != _msgSender()) { revert CallerNotOwner(); }
    }

    /**
     * @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 {
        if (newOwner == address(0)) { revert OwnerZeroAddress(); }
        _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 16 of 17 : 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 17 of 17 : BitScan.sol
// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */

pragma solidity ^0.8.0;


library BitScan {
    uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
    bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8";

    /**
        @dev Isolate the least significant set bit.
     */ 
    function isolateLS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            return bb & (0 - bb);
        }
    } 

    /**
        @dev Isolate the most significant set bit.
     */ 
    function isolateMS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            bb |= bb >> 128;
            bb |= bb >> 64;
            bb |= bb >> 32;
            bb |= bb >> 16;
            bb |= bb >> 8;
            bb |= bb >> 4;
            bb |= bb >> 2;
            bb |= bb >> 1;
            
            return (bb >> 1) + 1;
        }
    } 

    /**
        @dev Find the index of the lest significant set bit. (trailing zero count)
     */ 
    function bitScanForward256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]);
        }   
    }

    /**
        @dev Find the index of the most significant set bit.
     */ 
    function bitScanReverse256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]);
        }   
    }

    function log2(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]);
        } 
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_metadataURI","type":"string"},{"internalType":"uint256","name":"_capacity","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CallerNotOwner","type":"error"},{"inputs":[],"name":"CallerNotOwnerNorApprovedForAll","type":"error"},{"inputs":[],"name":"CannotApproveToCaller","type":"error"},{"inputs":[],"name":"CannotMintBeyondCapacity","type":"error"},{"inputs":[],"name":"CannotMintOrTransferToZeroAddress","type":"error"},{"inputs":[],"name":"CannotMintZeroTokens","type":"error"},{"inputs":[],"name":"CannotQueryZeroAddress","type":"error"},{"inputs":[],"name":"ERC721NotImplemented","type":"error"},{"inputs":[],"name":"NotAnAdmin","type":"error"},{"inputs":[],"name":"NotApprovedOrOwner","type":"error"},{"inputs":[],"name":"OwnerZeroAddress","type":"error"},{"inputs":[],"name":"ReentrantCall","type":"error"},{"inputs":[],"name":"SupplyExceeded","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TransferIsLocked","type":"error"},{"inputs":[],"name":"TransferIsLockedGlobally","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","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":"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"},{"inputs":[],"name":"allTransfersLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"capacity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_locked","type":"bool"}],"name":"lockAllTransfers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bool","name":"_locked","type":"bool"}],"name":"lockTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"metadataUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint_Qgo","outputs":[],"stateMutability":"nonpayable","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":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAdmin","type":"address"},{"internalType":"bool","name":"_isAdmin","type":"bool"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_metadataURI","type":"string"}],"name":"setMetadataURI","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":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferLocks","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052600160065561dead6080523480156200001c57600080fd5b50604051620021ab380380620021ab8339810160408190526200003f9162000265565b83836200004c33620000a2565b815162000061906003906020850190620000f2565b50805162000077906004906020840190620000f2565b50506001600c555081516200009490600d906020850190620000f2565b5060a052506200033b915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8280546200010090620002fe565b90600052602060002090601f0160209004810192826200012457600085556200016f565b82601f106200013f57805160ff19168380011785556200016f565b828001600101855582156200016f579182015b828111156200016f57825182559160200191906001019062000152565b506200017d92915062000181565b5090565b5b808211156200017d576000815560010162000182565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001c057600080fd5b81516001600160401b0380821115620001dd57620001dd62000198565b604051601f8301601f19908116603f0116810190828211818310171562000208576200020862000198565b816040528381526020925086838588010111156200022557600080fd5b600091505b838210156200024957858201830151818301840152908201906200022a565b838211156200025b5760008385830101525b9695505050505050565b600080600080608085870312156200027c57600080fd5b84516001600160401b03808211156200029457600080fd5b620002a288838901620001ae565b95506020870151915080821115620002b957600080fd5b620002c788838901620001ae565b94506040870151915080821115620002de57600080fd5b50620002ed87828801620001ae565b606096909601519497939650505050565b600181811c908216806200031357607f821691505b602082108114156200033557634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a051611e3c6200036f6000396000818161031801526104ec01526000818161037801526111750152611e3c6000f3fe608060405234801561001057600080fd5b50600436106101e35760003560e01c80636352211e1161010f57806395d89b41116100a2578063c87b56dd11610071578063c87b56dd1461042c578063e985e9c51461043f578063f099d5bb1461047b578063f2fde38b1461048e57600080fd5b806395d89b41146103f1578063a22cb465146103f9578063b88d4fde1461040c578063c39cca041461041f57600080fd5b8063750521f5116100de578063750521f5146103a257806377a4d559146103b55780638c47a507146103bd5780638da5cb5b146103e057600080fd5b80636352211e1461034d57806370a082311461036057806370d5ae0514610373578063715018a61461039a57600080fd5b80632f745c59116101875780634b0bddd2116101565780634b0bddd2146102ed5780634f6ccce7146103005780635cfc1a511461031357806362c067671461033a57600080fd5b80632f745c59146102a157806333b57274146102b457806342842e0e146102c757806342966c68146102da57600080fd5b8063081812fc116101c3578063081812fc1461023a578063095ea7b31461026557806318160ddd1461027857806323b872dd1461028e57600080fd5b80611784146101e857806301ffc9a7146101fd57806306fdde0314610225575b600080fd5b6101fb6101f636600461181b565b6104a1565b005b61021061020b36600461185b565b610552565b60405190151581526020015b60405180910390f35b61022d6105bf565b60405161021c91906118d0565b61024d6102483660046118e3565b610651565b6040516001600160a01b03909116815260200161021c565b6101fb61027336600461181b565b610678565b6102806106d2565b60405190815260200161021c565b6101fb61029c3660046118fc565b6106e8565b6102806102af36600461181b565b6106fd565b6101fb6102c2366004611946565b61078b565b6101fb6102d53660046118fc565b6107f4565b6101fb6102e83660046118e3565b61080f565b6101fb6102fb366004611976565b61081b565b61028061030e3660046118e3565b61084e565b6102807f000000000000000000000000000000000000000000000000000000000000000081565b6101fb6103483660046118fc565b6108ca565b61024d61035b3660046118e3565b610958565b61028061036e3660046119a2565b61098f565b61024d7f000000000000000000000000000000000000000000000000000000000000000081565b6101fb610a1a565b6101fb6103b03660046119bd565b610a2e565b61022d610a42565b6102106103cb3660046118e3565b600a6020526000908152604090205460ff1681565b6000546001600160a01b031661024d565b61022d610ad0565b6101fb610407366004611976565b610adf565b6101fb61041a366004611a45565b610b75565b6009546102109060ff1681565b61022d61043a3660046118e3565b610b91565b61021061044d366004611b21565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6101fb610489366004611b54565b610bf8565b6101fb61049c3660046119a2565b610c13565b6000546001600160a01b031633148015906104cc5750336000908152600b602052604090205460ff16155b156104ea576040516355098f2760e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081600160065461051b9190611b87565b6105259190611b9e565b11156105445760405163b7486ac160e01b815260040160405180910390fd5b61054e8282610c4b565b5050565b60006001600160e01b031982166380ac58cd60e01b148061058357506001600160e01b03198216635b5e139f60e01b145b8061059e57506001600160e01b0319821663780e9d6360e01b145b806105b957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600380546105ce90611bb6565b80601f01602080910402602001604051908101604052809291908181526020018280546105fa90611bb6565b80156106475780601f1061061c57610100808354040283529160200191610647565b820191906000526020600020905b81548152906001019060200180831161062a57829003601f168201915b5050505050905090565b600061065c82610d24565b506000908152600760205260409020546001600160a01b031690565b600061068382610958565b9050336001600160a01b038216148015906106a557506106a3813361044d565b155b156106c357604051631c75f76760e01b815260040160405180910390fd5b6106cd8383610d4a565b505050565b60006106dc610db8565b60016006540303905090565b6106f23382610e28565b6106cd838383610e4f565b60008060015b6006548110156107715761071681611063565b801561073b575061072681610958565b6001600160a01b0316856001600160a01b0316145b1561075f57838214156107515791506105b99050565b8161075b81611bf1565b9250505b8061076981611bf1565b915050610703565b50604051637d3d824960e01b815260040160405180910390fd5b6000546001600160a01b031633148015906107b65750336000908152600b602052604090205460ff16155b156107d4576040516355098f2760e01b815260040160405180910390fd5b6000918252600a6020526040909120805460ff1916911515919091179055565b6106cd83838360405180602001604052806000815250610b75565b610818816110a2565b50565b6108236111d8565b6001600160a01b03919091166000908152600b60205260409020805460ff1916911515919091179055565b60006108586106d2565b821061087757604051637d3d824960e01b815260040160405180910390fd5b600060015b6006548110156108c35761088f81611063565b156108b157838214156108a3579392505050565b816108ad81611bf1565b9250505b806108bb81611bf1565b91505061087c565b5050919050565b6108d26111d8565b6108da611203565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094d9190611c0c565b506106cd6001600c55565b6000600182101561097c5760405163677510db60e11b815260040160405180910390fd5b60006109878361122e565b509392505050565b60006001600160a01b0382166109b857604051630560249960e41b815260040160405180910390fd5b600060015b600654811015610a13576109d081611063565b15610a03576109de81610958565b6001600160a01b0316846001600160a01b03161415610a0357610a0082611bf1565b91505b610a0c81611bf1565b90506109bd565b5092915050565b610a226111d8565b610a2c6000611264565b565b610a366111d8565b6106cd600d838361176b565b600d8054610a4f90611bb6565b80601f0160208091040260200160405190810160405280929190818152602001828054610a7b90611bb6565b8015610ac85780601f10610a9d57610100808354040283529160200191610ac8565b820191906000526020600020905b815481529060010190602001808311610aab57829003601f168201915b505050505081565b6060600480546105ce90611bb6565b6001600160a01b038216331415610b095760405163651c48e360e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610b7f3383610e28565b610b8b848484846112b4565b50505050565b6060610b9c82610d24565b6000610ba66112ea565b90506000815111610bc65760405180602001604052806000815250610bf1565b80610bd0846112f9565b604051602001610be1929190611c29565b6040516020818303038152906040525b9392505050565b610c006111d8565b6009805460ff1916911515919091179055565b610c1b6111d8565b6001600160a01b038116610c4257604051630962257960e11b815260040160405180910390fd5b61081881611264565b60065481610c6c57604051634d3f50c760e01b815260040160405180910390fd5b6001600160a01b038316610c9357604051635d3b167560e11b815260040160405180910390fd5b6006805483019055600081815260056020526040902080546001600160a01b0319166001600160a01b038516179055610ccd6001826113ff565b8060005b83811015610d1d5760405182906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a460019182019101610cd1565b5050505050565b610d2d81611063565b6108185760405163677510db60e11b815260040160405180910390fd5b600081815260076020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610d7f82610958565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806001600654610dca9190611b87565b90506000610ddd600883901c6001611b9e565b905060005b81811015610e2257600081815260026020526040902054610e028161142b565b610e0c9086611b9e565b9450508080610e1a90611bf1565b915050610de2565b50505090565b610e32828261144a565b61054e5760405163390cdd9b60e21b815260040160405180910390fd5b600080610e5b8361122e565b915091506000826001600160a01b0316610e723390565b6001600160a01b03161480610e8c5750610e8c833361044d565b80610ea7575033610e9c85610651565b6001600160a01b0316145b9050856001600160a01b0316836001600160a01b0316141580610ec8575080155b15610ee65760405163390cdd9b60e21b815260040160405180910390fd5b6001600160a01b038516610f0d57604051635d3b167560e11b815260040160405180910390fd5b60095460ff1615610f3157604051630314a19b60e51b815260040160405180910390fd5b6000848152600a602052604090205460ff1615610f6157604051631ec47c7760e01b815260040160405180910390fd5b610f6c600085610d4a565b6000610f79856001611b9e565b600881901c600090815260016020526040902054909150600160ff1b60ff83161c16158015610fa9575060065481105b15610fe057600081815260056020526040902080546001600160a01b0319166001600160a01b038916179055610fe06001826113ff565b600085815260056020526040902080546001600160a01b0319166001600160a01b038816179055828514611019576110196001866113ff565b84866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050505050565b600881901c600090815260026020526040812054600160ff1b60ff84161c1615158061108d575081155b1561109a57506000919050565b506006541190565b60006110ad82610958565b90506000336001600160a01b03831614806110cd57506110cd823361044d565b806110e85750336110dd84610651565b6001600160a01b0316145b9050806111085760405163390cdd9b60e21b815260040160405180910390fd5b60095460ff161561112c57604051630314a19b60e51b815260040160405180910390fd5b6000838152600a602052604090205460ff161561115c57604051631ec47c7760e01b815260040160405180910390fd5b611167600084610d4a565b6111726002846113ff565b827f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000546001600160a01b03163314610a2c57604051632e6c18c960e11b815260040160405180910390fd5b6002600c541415611227576040516306fda65d60e31b815260040160405180910390fd5b6002600c55565b60008061123a83610d24565b611243836114ab565b6000818152600560205260409020546001600160a01b031694909350915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6112bf848484610e4f565b6112cd8484846001856114b8565b610b8b576040516335334b0f60e21b815260040160405180910390fd5b6060600d80546105ce90611bb6565b60608161131d5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611347578061133181611bf1565b91506113409050600a83611c6e565b9150611321565b60008167ffffffffffffffff81111561136257611362611a2f565b6040519080825280601f01601f19166020018201604052801561138c576020820181803683370190505b5090505b84156113f7576113a1600183611b87565b91506113ae600a86611c82565b6113b9906030611b9e565b60f81b8183815181106113ce576113ce611c96565b60200101906001600160f81b031916908160001a9053506113f0600a86611c6e565b9450611390565b949350505050565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b60005b81156114455760001982019091169060010161142e565b919050565b600061145582610d24565b600061146083610958565b9050806001600160a01b0316846001600160a01b0316148061149b5750836001600160a01b031661149084610651565b6001600160a01b0316145b806113f757506113f7818561044d565b60006105b96001836115ed565b60006001600160a01b0385163b156115e057506001835b6114d98486611b9e565b8110156115da57604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906115129033908b9086908990600401611cac565b6020604051808303816000875af192505050801561154d575060408051601f3d908101601f1916820190925261154a91810190611ce9565b60015b6115a8573d80801561157b576040519150601f19603f3d011682016040523d82523d6000602084013e611580565b606091505b5080516115a0576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b8280156115c557506001600160e01b03198116630a85bd0160e11b145b925050806115d281611bf1565b9150506114cf565b506115e4565b5060015b95945050505050565b600881901c60008181526020849052604081205490919060ff808516919082181c801561162f5761161d816116e9565b60ff168203600884901b1793506116e0565b600083116116a05760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b606482015260840160405180910390fd5b5060001990910160008181526020869052604090205490919080156116db576116c8816116e9565b60ff0360ff16600884901b1793506116e0565b61162f565b50505092915050565b60006040518061012001604052806101008152602001611d07610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff61173285611753565b02901c8151811061174557611745611c96565b016020015160f81c92915050565b600080821161176157600080fd5b5060008190031690565b82805461177790611bb6565b90600052602060002090601f01602090048101928261179957600085556117df565b82601f106117b25782800160ff198235161785556117df565b828001600101855582156117df579182015b828111156117df5782358255916020019190600101906117c4565b506117eb9291506117ef565b5090565b5b808211156117eb57600081556001016117f0565b80356001600160a01b038116811461144557600080fd5b6000806040838503121561182e57600080fd5b61183783611804565b946020939093013593505050565b6001600160e01b03198116811461081857600080fd5b60006020828403121561186d57600080fd5b8135610bf181611845565b60005b8381101561189357818101518382015260200161187b565b83811115610b8b5750506000910152565b600081518084526118bc816020860160208601611878565b601f01601f19169290920160200192915050565b602081526000610bf160208301846118a4565b6000602082840312156118f557600080fd5b5035919050565b60008060006060848603121561191157600080fd5b61191a84611804565b925061192860208501611804565b9150604084013590509250925092565b801515811461081857600080fd5b6000806040838503121561195957600080fd5b82359150602083013561196b81611938565b809150509250929050565b6000806040838503121561198957600080fd5b61199283611804565b9150602083013561196b81611938565b6000602082840312156119b457600080fd5b610bf182611804565b600080602083850312156119d057600080fd5b823567ffffffffffffffff808211156119e857600080fd5b818501915085601f8301126119fc57600080fd5b813581811115611a0b57600080fd5b866020828501011115611a1d57600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611a5b57600080fd5b611a6485611804565b9350611a7260208601611804565b925060408501359150606085013567ffffffffffffffff80821115611a9657600080fd5b818701915087601f830112611aaa57600080fd5b813581811115611abc57611abc611a2f565b604051601f8201601f19908116603f01168101908382118183101715611ae457611ae4611a2f565b816040528281528a6020848701011115611afd57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611b3457600080fd5b611b3d83611804565b9150611b4b60208401611804565b90509250929050565b600060208284031215611b6657600080fd5b8135610bf181611938565b634e487b7160e01b600052601160045260246000fd5b600082821015611b9957611b99611b71565b500390565b60008219821115611bb157611bb1611b71565b500190565b600181811c90821680611bca57607f821691505b60208210811415611beb57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611c0557611c05611b71565b5060010190565b600060208284031215611c1e57600080fd5b8151610bf181611938565b60008351611c3b818460208801611878565b835190830190611c4f818360208801611878565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b600082611c7d57611c7d611c58565b500490565b600082611c9157611c91611c58565b500690565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611cdf908301846118a4565b9695505050505050565b600060208284031215611cfb57600080fd5b8151610bf18161184556fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a2646970667358221220bfdba63fa3e5bbb4538ee1351ae2736a8d3fe38b70c77b030cd6b2e1f23fae7964736f6c634300080b0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001a200000000000000000000000000000000000000000000000000000000000000115765417265416c6c496e766573746f727300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045741414900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005968747470733a2f2f6e667473746f726167652e6c696e6b2f697066732f6261667962656964696d71776d6564713266697a696e7875636169716875756b3332677a3465636664687933646834666f78776565736e6c68666d2f00000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e35760003560e01c80636352211e1161010f57806395d89b41116100a2578063c87b56dd11610071578063c87b56dd1461042c578063e985e9c51461043f578063f099d5bb1461047b578063f2fde38b1461048e57600080fd5b806395d89b41146103f1578063a22cb465146103f9578063b88d4fde1461040c578063c39cca041461041f57600080fd5b8063750521f5116100de578063750521f5146103a257806377a4d559146103b55780638c47a507146103bd5780638da5cb5b146103e057600080fd5b80636352211e1461034d57806370a082311461036057806370d5ae0514610373578063715018a61461039a57600080fd5b80632f745c59116101875780634b0bddd2116101565780634b0bddd2146102ed5780634f6ccce7146103005780635cfc1a511461031357806362c067671461033a57600080fd5b80632f745c59146102a157806333b57274146102b457806342842e0e146102c757806342966c68146102da57600080fd5b8063081812fc116101c3578063081812fc1461023a578063095ea7b31461026557806318160ddd1461027857806323b872dd1461028e57600080fd5b80611784146101e857806301ffc9a7146101fd57806306fdde0314610225575b600080fd5b6101fb6101f636600461181b565b6104a1565b005b61021061020b36600461185b565b610552565b60405190151581526020015b60405180910390f35b61022d6105bf565b60405161021c91906118d0565b61024d6102483660046118e3565b610651565b6040516001600160a01b03909116815260200161021c565b6101fb61027336600461181b565b610678565b6102806106d2565b60405190815260200161021c565b6101fb61029c3660046118fc565b6106e8565b6102806102af36600461181b565b6106fd565b6101fb6102c2366004611946565b61078b565b6101fb6102d53660046118fc565b6107f4565b6101fb6102e83660046118e3565b61080f565b6101fb6102fb366004611976565b61081b565b61028061030e3660046118e3565b61084e565b6102807f00000000000000000000000000000000000000000000000000000000000001a281565b6101fb6103483660046118fc565b6108ca565b61024d61035b3660046118e3565b610958565b61028061036e3660046119a2565b61098f565b61024d7f000000000000000000000000000000000000000000000000000000000000dead81565b6101fb610a1a565b6101fb6103b03660046119bd565b610a2e565b61022d610a42565b6102106103cb3660046118e3565b600a6020526000908152604090205460ff1681565b6000546001600160a01b031661024d565b61022d610ad0565b6101fb610407366004611976565b610adf565b6101fb61041a366004611a45565b610b75565b6009546102109060ff1681565b61022d61043a3660046118e3565b610b91565b61021061044d366004611b21565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6101fb610489366004611b54565b610bf8565b6101fb61049c3660046119a2565b610c13565b6000546001600160a01b031633148015906104cc5750336000908152600b602052604090205460ff16155b156104ea576040516355098f2760e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000001a281600160065461051b9190611b87565b6105259190611b9e565b11156105445760405163b7486ac160e01b815260040160405180910390fd5b61054e8282610c4b565b5050565b60006001600160e01b031982166380ac58cd60e01b148061058357506001600160e01b03198216635b5e139f60e01b145b8061059e57506001600160e01b0319821663780e9d6360e01b145b806105b957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600380546105ce90611bb6565b80601f01602080910402602001604051908101604052809291908181526020018280546105fa90611bb6565b80156106475780601f1061061c57610100808354040283529160200191610647565b820191906000526020600020905b81548152906001019060200180831161062a57829003601f168201915b5050505050905090565b600061065c82610d24565b506000908152600760205260409020546001600160a01b031690565b600061068382610958565b9050336001600160a01b038216148015906106a557506106a3813361044d565b155b156106c357604051631c75f76760e01b815260040160405180910390fd5b6106cd8383610d4a565b505050565b60006106dc610db8565b60016006540303905090565b6106f23382610e28565b6106cd838383610e4f565b60008060015b6006548110156107715761071681611063565b801561073b575061072681610958565b6001600160a01b0316856001600160a01b0316145b1561075f57838214156107515791506105b99050565b8161075b81611bf1565b9250505b8061076981611bf1565b915050610703565b50604051637d3d824960e01b815260040160405180910390fd5b6000546001600160a01b031633148015906107b65750336000908152600b602052604090205460ff16155b156107d4576040516355098f2760e01b815260040160405180910390fd5b6000918252600a6020526040909120805460ff1916911515919091179055565b6106cd83838360405180602001604052806000815250610b75565b610818816110a2565b50565b6108236111d8565b6001600160a01b03919091166000908152600b60205260409020805460ff1916911515919091179055565b60006108586106d2565b821061087757604051637d3d824960e01b815260040160405180910390fd5b600060015b6006548110156108c35761088f81611063565b156108b157838214156108a3579392505050565b816108ad81611bf1565b9250505b806108bb81611bf1565b91505061087c565b5050919050565b6108d26111d8565b6108da611203565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610929573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094d9190611c0c565b506106cd6001600c55565b6000600182101561097c5760405163677510db60e11b815260040160405180910390fd5b60006109878361122e565b509392505050565b60006001600160a01b0382166109b857604051630560249960e41b815260040160405180910390fd5b600060015b600654811015610a13576109d081611063565b15610a03576109de81610958565b6001600160a01b0316846001600160a01b03161415610a0357610a0082611bf1565b91505b610a0c81611bf1565b90506109bd565b5092915050565b610a226111d8565b610a2c6000611264565b565b610a366111d8565b6106cd600d838361176b565b600d8054610a4f90611bb6565b80601f0160208091040260200160405190810160405280929190818152602001828054610a7b90611bb6565b8015610ac85780601f10610a9d57610100808354040283529160200191610ac8565b820191906000526020600020905b815481529060010190602001808311610aab57829003601f168201915b505050505081565b6060600480546105ce90611bb6565b6001600160a01b038216331415610b095760405163651c48e360e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610b7f3383610e28565b610b8b848484846112b4565b50505050565b6060610b9c82610d24565b6000610ba66112ea565b90506000815111610bc65760405180602001604052806000815250610bf1565b80610bd0846112f9565b604051602001610be1929190611c29565b6040516020818303038152906040525b9392505050565b610c006111d8565b6009805460ff1916911515919091179055565b610c1b6111d8565b6001600160a01b038116610c4257604051630962257960e11b815260040160405180910390fd5b61081881611264565b60065481610c6c57604051634d3f50c760e01b815260040160405180910390fd5b6001600160a01b038316610c9357604051635d3b167560e11b815260040160405180910390fd5b6006805483019055600081815260056020526040902080546001600160a01b0319166001600160a01b038516179055610ccd6001826113ff565b8060005b83811015610d1d5760405182906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a460019182019101610cd1565b5050505050565b610d2d81611063565b6108185760405163677510db60e11b815260040160405180910390fd5b600081815260076020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610d7f82610958565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806001600654610dca9190611b87565b90506000610ddd600883901c6001611b9e565b905060005b81811015610e2257600081815260026020526040902054610e028161142b565b610e0c9086611b9e565b9450508080610e1a90611bf1565b915050610de2565b50505090565b610e32828261144a565b61054e5760405163390cdd9b60e21b815260040160405180910390fd5b600080610e5b8361122e565b915091506000826001600160a01b0316610e723390565b6001600160a01b03161480610e8c5750610e8c833361044d565b80610ea7575033610e9c85610651565b6001600160a01b0316145b9050856001600160a01b0316836001600160a01b0316141580610ec8575080155b15610ee65760405163390cdd9b60e21b815260040160405180910390fd5b6001600160a01b038516610f0d57604051635d3b167560e11b815260040160405180910390fd5b60095460ff1615610f3157604051630314a19b60e51b815260040160405180910390fd5b6000848152600a602052604090205460ff1615610f6157604051631ec47c7760e01b815260040160405180910390fd5b610f6c600085610d4a565b6000610f79856001611b9e565b600881901c600090815260016020526040902054909150600160ff1b60ff83161c16158015610fa9575060065481105b15610fe057600081815260056020526040902080546001600160a01b0319166001600160a01b038916179055610fe06001826113ff565b600085815260056020526040902080546001600160a01b0319166001600160a01b038816179055828514611019576110196001866113ff565b84866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a450505050505050565b600881901c600090815260026020526040812054600160ff1b60ff84161c1615158061108d575081155b1561109a57506000919050565b506006541190565b60006110ad82610958565b90506000336001600160a01b03831614806110cd57506110cd823361044d565b806110e85750336110dd84610651565b6001600160a01b0316145b9050806111085760405163390cdd9b60e21b815260040160405180910390fd5b60095460ff161561112c57604051630314a19b60e51b815260040160405180910390fd5b6000838152600a602052604090205460ff161561115c57604051631ec47c7760e01b815260040160405180910390fd5b611167600084610d4a565b6111726002846113ff565b827f000000000000000000000000000000000000000000000000000000000000dead6001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000546001600160a01b03163314610a2c57604051632e6c18c960e11b815260040160405180910390fd5b6002600c541415611227576040516306fda65d60e31b815260040160405180910390fd5b6002600c55565b60008061123a83610d24565b611243836114ab565b6000818152600560205260409020546001600160a01b031694909350915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6112bf848484610e4f565b6112cd8484846001856114b8565b610b8b576040516335334b0f60e21b815260040160405180910390fd5b6060600d80546105ce90611bb6565b60608161131d5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611347578061133181611bf1565b91506113409050600a83611c6e565b9150611321565b60008167ffffffffffffffff81111561136257611362611a2f565b6040519080825280601f01601f19166020018201604052801561138c576020820181803683370190505b5090505b84156113f7576113a1600183611b87565b91506113ae600a86611c82565b6113b9906030611b9e565b60f81b8183815181106113ce576113ce611c96565b60200101906001600160f81b031916908160001a9053506113f0600a86611c6e565b9450611390565b949350505050565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b60005b81156114455760001982019091169060010161142e565b919050565b600061145582610d24565b600061146083610958565b9050806001600160a01b0316846001600160a01b0316148061149b5750836001600160a01b031661149084610651565b6001600160a01b0316145b806113f757506113f7818561044d565b60006105b96001836115ed565b60006001600160a01b0385163b156115e057506001835b6114d98486611b9e565b8110156115da57604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906115129033908b9086908990600401611cac565b6020604051808303816000875af192505050801561154d575060408051601f3d908101601f1916820190925261154a91810190611ce9565b60015b6115a8573d80801561157b576040519150601f19603f3d011682016040523d82523d6000602084013e611580565b606091505b5080516115a0576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b8280156115c557506001600160e01b03198116630a85bd0160e11b145b925050806115d281611bf1565b9150506114cf565b506115e4565b5060015b95945050505050565b600881901c60008181526020849052604081205490919060ff808516919082181c801561162f5761161d816116e9565b60ff168203600884901b1793506116e0565b600083116116a05760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b606482015260840160405180910390fd5b5060001990910160008181526020869052604090205490919080156116db576116c8816116e9565b60ff0360ff16600884901b1793506116e0565b61162f565b50505092915050565b60006040518061012001604052806101008152602001611d07610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff61173285611753565b02901c8151811061174557611745611c96565b016020015160f81c92915050565b600080821161176157600080fd5b5060008190031690565b82805461177790611bb6565b90600052602060002090601f01602090048101928261179957600085556117df565b82601f106117b25782800160ff198235161785556117df565b828001600101855582156117df579182015b828111156117df5782358255916020019190600101906117c4565b506117eb9291506117ef565b5090565b5b808211156117eb57600081556001016117f0565b80356001600160a01b038116811461144557600080fd5b6000806040838503121561182e57600080fd5b61183783611804565b946020939093013593505050565b6001600160e01b03198116811461081857600080fd5b60006020828403121561186d57600080fd5b8135610bf181611845565b60005b8381101561189357818101518382015260200161187b565b83811115610b8b5750506000910152565b600081518084526118bc816020860160208601611878565b601f01601f19169290920160200192915050565b602081526000610bf160208301846118a4565b6000602082840312156118f557600080fd5b5035919050565b60008060006060848603121561191157600080fd5b61191a84611804565b925061192860208501611804565b9150604084013590509250925092565b801515811461081857600080fd5b6000806040838503121561195957600080fd5b82359150602083013561196b81611938565b809150509250929050565b6000806040838503121561198957600080fd5b61199283611804565b9150602083013561196b81611938565b6000602082840312156119b457600080fd5b610bf182611804565b600080602083850312156119d057600080fd5b823567ffffffffffffffff808211156119e857600080fd5b818501915085601f8301126119fc57600080fd5b813581811115611a0b57600080fd5b866020828501011115611a1d57600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611a5b57600080fd5b611a6485611804565b9350611a7260208601611804565b925060408501359150606085013567ffffffffffffffff80821115611a9657600080fd5b818701915087601f830112611aaa57600080fd5b813581811115611abc57611abc611a2f565b604051601f8201601f19908116603f01168101908382118183101715611ae457611ae4611a2f565b816040528281528a6020848701011115611afd57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611b3457600080fd5b611b3d83611804565b9150611b4b60208401611804565b90509250929050565b600060208284031215611b6657600080fd5b8135610bf181611938565b634e487b7160e01b600052601160045260246000fd5b600082821015611b9957611b99611b71565b500390565b60008219821115611bb157611bb1611b71565b500190565b600181811c90821680611bca57607f821691505b60208210811415611beb57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611c0557611c05611b71565b5060010190565b600060208284031215611c1e57600080fd5b8151610bf181611938565b60008351611c3b818460208801611878565b835190830190611c4f818360208801611878565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b600082611c7d57611c7d611c58565b500490565b600082611c9157611c91611c58565b500690565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611cdf908301846118a4565b9695505050505050565b600060208284031215611cfb57600080fd5b8151610bf18161184556fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a2646970667358221220bfdba63fa3e5bbb4538ee1351ae2736a8d3fe38b70c77b030cd6b2e1f23fae7964736f6c634300080b0033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001a200000000000000000000000000000000000000000000000000000000000000115765417265416c6c496e766573746f727300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045741414900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005968747470733a2f2f6e667473746f726167652e6c696e6b2f697066732f6261667962656964696d71776d6564713266697a696e7875636169716875756b3332677a3465636664687933646834666f78776565736e6c68666d2f00000000000000

-----Decoded View---------------
Arg [0] : _name (string): WeAreAllInvestors
Arg [1] : _symbol (string): WAAI
Arg [2] : _metadataURI (string): https://nftstorage.link/ipfs/bafybeidimqwmedq2fizinxucaiqhuuk32gz4ecfdhy3dh4foxweesnlhfm/
Arg [3] : _capacity (uint256): 418

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 00000000000000000000000000000000000000000000000000000000000001a2
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000011
Arg [5] : 5765417265416c6c496e766573746f7273000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [7] : 5741414900000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000059
Arg [9] : 68747470733a2f2f6e667473746f726167652e6c696e6b2f697066732f626166
Arg [10] : 7962656964696d71776d6564713266697a696e7875636169716875756b333267
Arg [11] : 7a3465636664687933646834666f78776565736e6c68666d2f00000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.