ETH Price: $3,927.23 (+5.46%)

Token

ERC-20: Blockverse Diamonds (DIAMOND)
 

Overview

Max Total Supply

440,929 DIAMOND

Holders

47

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 0 Decimals)

Filtered by Token Holder
cytoblastoma.eth
Balance
5,989 DIAMOND

Value
$0.00
0xA3d83cA657170c10f50c81cf49B1E86A81f0E815
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:
BlockverseDiamonds

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license
File 1 of 25 : BlockverseDiamonds.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IBlockverseDiamonds.sol";
import "./interfaces/IBlockverseStaking.sol";

contract BlockverseDiamonds is ERC20, IBlockverseDiamonds, Ownable, ReentrancyGuard {
    IBlockverseStaking staking;

    constructor() ERC20("Blockverse Diamonds", "DIAMOND") {}

    function decimals() public view virtual override returns (uint8) {
        return 0;
    }

    function mint(address to, uint256 amount) external override nonReentrant requireContractsSet {
        require(_msgSender() == address(staking) || _msgSender() == owner(), "Not authorized");

        _mint(to, amount);
    }

    // SETUP
    modifier requireContractsSet() {
        require(address(staking) != address(0), "Contracts not set");
        _;
    }

    function setContracts(address _staking) external onlyOwner {
        staking = IBlockverseStaking(_staking);
    }
}

File 2 of 25 : Blockverse.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./interfaces/IBlockverse.sol";
import "./interfaces/IBlockverseStaking.sol";
import "./interfaces/IBlockverseMetadata.sol";

contract Blockverse is IBlockverse, ERC721Enumerable, Ownable, ReentrancyGuard {
    using MerkleProof for bytes32[];

    IBlockverseStaking staking;
    IBlockverseMetadata metadata;

    uint256 public constant price = 0.05 ether;
    uint256 constant mintLimit = 4;
    uint256 constant presaleMintLimit = 3;
    uint256 constant supplyLimit = 10000;
    bytes32 whitelistMerkelRoot;

    // Sale Stages
    // 0 - Nothing enabled
    // 1 - Whitelist
    // 2 - Public sale
    uint8 public saleStage = 0;

    mapping(address => uint256) public minted;
    mapping(address => BlockverseFaction) public walletAssignedMintFaction;
    mapping(BlockverseFaction => uint256) public mintedByFaction;
    mapping(uint256 => BlockverseFaction) public tokenFaction;

    constructor() ERC721("Blockverse", "BLCK")  {}

    // MINT
    function remainingMint(address user) public view returns (uint256) {
        return (saleStage == 1 ? presaleMintLimit : mintLimit) - minted[user];
    }

    function mint(uint256 num, bool autoStake) external override payable nonReentrant requireContractsSet {
        uint256 supply = totalSupply();
        require(tx.origin == _msgSender(), "Only EOA");
        require(saleStage == 2 || _msgSender() == owner(), "Sale not started");
        require(remainingMint(_msgSender()) >= num || _msgSender() == owner(), "Hit mint limit");
        require(supply + num < supplyLimit, "Exceeds maximum supply");
        require(msg.value >= price * num || _msgSender() == owner(), "Ether sent is not correct");
        require(num > 0, "Can't mint 0");

        if (walletAssignedMintFaction[_msgSender()] == BlockverseFaction.UNASSIGNED) {
            BlockverseFaction minFaction = BlockverseFaction.APES;
            uint256 minCount = mintedByFaction[minFaction];

            for (uint256 i = 1; i <= uint256(BlockverseFaction.ALIENS); i++) {
                uint256 iCount = mintedByFaction[BlockverseFaction(i)];
                if (iCount < minCount) {
                    minFaction = BlockverseFaction(i);
                    minCount = iCount;
                }
            }

            walletAssignedMintFaction[_msgSender()] = minFaction;
        }

        minted[_msgSender()] += num;
        mintedByFaction[walletAssignedMintFaction[_msgSender()]] += num;

        for (uint256 i; i < num; i++) {
            address recipient = autoStake && i == 0 ? address(staking) : _msgSender();
            _safeMint(recipient, supply + i + 1);
            tokenFaction[supply + i + 1] = walletAssignedMintFaction[_msgSender()];
        }

        if (autoStake && staking.stakedByUser(_msgSender()) == 0) {
            staking.stake(_msgSender(), supply + 1);
        }
    }

    function whitelistMint(uint256 num, bytes32[] memory proof, bool autoStake) external override payable nonReentrant requireContractsSet {
        uint256 supply = totalSupply();
        require(tx.origin == _msgSender(), "Only EOA");
        require(saleStage == 1 || _msgSender() == owner(), "Pre-sale not started or has ended");
        require(remainingMint(_msgSender()) >= num, "Hit mint limit");
        require(supply + num < supplyLimit, "Exceeds maximum supply");
        require(msg.value >= num * price, "Ether sent is not correct");
        require(whitelistMerkelRoot != 0, "Whitelist not set");
        require(
            proof.verify(whitelistMerkelRoot, keccak256(abi.encodePacked(_msgSender()))),
            "You aren't whitelisted"
        );
        require(num > 0, "Can't mint 0");

        minted[_msgSender()] += num;

        for (uint256 i; i < num; i++) {
            address recipient = autoStake ? address(staking) : _msgSender();
            _safeMint(recipient, supply + i + 1);
            tokenFaction[supply + i + 1] = walletAssignedMintFaction[_msgSender()];
        }

        if (autoStake) {
            staking.stake(_msgSender(), supply + 1);
        }
    }

    // UI LINK/METADATA
    function walletOfUser(address user) public view override returns (uint256[] memory) {
        uint256 tokenCount = balanceOf(user);

        uint256[] memory tokensId = new uint256[](tokenCount);
        for (uint256 i; i < tokenCount; i++) {
            tokensId[i] = tokenOfOwnerByIndex(user, i);
        }
        return tokensId;
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        return metadata.tokenURI(tokenId, tokenFaction[tokenId]);
    }

    function getTokenFaction(uint256 tokenId) external view override returns (BlockverseFaction) {
        return tokenFaction[tokenId];
    }

    // ADMIN
    function setSaleStage(uint8 val) public onlyOwner {
        saleStage = val;
    }

    function setWhitelistRoot(bytes32 val) public onlyOwner {
        whitelistMerkelRoot = val;
    }

    function withdrawAll(address payable a) public onlyOwner {
        a.transfer(address(this).balance);
    }

    // ALLOW STAKING TO MODIFY
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override(ERC721, IERC721) {
        // allow admin contracts to be send without approval
        if(_msgSender() != address(staking) && _msgSender() != owner()) {
            require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        }
        _transfer(from, to, tokenId);
    }

    // SETUP
    modifier requireContractsSet() {
        require(address(staking) != address(0) && address(metadata) != address(0)
        , "Contracts not set");
        _;
    }

    function setContracts(address _staking, address _metadata) external onlyOwner {
        staking = IBlockverseStaking(_staking);
        metadata = IBlockverseMetadata(_metadata);
    }
}

