ETH Price: $3,458.70 (-1.37%)
Gas: 4 Gwei

Token

The Ape Game (TAG)
 

Overview

Max Total Supply

502 TAG

Holders

71

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
luckyjoe.eth
Balance
2 TAG
0xEa4AC3B51e75ff58de93d3ed6531D45C28a4C6C7
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:
Apes

Compiler Version
v0.8.1+commit.df193b15

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : Apes.sol
//
//  _____ _   _ _____      _    ____  _____    ____    _    __  __ _____
// |_   _| | | | ____|    / \  |  _ \| ____|  / ___|  / \  |  \/  | ____|
//   | | | |_| |  _|     / _ \ | |_) |  _|   | |  _  / _ \ | |\/| |  _|
//   | | |  _  | |___   / ___ \|  __/| |___  | |_| |/ ___ \| |  | | |___
//   |_| |_| |_|_____| /_/   \_\_|   |_____|  \____/_/   \_\_|  |_|_____|
//

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ERC721.sol";
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
import "./Counters.sol";
import "./Strings.sol";
import "./Bananas.sol";
import "./Jungle.sol";

contract Apes is ERC721Enumerable, Ownable {
    using SafeMath for uint256;
    using Counters for Counters.Counter;
    using Strings for uint256;

    Counters.Counter private _tokenIdTracker;

    Bananas bananas;

    uint256 public maxFreeSupply = 500;
    uint256 public constant maxPublicSupply = 5000;
    uint256 public constant maxTotalSupply = 15000;
    uint256 public constant mintPrice = 0.029 ether;
    uint256 public constant maxPerTx = 10;
    uint256 public constant maxFreePerWallet = 10;

    address public constant dev1Address = 0xA17555Ac424f378F6C1a296cc888607621e89A1c;
    address public constant dev2Address = 0x1452f628694367d5203d48e0709b034f4da03A76;

    bool mintActive = false;
    bool public bananasMinting = false;

    mapping(address => uint256) public freeMintsClaimed; //Track free mints claimed per wallet

    string public baseTokenURI;

    constructor() ERC721("The Ape Game", "TAG") {}

    //-----------------------------------------------------------------------------//
    //------------------------------Mint Logic-------------------------------------//
    //-----------------------------------------------------------------------------//

    //Resume/pause Public Sale
    function toggleMint() public onlyOwner {
        mintActive = !mintActive;
    }

    //Public Mint
      function mint(address _referredBy, uint256 _count) public payable {
        uint256 total = _totalSupply();
        require(mintActive, "Sale has not begun");
        require(total + _count <= maxPublicSupply, "No apes left");
        require(_count <= maxPerTx, "10 max per tx");
        require(msg.value >= price(_count), "Not enough eth sent");

        for (uint256 i = 0; i < _count; i++) {
            _mintApe(msg.sender);
        }
        uint256 balance = price(_count);
        uint256 referralShare = balance.mul(10).div(100);
        if(_referredBy != 0x0000000000000000000000000000000000000000 &&_referredBy != msg.sender ){
            _referralbonus(_referredBy, referralShare);
        }
    }
    function mintNow( uint256 _count) public payable {
        uint256 total = _totalSupply();
        require(mintActive, "Sale has not begun");
        require(total + _count <= maxPublicSupply, "No apes left");
        require(_count <= maxPerTx, "10 max per tx");
        require(msg.value >= price(_count), "Not enough eth sent");

        for (uint256 i = 0; i < _count; i++) {
            _mintApe(msg.sender);
        }

    }
  function _referralbonus(address _address, uint256 _amount) private{
       payable(_address).transfer(_amount);
    }

    //Free Mint for first 500
    function freeMint(uint256 _count) public {
        uint256 total = _totalSupply();
        require(mintActive, "Public Sale is not active");
        require(total + _count <= maxFreeSupply, "No more free apes");
        require(_count + freeMintsClaimed[msg.sender] <= maxFreePerWallet, "Only 10 free mints per wallet");
        require(_count <= maxPerTx, "10 max per tx");

        for (uint256 i = 0; i < _count; i++) {
            freeMintsClaimed[msg.sender]++;
            _mintApe(msg.sender);
        }
    }

    //Public Mint until 5000
    function mintApeForBananas() public {
        uint256 total = _totalSupply();
        require(total < maxTotalSupply, "No Apes left");
        require(bananasMinting, "Minting with $bananas has not begun");
        bananas.burn(msg.sender, getBananasCost(total));
        _mintApe(msg.sender);
    }

    function getBananasCost(uint256 totalSupply) internal pure returns (uint256 cost){
        if (totalSupply < 6000)
            return 100;
        else if (totalSupply < 8000)
            return 200;
        else if (totalSupply < 10000)
            return 400;
        else if (totalSupply < 12000)
            return 800;
         else if (totalSupply < 14000)
            return 1000;
         else if (totalSupply < 15000)
            return 1200;
 
    }

    //Mint Ape
    function _mintApe(address _to) private {
        uint id = _tokenIdTracker.current();
        _tokenIdTracker.increment();
        _safeMint(_to, id);
    }

    //Function to get price of minting a ape
    function price(uint256 _count) public pure returns (uint256) {
        return mintPrice.mul(_count);
    }

    //-----------------------------------------------------------------------------//
    //---------------------------Admin & Internal Logic----------------------------//
    //-----------------------------------------------------------------------------//

    //Set address for $Bananas
    function setBananasAddress(address bananasAddr) external onlyOwner {
        bananas = Bananas(bananasAddr);
    }

    //Internal URI function
    function _baseURI() internal view virtual override returns (string memory) {
        return baseTokenURI;
    }

    //Start/Stop minting apes for $bananas
    function toggleBananasMinting() public onlyOwner {
        bananasMinting = !bananasMinting;
    }

    //Set URI for metadata
    function setBaseURI(string memory baseURI) public onlyOwner {
        baseTokenURI = baseURI;
    }

    //Withdraw from contract
    function withdrawAll() public onlyOwner {
        uint256 balance = address(this).balance;
        uint256 dev1Share = balance.mul(4).div(100);
        uint256 dev2Share = balance.mul(96).div(100);

        require(balance > 0);
        _withdraw(dev1Address, dev1Share);
        _withdraw(dev2Address, dev2Share);
    }

    //Internal withdraw
    function _withdraw(address _address, uint256 _amount) private {
        (bool success, ) = _address.call{value: _amount}("");
        require(success, "Transfer failed.");
    }

    //Return total supply of apes
    function _totalSupply() public view returns (uint) {
        return _tokenIdTracker.current();
    }
}

File 2 of 20 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

File 3 of 20 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

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

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 4 of 20 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Context.sol";

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

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

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

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

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

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 20 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 6 of 20 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 7 of 20 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

File 8 of 20 : Bananas.sol
//  ____    _    _   _    _    _   _    _    ____
// | __ )  / \  | \ | |  / \  | \ | |  / \  / ___|
// |  _ \ / _ \ |  \| | / _ \ |  \| | / _ \ \___ \
// | |_) / ___ \| |\  |/ ___ \| |\  |/ ___ \ ___) |
// |____/_/   \_\_| \_/_/   \_\_| \_/_/   \_\____/
//
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./ERC20.sol";
import "./Ownable.sol";

