MATIC Price: $0.532566 (+1.71%)
Gas: 30.1 GWei
 

Overview

Max Total Supply

22,621 MnAv2

Holders

554

Total Transfers

-

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
MnAv2

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 21 : 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 2 of 21 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

File 3 of 21 : 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 4 of 21 : 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 5 of 21 : 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 6 of 21 : 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 7 of 21 : 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 8 of 21 : 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 9 of 21 : 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 10 of 21 : 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 11 of 21 : 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 12 of 21 : 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 13 of 21 : 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 14 of 21 : 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 15 of 21 : MnAv2.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/IMnA.sol";
import "./interfaces/IORES.sol";
import "./interfaces/IMnAv2.sol";
import "./interfaces/ITraits.sol";
import "./interfaces/ILevelMath.sol";

import "./libraries/ERC721A.sol";

contract MnAv2 is IMnAv2, IERC721Receiver, ERC721Enumerable, Ownable, Pausable {
  struct LastWrite {
    uint64 time;
    uint64 blockNum;
  }

  struct UpgradeEpoch {
    bool skipped;
    uint256 lastUpdate;
  }

  event MarineBurned(uint256 indexed tokenId);
  event AlienBurned(uint256 indexed tokenId);

  // number of tokens have been minted so far
  uint16 public override minted;

  uint256 public MAX_LEVEL = 69;

  // mapping from tokenId to level number
  mapping(uint256 => uint256) private tokenLevels;
  // mapping from tokenId to UpgradeEpoch
  mapping(uint256 => UpgradeEpoch) public upgradeEpoches;
  // mapping from tokenId to a struct containing the token's traits
  mapping(uint256 => IMnA.MarineAlien) private tokenTraits;
  // mapping from hashed(tokenTrait) to the tokenId it's associated with
  // used to ensure there are no duplicates
  mapping(uint256 => uint256) public existingCombinations;
  // Tracks the last block and timestamp that a caller has written to state.
  // Disallow some access to functions if they occur while a change is being written.

  mapping(address => LastWrite) private lastWriteAddress;
  mapping(uint256 => LastWrite) private lastWriteToken;

  address public DEAD_ADDRESS = 0x000000000000000000000000000000000000dEaD;

  // reference to Traits
  ITraits public traits;

  // MnA v1 address
  IMnA public mnaV1;

  // ORES token address
  IORES public ores;

  // KLAYE token address
  IERC20 public klaye;

  // LevelMath contract address
  ILevelMath public levelMath;

  // address => allowedToCallFunctions
  mapping(address => bool) private admins;

  constructor() ERC721("Marines & Aliens Game v2", "MnAv2") {
    _pause();
  }

  modifier requireContractsSet() {
    require(
      address(traits) != address(0) &&
        address(mnaV1) != address(0) &&
        address(ores) != address(0) &&
        address(levelMath) != address(0) &&
        address(klaye) != address(0),
      "Contracts not set"
    );
    _;
  }

  modifier blockIfChangingAddress() {
    // frens can always call whenever they want :)
    require(
      admins[_msgSender()] ||
        lastWriteAddress[tx.origin].blockNum < block.number,
      "hmmmm what doing?"
    );
    _;
  }

  modifier blockIfChangingToken(uint256 tokenId) {
    // frens can always call whenever they want :)
    require(
      admins[_msgSender()] || lastWriteToken[tokenId].blockNum < block.number,
      "hmmmm what doing?"
    );
    _;
  }

  function setContracts(
    address _mnaV1,
    address _traits,
    address _ores,
    address _klaye,
    address _levelMath
  ) external onlyOwner {
    mnaV1 = IMnA(_mnaV1);
    traits = ITraits(_traits);
    ores = IORES(_ores);
    klaye = IERC20(_klaye);
    levelMath = ILevelMath(_levelMath);
  }

  /**
   * Mint a token - any payment / game logic should be handled in the game contract.
   * This will just generate random traits and mint a token to a designated address.
   */
  function mintInternal(address recipient, uint256 tokenId)
    internal
    whenNotPaused
  {
    minted++;
    upgradeEpoches[tokenId] = UpgradeEpoch(false, block.timestamp);
    _safeMint(recipient, tokenId);
  }

  function getTokenWriteBlock(uint256 tokenId)
    external
    view
    override
    returns (uint64)
  {
    require(admins[_msgSender()], "Only admins can call this");
    return lastWriteToken[tokenId].blockNum;
  }

  /**
   * Claims the MnAv2 tokens by burning some MnAv2 tokens.
   * Used to avoid estimateGas failure
   */
  function claimTokens(uint256[] calldata tokenIds) external whenNotPaused {
    for (uint256 index = 0; index < tokenIds.length; index++) {
      uint256 tokenId = tokenIds[index];
      require(mnaV1.ownerOf(tokenId) == msg.sender, "not owner");
      IMnA.MarineAlien memory s = mnaV1.getTokenTraits(tokenId);
      tokenTraits[tokenId] = s;
      mnaV1.safeTransferFrom(msg.sender, DEAD_ADDRESS, tokenId);
      mintInternal(msg.sender, tokenId);
    }
  }

  /**
   * Upgrades current level upto next one. $ORES token is required to do.
   * @param tokenIds - The token ids what you're going to upgrade
   */
  function upgradeLevel(uint256[] calldata tokenIds)
    external
    override
    whenNotPaused
  {
    require(tokenIds.length > 0, "invalid param");
    uint256 totalOresToken = 0;
    for (uint256 index = 0; index < tokenIds.length; index++) {
      uint256 tokenId = tokenIds[index];
      uint256 tokenLevel = tokenLevels[tokenId];
      require(ownerOf(tokenId) == msg.sender, "not owner");
      require(tokenLevel <= MAX_LEVEL, "Already max level");
      UpgradeEpoch memory upgradeEpoch = upgradeEpoches[tokenId];
      ILevelMath.LevelEpoch memory levelEpoch = levelMath.getLevelEpoch(
        tokenLevel
      );
      if (!upgradeEpoch.skipped) {
        require(
          upgradeEpoch.lastUpdate + levelEpoch.coolDownTime < block.timestamp,
          "needs to wait for the cooldown duration"
        );
      }

      totalOresToken += levelEpoch.oresToken;
      tokenLevels[tokenId] = tokenLevel + 1;
      upgradeEpoches[tokenId] = UpgradeEpoch(false, block.timestamp);
    }
    require(ores.transferFrom(msg.sender, DEAD_ADDRESS, totalOresToken));
  }

  /**
   * Resets cooldown time to upgrade immediately.
   * @param tokenIds - The token ids what you're going to reset
   */
  function resetCoolDown(uint256[] calldata tokenIds)
    external
    override
    whenNotPaused
  {
    require(tokenIds.length > 0, "invalid param");
    uint256 totalKlayeToken = 0;
    for (uint256 index = 0; index < tokenIds.length; index++) {
      uint256 tokenId = tokenIds[index];
      uint256 tokenLevel = tokenLevels[tokenId];
      require(tokenLevel <= MAX_LEVEL, "already max level");

      UpgradeEpoch memory upgradeEpoch = upgradeEpoches[tokenId];
      ILevelMath.LevelEpoch memory levelEpoch = levelMath.getLevelEpoch(
        tokenLevel
      );
      require(!upgradeEpoch.skipped, "already reset");
      totalKlayeToken += levelEpoch.klayeToSkip;
      upgradeEpoches[tokenId] = UpgradeEpoch(true, block.timestamp);
    }
    require(klaye.transferFrom(msg.sender, DEAD_ADDRESS, totalKlayeToken));
  }

  /**
   * Burn a token - any game logic should be handled before this function.
   */
  function burn(uint256 tokenId) external whenNotPaused {
    require(admins[_msgSender()], "Only admins can call this");
    require(ownerOf(tokenId) == tx.origin, "Oops you don't own that");
    if (tokenTraits[tokenId].isMarine) {
      emit MarineBurned(tokenId);
    } else {
      emit AlienBurned(tokenId);
    }
    _burn(tokenId);
  }

  function updateOriginAccess(uint16[] memory tokenIds) external override {
    require(admins[_msgSender()], "Only admins can call this");
    uint64 blockNum = uint64(block.number);
    uint64 time = uint64(block.timestamp);
    lastWriteAddress[tx.origin] = LastWrite(time, blockNum);
    for (uint256 i = 0; i < tokenIds.length; i++) {
      lastWriteToken[tokenIds[i]] = LastWrite(time, blockNum);
    }
  }

  function transferFrom(
    address from,
    address to,
    uint256 tokenId
  ) public virtual override(ERC721, IERC721) blockIfChangingToken(tokenId) {
    // allow admin contracts to be send without approval
    if (!admins[_msgSender()]) {
      require(
        _isApprovedOrOwner(_msgSender(), tokenId),
        "ERC721: transfer caller is not owner nor approved"
      );
    }
    _transfer(from, to, tokenId);
  }

  /** READ */

  /**
   * Gets the number of $ORES tokens for the specific level
   */
  function oresTokenForLevel(uint256 level) public view returns (uint256) {}

  /**
   * Gets the number of $KLAYE tokens for the specific level
   */
  function klayeTokenForCoolDown(uint256 level) public view returns (uint256) {}

  /**
   * checks if a token is a Marines
   * @param tokenId the ID of the token to check
   * @return marine - whether or not a token is a Marines
   */
  function isMarine(uint256 tokenId)
    external
    view
    override
    blockIfChangingToken(tokenId)
    returns (bool)
  {
    // Sneaky aliens will be slain if they try to peep this after mint. Nice try.
    IMnA.MarineAlien memory s = tokenTraits[tokenId];
    return s.isMarine;
  }

  /**
   * enables owner to pause / unpause minting
   */
  function setPaused(bool _paused) external requireContractsSet onlyOwner {
    if (_paused) _pause();
    else _unpause();
  }

  /**
   * enables an address to mint / burn
   * @param addr the address to enable
   */
  function addAdmin(address addr) external onlyOwner {
    admins[addr] = true;
  }

  /**
   * disables an address from minting / burning
   * @param addr the address to disbale
   */
  function removeAdmin(address addr) external onlyOwner {
    admins[addr] = false;
  }

  function getTokenTraits(uint256 tokenId)
    external
    view
    override
    blockIfChangingAddress
    blockIfChangingToken(tokenId)
    returns (IMnA.MarineAlien memory)
  {
    return tokenTraits[tokenId];
  }

  function getTokenLevel(uint256 tokenId)
    external
    view
    override
    blockIfChangingAddress
    blockIfChangingToken(tokenId)
    returns (uint256)
  {
    return tokenLevels[tokenId];
  }

  function tokenURI(uint256 tokenId)
    public
    view
    override
    blockIfChangingAddress
    blockIfChangingToken(tokenId)
    returns (string memory)
  {
    require(_exists(tokenId), "Token ID does not exist");
    return traits.tokenURI(tokenId);
  }

  function tokenOfOwnerByIndex(address owner, uint256 index)
    public
    view
    virtual
    override(ERC721Enumerable, IERC721Enumerable)
    blockIfChangingAddress
    returns (uint256)
  {
    require(
      admins[_msgSender()] || lastWriteAddress[owner].blockNum < block.number,
      "hmmmm what doing?"
    );
    uint256 tokenId = super.tokenOfOwnerByIndex(owner, index);
    require(
      admins[_msgSender()] || lastWriteToken[tokenId].blockNum < block.number,
      "hmmmm what doing?"
    );
    return tokenId;
  }

  function balanceOf(address owner)
    public
    view
    virtual
    override(ERC721, IERC721)
    blockIfChangingAddress
    returns (uint256)
  {
    require(
      admins[_msgSender()] || lastWriteAddress[owner].blockNum < block.number,
      "hmmmm what doing?"
    );
    return super.balanceOf(owner);
  }

  function ownerOf(uint256 tokenId)
    public
    view
    virtual
    override(ERC721, IERC721)
    blockIfChangingAddress
    blockIfChangingToken(tokenId)
    returns (address)
  {
    address addr = super.ownerOf(tokenId);
    require(
      admins[_msgSender()] || lastWriteAddress[addr].blockNum < block.number,
      "hmmmm what doing?"
    );
    return addr;
  }

  function tokenByIndex(uint256 index)
    public
    view
    virtual
    override(ERC721Enumerable, IERC721Enumerable)
    returns (uint256)
  {
    uint256 tokenId = super.tokenByIndex(index);
    require(
      admins[_msgSender()] || lastWriteToken[tokenId].blockNum < block.number,
      "hmmmm what doing?"
    );
    return tokenId;
  }

  function approve(address to, uint256 tokenId)
    public
    virtual
    override(ERC721, IERC721)
    blockIfChangingToken(tokenId)
  {
    super.approve(to, tokenId);
  }

  function getApproved(uint256 tokenId)
    public
    view
    virtual
    override(ERC721, IERC721)
    blockIfChangingToken(tokenId)
    returns (address)
  {
    return super.getApproved(tokenId);
  }

  function setApprovalForAll(address operator, bool approved)
    public
    virtual
    override(ERC721, IERC721)
    blockIfChangingAddress
  {
    super.setApprovalForAll(operator, approved);
  }

  function isApprovedForAll(address owner, address operator)
    public
    view
    virtual
    override(ERC721, IERC721)
    blockIfChangingAddress
    returns (bool)
  {
    return super.isApprovedForAll(owner, operator);
  }

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

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

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

File 16 of 21 : ILevelMath.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

interface ILevelMath {
  struct LevelEpoch {
    uint256 oresToken;
    uint256 coolDownTime;
    uint256 klayeToSkip;
    uint256 klayePerDay;
    uint256 maxRewardDuration;
  }

  function getLevelEpoch(uint256 level)
    external
    view
    returns (LevelEpoch memory);
}

File 17 of 21 : IMnA.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

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

interface IMnA is IERC721Enumerable {
    // game data storage
    struct MarineAlien {
        bool isMarine;
        uint8 M_Weapon;
        uint8 M_Back;
        uint8 M_Headgear;
        uint8 M_Eyes;
        uint8 M_Emblem;
        uint8 M_Body;
        uint8 A_Headgear;
        uint8 A_Eye;
        uint8 A_Back;
        uint8 A_Mouth;
        uint8 A_Body;
        uint8 rankIndex;
    }

    function minted() external returns (uint16);

    function updateOriginAccess(uint16[] memory tokenIds) external;

    function mint(address recipient, uint256 seed) external;

    function burn(uint256 tokenId) external;

    function getMaxTokens() external view returns (uint256);

    function getPaidTokens() external view returns (uint256);

    function getTokenTraits(uint256 tokenId)
        external
        view
        returns (MarineAlien memory);

    function getTokenWriteBlock(uint256 tokenId) external view returns (uint64);

    function isMarine(uint256 tokenId) external view returns (bool);
}

File 18 of 21 : IMnAv2.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

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

interface IMnAv2 is IERC721Enumerable {
  function minted() external returns (uint16);

  function updateOriginAccess(uint16[] memory tokenIds) external;

  function getTokenTraits(uint256 tokenId)
    external
    view
    returns (IMnA.MarineAlien memory);

  function getTokenLevel(uint256 tokenId) external view returns (uint256);

  function getTokenWriteBlock(uint256 tokenId) external view returns (uint64);

  function isMarine(uint256 tokenId) external view returns (bool);

  function upgradeLevel(uint256[] calldata tokenIds) external;

  function resetCoolDown(uint256[] calldata tokenIds) external;
}

File 19 of 21 : IORES.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

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

  function burn(address from, uint256 amount) external;

  function updateOriginAccess() external;

  function transferFrom(
    address sender,
    address recipient,
    uint256 amount
  ) external returns (bool);
}