File 3 of 25 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

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 25 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 5 of 25 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

File 6 of 25 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }
        return computedHash;
    }
}

File 7 of 25 : IBlockverse.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface IBlockverse is IERC721Enumerable {
    function mint(uint256 amount, bool autoStake) external payable;
    function whitelistMint(uint256 amount, bytes32[] memory proof, bool autoStake) external payable;
    function walletOfUser(address user) external view returns (uint256[] memory);
    function getTokenFaction(uint256 tokenId) external view returns (BlockverseFaction);

    enum BlockverseFaction {
        UNASSIGNED,
        APES,
        KONGS,
        DOODLERS,
        CATS,
        KAIJUS,
        ALIENS
    }
}

File 8 of 25 : IBlockverseStaking.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

interface IBlockverseStaking {
    function stake(address from, uint256 tokenId) external;
    function claim(uint256 tokenId, bool unstake, uint256 nonce, uint256 amountV, bytes32 r, bytes32 s) external;
    function stakedByUser(address user) external view returns (uint256);

    event Claim(uint256 indexed _tokenId, uint256 indexed _amount, bool indexed _unstake);
}

File 9 of 25 : IBlockverseMetadata.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

import "./IBlockverse.sol";

interface IBlockverseMetadata {
    function tokenURI(uint256 tokenId, IBlockverse.BlockverseFaction faction) external view returns (string memory);
}

File 10 of 25 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: 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 {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: 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 Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev 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 11 of 25 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 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 12 of 25 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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 13 of 25 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 15 of 25 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

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 16 of 25 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 17 of 25 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

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 18 of 25 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 20 of 25 : BlockverseMetadata.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

import "./interfaces/IBlockverseMetadata.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

struct BlockverseToken {
    IBlockverse.BlockverseFaction faction;
    uint8 bottom;
    uint8 eye;
    uint8 mouth;
    uint8 top;
}

contract BlockverseMetadata is IBlockverseMetadata, Ownable {
    using Strings for uint256;
    using Strings for uint8;

    string public cdnUrl;
    uint256[] public tidBreakpoints;
    uint256[] public seedBreakpoints;
    mapping(uint256 => uint8[]) public traitProbabilities;
    mapping(uint256 => uint8[]) public traitAliases;
    mapping(uint256 => mapping(uint8 => string)) public traitNames;

    function tokenURI(uint256 tokenId, IBlockverse.BlockverseFaction faction) external view override returns (string memory) {
        BlockverseToken memory tokenStruct = getTokenMetadata(tokenId, faction);

        string memory metadata;
        if (tokenStruct.faction == IBlockverse.BlockverseFaction.UNASSIGNED) {
            metadata = string(abi.encodePacked(
                '{',
                    '"name":"Blockverse #???",',
                    '"description":"",',
                    '"image":"', cdnUrl, '/unknown",',
                    '"attributes":[',
                        attributeForTypeAndValue("Faction", "???"),',',
                        attributeForTypeAndValue("Bottom", "???"),',',
                        attributeForTypeAndValue("Eye", "???"),',',
                        attributeForTypeAndValue("Mouth", "???"),',',
                        attributeForTypeAndValue("Top", "???"),
                    ']',
                "}"
            ));
        } else {
            string memory queryParams = string(abi.encodePacked(
                    "?base=",uint256(faction).toString(),
                    "&bottoms=",tokenStruct.bottom.toString(),
                    "&eyes=",tokenStruct.eye.toString(),
                    "&mouths=",tokenStruct.mouth.toString(),
                    "&tops=",tokenStruct.top.toString()
                ));
            metadata = string(abi.encodePacked(
                '{',
                    '"name":"Blockverse #',tokenId.toString(),'",',
                    '"description":"",',
                    '"image":"', cdnUrl, '/token',queryParams,'",',
                    '"skinImage":"', cdnUrl, '/skin',queryParams,'",',
                    '"attributes":[',
                        attributeForTypeAndValue("Faction", factionToString(faction)),',',
                        attributeForTypeAndValue("Bottom", traitNames[0][tokenStruct.bottom]),',',
                        attributeForTypeAndValue("Eye", traitNames[1][tokenStruct.eye]),',',
                        attributeForTypeAndValue("Mouth", traitNames[2][tokenStruct.mouth]),',',
                        attributeForTypeAndValue("Top", traitNames[3][tokenStruct.top]),
                    ']',
                "}"
            ));
        }

        return string(abi.encodePacked(
            "data:application/json;base64,",
            base64(bytes(metadata))
        ));
    }

    // METADATA/SEEDING
    function getTokenMetadata(uint256 tid, IBlockverse.BlockverseFaction faction) internal view returns (BlockverseToken memory tokenMetadata) {
        uint256 seed = getTokenSeed(tid);

        if (seed == 0) {
            tokenMetadata.faction = IBlockverse.BlockverseFaction.UNASSIGNED;
        } else {
            tokenMetadata.faction = faction;
            tokenMetadata.bottom = getTraitValue(seed, 0);
            tokenMetadata.eye = getTraitValue(seed, 1);
            tokenMetadata.mouth = getTraitValue(seed, 2);
            tokenMetadata.top = getTraitValue(seed, 3);
        }
    }

    function getTraitValue(uint256 seed, uint256 trait) public view returns (uint8 traitValue) {
        uint8 n = uint8(traitProbabilities[trait].length);

        uint16 traitSeed = uint16(seed >> trait * 16);
        traitValue = uint8(traitSeed) % n;
        uint8 rand = uint8(traitSeed >> 8);

        if (traitProbabilities[trait][traitValue] < rand) {
            traitValue = traitAliases[trait][traitValue];
        }
    }

    function getTokenSeed(uint256 tid) public view returns (uint256 seed) {
        require(tidBreakpoints.length == seedBreakpoints.length, "Invalid state");

        uint256 rangeSeed = 0;
        for (uint256 i; i < tidBreakpoints.length; i++) {
            if (tidBreakpoints[i] > tid) {
                rangeSeed = seedBreakpoints[i];
            }
        }

        seed = rangeSeed == 0 ? 0 : uint256(keccak256(abi.encodePacked(tid, rangeSeed)));
    }

    function addBreakpoint(uint256 seed, uint256 tid) external onlyOwner {
        require(seed != 0, "Seed can't be 0");
        require(tid != 0, "Token ID can't be 0");

        seedBreakpoints.push(seed);
        tidBreakpoints.push(tid);
    }

    // TRAIT UPLOAD
    function uploadTraitNames(uint8 traitType, uint8[] calldata traitIds, string[] calldata newTraitNames) external onlyOwner {
        require(traitIds.length == newTraitNames.length, "Mismatched inputs");
        for (uint i = 0; i < traitIds.length; i++) {
            traitNames[traitType][traitIds[i]] = newTraitNames[i];
        }
    }

    function uploadTraitProbabilities(uint8 traitType, uint8[] calldata newTraitProbabilities) external onlyOwner {
        delete traitProbabilities[traitType];
        for (uint i = 0; i < newTraitProbabilities.length; i++) {
            traitProbabilities[traitType].push(newTraitProbabilities[i]);
        }
    }

    function uploadTraitAliases(uint8 traitType, uint8[] calldata newTraitAliases) external onlyOwner {
        delete traitAliases[traitType];
        for (uint i = 0; i < newTraitAliases.length; i++) {
            traitAliases[traitType].push(newTraitAliases[i]);
        }
    }

    function setCdnUri(string memory newCdnUri) external onlyOwner {
        cdnUrl = newCdnUri;
    }

    // JSON Representation
    function factionToString(IBlockverse.BlockverseFaction faction) internal pure returns (string memory factionString) {
        factionString = "???";
        if (faction == IBlockverse.BlockverseFaction.APES) {
            factionString = "Apes";
        } else if (faction == IBlockverse.BlockverseFaction.KONGS) {
            factionString = "Kongs";
        } else if (faction == IBlockverse.BlockverseFaction.DOODLERS) {
            factionString = "Doodlers";
        } else if (faction == IBlockverse.BlockverseFaction.CATS) {
            factionString = "Cats";
        } else if (faction == IBlockverse.BlockverseFaction.KAIJUS) {
            factionString = "Kaijus";
        } else if (faction == IBlockverse.BlockverseFaction.ALIENS) {
            factionString = "Aliens";
        }
    }

    function attributeForTypeAndValue(string memory traitType, string memory value) internal pure returns (string memory) {
        return string(abi.encodePacked(
            '{"trait_type":"',
            traitType,
            '","value":"',
            value,
            '"}'
        ));
    }

    /** BASE 64 - Written by Brech Devos */
    string internal constant TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

    function base64(bytes memory data) internal pure returns (string memory) {
        if (data.length == 0) return '';

        // load the table into memory
        string memory table = TABLE;

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((data.length + 2) / 3);

        // add some extra buffer at the end required for the writing
        string memory result = new string(encodedLen + 32);

        assembly {
            // set the actual output length
            mstore(result, encodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

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

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

                // read 3 bytes
                let input := mload(dataPtr)

                // write 4 characters
                mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F)))))
                resultPtr := add(resultPtr, 1)
                mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F)))))
                resultPtr := add(resultPtr, 1)
                mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr( 6, input), 0x3F)))))
                resultPtr := add(resultPtr, 1)
                mstore(resultPtr, shl(248, mload(add(tablePtr, and(        input,  0x3F)))))
                resultPtr := add(resultPtr, 1)
            }

            // padding with '='
            switch mod(mload(data), 3)
            case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) }
            case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) }
        }

        return result;
    }
}

