ETH Price: $3,230.67 (-3.72%)
Gas: 8.13 Gwei

Contract

0x1C9EFa5e7b6DDCc50634267037dc8514FD1B0152
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw205977522024-08-24 10:05:59120 days ago1724493959IN
0x1C9EFa5e...4FD1B0152
0 ETH0.00021331.02573979
Withdraw205951842024-08-24 1:29:23120 days ago1724462963IN
0x1C9EFa5e...4FD1B0152
0 ETH0.00107551.06889448
Withdraw204867432024-08-08 22:04:59135 days ago1723154699IN
0x1C9EFa5e...4FD1B0152
0 ETH0.003207677.38508623
Withdraw198053852024-05-05 17:29:23231 days ago1714930163IN
0x1C9EFa5e...4FD1B0152
0 ETH0.001404218.14148417
Withdraw197293882024-04-25 2:25:23241 days ago1714011923IN
0x1C9EFa5e...4FD1B0152
0 ETH0.000886635.97472793
Withdraw195865702024-04-05 2:29:23261 days ago1712284163IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0031599714.3499095
Withdraw189411422024-01-05 12:42:35352 days ago1704458555IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0069772916.06683301
Deposit189252252024-01-03 7:03:11354 days ago1704265391IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0051093312.02983748
Deposit189229982024-01-02 23:34:59354 days ago1704238499IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0028667714.34281746
Deposit189228992024-01-02 23:15:11354 days ago1704237311IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0033108518.11439063
Deposit189130362024-01-01 14:00:47356 days ago1704117647IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0188717614.6398326
Deposit184963972023-11-04 4:48:11414 days ago1699073291IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0042251613.15299922
Withdraw184875222023-11-02 22:59:35415 days ago1698965975IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0041183827.75227495
Deposit183606752023-10-16 4:53:59433 days ago1697432039IN
0x1C9EFa5e...4FD1B0152
0 ETH0.000982084.91347117
Withdraw183157552023-10-09 22:01:47439 days ago1696888907IN
0x1C9EFa5e...4FD1B0152
0 ETH0.001342359.04561133
Deposit170190442023-04-10 16:43:23622 days ago1681145003IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0080496628.04447841
Withdraw170190282023-04-10 16:40:11622 days ago1681144811IN
0x1C9EFa5e...4FD1B0152
0 ETH0.006446229.27313252
Withdraw169483392023-03-31 16:23:11632 days ago1680279791IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0047981732.33317811
Deposit169085332023-03-26 2:08:59637 days ago1679796539IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0026967213.49203592
Deposit167519532023-03-04 1:54:59659 days ago1677894899IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0042706421.36655943
Deposit167474282023-03-03 10:35:23660 days ago1677839723IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0059863718.63566293
Withdraw166035542023-02-11 5:53:23680 days ago1676094803IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0024464516.48576257
Deposit164581162023-01-21 22:18:47700 days ago1674339527IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0033462216.74161175
Deposit164500772023-01-20 19:22:11702 days ago1674242531IN
0x1C9EFa5e...4FD1B0152
0 ETH0.014275620.87708447
Deposit163534782023-01-07 7:40:47715 days ago1673077247IN
0x1C9EFa5e...4FD1B0152
0 ETH0.0026961814.75140012
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakeFlowtys

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 500 runs

Other Settings:
default evmVersion
File 1 of 9 : StakeFlowty.sol
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

interface IINK {
    function whitelist_mint(address account, uint256 amount) external;
}
interface IFLOWTY {
    function getAge(uint256 tokenId) external view returns (uint8);
}