File 20 of 21 : ITraits.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

interface ITraits {
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 21 of 21 : ERC721A.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at 0 (e.g. 1, 2, 3..).
 *
 * Does not support burning tokens to address(0).
 */
contract ERC721A is
  Context,
  ERC165,
  IERC721,
  IERC721Metadata,
  IERC721Enumerable
{
  using Address for address;
  using Strings for uint256;

  struct TokenOwnership {
    address addr;
    uint64 startTimestamp;
  }

  struct AddressData {
    uint128 balance;
    uint128 numberMinted;
  }

  uint256 private currentIndex = 1;

  uint256 internal immutable maxBatchSize;

  // Token name
  string private _name;

  // Token symbol
  string private _symbol;

  // Mapping from token ID to ownership details
  // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
  mapping(uint256 => TokenOwnership) private _ownerships;

  // Mapping owner address to address data
  mapping(address => AddressData) private _addressData;

  // 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
   * `maxBatchSize` refers to how much a minter can mint at a time.
   */
  constructor(
    string memory name_,
    string memory symbol_,
    uint256 maxBatchSize_
  ) {
    require(maxBatchSize_ > 0, "ERC721A: max batch size must be nonzero");
    _name = name_;
    _symbol = symbol_;
    maxBatchSize = maxBatchSize_;
  }

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

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

  /**
   * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
   * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
   * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
   */
  function tokenOfOwnerByIndex(address owner, uint256 index)
    public
    view
    override
    returns (uint256)
  {
    require(index < balanceOf(owner), "ERC721A: owner index out of bounds");
    uint256 numMintedSoFar = totalSupply();
    uint256 tokenIdsIdx = 0;
    address currOwnershipAddr = address(0);
    for (uint256 i = 0; i < numMintedSoFar; i++) {
      TokenOwnership memory ownership = _ownerships[i];
      if (ownership.addr != address(0)) {
        currOwnershipAddr = ownership.addr;
      }
      if (currOwnershipAddr == owner) {
        if (tokenIdsIdx == index) {
          return i;
        }
        tokenIdsIdx++;
      }
    }
    revert("ERC721A: unable to get token of owner by index");
  }

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

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

  function _numberMinted(address owner) internal view returns (uint256) {
    require(
      owner != address(0),
      "ERC721A: number minted query for the zero address"
    );
    return uint256(_addressData[owner].numberMinted);
  }

  function ownershipOf(uint256 tokenId)
    internal
    view
    returns (TokenOwnership memory)
  {
    require(_exists(tokenId), "ERC721A: owner query for nonexistent token");

    uint256 lowestTokenToCheck;
    if (tokenId >= maxBatchSize) {
      lowestTokenToCheck = tokenId - maxBatchSize + 1;
    }

    for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) {
      TokenOwnership memory ownership = _ownerships[curr];
      if (ownership.addr != address(0)) {
        return ownership;
      }
    }

    revert("ERC721A: unable to determine the owner of token");
  }

  /**
   * @dev See {IERC721-ownerOf}.
   */
  function ownerOf(uint256 tokenId) public view override returns (address) {
    return ownershipOf(tokenId).addr;
  }