File 21 of 25 : BlockverseStaking.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "./interfaces/IBlockverseStaking.sol";
import "./interfaces/IBlockverseDiamonds.sol";
import "./interfaces/IBlockverse.sol";

contract BlockverseStaking is IBlockverseStaking, IERC721Receiver, Ownable, ReentrancyGuard {
    IBlockverse blockverse;
    IBlockverseDiamonds diamonds;
    address signer;

    mapping(address => uint256) public userStake;
    mapping(address => uint256) public userUnstakeTime;
    mapping(address => IBlockverse.BlockverseFaction) public userUnstakeFaction;
    mapping(uint256 => address) public tokenStakedBy;
    mapping(uint256 => bool) public nonceUsed;

    uint256 unstakeFactionChangeTime = 3 days;

    function stake(address from, uint256 tokenId) external override requireContractsSet nonReentrant {
        require(tx.origin == _msgSender() || _msgSender() == address(blockverse), "Only EOA");
        require(userStake[from] == 0, "Must not be staking already");
        require(userUnstakeFaction[from] == blockverse.getTokenFaction(tokenId) || block.timestamp - userUnstakeTime[from] > unstakeFactionChangeTime, "Can't switch faction yet");
        if (_msgSender() != address(blockverse)) {
            require(blockverse.ownerOf(tokenId) == _msgSender(), "Must own this token");
            require(_msgSender() == from, "Must stake from yourself");
            blockverse.transferFrom(_msgSender(), address(this), tokenId);
        }

        userStake[from] = tokenId;
        tokenStakedBy[tokenId] = from;
    }

    bytes32 constant public MINT_CALL_HASH_TYPE = keccak256("mint(address to,uint256 amount)");

    function claim(uint256 tokenId, bool unstake, uint256 nonce, uint256 amountV, bytes32 r, bytes32 s) external override requireContractsSet nonReentrant {
        require(tx.origin == _msgSender(), "Only EOA");
        require(userStake[_msgSender()] == tokenId, "Must own this token");
        require(tokenStakedBy[tokenId] == _msgSender(), "Must own this token");
        require(!nonceUsed[nonce], "Claim already used");

        nonceUsed[nonce] = true;
        uint256 amount = uint248(amountV >> 8);
        uint8 v = uint8(amountV);

        bytes32 digest = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32",
            keccak256(abi.encode(MINT_CALL_HASH_TYPE, nonce, _msgSender(), amount))
        ));

        address signedBy = ecrecover(digest, v, r, s);
        require(signedBy == signer, "Invalid signer");

        if (unstake) {
            userStake[_msgSender()] = 0;
            tokenStakedBy[tokenId] = address(0);
            userUnstakeFaction[_msgSender()] = blockverse.getTokenFaction(tokenId);
            userUnstakeTime[_msgSender()] = block.timestamp;

            blockverse.safeTransferFrom(address(this), _msgSender(), tokenId, "");
        }

        diamonds.mint(_msgSender(), amount);

        emit Claim(tokenId, amount, unstake);
    }

    function stakedByUser(address user) external view override returns (uint256) {
        return userStake[user];
    }

    // SETUP
    modifier requireContractsSet() {
        require(address(blockverse) != address(0) && address(diamonds) != address(0) &&
            address(signer) != address(0),
            "Contracts not set");
        _;
    }

    function setContracts(address _blockverse, address _diamonds, address _signer) external onlyOwner {
        blockverse = IBlockverse(_blockverse);
        diamonds = IBlockverseDiamonds(_diamonds);
        signer = _signer;
    }

    function onERC721Received(
        address,
        address from,
        uint256,
        bytes calldata
    ) external pure override returns (bytes4) {
      require(from == address(0x0), "Cannot send to BlockverseStaking directly");
      return IERC721Receiver.onERC721Received.selector;
    }
}

