ETH Price: $3,353.79 (-2.38%)

Contract

0x27896C00Ff4eBBE150EC29439ad9dB5b46dD8350
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Exchange NFT For...212530172024-11-23 21:06:473 days ago1732396007IN
TheMonkeVault
0 ETH0.0016825212.02505268
Exchange NFT For...212530132024-11-23 21:05:473 days ago1732395947IN
TheMonkeVault
0 ETH0.0015247510.89279842
Exchange NFT For...211981082024-11-16 5:16:5910 days ago1731734219IN
TheMonkeVault
0 ETH0.0022249214.14597446
Exchange NFT For...210158842024-10-21 18:55:3536 days ago1729536935IN
TheMonkeVault
0 ETH0.001425489.8320618
Exchange NFT For...210158822024-10-21 18:55:1136 days ago1729536911IN
TheMonkeVault
0 ETH0.001335589.21201117
Exchange ERC20Fo...209958332024-10-18 23:48:1139 days ago1729295291IN
TheMonkeVault
0 ETH0.001858278.59706402
Exchange ERC20Fo...208832432024-10-03 6:37:5954 days ago1727937479IN
TheMonkeVault
0 ETH0.001151865.71062477
Exchange ERC20Fo...208828002024-10-03 5:08:4754 days ago1727932127IN
TheMonkeVault
0 ETH0.000749813.56219877
Exchange NFT For...208827932024-10-03 5:07:2354 days ago1727932043IN
TheMonkeVault
0 ETH0.00055153.80393509
Exchange ERC20Fo...208827852024-10-03 5:05:4754 days ago1727931947IN
TheMonkeVault
0 ETH0.000707483.6900712
Exchange NFT For...208827792024-10-03 5:04:3554 days ago1727931875IN
TheMonkeVault
0 ETH0.000601064.14576333
Exchange ERC20Fo...208779772024-10-02 13:00:5955 days ago1727874059IN
TheMonkeVault
0 ETH0.0026492612.8476562
Exchange ERC20Fo...208778412024-10-02 12:33:1155 days ago1727872391IN
TheMonkeVault
0 ETH0.001793159.58877084
Exchange ERC20Fo...208759382024-10-02 6:11:5955 days ago1727849519IN
TheMonkeVault
0 ETH0.00122916.49198699
Exchange ERC20Fo...208759242024-10-02 6:09:1155 days ago1727849351IN
TheMonkeVault
0 ETH0.000952775.63073575
Exchange ERC20Fo...208389142024-09-27 2:16:5961 days ago1727403419IN
TheMonkeVault
0 ETH0.0021241210.94195319
Exchange ERC20Fo...208388852024-09-27 2:11:1161 days ago1727403071IN
TheMonkeVault
0 ETH0.001603511.86617828
Exchange ERC20Fo...208388332024-09-27 2:00:4761 days ago1727402447IN
TheMonkeVault
0 ETH0.0026107513.12115112
Exchange ERC20Fo...208087792024-09-22 21:22:5965 days ago1727040179IN
TheMonkeVault
0 ETH0.001600947.17894001
Exchange ERC20Fo...208083622024-09-22 19:59:1165 days ago1727035151IN
TheMonkeVault
0 ETH0.002117888.9501848
Exchange NFT For...207819092024-09-19 3:19:2369 days ago1726715963IN
TheMonkeVault
0 ETH0.0027478118.05186524
Exchange NFT For...207804712024-09-18 22:30:2369 days ago1726698623IN
TheMonkeVault
0 ETH0.0019997712.73111397
Exchange ERC20Fo...207747982024-09-18 3:28:1169 days ago1726630091IN
TheMonkeVault
0 ETH0.00133727.24805275
Exchange ERC20Fo...207678472024-09-17 4:07:5970 days ago1726546079IN
TheMonkeVault
0 ETH0.000695124.41117332
Exchange ERC20Fo...207677622024-09-17 3:50:5970 days ago1726545059IN
TheMonkeVault
0 ETH0.000741174.93173615
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
204132732024-07-29 15:59:35120 days ago1722268775
TheMonkeVault
0.02 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NFTExchange

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 10000 runs

Other Settings:
paris EvmVersion, MIT license
File 1 of 11 : NFTExchange.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "erc721a/contracts/interfaces/IERC721AQueryable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external returns (bytes4);
}

