ETH Price: $2,061.20 (-5.19%)

Contract

0x4A75AF149e661EEc8E2CfA94742CF2eF586b7A4D
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Stake190448562024-01-20 1:41:59796 days ago1705714919IN
0x4A75AF14...F586b7A4D
0 ETH0.0032595519.58453977
Stake190448552024-01-20 1:41:47796 days ago1705714907IN
0x4A75AF14...F586b7A4D
0 ETH0.0027212619.5041872
Stake190448552024-01-20 1:41:47796 days ago1705714907IN
0x4A75AF14...F586b7A4D
0 ETH0.0039385719.5041872
Stake182789072023-10-04 18:20:47904 days ago1696443647IN
0x4A75AF14...F586b7A4D
0 ETH0.0004818810.96645928
Stake182789072023-10-04 18:20:47904 days ago1696443647IN
0x4A75AF14...F586b7A4D
0 ETH0.0020875310
Stake179549472023-08-20 9:04:59949 days ago1692522299IN
0x4A75AF14...F586b7A4D
0 ETH0.0023937211.46679985
Stake178486902023-08-05 12:12:59964 days ago1691237579IN
0x4A75AF14...F586b7A4D
0 ETH0.0032922415.77100925
Stake178392602023-08-04 4:31:59965 days ago1691123519IN
0x4A75AF14...F586b7A4D
0 ETH0.0022794515.70714499
Stake178392572023-08-04 4:31:23965 days ago1691123483IN
0x4A75AF14...F586b7A4D
0 ETH0.002474417.05051345
Stake178392562023-08-04 4:31:11965 days ago1691123471IN
0x4A75AF14...F586b7A4D
0 ETH0.00262314.19104687
Stake178392542023-08-04 4:30:47965 days ago1691123447IN
0x4A75AF14...F586b7A4D
0 ETH0.0029828916.35190953
Stake178392522023-08-04 4:30:23965 days ago1691123423IN
0x4A75AF14...F586b7A4D
0 ETH0.0036917.67641543
Stake178199852023-08-01 11:54:47968 days ago1690890887IN
0x4A75AF14...F586b7A4D
0 ETH0.002542513.98992292
Stake178178662023-08-01 4:48:47968 days ago1690865327IN
0x4A75AF14...F586b7A4D
0 ETH0.0029195213.98555139
Stake178113542023-07-31 6:59:23969 days ago1690786763IN
0x4A75AF14...F586b7A4D
0 ETH0.0018788412.94665022
Stake178113522023-07-31 6:58:59969 days ago1690786739IN
0x4A75AF14...F586b7A4D
0 ETH0.0023521112.89405135
Stake178099762023-07-31 2:21:47969 days ago1690770107IN
0x4A75AF14...F586b7A4D
0 ETH0.00230513.94279663
Stake178086582023-07-30 21:55:47970 days ago1690754147IN
0x4A75AF14...F586b7A4D
0 ETH0.0034430518.47507102
Stake178051052023-07-30 9:58:11970 days ago1690711091IN
0x4A75AF14...F586b7A4D
0 ETH0.0029212115.8044406
Stake178050442023-07-30 9:45:59970 days ago1690710359IN
0x4A75AF14...F586b7A4D
0 ETH0.0029161714.10367828
Stake178050062023-07-30 9:38:23970 days ago1690709903IN
0x4A75AF14...F586b7A4D
0 ETH0.0030329314.5288421
Stake178049132023-07-30 9:19:23970 days ago1690708763IN
0x4A75AF14...F586b7A4D
0 ETH0.0026530916.11473341
Stake178048812023-07-30 9:12:59970 days ago1690708379IN
0x4A75AF14...F586b7A4D
0 ETH0.002895315.87172085
Stake178048502023-07-30 9:06:47970 days ago1690708007IN
0x4A75AF14...F586b7A4D
0 ETH0.00337916.18660176
Stake178047232023-07-30 8:41:23970 days ago1690706483IN
0x4A75AF14...F586b7A4D
0 ETH0.0025497617.56980545
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Staking

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

