ETH Price: $2,638.85 (-0.57%)
Gas: 3 Gwei

Contract

0x5388f63363d2EF6812AE55c9E41D68096588e36e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw184875242023-11-02 22:59:59283 days ago1698965999IN
0x5388f633...96588e36e
0 ETH0.0024324126.66999483
Deposit162844862022-12-28 16:36:11592 days ago1672245371IN
0x5388f633...96588e36e
0 ETH0.0047650418.21792811
Withdraw161639602022-12-11 20:49:47609 days ago1670791787IN
0x5388f633...96588e36e
0 ETH0.0015213214.28417862
Deposit158903922022-11-03 15:29:35647 days ago1667489375IN
0x5388f633...96588e36e
0 ETH0.0032827423.39668423
Deposit156038172022-09-24 14:28:23687 days ago1664029703IN
0x5388f633...96588e36e
0 ETH0.000893885.6787765
Deposit155806722022-09-21 8:45:35691 days ago1663749935IN
0x5388f633...96588e36e
0 ETH0.000667574.24105137
Deposit154662802022-09-03 15:56:47708 days ago1662220607IN
0x5388f633...96588e36e
0 ETH0.001729687.23588885
Deposit154590742022-09-02 12:07:46709 days ago1662120466IN
0x5388f633...96588e36e
0 ETH0.0018697111.87724571
Deposit154326622022-08-29 6:57:21714 days ago1661756241IN
0x5388f633...96588e36e
0 ETH0.00267164.78520248
Deposit153829112022-08-21 8:28:15722 days ago1661070495IN
0x5388f633...96588e36e
0 ETH0.005166364.71865675
Deposit153504912022-08-16 5:24:09727 days ago1660627449IN
0x5388f633...96588e36e
0 ETH0.0017296910.9877638
Deposit153290632022-08-12 20:10:56730 days ago1660335056IN
0x5388f633...96588e36e
0 ETH0.0083441922.81655682
Deposit153224572022-08-11 19:13:54731 days ago1660245234IN
0x5388f633...96588e36e
0 ETH0.020592218.80772997
Deposit153165522022-08-10 20:45:10732 days ago1660164310IN
0x5388f633...96588e36e
0 ETH0.0082287122.49855558
Deposit153096012022-08-09 18:41:10733 days ago1660070470IN
0x5388f633...96588e36e
0 ETH0.003204920.35891959
Deposit153093692022-08-09 17:48:01733 days ago1660067281IN
0x5388f633...96588e36e
0 ETH0.0132950328.2929589
Deposit153058162022-08-09 4:12:47734 days ago1660018367IN
0x5388f633...96588e36e
0 ETH0.0027378210.46735445
Deposit153021952022-08-08 14:49:58734 days ago1659970198IN
0x5388f633...96588e36e
0 ETH0.0021209613.4733149
Deposit153002622022-08-08 7:37:42735 days ago1659944262IN
0x5388f633...96588e36e
0 ETH0.002594427.0942413
Deposit152960462022-08-07 15:38:12735 days ago1659886692IN
0x5388f633...96588e36e
0 ETH0.0025877816.43875221
Deposit152930592022-08-07 4:42:43736 days ago1659847363IN
0x5388f633...96588e36e
0 ETH0.001435015.88441361
Deposit152906102022-08-06 19:30:24736 days ago1659814224IN
0x5388f633...96588e36e
0 ETH0.002064075.64405196
Deposit152905632022-08-06 19:20:27736 days ago1659813627IN
0x5388f633...96588e36e
0 ETH0.001058756.72566792
Deposit152904722022-08-06 19:00:17736 days ago1659812417IN
0x5388f633...96588e36e
0 ETH0.001184257.52345273
Deposit152898652022-08-06 16:47:32736 days ago1659804452IN
0x5388f633...96588e36e
0 ETH0.00108596.89867074
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:
StakeMLA

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 500 runs

Other Settings:
default evmVersion
File 1 of 9 : StakeMLA.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;
}

