ETH Price: $3,452.75 (+0.92%)
Gas: 7 Gwei

The Plague Staked (sFROG)
 

Overview

TokenID

6384

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
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
StakeFrogs

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 14 : StakeFrogs.sol
// SPDX-License-Identifier: CC-BY-NC-4.0
pragma solidity ^0.8.13;

import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {UntransferableERC721} from "./extensions/UntransferableERC721.sol";

/**
 * MMMMMMMMMMMMMMMMMMWWWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 * MMMMMMMMMMMMMWXOxdlllloxOKNWNXXK000OOO000KXXX0OOkOO0XWMMMMMMMMMMMMMMMM
 * MMMMMMMMMMMW0o:,''''''''';cc:;;,,,'''''',,;;;,''''',;cd0WMMMMMMMMMMMMM
 * MMMMMMMMMMNx;'''''''''''''''''''''''''''''''''''''''''',dXMMMMMMMMMMMM
 * MMMMMMMMMM0:',lol;'.';cllc,',''',,,,,''''',''''''''''''''dNMMMMMMMMMMM
 * MMMMMMMMMM0c':kkc'';;;d00x;'',,'','''''',lxl,....,:cll;'';xXWMMMMMMMMM
 * MMMMMMMMMMXo';dx;.':;'lOkc,'',,,,,'''''';dOc'.;c;,o00Ol'''':xXMMMMMMMM
 * MMMMMMMMMWO:'';:,'..'';::,',''''','''''',cd;..,:,,d0Od;''''''lKWMMMMMM
 * MMMMMMMMMKl,''''''''','''',,',,',,'''''''','''''',clc,''''''''cKMMMMMM
 * MMMMMMMMNd,''''','''''''''''''''''',,,'''''''''''''''''''''''''dNMMMMM
 * MMMMMMMWk;'','''''''''''''''''''''''''''''''''''','','','''''''cKMMMMM
 * MMMMMMW0c,','',''''''''''''''',,,,'''''''''''''',,,,;;;,,''''''cKMMMMM
 * MMMMMNkl::;,,,,,,'''''''''''''''',''''''',,,,;;::ccccllc;''''''oNMMMMM
 * MMMMMXo:lllllc:;;;;,,,,,,,,,,,,,,,;;;;::::::ccccllllllc;,''''':OMMMMMM
 * MMMMMWx:cccccccccc::::::::::::::::::::ccccccccllllcc:;,'''''';kWMMMMMM
 * MMMMMW0occlllllcccccccccccccccccccccclllllllcc::;,,,'''''''':OWMMMMMMM
 * MMMMMMWN0xoc:::::ccccclllllllccccccc::::;;,,,,'''''''''''',oKWMMMMMMMM
 * MMMMMMMMMMWX0koc,'',,,,,,,,,,,,,,,''''''',,''''''''''''';o0WMMMMMMMMMM
 * MMMMMMMMMMMMMMWN0xo;'''''''''''''''''''''''''''''''.';lxKWMMMMMMMMMMMM
 * MMMMMMMMMMMMMMMMMMWKko:,''''''''''''''''''''''.',;cdkKWMMMMMMMMMMMMMMM
 * MMMMMMMMMMMMMMMMMMMMMWNKOxolc:;,,'''''',,,;:codk0XWMMMMMMMMMMMMMMMMMMM
 * MMMMMMMMMMMMMMMMMMMMMMMMMMMWNNXK000OOO00KKXNWMMMMMMMMMMMMMMMMMMMMMMMMM
 * MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 *
 * @title StakeFrogs
 * @custom:website www.plaguenft.com
 * @author @lozzereth (www.allthingsweb3.com)
 * @notice NFT Staking contract for The Plague. Staking will entitle its holders to a
 *         staked nft and yield token. Contract is the custodian of a fixed amount of
 *         token which is then distributed as rewards to its holders.
 */