contract Bananas is ERC20, Ownable {
    address public apeAddress;
    address public jungleAddress;

    mapping(address => bool) public allowedAddresses;

    constructor() ERC20("BANANAS", "BANANAS") {}

    function setApeAddress(address apeAddr) external onlyOwner {
        apeAddress = apeAddr;
    }

    function setJungleAddress(address jungleAddr) external onlyOwner {
        jungleAddress = jungleAddr;
    }

    function burn(address user, uint256 amount) external {
        require(msg.sender == jungleAddress || msg.sender == apeAddress, "Address not authorized");
        _burn(user, amount);
    }

    function mint(address to, uint256 value) external {
        require(msg.sender == jungleAddress || msg.sender == apeAddress, "Address not authorized");
        _mint(to, value);
    }
}

File 9 of 20 : Jungle.sol
//     _ _   _ _   _  ____ _     _____
//     | | | | | \ | |/ ___| |   | ____|
//  _  | | | | |  \| | |  _| |   |  _|
// | |_| | |_| | |\  | |_| | |___| |___
//  \___/ \___/|_| \_|\____|_____|_____|
//
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Ownable.sol";
import "./SafeMath.sol";
import "./IERC721Receiver.sol";
import "./Apes.sol";
import "./Bananas.sol";

contract Jungle is Ownable, IERC721Receiver {
    using SafeMath for uint256;

    //Establish interface for Apes
    Apes apes;

    //Establish interface for $BANANAS
    Bananas bananas;

    event ApeStolen(address previousOwner, address newOwner, uint256 tokenId);
    event ApeStaked(address owner, uint256 tokenId, uint256 status);
    event ApeClaimed(address owner, uint256 tokenId);

    /* Struct to track token info
    Status is as follows:
        0 - Unstaked
        1 - HungryApe
        2 - GreedyApe
        3 - MutantApe
    */
    struct tokenInfo {
        uint256 tokenId;
        address owner;
        uint256 status;
        uint256 timeStaked;
    }

    // maps id to token info structure
    mapping(uint256 => tokenInfo) public jungle;

    //Amount token id to amount stolen
    mapping(uint256 => uint256) public bananasStolen;

    //Daily $BANANAS earned by HungryApes
    uint256 public hungryApeBananasRate = 100 ether;
    //Total number of HungryApes staked
    uint256 public totalHungryApesStaked = 0;
    //Percent of $BANANAS earned by HungryApes that is kept
    uint256 public hungryApeShare = 50;

    //Percent of $BANANAS earned by hungryApes that is stolen by GreedyApes
    uint256 public greedyApeShare = 50;
    //5% chance a greedyApe gets lost each time it is unstaked
    uint256 public chanceGreedyApeGetsLost = 5;

    //Store tokenIds of all GreedyApes staked
    uint256[] public greedyApesStaked;
    //Store Index of greedyApes staked
    mapping(uint256 => uint256) public greedyApeIndices;

    //Store tokenIds of all mutantApes staked
    uint256[] public mutantApesStaked;
    //Store Index of mutantApes staked
    mapping(uint256 => uint256) public mutantApeIndices;

    //1 day lock on staking
    uint256 public minStakeTime = 1 days;

    bool public staking = false;

    //Used to keep track of total Apes supply
    uint256 public totalSupply = 5000;

    constructor(){}



    //Mint Apes for bananas
    function mintApeForBananas(bool stake, uint256 status) public {
        require(staking, "Staking is paused");
        bananas.burn(msg.sender, getBananasCost(totalSupply));
        apes.mintApeForBananas();
        uint256 tokenId = totalSupply;
        totalSupply++;
        if(stake){
            jungle[tokenId] = tokenInfo({
                tokenId: tokenId,
                owner: msg.sender,
                status: status,
                timeStaked: block.timestamp
            });
            if (status == 1)
                totalHungryApesStaked++;
            else if (status == 2){
                greedyApesStaked.push(tokenId);
                greedyApeIndices[tokenId] = greedyApesStaked.length - 1;
            }
            else if (status == 3){
                mutantApesStaked.push(tokenId);
                mutantApeIndices[tokenId] = mutantApesStaked.length - 1;
            }
        } else {
            apes.safeTransferFrom(address(this), msg.sender, tokenId);
        }

    }

    function getBananasCost(uint256 supply) internal pure returns (uint256 cost){
   if (supply < 6000)
            return 100;            
        else if (supply < 8000)
            return 200;
        else if (supply < 10000)
            return 400;
        else if (supply < 12000)
            return 800;
         else if (supply < 14000)
            return 1000;
         else if (supply < 15000)
            return 1200;
    }

    //-----------------------------------------------------------------------------//
    //------------------------------Staking----------------------------------------//
    //-----------------------------------------------------------------------------//

    /*sends any number of Apes to the jungle
        ids -> list of ape ids to stake
        Status == 1 -> HungryApe
        Status == 2 -> GreedyApe
        Status == 3 -> MutantApe
    */
    function sendManyToJungle(uint256[] calldata ids, uint256 status) external {
        for(uint256 i = 0; i < ids.length; i++){
            require(apes.ownerOf(ids[i]) == msg.sender, "Not your Ape");
            require(staking, "Staking is paused");

            jungle[ids[i]] = tokenInfo({
                tokenId: ids[i],
                owner: msg.sender,
                status: status,
                timeStaked: block.timestamp
            });

            emit ApeStaked(msg.sender, ids[i], status);
            apes.transferFrom(msg.sender, address(this), ids[i]);

            if (status == 1)
                totalHungryApesStaked++;
            else if (status == 2){
                greedyApesStaked.push(ids[i]);
                greedyApeIndices[ids[i]] = greedyApesStaked.length - 1;
            }
            else if (status == 3){
                mutantApesStaked.push(ids[i]);
                mutantApeIndices[ids[i]] = mutantApesStaked.length - 1;

            }
        }
    }

    function unstakeManyApes(uint256[] calldata ids) external {
        for(uint256 i = 0; i < ids.length; i++){
            tokenInfo memory token = jungle[ids[i]];
            require(token.owner == msg.sender, "Not your Ape");
            require(apes.ownerOf(ids[i]) == address(this), "Ape must be staked in order to claim");
            require(staking, "Staking is paused");
            require(block.timestamp - token.timeStaked >= minStakeTime, "1 day stake lock");

            _claim(msg.sender, ids[i]);

            if (token.status == 1){
                totalHungryApesStaked--;
            }
            else if (token.status == 2){
                uint256 lastGreedyApe = greedyApesStaked[greedyApesStaked.length - 1];
                greedyApesStaked[greedyApeIndices[ids[i]]] = lastGreedyApe;
                greedyApeIndices[lastGreedyApe] = greedyApeIndices[ids[i]];
                greedyApesStaked.pop();
            }
            else if (token.status == 3){
                uint256 lastMutantApe = mutantApesStaked[mutantApesStaked.length - 1];
                mutantApesStaked[mutantApeIndices[ids[i]]] = lastMutantApe;
                mutantApeIndices[lastMutantApe] = mutantApeIndices[ids[i]];
                mutantApesStaked.pop();
            }

            emit ApeClaimed(address(this), ids[i]);

            //retrieve token info again to account for stolen Apes
            tokenInfo memory newToken = jungle[ids[i]];
            apes.safeTransferFrom(address(this), newToken.owner, ids[i]);
            jungle[ids[i]] = tokenInfo({
                tokenId: ids[i],
                owner: newToken.owner,
                status: 0,
                timeStaked: block.timestamp
            });
        }
    }

    function claimManyApes(uint256[] calldata ids) external {
        for(uint256 i = 0; i < ids.length; i++){
            tokenInfo memory token = jungle[ids[i]];
            require(token.owner == msg.sender, "Not your Ape");
            require(apes.ownerOf(ids[i]) == address(this), "Ape must be staked in order to claim");
            require(staking, "Staking is paused");

            _claim(msg.sender, ids[i]);
            emit ApeClaimed(address(this), ids[i]);

            //retrieve token info again to account for stolen Apes
            tokenInfo memory newToken = jungle[ids[i]];
            jungle[ids[i]] = tokenInfo({
                tokenId: ids[i],
                owner: newToken.owner,
                status: newToken.status,
                timeStaked: block.timestamp
            });
        }
    }

    function _claim(address owner, uint256 tokenId) internal {
        tokenInfo memory token = jungle[tokenId];
        if (token.status == 1){
            if(greedyApesStaked.length > 0){
                uint256 bananasGathered = getPendingBananas(tokenId);
                bananas.mint(owner, bananasGathered.mul(hungryApeShare).div(100));
                stealBananas(bananasGathered.mul(greedyApeShare).div(100));
            }
            else {
                bananas.mint(owner, getPendingBananas(tokenId));
            }
        }
        else if (token.status == 2){
            uint256 roll = randomIntInRange(tokenId, 100);
            if(roll > chanceGreedyApeGetsLost || mutantApesStaked.length == 0){
                bananas.mint(owner, bananasStolen[tokenId]);
                bananasStolen[tokenId ]= 0;
            } else{
                getNewOwnerForGreedyApe(roll, tokenId);
            }
        }
    }

    //Public function to view pending $BANANAS earnings for HungryApes.
    function getBananasEarnings(uint256 id) public view returns(uint256) {
        return getPendingBananas(id);
    }

    //Passive earning of $BANANAS, 100 $BANANAS per day
    function getPendingBananas(uint256 id) internal view returns(uint256) {
        tokenInfo memory token = jungle[id];
        return (block.timestamp - token.timeStaked) * 100 ether / 1 days;
    }

    //Returns a pseudo-random integer between 0 - max
    function randomIntInRange(uint256 seed, uint256 max) internal view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(
            tx.origin,
            blockhash(block.number - 1),
            block.timestamp,
            seed
        ))) % max;
    }

    //Return new owner of lost GreedyApe from current mutantApes
    function stealBananas(uint256 amount) internal{
        uint256 roll = randomIntInRange(amount, greedyApesStaked.length);
        bananasStolen[greedyApesStaked[roll]] += amount;
    }

    //Return new owner of lost greedyApe from current mutantApes
    function getNewOwnerForGreedyApe(uint256 seed, uint256 tokenId) internal{
        tokenInfo memory greedyApe = jungle[tokenId];
        uint256 roll = randomIntInRange(seed, mutantApesStaked.length);
        tokenInfo memory mutantApe = jungle[mutantApesStaked[roll]];
        emit ApeStolen(greedyApe.owner, mutantApe.owner, tokenId);
        jungle[tokenId] = tokenInfo({
                tokenId: tokenId,
                owner: mutantApe.owner,
                status: 2,
                timeStaked: block.timestamp
        });
        bananas.mint(mutantApe.owner, bananasStolen[tokenId]);
        bananasStolen[tokenId] = 0;
    }

    function getTotalMutantApesStaked() public view returns (uint256) {
        return mutantApesStaked.length;
    }

    function getTotalGreedyApesStaked() public view returns (uint256) {
        return greedyApesStaked.length;
    }

    //Set address for Apes
    function setApeAddress(address apeAddr) external onlyOwner {
        apes = Apes(apeAddr);
    }

    //Set address for $BANANAS
    function setBananasAddress(address bananasAddr) external onlyOwner {
        bananas = Bananas(bananasAddr);
    }

    //Start/Stop staking
    function toggleStaking() public onlyOwner {
        staking = !staking;
    }

    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external pure override returns (bytes4) {
      return IERC721Receiver.onERC721Received.selector;
    }
}