File 22 of 25 : IBlockverseDiamonds.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

interface IBlockverseDiamonds {
    function mint(address to, uint256 amount) external;
}

File 23 of 25 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/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 24 of 25 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

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 25 of 25 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

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,
    "details": {
      "yul": true,
      "yulDetails": {
        "stackAllocation": true,
        "optimizerSteps": "dhfoDgvulfnTUtnIf"
      }
    }
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  }
}

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":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","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":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staking","type":"address"}],"name":"setContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","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":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604080518082018252601381527f426c6f636b7665727365204469616d6f6e6473000000000000000000000000006020808301918252835180850190945260078452661112505353d39160ca1b90840152815191929162000076916003916200010a565b5080516200008c9060049060208401906200010a565b505050620000a9620000a3620000b460201b60201c565b620000b8565b6001600655620001f7565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200011890620001c6565b90600052602060002090601f0160209004810192826200013c576000855562000187565b82601f106200015757805160ff191683800117855562000187565b8280016001018555821562000187579182015b82811115620001875782518255916020019190600101906200016a565b506200019592915062000199565b5090565b5b808211156200019557600081556001016200019a565b634e487b7160e01b600052602260045260246000fd5b600281046001821680620001db57607f821691505b60208210811415620001f157620001f1620001b0565b50919050565b610eec80620002076000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610203578063a9059cbb14610216578063dd62ed3e14610229578063f2fde38b1461026257600080fd5b806370a08231146101b1578063715018a6146101da5780638da5cb5b146101e257806395d89b41146101fb57600080fd5b8063313ce567116100d3578063313ce56714610167578063395093511461017657806340c10f19146101895780635a2e2f471461019e57600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014357806323b872dd14610154575b600080fd5b61010d610275565b60405161011a91906108f9565b60405180910390f35b610136610131366004610952565b610307565b60405161011a9190610999565b6002545b60405161011a91906109ad565b6101366101623660046109bb565b61031e565b600060405161011a9190610a14565b610136610184366004610952565b610390565b61019c610197366004610952565b6103cc565b005b61019c6101ac366004610a22565b610477565b6101476101bf366004610a22565b6001600160a01b031660009081526020819052604090205490565b61019c6104c3565b6005546001600160a01b031660405161011a9190610a54565b61010d6104f9565b610136610211366004610952565b610508565b610136610224366004610952565b610563565b610147610237366004610a62565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61019c610270366004610a22565b610570565b60606003805461028490610aab565b80601f01602080910402602001604051908101604052809291908181526020018280546102b090610aab565b80156102fd5780601f106102d2576101008083540402835291602001916102fd565b820191906000526020600020905b8154815290600101906020018083116102e057829003601f168201915b5050505050905090565b60006103143384846105cc565b5060015b92915050565b600061032b848484610680565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156103785760405162461bcd60e51b815260040161036f90610b1d565b60405180910390fd5b61038585338584036105cc565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103149185906103c7908690610b43565b6105cc565b600260065414156103ef5760405162461bcd60e51b815260040161036f90610b8f565b60026006556007546001600160a01b031661041c5760405162461bcd60e51b815260040161036f90610bc5565b6007546001600160a01b0316336001600160a01b0316148061044857506005546001600160a01b031633145b6104645760405162461bcd60e51b815260040161036f90610bf8565b61046e8282610795565b50506001600655565b6005546001600160a01b031633146104a15760405162461bcd60e51b815260040161036f90610c38565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b031633146104ed5760405162461bcd60e51b815260040161036f90610c38565b6104f76000610849565b565b60606004805461028490610aab565b3360009081526001602090815260408083206001600160a01b03861684529091528120548281101561054c5760405162461bcd60e51b815260040161036f90610c88565b61055933858584036105cc565b5060019392505050565b6000610314338484610680565b6005546001600160a01b0316331461059a5760405162461bcd60e51b815260040161036f90610c38565b6001600160a01b0381166105c05760405162461bcd60e51b815260040161036f90610cd9565b6105c981610849565b50565b6001600160a01b0383166105f25760405162461bcd60e51b815260040161036f90610d28565b6001600160a01b0382166106185760405162461bcd60e51b815260040161036f90610d75565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906106739085906109ad565b60405180910390a3505050565b6001600160a01b0383166106a65760405162461bcd60e51b815260040161036f90610dc5565b6001600160a01b0382166106cc5760405162461bcd60e51b815260040161036f90610e13565b6001600160a01b038316600090815260208190526040902054818110156107055760405162461bcd60e51b815260040161036f90610e64565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061073c908490610b43565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161078691906109ad565b60405180910390a35b50505050565b6001600160a01b0382166107bb5760405162461bcd60e51b815260040161036f90610ea6565b80600260008282546107cd9190610b43565b90915550506001600160a01b038216600090815260208190526040812080548392906107fa908490610b43565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061083d9085906109ad565b60405180910390a35050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b838110156108b657818101518382015260200161089e565b8381111561078f5750506000910152565b60006108d1825190565b8084526020840193506108e881856020860161089b565b601f01601f19169290920192915050565b6020808252810161090a81846108c7565b9392505050565b60006001600160a01b038216610318565b61092b81610911565b81146105c957600080fd5b803561031881610922565b8061092b565b803561031881610941565b6000806040838503121561096857610968600080fd5b60006109748585610936565b925050602061098585828601610947565b9150509250929050565b8015155b82525050565b60208101610318828461098f565b80610993565b6020810161031882846109a7565b6000806000606084860312156109d3576109d3600080fd5b60006109df8686610936565b93505060206109f086828701610936565b9250506040610a0186828701610947565b9150509250925092565b60ff8116610993565b602081016103188284610a0b565b600060208284031215610a3757610a37600080fd5b6000610a438484610936565b949350505050565b61099381610911565b602081016103188284610a4b565b60008060408385031215610a7857610a78600080fd5b6000610a848585610936565b925050602061098585828601610936565b634e487b7160e01b600052602260045260246000fd5b600281046001821680610abf57607f821691505b60208210811415610ad257610ad2610a95565b50919050565b60288152602081017f45524332303a207472616e7366657220616d6f756e74206578636565647320618152676c6c6f77616e636560c01b602082015290505b60400190565b6020808252810161031881610ad8565b634e487b7160e01b600052601160045260246000fd5b60008219821115610b5657610b56610b2d565b500190565b601f8152602081017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815290505b60200190565b6020808252810161031881610b5b565b60118152602081017010dbdb9d1c9858dd1cc81b9bdd081cd95d607a1b81529050610b89565b6020808252810161031881610b9f565b600e8152602081016d139bdd08185d5d1a1bdc9a5e995960921b81529050610b89565b6020808252810161031881610bd5565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65729101908152610b89565b6020808252810161031881610c08565b60258152602081017f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77815264207a65726f60d81b60208201529050610b17565b6020808252810161031881610c48565b60268152602081017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b60208201529050610b17565b6020808252810161031881610c98565b60248152602081017f45524332303a20617070726f76652066726f6d20746865207a65726f206164648152637265737360e01b60208201529050610b17565b6020808252810161031881610ce9565b60228152602081017f45524332303a20617070726f766520746f20746865207a65726f206164647265815261737360f01b60208201529050610b17565b6020808252810161031881610d38565b60258152602081017f45524332303a207472616e736665722066726f6d20746865207a65726f206164815264647265737360d81b60208201529050610b17565b6020808252810161031881610d85565b60238152602081017f45524332303a207472616e7366657220746f20746865207a65726f206164647281526265737360e81b60208201529050610b17565b6020808252810161031881610dd5565b60268152602081017f45524332303a207472616e7366657220616d6f756e7420657863656564732062815265616c616e636560d01b60208201529050610b17565b6020808252810161031881610e23565b601f8152602081017f45524332303a206d696e7420746f20746865207a65726f20616464726573730081529050610b89565b6020808252810161031881610e7456fea2646970667358221220b9e6bad3efe5a96bd29079f691782f5711e461d4916150d7f056127f7bd06eb364736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610203578063a9059cbb14610216578063dd62ed3e14610229578063f2fde38b1461026257600080fd5b806370a08231146101b1578063715018a6146101da5780638da5cb5b146101e257806395d89b41146101fb57600080fd5b8063313ce567116100d3578063313ce56714610167578063395093511461017657806340c10f19146101895780635a2e2f471461019e57600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014357806323b872dd14610154575b600080fd5b61010d610275565b60405161011a91906108f9565b60405180910390f35b610136610131366004610952565b610307565b60405161011a9190610999565b6002545b60405161011a91906109ad565b6101366101623660046109bb565b61031e565b600060405161011a9190610a14565b610136610184366004610952565b610390565b61019c610197366004610952565b6103cc565b005b61019c6101ac366004610a22565b610477565b6101476101bf366004610a22565b6001600160a01b031660009081526020819052604090205490565b61019c6104c3565b6005546001600160a01b031660405161011a9190610a54565b61010d6104f9565b610136610211366004610952565b610508565b610136610224366004610952565b610563565b610147610237366004610a62565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61019c610270366004610a22565b610570565b60606003805461028490610aab565b80601f01602080910402602001604051908101604052809291908181526020018280546102b090610aab565b80156102fd5780601f106102d2576101008083540402835291602001916102fd565b820191906000526020600020905b8154815290600101906020018083116102e057829003601f168201915b5050505050905090565b60006103143384846105cc565b5060015b92915050565b600061032b848484610680565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156103785760405162461bcd60e51b815260040161036f90610b1d565b60405180910390fd5b61038585338584036105cc565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103149185906103c7908690610b43565b6105cc565b600260065414156103ef5760405162461bcd60e51b815260040161036f90610b8f565b60026006556007546001600160a01b031661041c5760405162461bcd60e51b815260040161036f90610bc5565b6007546001600160a01b0316336001600160a01b0316148061044857506005546001600160a01b031633145b6104645760405162461bcd60e51b815260040161036f90610bf8565b61046e8282610795565b50506001600655565b6005546001600160a01b031633146104a15760405162461bcd60e51b815260040161036f90610c38565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b031633146104ed5760405162461bcd60e51b815260040161036f90610c38565b6104f76000610849565b565b60606004805461028490610aab565b3360009081526001602090815260408083206001600160a01b03861684529091528120548281101561054c5760405162461bcd60e51b815260040161036f90610c88565b61055933858584036105cc565b5060019392505050565b6000610314338484610680565b6005546001600160a01b0316331461059a5760405162461bcd60e51b815260040161036f90610c38565b6001600160a01b0381166105c05760405162461bcd60e51b815260040161036f90610cd9565b6105c981610849565b50565b6001600160a01b0383166105f25760405162461bcd60e51b815260040161036f90610d28565b6001600160a01b0382166106185760405162461bcd60e51b815260040161036f90610d75565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906106739085906109ad565b60405180910390a3505050565b6001600160a01b0383166106a65760405162461bcd60e51b815260040161036f90610dc5565b6001600160a01b0382166106cc5760405162461bcd60e51b815260040161036f90610e13565b6001600160a01b038316600090815260208190526040902054818110156107055760405162461bcd60e51b815260040161036f90610e64565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061073c908490610b43565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161078691906109ad565b60405180910390a35b50505050565b6001600160a01b0382166107bb5760405162461bcd60e51b815260040161036f90610ea6565b80600260008282546107cd9190610b43565b90915550506001600160a01b038216600090815260208190526040812080548392906107fa908490610b43565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061083d9085906109ad565b60405180910390a35050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b838110156108b657818101518382015260200161089e565b8381111561078f5750506000910152565b60006108d1825190565b8084526020840193506108e881856020860161089b565b601f01601f19169290920192915050565b6020808252810161090a81846108c7565b9392505050565b60006001600160a01b038216610318565b61092b81610911565b81146105c957600080fd5b803561031881610922565b8061092b565b803561031881610941565b6000806040838503121561096857610968600080fd5b60006109748585610936565b925050602061098585828601610947565b9150509250929050565b8015155b82525050565b60208101610318828461098f565b80610993565b6020810161031882846109a7565b6000806000606084860312156109d3576109d3600080fd5b60006109df8686610936565b93505060206109f086828701610936565b9250506040610a0186828701610947565b9150509250925092565b60ff8116610993565b602081016103188284610a0b565b600060208284031215610a3757610a37600080fd5b6000610a438484610936565b949350505050565b61099381610911565b602081016103188284610a4b565b60008060408385031215610a7857610a78600080fd5b6000610a848585610936565b925050602061098585828601610936565b634e487b7160e01b600052602260045260246000fd5b600281046001821680610abf57607f821691505b60208210811415610ad257610ad2610a95565b50919050565b60288152602081017f45524332303a207472616e7366657220616d6f756e74206578636565647320618152676c6c6f77616e636560c01b602082015290505b60400190565b6020808252810161031881610ad8565b634e487b7160e01b600052601160045260246000fd5b60008219821115610b5657610b56610b2d565b500190565b601f8152602081017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815290505b60200190565b6020808252810161031881610b5b565b60118152602081017010dbdb9d1c9858dd1cc81b9bdd081cd95d607a1b81529050610b89565b6020808252810161031881610b9f565b600e8152602081016d139bdd08185d5d1a1bdc9a5e995960921b81529050610b89565b6020808252810161031881610bd5565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65729101908152610b89565b6020808252810161031881610c08565b60258152602081017f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77815264207a65726f60d81b60208201529050610b17565b6020808252810161031881610c48565b60268152602081017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b60208201529050610b17565b6020808252810161031881610c98565b60248152602081017f45524332303a20617070726f76652066726f6d20746865207a65726f206164648152637265737360e01b60208201529050610b17565b6020808252810161031881610ce9565b60228152602081017f45524332303a20617070726f766520746f20746865207a65726f206164647265815261737360f01b60208201529050610b17565b6020808252810161031881610d38565b60258152602081017f45524332303a207472616e736665722066726f6d20746865207a65726f206164815264647265737360d81b60208201529050610b17565b6020808252810161031881610d85565b60238152602081017f45524332303a207472616e7366657220746f20746865207a65726f206164647281526265737360e81b60208201529050610b17565b6020808252810161031881610dd5565b60268152602081017f45524332303a207472616e7366657220616d6f756e7420657863656564732062815265616c616e636560d01b60208201529050610b17565b6020808252810161031881610e23565b601f8152602081017f45524332303a206d696e7420746f20746865207a65726f20616464726573730081529050610b89565b6020808252810161031881610e7456fea2646970667358221220b9e6bad3efe5a96bd29079f691782f5711e461d4916150d7f056127f7bd06eb364736f6c63430008090033

