CRO Price: $0.09 (-1.87%)

Atlantis Planets (PLANETS)

Overview

TokenID

5010

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
AtlantisPlanets

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 26 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

File 2 of 26 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

File 3 of 26 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 4 of 26 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 5 of 26 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (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: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        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) {
        _requireMinted(tokenId);

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

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden 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 token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        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: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

    /**
     * @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 from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

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

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {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 an {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 Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @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 {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256, /* firstTokenId */
        uint256 batchSize
    ) internal virtual {
        if (batchSize > 1) {
            if (from != address(0)) {
                _balances[from] -= batchSize;
            }
            if (to != address(0)) {
                _balances[to] += batchSize;
            }
        }
    }

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}
}

File 6 of 26 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 8 of 26 : 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 9 of 26 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

File 10 of 26 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 11 of 26 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 12 of 26 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 13 of 26 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 14 of 26 : 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 15 of 26 : 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 16 of 26 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

File 17 of 26 : AtlantisAddressRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./common/AddressRegistry.sol";

contract AtlantisAddressRegistry is Ownable, AddressRegistry {
    bytes32 private constant ARGONAUTS = "ARGONAUTS";
    bytes32 private constant ARGO = "ARGO";
    bytes32 private constant XARGO = "XARGO";
    bytes32 private constant GOLD = "GOLD";
    bytes32 private constant STARDUST = "STARDUST";
    bytes32 private constant ATLANTIS = "ATLANTIS";
    bytes32 private constant ATLANTIS_PLANETS = "ATLANTIS_PLANETS";
    bytes32 private constant STAKING_WITH_LOCK = "STAKING_WITH_LOCK";
    bytes32 private constant ATLANTIS_GEMSTONES = "GEMSTONES";
    bytes32 private constant ATLANTIS_EQUIPMENTS = "EQUIPMENTS";
    bytes32 private constant ATLANTIS_SPACESHIPS = "SPACESHIPS";
    bytes32 private constant ATLANTIS_RACING = "RACING";
    bytes32 private constant ATLANTIS_MARKETPLACE = "MARKETPLACE";
    bytes32 private constant ATLANTIS_AUCTION = "AUCTION";
    bytes32 private constant STARDUST_PLEDGING = "PLEDGING";

    mapping(address => bool) private _addresses;

    function setArgonauts(address contractAddress) external onlyOwner {
        _setAddress(ARGONAUTS, contractAddress);
    }

    function setArgo(address contractAddress) external onlyOwner {
        _setAddress(ARGO, contractAddress);
    }

    function setXargo(address contractAddress) external onlyOwner {
        _setAddress(XARGO, contractAddress);
    }

    function setGold(address contractAddress) external onlyOwner {
        _setAddress(GOLD, contractAddress);
    }

    function setStardust(address contractAddress) external onlyOwner {
        _setAddress(STARDUST, contractAddress);
    }

    function setAtlantis(address contractAddress) external onlyOwner {
        _setAddress(ATLANTIS, contractAddress);
    }

    function setAtlantisPlanets(address contractAddress) external onlyOwner {
        _setAddress(ATLANTIS_PLANETS, contractAddress);
    }

    function setStakingWithLock(address contractAddress) external onlyOwner {
        _setAddress(STAKING_WITH_LOCK, contractAddress);
    }

    function setGemstones(address contractAddress) external onlyOwner {
        _setAddress(ATLANTIS_GEMSTONES, contractAddress);
    }

    function setEquipments(address contractAddress) external onlyOwner {
        _setAddress(ATLANTIS_EQUIPMENTS, contractAddress);
    }

    function setSpaceships(address contractAddress) external onlyOwner {
        _setAddress(ATLANTIS_SPACESHIPS, contractAddress);
    }

    function setRacing(address contractAddress) external onlyOwner {
        _setAddress(ATLANTIS_RACING, contractAddress);
    }

    function setMarketplace(address contractAddress) external onlyOwner {
        _setAddress(ATLANTIS_MARKETPLACE, contractAddress);
    }

    function setAuction(address contractAddress) external onlyOwner {
        _setAddress(ATLANTIS_AUCTION, contractAddress);
    }

    function setPledging(address contractAddress) external onlyOwner {
        _setAddress(STARDUST_PLEDGING, contractAddress);
    }

    function getArgonauts() external view returns (address) {
        return getAddress(ARGONAUTS);
    }

    function getArgo() external view returns (address) {
        return getAddress(ARGO);
    }

    function getXargo() external view returns (address) {
        return getAddress(XARGO);
    }

    function getGold() external view returns (address) {
        return getAddress(GOLD);
    }

    function getStardust() external view returns (address) {
        return getAddress(STARDUST);
    }

    function getAtlantis() public view returns (address) {
        return getAddress(ATLANTIS);
    }

    function getAtlantisPlanets() public view returns (address) {
        return getAddress(ATLANTIS_PLANETS);
    }

    function getStakingWithLock() external view returns (address) {
        return getAddress(STAKING_WITH_LOCK);
    }

    function getGemstones() public view returns (address) {
        return getAddress(ATLANTIS_GEMSTONES);
    }

    function getEquipments() public view returns (address) {
        return getAddress(ATLANTIS_EQUIPMENTS);
    }

    function getSpaceships() external view returns (address) {
        return getAddress(ATLANTIS_SPACESHIPS);
    }

    function getRacing() external view returns (address) {
        return getAddress(ATLANTIS_RACING);
    }

    function getMarketplace() external view returns (address) {
        return getAddress(ATLANTIS_MARKETPLACE);
    }

    function getAuction() external view returns (address) {
        return getAddress(ATLANTIS_AUCTION);
    }

    function getPledging() external view returns (address) {
        return getAddress(STARDUST_PLEDGING);
    }

    function isControllerContract(address _contractAddress) external view returns (bool) {
        if (
            _contractAddress == getAtlantis() ||
            _contractAddress == getGemstones() ||
            _contractAddress == getAtlantisPlanets() ||
            _contractAddress == getEquipments()
        ) {
            return true;
        }
        return false;
    }
}

File 18 of 26 : AtlantisPlanets.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interface/IAtlantisPlanets.sol";
import "./interface/IAtlantisGemstones.sol";
import "./interface/IStakingWithLock.sol";
import "./common/WithLimitedSupply.sol";
import "./common/RandomlyAssigned.sol";
import "./common/Base64.sol";
import "./AtlantisAddressRegistry.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

/// @title Atlantis Planets Mint Contract
/// @dev Max Supply of 6000 planets
/// @dev First 12 planets are EPIC planets
// Stages
// 0: Before all minting commence
// 1: WhiteList Sale
// 2: Public sale
// 3: Post-Mint (Admin Phase)
// 4: Game Phase