contract StakeFlowtys is IERC721Receiver, Ownable, ReentrancyGuard {
    using EnumerableSet for EnumerableSet.UintSet;

    address public ERC20_CONTRACT;
    address public ERC721_CONTRACT;
    address public REWARDS_PROXY_CONTRACT;
    uint256 public EXPIRATION; //expiry block number (avg 15s per block)

    mapping(address => EnumerableSet.UintSet) private _deposits;
    mapping(address => mapping(uint256 => uint256)) public depositBlocks;
    uint256[4] public rewardRate;
    uint256 public bonusRewardRate;
    uint256 public bonusExpireBlock;
    bool started;

    constructor(
        address _erc20,
        address _erc721,
        address _proxy,
        uint256 _expiration
    ) {
        ERC20_CONTRACT = _erc20;
        ERC721_CONTRACT = _erc721;
        REWARDS_PROXY_CONTRACT = _proxy;
        EXPIRATION = block.number + _expiration;
        // number of tokens Per day
        rewardRate = [5, 10, 15, 20];
        bonusRewardRate = (15 * 1e18) / 6000;
        started = false;
    }

    function setRate(uint256 _rarity, uint256 _rate) public onlyOwner() {
        rewardRate[_rarity] = _rate;
    }

    function setExpiration(uint256 _expiration) public onlyOwner() {
        EXPIRATION = _expiration;
    }

    function setBonusRate(uint256 _rate) public onlyOwner() {
        bonusRewardRate = _rate;
    }

    function setBonusExpiration(uint256 _expiration) public onlyOwner() {
        bonusExpireBlock = _expiration;
    }
    
    function toggleStart() public onlyOwner() {
        started = !started;
    }

    function setTokenAddress(address _tokenAddress) public onlyOwner() {
        // Used to change rewards token if needed
        ERC20_CONTRACT = _tokenAddress;
    }

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

    function depositsOf(address account)
        external
        view
        returns (uint256[] memory)
    {
        EnumerableSet.UintSet storage depositSet = _deposits[account];
        uint256[] memory tokenIds = new uint256[](depositSet.length());

        for (uint256 i; i < depositSet.length(); ) {
            tokenIds[i] = depositSet.at(i);
            unchecked{ i++; }
        }

        return tokenIds;
    }

    function findRate(uint256 tokenId, uint256 startingBlock)
        public
        view
        returns (uint256 rate) 
    {
        uint256 age = IFLOWTY(ERC721_CONTRACT).getAge(tokenId);
        uint256 perDay = rewardRate[age];
        
        // 6000 blocks per day
        // perDay / 6000 = reward per block

        rate = (perDay * 1e18) / 6000;

        // Initial staking bonus, last for around a week or so
        if (startingBlock < bonusExpireBlock) {
          rate += bonusRewardRate;
        }
        
        return rate;
    }

    function calculateRewards(address account, uint256[] memory tokenIds)
        public
        view
        returns (uint256[] memory rewards)
    {
        rewards = new uint256[](tokenIds.length);

        for (uint256 i; i < tokenIds.length; ) {
            uint256 tokenId = tokenIds[i];
            if (_deposits[account].contains(tokenId)) {
              uint256 rate = findRate(tokenId, depositBlocks[account][tokenId]);
              rewards[i] =
                  rate *
                  (Math.min(block.number, EXPIRATION) -
                      depositBlocks[account][tokenId]);
            } else {
              rewards[i] = 0;
            }
            unchecked{ i++; }
        }
    }

    function calculateRewardsAll(address account, uint256[] memory tokenIds)
        public
        view
        returns (uint256[] memory rewards)
    {
        rewards = new uint256[](tokenIds.length);
        EnumerableSet.UintSet storage depositSet = _deposits[account];

        for (uint256 i; i < tokenIds.length; ) {
            uint256 tokenId = depositSet.at(i);
            uint256 rate = findRate(tokenId, depositBlocks[account][tokenId]);
            rewards[i] = rate *
                (Math.min(block.number, EXPIRATION) -
                    depositBlocks[account][tokenId]);
            unchecked{ i++; }
        }
    }


    function claimRewardsInt(uint256[] calldata tokenIds) private {
        uint256 reward;
        uint256 curblock = Math.min(block.number, EXPIRATION);

        uint256[] memory rewards = calculateRewards(msg.sender, tokenIds);

        for (uint256 i; i < tokenIds.length; ) {
            reward += rewards[i];
            depositBlocks[msg.sender][tokenIds[i]] = curblock;
            unchecked{ i++; }
        }

        if (reward > 0) {
            IINK(ERC20_CONTRACT).whitelist_mint(msg.sender, reward);
        }
    }

    function claimRewards(uint256[] calldata tokenIds) public nonReentrant {
        claimRewardsInt(tokenIds);
    }

    function claimRewardsAllInt(address user) private {
        uint256 reward;
        uint256 curblock = Math.min(block.number, EXPIRATION);

        EnumerableSet.UintSet storage depositSet = _deposits[user];
        uint256[] memory tokenIds = new uint256[](depositSet.length());
        uint256[] memory rewards = calculateRewardsAll(user, tokenIds);

        for (uint256 i; i < tokenIds.length; ) {
            reward += rewards[i];
            depositBlocks[user][depositSet.at(i)] = curblock;
            unchecked{ i++; }
        }

        if (reward > 0) {
            IINK(ERC20_CONTRACT).whitelist_mint(user, reward);
        }
    }

    function claimRewardsAllFor(address user) public nonReentrant {
        require(msg.sender == REWARDS_PROXY_CONTRACT, 'StakeFlowtys: function only for a proxy contract');
        claimRewardsAllInt(user);
    }

    function claimRewardsAll() public nonReentrant {
        claimRewardsAllInt(msg.sender);
    }

    function deposit(uint256[] calldata tokenIds) external nonReentrant {
        require(started, 'StakeFlowtys: Staking contract not started yet');

        claimRewardsInt(tokenIds);
        
        for (uint256 i; i < tokenIds.length; ) {
            IERC721(ERC721_CONTRACT).safeTransferFrom(
                msg.sender,
                address(this),
                tokenIds[i],
                ''
            );
            _deposits[msg.sender].add(tokenIds[i]);
            unchecked{ i++; }
        }
    }

    function admin_deposit(uint256[] calldata tokenIds) onlyOwner() external nonReentrant {
        claimRewardsInt(tokenIds);

        for (uint256 i; i < tokenIds.length; ) {
            IERC721(ERC721_CONTRACT).safeTransferFrom(
                msg.sender,
                address(this),
                tokenIds[i],
                ''
            );
            _deposits[msg.sender].add(tokenIds[i]);
            unchecked{ i++; }
        }
    }

    function withdraw(uint256[] calldata tokenIds) external nonReentrant {
        claimRewardsInt(tokenIds);

        for (uint256 i; i < tokenIds.length; ) {
            require(
                _deposits[msg.sender].contains(tokenIds[i]),
                'StakeFlowtys: Token not deposited'
            );

            _deposits[msg.sender].remove(tokenIds[i]);

            IERC721(ERC721_CONTRACT).safeTransferFrom(
                address(this),
                msg.sender,
                tokenIds[i],
                ''
            );
            unchecked{ i++; }
        }
    }
}