Deployed Bytecode Sourcemap

331:765:18:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2141:98:2;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4238:166;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;3229:106::-;3316:12;;3229:106;;;;;;;:::i;4871:478::-;;;;;;:::i;:::-;;:::i;516:90:18:-;574:5;516:90;;;;;;:::i;5744:212:2:-;;;;;;:::i;:::-;;:::i;612:224:18:-;;;;;;:::i;:::-;;:::i;:::-;;980:114;;;;;;:::i;:::-;;:::i;3393:125:2:-;;;;;;:::i;:::-;-1:-1:-1;;;;;3493:18:2;3467:7;3493:18;;;;;;;;;;;;3393:125;1668:101:0;;;:::i;1036:85::-;1108:6;;-1:-1:-1;;;;;1108:6:0;1036:85;;;;;;:::i;2352:102:2:-;;;:::i;6443:405::-;;;;;;:::i;:::-;;:::i;3721:172::-;;;;;;:::i;:::-;;:::i;3951:149::-;;;;;;:::i;:::-;-1:-1:-1;;;;;4066:18:2;;;4040:7;4066:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;3951:149;1918:198:0;;;;;;:::i;:::-;;:::i;2141:98:2:-;2195:13;2227:5;2220:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2141:98;:::o;4238:166::-;4321:4;4337:39;719:10:12;4360:7:2;4369:6;4337:8;:39::i;:::-;-1:-1:-1;4393:4:2;4238:166;;;;;:::o;4871:478::-;5007:4;5023:36;5033:6;5041:9;5052:6;5023:9;:36::i;:::-;-1:-1:-1;;;;;5097:19:2;;5070:24;5097:19;;;:11;:19;;;;;;;;719:10:12;5097:33:2;;;;;;;;5148:26;;;;5140:79;;;;-1:-1:-1;;;5140:79:2;;;;;;;:::i;:::-;;;;;;;;;5253:57;5262:6;719:10:12;5303:6:2;5284:16;:25;5253:8;:57::i;:::-;-1:-1:-1;5338:4:2;;4871:478;-1:-1:-1;;;;4871:478:2:o;5744:212::-;719:10:12;5832:4:2;5880:25;;;:11;:25;;;;;;;;-1:-1:-1;;;;;5880:34:2;;;;;;;;;;5832:4;;5848:80;;5871:7;;5880:47;;5917:10;;5880:47;:::i;:::-;5848:8;:80::i;612:224:18:-;1744:1:1;2325:7;;:19;;2317:63;;;;-1:-1:-1;;;2317:63:1;;;;;;;:::i;:::-;1744:1;2455:7;:18;912:7:18::1;::::0;-1:-1:-1;;;;;912:7:18::1;896:60;;;;-1:-1:-1::0;;;896:60:18::1;;;;;;;:::i;:::-;747:7:::2;::::0;-1:-1:-1;;;;;747:7:18::2;719:10:12::0;-1:-1:-1;;;;;723:32:18::2;;:59;;;-1:-1:-1::0;1108:6:0;;-1:-1:-1;;;;;1108:6:0;719:10:12;759:23:18::2;723:59;715:86;;;;-1:-1:-1::0;;;715:86:18::2;;;;;;;:::i;:::-;812:17;818:2;822:6;812:5;:17::i;:::-;-1:-1:-1::0;;1701:1:1;2628:7;:22;612:224:18:o;980:114::-;1108:6:0;;-1:-1:-1;;;;;1108:6:0;719:10:12;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;;;;;;:::i;:::-;1049:7:18::1;:38:::0;;-1:-1:-1;;;;;;1049:38:18::1;-1:-1:-1::0;;;;;1049:38:18;;;::::1;::::0;;;::::1;::::0;;980:114::o;1668:101:0:-;1108:6;;-1:-1:-1;;;;;1108:6:0;719:10:12;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;;;;;;:::i;:::-;1732:30:::1;1759:1;1732:18;:30::i;:::-;1668:101::o:0;2352:102:2:-;2408:13;2440:7;2433:14;;;;;:::i;6443:405::-;719:10:12;6536:4:2;6579:25;;;:11;:25;;;;;;;;-1:-1:-1;;;;;6579:34:2;;;;;;;;;;6631:35;;;;6623:85;;;;-1:-1:-1;;;6623:85:2;;;;;;;:::i;:::-;6742:67;719:10:12;6765:7:2;6793:15;6774:16;:34;6742:8;:67::i;:::-;-1:-1:-1;6837:4:2;;6443:405;-1:-1:-1;;;6443:405:2:o;3721:172::-;3807:4;3823:42;719:10:12;3847:9:2;3858:6;3823:9;:42::i;1918:198:0:-;1108:6;;-1:-1:-1;;;;;1108:6:0;719:10:12;1248:23:0;1240:68;;;;-1:-1:-1;;;1240:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;2006:22:0;::::1;1998:73;;;;-1:-1:-1::0;;;1998:73:0::1;;;;;;;:::i;:::-;2081:28;2100:8;2081:18;:28::i;:::-;1918:198:::0;:::o;10019:370:2:-;-1:-1:-1;;;;;10150:19:2;;10142:68;;;;-1:-1:-1;;;10142:68:2;;;;;;;:::i;:::-;-1:-1:-1;;;;;10228:21:2;;10220:68;;;;-1:-1:-1;;;10220:68:2;;;;;;;:::i;:::-;-1:-1:-1;;;;;10299:18:2;;;;;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;;:36;;;10350:32;;;;;10329:6;;10350:32;:::i;:::-;;;;;;;;10019:370;;;:::o;7322:713::-;-1:-1:-1;;;;;7457:20:2;;7449:70;;;;-1:-1:-1;;;7449:70:2;;;;;;;:::i;:::-;-1:-1:-1;;;;;7537:23:2;;7529:71;;;;-1:-1:-1;;;7529:71:2;;;;;;;:::i;:::-;-1:-1:-1;;;;;7693:17:2;;7669:21;7693:17;;;;;;;;;;;7728:23;;;;7720:74;;;;-1:-1:-1;;;7720:74:2;;;;;;;:::i;:::-;-1:-1:-1;;;;;7828:17:2;;;:9;:17;;;;;;;;;;;7848:22;;;7828:42;;7890:20;;;;;;;;:30;;7864:6;;7828:9;7890:30;;7864:6;;7890:30;:::i;:::-;;;;;;;;7953:9;-1:-1:-1;;;;;7936:35:2;7945:6;-1:-1:-1;;;;;7936:35:2;;7964:6;7936:35;;;;;;:::i;:::-;;;;;;;;7982:46;7439:596;7322:713;;;:::o;8311:389::-;-1:-1:-1;;;;;8394:21:2;;8386:65;;;;-1:-1:-1;;;8386:65:2;;;;;;;:::i;:::-;8538:6;8522:12;;:22;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;;;8554:18:2;;:9;:18;;;;;;;;;;:28;;8576:6;;8554:9;:28;;8576:6;;8554:28;:::i;:::-;;;;-1:-1:-1;;8597:37:2;;-1:-1:-1;;;;;8597:37:2;;;8614:1;;8597:37;;;;8627:6;;8597:37;:::i;:::-;;;;;;;;8311:389;;:::o;2270:187:0:-;2362:6;;;-1:-1:-1;;;;;2378:17:0;;;-1:-1:-1;;;;;;2378:17:0;;;;;;;2410:40;;2362:6;;;2378:17;2362:6;;2410:40;;2343:16;;2410:40;2333:124;2270:187;:::o;250:258:25:-;322:1;332:113;346:6;343:1;340:13;332:113;;;422:11;;;416:18;403:11;;;396:39;368:2;361:10;332:113;;;463:6;460:1;457:13;454:48;;;-1:-1:-1;;498:1:25;480:16;;473:27;250:258::o;621:283::-;663:3;695:26;715:5;76:12;;14:76;695:26;182:19;;;234:4;225:14;;730:55;;794:52;839:6;834:3;827:4;820:5;816:16;794:52;:::i;:::-;606:2;586:14;-1:-1:-1;;582:28:25;862:36;;;;;;-1:-1:-1;;621:283:25:o;909:267::-;1063:2;1075:47;;;1048:18;;1139:31;1048:18;1157:6;1139:31;:::i;:::-;1131:39;909:267;-1:-1:-1;;;909:267:25:o;1405:96::-;1440:7;-1:-1:-1;;;;;1363:31:25;;1473:22;1295:105;1506:122;1581:22;1597:5;1581:22;:::i;:::-;1574:5;1571:33;1561:61;;1618:1;1615;1608:12;1633:139;1706:20;;1735:31;1706:20;1735:31;:::i;1849:122::-;1940:5;1924:22;1777:67;1976:139;2049:20;;2078:31;2049:20;2078:31;:::i;2120:443::-;2188:6;2196;2249:2;2237:9;2228:7;2224:23;2220:32;2217:147;;;2275:79;331:765:18;;;2275:79:25;2387:1;2407:51;2450:7;2430:9;2407:51;:::i;:::-;2397:61;;;2483:2;2504:53;2549:7;2538:8;2527:9;2523:24;2504:53;:::i;:::-;2494:63;;;2120:443;;;;;:::o;2665:89::-;2640:13;;2633:21;2728:19;2723:3;2716:32;;;2665:89::o;2759:188::-;2887:2;2872:18;;2899:42;2876:9;2915:6;2899:42;:::i;2952:95::-;3034:5;3018:22;1777:67;3052:197;3186:2;3171:18;;3198:45;3175:9;3217:6;3198:45;:::i;3254:559::-;3331:6;3339;3347;3400:2;3388:9;3379:7;3375:23;3371:32;3368:147;;;3426:79;331:765:18;;;3426:79:25;3538:1;3558:51;3601:7;3581:9;3558:51;:::i;:::-;3548:61;;;3634:2;3655:53;3700:7;3689:8;3678:9;3674:24;3655:53;:::i;:::-;3645:63;;;3733:2;3754:53;3799:7;3788:8;3777:9;3773:24;3754:53;:::i;:::-;3744:63;;;3254:559;;;;;:::o;3899:91::-;3887:4;3876:16;;3963:20;3818:76;3995:191;4125:2;4110:18;;4137:43;4114:9;4154:6;4137:43;:::i;4191:327::-;4250:6;4303:2;4291:9;4282:7;4278:23;4274:32;4271:147;;;4329:79;331:765:18;;;4329:79:25;4441:1;4461:51;4504:7;4484:9;4461:51;:::i;:::-;4451:61;4191:327;-1:-1:-1;;;;4191:327:25:o;4523:95::-;4589:22;4605:5;4589:22;:::i;4623:197::-;4757:2;4742:18;;4769:45;4746:9;4788:6;4769:45;:::i;4825:443::-;4893:6;4901;4954:2;4942:9;4933:7;4929:23;4925:32;4922:147;;;4980:79;331:765:18;;;4980:79:25;5092:1;5112:51;5155:7;5135:9;5112:51;:::i;:::-;5102:61;;;5188:2;5209:53;5254:7;5243:8;5232:9;5228:24;5209:53;:::i;5273:127::-;5334:10;5329:3;5325:20;5322:1;5315:31;5365:4;5362:1;5355:15;5389:4;5386:1;5379:15;5405:283;5490:1;5480:12;;5537:1;5527:12;;;5548:61;;5602:4;5594:6;5590:17;5580:27;;5548:61;5655:2;5647:6;5644:14;5624:18;5621:38;5618:64;;;5662:18;;:::i;:::-;5618:64;5405:283;;;:::o;5926:252::-;6039:2;182:19;;234:4;225:14;;5836:34;5813:58;;-1:-1:-1;;;5899:2:25;5887:15;;5880:35;5991:51;-1:-1:-1;6051:93:25;6169:2;6160:12;;5926:252::o;6183:324::-;6390:2;6402:47;;;6375:18;;6466:35;6375:18;6466:35;:::i;6512:127::-;6573:10;6568:3;6564:20;6561:1;6554:31;6604:4;6601:1;6594:15;6628:4;6625:1;6618:15;6644:200;6684:3;6775:14;;6769:21;;6766:47;;;6793:18;;:::i;:::-;-1:-1:-1;6829:9:25;;6644:200::o;7037:252::-;7150:2;182:19;;234:4;225:14;;6992:33;6969:57;;7102:51;-1:-1:-1;7162:93:25;7280:2;7271:12;;7037:252::o;7294:324::-;7501:2;7513:47;;;7486:18;;7577:35;7486:18;7577:35;:::i;7797:252::-;7910:2;182:19;;234:4;225:14;;-1:-1:-1;;;7743:43:25;;7862:51;-1:-1:-1;7922:93:25;7623:169;8054:324;8261:2;8273:47;;;8246:18;;8337:35;8246:18;8337:35;:::i;8554:252::-;8667:2;182:19;;234:4;225:14;;-1:-1:-1;;;8503:40:25;;8619:51;-1:-1:-1;8679:93:25;8383:166;8811:324;9018:2;9030:47;;;9003:18;;9094:35;9003:18;9094:35;:::i;9329:252::-;9442:2;182:19;;;9283:34;225:14;;9260:58;;;9454:93;9140:184;9586:324;9793:2;9805:47;;;9778:18;;9869:35;9778:18;9869:35;:::i;10145:252::-;10258:2;182:19;;234:4;225:14;;10058:34;10035:58;;-1:-1:-1;;;10121:2:25;10109:15;;10102:32;10210:51;-1:-1:-1;10270:93:25;9915:225;10402:324;10609:2;10621:47;;;10594:18;;10685:35;10594:18;10685:35;:::i;10962:252::-;11075:2;182:19;;234:4;225:14;;10874:34;10851:58;;-1:-1:-1;;;10937:2:25;10925:15;;10918:33;11027:51;-1:-1:-1;11087:93:25;10731:226;11219:324;11426:2;11438:47;;;11411:18;;11502:35;11411:18;11502:35;:::i;11777:252::-;11890:2;182:19;;234:4;225:14;;11691:34;11668:58;;-1:-1:-1;;;11754:2:25;11742:15;;11735:31;11842:51;-1:-1:-1;11902:93:25;11548:224;12034:324;12241:2;12253:47;;;12226:18;;12317:35;12226:18;12317:35;:::i;12590:252::-;12703:2;182:19;;234:4;225:14;;12506:34;12483:58;;-1:-1:-1;;;12569:2:25;12557:15;;12550:29;12655:51;-1:-1:-1;12715:93:25;12363:222;12847:324;13054:2;13066:47;;;13039:18;;13130:35;13039:18;13130:35;:::i;13406:252::-;13519:2;182:19;;234:4;225:14;;13319:34;13296:58;;-1:-1:-1;;;13382:2:25;13370:15;;13363:32;13471:51;-1:-1:-1;13531:93:25;13176:225;13663:324;13870:2;13882:47;;;13855:18;;13946:35;13855:18;13946:35;:::i;14220:252::-;14333:2;182:19;;234:4;225:14;;14135:34;14112:58;;-1:-1:-1;;;14198:2:25;14186:15;;14179:30;14285:51;-1:-1:-1;14345:93:25;13992:223;14477:324;14684:2;14696:47;;;14669:18;;14760:35;14669:18;14760:35;:::i;15037:247::-;15145:2;182:19;;234:4;225:14;;14949:34;14926:58;;-1:-1:-1;;;15012:2:25;15000:15;;14993:33;15097:51;-1:-1:-1;15157:93:25;14806:226;15289:319;15496:2;15508:47;;;15481:18;;15572:30;15481:18;15572:30;:::i;15801:252::-;15914:2;182:19;;234:4;225:14;;15756:33;15733:57;;15866:51;-1:-1:-1;15926:93:25;15613:183;16058:324;16265:2;16277:47;;;16250:18;;16341:35;16250:18;16341:35;:::i

Swarm Source

ipfs://b9e6bad3efe5a96bd29079f691782f5711e461d4916150d7f056127f7bd06eb3
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.