contract AtlantisPlanets is ERC721, Ownable, IAtlantisPlanets, RandomlyAssigned {
    using Strings for uint256;
    using ECDSA for bytes32;

    AtlantisAddressRegistry public addressRegistry;

    string public baseURI;

    uint8 public stage;
    uint256 currentSupply;
    uint256 public whitelistPhase;

    // VIP Whitelist Mint Settings 750 cro
    uint256 public vipMintMaxPerWallet = 10; // VIP Sale Address Mint Cap
    uint256 public vipMintPrice = 0 ether; // VIP Sale Mint Price
    mapping(address => uint256) public vipMintCount;

    // Whitelist Mint Settings 850 cro
    uint256 public whitelistMintMaxPerWallet = 20; // Private Sale Address Mint Cap
    uint256 public whitelistMintPrice = 1 ether; // Private Sale Mint Price
    mapping(address => uint256) public whitelistMintCount;
    address private whitelistSignerAddress;

    // Public Sale Mint Settings 950 cro
    uint256 public publicMintPrice = 2 ether;
    uint256 public publicMintMaxPerWallet = type(uint256).max; // Unlimited mint
    mapping(address => uint256) public publicMintCount;

    // Treasury
    address public treasury;

    // Levelling
    bytes public levelUpGemstone;
    // xARGO base cost
    uint256 public xArgoBaseCost = 40 ether;
    // stardust base cost
    uint256 public stardustBaseCost = 200 ether;
    // stardust base cost scaling
    uint256 public stardustBaseCostScaling = 25;
    // stardust rarity cost scaling
    uint256 public stardustRarityCostScaling = 20;
    // Mapping of planet token id to planet struct
    mapping(uint256 => AtlantisLib.Planet) public planets;

    // Variable to track Gemstone tiers
    uint16 public constant gemstoneTiers = 4;
    // Variable to track max planet level
    uint16 public constant maxPlanetLevel = 50;

    bool public revealed = false;
    string public unrevealedImageURI = "ipfs://bafybeicabmv4ccbblnnpfq6q5rg5sr2qqq4mc7y7y3tqyfztiwzrkff5vi";

    // gemstone token ids is in the following sequence:
    // 1 - Fire 1
    // 2 - Lightning 1
    // 3 - Steel 1
    // 4 - Fire 2
    // 5 - Lightning 2
    // 6 - Steel 2
    // 7 - Fire 3
    // 8 - Lightning 3
    // 9 - Steel 3
    // 10 - Fire 4
    // 11 - Lightning 4
    // 12 - Steel 4

    // Events
    event PlanetUpgraded(uint256 indexed tokenId, uint256 indexed level);
    event PrivateMint(address indexed to, uint256 amount);
    event PublicMint(address indexed to, uint256 amount);

    // -------------------- MODIFIERS ----------------------

    /**
     * @dev Prevent Smart Contracts from calling the functions with this modifier
     */
    modifier onlyEOA() {
        require(msg.sender == tx.origin, "Planets: must use EOA");
        _;
    }

    constructor(
        address _owner,
        address _whitelistSignerAddress,
        string memory __baseURI,
        AtlantisAddressRegistry _addressRegistry
    ) ERC721("Atlantis Planets", "PLANETS") RandomlyAssigned(6000, 13) {
        setTreasury(_owner);
        setWhitelistSignerAddress(_whitelistSignerAddress);
        setBaseURI(__baseURI);
        transferOwnership(_owner);
        currentSupply = 0;
        addressRegistry = _addressRegistry;
    }

    /**
     * @dev Set Revealed Metadata URI
     */
    function setBaseURI(string memory _newBaseURI) public onlyOwner {
        baseURI = _newBaseURI;
    }

    /**
     * @dev Set Unrevealed Metadata URI
     */
    function setUnrevealedImageURI(string memory _newUnrevealedImageURI) public onlyOwner {
        unrevealedImageURI = _newUnrevealedImageURI;
    }

    // -------------------- ATLANTIS PUBLIC FUNCTIONS ----------------------

    /**
     * @dev Get gemstone upgrade requirements for upgrading a planet
     * @param _tokenId The token id of the planet
     * @param _levels The number of levels to upgrade
     * @return gemstoneRequirements The gemstone requirements for upgrading the planet
     */
    function getUpgradeRequirements(
        uint256 _tokenId,
        uint8 _levels
    ) internal view returns (uint16[4] memory gemstoneRequirements) {
        // Get planet struct
        AtlantisLib.Planet memory planet = planets[_tokenId];
        uint8 planetLevel = planet.level;
        uint8 newLevel = planetLevel + _levels;
        uint8 orbit = uint8(planet.orbit);

        if (planetLevel + _levels > maxPlanetLevel) revert ExceededMaxLevel();

        // Cumulative requirement at target level - Cumulative requirement at current level = requirement for upgrade
        gemstoneRequirements[0] =
            toUint16(levelUpGemstone, orbit, newLevel, 0) -
            toUint16(levelUpGemstone, orbit, planetLevel, 0);

        gemstoneRequirements[1] =
            toUint16(levelUpGemstone, orbit, newLevel, 1) -
            toUint16(levelUpGemstone, orbit, planetLevel, 1);

        gemstoneRequirements[2] =
            toUint16(levelUpGemstone, orbit, newLevel, 2) -
            toUint16(levelUpGemstone, orbit, planetLevel, 2);

        gemstoneRequirements[3] =
            toUint16(levelUpGemstone, orbit, newLevel, 3) -
            toUint16(levelUpGemstone, orbit, planetLevel, 3);
    }

    /**
     * @notice Get uint16 value from a byte array
     * @param _bytes The byte array
     * @param orbit Orbit of the planet
     * @param level Level of the planet
     * @param tier Tier of the gemstone
     * @dev This function was modified to serve retriving the gemstone upgrade requirements
     */
    function toUint16(
        bytes memory _bytes,
        uint256 orbit,
        uint256 level,
        uint256 tier
    ) internal pure returns (uint16 tempUint) {
        uint256 _start = orbit * 8 + (level - 1) * 32 + tier * 2;
        require(_bytes.length >= _start + 2, "toUint16_outOfBounds");

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }
    }

    /**
     * @notice Get evolution stage of planet
     * @param level Level of a planet
     */
    function _getPlanetEvolution(
        uint16 level
    ) internal pure returns (AtlantisLib.Evolution evo, string memory evoString) {
        if (level < 20) {
            evo = AtlantisLib.Evolution.ALPHA;
            evoString = "Alpha";
        } else if (level >= 20 && level < 30) {
            evo = AtlantisLib.Evolution.BETA;
            evoString = "Beta";
        } else if (level >= 30 && level < 40) {
            evo = AtlantisLib.Evolution.GAMMA;
            evoString = "Gamma";
        } else if (level >= 40 && level < 50) {
            evo = AtlantisLib.Evolution.DELTA;
            evoString = "Delta";
        } else if (level == 50) {
            evo = AtlantisLib.Evolution.EPSILON;
            evoString = "Epsilon";
        }
    }

    /**
     * @notice Get planet details
     * @dev Planet details include: level, element, orbit, onExpedition
     */
    function getPlanetDetails(uint256 _planetId) external view returns (AtlantisLib.Planet memory) {
        AtlantisLib.Planet memory planet = planets[_planetId];
        return planet;
    }

    /**
     * @notice Return xArgo cost for upgrading a planet
     */
    function getxArgoCost(uint8 currentLevel, uint8 newLevel) internal view returns (uint256 xArgoCost) {
        if (currentLevel == 0 || currentLevel >= newLevel) revert InvalidUpgradeLevel(currentLevel, newLevel);

        // Loop through all levels and add up xArgo cost
        for (uint256 i = currentLevel; i < newLevel; i++) {
            xArgoCost += xArgoBaseCost * i;
        }
    }

    /**
     * @notice Return stardust cost for upgrading a planet
     * @param currentLevel Current Level of Planet
     * @param newLevel New planet level
     * @param orbit Orbit of planet
     */
    function getStardustCost(
        uint8 currentLevel,
        uint8 newLevel,
        uint8 orbit
    ) internal view returns (uint256 stardustCost) {
        if (currentLevel == 0 || currentLevel >= newLevel) revert InvalidUpgradeLevel(currentLevel, newLevel);

        // Loop through all levels and add up stardust cost
        for (uint256 i = currentLevel; i < newLevel; i++) {
            stardustCost +=
                (stardustBaseCost *
                    (((i - 1) * stardustBaseCostScaling + 100) * ((orbit) * stardustRarityCostScaling + 100))) /
                10000;
        }
    }

    /**
     * External function for frontend to retrieve stardust, xArgo, and gemstone costs in 1 multicall
     */
    function getUpgradeCosts(
        uint256 _tokenId,
        uint8 _levels
    ) external view returns (uint256 stardustCost, uint256 xArgoCost, uint16[4] memory gemstoneRequirements) {
        // Get planet struct
        AtlantisLib.Planet memory planet = planets[_tokenId];
        uint8 planetLevel = planet.level;
        uint8 newLevel = planetLevel + _levels;
        uint8 orbit = uint8(planet.orbit);

        require(planetLevel + _levels <= maxPlanetLevel, "Planets: Planet cannot be upgraded to this level!");

        // Get stardust cost
        stardustCost = getStardustCost(planetLevel, newLevel, orbit);

        // Get xArgo cost
        xArgoCost = getxArgoCost(planetLevel, newLevel);

        // Get gemstone requirements
        gemstoneRequirements = getUpgradeRequirements(_tokenId, _levels);
    }

    /**
     * @notice Returns total supply of AtlantisPlanets
     */
    function totalSupply() public view returns (uint256) {
        return currentSupply;
    }

    /**
     * @dev Upgrade a planet by `_levels` levels
     * @param _tokenId Token ID of planet
     * @param _levels Number of levels to upgrade planet by
     */
    function upgradePlanet(uint256 _tokenId, uint8 _levels) external {
        IERC20 xARGO = IERC20(addressRegistry.getXargo());
        IAtlantisGemstones atlantisGemstones = IAtlantisGemstones(addressRegistry.getGemstones());
        IStakingWithLock stakingWithLock = IStakingWithLock(addressRegistry.getStakingWithLock());

        // Check if upgrader is owner of planet
        if (ownerOf(_tokenId) != msg.sender) revert NotOwnerOfPlanet();
        // Check if stage 4
        if (stage != 4) revert InvalidStage(stage, 4);

        AtlantisLib.Planet storage planet = planets[_tokenId];

        uint8 orbit = uint8(planet.orbit);

        if (planet.level + _levels > maxPlanetLevel) revert ExceededMaxLevel();

        // Get xARGO requirements
        uint256 xArgoCost = getxArgoCost(planet.level, planet.level + _levels);
        // Get Stardust requirements
        // Base cost scaling for stardust 0.25 = 25, need math properly
        uint256 stardustCost = getStardustCost(planet.level, planet.level + _levels, orbit);

        // Get gemstone requirements
        uint16[4] memory gemstoneRequirements = getUpgradeRequirements(_tokenId, _levels);

        uint16 planetTypeTierStep = 0;
        uint16 step = 1;
        // Increase planet level
        planet.level += _levels;
        while (step <= gemstoneTiers) {
            uint256 toBurn = gemstoneRequirements[step - 1];
            // Burn gemstones
            if (toBurn > 0) {
                atlantisGemstones.burn(msg.sender, uint256(uint256(planet.element) + 1 + planetTypeTierStep), toBurn);
            }
            step++;
            planetTypeTierStep += 3;
        }
        // Transfer xARGO and Stardust to this contract
        xARGO.transferFrom(msg.sender, address(this), xArgoCost);
        if (stardustCost > 0) {
            stakingWithLock.unstakeAndBurn(stardustCost);
        }

        emit PlanetUpgraded(_tokenId, planet.level);
    }

    // -------------------- MINT FUNCTIONS --------------------------

    /**
     * @dev Mint planet (Whitelist only)
     * @param _mintAmount Amount of planets to mint
     * @param nonce Unique Nonce
     * @param signature Signature provided by the signerAddress
     */
    function whitelistMint(
        uint256 _mintAmount,
        bytes memory nonce,
        bytes memory signature
    ) external payable onlyEOA ensureAvailabilityFor(_mintAmount) {
        // Check if user is whitelisted
        if (!whitelistSigned(msg.sender, nonce, signature, whitelistPhase)) revert InvalidSignature();

        // Check if whitelist sale is open
        if (stage != 1) revert InvalidStage(stage, 1);
        if (whitelistPhase == 1) {
            // Check if enough ETH is sent
            if (msg.value != _mintAmount * vipMintPrice) revert InsufficientCRO(msg.value, _mintAmount * vipMintPrice);

            // Check if mints does not exceed max wallet allowance for public sale
            if (vipMintCount[msg.sender] + _mintAmount > vipMintMaxPerWallet) revert ExceedMaxMintPerWallet();

            vipMintCount[msg.sender] += _mintAmount;
        }
        if (whitelistPhase == 2) {
            // Check if enough ETH is sent
            if (msg.value != _mintAmount * whitelistMintPrice)
                revert InsufficientCRO(msg.value, _mintAmount * whitelistMintPrice);

            // Check if mints does not exceed max wallet allowance for public sale
            if (whitelistMintCount[msg.sender] + _mintAmount > whitelistMintMaxPerWallet)
                revert ExceedMaxMintPerWallet();

            whitelistMintCount[msg.sender] += _mintAmount;
        }
        currentSupply += _mintAmount;

        for (uint256 i; i < _mintAmount; i++) {
            _mintPlanet();
        }
        emit PrivateMint(msg.sender, _mintAmount);
    }

    /**
     * @notice Public Mint
     * @param _mintAmount Amount that is minted
     */
    function mint(uint256 _mintAmount) external payable onlyEOA ensureAvailabilityFor(_mintAmount) {
        // Check if public sale is open
        if (stage != 2) revert InvalidStage(stage, 2);
        publicMintCount[msg.sender] += _mintAmount;
        currentSupply += _mintAmount;
        // Check if enough ETH is sent
        if (msg.value != _mintAmount * publicMintPrice)
            revert InsufficientCRO(msg.value, _mintAmount * publicMintPrice);
        // Check if mints does not exceed total max supply

        for (uint256 i; i < _mintAmount; i++) {
            _mintPlanet();
        }
        emit PublicMint(msg.sender, _mintAmount);
    }

    /**
     * @notice Mint planet
     * @dev Set initial planet level to 1 and random mint to msg.sender
     */
    function _mintPlanet() internal {
        // Get next token Id
        uint256 _tokenId = nextToken();
        // Initialize planet
        planets[_tokenId].level = 1;
        // Mint planet
        _safeMint(msg.sender, _tokenId);
    }

    /**
     * @notice Set whitelist phase
     * @param _whitelistPhase Phase of whitelist
     */
    function setWhitelistPhase(uint256 _whitelistPhase) external onlyOwner {
        whitelistPhase = _whitelistPhase;
    }

    // -------------------- ATLANTIS ADMIN FUNCTIONS ----------------------
    /**
     * @dev Set planet backgrounds
     * @param _tokenIds Token ID of planets
     * @param _backgrounds Backgrounds of planets
     */
    function setPlanetBackgrounds(
        uint256[] calldata _tokenIds,
        AtlantisLib.Background[] calldata _backgrounds
    ) external onlyOwner {
        if (stage != 3) revert InvalidStage(stage, 3);
        // Loop through planet types and set planet type
        for (uint256 i; i < _backgrounds.length; i++) {
            planets[_tokenIds[i]].background = _backgrounds[i];
        }
    }

    /**
     * @dev Set planet orbit names
     * @param _tokenIds Token ID of planets
     * @param _planetOrbitNames Orbit Names of planets
     */

    function setPlanetOrbitNames(
        uint256[] calldata _tokenIds,
        AtlantisLib.OrbitName[] calldata _planetOrbitNames
    ) external onlyOwner {
        if (stage != 3) revert InvalidStage(stage, 3);
        // Loop through planet types and set planet type
        for (uint256 i; i < _planetOrbitNames.length; i++) {
            planets[_tokenIds[i]].orbitName = _planetOrbitNames[i];
        }
    }

    /**
     * @dev Set planet orbit
     * @param _tokenIds Token ID of planets
     * @param _planetOrbits Orbit of planets
     */
    function setPlanetOrbits(
        uint256[] calldata _tokenIds,
        AtlantisLib.Orbit[] calldata _planetOrbits
    ) external onlyOwner {
        if (stage != 3) revert InvalidStage(stage, 3);
        // Loop through planet types and set planet type
        for (uint256 i; i < _planetOrbits.length; i++) {
            planets[_tokenIds[i]].orbit = _planetOrbits[i];
        }
    }

    /**
     * @dev Set planet element
     * @param _tokenIds Token ID of planets
     * @param _gemstoneTypes Element of planets
     */
    function setPlanetElements(
        uint256[] calldata _tokenIds,
        AtlantisLib.Element[] calldata _gemstoneTypes
    ) external onlyOwner {
        // Require stage 3
        if (stage != 3) revert InvalidStage(stage, 3);
        // Set planet type
        for (uint256 i; i < _tokenIds.length; i++) {
            planets[_tokenIds[i]].element = _gemstoneTypes[i];
        }
    }

    /**
     * @notice Set level up gemstone costs
     * @param _data gemstone cost packed in bytes
     * @dev _data is packed as follows:
     *     Cumulative cost for each gemstone tier for each planet type
     *              | Common              | Uncommon            | Rare                | Epic
     *              | T1   T2   T3   T4   | T1   T2   T3   T4   | T1   T2   T3   T4   | T1   T2   T3   T4
     *     Level 1  | 0000 0000 0000 0000 | 0000 0000 0000 0000 | 0000 0000 0000 0000 | 0000 0000 0000 0000
     *     ...
     *     Level 50 | 0122 00af 00e1 0113 | 015c 00d2 010e 014a | 0196 00f5 013b 0181 | 01d0 0118 0168 01b8
     */
    function setLevelUpGemstone(bytes calldata _data) external onlyOwner {
        // Require stage 3
        if (stage != 3) revert InvalidStage(stage, 3);
        levelUpGemstone = _data;
    }

    /**
     * @dev Withdraw ERC20 Tokens From this contract
     * @param _tokenAddress Address of ERC20 token
     * @param _amount Amount of ERC20 token to withdraw
     */
    function withdrawERC20(IERC20 _tokenAddress, uint256 _amount) external onlyOwner {
        _tokenAddress.transfer(treasury, _amount);
    }

    // Setters for base costs
    /**
     * @dev Set xArgo And Stardust base costs
     * @param _xArgoBaseCost xArgo base cost
     * @param _stardustBaseCost Stardust base cost
     */
    function setBaseCosts(uint256 _xArgoBaseCost, uint256 _stardustBaseCost) external onlyOwner {
        xArgoBaseCost = _xArgoBaseCost;
        stardustBaseCost = _stardustBaseCost;
    }

    // Setters for scaling
    /**
     * @dev Set stardust scaling costs
     * @param _stardustBaseCostScaling sd base cost scaling
     * @param _stardustRarityCostScaling Stardust rarity cost scaling
     */
    function setScaling(uint256 _stardustBaseCostScaling, uint256 _stardustRarityCostScaling) external onlyOwner {
        stardustBaseCostScaling = _stardustBaseCostScaling;
        stardustRarityCostScaling = _stardustRarityCostScaling;
    }

    // -------------------- WHITELIST FUNCTION ----------------------

    /**
     * @dev Checks if the the signature is signed by a valid signer for whitelist
     * @param sender Address of minter
     * @param nonce Random bytes32 nonce
     * @param signature Signature generated off-chain
     */
    function whitelistSigned(
        address sender,
        bytes memory nonce,
        bytes memory signature,
        uint256 _whitelistPhase
    ) private view returns (bool) {
        bytes32 _hash = keccak256(abi.encodePacked(sender, nonce, _whitelistPhase));
        return whitelistSignerAddress == ECDSA.toEthSignedMessageHash(_hash).recover(signature);
    }

    // ------------------------- ADMIN FUNCTIONS ----------------------------

    /**
     * @dev Set stage of minting
     */
    function setStage(uint8 _newStage) public onlyOwner {
        stage = _newStage;
    }

    /**
     * @dev Toggle Reveal
     */
    function toggleReveal() public onlyOwner {
        revealed = !revealed;
    }

    /**
     * @dev Set signer address for whitelist mint
     */
    function setWhitelistSignerAddress(address signer) public onlyOwner {
        whitelistSignerAddress = signer;
    }

    /**
     * @dev Set vip mint max per wallet
     */
    function setVipMaxMintPerWallet(uint256 amount) public onlyOwner {
        vipMintMaxPerWallet = amount;
    }

    /**
     * @dev Set vip mint price
     */
    function setVipMintPrice(uint256 _vipMintPrice) public onlyOwner {
        vipMintPrice = _vipMintPrice;
    }

    /**
     * @dev Set whitelist mint max per wallet
     */
    function setWhitelistMaxMintPerWallet(uint256 amount) public onlyOwner {
        whitelistMintMaxPerWallet = amount;
    }

    /**
     * @dev Set public mint price
     */
    function setPublicMintPrice(uint256 _publicMintPrice) public onlyOwner {
        publicMintPrice = _publicMintPrice;
    }

    /**
     * @dev Set whitelist mint price
     */
    function setWhitelistMintPrice(uint256 _whitelistMintPrice) public onlyOwner {
        whitelistMintPrice = _whitelistMintPrice;
    }

    /**
     * @notice Withdraw all CRO from this account to the owner
     */
    function withdrawFund() external onlyOwner {
        (bool success, ) = payable(treasury).call{ value: address(this).balance }("");
        require(success, "Transfer failed");
    }

    /**
     * @notice Sets the treasury address
     */
    function setTreasury(address _treasury) public onlyOwner {
        treasury = _treasury;
    }

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

    /**
     * @notice Returns if given tokenId exists in AtlantisPlanets
     */
    function exists(uint256 tokenId) external view returns (bool) {
        return _exists(tokenId);
    }

    // ------------------------- TOKEN METADATA ----------------------------

    /**
     * @notice Get ImageURI
     */
    function getImageURI(
        AtlantisLib.Background background,
        AtlantisLib.Element element,
        AtlantisLib.OrbitName orbitName,
        AtlantisLib.Evolution evo
    ) public view returns (string memory) {
        if (!revealed) {
            return unrevealedImageURI;
        }
        return
            string(
                abi.encodePacked(
                    _baseURI(),
                    Strings.toString(uint(background)),
                    "/",
                    Strings.toString(uint(element)),
                    "/",
                    Strings.toString(uint(evo)),
                    "/",
                    Strings.toString(uint(orbitName)),
                    ".png"
                )
            );
    }

    /**
     * @notice Returns token metadata
     * @dev Metadata is stored on-chain
     */
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        _requireMinted(tokenId);
        // Get Planet
        AtlantisLib.Planet memory planet = planets[tokenId];

        // Get Tier from Level
        (AtlantisLib.Evolution evo, string memory evoString) = _getPlanetEvolution(planet.level);

        // Name
        string memory json = string(abi.encodePacked('{"name": "', name(), " #", tokenId.toString(), '",'));

        // Description
        json = string(
            abi.encodePacked(
                json,
                '"description": "Welcome to the captivating realm of Atlantis, the game-verse and home of the legendary Argonauts. Planets are coveted lands that hold the key to your success in the game. Acquire planets, embark on exciting expeditions, and earn rewards that will supercharge your growth in Atlantis.",'
            )
        );

        // Attributes
        if (!revealed) {
            json = string(abi.encodePacked(json, '"attributes": [],'));
        } else {
            json = string(
                abi.encodePacked(
                    json,
                    '"attributes": [{"trait_type": "Element", "value": "',
                    AtlantisLib._planetElementToString(planet.element),
                    '"},',
                    '{"trait_type": "Background", "value": "',
                    AtlantisLib._planetBackgroundToString(planet.background),
                    '"},',
                    '{"trait_type": "Orbit Name", "value": "',
                    AtlantisLib._planetOrbitTypeToString(planet.orbitName),
                    '"},'
                )
            );
            json = string(
                abi.encodePacked(
                    json,
                    '{"trait_type": "Orbit", "value": "',
                    AtlantisLib._planetOrbitToString(planet.orbit),
                    '"},',
                    '{"trait_type": "Evolution", "value": "',
                    evoString,
                    '"},',
                    '{"trait_type": "Level", "value": "',
                    Strings.toString(planet.level),
                    '"}],'
                )
            );
        }

        json = Base64.encode(
            bytes(
                string(
                    abi.encodePacked(
                        json,
                        '"image": "',
                        getImageURI(planet.background, planet.element, planet.orbitName, evo),
                        '"}'
                    )
                )
            )
        );
        return string(abi.encodePacked("data:application/json;base64,", json));
    }

    /**
     * @notice Set the Address Registry
     * @param _addressRegistry The address of the Address Registry
     */
    function setAddressRegistry(AtlantisAddressRegistry _addressRegistry) external onlyOwner {
        addressRegistry = _addressRegistry;
    }

    function devMint(address _to, uint256 _mintAmount) public ensureAvailabilityFor(_mintAmount) onlyOwner {
        currentSupply += _mintAmount;
        for (uint256 i; i < _mintAmount; i++) {
            // Get next token Id
            uint256 _tokenId = nextToken();
            // Initialize planet
            planets[_tokenId].level = 1;
            // Mint planet
            _safeMint(tx.origin, _tokenId);
        }

        emit PublicMint(_to, _mintAmount);
    }

    function devEpicMint(address[12] calldata _auctionWinners) external onlyOwner {
        require(_auctionWinners.length == 12, "AtlantisPlanets: Invalid length");
        // Mint token Ids 1-12
        for (uint256 i = 1; i < 13; i++) {
            planets[i].level = 1;
            _safeMint(_auctionWinners[i - 1], i);
        }
    }
}

File 19 of 26 : AddressRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

contract AddressRegistry {
    mapping(bytes32 => address) public addresses;

    function getAddress(bytes32 _identifier) public view returns (address) {
        return addresses[_identifier];
    }

    function _setAddress(bytes32 _identifier, address contractAddress) internal {
        addresses[_identifier] = contractAddress;
    }
}

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

pragma solidity ^0.8.11;