contract StakeMLA 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 public rewardRate;   
    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 = uint256(2 * 1e18) / 6000;
        started = false;
    }

    function setRate(uint256 _rate) public onlyOwner() {
        rewardRate = (_rate * 1e18) / 6000;
    }

    function setExpiration(uint256 _expiration) public onlyOwner() {
        EXPIRATION = _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 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)) {
              rewards[i] =
                  rewardRate *
                  (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);
            rewards[i] = rewardRate *
                (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, 'StakeMLA: function only for a proxy contract');
        claimRewardsAllInt(user);
    }

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

    function deposit(uint256[] calldata tokenIds) external nonReentrant {
        require(started, 'StakeMLA: 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]),
                'StakeMLA: 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":[{"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":"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":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_expiration","type":"uint256"}],"name":"setExpiration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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"}]

60806040523480156200001157600080fd5b5060405162001a1c38038062001a1c83398101604081905262000034916200012a565b6200003f33620000bd565b60018055600280546001600160a01b038087166001600160a01b0319928316179092556003805486841690831617905560048054928516929091169190911790556200008c81436200017c565b600555620000a5611770671bc16d674ec80000620001a3565b60085550506009805460ff1916905550620001c69050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200012557600080fd5b919050565b600080600080608085870312156200014157600080fd5b6200014c856200010d565b93506200015c602086016200010d565b92506200016c604086016200010d565b6060959095015193969295505050565b600082198211156200019e57634e487b7160e01b600052601160045260246000fd5b500190565b600082620001c157634e487b7160e01b600052601260045260246000fd5b500490565b61184680620001d66000396000f3fe608060405234801561001057600080fd5b506004361061017d5760003560e01c806362b83dda116100e3578063983d95ce1161008c578063bb4b573411610066578063bb4b57341461034c578063e3a9db1a14610355578063f2fde38b1461036857600080fd5b8063983d95ce14610313578063a1c8a39614610326578063b97e439a1461033957600080fd5b80637b0a47ee116100bd5780637b0a47ee146102e65780638b8d841b146102ef5780638da5cb5b1461030257600080fd5b806362b83dda146102c35780636b9f69b4146102cb578063715018a6146102de57600080fd5b806326a4e8d21161014557806351e7a0591161011f57806351e7a0591461028a578063598b8e711461029d5780635eac6239146102b057600080fd5b806326a4e8d21461025157806334fcf43714610264578063515a20ba1461027757600080fd5b8063068c526f1461018257806306dfe2d1146101ab57806311cbef3d146101e4578063150b7a02146101ee57806316c2acb214610226575b600080fd5b610195610190366004611554565b61037b565b6040516101a291906116e4565b60405180910390f35b6101d66101b936600461162c565b600760209081526000928352604080842090915290825290205481565b6040519081526020016101a2565b6101ec6104c6565b005b61020d6101fc3660046114b9565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016101a2565b600354610239906001600160a01b031681565b6040516001600160a01b0390911681526020016101a2565b6101ec61025f36600461149e565b610527565b6101ec6102723660046116cb565b61059e565b6101ec6102853660046116cb565b61060b565b610195610298366004611554565b610658565b6101ec6102ab366004611656565b61074a565b6101ec6102be366004611656565b610903565b6101ec61096d565b600254610239906001600160a01b031681565b6101ec6109d4565b6101d660085481565b600454610239906001600160a01b031681565b6000546001600160a01b0316610239565b6101ec610321366004611656565b610a28565b6101ec61033436600461149e565b610bf6565b6101ec610347366004611656565b610ccd565b6101d660055481565b61019561036336600461149e565b610e42565b6101ec61037636600461149e565b610ef4565b6060815167ffffffffffffffff811115610397576103976117da565b6040519080825280602002602001820160405280156103c0578160200160208202803683370190505b50905060005b82518110156104bf5760008382815181106103e3576103e36117c4565b602002602001015190506104248160066000886001600160a01b03166001600160a01b03168152602001908152602001600020610fad90919063ffffffff16565b15610495576001600160a01b038516600090815260076020908152604080832084845290915290205460055461045b904390610fca565b6104659190611781565b6008546104729190611762565b838381518110610484576104846117c4565b6020026020010181815250506104b6565b60008383815181106104a9576104a96117c4565b6020026020010181815250505b506001016103c6565b5092915050565b6000546001600160a01b031633146105135760405162461bcd60e51b815260206004820181905260248201526000805160206117f183398151915260448201526064015b60405180910390fd5b6009805460ff19811660ff90911615179055565b6000546001600160a01b0316331461056f5760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105e65760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b6117706105fb82670de0b6b3a7640000611762565b6106059190611740565b60085550565b6000546001600160a01b031633146106535760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b600555565b6060815167ffffffffffffffff811115610674576106746117da565b60405190808252806020026020018201604052801561069d578160200160208202803683370190505b506001600160a01b03841660009081526006602052604081209192505b83518110156107425760006106cf8383610fe0565b6001600160a01b038716600090815260076020908152604080832084845290915290205460055491925090610705904390610fca565b61070f9190611781565b60085461071c9190611762565b84838151811061072e5761072e6117c4565b6020908102919091010152506001016106ba565b505092915050565b6002600154141561079d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b600260015560095460ff166108075760405162461bcd60e51b815260206004820152602a60248201527f5374616b654d4c413a205374616b696e6720636f6e7472616374206e6f7420736044820152691d185c9d1959081e595d60b21b606482015260840161050a565b6108118282610fec565b60005b818110156108fa576003546001600160a01b031663b88d4fde3330868686818110610841576108416117c4565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b1580156108a657600080fd5b505af11580156108ba573d6000803e3d6000fd5b505050506108f18383838181106108d3576108d36117c4565b3360009081526006602090815260409091209391020135905061112a565b50600101610814565b50506001805550565b600260015414156109565760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b60026001556109658282610fec565b505060018055565b600260015414156109c05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b60026001556109ce33611136565b60018055565b6000546001600160a01b03163314610a1c5760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b610a2660006112a3565b565b60026001541415610a7b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b6002600155610a8a8282610fec565b60005b818110156108fa57610ac8838383818110610aaa57610aaa6117c4565b33600090815260066020908152604090912093910201359050610fad565b610b145760405162461bcd60e51b815260206004820152601d60248201527f5374616b654d4c413a20546f6b656e206e6f74206465706f7369746564000000604482015260640161050a565b610b47838383818110610b2957610b296117c4565b33600090815260066020908152604090912093910201359050611300565b506003546001600160a01b031663b88d4fde3033868686818110610b6d57610b6d6117c4565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b158015610bd257600080fd5b505af1158015610be6573d6000803e3d6000fd5b505060019092019150610a8d9050565b60026001541415610c495760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b60026001556004546001600160a01b03163314610cbd5760405162461bcd60e51b815260206004820152602c60248201527f5374616b654d4c413a2066756e6374696f6e206f6e6c7920666f72206120707260448201526b1bde1e4818dbdb9d1c9858dd60a21b606482015260840161050a565b610cc681611136565b5060018055565b6000546001600160a01b03163314610d155760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b60026001541415610d685760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b6002600155610d778282610fec565b60005b818110156108fa576003546001600160a01b031663b88d4fde3330868686818110610da757610da76117c4565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b158015610e0c57600080fd5b505af1158015610e20573d6000803e3d6000fd5b50505050610e398383838181106108d3576108d36117c4565b50600101610d7a565b6001600160a01b0381166000908152600660205260408120606091610e668261130c565b67ffffffffffffffff811115610e7e57610e7e6117da565b604051908082528060200260200182016040528015610ea7578160200160208202803683370190505b50905060005b610eb68361130c565b811015610eec57610ec78382610fe0565b828281518110610ed957610ed96117c4565b6020908102919091010152600101610ead565b509392505050565b6000546001600160a01b03163314610f3c5760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b6001600160a01b038116610fa15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161050a565b610faa816112a3565b50565b600081815260018301602052604081205415155b90505b92915050565b6000818310610fd95781610fc1565b5090919050565b6000610fc18383611316565b600080610ffb43600554610fca565b9050600061103c3386868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061037b92505050565b905060005b848110156110b75781818151811061105b5761105b6117c4565b60200260200101518461106e9190611728565b336000908152600760205260408120919550849190888885818110611095576110956117c4565b6020908102929092013583525081019190915260400160002055600101611041565b508215611123576002546040516310722fb760e11b8152336004820152602481018590526001600160a01b03909116906320e45f6e90604401600060405180830381600087803b15801561110a57600080fd5b505af115801561111e573d6000803e3d6000fd5b505050505b5050505050565b6000610fc18383611340565b60008061114543600554610fca565b6001600160a01b03841660009081526006602052604081209192506111698261130c565b67ffffffffffffffff811115611181576111816117da565b6040519080825280602002602001820160405280156111aa578160200160208202803683370190505b50905060006111b98683610658565b905060005b825181101561122d578181815181106111d9576111d96117c4565b6020026020010151866111ec9190611728565b6001600160a01b03881660009081526007602052604081209197508691906112148785610fe0565b81526020810191909152604001600020556001016111be565b50841561129b576002546040516310722fb760e11b81526001600160a01b03888116600483015260248201889052909116906320e45f6e90604401600060405180830381600087803b15801561128257600080fd5b505af1158015611296573d6000803e3d6000fd5b505050505b505050505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610fc1838361138f565b6000610fc4825490565b600082600001828154811061132d5761132d6117c4565b9060005260206000200154905092915050565b600081815260018301602052604081205461138757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610fc4565b506000610fc4565b600081815260018301602052604081205480156114785760006113b3600183611781565b85549091506000906113c790600190611781565b905081811461142c5760008660000182815481106113e7576113e76117c4565b906000526020600020015490508087600001848154811061140a5761140a6117c4565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061143d5761143d6117ae565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610fc4565b6000915050610fc4565b80356001600160a01b038116811461149957600080fd5b919050565b6000602082840312156114b057600080fd5b610fc182611482565b6000806000806000608086880312156114d157600080fd5b6114da86611482565b94506114e860208701611482565b935060408601359250606086013567ffffffffffffffff8082111561150c57600080fd5b818801915088601f83011261152057600080fd5b81358181111561152f57600080fd5b89602082850101111561154157600080fd5b9699959850939650602001949392505050565b6000806040838503121561156757600080fd5b61157083611482565b915060208084013567ffffffffffffffff8082111561158e57600080fd5b818601915086601f8301126115a257600080fd5b8135818111156115b4576115b46117da565b8060051b604051601f19603f830116810181811085821117156115d9576115d96117da565b604052828152858101935084860182860187018b10156115f857600080fd5b600095505b8386101561161b5780358552600195909501949386019386016115fd565b508096505050505050509250929050565b6000806040838503121561163f57600080fd5b61164883611482565b946020939093013593505050565b6000806020838503121561166957600080fd5b823567ffffffffffffffff8082111561168157600080fd5b818501915085601f83011261169557600080fd5b8135818111156116a457600080fd5b8660208260051b85010111156116b957600080fd5b60209290920196919550909350505050565b6000602082840312156116dd57600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b8181101561171c57835183529284019291840191600101611700565b50909695505050505050565b6000821982111561173b5761173b611798565b500190565b60008261175d57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561177c5761177c611798565b500290565b60008282101561179357611793611798565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122051cce0d24e768d02b0c18b78c18e0491abfb3b67f83f972b1c3853c9352f8e4564736f6c63430008070033000000000000000000000000b8bc04a8be09c4734e3b1a6169dcc0a4cd6d5efa0000000000000000000000002d0cfb7c593d5c7000dce5389d555883648a61c90000000000000000000000008e6ec3ac7a484bb9a162b35c75116f3abfeab6610000000000000000000000000000000000000000000000000000000000462cd8

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061017d5760003560e01c806362b83dda116100e3578063983d95ce1161008c578063bb4b573411610066578063bb4b57341461034c578063e3a9db1a14610355578063f2fde38b1461036857600080fd5b8063983d95ce14610313578063a1c8a39614610326578063b97e439a1461033957600080fd5b80637b0a47ee116100bd5780637b0a47ee146102e65780638b8d841b146102ef5780638da5cb5b1461030257600080fd5b806362b83dda146102c35780636b9f69b4146102cb578063715018a6146102de57600080fd5b806326a4e8d21161014557806351e7a0591161011f57806351e7a0591461028a578063598b8e711461029d5780635eac6239146102b057600080fd5b806326a4e8d21461025157806334fcf43714610264578063515a20ba1461027757600080fd5b8063068c526f1461018257806306dfe2d1146101ab57806311cbef3d146101e4578063150b7a02146101ee57806316c2acb214610226575b600080fd5b610195610190366004611554565b61037b565b6040516101a291906116e4565b60405180910390f35b6101d66101b936600461162c565b600760209081526000928352604080842090915290825290205481565b6040519081526020016101a2565b6101ec6104c6565b005b61020d6101fc3660046114b9565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016101a2565b600354610239906001600160a01b031681565b6040516001600160a01b0390911681526020016101a2565b6101ec61025f36600461149e565b610527565b6101ec6102723660046116cb565b61059e565b6101ec6102853660046116cb565b61060b565b610195610298366004611554565b610658565b6101ec6102ab366004611656565b61074a565b6101ec6102be366004611656565b610903565b6101ec61096d565b600254610239906001600160a01b031681565b6101ec6109d4565b6101d660085481565b600454610239906001600160a01b031681565b6000546001600160a01b0316610239565b6101ec610321366004611656565b610a28565b6101ec61033436600461149e565b610bf6565b6101ec610347366004611656565b610ccd565b6101d660055481565b61019561036336600461149e565b610e42565b6101ec61037636600461149e565b610ef4565b6060815167ffffffffffffffff811115610397576103976117da565b6040519080825280602002602001820160405280156103c0578160200160208202803683370190505b50905060005b82518110156104bf5760008382815181106103e3576103e36117c4565b602002602001015190506104248160066000886001600160a01b03166001600160a01b03168152602001908152602001600020610fad90919063ffffffff16565b15610495576001600160a01b038516600090815260076020908152604080832084845290915290205460055461045b904390610fca565b6104659190611781565b6008546104729190611762565b838381518110610484576104846117c4565b6020026020010181815250506104b6565b60008383815181106104a9576104a96117c4565b6020026020010181815250505b506001016103c6565b5092915050565b6000546001600160a01b031633146105135760405162461bcd60e51b815260206004820181905260248201526000805160206117f183398151915260448201526064015b60405180910390fd5b6009805460ff19811660ff90911615179055565b6000546001600160a01b0316331461056f5760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146105e65760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b6117706105fb82670de0b6b3a7640000611762565b6106059190611740565b60085550565b6000546001600160a01b031633146106535760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b600555565b6060815167ffffffffffffffff811115610674576106746117da565b60405190808252806020026020018201604052801561069d578160200160208202803683370190505b506001600160a01b03841660009081526006602052604081209192505b83518110156107425760006106cf8383610fe0565b6001600160a01b038716600090815260076020908152604080832084845290915290205460055491925090610705904390610fca565b61070f9190611781565b60085461071c9190611762565b84838151811061072e5761072e6117c4565b6020908102919091010152506001016106ba565b505092915050565b6002600154141561079d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b600260015560095460ff166108075760405162461bcd60e51b815260206004820152602a60248201527f5374616b654d4c413a205374616b696e6720636f6e7472616374206e6f7420736044820152691d185c9d1959081e595d60b21b606482015260840161050a565b6108118282610fec565b60005b818110156108fa576003546001600160a01b031663b88d4fde3330868686818110610841576108416117c4565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b1580156108a657600080fd5b505af11580156108ba573d6000803e3d6000fd5b505050506108f18383838181106108d3576108d36117c4565b3360009081526006602090815260409091209391020135905061112a565b50600101610814565b50506001805550565b600260015414156109565760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b60026001556109658282610fec565b505060018055565b600260015414156109c05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b60026001556109ce33611136565b60018055565b6000546001600160a01b03163314610a1c5760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b610a2660006112a3565b565b60026001541415610a7b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b6002600155610a8a8282610fec565b60005b818110156108fa57610ac8838383818110610aaa57610aaa6117c4565b33600090815260066020908152604090912093910201359050610fad565b610b145760405162461bcd60e51b815260206004820152601d60248201527f5374616b654d4c413a20546f6b656e206e6f74206465706f7369746564000000604482015260640161050a565b610b47838383818110610b2957610b296117c4565b33600090815260066020908152604090912093910201359050611300565b506003546001600160a01b031663b88d4fde3033868686818110610b6d57610b6d6117c4565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b158015610bd257600080fd5b505af1158015610be6573d6000803e3d6000fd5b505060019092019150610a8d9050565b60026001541415610c495760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b60026001556004546001600160a01b03163314610cbd5760405162461bcd60e51b815260206004820152602c60248201527f5374616b654d4c413a2066756e6374696f6e206f6e6c7920666f72206120707260448201526b1bde1e4818dbdb9d1c9858dd60a21b606482015260840161050a565b610cc681611136565b5060018055565b6000546001600160a01b03163314610d155760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b60026001541415610d685760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161050a565b6002600155610d778282610fec565b60005b818110156108fa576003546001600160a01b031663b88d4fde3330868686818110610da757610da76117c4565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152608060648201526000608482015260a401600060405180830381600087803b158015610e0c57600080fd5b505af1158015610e20573d6000803e3d6000fd5b50505050610e398383838181106108d3576108d36117c4565b50600101610d7a565b6001600160a01b0381166000908152600660205260408120606091610e668261130c565b67ffffffffffffffff811115610e7e57610e7e6117da565b604051908082528060200260200182016040528015610ea7578160200160208202803683370190505b50905060005b610eb68361130c565b811015610eec57610ec78382610fe0565b828281518110610ed957610ed96117c4565b6020908102919091010152600101610ead565b509392505050565b6000546001600160a01b03163314610f3c5760405162461bcd60e51b815260206004820181905260248201526000805160206117f1833981519152604482015260640161050a565b6001600160a01b038116610fa15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161050a565b610faa816112a3565b50565b600081815260018301602052604081205415155b90505b92915050565b6000818310610fd95781610fc1565b5090919050565b6000610fc18383611316565b600080610ffb43600554610fca565b9050600061103c3386868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061037b92505050565b905060005b848110156110b75781818151811061105b5761105b6117c4565b60200260200101518461106e9190611728565b336000908152600760205260408120919550849190888885818110611095576110956117c4565b6020908102929092013583525081019190915260400160002055600101611041565b508215611123576002546040516310722fb760e11b8152336004820152602481018590526001600160a01b03909116906320e45f6e90604401600060405180830381600087803b15801561110a57600080fd5b505af115801561111e573d6000803e3d6000fd5b505050505b5050505050565b6000610fc18383611340565b60008061114543600554610fca565b6001600160a01b03841660009081526006602052604081209192506111698261130c565b67ffffffffffffffff811115611181576111816117da565b6040519080825280602002602001820160405280156111aa578160200160208202803683370190505b50905060006111b98683610658565b905060005b825181101561122d578181815181106111d9576111d96117c4565b6020026020010151866111ec9190611728565b6001600160a01b03881660009081526007602052604081209197508691906112148785610fe0565b81526020810191909152604001600020556001016111be565b50841561129b576002546040516310722fb760e11b81526001600160a01b03888116600483015260248201889052909116906320e45f6e90604401600060405180830381600087803b15801561128257600080fd5b505af1158015611296573d6000803e3d6000fd5b505050505b505050505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610fc1838361138f565b6000610fc4825490565b600082600001828154811061132d5761132d6117c4565b9060005260206000200154905092915050565b600081815260018301602052604081205461138757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610fc4565b506000610fc4565b600081815260018301602052604081205480156114785760006113b3600183611781565b85549091506000906113c790600190611781565b905081811461142c5760008660000182815481106113e7576113e76117c4565b906000526020600020015490508087600001848154811061140a5761140a6117c4565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061143d5761143d6117ae565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610fc4565b6000915050610fc4565b80356001600160a01b038116811461149957600080fd5b919050565b6000602082840312156114b057600080fd5b610fc182611482565b6000806000806000608086880312156114d157600080fd5b6114da86611482565b94506114e860208701611482565b935060408601359250606086013567ffffffffffffffff8082111561150c57600080fd5b818801915088601f83011261152057600080fd5b81358181111561152f57600080fd5b89602082850101111561154157600080fd5b9699959850939650602001949392505050565b6000806040838503121561156757600080fd5b61157083611482565b915060208084013567ffffffffffffffff8082111561158e57600080fd5b818601915086601f8301126115a257600080fd5b8135818111156115b4576115b46117da565b8060051b604051601f19603f830116810181811085821117156115d9576115d96117da565b604052828152858101935084860182860187018b10156115f857600080fd5b600095505b8386101561161b5780358552600195909501949386019386016115fd565b508096505050505050509250929050565b6000806040838503121561163f57600080fd5b61164883611482565b946020939093013593505050565b6000806020838503121561166957600080fd5b823567ffffffffffffffff8082111561168157600080fd5b818501915085601f83011261169557600080fd5b8135818111156116a457600080fd5b8660208260051b85010111156116b957600080fd5b60209290920196919550909350505050565b6000602082840312156116dd57600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b8181101561171c57835183529284019291840191600101611700565b50909695505050505050565b6000821982111561173b5761173b611798565b500190565b60008261175d57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561177c5761177c611798565b500290565b60008282101561179357611793611798565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122051cce0d24e768d02b0c18b78c18e0491abfb3b67f83f972b1c3853c9352f8e4564736f6c63430008070033

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

000000000000000000000000b8bc04a8be09c4734e3b1a6169dcc0a4cd6d5efa0000000000000000000000002d0cfb7c593d5c7000dce5389d555883648a61c90000000000000000000000008e6ec3ac7a484bb9a162b35c75116f3abfeab6610000000000000000000000000000000000000000000000000000000000462cd8

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

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000b8bc04a8be09c4734e3b1a6169dcc0a4cd6d5efa
Arg [1] : 0000000000000000000000002d0cfb7c593d5c7000dce5389d555883648a61c9
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.