contract NFTExchange is ReentrancyGuard, Ownable, IERC721Receiver {
    IERC721AQueryable public nft;
    IERC20 public token;

    enum Rarity {
        // Token IDs: 1200-1999 (800 total)
        Common,
        // Token IDs: 550-1199 (650 total)
        Rare,
        // Token IDs: 100-549 (450 total)
        Epic,
        // Token IDs: 0-99 (100 total)
        Legendary
    }

    uint256 constant public legendaryTokenIdStart = 0;
    uint256 constant public epicTokenIdStart = 100;
    uint256 constant public rareTokenIdStart = 550;
    uint256 constant public commonTokenIdStart = 1200;

    mapping(Rarity => uint256[]) internal availableNftsByRarity;
    mapping(Rarity => uint256) internal availableNftsCountByRarity;
    Rarity[] internal availableRarities;

    address public feesRecipient;

    // Fee structure based on rarity (in Ether)
    mapping(Rarity => uint256) public rarityExchangeFees;

    // Price for exchanging ERC20 to NFT
    uint256 public nftPrice = 3_450_000_000 * 10 ** 18;

    // Fee for exchanging ERC20 to NFT. It should discourage "fishing" for rare NFTs instead of using the exchangeNFT function.
    uint256 public exchangeFee = 250_000_000 * 10 ** 18;

    // Fee for exchanging to the same or lower tier
    uint256 public feeSameLower = 0.02 ether;

    bool public initialized = false;

    event NFTForNFT(
        uint256 indexed tokenIdGiven,
        uint256 indexed tokenIdReceived,
        address indexed exchanger
    );
    event NFTForERC20(uint256 indexed tokenId, address indexed exchanger);
    event ERC20ForNFT(uint256 indexed tokenId, address indexed exchanger);

    /// ------------------------
    /// ---- INITIALIZATION ----
    /// ------------------------

    constructor(address _feesRecipient, address _tokenAddress) Ownable(msg.sender) {
        token = IERC20(_tokenAddress);

        feesRecipient = _feesRecipient;

        // Initialize fees for each rarity tier (in Ether)
        rarityExchangeFees[Rarity.Common] = 0.02 ether;
        rarityExchangeFees[Rarity.Rare] = 0.1 ether;
        rarityExchangeFees[Rarity.Epic] = 0.3 ether;
        rarityExchangeFees[Rarity.Legendary] = 0.6 ether;
    }

    function setNFTAddress(address nftAddress) external onlyOwner {
        require(!initialized, "NFT Exchange already initialized");
        require(address(nftAddress) != address(0), "NFT address cannot be zero address");
        nft = IERC721AQueryable(nftAddress);
    }

    function initializeNftsOfRarity(Rarity rarity, uint256 start, uint256 stop) external onlyOwner {
        require(!initialized, "NFT Exchange already initialized");
        require(address(nft) != address(0), "NFT address not set");

        uint256[] memory nfts = nft.tokensOfOwnerIn(address(this), start, stop);

        availableNftsByRarity[rarity] = nfts;
        availableNftsCountByRarity[rarity] = nfts.length;

        addRarity(rarity);

        if (availableRarities.length == 4) {
            initialized = true;
        }
    }

    /// -----------------
    /// ---- HELPERS ----
    /// -----------------

    function getFullNftPrice() public view returns (uint256) {
        return nftPrice + exchangeFee;
    }

    function getTotalAvailableNfts() public view returns (uint256) {
        return availableNftsCountByRarity[Rarity.Legendary] + availableNftsCountByRarity[Rarity.Epic] + availableNftsCountByRarity[Rarity.Rare] + availableNftsCountByRarity[Rarity.Common];
    }

    function getRarity(uint256 tokenId) public view returns (Rarity) {
        if (tokenId >= legendaryTokenIdStart && tokenId < epicTokenIdStart) {
            return Rarity.Legendary;
        } else if (tokenId >= epicTokenIdStart && tokenId < rareTokenIdStart) {
            return Rarity.Epic;
        } else if (tokenId >= rareTokenIdStart && tokenId < commonTokenIdStart) {
            return Rarity.Rare;
        } else if (tokenId >= commonTokenIdStart && tokenId < nft.totalSupply()) {
            return Rarity.Common;
        } else {
            revert("Invalid tokenId");
        }
    }

    function calculateExchangeFee(Rarity currentRarity, Rarity targetRarity) public view returns (uint256) {
        if (targetRarity <= currentRarity) {
            return feeSameLower;
        } else if (targetRarity == Rarity.Rare) {
            return rarityExchangeFees[Rarity.Rare];
        } else if (targetRarity == Rarity.Epic) {
            return rarityExchangeFees[Rarity.Epic];
        } else if (targetRarity == Rarity.Legendary) {
            return rarityExchangeFees[Rarity.Legendary];
        } else {
            // Handle the case when targetRarity is not recognized (e.g., invalid input)
            revert("Invalid target rarity");
        }
    }

    // Removes a selected rarity from the `availableRarities` array while maintaining correct order
    function removeRarity(Rarity _rarity) internal {
        uint256 length = availableRarities.length;
        uint256 index = length;
        bool found = false;

        for (uint256 i = 0; i < length; i++) {
            if (availableRarities[i] == _rarity) {
                index = i;
                found = true;
                break;
            }
        }

        require(found, "Rarity does not exist");

        for (uint256 j = index; j < length - 1; j++) {
            availableRarities[j] = availableRarities[j + 1];
        }
        availableRarities.pop();
    }

    // Adds a selected rarity to the `availableRarities` array while maintaining correct order
    function addRarity(Rarity _rarity) internal {
        uint256 length = availableRarities.length;
        uint256 index = length;

        for (uint256 i = 0; i < length; i++) {
            require(availableRarities[i] != _rarity, "Rarity already exists");

            if (uint256(availableRarities[i]) > uint256(_rarity)) {
                index = i;
                break;
            }
        }

        availableRarities.push();  // Increase the array length by 1

        for (uint256 j = length; j > index; j--) {
            availableRarities[j] = availableRarities[j - 1];
        }
        availableRarities[index] = _rarity;
    }

    // Pseudo-random number generator - should be sufficient based on that the number of NFTs in the pool is limited
    function random() internal view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty, msg.sender)));
    }

    function removeNftFromAvailableNftsByRarityArray(Rarity rarity, uint256 index) internal {
        uint256 arrayLength = availableNftsCountByRarity[rarity];
        require(index < arrayLength);

        // If there is only one NFT left, it means the last NFT was already exchanged
        // and we can safely remove the rarity from the available rarities array
        if (arrayLength == 1) {
            removeRarity(rarity);
        }

        availableNftsByRarity[rarity][index] = availableNftsByRarity[rarity][arrayLength-1];
        availableNftsByRarity[rarity].pop();
        availableNftsCountByRarity[rarity]--;
    }

    function getRarityAndParsedIndexOfRandomNftIndex(uint256 randomIndex) internal view returns (Rarity, uint256) {
        uint256 legendaryNfts = availableNftsCountByRarity[Rarity.Legendary];
        uint256 epicNfts = availableNftsCountByRarity[Rarity.Epic];
        uint256 rareNfts = availableNftsCountByRarity[Rarity.Rare];

        if (randomIndex < legendaryNfts) {
            return (Rarity.Legendary, randomIndex);
        } else if (randomIndex < legendaryNfts + epicNfts) {
            return (Rarity.Epic, randomIndex - legendaryNfts);
        } else if (randomIndex < legendaryNfts + epicNfts + rareNfts) {
            return (Rarity.Rare, randomIndex - legendaryNfts - epicNfts);
        } else {
            return (Rarity.Common, randomIndex - legendaryNfts - epicNfts - rareNfts);
        }
    }

    function getRandomNftTokenId() internal returns (uint256) {
        uint256 availableNfts = getTotalAvailableNfts();
        require(availableNfts > 0, "No NFTs available for exchange");

        uint256 randomNftIndex = random() % availableNfts;
        (Rarity rarity, uint256 parsedRandomNftIndex) = getRarityAndParsedIndexOfRandomNftIndex(randomNftIndex);

        return getTokenIdFromIndex(rarity, parsedRandomNftIndex);
    }

    function getRandomNftTokenIdOfRarity(Rarity rarity) internal returns (uint256) {
        uint256 availableNfts = availableNftsCountByRarity[rarity];
        require(availableNfts > 0, "No NFTs of given rarity available for exchange");

        uint256 randomNftIndex = random() % availableNfts;

        return getTokenIdFromIndex(rarity, randomNftIndex);
    }

    function getTokenIdFromIndex(Rarity rarity, uint256 randomNftIndex) internal returns (uint256) {
        uint256 tokenId = availableNftsByRarity[rarity][randomNftIndex];

        removeNftFromAvailableNftsByRarityArray(rarity, randomNftIndex);

        return tokenId;
    }

    /// ------------------------
    /// ---- CORE FUNCTIONS ----
    /// ------------------------

    modifier onlyEOA() {
        require(msg.sender == tx.origin, "No contracts");
        _;
    }

    // Exchange ERC20 for a random ERC721
    function exchangeERC20ForNFT() external onlyEOA nonReentrant {
        require(initialized, "NFT Exchange not initialized");

        require(availableRarities.length > 0, "No NFTs available for exchange");

        // Ensure that the sender has approved the contract to spend the ERC20 tokens
        require(token.allowance(msg.sender, address(this)) >= getFullNftPrice(), "Not enough allowance for exchange");

        uint256 tokenId = getRandomNftTokenId();

        token.transferFrom(msg.sender, feesRecipient, exchangeFee);
        token.transferFrom(msg.sender, address(this), nftPrice);

        require(nft.ownerOf(tokenId) == address(this), "NFT not owned by contract");
        nft.safeTransferFrom(address(this), msg.sender, tokenId);

        emit ERC20ForNFT(tokenId, msg.sender);
    }

    // Exchange ERC721 for ERC20
    function exchangeNFTForERC20(uint256 tokenId) external onlyEOA nonReentrant {
        require(initialized, "NFT Exchange not initialized");

        require(nft.ownerOf(tokenId) == msg.sender, "You do not own this NFT");

        require(token.balanceOf(address(this)) >= nftPrice, "Not enough ERC20 tokens in the contract");

        nft.safeTransferFrom(msg.sender, address(this), tokenId);

        token.transfer(feesRecipient, exchangeFee);
        token.transfer(msg.sender, nftPrice - exchangeFee);

        emit NFTForERC20(tokenId, msg.sender);
    }

    // NFT for NFT exchange function with rarity consideration
    function exchangeNFT(uint256 tokenId, Rarity targetRarity) external payable onlyEOA nonReentrant {
        require(initialized, "NFT Exchange not initialized");

        require(nft.ownerOf(tokenId) == msg.sender, "You do not own this NFT");

        Rarity currentRarity = getRarity(tokenId);

        // Calculate fee based on target rarity
        uint256 exchangeFeeRarity = calculateExchangeFee(currentRarity, targetRarity);
        require(msg.value >= exchangeFeeRarity, "Insufficient Ether sent for fee");

        require(availableNftsByRarity[targetRarity].length > 0, "No NFTs available for exchange in target rarity");

        // Get a random NFT of the target rarity
        uint256 newTokenId = getRandomNftTokenIdOfRarity(targetRarity);

        // Transfer the NFT to the contract
        nft.safeTransferFrom(msg.sender, address(this), tokenId);

        // Transfer the new NFT to the msg.sender
        nft.safeTransferFrom(address(this), msg.sender, newTokenId);

        payable(feesRecipient).transfer(exchangeFeeRarity);

        // Refund excess Ether back to the sender
        if (msg.value > exchangeFeeRarity) {
            msg.sender.call{value: msg.value - exchangeFeeRarity}("");
        }

        emit NFTForNFT(tokenId, newTokenId, msg.sender);
    }

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

    // Function to set exchange mint fee
    function updateNftPrice(uint256 newNftPrice) external onlyOwner {
        nftPrice = newNftPrice;
    }

    // Function to set exchange mint fee
    function updateExchangeFee(uint256 newExchangeFee) external onlyOwner {
        exchangeFee = newExchangeFee;
    }

    // Function to update the fixed fee amount for same and lower rarity exchanges
    function updateFeeSameLower(uint256 newFee) external onlyOwner {
        feeSameLower = newFee;
    }

    // Function to update the fee for a specific rarity
    function updateFeeForRarity(Rarity rarity, uint256 newFee) external onlyOwner {
        require(rarity >= Rarity.Common && rarity <= Rarity.Legendary, "Invalid rarity");
        rarityExchangeFees[rarity] = newFee;
    }

    // Function to update the fee receiver
    function updateFeeReceiver(address newFeeReceiver) external onlyOwner {
        feesRecipient = newFeeReceiver;
    }

    // Withdraw any ERC20 token
    function withdrawERC20(address _tokenAddress) external onlyOwner {
        require(_tokenAddress != address(token), "Cannot withdraw the main ERC-20 token");

        uint256 balance = IERC20(_tokenAddress).balanceOf(address(this));
        IERC20(_tokenAddress).transfer(owner(), balance);
    }

    // Function to withdraw a specific ERC721 token
    function withdrawNFT(address _nftAddress, uint256 _tokenId) external onlyOwner {
        bool isIndexedNft = false;

        // Check if the NFT is indexed. If it's not, then it means that this NFT is "stuck" in the contract
        // and can be withdrawn by the owner without bricking the contract
        if (_nftAddress == address(nft)) {
            Rarity rarity = getRarity(_tokenId);
            for(uint256 i = 0; i < availableNftsByRarity[rarity].length; i++) {
                if (availableNftsByRarity[rarity][i] == _tokenId) {
                    isIndexedNft = true;
                    break;
                }
            }
        }

        if (isIndexedNft) {
            require(_nftAddress != address(nft), "Cannot withdraw the main NFT");
        }

        // Ensure that the contract owns the token
        require(IERC721(_nftAddress).ownerOf(_tokenId) == address(this), "Contract does not own this token");

        // Transfer the NFT token to the owner
        IERC721(_nftAddress).transferFrom(address(this), owner(), _tokenId);
    }

    /// ------------------------
    /// ------ RECEIVERS -------
    /// ------------------------

    function onERC721Received(
        address,
        address,
        uint256 tokenId,
        bytes calldata
    ) external override returns (bytes4) {
        Rarity rarity = getRarity(tokenId);

        if (availableNftsCountByRarity[rarity] == 0) {
            addRarity(rarity);
        }

        availableNftsByRarity[rarity].push(tokenId);
        availableNftsCountByRarity[rarity]++;

        // Return the function selector to confirm the transfer
        return this.onERC721Received.selector;
    }
}