File 2 of 9 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 3 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 9 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 5 of 9 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 6 of 9 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

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

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

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

File 7 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 8 of 9 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 9 of 9 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_erc20","type":"address"},{"internalType":"address","name":"_erc721","type":"address"},{"internalType":"address","name":"_proxy","type":"address"},{"internalType":"uint256","name":"_expiration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ERC20_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC721_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXPIRATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARDS_PROXY_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"admin_deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bonusExpireBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonusRewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"calculateRewards","outputs":[{"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"calculateRewardsAll","outputs":[{"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRewardsAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"claimRewardsAllFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"depositBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"depositsOf","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"startingBlock","type":"uint256"}],"name":"findRate","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_expiration","type":"uint256"}],"name":"setBonusExpiration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"setBonusRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_expiration","type":"uint256"}],"name":"setExpiration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rarity","type":"uint256"},{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"setRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"setTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162001d7438038062001d748339810160408190526200003491620001ae565b6200003f33620000e2565b60018055600280546001600160a01b038087166001600160a01b0319928316179092556003805486841690831617905560048054928516929091169190911790556200008c814362000200565b600590815560408051608081018252918252600a6020830152600f9082015260146060820152620000c290600890600462000132565b50506608e1bc9bf04000600c555050600e805460ff191690555062000227565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b826004810192821562000168579160200282015b8281111562000168578251829060ff1690559160200191906001019062000146565b50620001769291506200017a565b5090565b5b808211156200017657600081556001016200017b565b80516001600160a01b0381168114620001a957600080fd5b919050565b60008060008060808587031215620001c557600080fd5b620001d08562000191565b9350620001e06020860162000191565b9250620001f06040860162000191565b6060959095015193969295505050565b600082198211156200022257634e487b7160e01b600052601160045260246000fd5b500190565b611b3d80620002376000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80636b9f69b4116100f9578063b97e439a11610097578063d98701bb11610071578063d98701bb146103cb578063e3a9db1a146103de578063e4fcf329146103f1578063f2fde38b1461040457600080fd5b8063b97e439a1461039c578063bb4b5734146103af578063cea01962146103b857600080fd5b80638da5cb5b116100d35780638da5cb5b1461035c578063983d95ce1461036d578063a1c8a39614610380578063aeb50f901461039357600080fd5b80636b9f69b41461032e578063715018a6146103415780638b8d841b1461034957600080fd5b806346df2ccb11610166578063569b4e7711610140578063569b4e77146102ed578063598b8e71146103005780635eac62391461031357806362b83dda1461032657600080fd5b806346df2ccb146102b4578063515a20ba146102c757806351e7a059146102da57600080fd5b8063150b7a02116101a2578063150b7a021461023557806316c2acb21461026d5780631b8690dc1461029857806326a4e8d2146102a157600080fd5b8063068c526f146101c957806306dfe2d1146101f257806311cbef3d1461022b575b600080fd5b6101dc6101d7366004611806565b610417565b6040516101e991906119db565b60405180910390f35b61021d6102003660046118de565b600760209081526000928352604080842090915290825290205481565b6040519081526020016101e9565b610233610593565b005b61025461024336600461176b565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016101e9565b600354610280906001600160a01b031681565b6040516001600160a01b0390911681526020016101e9565b61021d600d5481565b6102336102af366004611750565b6105f4565b6102336102c2366004611996565b61066b565b6102336102d536600461197d565b6106cd565b6101dc6102e8366004611806565b61071a565b6102336102fb36600461197d565b61083d565b61023361030e366004611908565b61088a565b610233610321366004611908565b610a56565b610233610ac0565b600254610280906001600160a01b031681565b610233610b27565b600454610280906001600160a01b031681565b6000546001600160a01b0316610280565b61023361037b366004611908565b610b7b565b61023361038e366004611750565b610d53565b61021d600c5481565b6102336103aa366004611908565b610e3b565b61021d60055481565b61021d6103c636600461197d565b610fb0565b61021d6103d9366004611996565b610fc7565b6101dc6103ec366004611750565b6110a9565b6102336103ff36600461197d565b61115b565b610233610412366004611750565b6111a8565b6060815167ffffffffffffffff81111561043357610433611ad1565b60405190808252806020026020018201604052801561045c578160200160208202803683370190505b50905060005b825181101561058c57600083828151811061047f5761047f611abb565b602002602001015190506104c08160066000886001600160a01b03166001600160a01b0316815260200190815260200160002061126190919063ffffffff16565b15610562576001600160a01b03851660009081526007602090815260408083208484529091528120546104f4908390610fc7565b6001600160a01b03871660009081526007602090815260408083208684529091529020546005549192509061052a90439061127c565b6105349190611a78565b61053e9082611a59565b84848151811061055057610550611abb565b60200260200101818152505050610583565b600083838151811061057657610576611abb565b6020026020010181815250505b50600101610462565b5092915050565b6000546001600160a01b031633146105e05760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064015b60405180910390fd5b600e805460ff19811660ff90911615179055565b6000546001600160a01b0316331461063c5760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106b35760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b80600883600481106106c7576106c7611abb565b01555050565b6000546001600160a01b031633146107155760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b600555565b6060815167ffffffffffffffff81111561073657610736611ad1565b60405190808252806020026020018201604052801561075f578160200160208202803683370190505b506001600160a01b03841660009081526006602052604081209192505b83518110156108355760006107918383611292565b6001600160a01b0387166000908152600760209081526040808320848452909152812054919250906107c4908390610fc7565b6001600160a01b0388166000908152600760209081526040808320868452909152902054600554919250906107fa90439061127c565b6108049190611a78565b61080e9082611a59565b85848151811061082057610820611abb565b6020908102919091010152505060010161077c565b505092915050565b6000546001600160a01b031633146108855760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b600d55565b600260015414156108dd5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155600e5460ff1661095a5760405162461bcd60e51b815260206004820152602e60248201527f5374616b65466c6f777479733a205374616b696e6720636f6e7472616374206e60448201527f6f7420737461727465642079657400000000000000000000000000000000000060648201526084016105d7565b610964828261129e565b60005b81811015610a4d576003546001600160a01b031663b88d4fde333086868681811061099457610994611abb565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b1580156109f957600080fd5b505af1158015610a0d573d6000803e3d6000fd5b50505050610a44838383818110610a2657610a26611abb565b336000908152600660209081526040909120939102013590506113dc565b50600101610967565b50506001805550565b60026001541415610aa95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155610ab8828261129e565b505060018055565b60026001541415610b135760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155610b21336113e8565b60018055565b6000546001600160a01b03163314610b6f5760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b610b796000611555565b565b60026001541415610bce5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155610bdd828261129e565b60005b81811015610a4d57610c1b838383818110610bfd57610bfd611abb565b33600090815260066020908152604090912093910201359050611261565b610c715760405162461bcd60e51b815260206004820152602160248201527f5374616b65466c6f777479733a20546f6b656e206e6f74206465706f736974656044820152601960fa1b60648201526084016105d7565b610ca4838383818110610c8657610c86611abb565b336000908152600660209081526040909120939102013590506115b2565b506003546001600160a01b031663b88d4fde3033868686818110610cca57610cca611abb565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b158015610d2f57600080fd5b505af1158015610d43573d6000803e3d6000fd5b505060019092019150610be09050565b60026001541415610da65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b60026001556004546001600160a01b03163314610e2b5760405162461bcd60e51b815260206004820152603060248201527f5374616b65466c6f777479733a2066756e6374696f6e206f6e6c7920666f722060448201527f612070726f787920636f6e74726163740000000000000000000000000000000060648201526084016105d7565b610e34816113e8565b5060018055565b6000546001600160a01b03163314610e835760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b60026001541415610ed65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155610ee5828261129e565b60005b81811015610a4d576003546001600160a01b031663b88d4fde3330868686818110610f1557610f15611abb565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b158015610f7a57600080fd5b505af1158015610f8e573d6000803e3d6000fd5b50505050610fa7838383818110610a2657610a26611abb565b50600101610ee8565b60088160048110610fc057600080fd5b0154905081565b60035460405163071b804560e11b81526004810184905260009182916001600160a01b0390911690630e37008a9060240160206040518083038186803b15801561101057600080fd5b505afa158015611024573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104891906119b8565b60ff16905060006008826004811061106257611062611abb565b0154905061177061107b82670de0b6b3a7640000611a59565b6110859190611a37565b9250600d5484101561083557600c5461109e9084611a1f565b925050505b92915050565b6001600160a01b03811660009081526006602052604081206060916110cd826115be565b67ffffffffffffffff8111156110e5576110e5611ad1565b60405190808252806020026020018201604052801561110e578160200160208202803683370190505b50905060005b61111d836115be565b8110156111535761112e8382611292565b82828151811061114057611140611abb565b6020908102919091010152600101611114565b509392505050565b6000546001600160a01b031633146111a35760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b600c55565b6000546001600160a01b031633146111f05760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b6001600160a01b0381166112555760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d7565b61125e81611555565b50565b600081815260018301602052604081205415155b9392505050565b600081831061128b5781611275565b5090919050565b600061127583836115c8565b6000806112ad4360055461127c565b905060006112ee3386868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061041792505050565b905060005b848110156113695781818151811061130d5761130d611abb565b6020026020010151846113209190611a1f565b33600090815260076020526040812091955084919088888581811061134757611347611abb565b60209081029290920135835250810191909152604001600020556001016112f3565b5082156113d5576002546040516310722fb760e11b8152336004820152602481018590526001600160a01b03909116906320e45f6e90604401600060405180830381600087803b1580156113bc57600080fd5b505af11580156113d0573d6000803e3d6000fd5b505050505b5050505050565b600061127583836115f2565b6000806113f74360055461127c565b6001600160a01b038416600090815260066020526040812091925061141b826115be565b67ffffffffffffffff81111561143357611433611ad1565b60405190808252806020026020018201604052801561145c578160200160208202803683370190505b509050600061146b868361071a565b905060005b82518110156114df5781818151811061148b5761148b611abb565b60200260200101518661149e9190611a1f565b6001600160a01b03881660009081526007602052604081209197508691906114c68785611292565b8152602081019190915260400160002055600101611470565b50841561154d576002546040516310722fb760e11b81526001600160a01b03888116600483015260248201889052909116906320e45f6e90604401600060405180830381600087803b15801561153457600080fd5b505af1158015611548573d6000803e3d6000fd5b505050505b505050505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006112758383611641565b60006110a3825490565b60008260000182815481106115df576115df611abb565b9060005260206000200154905092915050565b6000818152600183016020526040812054611639575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556110a3565b5060006110a3565b6000818152600183016020526040812054801561172a576000611665600183611a78565b855490915060009061167990600190611a78565b90508181146116de57600086600001828154811061169957611699611abb565b90600052602060002001549050808760000184815481106116bc576116bc611abb565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116ef576116ef611aa5565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506110a3565b60009150506110a3565b80356001600160a01b038116811461174b57600080fd5b919050565b60006020828403121561176257600080fd5b61127582611734565b60008060008060006080868803121561178357600080fd5b61178c86611734565b945061179a60208701611734565b935060408601359250606086013567ffffffffffffffff808211156117be57600080fd5b818801915088601f8301126117d257600080fd5b8135818111156117e157600080fd5b8960208285010111156117f357600080fd5b9699959850939650602001949392505050565b6000806040838503121561181957600080fd5b61182283611734565b915060208084013567ffffffffffffffff8082111561184057600080fd5b818601915086601f83011261185457600080fd5b81358181111561186657611866611ad1565b8060051b604051601f19603f8301168101818110858211171561188b5761188b611ad1565b604052828152858101935084860182860187018b10156118aa57600080fd5b600095505b838610156118cd5780358552600195909501949386019386016118af565b508096505050505050509250929050565b600080604083850312156118f157600080fd5b6118fa83611734565b946020939093013593505050565b6000806020838503121561191b57600080fd5b823567ffffffffffffffff8082111561193357600080fd5b818501915085601f83011261194757600080fd5b81358181111561195657600080fd5b8660208260051b850101111561196b57600080fd5b60209290920196919550909350505050565b60006020828403121561198f57600080fd5b5035919050565b600080604083850312156119a957600080fd5b50508035926020909101359150565b6000602082840312156119ca57600080fd5b815160ff8116811461127557600080fd5b6020808252825182820181905260009190848201906040850190845b81811015611a13578351835292840192918401916001016119f7565b50909695505050505050565b60008219821115611a3257611a32611a8f565b500190565b600082611a5457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7357611a73611a8f565b500290565b600082821015611a8a57611a8a611a8f565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122096d1b73400078eb911865a70c542cd9e1c99d1891a15066c4102fb1ef2d1c19764736f6c63430008070033000000000000000000000000b8bc04a8be09c4734e3b1a6169dcc0a4cd6d5efa00000000000000000000000052607cb9c342821ea41ad265b9bb6a23bea494680000000000000000000000008e6ec3ac7a484bb9a162b35c75116f3abfeab6610000000000000000000000000000000000000000000000000000000000462cd8

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80636b9f69b4116100f9578063b97e439a11610097578063d98701bb11610071578063d98701bb146103cb578063e3a9db1a146103de578063e4fcf329146103f1578063f2fde38b1461040457600080fd5b8063b97e439a1461039c578063bb4b5734146103af578063cea01962146103b857600080fd5b80638da5cb5b116100d35780638da5cb5b1461035c578063983d95ce1461036d578063a1c8a39614610380578063aeb50f901461039357600080fd5b80636b9f69b41461032e578063715018a6146103415780638b8d841b1461034957600080fd5b806346df2ccb11610166578063569b4e7711610140578063569b4e77146102ed578063598b8e71146103005780635eac62391461031357806362b83dda1461032657600080fd5b806346df2ccb146102b4578063515a20ba146102c757806351e7a059146102da57600080fd5b8063150b7a02116101a2578063150b7a021461023557806316c2acb21461026d5780631b8690dc1461029857806326a4e8d2146102a157600080fd5b8063068c526f146101c957806306dfe2d1146101f257806311cbef3d1461022b575b600080fd5b6101dc6101d7366004611806565b610417565b6040516101e991906119db565b60405180910390f35b61021d6102003660046118de565b600760209081526000928352604080842090915290825290205481565b6040519081526020016101e9565b610233610593565b005b61025461024336600461176b565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016101e9565b600354610280906001600160a01b031681565b6040516001600160a01b0390911681526020016101e9565b61021d600d5481565b6102336102af366004611750565b6105f4565b6102336102c2366004611996565b61066b565b6102336102d536600461197d565b6106cd565b6101dc6102e8366004611806565b61071a565b6102336102fb36600461197d565b61083d565b61023361030e366004611908565b61088a565b610233610321366004611908565b610a56565b610233610ac0565b600254610280906001600160a01b031681565b610233610b27565b600454610280906001600160a01b031681565b6000546001600160a01b0316610280565b61023361037b366004611908565b610b7b565b61023361038e366004611750565b610d53565b61021d600c5481565b6102336103aa366004611908565b610e3b565b61021d60055481565b61021d6103c636600461197d565b610fb0565b61021d6103d9366004611996565b610fc7565b6101dc6103ec366004611750565b6110a9565b6102336103ff36600461197d565b61115b565b610233610412366004611750565b6111a8565b6060815167ffffffffffffffff81111561043357610433611ad1565b60405190808252806020026020018201604052801561045c578160200160208202803683370190505b50905060005b825181101561058c57600083828151811061047f5761047f611abb565b602002602001015190506104c08160066000886001600160a01b03166001600160a01b0316815260200190815260200160002061126190919063ffffffff16565b15610562576001600160a01b03851660009081526007602090815260408083208484529091528120546104f4908390610fc7565b6001600160a01b03871660009081526007602090815260408083208684529091529020546005549192509061052a90439061127c565b6105349190611a78565b61053e9082611a59565b84848151811061055057610550611abb565b60200260200101818152505050610583565b600083838151811061057657610576611abb565b6020026020010181815250505b50600101610462565b5092915050565b6000546001600160a01b031633146105e05760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064015b60405180910390fd5b600e805460ff19811660ff90911615179055565b6000546001600160a01b0316331461063c5760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106b35760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b80600883600481106106c7576106c7611abb565b01555050565b6000546001600160a01b031633146107155760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b600555565b6060815167ffffffffffffffff81111561073657610736611ad1565b60405190808252806020026020018201604052801561075f578160200160208202803683370190505b506001600160a01b03841660009081526006602052604081209192505b83518110156108355760006107918383611292565b6001600160a01b0387166000908152600760209081526040808320848452909152812054919250906107c4908390610fc7565b6001600160a01b0388166000908152600760209081526040808320868452909152902054600554919250906107fa90439061127c565b6108049190611a78565b61080e9082611a59565b85848151811061082057610820611abb565b6020908102919091010152505060010161077c565b505092915050565b6000546001600160a01b031633146108855760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b600d55565b600260015414156108dd5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155600e5460ff1661095a5760405162461bcd60e51b815260206004820152602e60248201527f5374616b65466c6f777479733a205374616b696e6720636f6e7472616374206e60448201527f6f7420737461727465642079657400000000000000000000000000000000000060648201526084016105d7565b610964828261129e565b60005b81811015610a4d576003546001600160a01b031663b88d4fde333086868681811061099457610994611abb565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b1580156109f957600080fd5b505af1158015610a0d573d6000803e3d6000fd5b50505050610a44838383818110610a2657610a26611abb565b336000908152600660209081526040909120939102013590506113dc565b50600101610967565b50506001805550565b60026001541415610aa95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155610ab8828261129e565b505060018055565b60026001541415610b135760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155610b21336113e8565b60018055565b6000546001600160a01b03163314610b6f5760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b610b796000611555565b565b60026001541415610bce5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155610bdd828261129e565b60005b81811015610a4d57610c1b838383818110610bfd57610bfd611abb565b33600090815260066020908152604090912093910201359050611261565b610c715760405162461bcd60e51b815260206004820152602160248201527f5374616b65466c6f777479733a20546f6b656e206e6f74206465706f736974656044820152601960fa1b60648201526084016105d7565b610ca4838383818110610c8657610c86611abb565b336000908152600660209081526040909120939102013590506115b2565b506003546001600160a01b031663b88d4fde3033868686818110610cca57610cca611abb565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b158015610d2f57600080fd5b505af1158015610d43573d6000803e3d6000fd5b505060019092019150610be09050565b60026001541415610da65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b60026001556004546001600160a01b03163314610e2b5760405162461bcd60e51b815260206004820152603060248201527f5374616b65466c6f777479733a2066756e6374696f6e206f6e6c7920666f722060448201527f612070726f787920636f6e74726163740000000000000000000000000000000060648201526084016105d7565b610e34816113e8565b5060018055565b6000546001600160a01b03163314610e835760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b60026001541415610ed65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105d7565b6002600155610ee5828261129e565b60005b81811015610a4d576003546001600160a01b031663b88d4fde3330868686818110610f1557610f15611abb565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b158015610f7a57600080fd5b505af1158015610f8e573d6000803e3d6000fd5b50505050610fa7838383818110610a2657610a26611abb565b50600101610ee8565b60088160048110610fc057600080fd5b0154905081565b60035460405163071b804560e11b81526004810184905260009182916001600160a01b0390911690630e37008a9060240160206040518083038186803b15801561101057600080fd5b505afa158015611024573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104891906119b8565b60ff16905060006008826004811061106257611062611abb565b0154905061177061107b82670de0b6b3a7640000611a59565b6110859190611a37565b9250600d5484101561083557600c5461109e9084611a1f565b925050505b92915050565b6001600160a01b03811660009081526006602052604081206060916110cd826115be565b67ffffffffffffffff8111156110e5576110e5611ad1565b60405190808252806020026020018201604052801561110e578160200160208202803683370190505b50905060005b61111d836115be565b8110156111535761112e8382611292565b82828151811061114057611140611abb565b6020908102919091010152600101611114565b509392505050565b6000546001600160a01b031633146111a35760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b600c55565b6000546001600160a01b031633146111f05760405162461bcd60e51b81526020600482018190526024820152600080516020611ae883398151915260448201526064016105d7565b6001600160a01b0381166112555760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d7565b61125e81611555565b50565b600081815260018301602052604081205415155b9392505050565b600081831061128b5781611275565b5090919050565b600061127583836115c8565b6000806112ad4360055461127c565b905060006112ee3386868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061041792505050565b905060005b848110156113695781818151811061130d5761130d611abb565b6020026020010151846113209190611a1f565b33600090815260076020526040812091955084919088888581811061134757611347611abb565b60209081029290920135835250810191909152604001600020556001016112f3565b5082156113d5576002546040516310722fb760e11b8152336004820152602481018590526001600160a01b03909116906320e45f6e90604401600060405180830381600087803b1580156113bc57600080fd5b505af11580156113d0573d6000803e3d6000fd5b505050505b5050505050565b600061127583836115f2565b6000806113f74360055461127c565b6001600160a01b038416600090815260066020526040812091925061141b826115be565b67ffffffffffffffff81111561143357611433611ad1565b60405190808252806020026020018201604052801561145c578160200160208202803683370190505b509050600061146b868361071a565b905060005b82518110156114df5781818151811061148b5761148b611abb565b60200260200101518661149e9190611a1f565b6001600160a01b03881660009081526007602052604081209197508691906114c68785611292565b8152602081019190915260400160002055600101611470565b50841561154d576002546040516310722fb760e11b81526001600160a01b03888116600483015260248201889052909116906320e45f6e90604401600060405180830381600087803b15801561153457600080fd5b505af1158015611548573d6000803e3d6000fd5b505050505b505050505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006112758383611641565b60006110a3825490565b60008260000182815481106115df576115df611abb565b9060005260206000200154905092915050565b6000818152600183016020526040812054611639575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556110a3565b5060006110a3565b6000818152600183016020526040812054801561172a576000611665600183611a78565b855490915060009061167990600190611a78565b90508181146116de57600086600001828154811061169957611699611abb565b90600052602060002001549050808760000184815481106116bc576116bc611abb565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116ef576116ef611aa5565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506110a3565b60009150506110a3565b80356001600160a01b038116811461174b57600080fd5b919050565b60006020828403121561176257600080fd5b61127582611734565b60008060008060006080868803121561178357600080fd5b61178c86611734565b945061179a60208701611734565b935060408601359250606086013567ffffffffffffffff808211156117be57600080fd5b818801915088601f8301126117d257600080fd5b8135818111156117e157600080fd5b8960208285010111156117f357600080fd5b9699959850939650602001949392505050565b6000806040838503121561181957600080fd5b61182283611734565b915060208084013567ffffffffffffffff8082111561184057600080fd5b818601915086601f83011261185457600080fd5b81358181111561186657611866611ad1565b8060051b604051601f19603f8301168101818110858211171561188b5761188b611ad1565b604052828152858101935084860182860187018b10156118aa57600080fd5b600095505b838610156118cd5780358552600195909501949386019386016118af565b508096505050505050509250929050565b600080604083850312156118f157600080fd5b6118fa83611734565b946020939093013593505050565b6000806020838503121561191b57600080fd5b823567ffffffffffffffff8082111561193357600080fd5b818501915085601f83011261194757600080fd5b81358181111561195657600080fd5b8660208260051b850101111561196b57600080fd5b60209290920196919550909350505050565b60006020828403121561198f57600080fd5b5035919050565b600080604083850312156119a957600080fd5b50508035926020909101359150565b6000602082840312156119ca57600080fd5b815160ff8116811461127557600080fd5b6020808252825182820181905260009190848201906040850190845b81811015611a13578351835292840192918401916001016119f7565b50909695505050505050565b60008219821115611a3257611a32611a8f565b500190565b600082611a5457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7357611a73611a8f565b500290565b600082821015611a8a57611a8a611a8f565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122096d1b73400078eb911865a70c542cd9e1c99d1891a15066c4102fb1ef2d1c19764736f6c63430008070033

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

000000000000000000000000b8bc04a8be09c4734e3b1a6169dcc0a4cd6d5efa00000000000000000000000052607cb9c342821ea41ad265b9bb6a23bea494680000000000000000000000008e6ec3ac7a484bb9a162b35c75116f3abfeab6610000000000000000000000000000000000000000000000000000000000462cd8

-----Decoded View---------------
Arg [0] : _erc20 (address): 0xB8BC04A8be09C4734e3B1a6169dcC0a4CD6d5efA
Arg [1] : _erc721 (address): 0x52607cb9c342821ea41ad265B9Bb6a23BEa49468
Arg [2] : _proxy (address): 0x8E6Ec3ac7a484bb9A162B35C75116F3aBFeAb661
Arg [3] : _expiration (uint256): 4599000

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000b8bc04a8be09c4734e3b1a6169dcc0a4cd6d5efa
Arg [1] : 00000000000000000000000052607cb9c342821ea41ad265b9bb6a23bea49468
Arg [2] : 0000000000000000000000008e6ec3ac7a484bb9a162b35c75116f3abfeab661
Arg [3] : 0000000000000000000000000000000000000000000000000000000000462cd8


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  ]

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.