  /**
   * @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 override {
    address owner = ERC721A.ownerOf(tokenId);
    require(to != owner, "ERC721A: approval to current owner");

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

    _approve(to, tokenId, owner);
  }

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

    return _tokenApprovals[tokenId];
  }

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

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

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

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

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

  /**
   * @dev See {IERC721-safeTransferFrom}.
   */
  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId,
    bytes memory _data
  ) public override {
    _transfer(from, to, tokenId);
    require(
      _checkOnERC721Received(from, to, tokenId, _data),
      "ERC721A: 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`),
   */
  function _exists(uint256 tokenId) internal view returns (bool) {
    return tokenId < currentIndex;
  }

  function _safeMint(address to, uint256 quantity) internal {
    _safeMint(to, quantity, "");
  }

  /**
   * @dev Mints `quantity` tokens and transfers them to `to`.
   *
   * Requirements:
   *
   * - `to` cannot be the zero address.
   * - `quantity` cannot be larger than the max batch size.
   *
   * Emits a {Transfer} event.
   */
  function _safeMint(
    address to,
    uint256 quantity,
    bytes memory _data
  ) internal {
    uint256 startTokenId = currentIndex;
    require(to != address(0), "ERC721A: mint to the zero address");
    // We know if the first token in the batch doesn't exist, the other ones don't as well, because of serial ordering.
    require(!_exists(startTokenId), "ERC721A: token already minted");
    require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high");

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

    AddressData memory addressData = _addressData[to];
    _addressData[to] = AddressData(
      addressData.balance + uint128(quantity),
      addressData.numberMinted + uint128(quantity)
    );
    _ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp));

    uint256 updatedIndex = startTokenId;

    for (uint256 i = 0; i < quantity; i++) {
      emit Transfer(address(0), to, updatedIndex);
      require(
        _checkOnERC721Received(address(0), to, updatedIndex, _data),
        "ERC721A: transfer to non ERC721Receiver implementer"
      );
      updatedIndex++;
    }

    currentIndex = updatedIndex;
    _afterTokenTransfers(address(0), to, startTokenId, quantity);
  }

  /**
   * @dev Transfers `tokenId` from `from` to `to`.
   *
   * 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
  ) private {
    TokenOwnership memory prevOwnership = ownershipOf(tokenId);

    bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
      getApproved(tokenId) == _msgSender() ||
      isApprovedForAll(prevOwnership.addr, _msgSender()));

    require(
      isApprovedOrOwner,
      "ERC721A: transfer caller is not owner nor approved"
    );

    require(
      prevOwnership.addr == from,
      "ERC721A: transfer from incorrect owner"
    );
    require(to != address(0), "ERC721A: transfer to the zero address");

    _beforeTokenTransfers(from, to, tokenId, 1);

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

    _addressData[from].balance -= 1;
    _addressData[to].balance += 1;
    _ownerships[tokenId] = TokenOwnership(to, uint64(block.timestamp));

    // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
    // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
    uint256 nextTokenId = tokenId + 1;
    if (_ownerships[nextTokenId].addr == address(0)) {
      if (_exists(nextTokenId)) {
        _ownerships[nextTokenId] = TokenOwnership(
          prevOwnership.addr,
          prevOwnership.startTimestamp
        );
      }
    }

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

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

  uint256 public nextOwnerToExplicitlySet = 0;

  /**
   * @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
   */
  function _setOwnersExplicit(uint256 quantity) internal {
    uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet;
    require(quantity > 0, "quantity must be nonzero");
    uint256 endIndex = oldNextOwnerToSet + quantity - 1;
    if (endIndex > currentIndex - 1) {
      endIndex = currentIndex - 1;
    }
    // We know if the last one in the group exists, all in the group exist, due to serial ordering.
    require(_exists(endIndex), "not enough minted yet for this cleanup");
    for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) {
      if (_ownerships[i].addr == address(0)) {
        TokenOwnership memory ownership = ownershipOf(i);
        _ownerships[i] = TokenOwnership(
          ownership.addr,
          ownership.startTimestamp
        );
      }
    }
    nextOwnerToExplicitlySet = endIndex + 1;
  }

  /**
   * @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(to).onERC721Received.selector;
      } catch (bytes memory reason) {
        if (reason.length == 0) {
          revert("ERC721A: transfer to non ERC721Receiver implementer");
        } else {
          assembly {
            revert(add(32, reason), mload(reason))
          }
        }
      }
    } else {
      return true;
    }
  }

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

  /**
   * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
   * minting.
   *
   * startTokenId - the first token id to be transferred
   * quantity - the amount to be transferred
   *
   * Calling conditions:
   *
   * - when `from` and `to` are both non-zero.
   * - `from` and `to` are never both zero.
   */
  function _afterTokenTransfers(
    address from,
    address to,
    uint256 startTokenId,
    uint256 quantity
  ) internal virtual {}
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"AlienBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MarineBurned","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEAD_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_LEVEL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"existingCombinations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenTraits","outputs":[{"components":[{"internalType":"bool","name":"isMarine","type":"bool"},{"internalType":"uint8","name":"M_Weapon","type":"uint8"},{"internalType":"uint8","name":"M_Back","type":"uint8"},{"internalType":"uint8","name":"M_Headgear","type":"uint8"},{"internalType":"uint8","name":"M_Eyes","type":"uint8"},{"internalType":"uint8","name":"M_Emblem","type":"uint8"},{"internalType":"uint8","name":"M_Body","type":"uint8"},{"internalType":"uint8","name":"A_Headgear","type":"uint8"},{"internalType":"uint8","name":"A_Eye","type":"uint8"},{"internalType":"uint8","name":"A_Back","type":"uint8"},{"internalType":"uint8","name":"A_Mouth","type":"uint8"},{"internalType":"uint8","name":"A_Body","type":"uint8"},{"internalType":"uint8","name":"rankIndex","type":"uint8"}],"internalType":"struct IMnA.MarineAlien","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenWriteBlock","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isMarine","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"klaye","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"klayeTokenForCoolDown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"levelMath","outputs":[{"internalType":"contract ILevelMath","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mnaV1","outputs":[{"internalType":"contract IMnA","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"ores","outputs":[{"internalType":"contract IORES","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"oresTokenForLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"resetCoolDown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mnaV1","type":"address"},{"internalType":"address","name":"_traits","type":"address"},{"internalType":"address","name":"_ores","type":"address"},{"internalType":"address","name":"_klaye","type":"address"},{"internalType":"address","name":"_levelMath","type":"address"}],"name":"setContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traits","outputs":[{"internalType":"contract ITraits","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"tokenIds","type":"uint16[]"}],"name":"updateOriginAccess","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"upgradeEpoches","outputs":[{"internalType":"bool","name":"skipped","type":"bool"},{"internalType":"uint256","name":"lastUpdate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"upgradeLevel","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526045600b55601280546001600160a01b03191661dead1790553480156200002a57600080fd5b50604080518082018252601881527f4d6172696e6573202620416c69656e732047616d65207632000000000000000060208083019182528351808501909452600584526426b720bb1960d91b9084015281519192916200008d91600091620001e5565b508051620000a3906001906020840190620001e5565b505050620000c0620000ba620000dd60201b60201c565b620000e1565b600a805460ff60a01b19169055620000d762000133565b620002c8565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62000147600a54600160a01b900460ff1690565b156200018c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640160405180910390fd5b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620001c83390565b6040516001600160a01b03909116815260200160405180910390a1565b828054620001f3906200028b565b90600052602060002090601f01602090048101928262000217576000855562000262565b82601f106200023257805160ff191683800117855562000262565b8280016001018555821562000262579182015b828111156200026257825182559160200191906001019062000245565b506200027092915062000274565b5090565b5b8082111562000270576000815560010162000275565b600281046001821680620002a057607f821691505b60208210811415620002c257634e487b7160e01b600052602260045260246000fd5b50919050565b613ef780620002d86000396000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c8063704802751161015c578063b077227b116100ce578063e1fc334f11610087578063e1fc334f1461060c578063e985e9c51461061f578063ebd1736814610632578063ecc5fe301461065d578063f2fde38b14610670578063f63bf8bd146106835761028a565b8063b077227b14610569578063b88d4fde1461057c578063bb7789fc1461058f578063c87b56dd146105a2578063d011645c146105b5578063d1ed7fc4146105c85761028a565b806394e568471161012057806394e56847146104f257806395d89b411461051257806396ffb9241461051a578063a1b8f3741461052d578063a22cb4651461054d578063a49062d4146105605761028a565b806370480275146104a057806370a08231146104b3578063715018a6146104c6578063797e7ed9146104ce5780638da5cb5b146104e15761028a565b80632d08265a116102005780634e6fd6c4116101b95780634e6fd6c4146104195780634f02c4201461042c5780634f6ccce7146104545780635c975abb146104675780636352211e1461047a5780636cbbd5da1461048d5761028a565b80632d08265a146103a75780632f745c59146103ba57806335ca838b146103cd5780634019bfc7146103e057806342842e0e146103f357806342966c68146104065761028a565b806312dcfba41161025257806312dcfba41461028f578063150b7a021461032e57806316c38b3c146103665780631785f53c1461037957806318160ddd1461038c57806323b872dd146103945761028a565b806301641d1e1461028f57806301ffc9a7146102b657806306fdde03146102d9578063081812fc146102ee578063095ea7b314610319575b600080fd5b6102a361029d366004613a55565b50600090565b6040519081526020015b60405180910390f35b6102c96102c4366004613859565b610696565b60405190151581526020016102ad565b6102e16106c3565b6040516102ad9190613ad6565b6103016102fc366004613a55565b610755565b6040516001600160a01b0390911681526020016102ad565b61032c6103273660046136d0565b6107ca565b005b61034d61033c366004613564565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016102ad565b61032c610374366004613821565b610833565b61032c610387366004613444565b610921565b6008546102a3565b61032c6103a2366004613524565b61096c565b61032c6103b53660046137b3565b610a15565b6102a36103c83660046136d0565b610e50565b61032c6103db3660046136fb565b610f79565b6102c96103ee366004613a55565b6110da565b61032c610401366004613524565b611218565b61032c610414366004613a55565b61127d565b601254610301906001600160a01b031681565b600a5461044190600160a81b900461ffff1681565b60405161ffff90911681526020016102ad565b6102a3610462366004613a55565b6113b8565b6102c9600a54600160a01b900460ff1690565b610301610488366004613a55565b61141f565b601754610301906001600160a01b031681565b61032c6104ae366004613444565b611542565b6102a36104c1366004613444565b611590565b61032c611654565b601654610301906001600160a01b031681565b600a546001600160a01b0316610301565b610505610500366004613a55565b61168a565b6040516102ad9190613c4d565b6102e1611885565b601454610301906001600160a01b031681565b6102a361053b366004613a55565b600f6020526000908152604090205481565b61032c61055b3660046136a3565b611894565b6102a3600b5481565b61032c6105773660046137b3565b6118fb565b61032c61058a3660046135fd565b611be7565b61032c61059d3660046137b3565b611c54565b6102e16105b0366004613a55565b611f83565b6102a36105c3366004613a55565b61211d565b6105f56105d6366004613a55565b600d602052600090815260409020805460019091015460ff9091169082565b6040805192151583526020830191909152016102ad565b601354610301906001600160a01b031681565b6102c961062d36600461347c565b6121e4565b610645610640366004613a55565b61226b565b6040516001600160401b0390911681526020016102ad565b601554610301906001600160a01b031681565b61032c61067e366004613444565b6122bd565b61032c6106913660046134b4565b612355565b60006001600160e01b0319821663780e9d6360e01b14806106bb57506106bb826123de565b90505b919050565b6060600080546106d290613dea565b80601f01602080910402602001604051908101604052809291908181526020018280546106fe90613dea565b801561074b5780601f106107205761010080835404028352916020019161074b565b820191906000526020600020905b81548152906001019060200180831161072e57829003601f168201915b5050505050905090565b33600090815260186020526040812054829060ff1680610793575060008181526011602052604090205443600160401b9091046001600160401b0316105b6107b85760405162461bcd60e51b81526004016107af90613b72565b60405180910390fd5b6107c18361242e565b91505b50919050565b33600090815260186020526040902054819060ff1680610808575060008181526011602052604090205443600160401b9091046001600160401b0316105b6108245760405162461bcd60e51b81526004016107af90613b72565b61082e83836124c3565b505050565b6013546001600160a01b03161580159061085757506014546001600160a01b031615155b801561086d57506015546001600160a01b031615155b801561088357506017546001600160a01b031615155b801561089957506016546001600160a01b031615155b6108d95760405162461bcd60e51b815260206004820152601160248201527010dbdb9d1c9858dd1cc81b9bdd081cd95d607a1b60448201526064016107af565b600a546001600160a01b031633146109035760405162461bcd60e51b81526004016107af90613bc7565b8015610916576109116125d4565b61091e565b61091e61265c565b50565b600a546001600160a01b0316331461094b5760405162461bcd60e51b81526004016107af90613bc7565b6001600160a01b03166000908152601860205260409020805460ff19169055565b33600090815260186020526040902054819060ff16806109aa575060008181526011602052604090205443600160401b9091046001600160401b0316105b6109c65760405162461bcd60e51b81526004016107af90613b72565b3360009081526018602052604090205460ff16610a04576109e8335b836126e6565b610a045760405162461bcd60e51b81526004016107af90613bfc565b610a0f8484846127bd565b50505050565b610a28600a54600160a01b900460ff1690565b15610a455760405162461bcd60e51b81526004016107af90613b9d565b60005b8181101561082e576000838383818110610a7257634e487b7160e01b600052603260045260246000fd5b6014546040516331a9108f60e11b8152602092909202939093013560048201819052935033926001600160a01b03169150636352211e9060240160206040518083038186803b158015610ac457600080fd5b505afa158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc9190613460565b6001600160a01b031614610b3e5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064016107af565b6014546040516394e5684760e01b8152600481018390526000916001600160a01b0316906394e56847906024016101a06040518083038186803b158015610b8457600080fd5b505afa158015610b98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbc9190613954565b905080600e600084815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff1602179055506101208201518160000160096101000a81548160ff021916908360ff16021790555061014082015181600001600a6101000a81548160ff021916908360ff16021790555061016082015181600001600b6101000a81548160ff021916908360ff16021790555061018082015181600001600c6101000a81548160ff021916908360ff160217905550905050601460009054906101000a90046001600160a01b03166001600160a01b03166342842e0e33601260009054906101000a90046001600160a01b0316856040518463ffffffff1660e01b8152600401610dff939291906001600160a01b039384168152919092166020820152604081019190915260600190565b600060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b50505050610e3b3383612968565b50508080610e4890613e41565b915050610a48565b3360009081526018602052604081205460ff1680610e8d57503260009081526010602052604090205443600160401b9091046001600160401b0316105b610ea95760405162461bcd60e51b81526004016107af90613b72565b3360009081526018602052604090205460ff1680610eef57506001600160a01b03831660009081526010602052604090205443600160401b9091046001600160401b0316105b610f0b5760405162461bcd60e51b81526004016107af90613b72565b6000610f178484612a14565b3360009081526018602052604090205490915060ff1680610f56575060008181526011602052604090205443600160401b9091046001600160401b0316105b610f725760405162461bcd60e51b81526004016107af90613b72565b9392505050565b3360009081526018602052604090205460ff16610fa85760405162461bcd60e51b81526004016107af90613b3b565b604080518082018252426001600160401b038181168352438082166020808601918252326000908152601090915295862094518554915167ffffffffffffffff199092169084161767ffffffffffffffff60401b1916600160401b91909316029190911790925590915b8351811015610a0f576040518060400160405280836001600160401b03168152602001846001600160401b03168152506011600086848151811061106657634e487b7160e01b600052603260045260246000fd5b60209081029190910181015161ffff168252818101929092526040016000208251815493909201516001600160401b03908116600160401b0267ffffffffffffffff60401b199190931667ffffffffffffffff199094169390931792909216179055806110d281613e41565b915050611012565b33600090815260186020526040812054829060ff1680611118575060008181526011602052604090205443600160401b9091046001600160401b0316105b6111345760405162461bcd60e51b81526004016107af90613b72565b50506000908152600e602090815260409182902082516101a081018452905460ff80821615158084526101008084048316958501959095526201000083048216958401959095526301000000820481166060840152640100000000820481166080840152650100000000008204811660a084015266010000000000008204811660c0840152600160381b8204811660e0840152600160401b8204811693830193909352600160481b81048316610120830152600160501b81048316610140830152600160581b81048316610160830152600160601b90049091166101809091015290565b33600090815260186020526040902054819060ff1680611256575060008181526011602052604090205443600160401b9091046001600160401b0316105b6112725760405162461bcd60e51b81526004016107af90613b72565b610a0f848484612aaa565b611290600a54600160a01b900460ff1690565b156112ad5760405162461bcd60e51b81526004016107af90613b9d565b3360009081526018602052604090205460ff166112dc5760405162461bcd60e51b81526004016107af90613b3b565b326112e68261141f565b6001600160a01b03161461133c5760405162461bcd60e51b815260206004820152601760248201527f4f6f707320796f7520646f6e2774206f776e207468617400000000000000000060448201526064016107af565b6000818152600e602052604090205460ff16156113835760405181907f86f8109fc1014c667ee2be6fb0b2b1d54dc3677ab2235dd38d9ea7d6419ff73890600090a26113af565b60405181907f53a25ae4217fbc3bc27383ae359a946f20812eb9b2cb7c25142d40c433acb65890600090a25b61091e81612ac5565b6000806113c483612b6c565b3360009081526018602052604090205490915060ff1680611403575060008181526011602052604090205443600160401b9091046001600160401b0316105b6106bb5760405162461bcd60e51b81526004016107af90613b72565b3360009081526018602052604081205460ff168061145c57503260009081526010602052604090205443600160401b9091046001600160401b0316105b6114785760405162461bcd60e51b81526004016107af90613b72565b33600090815260186020526040902054829060ff16806114b6575060008181526011602052604090205443600160401b9091046001600160401b0316105b6114d25760405162461bcd60e51b81526004016107af90613b72565b60006114dd84612c0d565b3360009081526018602052604090205490915060ff168061152657506001600160a01b03811660009081526010602052604090205443600160401b9091046001600160401b0316105b6107c15760405162461bcd60e51b81526004016107af90613b72565b600a546001600160a01b0316331461156c5760405162461bcd60e51b81526004016107af90613bc7565b6001600160a01b03166000908152601860205260409020805460ff19166001179055565b3360009081526018602052604081205460ff16806115cd57503260009081526010602052604090205443600160401b9091046001600160401b0316105b6115e95760405162461bcd60e51b81526004016107af90613b72565b3360009081526018602052604090205460ff168061162f57506001600160a01b03821660009081526010602052604090205443600160401b9091046001600160401b0316105b61164b5760405162461bcd60e51b81526004016107af90613b72565b6106bb82612c84565b600a546001600160a01b0316331461167e5760405162461bcd60e51b81526004016107af90613bc7565b6116886000612d0b565b565b604080516101a08101825260008082526020808301829052828401829052606083018290526080830182905260a0830182905260c0830182905260e083018290526101008301829052610120830182905261014083018290526101608301829052610180830182905233825260189052919091205460ff168061172c57503260009081526010602052604090205443600160401b9091046001600160401b0316105b6117485760405162461bcd60e51b81526004016107af90613b72565b33600090815260186020526040902054829060ff1680611786575060008181526011602052604090205443600160401b9091046001600160401b0316105b6117a25760405162461bcd60e51b81526004016107af90613b72565b50506000908152600e602090815260409182902082516101a081018452905460ff808216151583526101008083048216948401949094526201000082048116948301949094526301000000810484166060830152640100000000810484166080830152650100000000008104841660a083015266010000000000008104841660c0830152600160381b8104841660e0830152600160401b8104841692820192909252600160481b82048316610120820152600160501b82048316610140820152600160581b82048316610160820152600160601b90910490911661018082015290565b6060600180546106d290613dea565b3360009081526018602052604090205460ff16806118d157503260009081526010602052604090205443600160401b9091046001600160401b0316105b6118ed5760405162461bcd60e51b81526004016107af90613b72565b6118f78282612d5d565b5050565b61190e600a54600160a01b900460ff1690565b1561192b5760405162461bcd60e51b81526004016107af90613b9d565b806119685760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420706172616d60981b60448201526064016107af565b6000805b82811015611b4e57600084848381811061199657634e487b7160e01b600052603260045260246000fd5b9050602002013590506000600c6000838152602001908152602001600020549050600b548111156119fd5760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e481b585e081b195d995b607a1b60448201526064016107af565b6000828152600d6020908152604080832081518083018352815460ff1615158152600190910154928101929092526017549051631afbb35560e31b8152600481018590529192916001600160a01b039091169063d7dd9aa89060240160a06040518083038186803b158015611a7157600080fd5b505afa158015611a85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa99190613903565b825190915015611aeb5760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481c995cd95d609a1b60448201526064016107af565b6040810151611afa9087613d8f565b60408051808201825260018082524260208084019182526000998a52600d9052929097209051815460ff1916901515178155905195019490945550919350829150611b46905081613e41565b91505061196c565b506016546012546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018490529116906323b872dd906064015b602060405180830381600087803b158015611ba657600080fd5b505af1158015611bba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bde919061383d565b61082e57600080fd5b33600090815260186020526040902054829060ff1680611c25575060008181526011602052604090205443600160401b9091046001600160401b0316105b611c415760405162461bcd60e51b81526004016107af90613b72565b611c4d85858585612d68565b5050505050565b611c67600a54600160a01b900460ff1690565b15611c845760405162461bcd60e51b81526004016107af90613b9d565b80611cc15760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420706172616d60981b60448201526064016107af565b6000805b82811015611f41576000848483818110611cef57634e487b7160e01b600052603260045260246000fd5b602090810292909201356000818152600c909352604090922054919250339050611d188361141f565b6001600160a01b031614611d5a5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064016107af565b600b54811115611da05760405162461bcd60e51b8152602060048201526011602482015270105b1c9958591e481b585e081b195d995b607a1b60448201526064016107af565b6000828152600d6020908152604080832081518083018352815460ff1615158152600190910154928101929092526017549051631afbb35560e31b8152600481018590529192916001600160a01b039091169063d7dd9aa89060240160a06040518083038186803b158015611e1457600080fd5b505afa158015611e28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4c9190613903565b8251909150611ec7574281602001518360200151611e6a9190613d8f565b10611ec75760405162461bcd60e51b815260206004820152602760248201527f6e6565647320746f207761697420666f722074686520636f6f6c646f776e20646044820152663ab930ba34b7b760c91b60648201526084016107af565b8051611ed39087613d8f565b9550611ee0836001613d8f565b6000858152600c60209081526040808320939093558251808401845282815242818301908152978352600d9091529190209051815460ff1916901515178155935160019094019390935550829150611f39905081613e41565b915050611cc5565b506015546012546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018490529116906323b872dd90606401611b8c565b3360009081526018602052604090205460609060ff1680611fc357503260009081526010602052604090205443600160401b9091046001600160401b0316105b611fdf5760405162461bcd60e51b81526004016107af90613b72565b33600090815260186020526040902054829060ff168061201d575060008181526011602052604090205443600160401b9091046001600160401b0316105b6120395760405162461bcd60e51b81526004016107af90613b72565b6000838152600260205260409020546001600160a01b031661209d5760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20494420646f6573206e6f7420657869737400000000000000000060448201526064016107af565b60135460405163c87b56dd60e01b8152600481018590526001600160a01b039091169063c87b56dd9060240160006040518083038186803b1580156120e157600080fd5b505afa1580156120f5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107c19190810190613891565b3360009081526018602052604081205460ff168061215a57503260009081526010602052604090205443600160401b9091046001600160401b0316105b6121765760405162461bcd60e51b81526004016107af90613b72565b33600090815260186020526040902054829060ff16806121b4575060008181526011602052604090205443600160401b9091046001600160401b0316105b6121d05760405162461bcd60e51b81526004016107af90613b72565b50506000908152600c602052604090205490565b3360009081526018602052604081205460ff168061222157503260009081526010602052604090205443600160401b9091046001600160401b0316105b61223d5760405162461bcd60e51b81526004016107af90613b72565b6001600160a01b0380841660009081526005602090815260408083209386168352929052205460ff16610f72565b3360009081526018602052604081205460ff1661229a5760405162461bcd60e51b81526004016107af90613b3b565b50600090815260116020526040902054600160401b90046001600160401b031690565b600a546001600160a01b031633146122e75760405162461bcd60e51b81526004016107af90613bc7565b6001600160a01b03811661234c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107af565b61091e81612d0b565b600a546001600160a01b0316331461237f5760405162461bcd60e51b81526004016107af90613bc7565b601480546001600160a01b03199081166001600160a01b03978816179091556013805482169587169590951790945560158054851693861693909317909255601680548416918516919091179055601780549092169216919091179055565b60006001600160e01b031982166380ac58cd60e01b148061240f57506001600160e01b03198216635b5e139f60e01b145b806106bb57506301ffc9a760e01b6001600160e01b03198316146106bb565b6000818152600260205260408120546001600160a01b03166124a75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107af565b506000908152600460205260409020546001600160a01b031690565b60006124ce82612c0d565b9050806001600160a01b0316836001600160a01b0316141561253c5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107af565b336001600160a01b03821614806125585750612558813361062d565b6125ca5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107af565b61082e8383612d99565b6125e7600a54600160a01b900460ff1690565b156126045760405162461bcd60e51b81526004016107af90613b9d565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861263f3390565b6040516001600160a01b03909116815260200160405180910390a1565b61266f600a54600160a01b900460ff1690565b6126b25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107af565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361263f565b6000818152600260205260408120546001600160a01b031661275f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107af565b600061276a83612c0d565b9050806001600160a01b0316846001600160a01b031614806127a55750836001600160a01b031661279a84610755565b6001600160a01b0316145b806127b557506127b581856121e4565b949350505050565b826001600160a01b03166127d082612c0d565b6001600160a01b0316146128385760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016107af565b6001600160a01b03821661289a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107af565b6128a5838383612e07565b6128b0600082612d99565b6001600160a01b03831660009081526003602052604081208054600192906128d9908490613da7565b90915550506001600160a01b0382166000908152600360205260408120805460019290612907908490613d8f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61297b600a54600160a01b900460ff1690565b156129985760405162461bcd60e51b81526004016107af90613b9d565b600a8054600160a81b900461ffff169060156129b383613e1f565b82546101009290920a61ffff818102199093169190921691909102179055506040805180820182526000808252426020808401918252858352600d90529290209051815460ff19169015151781559051600191909101556118f78282612ec4565b6000612a1f83612c84565b8210612a815760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016107af565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61082e83838360405180602001604052806000815250611be7565b6000612ad082612c0d565b9050612ade81600084612e07565b612ae9600083612d99565b6001600160a01b0381166000908152600360205260408120805460019290612b12908490613da7565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000612b7760085490565b8210612bda5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016107af565b60088281548110612bfb57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806106bb5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107af565b60006001600160a01b038216612cef5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107af565b506001600160a01b031660009081526003602052604090205490565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6118f7338383612ede565b612d71336109e2565b612d8d5760405162461bcd60e51b81526004016107af90613bfc565b610a0f84848484612fad565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612dce82612c0d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6001600160a01b038316612e6257612e5d81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612e85565b816001600160a01b0316836001600160a01b031614612e8557612e858382612fe0565b6001600160a01b038216612ea157612e9c8161307d565b61082e565b826001600160a01b0316826001600160a01b03161461082e5761082e8282613156565b6118f782826040518060200160405280600081525061319a565b816001600160a01b0316836001600160a01b03161415612f405760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107af565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612fb88484846127bd565b612fc4848484846131cd565b610a0f5760405162461bcd60e51b81526004016107af90613ae9565b60006001612fed84612c84565b612ff79190613da7565b60008381526007602052604090205490915080821461304a576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061308f90600190613da7565b600083815260096020526040812054600880549394509092849081106130c557634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600883815481106130f457634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061313a57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061316183612c84565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6131a483836132da565b6131b160008484846131cd565b61082e5760405162461bcd60e51b81526004016107af90613ae9565b60006001600160a01b0384163b156132cf57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613211903390899088908890600401613a99565b602060405180830381600087803b15801561322b57600080fd5b505af192505050801561325b575060408051601f3d908101601f1916820190925261325891810190613875565b60015b6132b5573d808015613289576040519150601f19603f3d011682016040523d82523d6000602084013e61328e565b606091505b5080516132ad5760405162461bcd60e51b81526004016107af90613ae9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127b5565b506001949350505050565b6001600160a01b0382166133305760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107af565b6000818152600260205260409020546001600160a01b0316156133955760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107af565b6133a160008383612e07565b6001600160a01b03821660009081526003602052604081208054600192906133ca908490613d8f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b80516106be81613e9d565b805160ff811681146106be57600080fd5b600060208284031215613455578081fd5b8135610f7281613e88565b600060208284031215613471578081fd5b8151610f7281613e88565b6000806040838503121561348e578081fd5b823561349981613e88565b915060208301356134a981613e88565b809150509250929050565b600080600080600060a086880312156134cb578081fd5b85356134d681613e88565b945060208601356134e681613e88565b935060408601356134f681613e88565b9250606086013561350681613e88565b9150608086013561351681613e88565b809150509295509295909350565b600080600060608486031215613538578081fd5b833561354381613e88565b9250602084013561355381613e88565b929592945050506040919091013590565b60008060008060006080868803121561357b578283fd5b853561358681613e88565b9450602086013561359681613e88565b93506040860135925060608601356001600160401b03808211156135b8578283fd5b818801915088601f8301126135cb578283fd5b8135818111156135d9578384fd5b8960208285010111156135ea578384fd5b9699959850939650602001949392505050565b60008060008060808587031215613612578182fd5b843561361d81613e88565b9350602085013561362d81613e88565b92506040850135915060608501356001600160401b0381111561364e578182fd5b8501601f8101871361365e578182fd5b803561367161366c82613d68565b613d38565b818152886020838501011115613685578384fd5b81602084016020830137908101602001929092525092959194509250565b600080604083850312156136b5578182fd5b82356136c081613e88565b915060208301356134a981613e9d565b600080604083850312156136e2578182fd5b82356136ed81613e88565b946020939093013593505050565b6000602080838503121561370d578182fd5b82356001600160401b0380821115613723578384fd5b818501915085601f830112613736578384fd5b81358181111561374857613748613e72565b8381029150613758848301613d38565b8181528481019084860184860187018a1015613772578788fd5b8795505b838610156137a6578035945061ffff85168514613791578788fd5b84835260019590950194918601918601613776565b5098975050505050505050565b600080602083850312156137c5578182fd5b82356001600160401b03808211156137db578384fd5b818501915085601f8301126137ee578384fd5b8135818111156137fc578485fd5b866020808302850101111561380f578485fd5b60209290920196919550909350505050565b600060208284031215613832578081fd5b8135610f7281613e9d565b60006020828403121561384e578081fd5b8151610f7281613e9d565b60006020828403121561386a578081fd5b8135610f7281613eab565b600060208284031215613886578081fd5b8151610f7281613eab565b6000602082840312156138a2578081fd5b81516001600160401b038111156138b7578182fd5b8201601f810184136138c7578182fd5b80516138d561366c82613d68565b8181528560208385010111156138e9578384fd5b6138fa826020830160208601613dbe565b95945050505050565b600060a08284031215613914578081fd5b61391e60a0613d38565b82518152602083015160208201526040830151604082015260608301516060820152608083015160808201528091505092915050565b60006101a0808385031215613967578182fd5b61397081613d38565b905061397b83613428565b815261398960208401613433565b602082015261399a60408401613433565b60408201526139ab60608401613433565b60608201526139bc60808401613433565b60808201526139cd60a08401613433565b60a08201526139de60c08401613433565b60c08201526139ef60e08401613433565b60e0820152610100613a02818501613433565b90820152610120613a14848201613433565b90820152610140613a26848201613433565b90820152610160613a38848201613433565b90820152610180613a4a848201613433565b908201529392505050565b600060208284031215613a66578081fd5b5035919050565b60008151808452613a85816020860160208601613dbe565b601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613acc90830184613a6d565b9695505050505050565b600060208252610f726020830184613a6d565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526019908201527f4f6e6c792061646d696e732063616e2063616c6c207468697300000000000000604082015260600190565b602080825260119082015270686d6d6d6d207768617420646f696e673f60781b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b8151151581526101a081016020830151613c6c602084018260ff169052565b506040830151613c81604084018260ff169052565b506060830151613c96606084018260ff169052565b506080830151613cab608084018260ff169052565b5060a0830151613cc060a084018260ff169052565b5060c0830151613cd560c084018260ff169052565b5060e0830151613cea60e084018260ff169052565b506101008381015160ff908116918401919091526101208085015182169084015261014080850151821690840152610160808501518216908401526101809384015116929091019190915290565b604051601f8201601f191681016001600160401b0381118282101715613d6057613d60613e72565b604052919050565b60006001600160401b03821115613d8157613d81613e72565b50601f01601f191660200190565b60008219821115613da257613da2613e5c565b500190565b600082821015613db957613db9613e5c565b500390565b60005b83811015613dd9578181015183820152602001613dc1565b83811115610a0f5750506000910152565b600281046001821680613dfe57607f821691505b602082108114156107c457634e487b7160e01b600052602260045260246000fd5b600061ffff80831681811415613e3757613e37613e5c565b6001019392505050565b6000600019821415613e5557613e55613e5c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461091e57600080fd5b801515811461091e57600080fd5b6001600160e01b03198116811461091e57600080fdfea2646970667358221220d3c9e753068bccfc51d15a5fafcaa361d26f3be54136aeba3d2fc618624d227364736f6c63430008020033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061028a5760003560e01c8063704802751161015c578063b077227b116100ce578063e1fc334f11610087578063e1fc334f1461060c578063e985e9c51461061f578063ebd1736814610632578063ecc5fe301461065d578063f2fde38b14610670578063f63bf8bd146106835761028a565b8063b077227b14610569578063b88d4fde1461057c578063bb7789fc1461058f578063c87b56dd146105a2578063d011645c146105b5578063d1ed7fc4146105c85761028a565b806394e568471161012057806394e56847146104f257806395d89b411461051257806396ffb9241461051a578063a1b8f3741461052d578063a22cb4651461054d578063a49062d4146105605761028a565b806370480275146104a057806370a08231146104b3578063715018a6146104c6578063797e7ed9146104ce5780638da5cb5b146104e15761028a565b80632d08265a116102005780634e6fd6c4116101b95780634e6fd6c4146104195780634f02c4201461042c5780634f6ccce7146104545780635c975abb146104675780636352211e1461047a5780636cbbd5da1461048d5761028a565b80632d08265a146103a75780632f745c59146103ba57806335ca838b146103cd5780634019bfc7146103e057806342842e0e146103f357806342966c68146104065761028a565b806312dcfba41161025257806312dcfba41461028f578063150b7a021461032e57806316c38b3c146103665780631785f53c1461037957806318160ddd1461038c57806323b872dd146103945761028a565b806301641d1e1461028f57806301ffc9a7146102b657806306fdde03146102d9578063081812fc146102ee578063095ea7b314610319575b600080fd5b6102a361029d366004613a55565b50600090565b6040519081526020015b60405180910390f35b6102c96102c4366004613859565b610696565b60405190151581526020016102ad565b6102e16106c3565b6040516102ad9190613ad6565b6103016102fc366004613a55565b610755565b6040516001600160a01b0390911681526020016102ad565b61032c6103273660046136d0565b6107ca565b005b61034d61033c366004613564565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016102ad565b61032c610374366004613821565b610833565b61032c610387366004613444565b610921565b6008546102a3565b61032c6103a2366004613524565b61096c565b61032c6103b53660046137b3565b610a15565b6102a36103c83660046136d0565b610e50565b61032c6103db3660046136fb565b610f79565b6102c96103ee366004613a55565b6110da565b61032c610401366004613524565b611218565b61032c610414366004613a55565b61127d565b601254610301906001600160a01b031681565b600a5461044190600160a81b900461ffff1681565b60405161ffff90911681526020016102ad565b6102a3610462366004613a55565b6113b8565b6102c9600a54600160a01b900460ff1690565b610301610488366004613a55565b61141f565b601754610301906001600160a01b031681565b61032c6104ae366004613444565b611542565b6102a36104c1366004613444565b611590565b61032c611654565b601654610301906001600160a01b031681565b600a546001600160a01b0316610301565b610505610500366004613a55565b61168a565b6040516102ad9190613c4d565b6102e1611885565b601454610301906001600160a01b031681565b6102a361053b366004613a55565b600f6020526000908152604090205481565b61032c61055b3660046136a3565b611894565b6102a3600b5481565b61032c6105773660046137b3565b6118fb565b61032c61058a3660046135fd565b611be7565b61032c61059d3660046137b3565b611c54565b6102e16105b0366004613a55565b611f83565b6102a36105c3366004613a55565b61211d565b6105f56105d6366004613a55565b600d602052600090815260409020805460019091015460ff9091169082565b6040805192151583526020830191909152016102ad565b601354610301906001600160a01b031681565b6102c961062d36600461347c565b6121e4565b610645610640366004613a55565b61226b565b6040516001600160401b0390911681526020016102ad565b601554610301906001600160a01b031681565b61032c61067e366004613444565b6122bd565b61032c6106913660046134b4565b612355565b60006001600160e01b0319821663780e9d6360e01b14806106bb57506106bb826123de565b90505b919050565b6060600080546106d290613dea565b80601f01602080910402602001604051908101604052809291908181526020018280546106fe90613dea565b801561074b5780601f106107205761010080835404028352916020019161074b565b820191906000526020600020905b81548152906001019060200180831161072e57829003601f168201915b5050505050905090565b33600090815260186020526040812054829060ff1680610793575060008181526011602052604090205443600160401b9091046001600160401b0316105b6107b85760405162461bcd60e51b81526004016107af90613b72565b60405180910390fd5b6107c18361242e565b91505b50919050565b33600090815260186020526040902054819060ff1680610808575060008181526011602052604090205443600160401b9091046001600160401b0316105b6108245760405162461bcd60e51b81526004016107af90613b72565b61082e83836124c3565b505050565b6013546001600160a01b03161580159061085757506014546001600160a01b031615155b801561086d57506015546001600160a01b031615155b801561088357506017546001600160a01b031615155b801561089957506016546001600160a01b031615155b6108d95760405162461bcd60e51b815260206004820152601160248201527010dbdb9d1c9858dd1cc81b9bdd081cd95d607a1b60448201526064016107af565b600a546001600160a01b031633146109035760405162461bcd60e51b81526004016107af90613bc7565b8015610916576109116125d4565b61091e565b61091e61265c565b50565b600a546001600160a01b0316331461094b5760405162461bcd60e51b81526004016107af90613bc7565b6001600160a01b03166000908152601860205260409020805460ff19169055565b33600090815260186020526040902054819060ff16806109aa575060008181526011602052604090205443600160401b9091046001600160401b0316105b6109c65760405162461bcd60e51b81526004016107af90613b72565b3360009081526018602052604090205460ff16610a04576109e8335b836126e6565b610a045760405162461bcd60e51b81526004016107af90613bfc565b610a0f8484846127bd565b50505050565b610a28600a54600160a01b900460ff1690565b15610a455760405162461bcd60e51b81526004016107af90613b9d565b60005b8181101561082e576000838383818110610a7257634e487b7160e01b600052603260045260246000fd5b6014546040516331a9108f60e11b8152602092909202939093013560048201819052935033926001600160a01b03169150636352211e9060240160206040518083038186803b158015610ac457600080fd5b505afa158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc9190613460565b6001600160a01b031614610b3e5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064016107af565b6014546040516394e5684760e01b8152600481018390526000916001600160a01b0316906394e56847906024016101a06040518083038186803b158015610b8457600080fd5b505afa158015610b98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbc9190613954565b905080600e600084815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff1602179055506101208201518160000160096101000a81548160ff021916908360ff16021790555061014082015181600001600a6101000a81548160ff021916908360ff16021790555061016082015181600001600b6101000a81548160ff021916908360ff16021790555061018082015181600001600c6101000a81548160ff021916908360ff160217905550905050601460009054906101000a90046001600160a01b03166001600160a01b03166342842e0e33601260009054906101000a90046001600160a01b0316856040518463ffffffff1660e01b8152600401610dff939291906001600160a01b039384168152919092166020820152604081019190915260600190565b600060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b50505050610e3b3383612968565b50508080610e4890613e41565b915050610a48565b3360009081526018602052604081205460ff1680610e8d57503260009081526010602052604090205443600160401b9091046001600160401b0316105b610ea95760405162461bcd60e51b81526004016107af90613b72565b3360009081526018602052604090205460ff1680610eef57506001600160a01b03831660009081526010602052604090205443600160401b9091046001600160401b0316105b610f0b5760405162461bcd60e51b81526004016107af90613b72565b6000610f178484612a14565b3360009081526018602052604090205490915060ff1680610f56575060008181526011602052604090205443600160401b9091046001600160401b0316105b610f725760405162461bcd60e51b81526004016107af90613b72565b9392505050565b3360009081526018602052604090205460ff16610fa85760405162461bcd60e51b81526004016107af90613b3b565b604080518082018252426001600160401b038181168352438082166020808601918252326000908152601090915295862094518554915167ffffffffffffffff199092169084161767ffffffffffffffff60401b1916600160401b91909316029190911790925590915b8351811015610a0f576040518060400160405280836001600160401b03168152602001846001600160401b03168152506011600086848151811061106657634e487b7160e01b600052603260045260246000fd5b60209081029190910181015161ffff168252818101929092526040016000208251815493909201516001600160401b03908116600160401b0267ffffffffffffffff60401b199190931667ffffffffffffffff199094169390931792909216179055806110d281613e41565b915050611012565b33600090815260186020526040812054829060ff1680611118575060008181526011602052604090205443600160401b9091046001600160401b0316105b6111345760405162461bcd60e51b81526004016107af90613b72565b50506000908152600e602090815260409182902082516101a081018452905460ff80821615158084526101008084048316958501959095526201000083048216958401959095526301000000820481166060840152640100000000820481166080840152650100000000008204811660a084015266010000000000008204811660c0840152600160381b8204811660e0840152600160401b8204811693830193909352600160481b81048316610120830152600160501b81048316610140830152600160581b81048316610160830152600160601b90049091166101809091015290565b33600090815260186020526040902054819060ff1680611256575060008181526011602052604090205443600160401b9091046001600160401b0316105b6112725760405162461bcd60e51b81526004016107af90613b72565b610a0f848484612aaa565b611290600a54600160a01b900460ff1690565b156112ad5760405162461bcd60e51b81526004016107af90613b9d565b3360009081526018602052604090205460ff166112dc5760405162461bcd60e51b81526004016107af90613b3b565b326112e68261141f565b6001600160a01b03161461133c5760405162461bcd60e51b815260206004820152601760248201527f4f6f707320796f7520646f6e2774206f776e207468617400000000000000000060448201526064016107af565b6000818152600e602052604090205460ff16156113835760405181907f86f8109fc1014c667ee2be6fb0b2b1d54dc3677ab2235dd38d9ea7d6419ff73890600090a26113af565b60405181907f53a25ae4217fbc3bc27383ae359a946f20812eb9b2cb7c25142d40c433acb65890600090a25b61091e81612ac5565b6000806113c483612b6c565b3360009081526018602052604090205490915060ff1680611403575060008181526011602052604090205443600160401b9091046001600160401b0316105b6106bb5760405162461bcd60e51b81526004016107af90613b72565b3360009081526018602052604081205460ff168061145c57503260009081526010602052604090205443600160401b9091046001600160401b0316105b6114785760405162461bcd60e51b81526004016107af90613b72565b33600090815260186020526040902054829060ff16806114b6575060008181526011602052604090205443600160401b9091046001600160401b0316105b6114d25760405162461bcd60e51b81526004016107af90613b72565b60006114dd84612c0d565b3360009081526018602052604090205490915060ff168061152657506001600160a01b03811660009081526010602052604090205443600160401b9091046001600160401b0316105b6107c15760405162461bcd60e51b81526004016107af90613b72565b600a546001600160a01b0316331461156c5760405162461bcd60e51b81526004016107af90613bc7565b6001600160a01b03166000908152601860205260409020805460ff19166001179055565b3360009081526018602052604081205460ff16806115cd57503260009081526010602052604090205443600160401b9091046001600160401b0316105b6115e95760405162461bcd60e51b81526004016107af90613b72565b3360009081526018602052604090205460ff168061162f57506001600160a01b03821660009081526010602052604090205443600160401b9091046001600160401b0316105b61164b5760405162461bcd60e51b81526004016107af90613b72565b6106bb82612c84565b600a546001600160a01b0316331461167e5760405162461bcd60e51b81526004016107af90613bc7565b6116886000612d0b565b565b604080516101a08101825260008082526020808301829052828401829052606083018290526080830182905260a0830182905260c0830182905260e083018290526101008301829052610120830182905261014083018290526101608301829052610180830182905233825260189052919091205460ff168061172c57503260009081526010602052604090205443600160401b9091046001600160401b0316105b6117485760405162461bcd60e51b81526004016107af90613b72565b33600090815260186020526040902054829060ff1680611786575060008181526011602052604090205443600160401b9091046001600160401b0316105b6117a25760405162461bcd60e51b81526004016107af90613b72565b50506000908152600e602090815260409182902082516101a081018452905460ff808216151583526101008083048216948401949094526201000082048116948301949094526301000000810484166060830152640100000000810484166080830152650100000000008104841660a083015266010000000000008104841660c0830152600160381b8104841660e0830152600160401b8104841692820192909252600160481b82048316610120820152600160501b82048316610140820152600160581b82048316610160820152600160601b90910490911661018082015290565b6060600180546106d290613dea565b3360009081526018602052604090205460ff16806118d157503260009081526010602052604090205443600160401b9091046001600160401b0316105b6118ed5760405162461bcd60e51b81526004016107af90613b72565b6118f78282612d5d565b5050565b61190e600a54600160a01b900460ff1690565b1561192b5760405162461bcd60e51b81526004016107af90613b9d565b806119685760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420706172616d60981b60448201526064016107af565b6000805b82811015611b4e57600084848381811061199657634e487b7160e01b600052603260045260246000fd5b9050602002013590506000600c6000838152602001908152602001600020549050600b548111156119fd5760405162461bcd60e51b8152602060048201526011602482015270185b1c9958591e481b585e081b195d995b607a1b60448201526064016107af565b6000828152600d6020908152604080832081518083018352815460ff1615158152600190910154928101929092526017549051631afbb35560e31b8152600481018590529192916001600160a01b039091169063d7dd9aa89060240160a06040518083038186803b158015611a7157600080fd5b505afa158015611a85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa99190613903565b825190915015611aeb5760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e481c995cd95d609a1b60448201526064016107af565b6040810151611afa9087613d8f565b60408051808201825260018082524260208084019182526000998a52600d9052929097209051815460ff1916901515178155905195019490945550919350829150611b46905081613e41565b91505061196c565b506016546012546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018490529116906323b872dd906064015b602060405180830381600087803b158015611ba657600080fd5b505af1158015611bba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bde919061383d565b61082e57600080fd5b33600090815260186020526040902054829060ff1680611c25575060008181526011602052604090205443600160401b9091046001600160401b0316105b611c415760405162461bcd60e51b81526004016107af90613b72565b611c4d85858585612d68565b5050505050565b611c67600a54600160a01b900460ff1690565b15611c845760405162461bcd60e51b81526004016107af90613b9d565b80611cc15760405162461bcd60e51b815260206004820152600d60248201526c696e76616c696420706172616d60981b60448201526064016107af565b6000805b82811015611f41576000848483818110611cef57634e487b7160e01b600052603260045260246000fd5b602090810292909201356000818152600c909352604090922054919250339050611d188361141f565b6001600160a01b031614611d5a5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064016107af565b600b54811115611da05760405162461bcd60e51b8152602060048201526011602482015270105b1c9958591e481b585e081b195d995b607a1b60448201526064016107af565b6000828152600d6020908152604080832081518083018352815460ff1615158152600190910154928101929092526017549051631afbb35560e31b8152600481018590529192916001600160a01b039091169063d7dd9aa89060240160a06040518083038186803b158015611e1457600080fd5b505afa158015611e28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4c9190613903565b8251909150611ec7574281602001518360200151611e6a9190613d8f565b10611ec75760405162461bcd60e51b815260206004820152602760248201527f6e6565647320746f207761697420666f722074686520636f6f6c646f776e20646044820152663ab930ba34b7b760c91b60648201526084016107af565b8051611ed39087613d8f565b9550611ee0836001613d8f565b6000858152600c60209081526040808320939093558251808401845282815242818301908152978352600d9091529190209051815460ff1916901515178155935160019094019390935550829150611f39905081613e41565b915050611cc5565b506015546012546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018490529116906323b872dd90606401611b8c565b3360009081526018602052604090205460609060ff1680611fc357503260009081526010602052604090205443600160401b9091046001600160401b0316105b611fdf5760405162461bcd60e51b81526004016107af90613b72565b33600090815260186020526040902054829060ff168061201d575060008181526011602052604090205443600160401b9091046001600160401b0316105b6120395760405162461bcd60e51b81526004016107af90613b72565b6000838152600260205260409020546001600160a01b031661209d5760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20494420646f6573206e6f7420657869737400000000000000000060448201526064016107af565b60135460405163c87b56dd60e01b8152600481018590526001600160a01b039091169063c87b56dd9060240160006040518083038186803b1580156120e157600080fd5b505afa1580156120f5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107c19190810190613891565b3360009081526018602052604081205460ff168061215a57503260009081526010602052604090205443600160401b9091046001600160401b0316105b6121765760405162461bcd60e51b81526004016107af90613b72565b33600090815260186020526040902054829060ff16806121b4575060008181526011602052604090205443600160401b9091046001600160401b0316105b6121d05760405162461bcd60e51b81526004016107af90613b72565b50506000908152600c602052604090205490565b3360009081526018602052604081205460ff168061222157503260009081526010602052604090205443600160401b9091046001600160401b0316105b61223d5760405162461bcd60e51b81526004016107af90613b72565b6001600160a01b0380841660009081526005602090815260408083209386168352929052205460ff16610f72565b3360009081526018602052604081205460ff1661229a5760405162461bcd60e51b81526004016107af90613b3b565b50600090815260116020526040902054600160401b90046001600160401b031690565b600a546001600160a01b031633146122e75760405162461bcd60e51b81526004016107af90613bc7565b6001600160a01b03811661234c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107af565b61091e81612d0b565b600a546001600160a01b0316331461237f5760405162461bcd60e51b81526004016107af90613bc7565b601480546001600160a01b03199081166001600160a01b03978816179091556013805482169587169590951790945560158054851693861693909317909255601680548416918516919091179055601780549092169216919091179055565b60006001600160e01b031982166380ac58cd60e01b148061240f57506001600160e01b03198216635b5e139f60e01b145b806106bb57506301ffc9a760e01b6001600160e01b03198316146106bb565b6000818152600260205260408120546001600160a01b03166124a75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107af565b506000908152600460205260409020546001600160a01b031690565b60006124ce82612c0d565b9050806001600160a01b0316836001600160a01b0316141561253c5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107af565b336001600160a01b03821614806125585750612558813361062d565b6125ca5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107af565b61082e8383612d99565b6125e7600a54600160a01b900460ff1690565b156126045760405162461bcd60e51b81526004016107af90613b9d565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861263f3390565b6040516001600160a01b03909116815260200160405180910390a1565b61266f600a54600160a01b900460ff1690565b6126b25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107af565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361263f565b6000818152600260205260408120546001600160a01b031661275f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107af565b600061276a83612c0d565b9050806001600160a01b0316846001600160a01b031614806127a55750836001600160a01b031661279a84610755565b6001600160a01b0316145b806127b557506127b581856121e4565b949350505050565b826001600160a01b03166127d082612c0d565b6001600160a01b0316146128385760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016107af565b6001600160a01b03821661289a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107af565b6128a5838383612e07565b6128b0600082612d99565b6001600160a01b03831660009081526003602052604081208054600192906128d9908490613da7565b90915550506001600160a01b0382166000908152600360205260408120805460019290612907908490613d8f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61297b600a54600160a01b900460ff1690565b156129985760405162461bcd60e51b81526004016107af90613b9d565b600a8054600160a81b900461ffff169060156129b383613e1f565b82546101009290920a61ffff818102199093169190921691909102179055506040805180820182526000808252426020808401918252858352600d90529290209051815460ff19169015151781559051600191909101556118f78282612ec4565b6000612a1f83612c84565b8210612a815760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016107af565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61082e83838360405180602001604052806000815250611be7565b6000612ad082612c0d565b9050612ade81600084612e07565b612ae9600083612d99565b6001600160a01b0381166000908152600360205260408120805460019290612b12908490613da7565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000612b7760085490565b8210612bda5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016107af565b60088281548110612bfb57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806106bb5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107af565b60006001600160a01b038216612cef5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107af565b506001600160a01b031660009081526003602052604090205490565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6118f7338383612ede565b612d71336109e2565b612d8d5760405162461bcd60e51b81526004016107af90613bfc565b610a0f84848484612fad565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612dce82612c0d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6001600160a01b038316612e6257612e5d81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612e85565b816001600160a01b0316836001600160a01b031614612e8557612e858382612fe0565b6001600160a01b038216612ea157612e9c8161307d565b61082e565b826001600160a01b0316826001600160a01b03161461082e5761082e8282613156565b6118f782826040518060200160405280600081525061319a565b816001600160a01b0316836001600160a01b03161415612f405760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107af565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612fb88484846127bd565b612fc4848484846131cd565b610a0f5760405162461bcd60e51b81526004016107af90613ae9565b60006001612fed84612c84565b612ff79190613da7565b60008381526007602052604090205490915080821461304a576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061308f90600190613da7565b600083815260096020526040812054600880549394509092849081106130c557634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600883815481106130f457634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061313a57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061316183612c84565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6131a483836132da565b6131b160008484846131cd565b61082e5760405162461bcd60e51b81526004016107af90613ae9565b60006001600160a01b0384163b156132cf57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613211903390899088908890600401613a99565b602060405180830381600087803b15801561322b57600080fd5b505af192505050801561325b575060408051601f3d908101601f1916820190925261325891810190613875565b60015b6132b5573d808015613289576040519150601f19603f3d011682016040523d82523d6000602084013e61328e565b606091505b5080516132ad5760405162461bcd60e51b81526004016107af90613ae9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127b5565b506001949350505050565b6001600160a01b0382166133305760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016107af565b6000818152600260205260409020546001600160a01b0316156133955760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016107af565b6133a160008383612e07565b6001600160a01b03821660009081526003602052604081208054600192906133ca908490613d8f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b80516106be81613e9d565b805160ff811681146106be57600080fd5b600060208284031215613455578081fd5b8135610f7281613e88565b600060208284031215613471578081fd5b8151610f7281613e88565b6000806040838503121561348e578081fd5b823561349981613e88565b915060208301356134a981613e88565b809150509250929050565b600080600080600060a086880312156134cb578081fd5b85356134d681613e88565b945060208601356134e681613e88565b935060408601356134f681613e88565b9250606086013561350681613e88565b9150608086013561351681613e88565b809150509295509295909350565b600080600060608486031215613538578081fd5b833561354381613e88565b9250602084013561355381613e88565b929592945050506040919091013590565b60008060008060006080868803121561357b578283fd5b853561358681613e88565b9450602086013561359681613e88565b93506040860135925060608601356001600160401b03808211156135b8578283fd5b818801915088601f8301126135cb578283fd5b8135818111156135d9578384fd5b8960208285010111156135ea578384fd5b9699959850939650602001949392505050565b60008060008060808587031215613612578182fd5b843561361d81613e88565b9350602085013561362d81613e88565b92506040850135915060608501356001600160401b0381111561364e578182fd5b8501601f8101871361365e578182fd5b803561367161366c82613d68565b613d38565b818152886020838501011115613685578384fd5b81602084016020830137908101602001929092525092959194509250565b600080604083850312156136b5578182fd5b82356136c081613e88565b915060208301356134a981613e9d565b600080604083850312156136e2578182fd5b82356136ed81613e88565b946020939093013593505050565b6000602080838503121561370d578182fd5b82356001600160401b0380821115613723578384fd5b818501915085601f830112613736578384fd5b81358181111561374857613748613e72565b8381029150613758848301613d38565b8181528481019084860184860187018a1015613772578788fd5b8795505b838610156137a6578035945061ffff85168514613791578788fd5b84835260019590950194918601918601613776565b5098975050505050505050565b600080602083850312156137c5578182fd5b82356001600160401b03808211156137db578384fd5b818501915085601f8301126137ee578384fd5b8135818111156137fc578485fd5b866020808302850101111561380f578485fd5b60209290920196919550909350505050565b600060208284031215613832578081fd5b8135610f7281613e9d565b60006020828403121561384e578081fd5b8151610f7281613e9d565b60006020828403121561386a578081fd5b8135610f7281613eab565b600060208284031215613886578081fd5b8151610f7281613eab565b6000602082840312156138a2578081fd5b81516001600160401b038111156138b7578182fd5b8201601f810184136138c7578182fd5b80516138d561366c82613d68565b8181528560208385010111156138e9578384fd5b6138fa826020830160208601613dbe565b95945050505050565b600060a08284031215613914578081fd5b61391e60a0613d38565b82518152602083015160208201526040830151604082015260608301516060820152608083015160808201528091505092915050565b60006101a0808385031215613967578182fd5b61397081613d38565b905061397b83613428565b815261398960208401613433565b602082015261399a60408401613433565b60408201526139ab60608401613433565b60608201526139bc60808401613433565b60808201526139cd60a08401613433565b60a08201526139de60c08401613433565b60c08201526139ef60e08401613433565b60e0820152610100613a02818501613433565b90820152610120613a14848201613433565b90820152610140613a26848201613433565b90820152610160613a38848201613433565b90820152610180613a4a848201613433565b908201529392505050565b600060208284031215613a66578081fd5b5035919050565b60008151808452613a85816020860160208601613dbe565b601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613acc90830184613a6d565b9695505050505050565b600060208252610f726020830184613a6d565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526019908201527f4f6e6c792061646d696e732063616e2063616c6c207468697300000000000000604082015260600190565b602080825260119082015270686d6d6d6d207768617420646f696e673f60781b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b8151151581526101a081016020830151613c6c602084018260ff169052565b506040830151613c81604084018260ff169052565b506060830151613c96606084018260ff169052565b506080830151613cab608084018260ff169052565b5060a0830151613cc060a084018260ff169052565b5060c0830151613cd560c084018260ff169052565b5060e0830151613cea60e084018260ff169052565b506101008381015160ff908116918401919091526101208085015182169084015261014080850151821690840152610160808501518216908401526101809384015116929091019190915290565b604051601f8201601f191681016001600160401b0381118282101715613d6057613d60613e72565b604052919050565b60006001600160401b03821115613d8157613d81613e72565b50601f01601f191660200190565b60008219821115613da257613da2613e5c565b500190565b600082821015613db957613db9613e5c565b500390565b60005b83811015613dd9578181015183820152602001613dc1565b83811115610a0f5750506000910152565b600281046001821680613dfe57607f821691505b602082108114156107c457634e487b7160e01b600052602260045260246000fd5b600061ffff80831681811415613e3757613e37613e5c565b6001019392505050565b6000600019821415613e5557613e55613e5c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461091e57600080fd5b801515811461091e57600080fd5b6001600160e01b03198116811461091e57600080fdfea2646970667358221220d3c9e753068bccfc51d15a5fafcaa361d26f3be54136aeba3d2fc618624d227364736f6c63430008020033

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.