File 2 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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 3 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

File 4 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 11 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.20;

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

File 6 of 11 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 7 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 8 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @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 9 of 11 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    /**
     * `_sequentialUpTo()` must be greater than `_startTokenId()`.
     */
    error SequentialUpToTooSmall();

    /**
     * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.
     */
    error SequentialMintExceedsLimit();

    /**
     * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.
     */
    error SpotMintTokenIdTooSmall();

    /**
     * Cannot mint over a token that already exists.
     */
    error TokenAlreadyExists();

    /**
     * The feature is not compatible with spot mints.
     */
    error NotCompatibleWithSpotMints();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @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,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` 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 payable;

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

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

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

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

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

File 10 of 11 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of ERC721AQueryable.
 */
interface IERC721AQueryable is IERC721A {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory);
}

File 11 of 11 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../extensions/IERC721AQueryable.sol';

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_feesRecipient","type":"address"},{"internalType":"address","name":"_tokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"exchanger","type":"address"}],"name":"ERC20ForNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"exchanger","type":"address"}],"name":"NFTForERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenIdGiven","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenIdReceived","type":"uint256"},{"indexed":true,"internalType":"address","name":"exchanger","type":"address"}],"name":"NFTForNFT","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"},{"inputs":[{"internalType":"enum NFTExchange.Rarity","name":"currentRarity","type":"uint8"},{"internalType":"enum NFTExchange.Rarity","name":"targetRarity","type":"uint8"}],"name":"calculateExchangeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"commonTokenIdStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epicTokenIdStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeERC20ForNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchangeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum NFTExchange.Rarity","name":"targetRarity","type":"uint8"}],"name":"exchangeNFT","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exchangeNFTForERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeSameLower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feesRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFullNftPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRarity","outputs":[{"internalType":"enum NFTExchange.Rarity","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalAvailableNfts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum NFTExchange.Rarity","name":"rarity","type":"uint8"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"initializeNftsOfRarity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"legendaryTokenIdStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"contract IERC721AQueryable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rareTokenIdStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum NFTExchange.Rarity","name":"","type":"uint8"}],"name":"rarityExchangeFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftAddress","type":"address"}],"name":"setNFTAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newExchangeFee","type":"uint256"}],"name":"updateExchangeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum NFTExchange.Rarity","name":"rarity","type":"uint8"},{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"updateFeeForRarity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFeeReceiver","type":"address"}],"name":"updateFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"updateFeeSameLower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newNftPrice","type":"uint256"}],"name":"updateNftPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"withdrawNFT","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526b0b25c5eac0f5ba6bba0000006009556acecb8f27f4200f3a000000600a5566470de4df820000600b55600c805460ff191690553480156200004557600080fd5b506040516200356d3803806200356d8339810160408190526200006891620001f6565b600160005533806200009457604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200009f8162000187565b50600380546001600160a01b039283166001600160a01b031991821617825560078054949093169316929092179055600860205266470de4df8200007f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c75567016345785d8a00007fad67d757c34507f157cacfa2e3153e9f260a2244f30428821be7be64587ac55f55670429d069189e00007f6add646517a5b0f6793cd5891b7937d28a5b2981a5d88ebc7cd776088fea904155600052670853a0d2313c00007f625b35f5e76f098dd7c3a05b10e2e5e78a4a01228d60c3b143426cdf36d26455556200022e565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b0381168114620001f157600080fd5b919050565b600080604083850312156200020a57600080fd5b6200021583620001d9565b91506200022560208401620001d9565b90509250929050565b61332f806200023e6000396000f3fe6080604052600436106101e35760003560e01c80638b46805511610102578063c69bebe411610095578063ddad8a6a11610064578063ddad8a6a1461059b578063f2fde38b146105bb578063f4f3b200146105db578063fc0c546a146105fb57600080fd5b8063c69bebe414610531578063cbcb384714610551578063cd5d696a14610571578063d1c853fa1461058657600080fd5b8063aded1a81116100d1578063aded1a81146104bb578063bb8943cb146104db578063c22d1509146104f1578063c62709cb1461051157600080fd5b80638b4680551461042e5780638da5cb5b1461045b5780639b9cf7de14610486578063a32bfbbd146104a657600080fd5b80635050bcd81161017a578063621fb2ea11610149578063621fb2ea146103b657806369d03738146103cc578063702acfa8146103ec578063715018a61461041957600080fd5b80635050bcd81461034c578063578d9eb8146103635780635a0b33b1146103765780636088e93a1461039657600080fd5b80632ecd3be4116101b65780632ecd3be4146102a25780634353f806146102b857806347ccca02146102cd578063487586971461031f57600080fd5b80630d39fc81146101e8578063141fe0f814610211578063150b7a0214610227578063158ef93e14610278575b600080fd5b3480156101f457600080fd5b506101fe60095481565b6040519081526020015b60405180910390f35b34801561021d57600080fd5b506101fe600b5481565b34801561023357600080fd5b50610247610242366004612dfb565b610628565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610208565b34801561028457600080fd5b50600c546102929060ff1681565b6040519015158152602001610208565b3480156102ae57600080fd5b506101fe600a5481565b3480156102c457600080fd5b506101fe610740565b3480156102d957600080fd5b506002546102fa9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610208565b34801561032b57600080fd5b5061033f61033a366004612e9a565b610757565b6040516102089190612ee2565b34801561035857600080fd5b506103616108a9565b005b610361610371366004612f32565b610dd1565b34801561038257600080fd5b50610361610391366004612f5e565b611294565b3480156103a257600080fd5b506103616103b1366004612f88565b611359565b3480156103c257600080fd5b506101fe61022681565b3480156103d857600080fd5b506103616103e7366004612fa6565b61167d565b3480156103f857600080fd5b506007546102fa9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561042557600080fd5b506103616117a8565b34801561043a57600080fd5b506101fe610449366004612fc3565b60086020526000908152604090205481565b34801561046757600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff166102fa565b34801561049257600080fd5b506103616104a1366004612e9a565b6117ba565b3480156104b257600080fd5b506101fe606481565b3480156104c757600080fd5b506103616104d6366004612fde565b6117c7565b3480156104e757600080fd5b506101fe6104b081565b3480156104fd57600080fd5b5061036161050c366004612e9a565b611a15565b34801561051d57600080fd5b5061036161052c366004612e9a565b611a22565b34801561053d57600080fd5b5061036161054c366004612fa6565b611f01565b34801561055d57600080fd5b5061036161056c366004612e9a565b611f50565b34801561057d57600080fd5b506101fe600081565b34801561059257600080fd5b506101fe611f5d565b3480156105a757600080fd5b506101fe6105b6366004613011565b612012565b3480156105c757600080fd5b506103616105d6366004612fa6565b612123565b3480156105e757600080fd5b506103616105f6366004612fa6565b612184565b34801561060757600080fd5b506003546102fa9073ffffffffffffffffffffffffffffffffffffffff1681565b60008061063485610757565b90506005600082600381111561064c5761064c612eb3565b600381111561065d5761065d612eb3565b81526020019081526020016000205460000361067c5761067c81612386565b6004600082600381111561069257610692612eb3565b60038111156106a3576106a3612eb3565b8152602080820192909252604001600090812080546001810182559082529181209091018690556005908260038111156106df576106df612eb3565b60038111156106f0576106f0612eb3565b8152602001908152602001600020600081548092919061070f9061306a565b909155507f150b7a020000000000000000000000000000000000000000000000000000000098975050505050505050565b6000600a5460095461075291906130a2565b905090565b6000606482101561076a57506003919050565b6064821015801561077c575061022682105b1561078957506002919050565b610226821015801561079c57506104b082105b156107a957506001919050565b6104b0821015801561084a5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610823573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084791906130b5565b82105b1561085757506000919050565b60405162461bcd60e51b815260206004820152600f60248201527f496e76616c696420746f6b656e4964000000000000000000000000000000000060448201526064015b60405180910390fd5b919050565b3332146108f85760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e7472616374730000000000000000000000000000000000000000604482015260640161089b565b6109006125b1565b600c5460ff166109525760405162461bcd60e51b815260206004820152601c60248201527f4e46542045786368616e6765206e6f7420696e697469616c697a656400000000604482015260640161089b565b6006546109a15760405162461bcd60e51b815260206004820152601e60248201527f4e6f204e46547320617661696c61626c6520666f722065786368616e67650000604482015260640161089b565b6109a9610740565b6003546040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015273ffffffffffffffffffffffffffffffffffffffff9091169063dd62ed3e90604401602060405180830381865afa158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4191906130b5565b1015610ab55760405162461bcd60e51b815260206004820152602160248201527f4e6f7420656e6f75676820616c6c6f77616e636520666f722065786368616e6760448201527f6500000000000000000000000000000000000000000000000000000000000000606482015260840161089b565b6000610abf6125f4565b600354600754600a546040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9283166024820152604481019190915292935016906323b872dd906064016020604051808303816000875af1158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a91906130ce565b506003546009546040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481019190915273ffffffffffffffffffffffffffffffffffffffff909116906323b872dd906064016020604051808303816000875af1158015610bec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1091906130ce565b506002546040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101839052309173ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015610c80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca491906130f0565b73ffffffffffffffffffffffffffffffffffffffff1614610d075760405162461bcd60e51b815260206004820152601960248201527f4e4654206e6f74206f776e656420627920636f6e747261637400000000000000604482015260640161089b565b6002546040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201523360248201526044810183905273ffffffffffffffffffffffffffffffffffffffff909116906342842e0e90606401600060405180830381600087803b158015610d7f57600080fd5b505af1158015610d93573d6000803e3d6000fd5b50506040513392508391507f378cc0e9b869942e128433cc40ff13fe43b3c5e2eb521aece0dc5ca9ac583f7890600090a350610dcf6001600055565b565b333214610e205760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e7472616374730000000000000000000000000000000000000000604482015260640161089b565b610e286125b1565b600c5460ff16610e7a5760405162461bcd60e51b815260206004820152601c60248201527f4e46542045786368616e6765206e6f7420696e697469616c697a656400000000604482015260640161089b565b6002546040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101849052339173ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015610ee9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0d91906130f0565b73ffffffffffffffffffffffffffffffffffffffff1614610f705760405162461bcd60e51b815260206004820152601760248201527f596f7520646f206e6f74206f776e2074686973204e4654000000000000000000604482015260640161089b565b6000610f7b83610757565b90506000610f898284612012565b905080341015610fdb5760405162461bcd60e51b815260206004820152601f60248201527f496e73756666696369656e742045746865722073656e7420666f722066656500604482015260640161089b565b600060046000856003811115610ff357610ff3612eb3565b600381111561100457611004612eb3565b8152602081019190915260400160002054116110885760405162461bcd60e51b815260206004820152602f60248201527f4e6f204e46547320617661696c61626c6520666f722065786368616e6765206960448201527f6e20746172676574207261726974790000000000000000000000000000000000606482015260840161089b565b60006110938461268b565b6002546040517f42842e0e0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810188905291925073ffffffffffffffffffffffffffffffffffffffff16906342842e0e90606401600060405180830381600087803b15801561110c57600080fd5b505af1158015611120573d6000803e3d6000fd5b50506002546040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201523360248201526044810185905273ffffffffffffffffffffffffffffffffffffffff90911692506342842e0e9150606401600060405180830381600087803b15801561119c57600080fd5b505af11580156111b0573d6000803e3d6000fd5b505060075460405173ffffffffffffffffffffffffffffffffffffffff909116925084156108fc02915084906000818181858888f193505050501580156111fb573d6000803e3d6000fd5b5081341115611254573361120f833461310d565b604051600081818185875af1925050503d806000811461124b576040519150601f19603f3d011682016040523d82523d6000602084013e611250565b606091505b5050505b6040513390829087907fa594300b5cd22cc30743828742624c0af04e9983c409a939e9a627aee6286acd90600090a45050506112906001600055565b5050565b61129c612765565b60008260038111156112b0576112b0612eb3565b101580156112d0575060038260038111156112cd576112cd612eb3565b11155b61131c5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c696420726172697479000000000000000000000000000000000000604482015260640161089b565b806008600084600381111561133357611333612eb3565b600381111561134457611344612eb3565b81526020810191909152604001600020555050565b611361612765565b60025460009073ffffffffffffffffffffffffffffffffffffffff9081169084160361144b57600061139283610757565b905060005b600460008360038111156113ad576113ad612eb3565b60038111156113be576113be612eb3565b81526020810191909152604001600020548110156114485783600460008460038111156113ed576113ed612eb3565b60038111156113fe576113fe612eb3565b8152602001908152602001600020828154811061141d5761141d613120565b9060005260206000200154036114365760019250611448565b806114408161306a565b915050611397565b50505b80156114bc5760025473ffffffffffffffffffffffffffffffffffffffff908116908416036114bc5760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f7420776974686472617720746865206d61696e204e465400000000604482015260640161089b565b6040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101839052309073ffffffffffffffffffffffffffffffffffffffff851690636352211e90602401602060405180830381865afa158015611529573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154d91906130f0565b73ffffffffffffffffffffffffffffffffffffffff16146115b05760405162461bcd60e51b815260206004820181905260248201527f436f6e747261637420646f6573206e6f74206f776e207468697320746f6b656e604482015260640161089b565b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd306115ec60015473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116602482015260448101859052606401600060405180830381600087803b15801561166057600080fd5b505af1158015611674573d6000803e3d6000fd5b50505050505050565b611685612765565b600c5460ff16156116d85760405162461bcd60e51b815260206004820181905260248201527f4e46542045786368616e676520616c726561647920696e697469616c697a6564604482015260640161089b565b73ffffffffffffffffffffffffffffffffffffffff81166117615760405162461bcd60e51b815260206004820152602260248201527f4e465420616464726573732063616e6e6f74206265207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161089b565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6117b0612765565b610dcf60006127b8565b6117c2612765565b600a55565b6117cf612765565b600c5460ff16156118225760405162461bcd60e51b815260206004820181905260248201527f4e46542045786368616e676520616c726561647920696e697469616c697a6564604482015260640161089b565b60025473ffffffffffffffffffffffffffffffffffffffff166118875760405162461bcd60e51b815260206004820152601360248201527f4e46542061646472657373206e6f742073657400000000000000000000000000604482015260640161089b565b6002546040517f99a2557a000000000000000000000000000000000000000000000000000000008152306004820152602481018490526044810183905260009173ffffffffffffffffffffffffffffffffffffffff16906399a2557a90606401600060405180830381865afa158015611904573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261194a919081019061317e565b9050806004600086600381111561196357611963612eb3565b600381111561197457611974612eb3565b81526020019081526020016000209080519060200190611995929190612d79565b508051600560008660038111156119ae576119ae612eb3565b60038111156119bf576119bf612eb3565b81526020810191909152604001600020556119d984612386565b600654600403611a0f57600c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b50505050565b611a1d612765565b600b55565b333214611a715760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e7472616374730000000000000000000000000000000000000000604482015260640161089b565b611a796125b1565b600c5460ff16611acb5760405162461bcd60e51b815260206004820152601c60248201527f4e46542045786368616e6765206e6f7420696e697469616c697a656400000000604482015260640161089b565b6002546040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101839052339173ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015611b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b5e91906130f0565b73ffffffffffffffffffffffffffffffffffffffff1614611bc15760405162461bcd60e51b815260206004820152601760248201527f596f7520646f206e6f74206f776e2074686973204e4654000000000000000000604482015260640161089b565b6009546003546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015611c32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5691906130b5565b1015611cca5760405162461bcd60e51b815260206004820152602760248201527f4e6f7420656e6f75676820455243323020746f6b656e7320696e20746865206360448201527f6f6e747261637400000000000000000000000000000000000000000000000000606482015260840161089b565b6002546040517f42842e0e0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810183905273ffffffffffffffffffffffffffffffffffffffff909116906342842e0e90606401600060405180830381600087803b158015611d4257600080fd5b505af1158015611d56573d6000803e3d6000fd5b5050600354600754600a546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015260248101919091529116925063a9059cbb91506044016020604051808303816000875af1158015611dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfd91906130ce565b50600354600a5460095473ffffffffffffffffffffffffffffffffffffffff9092169163a9059cbb913391611e32919061310d565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af1158015611ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec691906130ce565b50604051339082907fb23966db354dd802f0fd87fc95f5e422c6ead07f3568771385b8da8d10a71f5690600090a3611efe6001600055565b50565b611f09612765565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611f58612765565b600955565b60056020527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc547f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b547f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a54600360009081527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc05490939291611ffe916130a2565b61200891906130a2565b61075291906130a2565b600082600381111561202657612026612eb3565b82600381111561203857612038612eb3565b116120465750600b5461211d565b600182600381111561205a5761205a612eb3565b0361208d576008600060015b600381111561207757612077612eb3565b815260200190815260200160002054905061211d565b60028260038111156120a1576120a1612eb3565b036120b157600860006002612066565b60038260038111156120c5576120c5612eb3565b036120d557600860006003612066565b60405162461bcd60e51b815260206004820152601560248201527f496e76616c696420746172676574207261726974790000000000000000000000604482015260640161089b565b92915050565b61212b612765565b73ffffffffffffffffffffffffffffffffffffffff811661217b576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526000600482015260240161089b565b611efe816127b8565b61218c612765565b60035473ffffffffffffffffffffffffffffffffffffffff9081169082160361221d5760405162461bcd60e51b815260206004820152602560248201527f43616e6e6f7420776974686472617720746865206d61696e204552432d32302060448201527f746f6b656e000000000000000000000000000000000000000000000000000000606482015260840161089b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa15801561228a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ae91906130b5565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6122eb60015473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018490526044016020604051808303816000875af115801561235d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238191906130ce565b505050565b6006548060005b828110156124ae578360038111156123a7576123a7612eb3565b600682815481106123ba576123ba613120565b90600052602060002090602091828204019190069054906101000a900460ff1660038111156123eb576123eb612eb3565b036124385760405162461bcd60e51b815260206004820152601560248201527f52617269747920616c7265616479206578697374730000000000000000000000604482015260640161089b565b83600381111561244a5761244a612eb3565b6006828154811061245d5761245d613120565b90600052602060002090602091828204019190069054906101000a900460ff16600381111561248e5761248e612eb3565b111561249c578091506124ae565b806124a68161306a565b91505061238d565b50600680546001018155600052815b8181111561255f5760066124d260018361310d565b815481106124e2576124e2613120565b90600052602060002090602091828204019190069054906101000a900460ff166006828154811061251557612515613120565b90600052602060002090602091828204019190066101000a81548160ff0219169083600381111561254857612548612eb3565b0217905550806125578161325a565b9150506124bd565b50826006828154811061257457612574613120565b90600052602060002090602091828204019190066101000a81548160ff021916908360038111156125a7576125a7612eb3565b0217905550505050565b6002600054036125ed576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6000806125ff611f5d565b9050600081116126515760405162461bcd60e51b815260206004820152601e60248201527f4e6f204e46547320617661696c61626c6520666f722065786368616e67650000604482015260640161089b565b60008161265c61282f565b612666919061328f565b90506000806126748361289a565b915091506126828282612999565b94505050505090565b600080600560008460038111156126a4576126a4612eb3565b60038111156126b5576126b5612eb3565b81526020019081526020016000205490506000811161273c5760405162461bcd60e51b815260206004820152602e60248201527f4e6f204e465473206f6620676976656e2072617269747920617661696c61626c60448201527f6520666f722065786368616e6765000000000000000000000000000000000000606482015260840161089b565b60008161274761282f565b612751919061328f565b905061275d8482612999565b949350505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610dcf576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161089b565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600042443360405160200161287c93929190928352602083019190915260601b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016604082015260540190565b6040516020818303038152906040528051906020012060001c905090565b60056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc0547f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a54600160009081527f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b549092839290918286101561292557506003959350505050565b61292f82846130a2565b86101561294e576002612942848861310d565b94509450505050915091565b8061295983856130a2565b61296391906130a2565b86101561298157600182612977858961310d565b612942919061310d565b6000818361298f868a61310d565b612977919061310d565b600080600460008560038111156129b2576129b2612eb3565b60038111156129c3576129c3612eb3565b815260200190815260200160002083815481106129e2576129e2613120565b906000526020600020015490506129f98484612a00565b9392505050565b600060056000846003811115612a1857612a18612eb3565b6003811115612a2957612a29612eb3565b8152602001908152602001600020549050808210612a4657600080fd5b80600103612a5757612a5783612bb2565b60046000846003811115612a6d57612a6d612eb3565b6003811115612a7e57612a7e612eb3565b8152602001908152602001600020600182612a99919061310d565b81548110612aa957612aa9613120565b906000526020600020015460046000856003811115612aca57612aca612eb3565b6003811115612adb57612adb612eb3565b81526020019081526020016000208381548110612afa57612afa613120565b906000526020600020018190555060046000846003811115612b1e57612b1e612eb3565b6003811115612b2f57612b2f612eb3565b8152602001908152602001600020805480612b4c57612b4c6132ca565b6001900381819060005260206000200160009055905560056000846003811115612b7857612b78612eb3565b6003811115612b8957612b89612eb3565b81526020019081526020016000206000815480929190612ba89061325a565b9190505550505050565b600654806000805b83811015612c3b57846003811115612bd457612bd4612eb3565b60068281548110612be757612be7613120565b90600052602060002090602091828204019190069054906101000a900460ff166003811115612c1857612c18612eb3565b03612c295780925060019150612c3b565b80612c338161306a565b915050612bba565b5080612c895760405162461bcd60e51b815260206004820152601560248201527f52617269747920646f6573206e6f742065786973740000000000000000000000604482015260640161089b565b815b612c9660018561310d565b811015612d37576006612caa8260016130a2565b81548110612cba57612cba613120565b90600052602060002090602091828204019190069054906101000a900460ff1660068281548110612ced57612ced613120565b90600052602060002090602091828204019190066101000a81548160ff02191690836003811115612d2057612d20612eb3565b021790555080612d2f8161306a565b915050612c8b565b506006805480612d4957612d496132ca565b60019003818190600052602060002090602091828204019190066101000a81549060ff0219169055905550505050565b828054828255906000526020600020908101928215612db4579160200282015b82811115612db4578251825591602001919060010190612d99565b50612dc0929150612dc4565b5090565b5b80821115612dc05760008155600101612dc5565b73ffffffffffffffffffffffffffffffffffffffff81168114611efe57600080fd5b600080600080600060808688031215612e1357600080fd5b8535612e1e81612dd9565b94506020860135612e2e81612dd9565b935060408601359250606086013567ffffffffffffffff80821115612e5257600080fd5b818801915088601f830112612e6657600080fd5b813581811115612e7557600080fd5b896020828501011115612e8757600080fd5b9699959850939650602001949392505050565b600060208284031215612eac57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160048310612f1d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b8035600481106108a457600080fd5b60008060408385031215612f4557600080fd5b82359150612f5560208401612f23565b90509250929050565b60008060408385031215612f7157600080fd5b612f7a83612f23565b946020939093013593505050565b60008060408385031215612f9b57600080fd5b8235612f7a81612dd9565b600060208284031215612fb857600080fd5b81356129f981612dd9565b600060208284031215612fd557600080fd5b6129f982612f23565b600080600060608486031215612ff357600080fd5b612ffc84612f23565b95602085013595506040909401359392505050565b6000806040838503121561302457600080fd5b61302d83612f23565b9150612f5560208401612f23565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361309b5761309b61303b565b5060010190565b8082018082111561211d5761211d61303b565b6000602082840312156130c757600080fd5b5051919050565b6000602082840312156130e057600080fd5b815180151581146129f957600080fd5b60006020828403121561310257600080fd5b81516129f981612dd9565b8181038181111561211d5761211d61303b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602080838503121561319157600080fd5b825167ffffffffffffffff808211156131a957600080fd5b818501915085601f8301126131bd57600080fd5b8151818111156131cf576131cf61314f565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811085821117156132125761321261314f565b60405291825284820192508381018501918883111561323057600080fd5b938501935b8285101561324e57845184529385019392850192613235565b98975050505050505050565b6000816132695761326961303b565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b6000826132c5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122060a3d7c0eb5ce8750c95a1092cd8c46cbf47bd073b8d18111626a4f2830ab99064736f6c6343000814003300000000000000000000000073d3715b8bcd75959a5be67d8ab9f4eebeb27407000000000000000000000000c8168d5665f4418353728ac970713e09c0b7c20e

Deployed Bytecode

0x6080604052600436106101e35760003560e01c80638b46805511610102578063c69bebe411610095578063ddad8a6a11610064578063ddad8a6a1461059b578063f2fde38b146105bb578063f4f3b200146105db578063fc0c546a146105fb57600080fd5b8063c69bebe414610531578063cbcb384714610551578063cd5d696a14610571578063d1c853fa1461058657600080fd5b8063aded1a81116100d1578063aded1a81146104bb578063bb8943cb146104db578063c22d1509146104f1578063c62709cb1461051157600080fd5b80638b4680551461042e5780638da5cb5b1461045b5780639b9cf7de14610486578063a32bfbbd146104a657600080fd5b80635050bcd81161017a578063621fb2ea11610149578063621fb2ea146103b657806369d03738146103cc578063702acfa8146103ec578063715018a61461041957600080fd5b80635050bcd81461034c578063578d9eb8146103635780635a0b33b1146103765780636088e93a1461039657600080fd5b80632ecd3be4116101b65780632ecd3be4146102a25780634353f806146102b857806347ccca02146102cd578063487586971461031f57600080fd5b80630d39fc81146101e8578063141fe0f814610211578063150b7a0214610227578063158ef93e14610278575b600080fd5b3480156101f457600080fd5b506101fe60095481565b6040519081526020015b60405180910390f35b34801561021d57600080fd5b506101fe600b5481565b34801561023357600080fd5b50610247610242366004612dfb565b610628565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610208565b34801561028457600080fd5b50600c546102929060ff1681565b6040519015158152602001610208565b3480156102ae57600080fd5b506101fe600a5481565b3480156102c457600080fd5b506101fe610740565b3480156102d957600080fd5b506002546102fa9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610208565b34801561032b57600080fd5b5061033f61033a366004612e9a565b610757565b6040516102089190612ee2565b34801561035857600080fd5b506103616108a9565b005b610361610371366004612f32565b610dd1565b34801561038257600080fd5b50610361610391366004612f5e565b611294565b3480156103a257600080fd5b506103616103b1366004612f88565b611359565b3480156103c257600080fd5b506101fe61022681565b3480156103d857600080fd5b506103616103e7366004612fa6565b61167d565b3480156103f857600080fd5b506007546102fa9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561042557600080fd5b506103616117a8565b34801561043a57600080fd5b506101fe610449366004612fc3565b60086020526000908152604090205481565b34801561046757600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff166102fa565b34801561049257600080fd5b506103616104a1366004612e9a565b6117ba565b3480156104b257600080fd5b506101fe606481565b3480156104c757600080fd5b506103616104d6366004612fde565b6117c7565b3480156104e757600080fd5b506101fe6104b081565b3480156104fd57600080fd5b5061036161050c366004612e9a565b611a15565b34801561051d57600080fd5b5061036161052c366004612e9a565b611a22565b34801561053d57600080fd5b5061036161054c366004612fa6565b611f01565b34801561055d57600080fd5b5061036161056c366004612e9a565b611f50565b34801561057d57600080fd5b506101fe600081565b34801561059257600080fd5b506101fe611f5d565b3480156105a757600080fd5b506101fe6105b6366004613011565b612012565b3480156105c757600080fd5b506103616105d6366004612fa6565b612123565b3480156105e757600080fd5b506103616105f6366004612fa6565b612184565b34801561060757600080fd5b506003546102fa9073ffffffffffffffffffffffffffffffffffffffff1681565b60008061063485610757565b90506005600082600381111561064c5761064c612eb3565b600381111561065d5761065d612eb3565b81526020019081526020016000205460000361067c5761067c81612386565b6004600082600381111561069257610692612eb3565b60038111156106a3576106a3612eb3565b8152602080820192909252604001600090812080546001810182559082529181209091018690556005908260038111156106df576106df612eb3565b60038111156106f0576106f0612eb3565b8152602001908152602001600020600081548092919061070f9061306a565b909155507f150b7a020000000000000000000000000000000000000000000000000000000098975050505050505050565b6000600a5460095461075291906130a2565b905090565b6000606482101561076a57506003919050565b6064821015801561077c575061022682105b1561078957506002919050565b610226821015801561079c57506104b082105b156107a957506001919050565b6104b0821015801561084a5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610823573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084791906130b5565b82105b1561085757506000919050565b60405162461bcd60e51b815260206004820152600f60248201527f496e76616c696420746f6b656e4964000000000000000000000000000000000060448201526064015b60405180910390fd5b919050565b3332146108f85760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e7472616374730000000000000000000000000000000000000000604482015260640161089b565b6109006125b1565b600c5460ff166109525760405162461bcd60e51b815260206004820152601c60248201527f4e46542045786368616e6765206e6f7420696e697469616c697a656400000000604482015260640161089b565b6006546109a15760405162461bcd60e51b815260206004820152601e60248201527f4e6f204e46547320617661696c61626c6520666f722065786368616e67650000604482015260640161089b565b6109a9610740565b6003546040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015273ffffffffffffffffffffffffffffffffffffffff9091169063dd62ed3e90604401602060405180830381865afa158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4191906130b5565b1015610ab55760405162461bcd60e51b815260206004820152602160248201527f4e6f7420656e6f75676820616c6c6f77616e636520666f722065786368616e6760448201527f6500000000000000000000000000000000000000000000000000000000000000606482015260840161089b565b6000610abf6125f4565b600354600754600a546040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9283166024820152604481019190915292935016906323b872dd906064016020604051808303816000875af1158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a91906130ce565b506003546009546040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481019190915273ffffffffffffffffffffffffffffffffffffffff909116906323b872dd906064016020604051808303816000875af1158015610bec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1091906130ce565b506002546040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101839052309173ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015610c80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca491906130f0565b73ffffffffffffffffffffffffffffffffffffffff1614610d075760405162461bcd60e51b815260206004820152601960248201527f4e4654206e6f74206f776e656420627920636f6e747261637400000000000000604482015260640161089b565b6002546040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201523360248201526044810183905273ffffffffffffffffffffffffffffffffffffffff909116906342842e0e90606401600060405180830381600087803b158015610d7f57600080fd5b505af1158015610d93573d6000803e3d6000fd5b50506040513392508391507f378cc0e9b869942e128433cc40ff13fe43b3c5e2eb521aece0dc5ca9ac583f7890600090a350610dcf6001600055565b565b333214610e205760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e7472616374730000000000000000000000000000000000000000604482015260640161089b565b610e286125b1565b600c5460ff16610e7a5760405162461bcd60e51b815260206004820152601c60248201527f4e46542045786368616e6765206e6f7420696e697469616c697a656400000000604482015260640161089b565b6002546040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101849052339173ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015610ee9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0d91906130f0565b73ffffffffffffffffffffffffffffffffffffffff1614610f705760405162461bcd60e51b815260206004820152601760248201527f596f7520646f206e6f74206f776e2074686973204e4654000000000000000000604482015260640161089b565b6000610f7b83610757565b90506000610f898284612012565b905080341015610fdb5760405162461bcd60e51b815260206004820152601f60248201527f496e73756666696369656e742045746865722073656e7420666f722066656500604482015260640161089b565b600060046000856003811115610ff357610ff3612eb3565b600381111561100457611004612eb3565b8152602081019190915260400160002054116110885760405162461bcd60e51b815260206004820152602f60248201527f4e6f204e46547320617661696c61626c6520666f722065786368616e6765206960448201527f6e20746172676574207261726974790000000000000000000000000000000000606482015260840161089b565b60006110938461268b565b6002546040517f42842e0e0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810188905291925073ffffffffffffffffffffffffffffffffffffffff16906342842e0e90606401600060405180830381600087803b15801561110c57600080fd5b505af1158015611120573d6000803e3d6000fd5b50506002546040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201523360248201526044810185905273ffffffffffffffffffffffffffffffffffffffff90911692506342842e0e9150606401600060405180830381600087803b15801561119c57600080fd5b505af11580156111b0573d6000803e3d6000fd5b505060075460405173ffffffffffffffffffffffffffffffffffffffff909116925084156108fc02915084906000818181858888f193505050501580156111fb573d6000803e3d6000fd5b5081341115611254573361120f833461310d565b604051600081818185875af1925050503d806000811461124b576040519150601f19603f3d011682016040523d82523d6000602084013e611250565b606091505b5050505b6040513390829087907fa594300b5cd22cc30743828742624c0af04e9983c409a939e9a627aee6286acd90600090a45050506112906001600055565b5050565b61129c612765565b60008260038111156112b0576112b0612eb3565b101580156112d0575060038260038111156112cd576112cd612eb3565b11155b61131c5760405162461bcd60e51b815260206004820152600e60248201527f496e76616c696420726172697479000000000000000000000000000000000000604482015260640161089b565b806008600084600381111561133357611333612eb3565b600381111561134457611344612eb3565b81526020810191909152604001600020555050565b611361612765565b60025460009073ffffffffffffffffffffffffffffffffffffffff9081169084160361144b57600061139283610757565b905060005b600460008360038111156113ad576113ad612eb3565b60038111156113be576113be612eb3565b81526020810191909152604001600020548110156114485783600460008460038111156113ed576113ed612eb3565b60038111156113fe576113fe612eb3565b8152602001908152602001600020828154811061141d5761141d613120565b9060005260206000200154036114365760019250611448565b806114408161306a565b915050611397565b50505b80156114bc5760025473ffffffffffffffffffffffffffffffffffffffff908116908416036114bc5760405162461bcd60e51b815260206004820152601c60248201527f43616e6e6f7420776974686472617720746865206d61696e204e465400000000604482015260640161089b565b6040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101839052309073ffffffffffffffffffffffffffffffffffffffff851690636352211e90602401602060405180830381865afa158015611529573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154d91906130f0565b73ffffffffffffffffffffffffffffffffffffffff16146115b05760405162461bcd60e51b815260206004820181905260248201527f436f6e747261637420646f6573206e6f74206f776e207468697320746f6b656e604482015260640161089b565b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd306115ec60015473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116602482015260448101859052606401600060405180830381600087803b15801561166057600080fd5b505af1158015611674573d6000803e3d6000fd5b50505050505050565b611685612765565b600c5460ff16156116d85760405162461bcd60e51b815260206004820181905260248201527f4e46542045786368616e676520616c726561647920696e697469616c697a6564604482015260640161089b565b73ffffffffffffffffffffffffffffffffffffffff81166117615760405162461bcd60e51b815260206004820152602260248201527f4e465420616464726573732063616e6e6f74206265207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161089b565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6117b0612765565b610dcf60006127b8565b6117c2612765565b600a55565b6117cf612765565b600c5460ff16156118225760405162461bcd60e51b815260206004820181905260248201527f4e46542045786368616e676520616c726561647920696e697469616c697a6564604482015260640161089b565b60025473ffffffffffffffffffffffffffffffffffffffff166118875760405162461bcd60e51b815260206004820152601360248201527f4e46542061646472657373206e6f742073657400000000000000000000000000604482015260640161089b565b6002546040517f99a2557a000000000000000000000000000000000000000000000000000000008152306004820152602481018490526044810183905260009173ffffffffffffffffffffffffffffffffffffffff16906399a2557a90606401600060405180830381865afa158015611904573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261194a919081019061317e565b9050806004600086600381111561196357611963612eb3565b600381111561197457611974612eb3565b81526020019081526020016000209080519060200190611995929190612d79565b508051600560008660038111156119ae576119ae612eb3565b60038111156119bf576119bf612eb3565b81526020810191909152604001600020556119d984612386565b600654600403611a0f57600c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b50505050565b611a1d612765565b600b55565b333214611a715760405162461bcd60e51b815260206004820152600c60248201527f4e6f20636f6e7472616374730000000000000000000000000000000000000000604482015260640161089b565b611a796125b1565b600c5460ff16611acb5760405162461bcd60e51b815260206004820152601c60248201527f4e46542045786368616e6765206e6f7420696e697469616c697a656400000000604482015260640161089b565b6002546040517f6352211e00000000000000000000000000000000000000000000000000000000815260048101839052339173ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015611b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b5e91906130f0565b73ffffffffffffffffffffffffffffffffffffffff1614611bc15760405162461bcd60e51b815260206004820152601760248201527f596f7520646f206e6f74206f776e2074686973204e4654000000000000000000604482015260640161089b565b6009546003546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015611c32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5691906130b5565b1015611cca5760405162461bcd60e51b815260206004820152602760248201527f4e6f7420656e6f75676820455243323020746f6b656e7320696e20746865206360448201527f6f6e747261637400000000000000000000000000000000000000000000000000606482015260840161089b565b6002546040517f42842e0e0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810183905273ffffffffffffffffffffffffffffffffffffffff909116906342842e0e90606401600060405180830381600087803b158015611d4257600080fd5b505af1158015611d56573d6000803e3d6000fd5b5050600354600754600a546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015260248101919091529116925063a9059cbb91506044016020604051808303816000875af1158015611dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfd91906130ce565b50600354600a5460095473ffffffffffffffffffffffffffffffffffffffff9092169163a9059cbb913391611e32919061310d565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af1158015611ea2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec691906130ce565b50604051339082907fb23966db354dd802f0fd87fc95f5e422c6ead07f3568771385b8da8d10a71f5690600090a3611efe6001600055565b50565b611f09612765565b600780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611f58612765565b600955565b60056020527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc547f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b547f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a54600360009081527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc05490939291611ffe916130a2565b61200891906130a2565b61075291906130a2565b600082600381111561202657612026612eb3565b82600381111561203857612038612eb3565b116120465750600b5461211d565b600182600381111561205a5761205a612eb3565b0361208d576008600060015b600381111561207757612077612eb3565b815260200190815260200160002054905061211d565b60028260038111156120a1576120a1612eb3565b036120b157600860006002612066565b60038260038111156120c5576120c5612eb3565b036120d557600860006003612066565b60405162461bcd60e51b815260206004820152601560248201527f496e76616c696420746172676574207261726974790000000000000000000000604482015260640161089b565b92915050565b61212b612765565b73ffffffffffffffffffffffffffffffffffffffff811661217b576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526000600482015260240161089b565b611efe816127b8565b61218c612765565b60035473ffffffffffffffffffffffffffffffffffffffff9081169082160361221d5760405162461bcd60e51b815260206004820152602560248201527f43616e6e6f7420776974686472617720746865206d61696e204552432d32302060448201527f746f6b656e000000000000000000000000000000000000000000000000000000606482015260840161089b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa15801561228a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ae91906130b5565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6122eb60015473ffffffffffffffffffffffffffffffffffffffff1690565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602481018490526044016020604051808303816000875af115801561235d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238191906130ce565b505050565b6006548060005b828110156124ae578360038111156123a7576123a7612eb3565b600682815481106123ba576123ba613120565b90600052602060002090602091828204019190069054906101000a900460ff1660038111156123eb576123eb612eb3565b036124385760405162461bcd60e51b815260206004820152601560248201527f52617269747920616c7265616479206578697374730000000000000000000000604482015260640161089b565b83600381111561244a5761244a612eb3565b6006828154811061245d5761245d613120565b90600052602060002090602091828204019190069054906101000a900460ff16600381111561248e5761248e612eb3565b111561249c578091506124ae565b806124a68161306a565b91505061238d565b50600680546001018155600052815b8181111561255f5760066124d260018361310d565b815481106124e2576124e2613120565b90600052602060002090602091828204019190069054906101000a900460ff166006828154811061251557612515613120565b90600052602060002090602091828204019190066101000a81548160ff0219169083600381111561254857612548612eb3565b0217905550806125578161325a565b9150506124bd565b50826006828154811061257457612574613120565b90600052602060002090602091828204019190066101000a81548160ff021916908360038111156125a7576125a7612eb3565b0217905550505050565b6002600054036125ed576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6000806125ff611f5d565b9050600081116126515760405162461bcd60e51b815260206004820152601e60248201527f4e6f204e46547320617661696c61626c6520666f722065786368616e67650000604482015260640161089b565b60008161265c61282f565b612666919061328f565b90506000806126748361289a565b915091506126828282612999565b94505050505090565b600080600560008460038111156126a4576126a4612eb3565b60038111156126b5576126b5612eb3565b81526020019081526020016000205490506000811161273c5760405162461bcd60e51b815260206004820152602e60248201527f4e6f204e465473206f6620676976656e2072617269747920617661696c61626c60448201527f6520666f722065786368616e6765000000000000000000000000000000000000606482015260840161089b565b60008161274761282f565b612751919061328f565b905061275d8482612999565b949350505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610dcf576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240161089b565b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600042443360405160200161287c93929190928352602083019190915260601b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016604082015260540190565b6040516020818303038152906040528051906020012060001c905090565b60056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc0547f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a54600160009081527f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b549092839290918286101561292557506003959350505050565b61292f82846130a2565b86101561294e576002612942848861310d565b94509450505050915091565b8061295983856130a2565b61296391906130a2565b86101561298157600182612977858961310d565b612942919061310d565b6000818361298f868a61310d565b612977919061310d565b600080600460008560038111156129b2576129b2612eb3565b60038111156129c3576129c3612eb3565b815260200190815260200160002083815481106129e2576129e2613120565b906000526020600020015490506129f98484612a00565b9392505050565b600060056000846003811115612a1857612a18612eb3565b6003811115612a2957612a29612eb3565b8152602001908152602001600020549050808210612a4657600080fd5b80600103612a5757612a5783612bb2565b60046000846003811115612a6d57612a6d612eb3565b6003811115612a7e57612a7e612eb3565b8152602001908152602001600020600182612a99919061310d565b81548110612aa957612aa9613120565b906000526020600020015460046000856003811115612aca57612aca612eb3565b6003811115612adb57612adb612eb3565b81526020019081526020016000208381548110612afa57612afa613120565b906000526020600020018190555060046000846003811115612b1e57612b1e612eb3565b6003811115612b2f57612b2f612eb3565b8152602001908152602001600020805480612b4c57612b4c6132ca565b6001900381819060005260206000200160009055905560056000846003811115612b7857612b78612eb3565b6003811115612b8957612b89612eb3565b81526020019081526020016000206000815480929190612ba89061325a565b9190505550505050565b600654806000805b83811015612c3b57846003811115612bd457612bd4612eb3565b60068281548110612be757612be7613120565b90600052602060002090602091828204019190069054906101000a900460ff166003811115612c1857612c18612eb3565b03612c295780925060019150612c3b565b80612c338161306a565b915050612bba565b5080612c895760405162461bcd60e51b815260206004820152601560248201527f52617269747920646f6573206e6f742065786973740000000000000000000000604482015260640161089b565b815b612c9660018561310d565b811015612d37576006612caa8260016130a2565b81548110612cba57612cba613120565b90600052602060002090602091828204019190069054906101000a900460ff1660068281548110612ced57612ced613120565b90600052602060002090602091828204019190066101000a81548160ff02191690836003811115612d2057612d20612eb3565b021790555080612d2f8161306a565b915050612c8b565b506006805480612d4957612d496132ca565b60019003818190600052602060002090602091828204019190066101000a81549060ff0219169055905550505050565b828054828255906000526020600020908101928215612db4579160200282015b82811115612db4578251825591602001919060010190612d99565b50612dc0929150612dc4565b5090565b5b80821115612dc05760008155600101612dc5565b73ffffffffffffffffffffffffffffffffffffffff81168114611efe57600080fd5b600080600080600060808688031215612e1357600080fd5b8535612e1e81612dd9565b94506020860135612e2e81612dd9565b935060408601359250606086013567ffffffffffffffff80821115612e5257600080fd5b818801915088601f830112612e6657600080fd5b813581811115612e7557600080fd5b896020828501011115612e8757600080fd5b9699959850939650602001949392505050565b600060208284031215612eac57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160048310612f1d577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b8035600481106108a457600080fd5b60008060408385031215612f4557600080fd5b82359150612f5560208401612f23565b90509250929050565b60008060408385031215612f7157600080fd5b612f7a83612f23565b946020939093013593505050565b60008060408385031215612f9b57600080fd5b8235612f7a81612dd9565b600060208284031215612fb857600080fd5b81356129f981612dd9565b600060208284031215612fd557600080fd5b6129f982612f23565b600080600060608486031215612ff357600080fd5b612ffc84612f23565b95602085013595506040909401359392505050565b6000806040838503121561302457600080fd5b61302d83612f23565b9150612f5560208401612f23565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361309b5761309b61303b565b5060010190565b8082018082111561211d5761211d61303b565b6000602082840312156130c757600080fd5b5051919050565b6000602082840312156130e057600080fd5b815180151581146129f957600080fd5b60006020828403121561310257600080fd5b81516129f981612dd9565b8181038181111561211d5761211d61303b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602080838503121561319157600080fd5b825167ffffffffffffffff808211156131a957600080fd5b818501915085601f8301126131bd57600080fd5b8151818111156131cf576131cf61314f565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f830116810181811085821117156132125761321261314f565b60405291825284820192508381018501918883111561323057600080fd5b938501935b8285101561324e57845184529385019392850192613235565b98975050505050505050565b6000816132695761326961303b565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b6000826132c5577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122060a3d7c0eb5ce8750c95a1092cd8c46cbf47bd073b8d18111626a4f2830ab99064736f6c63430008140033

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

00000000000000000000000073d3715b8bcd75959a5be67d8ab9f4eebeb27407000000000000000000000000c8168d5665f4418353728ac970713e09c0b7c20e

-----Decoded View---------------
Arg [0] : _feesRecipient (address): 0x73d3715b8bCD75959A5bE67d8AB9F4Eebeb27407
Arg [1] : _tokenAddress (address): 0xc8168d5665f4418353728ac970713e09C0B7c20e

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000073d3715b8bcd75959a5be67d8ab9f4eebeb27407
Arg [1] : 000000000000000000000000c8168d5665f4418353728ac970713e09c0b7c20e


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.