File 10 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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 13 of 20 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

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

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

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

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

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

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

File 14 of 20 : Context.sol
// SPDX-License-Identifier: MIT

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 15 of 20 : ERC165.sol
// SPDX-License-Identifier: MIT

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 16 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface 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 20 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";

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

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

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

File 18 of 20 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

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

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 19 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 20 of 20 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"_totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"bananasMinting","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dev1Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dev2Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"freeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"freeMintsClaimed","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":[],"name":"maxFreePerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxFreeSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerTx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPublicSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_referredBy","type":"address"},{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintApeForBananas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"mintNow","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","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":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bananasAddr","type":"address"}],"name":"setBananasAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleBananasMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","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":"","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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526101f4600d55600e805461ffff191690553480156200002257600080fd5b50604080518082018252600c81526b546865204170652047616d6560a01b60208083019182528351808501909452600384526254414760e81b908401528151919291620000729160009162000101565b5080516200008890600190602084019062000101565b505050620000a56200009f620000ab60201b60201c565b620000af565b620001e4565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200010f90620001a7565b90600052602060002090601f0160209004810192826200013357600085556200017e565b82601f106200014e57805160ff19168380011785556200017e565b828001600101855582156200017e579182015b828111156200017e57825182559160200191906001019062000161565b506200018c92915062000190565b5090565b5b808211156200018c576000815560010162000191565b600281046001821680620001bc57607f821691505b60208210811415620001de57634e487b7160e01b600052602260045260246000fd5b50919050565b612a3380620001f46000396000f3fe6080604052600436106102465760003560e01c80636817c76c11610139578063b88d4fde116100b6578063e2f0039e1161007a578063e2f0039e14610615578063e985e9c51461062a578063f2fde38b1461064a578063f94abfa01461066a578063f968adbe14610581578063fff5982b1461068a57610246565b8063b88d4fde14610596578063c3017a5d146105b6578063c87b56dd146105cb578063d3dd5fe0146105eb578063d547cfb71461060057610246565b8063853828b6116100fd578063853828b6146105225780638da5cb5b1461053757806395d89b411461054c578063a22cb46514610561578063a70273571461058157610246565b80636817c76c146104a557806370a08231146104ba578063715018a6146104da5780637c928fe9146104ef578063803524c51461050f57610246565b806326a74d8e116101c757806342842e0e1161018b57806342842e0e1461041057806347513334146104305780634f6ccce71461044557806355f804b3146104655780636352211e1461048557610246565b806326a74d8e1461039e5780632ab4d052146103b35780632f745c59146103c85780633eaaf86b146103e857806340c10f19146103fd57610246565b806316b29b3e1161020e57806316b29b3e1461031f57806318160ddd1461033457806320c09e241461034957806323b872dd1461035e57806326a49e371461037e57610246565b806301ffc9a71461024b57806306fdde0314610281578063081812fc146102a35780630865704c146102d0578063095ea7b3146102fd575b600080fd5b34801561025757600080fd5b5061026b610266366004612059565b61069f565b60405161027891906121b7565b60405180910390f35b34801561028d57600080fd5b506102966106cc565b60405161027891906121c2565b3480156102af57600080fd5b506102c36102be3660046120d7565b61075e565b604051610278919061214d565b3480156102dc57600080fd5b506102f06102eb366004611ef6565b6107aa565b60405161027891906128a4565b34801561030957600080fd5b5061031d610318366004612030565b6107bc565b005b34801561032b57600080fd5b5061031d610854565b34801561034057600080fd5b506102f06108b0565b34801561035557600080fd5b506102c36108b6565b34801561036a57600080fd5b5061031d610379366004611f42565b6108ce565b34801561038a57600080fd5b506102f06103993660046120d7565b610906565b3480156103aa57600080fd5b506102f0610919565b3480156103bf57600080fd5b506102f061091f565b3480156103d457600080fd5b506102f06103e3366004612030565b610925565b3480156103f457600080fd5b506102f0610977565b61031d61040b366004612030565b610988565b34801561041c57600080fd5b5061031d61042b366004611f42565b610ab0565b34801561043c57600080fd5b506102f0610acb565b34801561045157600080fd5b506102f06104603660046120d7565b610ad1565b34801561047157600080fd5b5061031d610480366004612091565b610b2c565b34801561049157600080fd5b506102c36104a03660046120d7565b610b82565b3480156104b157600080fd5b506102f0610bb7565b3480156104c657600080fd5b506102f06104d5366004611ef6565b610bc2565b3480156104e657600080fd5b5061031d610c06565b3480156104fb57600080fd5b5061031d61050a3660046120d7565b610c51565b61031d61051d3660046120d7565b610d4d565b34801561052e57600080fd5b5061031d610e16565b34801561054357600080fd5b506102c3610ec7565b34801561055857600080fd5b50610296610ed6565b34801561056d57600080fd5b5061031d61057c366004611ff6565b610ee5565b34801561058d57600080fd5b506102f0610fb3565b3480156105a257600080fd5b5061031d6105b1366004611f7d565b610fb8565b3480156105c257600080fd5b5061031d610ff7565b3480156105d757600080fd5b506102966105e63660046120d7565b6110c1565b3480156105f757600080fd5b5061031d611144565b34801561060c57600080fd5b50610296611197565b34801561062157600080fd5b5061026b611225565b34801561063657600080fd5b5061026b610645366004611f10565b611233565b34801561065657600080fd5b5061031d610665366004611ef6565b611261565b34801561067657600080fd5b5061031d610685366004611ef6565b6112cf565b34801561069657600080fd5b506102c3611330565b60006001600160e01b0319821663780e9d6360e01b14806106c457506106c482611348565b90505b919050565b6060600080546106db9061293b565b80601f01602080910402602001604051908101604052809291908181526020018280546107079061293b565b80156107545780601f1061072957610100808354040283529160200191610754565b820191906000526020600020905b81548152906001019060200180831161073757829003601f168201915b5050505050905090565b600061076982611388565b61078e5760405162461bcd60e51b81526004016107859061262f565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600f6020526000908152604090205481565b60006107c782610b82565b9050806001600160a01b0316836001600160a01b031614156107fb5760405162461bcd60e51b815260040161078590612775565b806001600160a01b031661080d6113a5565b6001600160a01b031614806108295750610829816106456113a5565b6108455760405162461bcd60e51b81526004016107859061246a565b61084f83836113a9565b505050565b61085c6113a5565b6001600160a01b031661086d610ec7565b6001600160a01b0316146108935760405162461bcd60e51b81526004016107859061267b565b600e805461ff001981166101009182900460ff1615909102179055565b60085490565b731452f628694367d5203d48e0709b034f4da03a7681565b6108df6108d96113a5565b82611417565b6108fb5760405162461bcd60e51b815260040161078590612807565b61084f83838361149c565b60006106c466670758aa7c8000836115c9565b61138881565b613a9881565b600061093083610bc2565b821061094e5760405162461bcd60e51b815260040161078590612226565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6000610983600b6115d5565b905090565b6000610992610977565b600e5490915060ff166109b75760405162461bcd60e51b815260040161078590612377565b6113886109c483836128ad565b11156109e25760405162461bcd60e51b8152600401610785906121d5565b600a821115610a035760405162461bcd60e51b8152600401610785906127b6565b610a0c82610906565b341015610a2b5760405162461bcd60e51b8152600401610785906126f9565b60005b82811015610a5157610a3f336115d9565b80610a4981612976565b915050610a2e565b506000610a5d83610906565b90506000610a776064610a7184600a6115c9565b906115fb565b90506001600160a01b03851615801590610a9a57506001600160a01b0385163314155b15610aa957610aa98582611607565b5050505050565b61084f83838360405180602001604052806000815250610fb8565b600d5481565b6000610adb6108b0565b8210610af95760405162461bcd60e51b815260040161078590612858565b60088281548110610b1a57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b610b346113a5565b6001600160a01b0316610b45610ec7565b6001600160a01b031614610b6b5760405162461bcd60e51b81526004016107859061267b565b8051610b7e906010906020840190611dd0565b5050565b6000818152600260205260408120546001600160a01b0316806106c45760405162461bcd60e51b815260040161078590612511565b66670758aa7c800081565b60006001600160a01b038216610bea5760405162461bcd60e51b8152600401610785906124c7565b506001600160a01b031660009081526003602052604090205490565b610c0e6113a5565b6001600160a01b0316610c1f610ec7565b6001600160a01b031614610c455760405162461bcd60e51b81526004016107859061267b565b610c4f600061163d565b565b6000610c5b610977565b600e5490915060ff16610c805760405162461bcd60e51b815260040161078590612340565b600d54610c8d83836128ad565b1115610cab5760405162461bcd60e51b8152600401610785906121fb565b336000908152600f6020526040902054600a90610cc890846128ad565b1115610ce65760405162461bcd60e51b8152600401610785906125f8565b600a821115610d075760405162461bcd60e51b8152600401610785906127b6565b60005b8281101561084f57336000908152600f60205260408120805491610d2d83612976565b9190505550610d3b336115d9565b80610d4581612976565b915050610d0a565b6000610d57610977565b600e5490915060ff16610d7c5760405162461bcd60e51b815260040161078590612377565b611388610d8983836128ad565b1115610da75760405162461bcd60e51b8152600401610785906121d5565b600a821115610dc85760405162461bcd60e51b8152600401610785906127b6565b610dd182610906565b341015610df05760405162461bcd60e51b8152600401610785906126f9565b60005b8281101561084f57610e04336115d9565b80610e0e81612976565b915050610df3565b610e1e6113a5565b6001600160a01b0316610e2f610ec7565b6001600160a01b031614610e555760405162461bcd60e51b81526004016107859061267b565b476000610e686064610a718460046115c9565b90506000610e7c6064610a718560606115c9565b905060008311610e8b57600080fd5b610ea973a17555ac424f378f6c1a296cc888607621e89a1c8361168f565b61084f731452f628694367d5203d48e0709b034f4da03a768261168f565b600a546001600160a01b031690565b6060600180546106db9061293b565b610eed6113a5565b6001600160a01b0316826001600160a01b03161415610f1e5760405162461bcd60e51b8152600401610785906123e7565b8060056000610f2b6113a5565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155610f6f6113a5565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610fa791906121b7565b60405180910390a35050565b600a81565b610fc9610fc36113a5565b83611417565b610fe55760405162461bcd60e51b815260040161078590612807565b610ff18484848461170b565b50505050565b6000611001610977565b9050613a9881106110245760405162461bcd60e51b81526004016107859061259d565b600e54610100900460ff1661104b5760405162461bcd60e51b81526004016107859061255a565b600c546001600160a01b0316639dc29fac336110668461173e565b6040518363ffffffff1660e01b815260040161108392919061219e565b600060405180830381600087803b15801561109d57600080fd5b505af11580156110b1573d6000803e3d6000fd5b505050506110be336115d9565b50565b60606110cc82611388565b6110e85760405162461bcd60e51b815260040161078590612726565b60006110f26117b0565b90506000815111611112576040518060200160405280600081525061113d565b8061111c846117bf565b60405160200161112d92919061211b565b6040516020818303038152906040525b9392505050565b61114c6113a5565b6001600160a01b031661115d610ec7565b6001600160a01b0316146111835760405162461bcd60e51b81526004016107859061267b565b600e805460ff19811660ff90911615179055565b601080546111a49061293b565b80601f01602080910402602001604051908101604052809291908181526020018280546111d09061293b565b801561121d5780601f106111f25761010080835404028352916020019161121d565b820191906000526020600020905b81548152906001019060200180831161120057829003601f168201915b505050505081565b600e54610100900460ff1681565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6112696113a5565b6001600160a01b031661127a610ec7565b6001600160a01b0316146112a05760405162461bcd60e51b81526004016107859061267b565b6001600160a01b0381166112c65760405162461bcd60e51b8152600401610785906122c3565b6110be8161163d565b6112d76113a5565b6001600160a01b03166112e8610ec7565b6001600160a01b03161461130e5760405162461bcd60e51b81526004016107859061267b565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b73a17555ac424f378f6c1a296cc888607621e89a1c81565b60006001600160e01b031982166380ac58cd60e01b148061137957506001600160e01b03198216635b5e139f60e01b145b806106c457506106c4826118da565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906113de82610b82565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061142282611388565b61143e5760405162461bcd60e51b81526004016107859061241e565b600061144983610b82565b9050806001600160a01b0316846001600160a01b031614806114845750836001600160a01b03166114798461075e565b6001600160a01b0316145b8061149457506114948185611233565b949350505050565b826001600160a01b03166114af82610b82565b6001600160a01b0316146114d55760405162461bcd60e51b8152600401610785906126b0565b6001600160a01b0382166114fb5760405162461bcd60e51b8152600401610785906123a3565b6115068383836118f3565b6115116000826113a9565b6001600160a01b038316600090815260036020526040812080546001929061153a9084906128f8565b90915550506001600160a01b03821660009081526003602052604081208054600192906115689084906128ad565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061113d82846128d9565b5490565b60006115e5600b6115d5565b90506115f1600b61197c565b610b7e8282611985565b600061113d82846128c5565b6040516001600160a01b0383169082156108fc029083906000818181858888f1935050505015801561084f573d6000803e3d6000fd5b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000826001600160a01b0316826040516116a89061214a565b60006040518083038185875af1925050503d80600081146116e5576040519150601f19603f3d011682016040523d82523d6000602084013e6116ea565b606091505b505090508061084f5760405162461bcd60e51b8152600401610785906127dd565b61171684848461149c565b6117228484848461199f565b610ff15760405162461bcd60e51b815260040161078590612271565b6000611770821015611752575060646106c7565b611f40821015611764575060c86106c7565b61271082101561177757506101906106c7565b612ee082101561178a57506103206106c7565b6136b082101561179d57506103e86106c7565b613a988210156106c757506104b06106c7565b6060601080546106db9061293b565b6060816117e457506040805180820190915260018152600360fc1b60208201526106c7565b8160005b811561180e57806117f881612976565b91506118079050600a836128c5565b91506117e8565b60008167ffffffffffffffff81111561183757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611861576020820181803683370190505b5090505b8415611494576118766001836128f8565b9150611883600a86612991565b61188e9060306128ad565b60f81b8183815181106118b157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506118d3600a866128c5565b9450611865565b6001600160e01b031981166301ffc9a760e01b14919050565b6118fe83838361084f565b6001600160a01b03831661191a5761191581611aba565b61193d565b816001600160a01b0316836001600160a01b03161461193d5761193d8382611afe565b6001600160a01b0382166119595761195481611b9b565b61084f565b826001600160a01b0316826001600160a01b03161461084f5761084f8282611c74565b80546001019055565b610b7e828260405180602001604052806000815250611cb8565b60006119b3846001600160a01b0316611ceb565b15611aaf57836001600160a01b031663150b7a026119cf6113a5565b8786866040518563ffffffff1660e01b81526004016119f19493929190612161565b602060405180830381600087803b158015611a0b57600080fd5b505af1925050508015611a3b575060408051601f3d908101601f19168201909252611a3891810190612075565b60015b611a95573d808015611a69576040519150601f19603f3d011682016040523d82523d6000602084013e611a6e565b606091505b508051611a8d5760405162461bcd60e51b815260040161078590612271565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611494565b506001949350505050565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b60006001611b0b84610bc2565b611b1591906128f8565b600083815260076020526040902054909150808214611b68576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611bad906001906128f8565b60008381526009602052604081205460088054939450909284908110611be357634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508060088381548110611c1257634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611c5857634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000611c7f83610bc2565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b611cc28383611cf1565b611ccf600084848461199f565b61084f5760405162461bcd60e51b815260040161078590612271565b3b151590565b6001600160a01b038216611d175760405162461bcd60e51b8152600401610785906125c3565b611d2081611388565b15611d3d5760405162461bcd60e51b815260040161078590612309565b611d49600083836118f3565b6001600160a01b0382166000908152600360205260408120805460019290611d729084906128ad565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b828054611ddc9061293b565b90600052602060002090601f016020900481019282611dfe5760008555611e44565b82601f10611e1757805160ff1916838001178555611e44565b82800160010185558215611e44579182015b82811115611e44578251825591602001919060010190611e29565b50611e50929150611e54565b5090565b5b80821115611e505760008155600101611e55565b600067ffffffffffffffff80841115611e8457611e846129d1565b604051601f8501601f19908116603f01168101908282118183101715611eac57611eac6129d1565b81604052809350858152868686011115611ec557600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146106c757600080fd5b600060208284031215611f07578081fd5b61113d82611edf565b60008060408385031215611f22578081fd5b611f2b83611edf565b9150611f3960208401611edf565b90509250929050565b600080600060608486031215611f56578081fd5b611f5f84611edf565b9250611f6d60208501611edf565b9150604084013590509250925092565b60008060008060808587031215611f92578081fd5b611f9b85611edf565b9350611fa960208601611edf565b925060408501359150606085013567ffffffffffffffff811115611fcb578182fd5b8501601f81018713611fdb578182fd5b611fea87823560208401611e69565b91505092959194509250565b60008060408385031215612008578182fd5b61201183611edf565b915060208301358015158114612025578182fd5b809150509250929050565b60008060408385031215612042578182fd5b61204b83611edf565b946020939093013593505050565b60006020828403121561206a578081fd5b813561113d816129e7565b600060208284031215612086578081fd5b815161113d816129e7565b6000602082840312156120a2578081fd5b813567ffffffffffffffff8111156120b8578182fd5b8201601f810184136120c8578182fd5b61149484823560208401611e69565b6000602082840312156120e8578081fd5b5035919050565b6000815180845261210781602086016020860161290f565b601f01601f19169290920160200192915050565b6000835161212d81846020880161290f565b83519083019061214181836020880161290f565b01949350505050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612194908301846120ef565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60006020825261113d60208301846120ef565b6020808252600c908201526b139bc8185c195cc81b19599d60a21b604082015260600190565b6020808252601190820152704e6f206d6f72652066726565206170657360781b604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526019908201527f5075626c69632053616c65206973206e6f742061637469766500000000000000604082015260600190565b60208082526012908201527129b0b632903430b9903737ba103132b3bab760711b604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b60208082526023908201527f4d696e74696e672077697468202462616e616e617320686173206e6f7420626560408201526233bab760e91b606082015260800190565b6020808252600c908201526b139bc8105c195cc81b19599d60a21b604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252601d908201527f4f6e6c792031302066726565206d696e7473207065722077616c6c6574000000604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b602080825260139082015272139bdd08195b9bdd59da08195d1a081cd95b9d606a1b604082015260600190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b6020808252600d908201526c0626040dac2f040e0cae440e8f609b1b604082015260600190565b60208082526010908201526f2a3930b739b332b9103330b4b632b21760811b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b90815260200190565b600082198211156128c0576128c06129a5565b500190565b6000826128d4576128d46129bb565b500490565b60008160001904831182151516156128f3576128f36129a5565b500290565b60008282101561290a5761290a6129a5565b500390565b60005b8381101561292a578181015183820152602001612912565b83811115610ff15750506000910152565b60028104600182168061294f57607f821691505b6020821081141561297057634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561298a5761298a6129a5565b5060010190565b6000826129a0576129a06129bb565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b0319811681146110be57600080fdfea2646970667358221220b07576f25053aae56838ae2516d333d2eac2fef48f18cff9e6b27a077628bc7c64736f6c63430008010033