library AtlantisLib {
    enum Orbit {
        COMMON,
        UNCOMMON,
        RARE,
        EPIC
    }

    enum OrbitName {
        HALO_RING,
        PANDORA,
        ATLAS,
        METIS,
        ENTWINED,
        RAINBOW_CLOUDS,
        GALATICA,
        ASTEROIDS,
        INTERSTELLAR_PINK,
        INTERSTELLAR_GRADIENT,
        // Epic planets
        INTERSTELLAR_GOLD
    }

    enum Background {
        PURPLE_HUES,
        BROWN_HUES,
        WAVY,
        SHOOTING_STARS,
        // Epic planets
        GOLD_HUES,
        GOLD_SHOOTING_STARS,
        WAVY_GOLD,
        GOLD_SKIES
    }

    enum Evolution {
        ALPHA, // 1-19
        BETA, // 20-29
        GAMMA, // 30-39
        DELTA, // 40-49
        EPSILON // 50
    }

    enum Element {
        FIRE,
        LIGHTNING,
        STEEL
    }

    struct Planet {
        uint8 level; // Max Level: 50
        Element element;
        Orbit orbit;
        OrbitName orbitName;
        Background background;
        bool onExpedition;
    }

    enum Rarity {
        COMMON,
        UNCOMMON,
        RARE,
        EPIC
    }

    /**
     * @notice Returns planet element as string
     */
    function _planetElementToString(AtlantisLib.Element element) internal pure returns (string memory) {
        if (element == AtlantisLib.Element.FIRE) {
            return "Fire";
        } else if (element == AtlantisLib.Element.STEEL) {
            return "Steel";
        } else if (element == AtlantisLib.Element.LIGHTNING) {
            return "Lightning";
        } else {
            return "";
        }
    }

    /**
     * @notice Returns planet orbit as string
     */
    function _planetOrbitToString(AtlantisLib.Orbit orbit) internal pure returns (string memory) {
        if (orbit == AtlantisLib.Orbit.COMMON) {
            return "Common";
        } else if (orbit == AtlantisLib.Orbit.UNCOMMON) {
            return "Uncommon";
        } else if (orbit == AtlantisLib.Orbit.RARE) {
            return "Rare";
        } else if (orbit == AtlantisLib.Orbit.EPIC) {
            return "Epic";
        } else {
            return "";
        }
    }

    /**
     * @notice Returns planet orbit as string
     */
    function _planetOrbitTypeToString(AtlantisLib.OrbitName orbitName) internal pure returns (string memory) {
        if (orbitName == AtlantisLib.OrbitName.HALO_RING) {
            return "Halo Ring";
        } else if (orbitName == AtlantisLib.OrbitName.PANDORA) {
            return "Pandora";
        } else if (orbitName == AtlantisLib.OrbitName.ATLAS) {
            return "Atlas";
        } else if (orbitName == AtlantisLib.OrbitName.METIS) {
            return "Metis";
        } else if (orbitName == AtlantisLib.OrbitName.ENTWINED) {
            return "Entwined";
        } else if (orbitName == AtlantisLib.OrbitName.RAINBOW_CLOUDS) {
            return "Rainbow Clouds";
        } else if (orbitName == AtlantisLib.OrbitName.GALATICA) {
            return "Galatica";
        } else if (orbitName == AtlantisLib.OrbitName.ASTEROIDS) {
            return "Asteroids";
        } else if (orbitName == AtlantisLib.OrbitName.INTERSTELLAR_PINK) {
            return "Interstellar Pink";
        } else if (orbitName == AtlantisLib.OrbitName.INTERSTELLAR_GRADIENT) {
            return "Interstellar Gradient";
            // Epic planets
        } else if (orbitName == AtlantisLib.OrbitName.INTERSTELLAR_GOLD) {
            return "Interstellar Gold";
        } else {
            return "";
        }
    }

    /**
     * @notice Returns planet orbit as string
     */
    function _planetBackgroundToString(AtlantisLib.Background background) internal pure returns (string memory) {
        if (background == AtlantisLib.Background.PURPLE_HUES) {
            return "Purple Hues";
        } else if (background == AtlantisLib.Background.BROWN_HUES) {
            return "Brown Hues";
        } else if (background == AtlantisLib.Background.WAVY) {
            return "Wavy";
        } else if (background == AtlantisLib.Background.SHOOTING_STARS) {
            return "Shooting Stars";
            // Epic planets
        } else if (background == AtlantisLib.Background.WAVY_GOLD) {
            return "Wavy Gold";
        } else if (background == AtlantisLib.Background.GOLD_SHOOTING_STARS) {
            return "Gold Shooting Stars";
        } else if (background == AtlantisLib.Background.GOLD_HUES) {
            return "Gold Hues";
        } else if (background == AtlantisLib.Background.GOLD_SKIES) {
            return "Gold Skies";
        } else {
            return "";
        }
    }
}

File 21 of 26 : Base64.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Base64
/// @author Brecht Devos - <[email protected]>
/// @notice Provides a function for encoding some bytes in base64
library Base64 {
    string internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

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

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

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

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

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

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

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

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

            // run over the input, 3 bytes at a time
            for {

            } lt(dataPtr, endPtr) {

            } {
                dataPtr := add(dataPtr, 3)

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

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

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

        return result;
    }
}

File 22 of 26 : RandomlyAssigned.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./WithLimitedSupply.sol";

/// @author 1001.digital
/// @title Randomly assign tokenIDs from a given set of tokens (PSEUDORANDOM).
abstract contract RandomlyAssigned is WithLimitedSupply {
    // Used for random index assignment
    mapping(uint256 => uint256) private tokenMatrix;

    // The initial token ID
    uint256 private startFrom;

    /// Instantiate the contract
    /// @param _totalMaxSupply how many tokens this collection should hold
    /// @param _startFrom the tokenID with which to start counting
    constructor(uint256 _totalMaxSupply, uint256 _startFrom)
        WithLimitedSupply(_totalMaxSupply)
    {
        startFrom = _startFrom;
    }

    /// Get the next token ID
    /// @dev Randomly gets a new token ID and keeps track of the ones that are still available.
    /// @return the next token ID
    function nextToken()
        internal
        override
        ensureAvailability
        returns (uint256)
    {
        uint256 maxIndex = totalMaxSupply() - tokenCount();
        uint256 random = uint256(
            keccak256(
                abi.encodePacked(
                    msg.sender,
                    block.coinbase,
                    block.difficulty,
                    block.gaslimit,
                    block.timestamp
                )
            )
        ) % maxIndex;

        uint256 value = 0;
        if (tokenMatrix[random] == 0) {
            // If this matrix position is empty, set the value to the generated random number.
            value = random;
        } else {
            // Otherwise, use the previously stored number from the matrix.
            value = tokenMatrix[random];
        }

        // If the last available tokenID is still unused...
        if (tokenMatrix[maxIndex - 1] == 0) {
            // ...store that ID in the current matrix position.
            tokenMatrix[random] = maxIndex - 1;
        } else {
            // ...otherwise copy over the stored number to the current matrix position.
            tokenMatrix[random] = tokenMatrix[maxIndex - 1];
        }

        // Increment counts
        super.nextToken();

        return value + startFrom;
    }
}

File 23 of 26 : WithLimitedSupply.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

/// @title A token tracker that limits the token supply and increments token IDs on each new mint.
abstract contract WithLimitedSupply {
    using Counters for Counters.Counter;

    /// @dev Emitted when the supply of this collection changes
    event SupplyChanged(uint256 supply);

    // Keeps track of how many we have minted
    Counters.Counter private _tokenCount;

    /// @dev The maximum count of tokens this token tracker will hold.
    uint256 private _totalMaxSupply;

    /// Instanciate the contract
    /// @param totalMaxSupply_ how many tokens this collection should hold
    constructor(uint256 totalMaxSupply_) {
        _totalMaxSupply = totalMaxSupply_;
    }

    /// @dev Get the max Supply
    /// @return the maximum token count
    function totalMaxSupply() public view virtual returns (uint256) {
        return _totalMaxSupply;
    }

    /// @dev Get the current token count
    /// @return the created token count
    function tokenCount() public view returns (uint256) {
        return _tokenCount.current();
    }

    /// @dev Check whether tokens are still available
    /// @return the available token count
    function availableTokenCount() public view returns (uint256) {
        return totalMaxSupply() - tokenCount();
    }

    /// @dev Increment the token count and fetch the latest count
    /// @return the next token id
    function nextToken() internal virtual returns (uint256) {
        uint256 token = _tokenCount.current();

        _tokenCount.increment();

        return token;
    }

    /// @dev Check whether another token is still available
    modifier ensureAvailability() {
        require(availableTokenCount() > 0, "No more tokens available");
        _;
    }

    /// @param amount Check whether number of tokens are still available
    /// @dev Check whether tokens are still available
    modifier ensureAvailabilityFor(uint256 amount) {
        require(availableTokenCount() >= amount, "Requested number of tokens not available");
        _;
    }
}

File 24 of 26 : IAtlantisGemstones.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.11;

import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IAtlantisGemstones is IERC1155 {
    error NonExistentToken();
    error OnlyAtlantisContractsAllowed();
    error InvalidInputAmount();
    error InvalidElement();
    error InvalidUpgrade();

    function fuseGemstones(uint8 _id, uint8 _toId, uint256 _amountToCreate) external;

    function burn(address _user, uint256 _id, uint256 _quantity) external;

    function mint(address _to, uint256 _id, uint256 _quantity) external;
}

File 25 of 26 : IAtlantisPlanets.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// Import AtlantisLib
import { AtlantisLib } from "../common/AtlantisLib.sol";

interface IAtlantisPlanets is IERC721 {
    error AuctionSettled();

    /**
     * The signature must be by the correct signer
     */
    error InvalidSignature();

    /**
     * The minting stage must be correct
     */
    error InvalidStage(uint8 currentStage, uint8 requiredStage);

    /**
     * The collection has exceeded the max supply
     */
    error ExceededMaxSupply();

    /**
     * The user has exceeded allowed mint count
     */
    error ExceedMaxMintPerWallet();

    /**
     * The planet has exceeded the max level
     */
    error ExceededMaxLevel();

    /**
     * Error thrown when user queries an unknown OrbitId
     */
    error UnknownOrbit();

    /**
     * Error thrown when user queries an unknown ElementId
     */
    error UnknownElement();

    /**
     * Error thrown when user queries an unknown PlanetId
     */
    error InvalidUpgradeLevel(uint8 currentLevel, uint8 newLevel);
    /**
     * User is not the owner of planet
     */
    error NotOwnerOfPlanet();

    error InsufficientCRO(uint256 amountPaid, uint256 amountRequired);

    error InvalidInput();

    function upgradePlanet(uint256 _tokenId, uint8 _levels) external;

    function getUpgradeCosts(
        uint256 _tokenId,
        uint8 _levels
    ) external view returns (uint256 stardustCost, uint256 xArgoCost, uint16[4] memory gemstoneRequirements);

    function getPlanetDetails(uint256 _planetId) external view returns (AtlantisLib.Planet memory);

    function setPlanetElements(uint256[] memory _tokenIds, AtlantisLib.Element[] memory _gemstoneType) external;

    function setPlanetOrbits(uint256[] memory _tokenIds, AtlantisLib.Orbit[] memory _planetsOrbit) external;
}

File 26 of 26 : IStakingWithLock.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;


interface IStakingWithLock {
     function unstakeAndBurn(uint256 _amount) external;

}

Settings
{
  "evmVersion": "london",
  "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":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_whitelistSignerAddress","type":"address"},{"internalType":"string","name":"__baseURI","type":"string"},{"internalType":"contract AtlantisAddressRegistry","name":"_addressRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AuctionSettled","type":"error"},{"inputs":[],"name":"ExceedMaxMintPerWallet","type":"error"},{"inputs":[],"name":"ExceededMaxLevel","type":"error"},{"inputs":[],"name":"ExceededMaxSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountPaid","type":"uint256"},{"internalType":"uint256","name":"amountRequired","type":"uint256"}],"name":"InsufficientCRO","type":"error"},{"inputs":[],"name":"InvalidInput","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[{"internalType":"uint8","name":"currentStage","type":"uint8"},{"internalType":"uint8","name":"requiredStage","type":"uint8"}],"name":"InvalidStage","type":"error"},{"inputs":[{"internalType":"uint8","name":"currentLevel","type":"uint8"},{"internalType":"uint8","name":"newLevel","type":"uint8"}],"name":"InvalidUpgradeLevel","type":"error"},{"inputs":[],"name":"NotOwnerOfPlanet","type":"error"},{"inputs":[],"name":"UnknownElement","type":"error"},{"inputs":[],"name":"UnknownOrbit","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"level","type":"uint256"}],"name":"PlanetUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PrivateMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PublicMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"supply","type":"uint256"}],"name":"SupplyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"addressRegistry","outputs":[{"internalType":"contract AtlantisAddressRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availableTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[12]","name":"_auctionWinners","type":"address[12]"}],"name":"devEpicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_mintAmount","type":"uint256"}],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gemstoneTiers","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"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":"enum AtlantisLib.Background","name":"background","type":"uint8"},{"internalType":"enum AtlantisLib.Element","name":"element","type":"uint8"},{"internalType":"enum AtlantisLib.OrbitName","name":"orbitName","type":"uint8"},{"internalType":"enum AtlantisLib.Evolution","name":"evo","type":"uint8"}],"name":"getImageURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_planetId","type":"uint256"}],"name":"getPlanetDetails","outputs":[{"components":[{"internalType":"uint8","name":"level","type":"uint8"},{"internalType":"enum AtlantisLib.Element","name":"element","type":"uint8"},{"internalType":"enum AtlantisLib.Orbit","name":"orbit","type":"uint8"},{"internalType":"enum AtlantisLib.OrbitName","name":"orbitName","type":"uint8"},{"internalType":"enum AtlantisLib.Background","name":"background","type":"uint8"},{"internalType":"bool","name":"onExpedition","type":"bool"}],"internalType":"struct AtlantisLib.Planet","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint8","name":"_levels","type":"uint8"}],"name":"getUpgradeCosts","outputs":[{"internalType":"uint256","name":"stardustCost","type":"uint256"},{"internalType":"uint256","name":"xArgoCost","type":"uint256"},{"internalType":"uint16[4]","name":"gemstoneRequirements","type":"uint16[4]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"levelUpGemstone","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPlanetLevel","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"planets","outputs":[{"internalType":"uint8","name":"level","type":"uint8"},{"internalType":"enum AtlantisLib.Element","name":"element","type":"uint8"},{"internalType":"enum AtlantisLib.Orbit","name":"orbit","type":"uint8"},{"internalType":"enum AtlantisLib.OrbitName","name":"orbitName","type":"uint8"},{"internalType":"enum AtlantisLib.Background","name":"background","type":"uint8"},{"internalType":"bool","name":"onExpedition","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publicMintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintMaxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":"contract AtlantisAddressRegistry","name":"_addressRegistry","type":"address"}],"name":"setAddressRegistry","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":"uint256","name":"_xArgoBaseCost","type":"uint256"},{"internalType":"uint256","name":"_stardustBaseCost","type":"uint256"}],"name":"setBaseCosts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"setLevelUpGemstone","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"enum AtlantisLib.Background[]","name":"_backgrounds","type":"uint8[]"}],"name":"setPlanetBackgrounds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"enum AtlantisLib.Element[]","name":"_gemstoneTypes","type":"uint8[]"}],"name":"setPlanetElements","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"enum AtlantisLib.OrbitName[]","name":"_planetOrbitNames","type":"uint8[]"}],"name":"setPlanetOrbitNames","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"enum AtlantisLib.Orbit[]","name":"_planetOrbits","type":"uint8[]"}],"name":"setPlanetOrbits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_publicMintPrice","type":"uint256"}],"name":"setPublicMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stardustBaseCostScaling","type":"uint256"},{"internalType":"uint256","name":"_stardustRarityCostScaling","type":"uint256"}],"name":"setScaling","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_newStage","type":"uint8"}],"name":"setStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newUnrevealedImageURI","type":"string"}],"name":"setUnrevealedImageURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setVipMaxMintPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vipMintPrice","type":"uint256"}],"name":"setVipMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setWhitelistMaxMintPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_whitelistMintPrice","type":"uint256"}],"name":"setWhitelistMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_whitelistPhase","type":"uint256"}],"name":"setWhitelistPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"setWhitelistSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stage","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stardustBaseCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stardustBaseCostScaling","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stardustRarityCostScaling","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleReveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenCount","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":"totalMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unrevealedImageURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint8","name":"_levels","type":"uint8"}],"name":"upgradePlanet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vipMintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vipMintMaxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vipMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"bytes","name":"nonce","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"whitelistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistMintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMintMaxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xArgoBaseCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