contract StakeFrogs is UntransferableERC721, IERC721Receiver {
    using Math for uint256;

    /// @notice Contract addresses
    address public immutable erc721Address;
    address public erc20Address;

    /// @notice First is default, followed by bonusIntervals rates
    uint256[3] public periodEmissions = [100, 200, 300];

    /// @notice Period that one full emission occurs
    uint256 public periodDenominator = 30 days;

    /// @notice Minimum interval (interval * demoninator) to begin bonus emissions
    uint256[2] public bonusIntervals = [3, 6];

    /// @notice Track the deposit and claim state of tokens
    struct StakedToken {
        uint256 depositedAt;
        uint256 claimedAt;
    }
    mapping(uint256 => StakedToken) public staked;

    /// @notice Token non-existent
    error TokenNonExistent(uint256 tokenId);

    /// @notice Not an owner of the frog
    error TokenNonOwner(uint256 tokenId);

    /// @notice Using a non-zero value
    error NonZeroValue();

    constructor(address _erc721Address, address _erc20Address)
        UntransferableERC721("The Plague Staked", "sFROG")
    {
        erc721Address = _erc721Address;
        erc20Address = _erc20Address;
        setBaseURI("ipfs://QmNyaURfnPtYQzDepeEFLDxTWdJHXRBP37HwxyJUvgMSm3/");
    }

    /**
     * @notice Track deposits of an account
     * @dev Intended for off-chain computation having O(totalSupply) complexity
     * @param account - Account to query
     * @return tokenIds
     */
    function depositsOf(address account)
        external
        view
        returns (uint256[] memory)
    {
        unchecked {
            uint256 tokenIdsIdx;
            uint256 tokenIdsLength = balanceOf(account);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            for (uint256 i; tokenIdsIdx != tokenIdsLength; ++i) {
                if (!_exists(i)) {
                    continue;
                }
                if (ownerOf(i) == account) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }

    /**
     * @dev Control the staking bonus for when denominator crosses
     * @param tokens - an array of intervals, denominated by {periodDenominator}
     *                 i.e. [3, 6] being respectively [3 months, 6 months] iff
     *                 {periodDenominator} = 1 month
     */
    function setBonusInterval(uint256[2] calldata tokens) external onlyOwner {
        bonusIntervals = tokens;
    }

    /**
     * @dev Adjust the emission rate (in wei)
     * @param rates - an array such that [default, bonusIntervals[0], bonusIntervals[1]
     */
    function setPeriodEmission(uint256[3] calldata rates) external onlyOwner {
        periodEmissions = rates;
    }

    /**
     * @dev Adjust the period of emission
     * @param interval - the interval, could be 1 day, 1 month, etc...
     */
    function setPeriodDenominator(uint256 interval) external onlyOwner {
        if (interval == 0) revert NonZeroValue();
        periodDenominator = interval;
    }

    /**
     * @notice Calculates the rewards for specific tokens under an address
     * @param account - account to check
     * @param tokenIds - token ids to check against
     * @return rewards
     */
    function calculateRewards(address account, uint256[] memory tokenIds)
        public
        view
        returns (uint256[] memory rewards)
    {
        rewards = new uint256[](tokenIds.length);
        for (uint256 i; i < tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            if (!_exists(tokenId)) {
                revert TokenNonExistent(tokenId);
            }
            if (ownerOf(tokenId) != account) {
                revert TokenNonOwner(tokenId);
            }
            unchecked {
                // tiny gas save
                uint256 interval = periodDenominator;
                uint256 depositedAt = staked[tokenId].depositedAt;
                uint256 claimedAt = staked[tokenId].claimedAt;

                // calculate rewards since deposit
                uint256 sinceDeposit = (block.timestamp - depositedAt) /
                    interval;
                uint256 accrued = _accruedRewards(sinceDeposit);

                // deduct all claims made to date
                if (claimedAt > depositedAt) {
                    uint256 sinceClaim = (claimedAt - depositedAt) / interval;
                    accrued -= _accruedRewards(sinceClaim);
                }
                rewards[i] = accrued;
            }
        }
        return rewards;
    }

    /**
     * @dev Finds the accrued rewards for a period relative to {periodDenominator}
     * @param period - Period of time, i.e 12 [days/months/...]
     * @return Rewards
     */
    function _accruedRewards(uint256 period) private view returns (uint256) {
        return
            Math.min(bonusIntervals[0], period) *
            periodEmissions[0] +
            Math.min(
                bonusIntervals[0] > period ? 0 : period - bonusIntervals[0],
                bonusIntervals[0]
            ) *
            periodEmissions[1] +
            (bonusIntervals[1] > period ? 0 : period - bonusIntervals[1]) *
            periodEmissions[2];
    }

    /**
     * @notice Claim the rewards for the tokens
     * @param tokenIds - Array of token ids
     */
    function claimRewards(uint256[] calldata tokenIds) public {
        uint256 reward;
        uint256[] memory rewards = calculateRewards(msg.sender, tokenIds);
        for (uint256 i; i < tokenIds.length; i++) {
            staked[tokenIds[i]].claimedAt = block.timestamp;
            unchecked {
                reward += rewards[i];
            }
        }

        if (reward > 0) {
            _safeTransferRewards(msg.sender, reward * 1e18);
        }
    }

    /**
     * @notice Deposit tokens into the contract
     * @param tokenIds - Array of token ids to stake
     */
    function deposit(uint256[] calldata tokenIds) public {
        for (uint256 i; i < tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            staked[tokenId].depositedAt = block.timestamp;
            IERC721(erc721Address).safeTransferFrom(
                msg.sender,
                address(this),
                tokenId,
                ""
            );
            _mint(msg.sender, tokenId);
        }
    }

    /**
     * @notice Withdraw tokens from the contract
     * @param tokenIds - Array of token ids to stake
     */
    function withdraw(uint256[] calldata tokenIds) public {
        claimRewards(tokenIds);
        _withdraw(tokenIds);
    }

    /**
     * @notice Withdraw tokens from the contract without any rewards
     * @param tokenIds - Array of token ids to stake
     */
    function emergencyWithdraw(uint256[] calldata tokenIds) public {
        _withdraw(tokenIds);
    }

    /**
     * @dev Withdraw token IDs from the contract
     * @param tokenIds - Array of token ids to stake
     */
    function _withdraw(uint256[] calldata tokenIds) private {
        for (uint256 i; i < tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            if (!_exists(tokenId)) {
                revert TokenNonExistent(tokenId);
            }
            if (ownerOf(tokenId) != msg.sender) {
                revert TokenNonOwner(tokenId);
            }
            _burn(tokenId);
            IERC721(erc721Address).safeTransferFrom(
                address(this),
                msg.sender,
                tokenId,
                ""
            );
        }
    }

    /**
     * @notice Withdraw tokens from the staking contract
     * @param amount - Amount in wei to withdraw
     */
    function withdrawTokens(uint256 amount) external onlyOwner {
        _safeTransferRewards(msg.sender, amount);
    }

    /**
     * @dev Issues tokens only if there is a sufficient balance in the contract
     * @param recipient - receiving address
     * @param amount - amount in wei to transfer
     */
    function _safeTransferRewards(address recipient, uint256 amount) private {
        uint256 balance = IERC20(erc20Address).balanceOf(address(this));
        if (amount <= balance) {
            IERC20(erc20Address).transfer(recipient, amount);
        }
    }

    /**
     * @dev Modify the ERC20 token being emitted
     * @param tokenAddress - address of token to emit
     */
    function setErc20Address(address tokenAddress) external onlyOwner {
        erc20Address = tokenAddress;
    }

    /**
     * @dev Receive ERC721 tokens
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external pure override returns (bytes4) {
        return IERC721Receiver.onERC721Received.selector;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 4 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 5 of 14 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @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 / b + (a % b == 0 ? 0 : 1);
    }
}

File 6 of 14 : UntransferableERC721.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @title UntransferableERC721
 * @author @lozzereth (www.allthingsweb3.com)
 * @notice An NFT implementation that cannot be transfered no matter what
 *         unless minting or burning.
 */
contract UntransferableERC721 is ERC721, Ownable {
    /// @dev Base URI for the underlying token
    string private baseURI;

    /// @dev Thrown when an approval is made while untransferable
    error Unapprovable();

    /// @dev Thrown when making an transfer while untransferable
    error Untransferable();

    constructor(string memory name_, string memory symbol_)
        ERC721(name_, symbol_)
    {}

    /**
     * @dev Prevent token transfer unless burn
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal override(ERC721) {
        if (to != address(0) && from != address(0)) {
            revert Untransferable();
        }
        super._beforeTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Prevent approvals of staked token
     */
    function approve(address, uint256) public virtual override {
        revert Unapprovable();
    }

    /**
     * @dev Prevent approval of staked token
     */
    function setApprovalForAll(address, bool) public virtual override {
        revert Unapprovable();
    }

    /**
     * @notice Set the base URI for the NFT
     */
    function setBaseURI(string memory baseURI_) public virtual onlyOwner {
        baseURI = baseURI_;
    }

    /**
     * @dev Returns the base URI
     */
    function _baseURI() internal view virtual override returns (string memory) {
        return baseURI;
    }
}

File 7 of 14 : 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 8 of 14 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 10 of 14 : 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 11 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 12 of 14 : 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 13 of 14 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 14 of 14 : 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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_erc721Address","type":"address"},{"internalType":"address","name":"_erc20Address","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NonZeroValue","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenNonExistent","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenNonOwner","type":"error"},{"inputs":[],"name":"Unapprovable","type":"error"},{"inputs":[],"name":"Untransferable","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bonusIntervals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"calculateRewards","outputs":[{"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"depositsOf","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erc20Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc721Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"periodEmissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[2]","name":"tokens","type":"uint256[2]"}],"name":"setBonusInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"setErc20Address","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"interval","type":"uint256"}],"name":"setPeriodDenominator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[3]","name":"rates","type":"uint256[3]"}],"name":"setPeriodEmission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"staked","outputs":[{"internalType":"uint256","name":"depositedAt","type":"uint256"},{"internalType":"uint256","name":"claimedAt","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610100604052606460a090815260c860c05261012c60e0526200002790600990600362000234565b5062278d00600c556040805180820190915260038152600660208201526200005490600d9060026200027d565b503480156200006257600080fd5b5060405162002b0c38038062002b0c833981016040819052620000859162000364565b6040805180820182526011815270151a1948141b1859dd594814dd185ad959607a1b6020808301918252835180850190945260058452647346524f4760d81b90840152815191929183918391620000df91600091620002b3565b508051620000f5906001906020840190620002b3565b505050620001126200010c6200016660201b60201c565b6200016a565b50506001600160a01b03828116608052600880546001600160a01b031916918316919091179055604080516060810190915260368082526200015e919062002ad66020830139620001bc565b5050620003d8565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6006546001600160a01b031633146200021b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b805162000230906007906020840190620002b3565b5050565b82600381019282156200026b579160200282015b828111156200026b578251829061ffff1690559160200191906001019062000248565b506200027992915062000330565b5090565b82600281019282156200026b579160200282015b828111156200026b578251829060ff1690559160200191906001019062000291565b828054620002c1906200039c565b90600052602060002090601f016020900481019282620002e557600085556200026b565b82601f106200030057805160ff19168380011785556200026b565b828001600101855582156200026b579182015b828111156200026b57825182559160200191906001019062000313565b5b8082111562000279576000815560010162000331565b80516001600160a01b03811681146200035f57600080fd5b919050565b600080604083850312156200037857600080fd5b620003838362000347565b9150620003936020840162000347565b90509250929050565b600181811c90821680620003b157607f821691505b602082108103620003d257634e487b7160e01b600052602260045260246000fd5b50919050565b6080516126d4620004026000396000818161032001528181610ba5015261197701526126d46000f3fe608060405234801561001057600080fd5b50600436106102415760003560e01c80635eac623911610145578063983d95ce116100bd578063c87b56dd1161008c578063e3a9db1a11610071578063e3a9db1a1461052d578063e985e9c514610540578063f2fde38b1461057c57600080fd5b8063c87b56dd14610507578063d1941b061461051a57600080fd5b8063983d95ce146104c05780639a70c540146104d3578063a22cb465146104e6578063b88d4fde146104f457600080fd5b8063715018a6116101145780638da5cb5b116100f95780638da5cb5b1461049e5780639276760c146104af57806395d89b41146104b857600080fd5b8063715018a61461048357806374e10e3f1461048b57600080fd5b80635eac6239146104375780636352211e1461044a578063709d8f021461045d57806370a082311461047057600080fd5b8063276184ae116101d8578063472c0cac116101a757806355f804b31161018c57806355f804b3146103d5578063598b8e71146103e85780635e1bef32146103fb57600080fd5b8063472c0cac146103af5780634a39fa80146103c257600080fd5b8063276184ae146103555780632764c42714610368578063315a095d1461038957806342842e0e1461039c57600080fd5b8063095ea7b311610214578063095ea7b3146102ce578063150b7a02146102e35780632352a8641461031b57806323b872dd1461034257600080fd5b806301ffc9a714610246578063068c526f1461026e57806306fdde031461028e578063081812fc146102a3575b600080fd5b610259610254366004611f6a565b61058f565b60405190151581526020015b60405180910390f35b61028161027c366004611fea565b6105e1565b60405161026591906120a3565b61029661077f565b604051610265919061213f565b6102b66102b1366004612152565b610811565b6040516001600160a01b039091168152602001610265565b6102e16102dc36600461216b565b6108a6565b005b6103026102f1366004612195565b630a85bd0160e11b95945050505050565b6040516001600160e01b03199091168152602001610265565b6102b67f000000000000000000000000000000000000000000000000000000000000000081565b6102e1610350366004612230565b6108bf565b6008546102b6906001600160a01b031681565b61037b610376366004612152565b61094b565b604051908152602001610265565b6102e1610397366004612152565b610962565b6102e16103aa366004612230565b6109c9565b6102e16103bd36600461226c565b6109e4565b6102e16103d0366004612294565b610a4f565b6102e16103e3366004612307565b610acb565b6102e16103f6366004612350565b610b38565b610422610409366004612152565b600f602052600090815260409020805460019091015482565b60408051928352602083019190915201610265565b6102e1610445366004612350565b610c26565b6102b6610458366004612152565b610cff565b61037b61046b366004612152565b610d8a565b61037b61047e366004612294565b610d9a565b6102e1610e34565b6102e1610499366004612152565b610e9a565b6006546001600160a01b03166102b6565b61037b600c5481565b610296610f1a565b6102e16104ce366004612350565b610f29565b6102e16104e13660046123c5565b610f3d565b6102e16102dc3660046123f5565b6102e161050236600461242c565b610fa4565b610296610515366004612152565b61102c565b6102e1610528366004612350565b610f33565b61028161053b366004612294565b611115565b61025961054e3660046124a8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102e161058a366004612294565b6111eb565b60006001600160e01b031982166380ac58cd60e01b14806105c057506001600160e01b03198216635b5e139f60e01b145b806105db57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060815167ffffffffffffffff8111156105fd576105fd611fa3565b604051908082528060200260200182016040528015610626578160200160208202803683370190505b50905060005b8251811015610778576000838281518110610649576106496124db565b60200260200101519050610674816000908152600260205260409020546001600160a01b0316151590565b61069957604051631e97bf7b60e11b8152600481018290526024015b60405180910390fd5b846001600160a01b03166106ac82610cff565b6001600160a01b0316146106d657604051632eda401960e21b815260048101829052602401610690565b600c546000828152600f6020526040812080546001909101549091834284900381610703576107036124f1565b0490506000610711826112ca565b905083831115610740576000858585038161072e5761072e6124f1565b04905061073a816112ca565b82039150505b80888881518110610753576107536124db565b60200260200101818152505050505050505080806107709061251d565b91505061062c565b5092915050565b60606000805461078e90612536565b80601f01602080910402602001604051908101604052809291908181526020018280546107ba90612536565b80156108075780601f106107dc57610100808354040283529160200191610807565b820191906000526020600020905b8154815290600101906020018083116107ea57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661088a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610690565b506000908152600460205260409020546001600160a01b031690565b60405163595162dd60e01b815260040160405180910390fd5b6108c9338261135e565b61093b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610690565b610946838383611455565b505050565b600d816002811061095b57600080fd5b0154905081565b6006546001600160a01b031633146109bc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b6109c63382611614565b50565b61094683838360405180602001604052806000815250610fa4565b6006546001600160a01b03163314610a3e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b610a4b6009826003611e60565b5050565b6006546001600160a01b03163314610aa95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b03163314610b255760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b8051610a4b906007906020840190611e9e565b60005b81811015610946576000838383818110610b5757610b576124db565b602090810292909201356000818152600f909352604080842042905551635c46a7ef60e11b8152336004820152306024820152604481018290526080606482015260848101939093529250507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b88d4fde9060a401600060405180830381600087803b158015610bf157600080fd5b505af1158015610c05573d6000803e3d6000fd5b50505050610c133382611701565b5080610c1e8161251d565b915050610b3b565b600080610c66338585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506105e192505050565b905060005b83811015610cd75742600f6000878785818110610c8a57610c8a6124db565b90506020020135815260200190815260200160002060010181905550818181518110610cb857610cb86124db565b6020026020010151830192508080610ccf9061251d565b915050610c6b565b508115610cf957610cf933610cf484670de0b6b3a764000061256a565b611614565b50505050565b6000818152600260205260408120546001600160a01b0316806105db5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610690565b6009816003811061095b57600080fd5b60006001600160a01b038216610e185760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610690565b506001600160a01b031660009081526003602052604090205490565b6006546001600160a01b03163314610e8e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b610e98600061184f565b565b6006546001600160a01b03163314610ef45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b80600003610f155760405163e320176b60e01b815260040160405180910390fd5b600c55565b60606001805461078e90612536565b610f338282610c26565b610a4b82826118a1565b6006546001600160a01b03163314610f975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b610a4b600d826002611f12565b610fae338361135e565b6110205760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610690565b610cf9848484846119ef565b6000818152600260205260409020546060906001600160a01b03166110b95760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610690565b60006110c3611a78565b905060008151116110e3576040518060200160405280600081525061110e565b806110ed84611a87565b6040516020016110fe929190612589565b6040516020818303038152906040525b9392505050565b606060008061112384610d9a565b905060008167ffffffffffffffff81111561114057611140611fa3565b604051908082528060200260200182016040528015611169578160200160208202803683370190505b50905060005b8284146111e2576000818152600260205260409020546001600160a01b0316156111da57856001600160a01b03166111a682610cff565b6001600160a01b0316036111da57808285806001019650815181106111cd576111cd6124db565b6020026020010181815250505b60010161116f565b50949350505050565b6006546001600160a01b031633146112455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b6001600160a01b0381166112c15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610690565b6109c68161184f565b600b54600e546000919083106112ec57600e546112e790846125b8565b6112ef565b60005b6112f9919061256a565b600a54600d5461132690851061131b57600d5461131690866125b8565b61131e565b60005b600d54611ba0565b611330919061256a565b600954600d546113409086611ba0565b61134a919061256a565b61135491906125cf565b6105db91906125cf565b6000818152600260205260408120546001600160a01b03166113d75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610690565b60006113e283610cff565b9050806001600160a01b0316846001600160a01b0316148061141d5750836001600160a01b031661141284610811565b6001600160a01b0316145b8061144d57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661146882610cff565b6001600160a01b0316146114e45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610690565b6001600160a01b0382166115465760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610690565b611551838383611bb6565b61155c600082611bf4565b6001600160a01b03831660009081526003602052604081208054600192906115859084906125b8565b90915550506001600160a01b03821660009081526003602052604081208054600192906115b39084906125cf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6008546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561165d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168191906125e7565b90508082116109465760085460405163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af11580156116dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf99190612600565b6001600160a01b0382166117575760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610690565b6000818152600260205260409020546001600160a01b0316156117bc5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610690565b6117c860008383611bb6565b6001600160a01b03821660009081526003602052604081208054600192906117f19084906125cf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b818110156109465760008383838181106118c0576118c06124db565b9050602002013590506118ea816000908152600260205260409020546001600160a01b0316151590565b61190a57604051631e97bf7b60e11b815260048101829052602401610690565b3361191482610cff565b6001600160a01b03161461193e57604051632eda401960e21b815260048101829052602401610690565b61194781611c62565b604051635c46a7ef60e11b81523060048201523360248201526044810182905260806064820152600060848201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b88d4fde9060a401600060405180830381600087803b1580156119c357600080fd5b505af11580156119d7573d6000803e3d6000fd5b505050505080806119e79061251d565b9150506118a4565b6119fa848484611455565b611a0684848484611d09565b610cf95760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610690565b60606007805461078e90612536565b606081600003611aae5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611ad85780611ac28161251d565b9150611ad19050600a8361261d565b9150611ab2565b60008167ffffffffffffffff811115611af357611af3611fa3565b6040519080825280601f01601f191660200182016040528015611b1d576020820181803683370190505b5090505b841561144d57611b326001836125b8565b9150611b3f600a86612631565b611b4a9060306125cf565b60f81b818381518110611b5f57611b5f6124db565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611b99600a8661261d565b9450611b21565b6000818310611baf578161110e565b5090919050565b6001600160a01b03821615801590611bd657506001600160a01b03831615155b156109465760405163072b78c760e01b815260040160405180910390fd5b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c2982610cff565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611c6d82610cff565b9050611c7b81600084611bb6565b611c86600083611bf4565b6001600160a01b0381166000908152600360205260408120805460019290611caf9084906125b8565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b15611e5557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611d4d903390899088908890600401612645565b6020604051808303816000875af1925050508015611d88575060408051601f3d908101601f19168201909252611d8591810190612681565b60015b611e3b573d808015611db6576040519150601f19603f3d011682016040523d82523d6000602084013e611dbb565b606091505b508051600003611e335760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610690565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061144d565b506001949350505050565b8260038101928215611e8e579160200282015b82811115611e8e578235825591602001919060010190611e73565b50611e9a929150611f3f565b5090565b828054611eaa90612536565b90600052602060002090601f016020900481019282611ecc5760008555611e8e565b82601f10611ee557805160ff1916838001178555611e8e565b82800160010185558215611e8e579182015b82811115611e8e578251825591602001919060010190611ef7565b8260028101928215611e8e5791602002820182811115611e8e578235825591602001919060010190611e73565b5b80821115611e9a5760008155600101611f40565b6001600160e01b0319811681146109c657600080fd5b600060208284031215611f7c57600080fd5b813561110e81611f54565b80356001600160a01b0381168114611f9e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611fe257611fe2611fa3565b604052919050565b60008060408385031215611ffd57600080fd5b61200683611f87565b915060208084013567ffffffffffffffff8082111561202457600080fd5b818601915086601f83011261203857600080fd5b81358181111561204a5761204a611fa3565b8060051b915061205b848301611fb9565b818152918301840191848101908984111561207557600080fd5b938501935b838510156120935784358252938501939085019061207a565b8096505050505050509250929050565b6020808252825182820181905260009190848201906040850190845b818110156120db578351835292840192918401916001016120bf565b50909695505050505050565b60005b838110156121025781810151838201526020016120ea565b83811115610cf95750506000910152565b6000815180845261212b8160208601602086016120e7565b601f01601f19169290920160200192915050565b60208152600061110e6020830184612113565b60006020828403121561216457600080fd5b5035919050565b6000806040838503121561217e57600080fd5b61218783611f87565b946020939093013593505050565b6000806000806000608086880312156121ad57600080fd5b6121b686611f87565b94506121c460208701611f87565b935060408601359250606086013567ffffffffffffffff808211156121e857600080fd5b818801915088601f8301126121fc57600080fd5b81358181111561220b57600080fd5b89602082850101111561221d57600080fd5b9699959850939650602001949392505050565b60008060006060848603121561224557600080fd5b61224e84611f87565b925061225c60208501611f87565b9150604084013590509250925092565b60006060828403121561227e57600080fd5b8260608301111561228e57600080fd5b50919050565b6000602082840312156122a657600080fd5b61110e82611f87565b600067ffffffffffffffff8311156122c9576122c9611fa3565b6122dc601f8401601f1916602001611fb9565b90508281528383830111156122f057600080fd5b828260208301376000602084830101529392505050565b60006020828403121561231957600080fd5b813567ffffffffffffffff81111561233057600080fd5b8201601f8101841361234157600080fd5b61144d848235602084016122af565b6000806020838503121561236357600080fd5b823567ffffffffffffffff8082111561237b57600080fd5b818501915085601f83011261238f57600080fd5b81358181111561239e57600080fd5b8660208260051b85010111156123b357600080fd5b60209290920196919550909350505050565b6000604082840312156123d757600080fd5b8260408301111561228e57600080fd5b80151581146109c657600080fd5b6000806040838503121561240857600080fd5b61241183611f87565b91506020830135612421816123e7565b809150509250929050565b6000806000806080858703121561244257600080fd5b61244b85611f87565b935061245960208601611f87565b925060408501359150606085013567ffffffffffffffff81111561247c57600080fd5b8501601f8101871361248d57600080fd5b61249c878235602084016122af565b91505092959194509250565b600080604083850312156124bb57600080fd5b6124c483611f87565b91506124d260208401611f87565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161252f5761252f612507565b5060010190565b600181811c9082168061254a57607f821691505b60208210810361228e57634e487b7160e01b600052602260045260246000fd5b600081600019048311821515161561258457612584612507565b500290565b6000835161259b8184602088016120e7565b8351908301906125af8183602088016120e7565b01949350505050565b6000828210156125ca576125ca612507565b500390565b600082198211156125e2576125e2612507565b500190565b6000602082840312156125f957600080fd5b5051919050565b60006020828403121561261257600080fd5b815161110e816123e7565b60008261262c5761262c6124f1565b500490565b600082612640576126406124f1565b500690565b60006001600160a01b038087168352808616602084015250836040830152608060608301526126776080830184612113565b9695505050505050565b60006020828403121561269357600080fd5b815161110e81611f5456fea2646970667358221220a5fdeff54fa5d113abe585b6dd3118a25bd25c225fbdfab685c9dc035cf528a664736f6c634300080d0033697066733a2f2f516d4e79615552666e507459517a4465706545464c44785457644a48585242503337487778794a5576674d536d332f0000000000000000000000008c3fb10693b228e8b976ff33ce88f97ce2ea9563000000000000000000000000726516b20c4692a6bea3900971a37e0ccf7a6bff

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102415760003560e01c80635eac623911610145578063983d95ce116100bd578063c87b56dd1161008c578063e3a9db1a11610071578063e3a9db1a1461052d578063e985e9c514610540578063f2fde38b1461057c57600080fd5b8063c87b56dd14610507578063d1941b061461051a57600080fd5b8063983d95ce146104c05780639a70c540146104d3578063a22cb465146104e6578063b88d4fde146104f457600080fd5b8063715018a6116101145780638da5cb5b116100f95780638da5cb5b1461049e5780639276760c146104af57806395d89b41146104b857600080fd5b8063715018a61461048357806374e10e3f1461048b57600080fd5b80635eac6239146104375780636352211e1461044a578063709d8f021461045d57806370a082311461047057600080fd5b8063276184ae116101d8578063472c0cac116101a757806355f804b31161018c57806355f804b3146103d5578063598b8e71146103e85780635e1bef32146103fb57600080fd5b8063472c0cac146103af5780634a39fa80146103c257600080fd5b8063276184ae146103555780632764c42714610368578063315a095d1461038957806342842e0e1461039c57600080fd5b8063095ea7b311610214578063095ea7b3146102ce578063150b7a02146102e35780632352a8641461031b57806323b872dd1461034257600080fd5b806301ffc9a714610246578063068c526f1461026e57806306fdde031461028e578063081812fc146102a3575b600080fd5b610259610254366004611f6a565b61058f565b60405190151581526020015b60405180910390f35b61028161027c366004611fea565b6105e1565b60405161026591906120a3565b61029661077f565b604051610265919061213f565b6102b66102b1366004612152565b610811565b6040516001600160a01b039091168152602001610265565b6102e16102dc36600461216b565b6108a6565b005b6103026102f1366004612195565b630a85bd0160e11b95945050505050565b6040516001600160e01b03199091168152602001610265565b6102b67f0000000000000000000000008c3fb10693b228e8b976ff33ce88f97ce2ea956381565b6102e1610350366004612230565b6108bf565b6008546102b6906001600160a01b031681565b61037b610376366004612152565b61094b565b604051908152602001610265565b6102e1610397366004612152565b610962565b6102e16103aa366004612230565b6109c9565b6102e16103bd36600461226c565b6109e4565b6102e16103d0366004612294565b610a4f565b6102e16103e3366004612307565b610acb565b6102e16103f6366004612350565b610b38565b610422610409366004612152565b600f602052600090815260409020805460019091015482565b60408051928352602083019190915201610265565b6102e1610445366004612350565b610c26565b6102b6610458366004612152565b610cff565b61037b61046b366004612152565b610d8a565b61037b61047e366004612294565b610d9a565b6102e1610e34565b6102e1610499366004612152565b610e9a565b6006546001600160a01b03166102b6565b61037b600c5481565b610296610f1a565b6102e16104ce366004612350565b610f29565b6102e16104e13660046123c5565b610f3d565b6102e16102dc3660046123f5565b6102e161050236600461242c565b610fa4565b610296610515366004612152565b61102c565b6102e1610528366004612350565b610f33565b61028161053b366004612294565b611115565b61025961054e3660046124a8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102e161058a366004612294565b6111eb565b60006001600160e01b031982166380ac58cd60e01b14806105c057506001600160e01b03198216635b5e139f60e01b145b806105db57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060815167ffffffffffffffff8111156105fd576105fd611fa3565b604051908082528060200260200182016040528015610626578160200160208202803683370190505b50905060005b8251811015610778576000838281518110610649576106496124db565b60200260200101519050610674816000908152600260205260409020546001600160a01b0316151590565b61069957604051631e97bf7b60e11b8152600481018290526024015b60405180910390fd5b846001600160a01b03166106ac82610cff565b6001600160a01b0316146106d657604051632eda401960e21b815260048101829052602401610690565b600c546000828152600f6020526040812080546001909101549091834284900381610703576107036124f1565b0490506000610711826112ca565b905083831115610740576000858585038161072e5761072e6124f1565b04905061073a816112ca565b82039150505b80888881518110610753576107536124db565b60200260200101818152505050505050505080806107709061251d565b91505061062c565b5092915050565b60606000805461078e90612536565b80601f01602080910402602001604051908101604052809291908181526020018280546107ba90612536565b80156108075780601f106107dc57610100808354040283529160200191610807565b820191906000526020600020905b8154815290600101906020018083116107ea57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b031661088a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610690565b506000908152600460205260409020546001600160a01b031690565b60405163595162dd60e01b815260040160405180910390fd5b6108c9338261135e565b61093b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610690565b610946838383611455565b505050565b600d816002811061095b57600080fd5b0154905081565b6006546001600160a01b031633146109bc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b6109c63382611614565b50565b61094683838360405180602001604052806000815250610fa4565b6006546001600160a01b03163314610a3e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b610a4b6009826003611e60565b5050565b6006546001600160a01b03163314610aa95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b03163314610b255760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b8051610a4b906007906020840190611e9e565b60005b81811015610946576000838383818110610b5757610b576124db565b602090810292909201356000818152600f909352604080842042905551635c46a7ef60e11b8152336004820152306024820152604481018290526080606482015260848101939093529250507f0000000000000000000000008c3fb10693b228e8b976ff33ce88f97ce2ea95636001600160a01b03169063b88d4fde9060a401600060405180830381600087803b158015610bf157600080fd5b505af1158015610c05573d6000803e3d6000fd5b50505050610c133382611701565b5080610c1e8161251d565b915050610b3b565b600080610c66338585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506105e192505050565b905060005b83811015610cd75742600f6000878785818110610c8a57610c8a6124db565b90506020020135815260200190815260200160002060010181905550818181518110610cb857610cb86124db565b6020026020010151830192508080610ccf9061251d565b915050610c6b565b508115610cf957610cf933610cf484670de0b6b3a764000061256a565b611614565b50505050565b6000818152600260205260408120546001600160a01b0316806105db5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610690565b6009816003811061095b57600080fd5b60006001600160a01b038216610e185760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610690565b506001600160a01b031660009081526003602052604090205490565b6006546001600160a01b03163314610e8e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b610e98600061184f565b565b6006546001600160a01b03163314610ef45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b80600003610f155760405163e320176b60e01b815260040160405180910390fd5b600c55565b60606001805461078e90612536565b610f338282610c26565b610a4b82826118a1565b6006546001600160a01b03163314610f975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b610a4b600d826002611f12565b610fae338361135e565b6110205760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610690565b610cf9848484846119ef565b6000818152600260205260409020546060906001600160a01b03166110b95760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610690565b60006110c3611a78565b905060008151116110e3576040518060200160405280600081525061110e565b806110ed84611a87565b6040516020016110fe929190612589565b6040516020818303038152906040525b9392505050565b606060008061112384610d9a565b905060008167ffffffffffffffff81111561114057611140611fa3565b604051908082528060200260200182016040528015611169578160200160208202803683370190505b50905060005b8284146111e2576000818152600260205260409020546001600160a01b0316156111da57856001600160a01b03166111a682610cff565b6001600160a01b0316036111da57808285806001019650815181106111cd576111cd6124db565b6020026020010181815250505b60010161116f565b50949350505050565b6006546001600160a01b031633146112455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610690565b6001600160a01b0381166112c15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610690565b6109c68161184f565b600b54600e546000919083106112ec57600e546112e790846125b8565b6112ef565b60005b6112f9919061256a565b600a54600d5461132690851061131b57600d5461131690866125b8565b61131e565b60005b600d54611ba0565b611330919061256a565b600954600d546113409086611ba0565b61134a919061256a565b61135491906125cf565b6105db91906125cf565b6000818152600260205260408120546001600160a01b03166113d75760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610690565b60006113e283610cff565b9050806001600160a01b0316846001600160a01b0316148061141d5750836001600160a01b031661141284610811565b6001600160a01b0316145b8061144d57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661146882610cff565b6001600160a01b0316146114e45760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610690565b6001600160a01b0382166115465760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610690565b611551838383611bb6565b61155c600082611bf4565b6001600160a01b03831660009081526003602052604081208054600192906115859084906125b8565b90915550506001600160a01b03821660009081526003602052604081208054600192906115b39084906125cf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6008546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561165d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168191906125e7565b90508082116109465760085460405163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af11580156116dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf99190612600565b6001600160a01b0382166117575760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610690565b6000818152600260205260409020546001600160a01b0316156117bc5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610690565b6117c860008383611bb6565b6001600160a01b03821660009081526003602052604081208054600192906117f19084906125cf565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b818110156109465760008383838181106118c0576118c06124db565b9050602002013590506118ea816000908152600260205260409020546001600160a01b0316151590565b61190a57604051631e97bf7b60e11b815260048101829052602401610690565b3361191482610cff565b6001600160a01b03161461193e57604051632eda401960e21b815260048101829052602401610690565b61194781611c62565b604051635c46a7ef60e11b81523060048201523360248201526044810182905260806064820152600060848201527f0000000000000000000000008c3fb10693b228e8b976ff33ce88f97ce2ea95636001600160a01b03169063b88d4fde9060a401600060405180830381600087803b1580156119c357600080fd5b505af11580156119d7573d6000803e3d6000fd5b505050505080806119e79061251d565b9150506118a4565b6119fa848484611455565b611a0684848484611d09565b610cf95760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610690565b60606007805461078e90612536565b606081600003611aae5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611ad85780611ac28161251d565b9150611ad19050600a8361261d565b9150611ab2565b60008167ffffffffffffffff811115611af357611af3611fa3565b6040519080825280601f01601f191660200182016040528015611b1d576020820181803683370190505b5090505b841561144d57611b326001836125b8565b9150611b3f600a86612631565b611b4a9060306125cf565b60f81b818381518110611b5f57611b5f6124db565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611b99600a8661261d565b9450611b21565b6000818310611baf578161110e565b5090919050565b6001600160a01b03821615801590611bd657506001600160a01b03831615155b156109465760405163072b78c760e01b815260040160405180910390fd5b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c2982610cff565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611c6d82610cff565b9050611c7b81600084611bb6565b611c86600083611bf4565b6001600160a01b0381166000908152600360205260408120805460019290611caf9084906125b8565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b15611e5557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611d4d903390899088908890600401612645565b6020604051808303816000875af1925050508015611d88575060408051601f3d908101601f19168201909252611d8591810190612681565b60015b611e3b573d808015611db6576040519150601f19603f3d011682016040523d82523d6000602084013e611dbb565b606091505b508051600003611e335760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610690565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061144d565b506001949350505050565b8260038101928215611e8e579160200282015b82811115611e8e578235825591602001919060010190611e73565b50611e9a929150611f3f565b5090565b828054611eaa90612536565b90600052602060002090601f016020900481019282611ecc5760008555611e8e565b82601f10611ee557805160ff1916838001178555611e8e565b82800160010185558215611e8e579182015b82811115611e8e578251825591602001919060010190611ef7565b8260028101928215611e8e5791602002820182811115611e8e578235825591602001919060010190611e73565b5b80821115611e9a5760008155600101611f40565b6001600160e01b0319811681146109c657600080fd5b600060208284031215611f7c57600080fd5b813561110e81611f54565b80356001600160a01b0381168114611f9e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611fe257611fe2611fa3565b604052919050565b60008060408385031215611ffd57600080fd5b61200683611f87565b915060208084013567ffffffffffffffff8082111561202457600080fd5b818601915086601f83011261203857600080fd5b81358181111561204a5761204a611fa3565b8060051b915061205b848301611fb9565b818152918301840191848101908984111561207557600080fd5b938501935b838510156120935784358252938501939085019061207a565b8096505050505050509250929050565b6020808252825182820181905260009190848201906040850190845b818110156120db578351835292840192918401916001016120bf565b50909695505050505050565b60005b838110156121025781810151838201526020016120ea565b83811115610cf95750506000910152565b6000815180845261212b8160208601602086016120e7565b601f01601f19169290920160200192915050565b60208152600061110e6020830184612113565b60006020828403121561216457600080fd5b5035919050565b6000806040838503121561217e57600080fd5b61218783611f87565b946020939093013593505050565b6000806000806000608086880312156121ad57600080fd5b6121b686611f87565b94506121c460208701611f87565b935060408601359250606086013567ffffffffffffffff808211156121e857600080fd5b818801915088601f8301126121fc57600080fd5b81358181111561220b57600080fd5b89602082850101111561221d57600080fd5b9699959850939650602001949392505050565b60008060006060848603121561224557600080fd5b61224e84611f87565b925061225c60208501611f87565b9150604084013590509250925092565b60006060828403121561227e57600080fd5b8260608301111561228e57600080fd5b50919050565b6000602082840312156122a657600080fd5b61110e82611f87565b600067ffffffffffffffff8311156122c9576122c9611fa3565b6122dc601f8401601f1916602001611fb9565b90508281528383830111156122f057600080fd5b828260208301376000602084830101529392505050565b60006020828403121561231957600080fd5b813567ffffffffffffffff81111561233057600080fd5b8201601f8101841361234157600080fd5b61144d848235602084016122af565b6000806020838503121561236357600080fd5b823567ffffffffffffffff8082111561237b57600080fd5b818501915085601f83011261238f57600080fd5b81358181111561239e57600080fd5b8660208260051b85010111156123b357600080fd5b60209290920196919550909350505050565b6000604082840312156123d757600080fd5b8260408301111561228e57600080fd5b80151581146109c657600080fd5b6000806040838503121561240857600080fd5b61241183611f87565b91506020830135612421816123e7565b809150509250929050565b6000806000806080858703121561244257600080fd5b61244b85611f87565b935061245960208601611f87565b925060408501359150606085013567ffffffffffffffff81111561247c57600080fd5b8501601f8101871361248d57600080fd5b61249c878235602084016122af565b91505092959194509250565b600080604083850312156124bb57600080fd5b6124c483611f87565b91506124d260208401611f87565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161252f5761252f612507565b5060010190565b600181811c9082168061254a57607f821691505b60208210810361228e57634e487b7160e01b600052602260045260246000fd5b600081600019048311821515161561258457612584612507565b500290565b6000835161259b8184602088016120e7565b8351908301906125af8183602088016120e7565b01949350505050565b6000828210156125ca576125ca612507565b500390565b600082198211156125e2576125e2612507565b500190565b6000602082840312156125f957600080fd5b5051919050565b60006020828403121561261257600080fd5b815161110e816123e7565b60008261262c5761262c6124f1565b500490565b600082612640576126406124f1565b500690565b60006001600160a01b038087168352808616602084015250836040830152608060608301526126776080830184612113565b9695505050505050565b60006020828403121561269357600080fd5b815161110e81611f5456fea2646970667358221220a5fdeff54fa5d113abe585b6dd3118a25bd25c225fbdfab685c9dc035cf528a664736f6c634300080d0033

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

0000000000000000000000008c3fb10693b228e8b976ff33ce88f97ce2ea9563000000000000000000000000726516b20c4692a6bea3900971a37e0ccf7a6bff

-----Decoded View---------------
Arg [0] : _erc721Address (address): 0x8c3FB10693B228E8b976FF33cE88f97Ce2EA9563
Arg [1] : _erc20Address (address): 0x726516B20c4692a6beA3900971a37e0cCf7A6BFf

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008c3fb10693b228e8b976ff33ce88f97ce2ea9563
Arg [1] : 000000000000000000000000726516b20c4692a6bea3900971a37e0ccf7a6bff


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.