Deployed Bytecode

0x6080604052600436106102465760003560e01c80636817c76c11610139578063b88d4fde116100b6578063e2f0039e1161007a578063e2f0039e14610615578063e985e9c51461062a578063f2fde38b1461064a578063f94abfa01461066a578063f968adbe14610581578063fff5982b1461068a57610246565b8063b88d4fde14610596578063c3017a5d146105b6578063c87b56dd146105cb578063d3dd5fe0146105eb578063d547cfb71461060057610246565b8063853828b6116100fd578063853828b6146105225780638da5cb5b1461053757806395d89b411461054c578063a22cb46514610561578063a70273571461058157610246565b80636817c76c146104a557806370a08231146104ba578063715018a6146104da5780637c928fe9146104ef578063803524c51461050f57610246565b806326a74d8e116101c757806342842e0e1161018b57806342842e0e1461041057806347513334146104305780634f6ccce71461044557806355f804b3146104655780636352211e1461048557610246565b806326a74d8e1461039e5780632ab4d052146103b35780632f745c59146103c85780633eaaf86b146103e857806340c10f19146103fd57610246565b806316b29b3e1161020e57806316b29b3e1461031f57806318160ddd1461033457806320c09e241461034957806323b872dd1461035e57806326a49e371461037e57610246565b806301ffc9a71461024b57806306fdde0314610281578063081812fc146102a35780630865704c146102d0578063095ea7b3146102fd575b600080fd5b34801561025757600080fd5b5061026b610266366004612059565b61069f565b60405161027891906121b7565b60405180910390f35b34801561028d57600080fd5b506102966106cc565b60405161027891906121c2565b3480156102af57600080fd5b506102c36102be3660046120d7565b61075e565b604051610278919061214d565b3480156102dc57600080fd5b506102f06102eb366004611ef6565b6107aa565b60405161027891906128a4565b34801561030957600080fd5b5061031d610318366004612030565b6107bc565b005b34801561032b57600080fd5b5061031d610854565b34801561034057600080fd5b506102f06108b0565b34801561035557600080fd5b506102c36108b6565b34801561036a57600080fd5b5061031d610379366004611f42565b6108ce565b34801561038a57600080fd5b506102f06103993660046120d7565b610906565b3480156103aa57600080fd5b506102f0610919565b3480156103bf57600080fd5b506102f061091f565b3480156103d457600080fd5b506102f06103e3366004612030565b610925565b3480156103f457600080fd5b506102f0610977565b61031d61040b366004612030565b610988565b34801561041c57600080fd5b5061031d61042b366004611f42565b610ab0565b34801561043c57600080fd5b506102f0610acb565b34801561045157600080fd5b506102f06104603660046120d7565b610ad1565b34801561047157600080fd5b5061031d610480366004612091565b610b2c565b34801561049157600080fd5b506102c36104a03660046120d7565b610b82565b3480156104b157600080fd5b506102f0610bb7565b3480156104c657600080fd5b506102f06104d5366004611ef6565b610bc2565b3480156104e657600080fd5b5061031d610c06565b3480156104fb57600080fd5b5061031d61050a3660046120d7565b610c51565b61031d61051d3660046120d7565b610d4d565b34801561052e57600080fd5b5061031d610e16565b34801561054357600080fd5b506102c3610ec7565b34801561055857600080fd5b50610296610ed6565b34801561056d57600080fd5b5061031d61057c366004611ff6565b610ee5565b34801561058d57600080fd5b506102f0610fb3565b3480156105a257600080fd5b5061031d6105b1366004611f7d565b610fb8565b3480156105c257600080fd5b5061031d610ff7565b3480156105d757600080fd5b506102966105e63660046120d7565b6110c1565b3480156105f757600080fd5b5061031d611144565b34801561060c57600080fd5b50610296611197565b34801561062157600080fd5b5061026b611225565b34801561063657600080fd5b5061026b610645366004611f10565b611233565b34801561065657600080fd5b5061031d610665366004611ef6565b611261565b34801561067657600080fd5b5061031d610685366004611ef6565b6112cf565b34801561069657600080fd5b506102c3611330565b60006001600160e01b0319821663780e9d6360e01b14806106c457506106c482611348565b90505b919050565b6060600080546106db9061293b565b80601f01602080910402602001604051908101604052809291908181526020018280546107079061293b565b80156107545780601f1061072957610100808354040283529160200191610754565b820191906000526020600020905b81548152906001019060200180831161073757829003601f168201915b5050505050905090565b600061076982611388565b61078e5760405162461bcd60e51b81526004016107859061262f565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600f6020526000908152604090205481565b60006107c782610b82565b9050806001600160a01b0316836001600160a01b031614156107fb5760405162461bcd60e51b815260040161078590612775565b806001600160a01b031661080d6113a5565b6001600160a01b031614806108295750610829816106456113a5565b6108455760405162461bcd60e51b81526004016107859061246a565b61084f83836113a9565b505050565b61085c6113a5565b6001600160a01b031661086d610ec7565b6001600160a01b0316146108935760405162461bcd60e51b81526004016107859061267b565b600e805461ff001981166101009182900460ff1615909102179055565b60085490565b731452f628694367d5203d48e0709b034f4da03a7681565b6108df6108d96113a5565b82611417565b6108fb5760405162461bcd60e51b815260040161078590612807565b61084f83838361149c565b60006106c466670758aa7c8000836115c9565b61138881565b613a9881565b600061093083610bc2565b821061094e5760405162461bcd60e51b815260040161078590612226565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6000610983600b6115d5565b905090565b6000610992610977565b600e5490915060ff166109b75760405162461bcd60e51b815260040161078590612377565b6113886109c483836128ad565b11156109e25760405162461bcd60e51b8152600401610785906121d5565b600a821115610a035760405162461bcd60e51b8152600401610785906127b6565b610a0c82610906565b341015610a2b5760405162461bcd60e51b8152600401610785906126f9565b60005b82811015610a5157610a3f336115d9565b80610a4981612976565b915050610a2e565b506000610a5d83610906565b90506000610a776064610a7184600a6115c9565b906115fb565b90506001600160a01b03851615801590610a9a57506001600160a01b0385163314155b15610aa957610aa98582611607565b5050505050565b61084f83838360405180602001604052806000815250610fb8565b600d5481565b6000610adb6108b0565b8210610af95760405162461bcd60e51b815260040161078590612858565b60088281548110610b1a57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b610b346113a5565b6001600160a01b0316610b45610ec7565b6001600160a01b031614610b6b5760405162461bcd60e51b81526004016107859061267b565b8051610b7e906010906020840190611dd0565b5050565b6000818152600260205260408120546001600160a01b0316806106c45760405162461bcd60e51b815260040161078590612511565b66670758aa7c800081565b60006001600160a01b038216610bea5760405162461bcd60e51b8152600401610785906124c7565b506001600160a01b031660009081526003602052604090205490565b610c0e6113a5565b6001600160a01b0316610c1f610ec7565b6001600160a01b031614610c455760405162461bcd60e51b81526004016107859061267b565b610c4f600061163d565b565b6000610c5b610977565b600e5490915060ff16610c805760405162461bcd60e51b815260040161078590612340565b600d54610c8d83836128ad565b1115610cab5760405162461bcd60e51b8152600401610785906121fb565b336000908152600f6020526040902054600a90610cc890846128ad565b1115610ce65760405162461bcd60e51b8152600401610785906125f8565b600a821115610d075760405162461bcd60e51b8152600401610785906127b6565b60005b8281101561084f57336000908152600f60205260408120805491610d2d83612976565b9190505550610d3b336115d9565b80610d4581612976565b915050610d0a565b6000610d57610977565b600e5490915060ff16610d7c5760405162461bcd60e51b815260040161078590612377565b611388610d8983836128ad565b1115610da75760405162461bcd60e51b8152600401610785906121d5565b600a821115610dc85760405162461bcd60e51b8152600401610785906127b6565b610dd182610906565b341015610df05760405162461bcd60e51b8152600401610785906126f9565b60005b8281101561084f57610e04336115d9565b80610e0e81612976565b915050610df3565b610e1e6113a5565b6001600160a01b0316610e2f610ec7565b6001600160a01b031614610e555760405162461bcd60e51b81526004016107859061267b565b476000610e686064610a718460046115c9565b90506000610e7c6064610a718560606115c9565b905060008311610e8b57600080fd5b610ea973a17555ac424f378f6c1a296cc888607621e89a1c8361168f565b61084f731452f628694367d5203d48e0709b034f4da03a768261168f565b600a546001600160a01b031690565b6060600180546106db9061293b565b610eed6113a5565b6001600160a01b0316826001600160a01b03161415610f1e5760405162461bcd60e51b8152600401610785906123e7565b8060056000610f2b6113a5565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155610f6f6113a5565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610fa791906121b7565b60405180910390a35050565b600a81565b610fc9610fc36113a5565b83611417565b610fe55760405162461bcd60e51b815260040161078590612807565b610ff18484848461170b565b50505050565b6000611001610977565b9050613a9881106110245760405162461bcd60e51b81526004016107859061259d565b600e54610100900460ff1661104b5760405162461bcd60e51b81526004016107859061255a565b600c546001600160a01b0316639dc29fac336110668461173e565b6040518363ffffffff1660e01b815260040161108392919061219e565b600060405180830381600087803b15801561109d57600080fd5b505af11580156110b1573d6000803e3d6000fd5b505050506110be336115d9565b50565b60606110cc82611388565b6110e85760405162461bcd60e51b815260040161078590612726565b60006110f26117b0565b90506000815111611112576040518060200160405280600081525061113d565b8061111c846117bf565b60405160200161112d92919061211b565b6040516020818303038152906040525b9392505050565b61114c6113a5565b6001600160a01b031661115d610ec7565b6001600160a01b0316146111835760405162461bcd60e51b81526004016107859061267b565b600e805460ff19811660ff90911615179055565b601080546111a49061293b565b80601f01602080910402602001604051908101604052809291908181526020018280546111d09061293b565b801561121d5780601f106111f25761010080835404028352916020019161121d565b820191906000526020600020905b81548152906001019060200180831161120057829003601f168201915b505050505081565b600e54610100900460ff1681565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6112696113a5565b6001600160a01b031661127a610ec7565b6001600160a01b0316146112a05760405162461bcd60e51b81526004016107859061267b565b6001600160a01b0381166112c65760405162461bcd60e51b8152600401610785906122c3565b6110be8161163d565b6112d76113a5565b6001600160a01b03166112e8610ec7565b6001600160a01b03161461130e5760405162461bcd60e51b81526004016107859061267b565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b73a17555ac424f378f6c1a296cc888607621e89a1c81565b60006001600160e01b031982166380ac58cd60e01b148061137957506001600160e01b03198216635b5e139f60e01b145b806106c457506106c4826118da565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906113de82610b82565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061142282611388565b61143e5760405162461bcd60e51b81526004016107859061241e565b600061144983610b82565b9050806001600160a01b0316846001600160a01b031614806114845750836001600160a01b03166114798461075e565b6001600160a01b0316145b8061149457506114948185611233565b949350505050565b826001600160a01b03166114af82610b82565b6001600160a01b0316146114d55760405162461bcd60e51b8152600401610785906126b0565b6001600160a01b0382166114fb5760405162461bcd60e51b8152600401610785906123a3565b6115068383836118f3565b6115116000826113a9565b6001600160a01b038316600090815260036020526040812080546001929061153a9084906128f8565b90915550506001600160a01b03821660009081526003602052604081208054600192906115689084906128ad565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061113d82846128d9565b5490565b60006115e5600b6115d5565b90506115f1600b61197c565b610b7e8282611985565b600061113d82846128c5565b6040516001600160a01b0383169082156108fc029083906000818181858888f1935050505015801561084f573d6000803e3d6000fd5b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000826001600160a01b0316826040516116a89061214a565b60006040518083038185875af1925050503d80600081146116e5576040519150601f19603f3d011682016040523d82523d6000602084013e6116ea565b606091505b505090508061084f5760405162461bcd60e51b8152600401610785906127dd565b61171684848461149c565b6117228484848461199f565b610ff15760405162461bcd60e51b815260040161078590612271565b6000611770821015611752575060646106c7565b611f40821015611764575060c86106c7565b61271082101561177757506101906106c7565b612ee082101561178a57506103206106c7565b6136b082101561179d57506103e86106c7565b613a988210156106c757506104b06106c7565b6060601080546106db9061293b565b6060816117e457506040805180820190915260018152600360fc1b60208201526106c7565b8160005b811561180e57806117f881612976565b91506118079050600a836128c5565b91506117e8565b60008167ffffffffffffffff81111561183757634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611861576020820181803683370190505b5090505b8415611494576118766001836128f8565b9150611883600a86612991565b61188e9060306128ad565b60f81b8183815181106118b157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506118d3600a866128c5565b9450611865565b6001600160e01b031981166301ffc9a760e01b14919050565b6118fe83838361084f565b6001600160a01b03831661191a5761191581611aba565b61193d565b816001600160a01b0316836001600160a01b03161461193d5761193d8382611afe565b6001600160a01b0382166119595761195481611b9b565b61084f565b826001600160a01b0316826001600160a01b03161461084f5761084f8282611c74565b80546001019055565b610b7e828260405180602001604052806000815250611cb8565b60006119b3846001600160a01b0316611ceb565b15611aaf57836001600160a01b031663150b7a026119cf6113a5565b8786866040518563ffffffff1660e01b81526004016119f19493929190612161565b602060405180830381600087803b158015611a0b57600080fd5b505af1925050508015611a3b575060408051601f3d908101601f19168201909252611a3891810190612075565b60015b611a95573d808015611a69576040519150601f19603f3d011682016040523d82523d6000602084013e611a6e565b606091505b508051611a8d5760405162461bcd60e51b815260040161078590612271565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611494565b506001949350505050565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b60006001611b0b84610bc2565b611b1591906128f8565b600083815260076020526040902054909150808214611b68576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611bad906001906128f8565b60008381526009602052604081205460088054939450909284908110611be357634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508060088381548110611c1257634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611c5857634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000611c7f83610bc2565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b611cc28383611cf1565b611ccf600084848461199f565b61084f5760405162461bcd60e51b815260040161078590612271565b3b151590565b6001600160a01b038216611d175760405162461bcd60e51b8152600401610785906125c3565b611d2081611388565b15611d3d5760405162461bcd60e51b815260040161078590612309565b611d49600083836118f3565b6001600160a01b0382166000908152600360205260408120805460019290611d729084906128ad565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b828054611ddc9061293b565b90600052602060002090601f016020900481019282611dfe5760008555611e44565b82601f10611e1757805160ff1916838001178555611e44565b82800160010185558215611e44579182015b82811115611e44578251825591602001919060010190611e29565b50611e50929150611e54565b5090565b5b80821115611e505760008155600101611e55565b600067ffffffffffffffff80841115611e8457611e846129d1565b604051601f8501601f19908116603f01168101908282118183101715611eac57611eac6129d1565b81604052809350858152868686011115611ec557600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146106c757600080fd5b600060208284031215611f07578081fd5b61113d82611edf565b60008060408385031215611f22578081fd5b611f2b83611edf565b9150611f3960208401611edf565b90509250929050565b600080600060608486031215611f56578081fd5b611f5f84611edf565b9250611f6d60208501611edf565b9150604084013590509250925092565b60008060008060808587031215611f92578081fd5b611f9b85611edf565b9350611fa960208601611edf565b925060408501359150606085013567ffffffffffffffff811115611fcb578182fd5b8501601f81018713611fdb578182fd5b611fea87823560208401611e69565b91505092959194509250565b60008060408385031215612008578182fd5b61201183611edf565b915060208301358015158114612025578182fd5b809150509250929050565b60008060408385031215612042578182fd5b61204b83611edf565b946020939093013593505050565b60006020828403121561206a578081fd5b813561113d816129e7565b600060208284031215612086578081fd5b815161113d816129e7565b6000602082840312156120a2578081fd5b813567ffffffffffffffff8111156120b8578182fd5b8201601f810184136120c8578182fd5b61149484823560208401611e69565b6000602082840312156120e8578081fd5b5035919050565b6000815180845261210781602086016020860161290f565b601f01601f19169290920160200192915050565b6000835161212d81846020880161290f565b83519083019061214181836020880161290f565b01949350505050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612194908301846120ef565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60006020825261113d60208301846120ef565b6020808252600c908201526b139bc8185c195cc81b19599d60a21b604082015260600190565b6020808252601190820152704e6f206d6f72652066726565206170657360781b604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526019908201527f5075626c69632053616c65206973206e6f742061637469766500000000000000604082015260600190565b60208082526012908201527129b0b632903430b9903737ba103132b3bab760711b604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b60208082526023908201527f4d696e74696e672077697468202462616e616e617320686173206e6f7420626560408201526233bab760e91b606082015260800190565b6020808252600c908201526b139bc8105c195cc81b19599d60a21b604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252601d908201527f4f6e6c792031302066726565206d696e7473207065722077616c6c6574000000604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b602080825260139082015272139bdd08195b9bdd59da08195d1a081cd95b9d606a1b604082015260600190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b6020808252600d908201526c0626040dac2f040e0cae440e8f609b1b604082015260600190565b60208082526010908201526f2a3930b739b332b9103330b4b632b21760811b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b90815260200190565b600082198211156128c0576128c06129a5565b500190565b6000826128d4576128d46129bb565b500490565b60008160001904831182151516156128f3576128f36129a5565b500290565b60008282101561290a5761290a6129a5565b500390565b60005b8381101561292a578181015183820152602001612912565b83811115610ff15750506000910152565b60028104600182168061294f57607f821691505b6020821081141561297057634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561298a5761298a6129a5565b5060010190565b6000826129a0576129a06129bb565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b0319811681146110be57600080fdfea2646970667358221220b07576f25053aae56838ae2516d333d2eac2fef48f18cff9e6b27a077628bc7c64736f6c63430008010033

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.