600a601055600060115560146013819055670de0b6b3a76400008155671bc16d674ec8000060175560001960185568022b1c8c1227a00000601c55680ad78ebc5ac6200000601d556019601e55601f556021805460ff1916905561010060405260426080818152906200633860a0396022906200007d9082620003ec565b503480156200008b57600080fd5b506040516200637a3803806200637a833981016040819052620000ae91620004e0565b611770600d816040518060400160405280601081526020016f41746c616e74697320506c616e65747360801b81525060405180604001604052806007815260200166504c414e45545360c81b81525081600090816200010e9190620003ec565b5060016200011d8282620003ec565b5050506200013a620001346200019c60201b60201c565b620001a0565b600855600a55506200014c84620001f2565b62000157836200021e565b62000162826200024a565b6200016d8462000266565b6000600e55600b80546001600160a01b0319166001600160a01b039290921691909117905550620005f3915050565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620001fc620002e9565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b62000228620002e9565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b62000254620002e9565b600c620002628282620003ec565b5050565b62000270620002e9565b6001600160a01b038116620002db5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b620002e681620001a0565b50565b6006546001600160a01b03163314620003455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620002d2565b565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200037257607f821691505b6020821081036200039357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003e757600081815260208120601f850160051c81016020861015620003c25750805b601f850160051c820191505b81811015620003e357828155600101620003ce565b5050505b505050565b81516001600160401b0381111562000408576200040862000347565b62000420816200041984546200035d565b8462000399565b602080601f8311600181146200045857600084156200043f5750858301515b600019600386901b1c1916600185901b178555620003e3565b600085815260208120601f198616915b82811015620004895788860151825594840194600190910190840162000468565b5085821015620004a85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0381168114620002e657600080fd5b8051620004db81620004b8565b919050565b60008060008060808587031215620004f757600080fd5b84516200050481620004b8565b809450506020808601516200051981620004b8565b60408701519094506001600160401b03808211156200053757600080fd5b818801915088601f8301126200054c57600080fd5b81518181111562000561576200056162000347565b604051601f8201601f19908116603f011681019083821181831017156200058c576200058c62000347565b816040528281528b86848701011115620005a557600080fd5b600093505b82841015620005c95784840186015181850187015292850192620005aa565b6000868483010152809750505050505050620005e860608601620004ce565b905092959194509250565b615d3580620006036000396000f3fe60806040526004361061043c5760003560e01c80637bf185aa11610234578063c87b56dd1161012e578063e025107f116100b6578063ea98eb1d1161007a578063ea98eb1d14610cd5578063f0f4426014610cf5578063f2fde38b14610d15578063f3ad65f414610d35578063f504764d14610d5557600080fd5b8063e025107f14610c5f578063e07fa3c114610c75578063e14ca35314610c8a578063e3e6a3ef14610c9f578063e985e9c514610cb557600080fd5b8063da71ff12116100fd578063da71ff1214610bde578063dc34c04114610bf3578063dc53fd9214610c09578063deecbfa814610c1f578063dffc857014610c3f57600080fd5b8063c87b56dd14610b5e578063ce3cd99714610b7e578063ce7cebf214610b9e578063d600671c14610bbe57600080fd5b8063a0712d68116101bc578063aa880b4f11610180578063aa880b4f14610ac6578063b7b637db14610adc578063b88d4fde14610afc578063c040e6b814610b1c578063c833e25814610b4857600080fd5b8063a0712d6814610a33578063a1db978214610a46578063a22cb46514610a66578063a611708e14610a86578063a8f6891614610aa657600080fd5b806395528bc51161020357806395528bc5146109a757806395d89b41146109c757806396330b5f146109dc5780639f181b5e14610a09578063a0617ad014610a1e57600080fd5b80637bf185aa14610933578063815d544c14610953578063877850ef146109695780638da5cb5b1461098957600080fd5b806338dc3a20116103455780635b8ad429116102cd5780636c0360eb116102915780636c0360eb146108b35780636cc29174146108c857806370a08231146108e8578063715018a614610908578063790188ae1461091d57600080fd5b80635b8ad4291461081e5780635d82cf6e1461083357806361d027b314610853578063627804af146108735780636352211e1461089357600080fd5b80634f558e79116103145780634f558e7914610777578063518302271461079757806355f804b3146107b157806358d95010146107d15780635b785034146107fe57600080fd5b806338dc3a20146106ed5780633bdf4ac61461070257806342842e0e1461072f5780634860d6da1461074f57600080fd5b806323b872dd116103c857806328d077681161039757806328d07768146106765780632f975f041461068b5780633246e467146106a15780633305048f146106b757806335c6aaf8146106d757600080fd5b806323b872dd146105b157806324436f77146105d157806326c1e750146105e457806327c7812c1461065657600080fd5b806311dceda71161040f57806311dceda7146104f257806312f269b91461052d57806318160ddd1461054d578063199854b2146105625780631b4663e81461058257600080fd5b806301ffc9a71461044157806306fdde0314610476578063081812fc14610498578063095ea7b3146104d0575b600080fd5b34801561044d57600080fd5b5061046161045c366004614a4a565b610d75565b60405190151581526020015b60405180910390f35b34801561048257600080fd5b5061048b610dc7565b60405161046d9190614abe565b3480156104a457600080fd5b506104b86104b3366004614ad1565b610e59565b6040516001600160a01b03909116815260200161046d565b3480156104dc57600080fd5b506104f06104eb366004614aff565b610e80565b005b3480156104fe57600080fd5b5061051f61050d366004614b2b565b60126020526000908152604090205481565b60405190815260200161046d565b34801561053957600080fd5b506104f0610548366004614b48565b610f9a565b34801561055957600080fd5b50600e5461051f565b34801561056e57600080fd5b506104f061057d366004614bb8565b611018565b34801561058e57600080fd5b506105a261059d366004614c35565b6110f5565b60405161046d93929190614c61565b3480156105bd57600080fd5b506104f06105cc366004614ca6565b6112de565b6104f06105df366004614d93565b61130f565b3480156105f057600080fd5b506106446105ff366004614ad1565b602080526000908152604090205460ff808216916101008104821691620100008204811691630100000081048216916401000000008204811691600160281b90041686565b60405161046d96959493929190614e5a565b34801561066257600080fd5b506104f0610671366004614b2b565b611596565b34801561068257600080fd5b5061048b6115c0565b34801561069757600080fd5b5061051f601d5481565b3480156106ad57600080fd5b5061051f60185481565b3480156106c357600080fd5b506104f06106d2366004614c35565b61164e565b3480156106e357600080fd5b5061051f60145481565b3480156106f957600080fd5b5061048b611b2a565b34801561070e57600080fd5b5061051f61071d366004614b2b565b60156020526000908152604090205481565b34801561073b57600080fd5b506104f061074a366004614ca6565b611b37565b34801561075b57600080fd5b50610764600481565b60405161ffff909116815260200161046d565b34801561078357600080fd5b50610461610792366004614ad1565b611b52565b3480156107a357600080fd5b506021546104619060ff1681565b3480156107bd57600080fd5b506104f06107cc366004614eab565b611b71565b3480156107dd57600080fd5b506107f16107ec366004614ad1565b611b85565b60405161046d9190614ef4565b34801561080a57600080fd5b506104f0610819366004614f5c565b611cd0565b34801561082a57600080fd5b506104f0611ce3565b34801561083f57600080fd5b506104f061084e366004614ad1565b611cff565b34801561085f57600080fd5b50601a546104b8906001600160a01b031681565b34801561087f57600080fd5b506104f061088e366004614aff565b611d0c565b34801561089f57600080fd5b506104b86108ae366004614ad1565b611de9565b3480156108bf57600080fd5b5061048b611e49565b3480156108d457600080fd5b506104f06108e3366004614f7e565b611e56565b3480156108f457600080fd5b5061051f610903366004614b2b565b611ea1565b34801561091457600080fd5b506104f0611f27565b34801561092957600080fd5b5061051f60105481565b34801561093f57600080fd5b506104f061094e366004614bb8565b611f3b565b34801561095f57600080fd5b5061051f600f5481565b34801561097557600080fd5b506104f0610984366004614ad1565b61200d565b34801561099557600080fd5b506006546001600160a01b03166104b8565b3480156109b357600080fd5b506104f06109c2366004614ad1565b61201a565b3480156109d357600080fd5b5061048b612027565b3480156109e857600080fd5b5061051f6109f7366004614b2b565b60196020526000908152604090205481565b348015610a1557600080fd5b5061051f612036565b348015610a2a57600080fd5b5060085461051f565b6104f0610a41366004614ad1565b612046565b348015610a5257600080fd5b506104f0610a61366004614aff565b6121a9565b348015610a7257600080fd5b506104f0610a81366004614ffe565b612228565b348015610a9257600080fd5b506104f0610aa1366004614ad1565b612233565b348015610ab257600080fd5b506104f0610ac1366004614ad1565b612240565b348015610ad257600080fd5b5061051f60135481565b348015610ae857600080fd5b506104f0610af7366004614bb8565b61224d565b348015610b0857600080fd5b506104f0610b17366004615037565b612321565b348015610b2857600080fd5b50600d54610b369060ff1681565b60405160ff909116815260200161046d565b348015610b5457600080fd5b5061051f60115481565b348015610b6a57600080fd5b5061048b610b79366004614ad1565b612359565b348015610b8a57600080fd5b506104f0610b993660046150a3565b612613565b348015610baa57600080fd5b506104f0610bb9366004614eab565b612631565b348015610bca57600080fd5b5061048b610bd93660046150eb565b612645565b348015610bea57600080fd5b50610764603281565b348015610bff57600080fd5b5061051f601e5481565b348015610c1557600080fd5b5061051f60175481565b348015610c2b57600080fd5b506104f0610c3a366004614bb8565b612773565b348015610c4b57600080fd5b506104f0610c5a366004614f5c565b61284b565b348015610c6b57600080fd5b5061051f601f5481565b348015610c8157600080fd5b506104f061285e565b348015610c9657600080fd5b5061051f6128fe565b348015610cab57600080fd5b5061051f601c5481565b348015610cc157600080fd5b50610461610cd0366004615145565b612915565b348015610ce157600080fd5b506104f0610cf0366004614ad1565b612943565b348015610d0157600080fd5b506104f0610d10366004614b2b565b612950565b348015610d2157600080fd5b506104f0610d30366004614b2b565b61297a565b348015610d4157600080fd5b50600b546104b8906001600160a01b031681565b348015610d6157600080fd5b506104f0610d70366004614b2b565b6129f0565b60006001600160e01b031982166380ac58cd60e01b1480610da657506001600160e01b03198216635b5e139f60e01b145b80610dc157506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060008054610dd690615173565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0290615173565b8015610e4f5780601f10610e2457610100808354040283529160200191610e4f565b820191906000526020600020905b815481529060010190602001808311610e3257829003601f168201915b5050505050905090565b6000610e6482612a1a565b506000908152600460205260409020546001600160a01b031690565b6000610e8b82611de9565b9050806001600160a01b0316836001600160a01b031603610efd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610f195750610f198133612915565b610f8b5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610ef4565b610f958383612a79565b505050565b610fa2612ae7565b60015b600d8110156110145760008181526020805260409020805460ff19166001908117909155611002908390610fd990846151c3565b600c8110610fe957610fe96151d6565b602002016020810190610ffc9190614b2b565b82612b41565b8061100c816151ec565b915050610fa5565b5050565b611020612ae7565b600d5460ff1660031461105657600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b60005b818110156110ee57828282818110611073576110736151d6565b90506020020160208101906110889190615205565b6020600087878581811061109e5761109e6151d6565b60209081029290920135835250810191909152604001600020805463ff0000001916630100000083600a8111156110d7576110d7614e00565b0217905550806110e6816151ec565b915050611059565b5050505050565b600080611100614a16565b600085815260208080526040808320815160c08101909252805460ff8082168452929391929184019161010090910416600281111561114157611141614e00565b600281111561115257611152614e00565b8152815460209091019062010000900460ff16600381111561117657611176614e00565b600381111561118757611187614e00565b815281546020909101906301000000900460ff16600a8111156111ac576111ac614e00565b600a8111156111bd576111bd614e00565b81528154602090910190640100000000900460ff1660078111156111e3576111e3614e00565b60078111156111f4576111f4614e00565b81529054600160281b900460ff1615156020909101528051909150600061121b8783615220565b905060008360400151600381111561123557611235614e00565b905060326112438985615220565b60ff1611156112ae5760405162461bcd60e51b815260206004820152603160248201527f506c616e6574733a20506c616e65742063616e6e6f7420626520757067726164604482015270656420746f2074686973206c6576656c2160781b6064820152608401610ef4565b6112b9838383612b5b565b96506112c58383612c37565b95506112d18989612cbd565b9450505050509250925092565b6112e8338261336c565b6113045760405162461bcd60e51b8152600401610ef490615239565b610f958383836133ca565b3332146113565760405162461bcd60e51b8152602060048201526015602482015274506c616e6574733a206d7573742075736520454f4160581b6044820152606401610ef4565b82806113606128fe565b101561137e5760405162461bcd60e51b8152600401610ef490615286565b61138c338484600f5461353b565b6113a957604051638baa579f60e01b815260040160405180910390fd5b600d5460ff166001146113df57600d5460405163353ba46160e11b815260ff909116600482015260016024820152604401610ef4565b600f5460010361148f576011546113f690856152ce565b341461142d57346011548561140b91906152ce565b604051631068e6e760e01b815260048101929092526024820152604401610ef4565b6010543360009081526012602052604090205461144b9086906152e5565b111561146a57604051634ecf32dd60e11b815260040160405180910390fd5b33600090815260126020526040812080548692906114899084906152e5565b90915550505b600f5460020361151d576014546114a690856152ce565b34146114bb57346014548561140b91906152ce565b601354336000908152601560205260409020546114d99086906152e5565b11156114f857604051634ecf32dd60e11b815260040160405180910390fd5b33600090815260156020526040812080548692906115179084906152e5565b90915550505b83600e600082825461152f91906152e5565b90915550600090505b8481101561155a576115486135e7565b80611552816151ec565b915050611538565b5060405184815233907f73c70fae6461815259bb17577a08362a747e97f1b952b86e211522d4a24f95379060200160405180910390a250505050565b61159e612ae7565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b601b80546115cd90615173565b80601f01602080910402602001604051908101604052809291908181526020018280546115f990615173565b80156116465780601f1061161b57610100808354040283529160200191611646565b820191906000526020600020905b81548152906001019060200180831161162957829003601f168201915b505050505081565b600b54604080516329a33d0560e21b815290516000926001600160a01b03169163a68cf4149160048083019260209291908290030181865afa158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc91906152f8565b90506000600b60009054906101000a90046001600160a01b03166001600160a01b031663786d10866040518163ffffffff1660e01b8152600401602060405180830381865afa158015611713573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173791906152f8565b90506000600b60009054906101000a90046001600160a01b03166001600160a01b0316638cc84db76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561178e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b291906152f8565b9050336117be86611de9565b6001600160a01b0316146117e557604051630a40deb960e31b815260040160405180910390fd5b600d5460ff1660041461181d57600d5460405163353ba46160e11b815260ff9091166004808301919091526024820152604401610ef4565b60008581526020805260408120805490919062010000900460ff16600381111561184957611849614e00565b825490915060329061185f90889060ff16615220565b60ff161115611881576040516330531d7360e01b815260040160405180910390fd5b815460009061189c9060ff166118978982615220565b612c37565b83549091506000906118bb9060ff166118b58a82615220565b85612b5b565b905060006118c98a8a612cbd565b85549091506000906001908b90889084906118e890849060ff16615220565b92506101000a81548160ff021916908360ff1602179055505b600461ffff821611611a105760008361191b600184615315565b61ffff166004811061192f5761192f6151d6565b602002015161ffff16905080156119ef5787546001600160a01b038b169063f5298aca90339061ffff871690610100900460ff16600281111561197457611974614e00565b61197f9060016152e5565b61198991906152e5565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260448101849052606401600060405180830381600087803b1580156119d657600080fd5b505af11580156119ea573d6000803e3d6000fd5b505050505b816119f981615330565b9250611a089050600384615351565b925050611901565b6040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b038b16906323b872dd906064016020604051808303816000875af1158015611a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a87919061536c565b508315611ae95760405163a7b8b49160e01b8152600481018590526001600160a01b0389169063a7b8b49190602401600060405180830381600087803b158015611ad057600080fd5b505af1158015611ae4573d6000803e3d6000fd5b505050505b865460405160ff909116908d907f50b7db618c3ed4d1fe8122fce987e7ea6245b41f8e0c64817c0eacaa225fd4eb90600090a3505050505050505050505050565b602280546115cd90615173565b610f9583838360405180602001604052806000815250612321565b6000818152600260205260408120546001600160a01b03161515610dc1565b611b79612ae7565b600c61101482826153d7565b611bbf6040805160c08101909152600080825260208201908152602001600081526020016000815260200160008152600060209091015290565b600082815260208080526040808320815160c08101909252805460ff80821684529293919291840191610100909104166002811115611c0057611c00614e00565b6002811115611c1157611c11614e00565b8152815460209091019062010000900460ff166003811115611c3557611c35614e00565b6003811115611c4657611c46614e00565b815281546020909101906301000000900460ff16600a811115611c6b57611c6b614e00565b600a811115611c7c57611c7c614e00565b81528154602090910190640100000000900460ff166007811115611ca257611ca2614e00565b6007811115611cb357611cb3614e00565b81529054600160281b900460ff1615156020909101529392505050565b611cd8612ae7565b601c91909155601d55565b611ceb612ae7565b6021805460ff19811660ff90911615179055565b611d07612ae7565b601755565b8080611d166128fe565b1015611d345760405162461bcd60e51b8152600401610ef490615286565b611d3c612ae7565b81600e6000828254611d4e91906152e5565b90915550600090505b82811015611da0576000611d69613615565b60008181526020805260409020805460ff191660011790559050611d8d3282612b41565b5080611d98816151ec565b915050611d57565b50826001600160a01b03167f748a2986091c2034d6e93b6f44f771a79f0e1d6acd8a60c68c17d4e1e2feaed283604051611ddc91815260200190565b60405180910390a2505050565b6000818152600260205260408120546001600160a01b031680610dc15760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610ef4565b600c80546115cd90615173565b611e5e612ae7565b600d5460ff16600314611e9457600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b601b610f95828483615497565b60006001600160a01b038216611f0b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610ef4565b506001600160a01b031660009081526003602052604090205490565b611f2f612ae7565b611f3960006137ae565b565b611f43612ae7565b600d5460ff16600314611f7957600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b60005b838110156110ee57828282818110611f9657611f966151d6565b9050602002016020810190611fab9190615557565b60206000878785818110611fc157611fc16151d6565b60209081029290920135835250810191909152604001600020805461ff001916610100836002811115611ff657611ff6614e00565b021790555080612005816151ec565b915050611f7c565b612015612ae7565b600f55565b612022612ae7565b601055565b606060018054610dd690615173565b600061204160075490565b905090565b33321461208d5760405162461bcd60e51b8152602060048201526015602482015274506c616e6574733a206d7573742075736520454f4160581b6044820152606401610ef4565b80806120976128fe565b10156120b55760405162461bcd60e51b8152600401610ef490615286565b600d5460ff166002146120eb57600d5460405163353ba46160e11b815260ff909116600482015260026024820152604401610ef4565b336000908152601960205260408120805484929061210a9084906152e5565b9250508190555081600e600082825461212391906152e5565b909155505060175461213590836152ce565b341461214a57346017548361140b91906152ce565b60005b8281101561216f5761215d6135e7565b80612167816151ec565b91505061214d565b5060405182815233907f748a2986091c2034d6e93b6f44f771a79f0e1d6acd8a60c68c17d4e1e2feaed29060200160405180910390a25050565b6121b1612ae7565b601a5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb906044016020604051808303816000875af1158015612204573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f95919061536c565b611014338383613800565b61223b612ae7565b601455565b612248612ae7565b601155565b612255612ae7565b600d5460ff1660031461228b57600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b60005b818110156110ee578282828181106122a8576122a86151d6565b90506020020160208101906122bd9190615572565b602060008787858181106122d3576122d36151d6565b60209081029290920135835250810191909152604001600020805462ff000019166201000083600381111561230a5761230a614e00565b021790555080612319816151ec565b91505061228e565b61232b338361336c565b6123475760405162461bcd60e51b8152600401610ef490615239565b612353848484846138ce565b50505050565b606061236482612a1a565b600082815260208080526040808320815160c08101909252805460ff808216845292939192918401916101009091041660028111156123a5576123a5614e00565b60028111156123b6576123b6614e00565b8152815460209091019062010000900460ff1660038111156123da576123da614e00565b60038111156123eb576123eb614e00565b815281546020909101906301000000900460ff16600a81111561241057612410614e00565b600a81111561242157612421614e00565b81528154602090910190640100000000900460ff16600781111561244757612447614e00565b600781111561245857612458614e00565b8152905460ff600160281b90910481161515602090920191909152815191925060009182916124879116613901565b915091506000612495610dc7565b61249e87613a38565b6040516020016124af9291906155af565b6040516020818303038152906040529050806040516020016124d19190615612565b60408051601f1981840301815291905260215490915060ff1661251557806040516020016124ff919061579c565b60405160208183030381529060405290506125a5565b806125238560200151613acb565b6125308660800151613b97565b61253d8760600151613d97565b60405160200161255094939291906157d1565b60405160208183030381529060405290508061256f8560400151614058565b83612580876000015160ff16613a38565b60405160200161259394939291906158f8565b60405160208183030381529060405290505b6125e6816125c186608001518760200151886060015188612645565b6040516020016125d29291906159ff565b604051602081830303815290604052614144565b9050806040516020016125f99190615a53565b604051602081830303815290604052945050505050919050565b61261b612ae7565b600d805460ff191660ff92909216919091179055565b612639612ae7565b602261101482826153d7565b60215460609060ff166126e4576022805461265f90615173565b80601f016020809104026020016040519081016040528092919081815260200182805461268b90615173565b80156126d85780601f106126ad576101008083540402835291602001916126d8565b820191906000526020600020905b8154815290600101906020018083116126bb57829003601f168201915b5050505050905061276b565b6126ec6142ab565b61270686600781111561270157612701614e00565b613a38565b61271b86600281111561270157612701614e00565b61273085600481111561270157612701614e00565b61274587600a81111561270157612701614e00565b604051602001612759959493929190615a98565b60405160208183030381529060405290505b949350505050565b61277b612ae7565b600d5460ff166003146127b157600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b60005b818110156110ee578282828181106127ce576127ce6151d6565b90506020020160208101906127e39190615b36565b602060008787858181106127f9576127f96151d6565b60209081029290920135835250810191909152604001600020805464ff00000000191664010000000083600781111561283457612834614e00565b021790555080612843816151ec565b9150506127b4565b612853612ae7565b601e91909155601f55565b612866612ae7565b601a546040516000916001600160a01b03169047908381818185875af1925050503d80600081146128b3576040519150601f19603f3d011682016040523d82523d6000602084013e6128b8565b606091505b50509050806128fb5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610ef4565b50565b6000612908612036565b60085461204191906151c3565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61294b612ae7565b601355565b612958612ae7565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b612982612ae7565b6001600160a01b0381166129e75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ef4565b6128fb816137ae565b6129f8612ae7565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260409020546001600160a01b03166128fb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610ef4565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612aae82611de9565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6006546001600160a01b03163314611f395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ef4565b6110148282604051806020016040528060008152506142ba565b600060ff84161580612b7357508260ff168460ff1610155b15612b9e57604051635cc08ee560e01b815260ff808616600483015284166024820152604401610ef4565b60ff84165b8360ff16811015612c2f57612710601f548460ff16612bc291906152ce565b612bcd9060646152e5565b601e54612bdb6001856151c3565b612be591906152ce565b612bf09060646152e5565b612bfa91906152ce565b601d54612c0791906152ce565b612c119190615b67565b612c1b90836152e5565b915080612c27816151ec565b915050612ba3565b509392505050565b600060ff83161580612c4f57508160ff168360ff1610155b15612c7a57604051635cc08ee560e01b815260ff808516600483015283166024820152604401610ef4565b60ff83165b8260ff16811015612cb65780601c54612c9891906152ce565b612ca290836152e5565b915080612cae816151ec565b915050612c7f565b5092915050565b612cc5614a16565b600083815260208080526040808320815160c08101909252805460ff80821684529293919291840191610100909104166002811115612d0657612d06614e00565b6002811115612d1757612d17614e00565b8152815460209091019062010000900460ff166003811115612d3b57612d3b614e00565b6003811115612d4c57612d4c614e00565b815281546020909101906301000000900460ff16600a811115612d7157612d71614e00565b600a811115612d8257612d82614e00565b81528154602090910190640100000000900460ff166007811115612da857612da8614e00565b6007811115612db957612db9614e00565b81529054600160281b900460ff16151560209091015280519091506000612de08583615220565b9050600083604001516003811115612dfa57612dfa614e00565b90506032612e088785615220565b60ff161115612e2a576040516330531d7360e01b815260040160405180910390fd5b612ec7601b8054612e3a90615173565b80601f0160208091040260200160405190810160405280929190818152602001828054612e6690615173565b8015612eb35780601f10612e8857610100808354040283529160200191612eb3565b820191906000526020600020905b815481529060010190602001808311612e9657829003601f168201915b50505050508260ff168560ff1660006142ed565b612f64601b8054612ed790615173565b80601f0160208091040260200160405190810160405280929190818152602001828054612f0390615173565b8015612f505780601f10612f2557610100808354040283529160200191612f50565b820191906000526020600020905b815481529060010190602001808311612f3357829003601f168201915b50505050508360ff168560ff1660006142ed565b612f6e9190615315565b61ffff168552601b80546130139190612f8690615173565b80601f0160208091040260200160405190810160405280929190818152602001828054612fb290615173565b8015612fff5780601f10612fd457610100808354040283529160200191612fff565b820191906000526020600020905b815481529060010190602001808311612fe257829003601f168201915b50505050508260ff168560ff1660016142ed565b6130b0601b805461302390615173565b80601f016020809104026020016040519081016040528092919081815260200182805461304f90615173565b801561309c5780601f106130715761010080835404028352916020019161309c565b820191906000526020600020905b81548152906001019060200180831161307f57829003601f168201915b50505050508360ff168560ff1660016142ed565b6130ba9190615315565b61ffff166020860152601b805461316291906130d590615173565b80601f016020809104026020016040519081016040528092919081815260200182805461310190615173565b801561314e5780601f106131235761010080835404028352916020019161314e565b820191906000526020600020905b81548152906001019060200180831161313157829003601f168201915b50505050508260ff168560ff1660026142ed565b6131ff601b805461317290615173565b80601f016020809104026020016040519081016040528092919081815260200182805461319e90615173565b80156131eb5780601f106131c0576101008083540402835291602001916131eb565b820191906000526020600020905b8154815290600101906020018083116131ce57829003601f168201915b50505050508360ff168560ff1660026142ed565b6132099190615315565b61ffff166040860152601b80546132b1919061322490615173565b80601f016020809104026020016040519081016040528092919081815260200182805461325090615173565b801561329d5780601f106132725761010080835404028352916020019161329d565b820191906000526020600020905b81548152906001019060200180831161328057829003601f168201915b50505050508260ff168560ff1660036142ed565b61334e601b80546132c190615173565b80601f01602080910402602001604051908101604052809291908181526020018280546132ed90615173565b801561333a5780601f1061330f5761010080835404028352916020019161333a565b820191906000526020600020905b81548152906001019060200180831161331d57829003601f168201915b50505050508360ff168560ff1660036142ed565b6133589190615315565b61ffff166060860152509295945050505050565b60008061337883611de9565b9050806001600160a01b0316846001600160a01b0316148061339f575061339f8185612915565b8061276b5750836001600160a01b03166133b884610e59565b6001600160a01b031614949350505050565b826001600160a01b03166133dd82611de9565b6001600160a01b0316146134035760405162461bcd60e51b8152600401610ef490615b7b565b6001600160a01b0382166134655760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610ef4565b6134728383836001614394565b826001600160a01b031661348582611de9565b6001600160a01b0316146134ab5760405162461bcd60e51b8152600401610ef490615b7b565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008085858460405160200161355393929190615bc0565b6040516020818303038152906040528051906020012090506135cc846135c6836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9061441c565b6016546001600160a01b039182169116149695505050505050565b60006135f1613615565b60008181526020805260409020805460ff1916600117905590506128fb3382612b41565b6000806136206128fe565b1161366d5760405162461bcd60e51b815260206004820152601860248201527f4e6f206d6f726520746f6b656e7320617661696c61626c6500000000000000006044820152606401610ef4565b6000613677612036565b60085461368491906151c3565b6040516bffffffffffffffffffffffff1933606090811b8216602084015241901b166034820152446048820152456068820152426088820152909150600090829060a8016040516020818303038152906040528051906020012060001c6136eb9190615bff565b60008181526009602052604081205491925090810361370b57508061371c565b506000818152600960205260409020545b6009600061372b6001866151c3565b8152602001908152602001600020546000036137605761374c6001846151c3565b600083815260096020526040902055613790565b6009600061376f6001866151c3565b81526020808201929092526040908101600090812054858252600990935220555b613798614438565b50600a546137a690826152e5565b935050505090565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036138615760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610ef4565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6138d98484846133ca565b6138e584848484614454565b6123535760405162461bcd60e51b8152600401610ef490615c13565b6000606060148361ffff161015613938575050604080518082019091526005815264416c70686160d81b6020820152600090915091565b60148361ffff16101580156139515750601e8361ffff16105b1561397b5750506040805180820190915260048152634265746160e01b6020820152600190915091565b601e8361ffff1610158015613994575060288361ffff16105b156139bf57505060408051808201909152600581526447616d6d6160d81b6020820152600290915091565b60288361ffff16101580156139d8575060328361ffff16105b15613a0357505060408051808201909152600581526444656c746160d81b6020820152600390915091565b8261ffff16603203613a3357505060408051808201909152600781526622b839b4b637b760c91b60208201526004905b915091565b60606000613a4583614552565b600101905060008167ffffffffffffffff811115613a6557613a65614ce7565b6040519080825280601f01601f191660200182016040528015613a8f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613a9957509392505050565b60606000826002811115613ae157613ae1614e00565b03613b065750506040805180820190915260048152634669726560e01b602082015290565b6002826002811115613b1a57613b1a614e00565b03613b4057505060408051808201909152600581526414dd19595b60da1b602082015290565b6001826002811115613b5457613b54614e00565b03613b7e5750506040805180820190915260098152684c696768746e696e6760b81b602082015290565b505060408051602081019091526000815290565b919050565b60606000826007811115613bad57613bad614e00565b03613bd957505060408051808201909152600b81526a507572706c65204875657360a81b602082015290565b6001826007811115613bed57613bed614e00565b03613c1857505060408051808201909152600a81526942726f776e204875657360b01b602082015290565b6002826007811115613c2c57613c2c614e00565b03613c515750506040805180820190915260048152635761767960e01b602082015290565b6003826007811115613c6557613c65614e00565b03613c9457505060408051808201909152600e81526d53686f6f74696e6720537461727360901b602082015290565b6006826007811115613ca857613ca8614e00565b03613cd257505060408051808201909152600981526815d85d9e4811dbdb1960ba1b602082015290565b6005826007811115613ce657613ce6614e00565b03613d1a575050604080518082019091526013815272476f6c642053686f6f74696e6720537461727360681b602082015290565b6004826007811115613d2e57613d2e614e00565b03613d58575050604080518082019091526009815268476f6c64204875657360b81b602082015290565b6007826007811115613d6c57613d6c614e00565b03613b7e57505060408051808201909152600a815269476f6c6420536b69657360b01b602082015290565b6060600082600a811115613dad57613dad614e00565b03613dd757505060408051808201909152600981526848616c6f2052696e6760b81b602082015290565b600182600a811115613deb57613deb614e00565b03613e1357505060408051808201909152600781526650616e646f726160c81b602082015290565b600282600a811115613e2757613e27614e00565b03613e4d57505060408051808201909152600581526441746c617360d81b602082015290565b600382600a811115613e6157613e61614e00565b03613e875750506040805180820190915260058152644d6574697360d81b602082015290565b600482600a811115613e9b57613e9b614e00565b03613ec4575050604080518082019091526008815267115b9d1dda5b995960c21b602082015290565b600582600a811115613ed857613ed8614e00565b03613f0757505060408051808201909152600e81526d5261696e626f7720436c6f75647360901b602082015290565b600682600a811115613f1b57613f1b614e00565b03613f4457505060408051808201909152600881526747616c617469636160c01b602082015290565b600782600a811115613f5857613f58614e00565b03613f8257505060408051808201909152600981526841737465726f69647360b81b602082015290565b600882600a811115613f9657613f96614e00565b03613fc8575050604080518082019091526011815270496e7465727374656c6c61722050696e6b60781b602082015290565b600982600a811115613fdc57613fdc614e00565b03614012575050604080518082019091526015815274125b9d195c9cdd195b1b185c8811dc98591a595b9d605a1b602082015290565b600a82600a81111561402657614026614e00565b03613b7e575050604080518082019091526011815270125b9d195c9cdd195b1b185c8811dbdb19607a1b602082015290565b6060600082600381111561406e5761406e614e00565b0361409557505060408051808201909152600681526521b7b6b6b7b760d11b602082015290565b60018260038111156140a9576140a9614e00565b036140d25750506040805180820190915260088152672ab731b7b6b6b7b760c11b602082015290565b60028260038111156140e6576140e6614e00565b0361410b5750506040805180820190915260048152635261726560e01b602082015290565b600382600381111561411f5761411f614e00565b03613b7e5750506040805180820190915260048152634570696360e01b602082015290565b6060815160000361416357505060408051602081019091526000815290565b6000604051806060016040528060408152602001615cc0604091399050600060038451600261419291906152e5565b61419c9190615b67565b6141a79060046152ce565b905060006141b68260206152e5565b67ffffffffffffffff8111156141ce576141ce614ce7565b6040519080825280601f01601f1916602001820160405280156141f8576020820181803683370190505b509050818152600183018586518101602084015b818310156142665760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b9382019390935260040161420c565b60038951066001811461428057600281146142915761429d565b613d3d60f01b60011983015261429d565b603d60f81b6000198301525b509398975050505050505050565b6060600c8054610dd690615173565b6142c4838361462a565b6142d16000848484614454565b610f955760405162461bcd60e51b8152600401610ef490615c13565b6000806142fb8360026152ce565b6143066001866151c3565b6143119060206152ce565b61431c8760086152ce565b61432691906152e5565b61433091906152e5565b905061433d8160026152e5565b865110156143845760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610ef4565b9490940160020151949350505050565b6001811115612353576001600160a01b038416156143da576001600160a01b038416600090815260036020526040812080548392906143d49084906151c3565b90915550505b6001600160a01b03831615612353576001600160a01b038316600090815260036020526040812080548392906144119084906152e5565b909155505050505050565b600080600061442b85856147c3565b91509150612c2f81614808565b60008061444460075490565b9050613b92600780546001019055565b60006001600160a01b0384163b1561454a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614498903390899088908890600401615c65565b6020604051808303816000875af19250505080156144d3575060408051601f3d908101601f191682019092526144d091810190615ca2565b60015b614530573d808015614501576040519150601f19603f3d011682016040523d82523d6000602084013e614506565b606091505b5080516000036145285760405162461bcd60e51b8152600401610ef490615c13565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061276b565b50600161276b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106145915772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106145bd576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106145db57662386f26fc10000830492506010015b6305f5e10083106145f3576305f5e100830492506008015b612710831061460757612710830492506004015b60648310614619576064830492506002015b600a8310610dc15760010192915050565b6001600160a01b0382166146805760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610ef4565b6000818152600260205260409020546001600160a01b0316156146e55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ef4565b6146f3600083836001614394565b6000818152600260205260409020546001600160a01b0316156147585760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ef4565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008082516041036147f95760208301516040840151606085015160001a6147ed87828585614952565b94509450505050614801565b506000905060025b9250929050565b600081600481111561481c5761481c614e00565b036148245750565b600181600481111561483857614838614e00565b036148855760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610ef4565b600281600481111561489957614899614e00565b036148e65760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610ef4565b60038160048111156148fa576148fa614e00565b036128fb5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610ef4565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156149895750600090506003614a0d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156149dd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614a0657600060019250925050614a0d565b9150600090505b94509492505050565b60405180608001604052806004906020820280368337509192915050565b6001600160e01b0319811681146128fb57600080fd5b600060208284031215614a5c57600080fd5b8135614a6781614a34565b9392505050565b60005b83811015614a89578181015183820152602001614a71565b50506000910152565b60008151808452614aaa816020860160208601614a6e565b601f01601f19169290920160200192915050565b602081526000614a676020830184614a92565b600060208284031215614ae357600080fd5b5035919050565b6001600160a01b03811681146128fb57600080fd5b60008060408385031215614b1257600080fd5b8235614b1d81614aea565b946020939093013593505050565b600060208284031215614b3d57600080fd5b8135614a6781614aea565b6000610180808385031215614b5c57600080fd5b838184011115614b6b57600080fd5b509092915050565b60008083601f840112614b8557600080fd5b50813567ffffffffffffffff811115614b9d57600080fd5b6020830191508360208260051b850101111561480157600080fd5b60008060008060408587031215614bce57600080fd5b843567ffffffffffffffff80821115614be657600080fd5b614bf288838901614b73565b90965094506020870135915080821115614c0b57600080fd5b50614c1887828801614b73565b95989497509550505050565b803560ff81168114613b9257600080fd5b60008060408385031215614c4857600080fd5b82359150614c5860208401614c24565b90509250929050565b838152602080820184905260c0820190604083018460005b6004811015614c9a57815161ffff1683529183019190830190600101614c79565b50505050949350505050565b600080600060608486031215614cbb57600080fd5b8335614cc681614aea565b92506020840135614cd681614aea565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115614d1857614d18614ce7565b604051601f8501601f19908116603f01168101908282118183101715614d4057614d40614ce7565b81604052809350858152868686011115614d5957600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112614d8457600080fd5b614a6783833560208501614cfd565b600080600060608486031215614da857600080fd5b83359250602084013567ffffffffffffffff80821115614dc757600080fd5b614dd387838801614d73565b93506040860135915080821115614de957600080fd5b50614df686828701614d73565b9150509250925092565b634e487b7160e01b600052602160045260246000fd5b60038110614e2657614e26614e00565b9052565b60048110614e2657614e26614e00565b600b8110614e2657614e26614e00565b60088110614e2657614e26614e00565b60ff8716815260c08101614e716020830188614e16565b614e7e6040830187614e2a565b614e8b6060830186614e3a565b614e986080830185614e4a565b82151560a0830152979650505050505050565b600060208284031215614ebd57600080fd5b813567ffffffffffffffff811115614ed457600080fd5b8201601f81018413614ee557600080fd5b61276b84823560208401614cfd565b815160ff16815260208083015160c0830191614f1290840182614e16565b506040830151614f256040840182614e2a565b506060830151614f386060840182614e3a565b506080830151614f4b6080840182614e4a565b5060a0928301511515919092015290565b60008060408385031215614f6f57600080fd5b50508035926020909101359150565b60008060208385031215614f9157600080fd5b823567ffffffffffffffff80821115614fa957600080fd5b818501915085601f830112614fbd57600080fd5b813581811115614fcc57600080fd5b866020828501011115614fde57600080fd5b60209290920196919550909350505050565b80151581146128fb57600080fd5b6000806040838503121561501157600080fd5b823561501c81614aea565b9150602083013561502c81614ff0565b809150509250929050565b6000806000806080858703121561504d57600080fd5b843561505881614aea565b9350602085013561506881614aea565b925060408501359150606085013567ffffffffffffffff81111561508b57600080fd5b61509787828801614d73565b91505092959194509250565b6000602082840312156150b557600080fd5b614a6782614c24565b803560088110613b9257600080fd5b803560038110613b9257600080fd5b8035600b8110613b9257600080fd5b6000806000806080858703121561510157600080fd5b61510a856150be565b9350615118602086016150cd565b9250615126604086016150dc565b915060608501356005811061513a57600080fd5b939692955090935050565b6000806040838503121561515857600080fd5b823561516381614aea565b9150602083013561502c81614aea565b600181811c9082168061518757607f821691505b6020821081036151a757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610dc157610dc16151ad565b634e487b7160e01b600052603260045260246000fd5b6000600182016151fe576151fe6151ad565b5060010190565b60006020828403121561521757600080fd5b614a67826150dc565b60ff8181168382160190811115610dc157610dc16151ad565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526028908201527f526571756573746564206e756d626572206f6620746f6b656e73206e6f7420616040820152677661696c61626c6560c01b606082015260800190565b8082028115828204841417610dc157610dc16151ad565b80820180821115610dc157610dc16151ad565b60006020828403121561530a57600080fd5b8151614a6781614aea565b61ffff828116828216039080821115612cb657612cb66151ad565b600061ffff808316818103615347576153476151ad565b6001019392505050565b61ffff818116838216019080821115612cb657612cb66151ad565b60006020828403121561537e57600080fd5b8151614a6781614ff0565b601f821115610f9557600081815260208120601f850160051c810160208610156153b05750805b601f850160051c820191505b818110156153cf578281556001016153bc565b505050505050565b815167ffffffffffffffff8111156153f1576153f1614ce7565b615405816153ff8454615173565b84615389565b602080601f83116001811461543a57600084156154225750858301515b600019600386901b1c1916600185901b1785556153cf565b600085815260208120601f198616915b828110156154695788860151825594840194600190910190840161544a565b50858210156154875787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff8311156154af576154af614ce7565b6154c3836154bd8354615173565b83615389565b6000601f8411600181146154f757600085156154df5750838201355b600019600387901b1c1916600186901b1783556110ee565b600083815260209020601f19861690835b828110156155285786850135825560209485019460019092019101615508565b50868210156155455760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561556957600080fd5b614a67826150cd565b60006020828403121561558457600080fd5b813560048110614a6757600080fd5b600081516155a5818560208601614a6e565b9290920192915050565b693d913730b6b2911d101160b11b815282516000906155d581600a850160208801614a6e565b61202360f01b600a9184019182015283516155f781600c840160208801614a6e565b61088b60f21b600c9290910191820152600e01949350505050565b60008251615624818460208701614a6e565b7f226465736372697074696f6e223a202257656c636f6d6520746f2074686520639201918252507f61707469766174696e67207265616c6d206f662041746c616e7469732c20746860208201527f652067616d652d766572736520616e6420686f6d65206f6620746865206c656760408201527f656e64617279204172676f6e617574732e20506c616e6574732061726520636f60608201527f7665746564206c616e6473207468617420686f6c6420746865206b657920746f60808201527f20796f7572207375636365737320696e207468652067616d652e20416371756960a08201527f726520706c616e6574732c20656d6261726b206f6e206578636974696e67206560c08201527f787065646974696f6e732c20616e64206561726e20726577617264732074686160e08201527f742077696c6c20737570657263686172676520796f75722067726f77746820696101008201526c1b88105d1b185b9d1a5ccb888b609a1b61012082015261012d01919050565b600082516157ae818460208701614a6e565b7008985d1d1c9a589d5d195cc88e8816d74b607a1b920191825250601101919050565b600085516157e3818460208a01614a6e565b80830190507f2261747472696275746573223a205b7b2274726169745f74797065223a2022458152723632b6b2b73a111610113b30b63ab2911d101160691b6020820152855161583a816033840160208a01614a6e565b62089f4b60ea1b6033929091019182018190527f7b2274726169745f74797065223a20224261636b67726f756e64222c20227661603683015266363ab2911d101160c91b60568301819052865161589881605d860160208b01614a6e565b605d9301928301919091527f7b2274726169745f74797065223a20224f72626974204e616d65222c20227661606083015260808201526158ed6158de6087830186615593565b62089f4b60ea1b815260030190565b979650505050505050565b6000855161590a818460208a01614a6e565b80830190507f7b2274726169745f74797065223a20224f72626974222c202276616c7565223a815261101160f11b8060208301528651615951816022850160208b01614a6e565b62089f4b60ea1b6022939091019283018190527f7b2274726169745f74797065223a202245766f6c7574696f6e222c202276616c6025840152653ab2911d101160d11b604584015286516159ac81604b860160208b01614a6e565b604b9301928301527f7b2274726169745f74797065223a20224c6576656c222c202276616c7565223a604e830152606e8201526158ed6159ef6070830186615593565b63089f574b60e21b815260040190565b60008351615a11818460208801614a6e565b691134b6b0b3b2911d101160b11b9083019081528351615a3881600a840160208801614a6e565b61227d60f01b600a9290910191820152600c01949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251615a8b81601d850160208701614a6e565b91909101601d0192915050565b60008651615aaa818460208b01614a6e565b865190830190615abe818360208b01614a6e565b602f60f81b91018181528651909190615ade816001850160208b01614a6e565b600192019182018190528551615afb816002850160208a01614a6e565b60029201918201528351615b16816003840160208801614a6e565b632e706e6760e01b60039290910191820152600701979650505050505050565b600060208284031215615b4857600080fd5b614a67826150be565b634e487b7160e01b600052601260045260246000fd5b600082615b7657615b76615b51565b500490565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6bffffffffffffffffffffffff198460601b16815260008351615bea816014850160208801614a6e565b60149201918201929092526034019392505050565b600082615c0e57615c0e615b51565b500690565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615c9890830184614a92565b9695505050505050565b600060208284031215615cb457600080fd5b8151614a6781614a3456fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220fb7dd33733ac7508fcef64d1e588eeca340523551a43979c3b470e70ec0e174064736f6c63430008110033697066733a2f2f626166796265696361626d7634636362626c6e6e706671367135726735737232717171346d633779377933747179667a7469777a726b66663576690000000000000000000000007aeca63e4b51b0ff8a8a82b3231033ca4ca6301b0000000000000000000000006a952f966c5dcc36a094c8ab141f027fb58f864e00000000000000000000000000000000000000000000000000000000000000800000000000000000000000005ff59cdcaa5b7bb704303328c48c1fb913bae3ee0000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040526004361061043c5760003560e01c80637bf185aa11610234578063c87b56dd1161012e578063e025107f116100b6578063ea98eb1d1161007a578063ea98eb1d14610cd5578063f0f4426014610cf5578063f2fde38b14610d15578063f3ad65f414610d35578063f504764d14610d5557600080fd5b8063e025107f14610c5f578063e07fa3c114610c75578063e14ca35314610c8a578063e3e6a3ef14610c9f578063e985e9c514610cb557600080fd5b8063da71ff12116100fd578063da71ff1214610bde578063dc34c04114610bf3578063dc53fd9214610c09578063deecbfa814610c1f578063dffc857014610c3f57600080fd5b8063c87b56dd14610b5e578063ce3cd99714610b7e578063ce7cebf214610b9e578063d600671c14610bbe57600080fd5b8063a0712d68116101bc578063aa880b4f11610180578063aa880b4f14610ac6578063b7b637db14610adc578063b88d4fde14610afc578063c040e6b814610b1c578063c833e25814610b4857600080fd5b8063a0712d6814610a33578063a1db978214610a46578063a22cb46514610a66578063a611708e14610a86578063a8f6891614610aa657600080fd5b806395528bc51161020357806395528bc5146109a757806395d89b41146109c757806396330b5f146109dc5780639f181b5e14610a09578063a0617ad014610a1e57600080fd5b80637bf185aa14610933578063815d544c14610953578063877850ef146109695780638da5cb5b1461098957600080fd5b806338dc3a20116103455780635b8ad429116102cd5780636c0360eb116102915780636c0360eb146108b35780636cc29174146108c857806370a08231146108e8578063715018a614610908578063790188ae1461091d57600080fd5b80635b8ad4291461081e5780635d82cf6e1461083357806361d027b314610853578063627804af146108735780636352211e1461089357600080fd5b80634f558e79116103145780634f558e7914610777578063518302271461079757806355f804b3146107b157806358d95010146107d15780635b785034146107fe57600080fd5b806338dc3a20146106ed5780633bdf4ac61461070257806342842e0e1461072f5780634860d6da1461074f57600080fd5b806323b872dd116103c857806328d077681161039757806328d07768146106765780632f975f041461068b5780633246e467146106a15780633305048f146106b757806335c6aaf8146106d757600080fd5b806323b872dd146105b157806324436f77146105d157806326c1e750146105e457806327c7812c1461065657600080fd5b806311dceda71161040f57806311dceda7146104f257806312f269b91461052d57806318160ddd1461054d578063199854b2146105625780631b4663e81461058257600080fd5b806301ffc9a71461044157806306fdde0314610476578063081812fc14610498578063095ea7b3146104d0575b600080fd5b34801561044d57600080fd5b5061046161045c366004614a4a565b610d75565b60405190151581526020015b60405180910390f35b34801561048257600080fd5b5061048b610dc7565b60405161046d9190614abe565b3480156104a457600080fd5b506104b86104b3366004614ad1565b610e59565b6040516001600160a01b03909116815260200161046d565b3480156104dc57600080fd5b506104f06104eb366004614aff565b610e80565b005b3480156104fe57600080fd5b5061051f61050d366004614b2b565b60126020526000908152604090205481565b60405190815260200161046d565b34801561053957600080fd5b506104f0610548366004614b48565b610f9a565b34801561055957600080fd5b50600e5461051f565b34801561056e57600080fd5b506104f061057d366004614bb8565b611018565b34801561058e57600080fd5b506105a261059d366004614c35565b6110f5565b60405161046d93929190614c61565b3480156105bd57600080fd5b506104f06105cc366004614ca6565b6112de565b6104f06105df366004614d93565b61130f565b3480156105f057600080fd5b506106446105ff366004614ad1565b602080526000908152604090205460ff808216916101008104821691620100008204811691630100000081048216916401000000008204811691600160281b90041686565b60405161046d96959493929190614e5a565b34801561066257600080fd5b506104f0610671366004614b2b565b611596565b34801561068257600080fd5b5061048b6115c0565b34801561069757600080fd5b5061051f601d5481565b3480156106ad57600080fd5b5061051f60185481565b3480156106c357600080fd5b506104f06106d2366004614c35565b61164e565b3480156106e357600080fd5b5061051f60145481565b3480156106f957600080fd5b5061048b611b2a565b34801561070e57600080fd5b5061051f61071d366004614b2b565b60156020526000908152604090205481565b34801561073b57600080fd5b506104f061074a366004614ca6565b611b37565b34801561075b57600080fd5b50610764600481565b60405161ffff909116815260200161046d565b34801561078357600080fd5b50610461610792366004614ad1565b611b52565b3480156107a357600080fd5b506021546104619060ff1681565b3480156107bd57600080fd5b506104f06107cc366004614eab565b611b71565b3480156107dd57600080fd5b506107f16107ec366004614ad1565b611b85565b60405161046d9190614ef4565b34801561080a57600080fd5b506104f0610819366004614f5c565b611cd0565b34801561082a57600080fd5b506104f0611ce3565b34801561083f57600080fd5b506104f061084e366004614ad1565b611cff565b34801561085f57600080fd5b50601a546104b8906001600160a01b031681565b34801561087f57600080fd5b506104f061088e366004614aff565b611d0c565b34801561089f57600080fd5b506104b86108ae366004614ad1565b611de9565b3480156108bf57600080fd5b5061048b611e49565b3480156108d457600080fd5b506104f06108e3366004614f7e565b611e56565b3480156108f457600080fd5b5061051f610903366004614b2b565b611ea1565b34801561091457600080fd5b506104f0611f27565b34801561092957600080fd5b5061051f60105481565b34801561093f57600080fd5b506104f061094e366004614bb8565b611f3b565b34801561095f57600080fd5b5061051f600f5481565b34801561097557600080fd5b506104f0610984366004614ad1565b61200d565b34801561099557600080fd5b506006546001600160a01b03166104b8565b3480156109b357600080fd5b506104f06109c2366004614ad1565b61201a565b3480156109d357600080fd5b5061048b612027565b3480156109e857600080fd5b5061051f6109f7366004614b2b565b60196020526000908152604090205481565b348015610a1557600080fd5b5061051f612036565b348015610a2a57600080fd5b5060085461051f565b6104f0610a41366004614ad1565b612046565b348015610a5257600080fd5b506104f0610a61366004614aff565b6121a9565b348015610a7257600080fd5b506104f0610a81366004614ffe565b612228565b348015610a9257600080fd5b506104f0610aa1366004614ad1565b612233565b348015610ab257600080fd5b506104f0610ac1366004614ad1565b612240565b348015610ad257600080fd5b5061051f60135481565b348015610ae857600080fd5b506104f0610af7366004614bb8565b61224d565b348015610b0857600080fd5b506104f0610b17366004615037565b612321565b348015610b2857600080fd5b50600d54610b369060ff1681565b60405160ff909116815260200161046d565b348015610b5457600080fd5b5061051f60115481565b348015610b6a57600080fd5b5061048b610b79366004614ad1565b612359565b348015610b8a57600080fd5b506104f0610b993660046150a3565b612613565b348015610baa57600080fd5b506104f0610bb9366004614eab565b612631565b348015610bca57600080fd5b5061048b610bd93660046150eb565b612645565b348015610bea57600080fd5b50610764603281565b348015610bff57600080fd5b5061051f601e5481565b348015610c1557600080fd5b5061051f60175481565b348015610c2b57600080fd5b506104f0610c3a366004614bb8565b612773565b348015610c4b57600080fd5b506104f0610c5a366004614f5c565b61284b565b348015610c6b57600080fd5b5061051f601f5481565b348015610c8157600080fd5b506104f061285e565b348015610c9657600080fd5b5061051f6128fe565b348015610cab57600080fd5b5061051f601c5481565b348015610cc157600080fd5b50610461610cd0366004615145565b612915565b348015610ce157600080fd5b506104f0610cf0366004614ad1565b612943565b348015610d0157600080fd5b506104f0610d10366004614b2b565b612950565b348015610d2157600080fd5b506104f0610d30366004614b2b565b61297a565b348015610d4157600080fd5b50600b546104b8906001600160a01b031681565b348015610d6157600080fd5b506104f0610d70366004614b2b565b6129f0565b60006001600160e01b031982166380ac58cd60e01b1480610da657506001600160e01b03198216635b5e139f60e01b145b80610dc157506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060008054610dd690615173565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0290615173565b8015610e4f5780601f10610e2457610100808354040283529160200191610e4f565b820191906000526020600020905b815481529060010190602001808311610e3257829003601f168201915b5050505050905090565b6000610e6482612a1a565b506000908152600460205260409020546001600160a01b031690565b6000610e8b82611de9565b9050806001600160a01b0316836001600160a01b031603610efd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610f195750610f198133612915565b610f8b5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610ef4565b610f958383612a79565b505050565b610fa2612ae7565b60015b600d8110156110145760008181526020805260409020805460ff19166001908117909155611002908390610fd990846151c3565b600c8110610fe957610fe96151d6565b602002016020810190610ffc9190614b2b565b82612b41565b8061100c816151ec565b915050610fa5565b5050565b611020612ae7565b600d5460ff1660031461105657600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b60005b818110156110ee57828282818110611073576110736151d6565b90506020020160208101906110889190615205565b6020600087878581811061109e5761109e6151d6565b60209081029290920135835250810191909152604001600020805463ff0000001916630100000083600a8111156110d7576110d7614e00565b0217905550806110e6816151ec565b915050611059565b5050505050565b600080611100614a16565b600085815260208080526040808320815160c08101909252805460ff8082168452929391929184019161010090910416600281111561114157611141614e00565b600281111561115257611152614e00565b8152815460209091019062010000900460ff16600381111561117657611176614e00565b600381111561118757611187614e00565b815281546020909101906301000000900460ff16600a8111156111ac576111ac614e00565b600a8111156111bd576111bd614e00565b81528154602090910190640100000000900460ff1660078111156111e3576111e3614e00565b60078111156111f4576111f4614e00565b81529054600160281b900460ff1615156020909101528051909150600061121b8783615220565b905060008360400151600381111561123557611235614e00565b905060326112438985615220565b60ff1611156112ae5760405162461bcd60e51b815260206004820152603160248201527f506c616e6574733a20506c616e65742063616e6e6f7420626520757067726164604482015270656420746f2074686973206c6576656c2160781b6064820152608401610ef4565b6112b9838383612b5b565b96506112c58383612c37565b95506112d18989612cbd565b9450505050509250925092565b6112e8338261336c565b6113045760405162461bcd60e51b8152600401610ef490615239565b610f958383836133ca565b3332146113565760405162461bcd60e51b8152602060048201526015602482015274506c616e6574733a206d7573742075736520454f4160581b6044820152606401610ef4565b82806113606128fe565b101561137e5760405162461bcd60e51b8152600401610ef490615286565b61138c338484600f5461353b565b6113a957604051638baa579f60e01b815260040160405180910390fd5b600d5460ff166001146113df57600d5460405163353ba46160e11b815260ff909116600482015260016024820152604401610ef4565b600f5460010361148f576011546113f690856152ce565b341461142d57346011548561140b91906152ce565b604051631068e6e760e01b815260048101929092526024820152604401610ef4565b6010543360009081526012602052604090205461144b9086906152e5565b111561146a57604051634ecf32dd60e11b815260040160405180910390fd5b33600090815260126020526040812080548692906114899084906152e5565b90915550505b600f5460020361151d576014546114a690856152ce565b34146114bb57346014548561140b91906152ce565b601354336000908152601560205260409020546114d99086906152e5565b11156114f857604051634ecf32dd60e11b815260040160405180910390fd5b33600090815260156020526040812080548692906115179084906152e5565b90915550505b83600e600082825461152f91906152e5565b90915550600090505b8481101561155a576115486135e7565b80611552816151ec565b915050611538565b5060405184815233907f73c70fae6461815259bb17577a08362a747e97f1b952b86e211522d4a24f95379060200160405180910390a250505050565b61159e612ae7565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b601b80546115cd90615173565b80601f01602080910402602001604051908101604052809291908181526020018280546115f990615173565b80156116465780601f1061161b57610100808354040283529160200191611646565b820191906000526020600020905b81548152906001019060200180831161162957829003601f168201915b505050505081565b600b54604080516329a33d0560e21b815290516000926001600160a01b03169163a68cf4149160048083019260209291908290030181865afa158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc91906152f8565b90506000600b60009054906101000a90046001600160a01b03166001600160a01b031663786d10866040518163ffffffff1660e01b8152600401602060405180830381865afa158015611713573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173791906152f8565b90506000600b60009054906101000a90046001600160a01b03166001600160a01b0316638cc84db76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561178e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b291906152f8565b9050336117be86611de9565b6001600160a01b0316146117e557604051630a40deb960e31b815260040160405180910390fd5b600d5460ff1660041461181d57600d5460405163353ba46160e11b815260ff9091166004808301919091526024820152604401610ef4565b60008581526020805260408120805490919062010000900460ff16600381111561184957611849614e00565b825490915060329061185f90889060ff16615220565b60ff161115611881576040516330531d7360e01b815260040160405180910390fd5b815460009061189c9060ff166118978982615220565b612c37565b83549091506000906118bb9060ff166118b58a82615220565b85612b5b565b905060006118c98a8a612cbd565b85549091506000906001908b90889084906118e890849060ff16615220565b92506101000a81548160ff021916908360ff1602179055505b600461ffff821611611a105760008361191b600184615315565b61ffff166004811061192f5761192f6151d6565b602002015161ffff16905080156119ef5787546001600160a01b038b169063f5298aca90339061ffff871690610100900460ff16600281111561197457611974614e00565b61197f9060016152e5565b61198991906152e5565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260448101849052606401600060405180830381600087803b1580156119d657600080fd5b505af11580156119ea573d6000803e3d6000fd5b505050505b816119f981615330565b9250611a089050600384615351565b925050611901565b6040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b038b16906323b872dd906064016020604051808303816000875af1158015611a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a87919061536c565b508315611ae95760405163a7b8b49160e01b8152600481018590526001600160a01b0389169063a7b8b49190602401600060405180830381600087803b158015611ad057600080fd5b505af1158015611ae4573d6000803e3d6000fd5b505050505b865460405160ff909116908d907f50b7db618c3ed4d1fe8122fce987e7ea6245b41f8e0c64817c0eacaa225fd4eb90600090a3505050505050505050505050565b602280546115cd90615173565b610f9583838360405180602001604052806000815250612321565b6000818152600260205260408120546001600160a01b03161515610dc1565b611b79612ae7565b600c61101482826153d7565b611bbf6040805160c08101909152600080825260208201908152602001600081526020016000815260200160008152600060209091015290565b600082815260208080526040808320815160c08101909252805460ff80821684529293919291840191610100909104166002811115611c0057611c00614e00565b6002811115611c1157611c11614e00565b8152815460209091019062010000900460ff166003811115611c3557611c35614e00565b6003811115611c4657611c46614e00565b815281546020909101906301000000900460ff16600a811115611c6b57611c6b614e00565b600a811115611c7c57611c7c614e00565b81528154602090910190640100000000900460ff166007811115611ca257611ca2614e00565b6007811115611cb357611cb3614e00565b81529054600160281b900460ff1615156020909101529392505050565b611cd8612ae7565b601c91909155601d55565b611ceb612ae7565b6021805460ff19811660ff90911615179055565b611d07612ae7565b601755565b8080611d166128fe565b1015611d345760405162461bcd60e51b8152600401610ef490615286565b611d3c612ae7565b81600e6000828254611d4e91906152e5565b90915550600090505b82811015611da0576000611d69613615565b60008181526020805260409020805460ff191660011790559050611d8d3282612b41565b5080611d98816151ec565b915050611d57565b50826001600160a01b03167f748a2986091c2034d6e93b6f44f771a79f0e1d6acd8a60c68c17d4e1e2feaed283604051611ddc91815260200190565b60405180910390a2505050565b6000818152600260205260408120546001600160a01b031680610dc15760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610ef4565b600c80546115cd90615173565b611e5e612ae7565b600d5460ff16600314611e9457600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b601b610f95828483615497565b60006001600160a01b038216611f0b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610ef4565b506001600160a01b031660009081526003602052604090205490565b611f2f612ae7565b611f3960006137ae565b565b611f43612ae7565b600d5460ff16600314611f7957600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b60005b838110156110ee57828282818110611f9657611f966151d6565b9050602002016020810190611fab9190615557565b60206000878785818110611fc157611fc16151d6565b60209081029290920135835250810191909152604001600020805461ff001916610100836002811115611ff657611ff6614e00565b021790555080612005816151ec565b915050611f7c565b612015612ae7565b600f55565b612022612ae7565b601055565b606060018054610dd690615173565b600061204160075490565b905090565b33321461208d5760405162461bcd60e51b8152602060048201526015602482015274506c616e6574733a206d7573742075736520454f4160581b6044820152606401610ef4565b80806120976128fe565b10156120b55760405162461bcd60e51b8152600401610ef490615286565b600d5460ff166002146120eb57600d5460405163353ba46160e11b815260ff909116600482015260026024820152604401610ef4565b336000908152601960205260408120805484929061210a9084906152e5565b9250508190555081600e600082825461212391906152e5565b909155505060175461213590836152ce565b341461214a57346017548361140b91906152ce565b60005b8281101561216f5761215d6135e7565b80612167816151ec565b91505061214d565b5060405182815233907f748a2986091c2034d6e93b6f44f771a79f0e1d6acd8a60c68c17d4e1e2feaed29060200160405180910390a25050565b6121b1612ae7565b601a5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb906044016020604051808303816000875af1158015612204573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f95919061536c565b611014338383613800565b61223b612ae7565b601455565b612248612ae7565b601155565b612255612ae7565b600d5460ff1660031461228b57600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b60005b818110156110ee578282828181106122a8576122a86151d6565b90506020020160208101906122bd9190615572565b602060008787858181106122d3576122d36151d6565b60209081029290920135835250810191909152604001600020805462ff000019166201000083600381111561230a5761230a614e00565b021790555080612319816151ec565b91505061228e565b61232b338361336c565b6123475760405162461bcd60e51b8152600401610ef490615239565b612353848484846138ce565b50505050565b606061236482612a1a565b600082815260208080526040808320815160c08101909252805460ff808216845292939192918401916101009091041660028111156123a5576123a5614e00565b60028111156123b6576123b6614e00565b8152815460209091019062010000900460ff1660038111156123da576123da614e00565b60038111156123eb576123eb614e00565b815281546020909101906301000000900460ff16600a81111561241057612410614e00565b600a81111561242157612421614e00565b81528154602090910190640100000000900460ff16600781111561244757612447614e00565b600781111561245857612458614e00565b8152905460ff600160281b90910481161515602090920191909152815191925060009182916124879116613901565b915091506000612495610dc7565b61249e87613a38565b6040516020016124af9291906155af565b6040516020818303038152906040529050806040516020016124d19190615612565b60408051601f1981840301815291905260215490915060ff1661251557806040516020016124ff919061579c565b60405160208183030381529060405290506125a5565b806125238560200151613acb565b6125308660800151613b97565b61253d8760600151613d97565b60405160200161255094939291906157d1565b60405160208183030381529060405290508061256f8560400151614058565b83612580876000015160ff16613a38565b60405160200161259394939291906158f8565b60405160208183030381529060405290505b6125e6816125c186608001518760200151886060015188612645565b6040516020016125d29291906159ff565b604051602081830303815290604052614144565b9050806040516020016125f99190615a53565b604051602081830303815290604052945050505050919050565b61261b612ae7565b600d805460ff191660ff92909216919091179055565b612639612ae7565b602261101482826153d7565b60215460609060ff166126e4576022805461265f90615173565b80601f016020809104026020016040519081016040528092919081815260200182805461268b90615173565b80156126d85780601f106126ad576101008083540402835291602001916126d8565b820191906000526020600020905b8154815290600101906020018083116126bb57829003601f168201915b5050505050905061276b565b6126ec6142ab565b61270686600781111561270157612701614e00565b613a38565b61271b86600281111561270157612701614e00565b61273085600481111561270157612701614e00565b61274587600a81111561270157612701614e00565b604051602001612759959493929190615a98565b60405160208183030381529060405290505b949350505050565b61277b612ae7565b600d5460ff166003146127b157600d5460405163353ba46160e11b815260ff909116600482015260036024820152604401610ef4565b60005b818110156110ee578282828181106127ce576127ce6151d6565b90506020020160208101906127e39190615b36565b602060008787858181106127f9576127f96151d6565b60209081029290920135835250810191909152604001600020805464ff00000000191664010000000083600781111561283457612834614e00565b021790555080612843816151ec565b9150506127b4565b612853612ae7565b601e91909155601f55565b612866612ae7565b601a546040516000916001600160a01b03169047908381818185875af1925050503d80600081146128b3576040519150601f19603f3d011682016040523d82523d6000602084013e6128b8565b606091505b50509050806128fb5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610ef4565b50565b6000612908612036565b60085461204191906151c3565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61294b612ae7565b601355565b612958612ae7565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b612982612ae7565b6001600160a01b0381166129e75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610ef4565b6128fb816137ae565b6129f8612ae7565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260409020546001600160a01b03166128fb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610ef4565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612aae82611de9565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6006546001600160a01b03163314611f395760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ef4565b6110148282604051806020016040528060008152506142ba565b600060ff84161580612b7357508260ff168460ff1610155b15612b9e57604051635cc08ee560e01b815260ff808616600483015284166024820152604401610ef4565b60ff84165b8360ff16811015612c2f57612710601f548460ff16612bc291906152ce565b612bcd9060646152e5565b601e54612bdb6001856151c3565b612be591906152ce565b612bf09060646152e5565b612bfa91906152ce565b601d54612c0791906152ce565b612c119190615b67565b612c1b90836152e5565b915080612c27816151ec565b915050612ba3565b509392505050565b600060ff83161580612c4f57508160ff168360ff1610155b15612c7a57604051635cc08ee560e01b815260ff808516600483015283166024820152604401610ef4565b60ff83165b8260ff16811015612cb65780601c54612c9891906152ce565b612ca290836152e5565b915080612cae816151ec565b915050612c7f565b5092915050565b612cc5614a16565b600083815260208080526040808320815160c08101909252805460ff80821684529293919291840191610100909104166002811115612d0657612d06614e00565b6002811115612d1757612d17614e00565b8152815460209091019062010000900460ff166003811115612d3b57612d3b614e00565b6003811115612d4c57612d4c614e00565b815281546020909101906301000000900460ff16600a811115612d7157612d71614e00565b600a811115612d8257612d82614e00565b81528154602090910190640100000000900460ff166007811115612da857612da8614e00565b6007811115612db957612db9614e00565b81529054600160281b900460ff16151560209091015280519091506000612de08583615220565b9050600083604001516003811115612dfa57612dfa614e00565b90506032612e088785615220565b60ff161115612e2a576040516330531d7360e01b815260040160405180910390fd5b612ec7601b8054612e3a90615173565b80601f0160208091040260200160405190810160405280929190818152602001828054612e6690615173565b8015612eb35780601f10612e8857610100808354040283529160200191612eb3565b820191906000526020600020905b815481529060010190602001808311612e9657829003601f168201915b50505050508260ff168560ff1660006142ed565b612f64601b8054612ed790615173565b80601f0160208091040260200160405190810160405280929190818152602001828054612f0390615173565b8015612f505780601f10612f2557610100808354040283529160200191612f50565b820191906000526020600020905b815481529060010190602001808311612f3357829003601f168201915b50505050508360ff168560ff1660006142ed565b612f6e9190615315565b61ffff168552601b80546130139190612f8690615173565b80601f0160208091040260200160405190810160405280929190818152602001828054612fb290615173565b8015612fff5780601f10612fd457610100808354040283529160200191612fff565b820191906000526020600020905b815481529060010190602001808311612fe257829003601f168201915b50505050508260ff168560ff1660016142ed565b6130b0601b805461302390615173565b80601f016020809104026020016040519081016040528092919081815260200182805461304f90615173565b801561309c5780601f106130715761010080835404028352916020019161309c565b820191906000526020600020905b81548152906001019060200180831161307f57829003601f168201915b50505050508360ff168560ff1660016142ed565b6130ba9190615315565b61ffff166020860152601b805461316291906130d590615173565b80601f016020809104026020016040519081016040528092919081815260200182805461310190615173565b801561314e5780601f106131235761010080835404028352916020019161314e565b820191906000526020600020905b81548152906001019060200180831161313157829003601f168201915b50505050508260ff168560ff1660026142ed565b6131ff601b805461317290615173565b80601f016020809104026020016040519081016040528092919081815260200182805461319e90615173565b80156131eb5780601f106131c0576101008083540402835291602001916131eb565b820191906000526020600020905b8154815290600101906020018083116131ce57829003601f168201915b50505050508360ff168560ff1660026142ed565b6132099190615315565b61ffff166040860152601b80546132b1919061322490615173565b80601f016020809104026020016040519081016040528092919081815260200182805461325090615173565b801561329d5780601f106132725761010080835404028352916020019161329d565b820191906000526020600020905b81548152906001019060200180831161328057829003601f168201915b50505050508260ff168560ff1660036142ed565b61334e601b80546132c190615173565b80601f01602080910402602001604051908101604052809291908181526020018280546132ed90615173565b801561333a5780601f1061330f5761010080835404028352916020019161333a565b820191906000526020600020905b81548152906001019060200180831161331d57829003601f168201915b50505050508360ff168560ff1660036142ed565b6133589190615315565b61ffff166060860152509295945050505050565b60008061337883611de9565b9050806001600160a01b0316846001600160a01b0316148061339f575061339f8185612915565b8061276b5750836001600160a01b03166133b884610e59565b6001600160a01b031614949350505050565b826001600160a01b03166133dd82611de9565b6001600160a01b0316146134035760405162461bcd60e51b8152600401610ef490615b7b565b6001600160a01b0382166134655760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610ef4565b6134728383836001614394565b826001600160a01b031661348582611de9565b6001600160a01b0316146134ab5760405162461bcd60e51b8152600401610ef490615b7b565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008085858460405160200161355393929190615bc0565b6040516020818303038152906040528051906020012090506135cc846135c6836040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b9061441c565b6016546001600160a01b039182169116149695505050505050565b60006135f1613615565b60008181526020805260409020805460ff1916600117905590506128fb3382612b41565b6000806136206128fe565b1161366d5760405162461bcd60e51b815260206004820152601860248201527f4e6f206d6f726520746f6b656e7320617661696c61626c6500000000000000006044820152606401610ef4565b6000613677612036565b60085461368491906151c3565b6040516bffffffffffffffffffffffff1933606090811b8216602084015241901b166034820152446048820152456068820152426088820152909150600090829060a8016040516020818303038152906040528051906020012060001c6136eb9190615bff565b60008181526009602052604081205491925090810361370b57508061371c565b506000818152600960205260409020545b6009600061372b6001866151c3565b8152602001908152602001600020546000036137605761374c6001846151c3565b600083815260096020526040902055613790565b6009600061376f6001866151c3565b81526020808201929092526040908101600090812054858252600990935220555b613798614438565b50600a546137a690826152e5565b935050505090565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036138615760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610ef4565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6138d98484846133ca565b6138e584848484614454565b6123535760405162461bcd60e51b8152600401610ef490615c13565b6000606060148361ffff161015613938575050604080518082019091526005815264416c70686160d81b6020820152600090915091565b60148361ffff16101580156139515750601e8361ffff16105b1561397b5750506040805180820190915260048152634265746160e01b6020820152600190915091565b601e8361ffff1610158015613994575060288361ffff16105b156139bf57505060408051808201909152600581526447616d6d6160d81b6020820152600290915091565b60288361ffff16101580156139d8575060328361ffff16105b15613a0357505060408051808201909152600581526444656c746160d81b6020820152600390915091565b8261ffff16603203613a3357505060408051808201909152600781526622b839b4b637b760c91b60208201526004905b915091565b60606000613a4583614552565b600101905060008167ffffffffffffffff811115613a6557613a65614ce7565b6040519080825280601f01601f191660200182016040528015613a8f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613a9957509392505050565b60606000826002811115613ae157613ae1614e00565b03613b065750506040805180820190915260048152634669726560e01b602082015290565b6002826002811115613b1a57613b1a614e00565b03613b4057505060408051808201909152600581526414dd19595b60da1b602082015290565b6001826002811115613b5457613b54614e00565b03613b7e5750506040805180820190915260098152684c696768746e696e6760b81b602082015290565b505060408051602081019091526000815290565b919050565b60606000826007811115613bad57613bad614e00565b03613bd957505060408051808201909152600b81526a507572706c65204875657360a81b602082015290565b6001826007811115613bed57613bed614e00565b03613c1857505060408051808201909152600a81526942726f776e204875657360b01b602082015290565b6002826007811115613c2c57613c2c614e00565b03613c515750506040805180820190915260048152635761767960e01b602082015290565b6003826007811115613c6557613c65614e00565b03613c9457505060408051808201909152600e81526d53686f6f74696e6720537461727360901b602082015290565b6006826007811115613ca857613ca8614e00565b03613cd257505060408051808201909152600981526815d85d9e4811dbdb1960ba1b602082015290565b6005826007811115613ce657613ce6614e00565b03613d1a575050604080518082019091526013815272476f6c642053686f6f74696e6720537461727360681b602082015290565b6004826007811115613d2e57613d2e614e00565b03613d58575050604080518082019091526009815268476f6c64204875657360b81b602082015290565b6007826007811115613d6c57613d6c614e00565b03613b7e57505060408051808201909152600a815269476f6c6420536b69657360b01b602082015290565b6060600082600a811115613dad57613dad614e00565b03613dd757505060408051808201909152600981526848616c6f2052696e6760b81b602082015290565b600182600a811115613deb57613deb614e00565b03613e1357505060408051808201909152600781526650616e646f726160c81b602082015290565b600282600a811115613e2757613e27614e00565b03613e4d57505060408051808201909152600581526441746c617360d81b602082015290565b600382600a811115613e6157613e61614e00565b03613e875750506040805180820190915260058152644d6574697360d81b602082015290565b600482600a811115613e9b57613e9b614e00565b03613ec4575050604080518082019091526008815267115b9d1dda5b995960c21b602082015290565b600582600a811115613ed857613ed8614e00565b03613f0757505060408051808201909152600e81526d5261696e626f7720436c6f75647360901b602082015290565b600682600a811115613f1b57613f1b614e00565b03613f4457505060408051808201909152600881526747616c617469636160c01b602082015290565b600782600a811115613f5857613f58614e00565b03613f8257505060408051808201909152600981526841737465726f69647360b81b602082015290565b600882600a811115613f9657613f96614e00565b03613fc8575050604080518082019091526011815270496e7465727374656c6c61722050696e6b60781b602082015290565b600982600a811115613fdc57613fdc614e00565b03614012575050604080518082019091526015815274125b9d195c9cdd195b1b185c8811dc98591a595b9d605a1b602082015290565b600a82600a81111561402657614026614e00565b03613b7e575050604080518082019091526011815270125b9d195c9cdd195b1b185c8811dbdb19607a1b602082015290565b6060600082600381111561406e5761406e614e00565b0361409557505060408051808201909152600681526521b7b6b6b7b760d11b602082015290565b60018260038111156140a9576140a9614e00565b036140d25750506040805180820190915260088152672ab731b7b6b6b7b760c11b602082015290565b60028260038111156140e6576140e6614e00565b0361410b5750506040805180820190915260048152635261726560e01b602082015290565b600382600381111561411f5761411f614e00565b03613b7e5750506040805180820190915260048152634570696360e01b602082015290565b6060815160000361416357505060408051602081019091526000815290565b6000604051806060016040528060408152602001615cc0604091399050600060038451600261419291906152e5565b61419c9190615b67565b6141a79060046152ce565b905060006141b68260206152e5565b67ffffffffffffffff8111156141ce576141ce614ce7565b6040519080825280601f01601f1916602001820160405280156141f8576020820181803683370190505b509050818152600183018586518101602084015b818310156142665760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b9382019390935260040161420c565b60038951066001811461428057600281146142915761429d565b613d3d60f01b60011983015261429d565b603d60f81b6000198301525b509398975050505050505050565b6060600c8054610dd690615173565b6142c4838361462a565b6142d16000848484614454565b610f955760405162461bcd60e51b8152600401610ef490615c13565b6000806142fb8360026152ce565b6143066001866151c3565b6143119060206152ce565b61431c8760086152ce565b61432691906152e5565b61433091906152e5565b905061433d8160026152e5565b865110156143845760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610ef4565b9490940160020151949350505050565b6001811115612353576001600160a01b038416156143da576001600160a01b038416600090815260036020526040812080548392906143d49084906151c3565b90915550505b6001600160a01b03831615612353576001600160a01b038316600090815260036020526040812080548392906144119084906152e5565b909155505050505050565b600080600061442b85856147c3565b91509150612c2f81614808565b60008061444460075490565b9050613b92600780546001019055565b60006001600160a01b0384163b1561454a57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614498903390899088908890600401615c65565b6020604051808303816000875af19250505080156144d3575060408051601f3d908101601f191682019092526144d091810190615ca2565b60015b614530573d808015614501576040519150601f19603f3d011682016040523d82523d6000602084013e614506565b606091505b5080516000036145285760405162461bcd60e51b8152600401610ef490615c13565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061276b565b50600161276b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106145915772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106145bd576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106145db57662386f26fc10000830492506010015b6305f5e10083106145f3576305f5e100830492506008015b612710831061460757612710830492506004015b60648310614619576064830492506002015b600a8310610dc15760010192915050565b6001600160a01b0382166146805760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610ef4565b6000818152600260205260409020546001600160a01b0316156146e55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ef4565b6146f3600083836001614394565b6000818152600260205260409020546001600160a01b0316156147585760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610ef4565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60008082516041036147f95760208301516040840151606085015160001a6147ed87828585614952565b94509450505050614801565b506000905060025b9250929050565b600081600481111561481c5761481c614e00565b036148245750565b600181600481111561483857614838614e00565b036148855760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610ef4565b600281600481111561489957614899614e00565b036148e65760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610ef4565b60038160048111156148fa576148fa614e00565b036128fb5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610ef4565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156149895750600090506003614a0d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156149dd573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614a0657600060019250925050614a0d565b9150600090505b94509492505050565b60405180608001604052806004906020820280368337509192915050565b6001600160e01b0319811681146128fb57600080fd5b600060208284031215614a5c57600080fd5b8135614a6781614a34565b9392505050565b60005b83811015614a89578181015183820152602001614a71565b50506000910152565b60008151808452614aaa816020860160208601614a6e565b601f01601f19169290920160200192915050565b602081526000614a676020830184614a92565b600060208284031215614ae357600080fd5b5035919050565b6001600160a01b03811681146128fb57600080fd5b60008060408385031215614b1257600080fd5b8235614b1d81614aea565b946020939093013593505050565b600060208284031215614b3d57600080fd5b8135614a6781614aea565b6000610180808385031215614b5c57600080fd5b838184011115614b6b57600080fd5b509092915050565b60008083601f840112614b8557600080fd5b50813567ffffffffffffffff811115614b9d57600080fd5b6020830191508360208260051b850101111561480157600080fd5b60008060008060408587031215614bce57600080fd5b843567ffffffffffffffff80821115614be657600080fd5b614bf288838901614b73565b90965094506020870135915080821115614c0b57600080fd5b50614c1887828801614b73565b95989497509550505050565b803560ff81168114613b9257600080fd5b60008060408385031215614c4857600080fd5b82359150614c5860208401614c24565b90509250929050565b838152602080820184905260c0820190604083018460005b6004811015614c9a57815161ffff1683529183019190830190600101614c79565b50505050949350505050565b600080600060608486031215614cbb57600080fd5b8335614cc681614aea565b92506020840135614cd681614aea565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115614d1857614d18614ce7565b604051601f8501601f19908116603f01168101908282118183101715614d4057614d40614ce7565b81604052809350858152868686011115614d5957600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112614d8457600080fd5b614a6783833560208501614cfd565b600080600060608486031215614da857600080fd5b83359250602084013567ffffffffffffffff80821115614dc757600080fd5b614dd387838801614d73565b93506040860135915080821115614de957600080fd5b50614df686828701614d73565b9150509250925092565b634e487b7160e01b600052602160045260246000fd5b60038110614e2657614e26614e00565b9052565b60048110614e2657614e26614e00565b600b8110614e2657614e26614e00565b60088110614e2657614e26614e00565b60ff8716815260c08101614e716020830188614e16565b614e7e6040830187614e2a565b614e8b6060830186614e3a565b614e986080830185614e4a565b82151560a0830152979650505050505050565b600060208284031215614ebd57600080fd5b813567ffffffffffffffff811115614ed457600080fd5b8201601f81018413614ee557600080fd5b61276b84823560208401614cfd565b815160ff16815260208083015160c0830191614f1290840182614e16565b506040830151614f256040840182614e2a565b506060830151614f386060840182614e3a565b506080830151614f4b6080840182614e4a565b5060a0928301511515919092015290565b60008060408385031215614f6f57600080fd5b50508035926020909101359150565b60008060208385031215614f9157600080fd5b823567ffffffffffffffff80821115614fa957600080fd5b818501915085601f830112614fbd57600080fd5b813581811115614fcc57600080fd5b866020828501011115614fde57600080fd5b60209290920196919550909350505050565b80151581146128fb57600080fd5b6000806040838503121561501157600080fd5b823561501c81614aea565b9150602083013561502c81614ff0565b809150509250929050565b6000806000806080858703121561504d57600080fd5b843561505881614aea565b9350602085013561506881614aea565b925060408501359150606085013567ffffffffffffffff81111561508b57600080fd5b61509787828801614d73565b91505092959194509250565b6000602082840312156150b557600080fd5b614a6782614c24565b803560088110613b9257600080fd5b803560038110613b9257600080fd5b8035600b8110613b9257600080fd5b6000806000806080858703121561510157600080fd5b61510a856150be565b9350615118602086016150cd565b9250615126604086016150dc565b915060608501356005811061513a57600080fd5b939692955090935050565b6000806040838503121561515857600080fd5b823561516381614aea565b9150602083013561502c81614aea565b600181811c9082168061518757607f821691505b6020821081036151a757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610dc157610dc16151ad565b634e487b7160e01b600052603260045260246000fd5b6000600182016151fe576151fe6151ad565b5060010190565b60006020828403121561521757600080fd5b614a67826150dc565b60ff8181168382160190811115610dc157610dc16151ad565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526028908201527f526571756573746564206e756d626572206f6620746f6b656e73206e6f7420616040820152677661696c61626c6560c01b606082015260800190565b8082028115828204841417610dc157610dc16151ad565b80820180821115610dc157610dc16151ad565b60006020828403121561530a57600080fd5b8151614a6781614aea565b61ffff828116828216039080821115612cb657612cb66151ad565b600061ffff808316818103615347576153476151ad565b6001019392505050565b61ffff818116838216019080821115612cb657612cb66151ad565b60006020828403121561537e57600080fd5b8151614a6781614ff0565b601f821115610f9557600081815260208120601f850160051c810160208610156153b05750805b601f850160051c820191505b818110156153cf578281556001016153bc565b505050505050565b815167ffffffffffffffff8111156153f1576153f1614ce7565b615405816153ff8454615173565b84615389565b602080601f83116001811461543a57600084156154225750858301515b600019600386901b1c1916600185901b1785556153cf565b600085815260208120601f198616915b828110156154695788860151825594840194600190910190840161544a565b50858210156154875787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b67ffffffffffffffff8311156154af576154af614ce7565b6154c3836154bd8354615173565b83615389565b6000601f8411600181146154f757600085156154df5750838201355b600019600387901b1c1916600186901b1783556110ee565b600083815260209020601f19861690835b828110156155285786850135825560209485019460019092019101615508565b50868210156155455760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006020828403121561556957600080fd5b614a67826150cd565b60006020828403121561558457600080fd5b813560048110614a6757600080fd5b600081516155a5818560208601614a6e565b9290920192915050565b693d913730b6b2911d101160b11b815282516000906155d581600a850160208801614a6e565b61202360f01b600a9184019182015283516155f781600c840160208801614a6e565b61088b60f21b600c9290910191820152600e01949350505050565b60008251615624818460208701614a6e565b7f226465736372697074696f6e223a202257656c636f6d6520746f2074686520639201918252507f61707469766174696e67207265616c6d206f662041746c616e7469732c20746860208201527f652067616d652d766572736520616e6420686f6d65206f6620746865206c656760408201527f656e64617279204172676f6e617574732e20506c616e6574732061726520636f60608201527f7665746564206c616e6473207468617420686f6c6420746865206b657920746f60808201527f20796f7572207375636365737320696e207468652067616d652e20416371756960a08201527f726520706c616e6574732c20656d6261726b206f6e206578636974696e67206560c08201527f787065646974696f6e732c20616e64206561726e20726577617264732074686160e08201527f742077696c6c20737570657263686172676520796f75722067726f77746820696101008201526c1b88105d1b185b9d1a5ccb888b609a1b61012082015261012d01919050565b600082516157ae818460208701614a6e565b7008985d1d1c9a589d5d195cc88e8816d74b607a1b920191825250601101919050565b600085516157e3818460208a01614a6e565b80830190507f2261747472696275746573223a205b7b2274726169745f74797065223a2022458152723632b6b2b73a111610113b30b63ab2911d101160691b6020820152855161583a816033840160208a01614a6e565b62089f4b60ea1b6033929091019182018190527f7b2274726169745f74797065223a20224261636b67726f756e64222c20227661603683015266363ab2911d101160c91b60568301819052865161589881605d860160208b01614a6e565b605d9301928301919091527f7b2274726169745f74797065223a20224f72626974204e616d65222c20227661606083015260808201526158ed6158de6087830186615593565b62089f4b60ea1b815260030190565b979650505050505050565b6000855161590a818460208a01614a6e565b80830190507f7b2274726169745f74797065223a20224f72626974222c202276616c7565223a815261101160f11b8060208301528651615951816022850160208b01614a6e565b62089f4b60ea1b6022939091019283018190527f7b2274726169745f74797065223a202245766f6c7574696f6e222c202276616c6025840152653ab2911d101160d11b604584015286516159ac81604b860160208b01614a6e565b604b9301928301527f7b2274726169745f74797065223a20224c6576656c222c202276616c7565223a604e830152606e8201526158ed6159ef6070830186615593565b63089f574b60e21b815260040190565b60008351615a11818460208801614a6e565b691134b6b0b3b2911d101160b11b9083019081528351615a3881600a840160208801614a6e565b61227d60f01b600a9290910191820152600c01949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251615a8b81601d850160208701614a6e565b91909101601d0192915050565b60008651615aaa818460208b01614a6e565b865190830190615abe818360208b01614a6e565b602f60f81b91018181528651909190615ade816001850160208b01614a6e565b600192019182018190528551615afb816002850160208a01614a6e565b60029201918201528351615b16816003840160208801614a6e565b632e706e6760e01b60039290910191820152600701979650505050505050565b600060208284031215615b4857600080fd5b614a67826150be565b634e487b7160e01b600052601260045260246000fd5b600082615b7657615b76615b51565b500490565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6bffffffffffffffffffffffff198460601b16815260008351615bea816014850160208801614a6e565b60149201918201929092526034019392505050565b600082615c0e57615c0e615b51565b500690565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615c9890830184614a92565b9695505050505050565b600060208284031215615cb457600080fd5b8151614a6781614a3456fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220fb7dd33733ac7508fcef64d1e588eeca340523551a43979c3b470e70ec0e174064736f6c63430008110033

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

0000000000000000000000007aeca63e4b51b0ff8a8a82b3231033ca4ca6301b0000000000000000000000006a952f966c5dcc36a094c8ab141f027fb58f864e00000000000000000000000000000000000000000000000000000000000000800000000000000000000000005ff59cdcaa5b7bb704303328c48c1fb913bae3ee0000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _owner (address): 0x7AECa63e4B51b0Ff8A8a82b3231033ca4CA6301b
Arg [1] : _whitelistSignerAddress (address): 0x6A952f966c5DcC36A094c8AB141f027fb58F864e
Arg [2] : __baseURI (string):
Arg [3] : _addressRegistry (address): 0x5ff59cdCAA5B7Bb704303328C48c1fb913BAe3EE

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000007aeca63e4b51b0ff8a8a82b3231033ca4ca6301b
Arg [1] : 0000000000000000000000006a952f966c5dcc36a094c8ab141f027fb58f864e
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [3] : 0000000000000000000000005ff59cdcaa5b7bb704303328c48c1fb913bae3ee
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000


Loading...
Loading
[ 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.