contract Staking is ReentrancyGuard {
    using SafeERC20 for IERC20;

    // Interfaces for ERC20 and ERC721
    IERC20 public immutable rewardsToken;
    IERC721 public immutable nftCollection;

    // Constructor function to set the rewards token and the NFT collection addresses
    constructor(IERC721 _nftCollection, IERC20 _rewardsToken) {
        nftCollection = _nftCollection;
        rewardsToken = _rewardsToken;
    }

    struct StakedToken {
        address staker;
        uint256 tokenId;
    }

    // Staker info
    struct Staker {
        // Amount of tokens staked by the staker
        uint256 amountStaked;
        // Staked token ids
        StakedToken[] stakedTokens;
        // Last time of the rewards were calculated for this user
        uint256 timeOfLastUpdate;
        // Calculated, but unclaimed rewards for the User. The rewards are
        // calculated each time the user writes to the Smart Contract
        uint256 unclaimedRewards;
    }

    // Rewards per hour per token deposited in wei.
    uint256 private rewardsPerHour = 10 * 10 ** 18;

    // Mapping of User Address to Staker info
    mapping(address => Staker) public stakers;

    // Mapping of Token Id to staker. Made for the SC to remember
    // who to send back the ERC721 Token to.
    mapping(uint256 => address) public stakerAddress;

    // If address already has ERC721 Token/s staked, calculate the rewards.
    // Increment the amountStaked and map msg.sender to the Token Id of the staked
    // Token to later send back on withdrawal. Finally give timeOfLastUpdate the
    // value of now.
    function stake(uint256 _tokenId) external nonReentrant {
        // If wallet has tokens staked, calculate the rewards before adding the new token
        if (stakers[msg.sender].amountStaked > 0) {
            uint256 rewards = calculateRewards(msg.sender);
            stakers[msg.sender].unclaimedRewards += rewards;
        }

        // Wallet must own the token they are trying to stake
        require(
            nftCollection.ownerOf(_tokenId) == msg.sender,
            "You don't own this token!"
        );

        // Transfer the token from the wallet to the Smart contract
        nftCollection.transferFrom(msg.sender, address(this), _tokenId);

        // Create StakedToken
        StakedToken memory stakedToken = StakedToken(msg.sender, _tokenId);

        // Add the token to the stakedTokens array
        stakers[msg.sender].stakedTokens.push(stakedToken);

        // Increment the amount staked for this wallet
        stakers[msg.sender].amountStaked++;

        // Update the mapping of the tokenId to the staker's address
        stakerAddress[_tokenId] = msg.sender;

        // Update the timeOfLastUpdate for the staker
        stakers[msg.sender].timeOfLastUpdate = block.timestamp;
    }

    // Check if user has any ERC721 Tokens Staked and if they tried to withdraw,
    // calculate the rewards and store them in the unclaimedRewards
    // decrement the amountStaked of the user and transfer the ERC721 token back to them
    function withdraw(uint256 _tokenId) external nonReentrant {
        // Make sure the user has at least one token staked before withdrawing
        require(
            stakers[msg.sender].amountStaked > 0,
            "You have no tokens staked"
        );

        // Wallet must own the token they are trying to withdraw
        require(
            stakerAddress[_tokenId] == msg.sender,
            "You don't own this token!"
        );

        // Update the rewards for this user, as the amount of rewards decreases with less tokens.
        uint256 rewards = calculateRewards(msg.sender);
        stakers[msg.sender].unclaimedRewards += rewards;

        // Find the index of this token id in the stakedTokens array
        uint256 index = 0;
        for (uint256 i = 0; i < stakers[msg.sender].stakedTokens.length; i++) {
            if (
                stakers[msg.sender].stakedTokens[i].tokenId == _tokenId &&
                stakers[msg.sender].stakedTokens[i].staker != address(0)
            ) {
                index = i;
                break;
            }
        }

        // Set this token's .staker to be address 0 to mark it as no longer staked
        stakers[msg.sender].stakedTokens[index].staker = address(0);

        // Decrement the amount staked for this wallet
        stakers[msg.sender].amountStaked--;

        // Update the mapping of the tokenId to the be address(0) to indicate that the token is no longer staked
        stakerAddress[_tokenId] = address(0);

        // Transfer the token back to the withdrawer
        nftCollection.transferFrom(address(this), msg.sender, _tokenId);

        // Update the timeOfLastUpdate for the withdrawer
        stakers[msg.sender].timeOfLastUpdate = block.timestamp;
    }

    // Calculate rewards for the msg.sender, check if there are any rewards
    // claim, set unclaimedRewards to 0 and transfer the ERC20 Reward token
    // to the user.
    function claimRewards() external {
        uint256 rewards = calculateRewards(msg.sender) +
            stakers[msg.sender].unclaimedRewards;
        require(rewards > 0, "You have no rewards to claim");
        stakers[msg.sender].timeOfLastUpdate = block.timestamp;
        stakers[msg.sender].unclaimedRewards = 0;
        rewardsToken.safeTransfer(msg.sender, rewards);
    }

    //////////
    // View //
    //////////

    function availableRewards(address _staker) public view returns (uint256) {
        uint256 rewards = calculateRewards(_staker) +
            stakers[_staker].unclaimedRewards;
        return rewards;
    }

    function getStakedTokens(
        address _user
    ) public view returns (StakedToken[] memory) {
        // Check if we know this user
        if (stakers[_user].amountStaked > 0) {
            // Return all the tokens in the stakedToken Array for this user that are not -1
            StakedToken[] memory _stakedTokens = new StakedToken[](
                stakers[_user].amountStaked
            );
            uint256 _index = 0;

            for (uint256 j = 0; j < stakers[_user].stakedTokens.length; j++) {
                if (stakers[_user].stakedTokens[j].staker != (address(0))) {
                    _stakedTokens[_index] = stakers[_user].stakedTokens[j];
                    _index++;
                }
            }

            return _stakedTokens;
        }
        // Otherwise, return empty array
        else {
            return new StakedToken[](0);
        }
    }

    /////////////
    // Internal//
    /////////////

    // Calculate rewards for param _staker by calculating the time passed
    // since last update in hours and mulitplying it to ERC721 Tokens Staked
    // and rewardsPerHour.
    function calculateRewards(
        address _staker
    ) internal view returns (uint256 _rewards) {
        return (((
            ((block.timestamp - stakers[_staker].timeOfLastUpdate) *
                stakers[_staker].amountStaked)
        ) * rewardsPerHour) / (60 * 60));
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IERC721","name":"_nftCollection","type":"address"},{"internalType":"contract IERC20","name":"_rewardsToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"availableRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getStakedTokens","outputs":[{"components":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct Staking.StakedToken[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftCollection","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakers","outputs":[{"internalType":"uint256","name":"amountStaked","type":"uint256"},{"internalType":"uint256","name":"timeOfLastUpdate","type":"uint256"},{"internalType":"uint256","name":"unclaimedRewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052678ac7230489e8000060015534801561001c57600080fd5b5060405161114338038061114383398101604081905261003b9161005e565b60016000556001600160601b0319606092831b811660a052911b166080526100b0565b6000806040838503121561007157600080fd5b825161007c81610098565b602084015190925061008d81610098565b809150509250929050565b6001600160a01b03811681146100ad57600080fd5b50565b60805160601c60a05160601c61104d6100f66000396000818160e3015281816104610152818161081e015261090c0152600081816101a7015261057f015261104d6000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80639168ae72116100665780639168ae721461011d5780639406704514610166578063a694fc3a1461018f578063d1af0c7d146101a2578063f854a27f146101c957600080fd5b80632e1a7d4d14610098578063372500ab146100ad57806363c28db1146100b55780636588103b146100de575b600080fd5b6100ab6100a6366004610e2e565b6101ea565b005b6100ab6104e2565b6100c86100c3366004610dd2565b6105ae565b6040516100d59190610e63565b60405180910390f35b6101057f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100d5565b61014b61012b366004610dd2565b600260208190526000918252604090912080549181015460039091015483565b604080519384526020840192909252908201526060016100d5565b610105610174366004610e2e565b6003602052600090815260409020546001600160a01b031681565b6100ab61019d366004610e2e565b6107a8565b6101057f000000000000000000000000000000000000000000000000000000000000000081565b6101dc6101d7366004610dd2565b610a2a565b6040519081526020016100d5565b6101f2610a62565b336000908152600260205260409020546102535760405162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f20746f6b656e73207374616b65640000000000000060448201526064015b60405180910390fd5b6000818152600360205260409020546001600160a01b031633146102b55760405162461bcd60e51b8152602060048201526019602482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b604482015260640161024a565b60006102c033610abc565b336000908152600260205260408120600301805492935083929091906102e7908490610eee565b9091555060009050805b336000908152600260205260409020600101548110156103ac5733600090815260026020526040902060010180548591908390811061033257610332610fd6565b90600052602060002090600202016001015414801561038d575033600090815260026020526040812060010180548390811061037057610370610fd6565b60009182526020909120600290910201546001600160a01b031614155b1561039a578091506103ac565b806103a481610fa5565b9150506102f1565b503360009081526002602052604081206001018054839081106103d1576103d1610fd6565b6000918252602080832060029283020180546001600160a01b0319166001600160a01b0395909516949094179093553382529091526040812080549161041683610f8e565b90915550506000838152600360205260409081902080546001600160a01b0319169055516323b872dd60e01b8152306004820152336024820152604481018490526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b1580156104a557600080fd5b505af11580156104b9573d6000803e3d6000fd5b505033600090815260026020819052604090912042910155506104df9250610b15915050565b50565b33600081815260026020526040812060030154909161050090610abc565b61050a9190610eee565b90506000811161055c5760405162461bcd60e51b815260206004820152601c60248201527f596f752068617665206e6f207265776172647320746f20636c61696d00000000604482015260640161024a565b33600081815260026020819052604082204291810191909155600301556104df907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169083610b1c565b6001600160a01b03811660009081526002602052604090205460609015610764576001600160a01b03821660009081526002602052604081205467ffffffffffffffff81111561060057610600610fec565b60405190808252806020026020018201604052801561064557816020015b604080518082019091526000808252602082015281526020019060019003908161061e5790505b5090506000805b6001600160a01b03851660009081526002602052604090206001015481101561075b576001600160a01b038516600090815260026020526040812060010180548390811061069c5761069c610fd6565b60009182526020909120600290910201546001600160a01b031614610749576001600160a01b03851660009081526002602052604090206001018054829081106106e8576106e8610fd6565b60009182526020918290206040805180820190915260029092020180546001600160a01b031682526001015491810191909152835184908490811061072f5761072f610fd6565b6020026020010181905250818061074590610fa5565b9250505b8061075381610fa5565b91505061064c565b50909392505050565b60408051600080825260208201909252906107a1565b604080518082019091526000808252602082015281526020019060019003908161077a5790505b5092915050565b6107b0610a62565b33600090815260026020526040902054156107fe5760006107d033610abc565b336000908152600260205260408120600301805492935083929091906107f7908490610eee565b9091555050505b6040516331a9108f60e11b81526004810182905233906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e9060240160206040518083038186803b15801561086057600080fd5b505afa158015610874573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108989190610def565b6001600160a01b0316146108ea5760405162461bcd60e51b8152602060048201526019602482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b604482015260640161024a565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd90606401600060405180830381600087803b15801561095857600080fd5b505af115801561096c573d6000803e3d6000fd5b50506040805180820182523380825260208083018781526000838152600280845295812060018082018054808301825590845294832087519590980290970180546001600160a01b0319166001600160a01b03909516949094178455915192909501919091559083528054919450909250906109e783610fa5565b909155505050600081815260036020908152604080832080546001600160a01b031916339081179091558352600291829052909120429101556104df6001600055565b6001600160a01b0381166000908152600260205260408120600301548190610a5184610abc565b610a5b9190610eee565b9392505050565b60026000541415610ab55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161024a565b6002600055565b6001546001600160a01b0382166000908152600260208190526040822080549101549192610e1092909190610af19042610f47565b610afb9190610f28565b610b059190610f28565b610b0f9190610f06565b92915050565b6001600055565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b6e908490610b73565b505050565b6000610bc8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c459092919063ffffffff16565b805190915015610b6e5780806020019051810190610be69190610e0c565b610b6e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161024a565b6060610c548484600085610c5c565b949350505050565b606082471015610cbd5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161024a565b600080866001600160a01b03168587604051610cd99190610e47565b60006040518083038185875af1925050503d8060008114610d16576040519150601f19603f3d011682016040523d82523d6000602084013e610d1b565b606091505b5091509150610d2c87838387610d37565b979650505050505050565b60608315610da3578251610d9c576001600160a01b0385163b610d9c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161024a565b5081610c54565b610c548383815115610db85781518083602001fd5b8060405162461bcd60e51b815260040161024a9190610ebb565b600060208284031215610de457600080fd5b8135610a5b81611002565b600060208284031215610e0157600080fd5b8151610a5b81611002565b600060208284031215610e1e57600080fd5b81518015158114610a5b57600080fd5b600060208284031215610e4057600080fd5b5035919050565b60008251610e59818460208701610f5e565b9190910192915050565b602080825282518282018190526000919060409081850190868401855b82811015610eae57815180516001600160a01b03168552860151868501529284019290850190600101610e80565b5091979650505050505050565b6020815260008251806020840152610eda816040850160208701610f5e565b601f01601f19169190910160400192915050565b60008219821115610f0157610f01610fc0565b500190565b600082610f2357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610f4257610f42610fc0565b500290565b600082821015610f5957610f59610fc0565b500390565b60005b83811015610f79578181015183820152602001610f61565b83811115610f88576000848401525b50505050565b600081610f9d57610f9d610fc0565b506000190190565b6000600019821415610fb957610fb9610fc0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104df57600080fdfea2646970667358221220cdfd05293d7a271f723c81265e4a57722854fb6eb9cb7d1433a665ad414577e464736f6c63430008070033000000000000000000000000c347075b60ff7f07eea970636ea9a8f95d7e7da900000000000000000000000053392bfb0c5b1ebbaa5b4534ba97830e0da1968c

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100935760003560e01c80639168ae72116100665780639168ae721461011d5780639406704514610166578063a694fc3a1461018f578063d1af0c7d146101a2578063f854a27f146101c957600080fd5b80632e1a7d4d14610098578063372500ab146100ad57806363c28db1146100b55780636588103b146100de575b600080fd5b6100ab6100a6366004610e2e565b6101ea565b005b6100ab6104e2565b6100c86100c3366004610dd2565b6105ae565b6040516100d59190610e63565b60405180910390f35b6101057f000000000000000000000000c347075b60ff7f07eea970636ea9a8f95d7e7da981565b6040516001600160a01b0390911681526020016100d5565b61014b61012b366004610dd2565b600260208190526000918252604090912080549181015460039091015483565b604080519384526020840192909252908201526060016100d5565b610105610174366004610e2e565b6003602052600090815260409020546001600160a01b031681565b6100ab61019d366004610e2e565b6107a8565b6101057f00000000000000000000000053392bfb0c5b1ebbaa5b4534ba97830e0da1968c81565b6101dc6101d7366004610dd2565b610a2a565b6040519081526020016100d5565b6101f2610a62565b336000908152600260205260409020546102535760405162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f20746f6b656e73207374616b65640000000000000060448201526064015b60405180910390fd5b6000818152600360205260409020546001600160a01b031633146102b55760405162461bcd60e51b8152602060048201526019602482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b604482015260640161024a565b60006102c033610abc565b336000908152600260205260408120600301805492935083929091906102e7908490610eee565b9091555060009050805b336000908152600260205260409020600101548110156103ac5733600090815260026020526040902060010180548591908390811061033257610332610fd6565b90600052602060002090600202016001015414801561038d575033600090815260026020526040812060010180548390811061037057610370610fd6565b60009182526020909120600290910201546001600160a01b031614155b1561039a578091506103ac565b806103a481610fa5565b9150506102f1565b503360009081526002602052604081206001018054839081106103d1576103d1610fd6565b6000918252602080832060029283020180546001600160a01b0319166001600160a01b0395909516949094179093553382529091526040812080549161041683610f8e565b90915550506000838152600360205260409081902080546001600160a01b0319169055516323b872dd60e01b8152306004820152336024820152604481018490526001600160a01b037f000000000000000000000000c347075b60ff7f07eea970636ea9a8f95d7e7da916906323b872dd90606401600060405180830381600087803b1580156104a557600080fd5b505af11580156104b9573d6000803e3d6000fd5b505033600090815260026020819052604090912042910155506104df9250610b15915050565b50565b33600081815260026020526040812060030154909161050090610abc565b61050a9190610eee565b90506000811161055c5760405162461bcd60e51b815260206004820152601c60248201527f596f752068617665206e6f207265776172647320746f20636c61696d00000000604482015260640161024a565b33600081815260026020819052604082204291810191909155600301556104df907f00000000000000000000000053392bfb0c5b1ebbaa5b4534ba97830e0da1968c6001600160a01b03169083610b1c565b6001600160a01b03811660009081526002602052604090205460609015610764576001600160a01b03821660009081526002602052604081205467ffffffffffffffff81111561060057610600610fec565b60405190808252806020026020018201604052801561064557816020015b604080518082019091526000808252602082015281526020019060019003908161061e5790505b5090506000805b6001600160a01b03851660009081526002602052604090206001015481101561075b576001600160a01b038516600090815260026020526040812060010180548390811061069c5761069c610fd6565b60009182526020909120600290910201546001600160a01b031614610749576001600160a01b03851660009081526002602052604090206001018054829081106106e8576106e8610fd6565b60009182526020918290206040805180820190915260029092020180546001600160a01b031682526001015491810191909152835184908490811061072f5761072f610fd6565b6020026020010181905250818061074590610fa5565b9250505b8061075381610fa5565b91505061064c565b50909392505050565b60408051600080825260208201909252906107a1565b604080518082019091526000808252602082015281526020019060019003908161077a5790505b5092915050565b6107b0610a62565b33600090815260026020526040902054156107fe5760006107d033610abc565b336000908152600260205260408120600301805492935083929091906107f7908490610eee565b9091555050505b6040516331a9108f60e11b81526004810182905233906001600160a01b037f000000000000000000000000c347075b60ff7f07eea970636ea9a8f95d7e7da91690636352211e9060240160206040518083038186803b15801561086057600080fd5b505afa158015610874573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108989190610def565b6001600160a01b0316146108ea5760405162461bcd60e51b8152602060048201526019602482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b604482015260640161024a565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f000000000000000000000000c347075b60ff7f07eea970636ea9a8f95d7e7da96001600160a01b0316906323b872dd90606401600060405180830381600087803b15801561095857600080fd5b505af115801561096c573d6000803e3d6000fd5b50506040805180820182523380825260208083018781526000838152600280845295812060018082018054808301825590845294832087519590980290970180546001600160a01b0319166001600160a01b03909516949094178455915192909501919091559083528054919450909250906109e783610fa5565b909155505050600081815260036020908152604080832080546001600160a01b031916339081179091558352600291829052909120429101556104df6001600055565b6001600160a01b0381166000908152600260205260408120600301548190610a5184610abc565b610a5b9190610eee565b9392505050565b60026000541415610ab55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161024a565b6002600055565b6001546001600160a01b0382166000908152600260208190526040822080549101549192610e1092909190610af19042610f47565b610afb9190610f28565b610b059190610f28565b610b0f9190610f06565b92915050565b6001600055565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b6e908490610b73565b505050565b6000610bc8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610c459092919063ffffffff16565b805190915015610b6e5780806020019051810190610be69190610e0c565b610b6e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161024a565b6060610c548484600085610c5c565b949350505050565b606082471015610cbd5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161024a565b600080866001600160a01b03168587604051610cd99190610e47565b60006040518083038185875af1925050503d8060008114610d16576040519150601f19603f3d011682016040523d82523d6000602084013e610d1b565b606091505b5091509150610d2c87838387610d37565b979650505050505050565b60608315610da3578251610d9c576001600160a01b0385163b610d9c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161024a565b5081610c54565b610c548383815115610db85781518083602001fd5b8060405162461bcd60e51b815260040161024a9190610ebb565b600060208284031215610de457600080fd5b8135610a5b81611002565b600060208284031215610e0157600080fd5b8151610a5b81611002565b600060208284031215610e1e57600080fd5b81518015158114610a5b57600080fd5b600060208284031215610e4057600080fd5b5035919050565b60008251610e59818460208701610f5e565b9190910192915050565b602080825282518282018190526000919060409081850190868401855b82811015610eae57815180516001600160a01b03168552860151868501529284019290850190600101610e80565b5091979650505050505050565b6020815260008251806020840152610eda816040850160208701610f5e565b601f01601f19169190910160400192915050565b60008219821115610f0157610f01610fc0565b500190565b600082610f2357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610f4257610f42610fc0565b500290565b600082821015610f5957610f59610fc0565b500390565b60005b83811015610f79578181015183820152602001610f61565b83811115610f88576000848401525b50505050565b600081610f9d57610f9d610fc0565b506000190190565b6000600019821415610fb957610fb9610fc0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104df57600080fdfea2646970667358221220cdfd05293d7a271f723c81265e4a57722854fb6eb9cb7d1433a665ad414577e464736f6c63430008070033

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

000000000000000000000000c347075b60ff7f07eea970636ea9a8f95d7e7da900000000000000000000000053392bfb0c5b1ebbaa5b4534ba97830e0da1968c

-----Decoded View---------------
Arg [0] : _nftCollection (address): 0xc347075B60FF7f07eea970636Ea9A8F95d7E7dA9
Arg [1] : _rewardsToken (address): 0x53392bfB0c5b1ebBaa5B4534bA97830E0dA1968C

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c347075b60ff7f07eea970636ea9a8f95d7e7da9
Arg [1] : 00000000000000000000000053392bfb0c5b1ebbaa5b4534ba97830e0da1968c


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.