HYPE Price: $22.08 (-0.27%)
 

Overview

HYPE Balance

HyperEVM LogoHyperEVM LogoHyperEVM Logo0 HYPE

HYPE Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Withdraw145910362025-09-23 5:16:00125 days ago1758604560IN
0xe7D780C7...B50dD4900
0 HYPE0.08071483200.72526174
Claim Rewards145899382025-09-23 4:58:00125 days ago1758603480IN
0xe7D780C7...B50dD4900
0 HYPE0.000007810.1
Withdraw140223702025-09-16 17:52:19131 days ago1758045139IN
0xe7D780C7...B50dD4900
0 HYPE0.000052370.39583295
Claim Rewards140223602025-09-16 17:52:09131 days ago1758045129IN
0xe7D780C7...B50dD4900
0 HYPE0.000042850.59590573
Claim Rewards140164722025-09-16 16:15:38131 days ago1758039338IN
0xe7D780C7...B50dD4900
0 HYPE0.01308447200.72526174
Claim Rewards139262182025-09-15 15:36:03132 days ago1757950563IN
0xe7D780C7...B50dD4900
0 HYPE0.0007059610.83
Withdraw139261902025-09-15 15:35:36132 days ago1757950536IN
0xe7D780C7...B50dD4900
0 HYPE0.0014739511.14
Claim Rewards139252682025-09-15 15:20:29132 days ago1757949629IN
0xe7D780C7...B50dD4900
0 HYPE0.000540757.52
Claim Rewards138851942025-09-15 4:23:32133 days ago1757910212IN
0xe7D780C7...B50dD4900
0 HYPE0.000011520.14
Withdraw138851752025-09-15 4:23:13133 days ago1757910193IN
0xe7D780C7...B50dD4900
0 HYPE0.000043550.35
Withdraw138452792025-09-14 17:29:11133 days ago1757870951IN
0xe7D780C7...B50dD4900
0 HYPE0.000296272.76
Claim Rewards138452762025-09-14 17:29:08133 days ago1757870948IN
0xe7D780C7...B50dD4900
0 HYPE0.000236222.76
Withdraw138452572025-09-14 17:28:50133 days ago1757870930IN
0xe7D780C7...B50dD4900
0 HYPE0.000209321.95
Claim Rewards138452542025-09-14 17:28:47133 days ago1757870927IN
0xe7D780C7...B50dD4900
0 HYPE0.000123241.44
Withdraw138452422025-09-14 17:28:35133 days ago1757870915IN
0xe7D780C7...B50dD4900
0 HYPE0.000424843.6
Claim Rewards138452412025-09-14 17:28:34133 days ago1757870914IN
0xe7D780C7...B50dD4900
0 HYPE0.000113831.33
Withdraw138452192025-09-14 17:28:12133 days ago1757870892IN
0xe7D780C7...B50dD4900
0 HYPE0.000210061.78
Claim Rewards138452152025-09-14 17:28:08133 days ago1757870888IN
0xe7D780C7...B50dD4900
0 HYPE0.000152341.78
Withdraw138452032025-09-14 17:27:57133 days ago1757870877IN
0xe7D780C7...B50dD4900
0 HYPE0.00023131.96
Claim Rewards138451962025-09-14 17:27:50133 days ago1757870870IN
0xe7D780C7...B50dD4900
0 HYPE0.000159191.86
Withdraw138451842025-09-14 17:27:38133 days ago1757870858IN
0xe7D780C7...B50dD4900
0 HYPE0.000224221.9
Claim Rewards138451802025-09-14 17:27:34133 days ago1757870854IN
0xe7D780C7...B50dD4900
0 HYPE0.000166041.94
Withdraw138451312025-09-14 17:26:46133 days ago1757870806IN
0xe7D780C7...B50dD4900
0 HYPE0.000508634.31
Claim Rewards138451272025-09-14 17:26:42133 days ago1757870802IN
0xe7D780C7...B50dD4900
0 HYPE0.000394564.61
Withdraw138451152025-09-14 17:26:30133 days ago1757870790IN
0xe7D780C7...B50dD4900
0 HYPE0.0021607918.31
View all transactions

View more zero value Internal Transactions in Advanced View mode

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

Contract Source Code Verified (Exact Match)

Contract Name:
ERC721Staking

Compiler Version
v0.8.19+commit.7dd6d404

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/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

/**
 * @title ERC721 Staking Smart Contract
 *
 * @author andreitoma8
 *
 * @notice This contract uses a simple principle to alow users to stake ERC721 Tokens and earn ERC20 Reward Tokens distributed by the owner of the contract.
 * Each time a user stakes or withdraws a new Token Id, the contract will store the time of the transaction and the amount of ERC20 Reward Tokens that the user has earned up to that point
 * (based on the amount of time that has passed since the last transaction, the amount of Tokens staked and the amount of ERC20 Reward Tokens distributed per hour so that the amount of ERC20
 * Reward Tokens earned by the user is always distributed accounting for how many ERC721 Tokens he has staked at that particular moment.
 * The user can claim the ERC20 Reward Tokens at any time by calling the claimRewards function.
 *
 * @dev The contract is built to be compatible with most ERC721 and ERC20 tokens.
 */
contract ERC721Staking is Ownable, ReentrancyGuard, Pausable {
    using SafeERC20 for IERC20;

    /**
     * @dev The ERC20 Reward Token that will be distributed to stakers.
     */
    IERC20 public immutable rewardsToken;

    /**
     * @dev The ERC721 Collection that will be staked.
     */
    IERC721 public immutable nftCollection;

    uint256 constant SECONDS_IN_HOUR = 3600;

    /**
     * @dev Struct that holds the staking details for each user.
     */
    struct Staker {
        /**
         * @dev The array of Token Ids staked by the user.
         */
        uint256[] stakedTokenIds;
    }

    /**
     * @dev Total rewards distributed per hour for the entire collection (shared pool)
     */
    uint256 public totalRewardsPerHour = 1 * 1e18; // 1000 tokens per hour for all NFTs
    
    /**
     * @dev Total number of staked NFTs across all users
     */
    uint256 public totalStakedNFTs;
    
    /**
     * @dev Synthetix-like reward accumulator system
     */
    uint256 public rewardPerNFTStored;           // Global accumulated reward per NFT
    uint256 public lastUpdateTime;               // Last time rewards were updated
    uint256 public rewardRate;                   // Tokens per second = totalRewardsPerHour / 3600
    
    /**
     * @dev User reward tracking
     */
    mapping(address => uint256) public userRewardPerNFTPaid;  // Last rewardPerNFTStored when user was updated
    mapping(address => uint256) internal rewards;               // Pending rewards for user

    /**
     * @dev Mapping of stakers to their staking info.
     */
    mapping(address => Staker) internal stakers;

    /**
     * @dev Mapping of Token Id to staker address.
     */
    mapping(uint256 => address) public stakerAddress;

    /**
     * @dev Array of stakers addresses.
     */
    address[] public stakersArray;

    /**
     * @dev Mapping of stakers addresses to their index in the stakersArray.
     */
    mapping(address => uint256) public stakerToArrayIndex;

    /**
     * @notice Mapping of Token Id to it's index in the staker's stakedTokenIds array.
     */
    mapping(uint256 => uint256) public tokenIdToArrayIndex;
    
    /**
     * @dev Maximum NFTs per transaction to prevent gas issues
     */
    uint256 public constant MAX_BATCH_SIZE = 50;

    // Events
    event Staked(address indexed user, uint256[] tokenIds);
    event Withdrawn(address indexed user, uint256[] tokenIds);
    event RewardsClaimed(address indexed user, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256[] tokenIds);
    event TotalRewardsPerHourUpdated(uint256 newRate);

    /**
     * @notice Constructor function that initializes the ERC20 and ERC721 interfaces.
     * @param _nftCollection - The address of the ERC721 Collection.
     * @param _rewardsToken - The address of the ERC20 Reward Token.
     */
    constructor(IERC721 _nftCollection, IERC20 _rewardsToken) {
        require(address(_nftCollection) != address(0) && address(_rewardsToken) != address(0), "zero addr");
        
        nftCollection = _nftCollection;
        rewardsToken = _rewardsToken;
        rewardRate = totalRewardsPerHour / 3600; // tokens per second
        lastUpdateTime = block.timestamp;
    }

    /**
     * @notice Function used to stake ERC721 Tokens.
     * @param _tokenIds - The array of Token Ids to stake.
     * @dev Each Token Id must be approved for transfer by the user before calling this function.
     */
    function stake(uint256[] calldata _tokenIds) external whenNotPaused {
        uint256 len = _tokenIds.length;
        require(len > 0 && len <= MAX_BATCH_SIZE, "Invalid batch size");
        
        updateReward(msg.sender);
        
        Staker storage staker = stakers[msg.sender];

        if (staker.stakedTokenIds.length == 0) {
            stakersArray.push(msg.sender);
            stakerToArrayIndex[msg.sender] = stakersArray.length - 1;
        }
        
        // Check ownership and duplicates efficiently
        for (uint256 i; i < len; ++i) {
            uint256 tokenId = _tokenIds[i];
            require(nftCollection.ownerOf(tokenId) == msg.sender, "Can't stake tokens you don't own!");
            require(stakerAddress[tokenId] == address(0), "Token already staked");
            
            // Check for duplicates in same call (only against previous tokens)
            for (uint256 j; j < i; ++j) {
                require(_tokenIds[j] != tokenId, "Duplicate token in same call");
            }
        }
        
        // Transfer and register NFTs
        for (uint256 i; i < len; ++i) {
            uint256 tokenId = _tokenIds[i];
            nftCollection.transferFrom(msg.sender, address(this), tokenId);

            staker.stakedTokenIds.push(tokenId);
            tokenIdToArrayIndex[tokenId] = staker.stakedTokenIds.length - 1;
            stakerAddress[tokenId] = msg.sender;
        }
        
        // Update total count
        totalStakedNFTs += len;
        
        emit Staked(msg.sender, _tokenIds);
    }

    /**
     * @notice Function used to withdraw ERC721 Tokens.
     * @param _tokenIds - The array of Token Ids to withdraw.
     */
    function withdraw(uint256[] calldata _tokenIds) external nonReentrant {
        uint256 lenToWithdraw = _tokenIds.length;
        require(lenToWithdraw > 0 && lenToWithdraw <= MAX_BATCH_SIZE, "Invalid batch size");
        
        updateReward(msg.sender);
        
        Staker storage staker = stakers[msg.sender];
        require(staker.stakedTokenIds.length > 0, "You have no tokens staked");
        require(lenToWithdraw <= staker.stakedTokenIds.length, "Cannot withdraw more than staked");
        
        // Check for duplicates in withdraw call (optimized)
        for (uint256 i; i < lenToWithdraw; ++i) {
            for (uint256 j; j < i; ++j) {
                require(_tokenIds[j] != _tokenIds[i], "Duplicate token in same call");
            }
        }
        
        for (uint256 i; i < lenToWithdraw; ++i) {
            uint256 tokenId = _tokenIds[i];
            require(stakerAddress[tokenId] == msg.sender, "Not your token");

            uint256 index = tokenIdToArrayIndex[tokenId];
            require(index < staker.stakedTokenIds.length, "Invalid token index"); // Fix: Prevent out of bounds
            uint256 lastTokenIndex = staker.stakedTokenIds.length - 1;
            if (index != lastTokenIndex) {
                uint256 lastTokenId = staker.stakedTokenIds[lastTokenIndex];
                staker.stakedTokenIds[index] = lastTokenId;
                tokenIdToArrayIndex[lastTokenId] = index;
            }
            staker.stakedTokenIds.pop();

            delete tokenIdToArrayIndex[tokenId];
            delete stakerAddress[tokenId];

            nftCollection.transferFrom(address(this), msg.sender, tokenId);
        }
        
        // Update total count
        totalStakedNFTs -= lenToWithdraw;

        if (staker.stakedTokenIds.length == 0) {
            uint256 index = stakerToArrayIndex[msg.sender];
            uint256 lastStakerIndex = stakersArray.length - 1;
            
            require(index <= lastStakerIndex, "Invalid staker index"); // Fix: Validate index
            
            if (index != lastStakerIndex) {
                address lastStaker = stakersArray[lastStakerIndex];
                stakersArray[index] = lastStaker;
                stakerToArrayIndex[lastStaker] = index;
            }
            stakersArray.pop();
            delete stakerToArrayIndex[msg.sender];
        }
        
        emit Withdrawn(msg.sender, _tokenIds);
    }

    /**
     * @notice Function used to claim the accrued ERC20 Reward Tokens.
     */
    function claimRewards() external nonReentrant {
        updateReward(msg.sender);
        
        uint256 reward = rewards[msg.sender];
        require(reward > 0, "You have no rewards to claim");

        rewards[msg.sender] = 0;
        rewardsToken.safeTransfer(msg.sender, reward);
        
        emit RewardsClaimed(msg.sender, reward);
    }

    /**
     * @notice Function used to set the total rewards per hour for the entire collection.
     * @param _newValue - The new value of the totalRewardsPerHour variable.
     */
    function setTotalRewardsPerHour(uint256 _newValue) public onlyOwner {
        updateRewardPerNFTStored();
        totalRewardsPerHour = _newValue;
        rewardRate = _newValue / 3600; // Update rate per second
        
        emit TotalRewardsPerHourUpdated(_newValue);
    }
    
    /**
     * @notice Update global reward accumulator (Synthetix model)
     */
    function updateRewardPerNFTStored() internal {
        if (totalStakedNFTs > 0) {
            uint256 elapsed = block.timestamp - lastUpdateTime;
            rewardPerNFTStored += (elapsed * rewardRate * 1e18) / totalStakedNFTs;
        }
        lastUpdateTime = block.timestamp;
    }
    
    /**
     * @notice Update reward for specific user (Synthetix model)
     */
    function updateReward(address user) internal {
        updateRewardPerNFTStored();
        
        Staker storage staker = stakers[user];
        
        // Fix: Protection against underflow
        uint256 userPaid = userRewardPerNFTPaid[user];
        if (rewardPerNFTStored >= userPaid) {
            rewards[user] += (staker.stakedTokenIds.length * (rewardPerNFTStored - userPaid)) / 1e18;
        }
        
        userRewardPerNFTPaid[user] = rewardPerNFTStored;
    }

    /**
     * @notice Function used to get the info for a user: the Token Ids staked and the available rewards.
     * @param _user - The address of the user.
     * @return _stakedTokenIds - The array of Token Ids staked by the user.
     * @return _availableRewards - The available rewards for the user.
     */
    function userStakeInfo(address _user)
        public
        view
        returns (uint256[] memory _stakedTokenIds, uint256 _availableRewards)
    {
        return (stakers[_user].stakedTokenIds, availableRewards(_user));
    }

    /**
     * @notice Function used to get the available rewards for a user.
     * @param _user - The address of the user.
     * @return _rewards - The available rewards for the user.
     */
    function availableRewards(address _user) public view returns (uint256 _rewards) {
        Staker memory staker = stakers[_user];
        
        // Calculate pending rewards using Synthetix model with full precision
        uint256 tempRewardPerNFTStored = rewardPerNFTStored;
        if (totalStakedNFTs > 0) {
            uint256 elapsed = block.timestamp - lastUpdateTime;
            // Use full precision: elapsed * rewardRate * 1e18 / totalStakedNFTs
            tempRewardPerNFTStored += (elapsed * rewardRate * 1e18) / totalStakedNFTs;
        }
        
        // Calculate pending with full precision and underflow protection
        uint256 userPaid = userRewardPerNFTPaid[_user];
        uint256 pendingRewards = 0;
        if (tempRewardPerNFTStored >= userPaid) {
            pendingRewards = (staker.stakedTokenIds.length * (tempRewardPerNFTStored - userPaid)) / 1e18;
        }
        
        return rewards[_user] + pendingRewards;
    }

    /**
     * @notice Get current reward rate per NFT per hour
     * @return Current reward rate per NFT per hour (0 if no NFTs staked)
     */
    function getCurrentRewardRatePerNFT() external view returns (uint256) {
        if (totalStakedNFTs == 0) {
            return 0;
        }
        // Return rate per second with full precision (scaled by 1e18)
        return (rewardRate * 3600 * 1e18) / totalStakedNFTs;
    }
    
    /**
     * @notice Get pending rewards for a user
     * @param _user - User address
     * @return Pending rewards amount
     */
    function getPendingRewards(address _user) external view returns (uint256) {
        return availableRewards(_user);
    }
    
    /**
     * @notice Get staker info since mapping is internal
     * @param _user - User address
     * @return tokenIds - Array of staked token IDs
     */
    function getStakerTokenIds(address _user) external view returns (uint256[] memory tokenIds) {
        return stakers[_user].stakedTokenIds;
    }

    /**
     * @notice Emergency withdraw without caring about rewards. EMERGENCY ONLY.
     * @param _tokenIds - Array of token IDs to emergency withdraw
     */
    function emergencyWithdraw(uint256[] calldata _tokenIds) external nonReentrant {
        uint256 lenToWithdraw = _tokenIds.length;
        require(lenToWithdraw > 0 && lenToWithdraw <= MAX_BATCH_SIZE, "Invalid batch size");
        
        Staker storage staker = stakers[msg.sender];
        require(staker.stakedTokenIds.length > 0, "You have no tokens staked");

        // Check for duplicates (optimized)
        for (uint256 i; i < lenToWithdraw; ++i) {
            for (uint256 j; j < i; ++j) {
                require(_tokenIds[j] != _tokenIds[i], "Duplicate token in same call");
            }
        }
        
        for (uint256 i; i < lenToWithdraw; ++i) {
            uint256 tokenId = _tokenIds[i];
            require(stakerAddress[tokenId] == msg.sender, "Not your token");

            uint256 index = tokenIdToArrayIndex[tokenId];
            require(index < staker.stakedTokenIds.length, "Invalid token index");
            
            uint256 lastTokenIndex = staker.stakedTokenIds.length - 1;
            if (index != lastTokenIndex) {
                uint256 lastTokenId = staker.stakedTokenIds[lastTokenIndex];
                staker.stakedTokenIds[index] = lastTokenId;
                tokenIdToArrayIndex[lastTokenId] = index;
            }
            staker.stakedTokenIds.pop();
            totalStakedNFTs--;

            delete tokenIdToArrayIndex[tokenId];
            delete stakerAddress[tokenId];

            nftCollection.transferFrom(address(this), msg.sender, tokenId);
        }

        // Reset user data completely (lose all rewards)
        rewards[msg.sender] = 0;
        userRewardPerNFTPaid[msg.sender] = rewardPerNFTStored;

        if (staker.stakedTokenIds.length == 0) {
            uint256 index = stakerToArrayIndex[msg.sender];
            uint256 lastStakerIndex = stakersArray.length - 1;
            
            require(index <= lastStakerIndex, "Invalid staker index");
            
            if (index != lastStakerIndex) {
                address lastStaker = stakersArray[lastStakerIndex];
                stakersArray[index] = lastStaker;
                stakerToArrayIndex[lastStaker] = index;
            }
            stakersArray.pop();
            delete stakerToArrayIndex[msg.sender];
        }
        
        emit EmergencyWithdraw(msg.sender, _tokenIds);
    }

    /**
     * @dev Pause staking.
     */
    function pause() external onlyOwner {
        _pause();
    }

    /**
     * @dev Resume staking.
     */
    function unpause() external onlyOwner {
        _unpause();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

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

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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;
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/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.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
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].
     *
     * CAUTION: See Security Considerations above.
     */
    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.9.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.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/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.8.0/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 (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

// 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"
      ]
    }
  }
}

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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRate","type":"uint256"}],"name":"TotalRewardsPerHourUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"MAX_BATCH_SIZE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"availableRewards","outputs":[{"internalType":"uint256","name":"_rewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentRewardRatePerNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getPendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getStakerTokenIds","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftCollection","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerNFTStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newValue","type":"uint256"}],"name":"setTotalRewardsPerHour","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","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":"stakerToArrayIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakersArray","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToArrayIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardsPerHour","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakedNFTs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerNFTPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"userStakeInfo","outputs":[{"internalType":"uint256[]","name":"_stakedTokenIds","type":"uint256[]"},{"internalType":"uint256","name":"_availableRewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052670de0b6b3a76400006003553480156200001d57600080fd5b50604051620022bc380380620022bc833981016040819052620000409162000154565b6200004b33620000eb565b600180556002805460ff191690556001600160a01b038216158015906200007a57506001600160a01b03811615155b620000b75760405162461bcd60e51b81526020600482015260096024820152683d32b9379030b2323960b91b604482015260640160405180910390fd5b6001600160a01b0380831660a0528116608052600354620000dc90610e109062000193565b600755505042600655620001b6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200015157600080fd5b50565b600080604083850312156200016857600080fd5b825162000175816200013b565b602084015190925062000188816200013b565b809150509250929050565b600082620001b157634e487b7160e01b600052601260045260246000fd5b500490565b60805160a0516120bd620001ff600039600081816102d8015281816105290152818161072e01528181610de601526112f50152600081816103ba01526108c801526120bd6000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c80637b0a47ee11610104578063c8f33c91116100a2578063f2fde38b11610071578063f2fde38b146103dc578063f456b399146103ef578063f6ed20171461040f578063f854a27f1461042257600080fd5b8063c8f33c9114610391578063cfdbf2541461039a578063d1941b06146103a2578063d1af0c7d146103b557600080fd5b80638da5cb5b116100de5780638da5cb5b146103245780639406704514610335578063983d95ce1461035e578063c1030da41461037157600080fd5b80637b0a47ee1461030a578063809aabc8146103135780638456cb591461031c57600080fd5b806350df1e02116101715780635c975abb1161014b5780635c975abb146102bd5780636588103b146102d35780636a2af77f146102fa578063715018a61461030257600080fd5b806350df1e021461025f5780635357e9161461027f578063549df74b146102aa57600080fd5b8063372500ab116101ad578063372500ab1461020e5780633f4ba83a146102165780634a1f99b51461021e5780634ead43271461023e57600080fd5b80630fbf0a93146101d457806313b7f389146101e95780632c9dcbb414610205575b600080fd5b6101e76101e2366004611d31565b610435565b005b6101f260035481565b6040519081526020015b60405180910390f35b6101f260045481565b6101e7610844565b6101e7610938565b6101f261022c366004611dbb565b60086020526000908152604090205481565b61025161024c366004611dbb565b610948565b6040516101fc929190611e1a565b6101f261026d366004611e3c565b600e6020526000908152604090205481565b61029261028d366004611e3c565b6109c4565b6040516001600160a01b0390911681526020016101fc565b6101e76102b8366004611e3c565b6109ee565b60025460ff1660405190151581526020016101fc565b6102927f000000000000000000000000000000000000000000000000000000000000000081565b6101f2610a48565b6101e7610a8d565b6101f260075481565b6101f260055481565b6101e7610a9f565b6000546001600160a01b0316610292565b610292610343366004611e3c565b600b602052600090815260409020546001600160a01b031681565b6101e761036c366004611d31565b610aaf565b6101f261037f366004611dbb565b600d6020526000908152604090205481565b6101f260065481565b6101f2603281565b6101e76103b0366004611d31565b611000565b6102927f000000000000000000000000000000000000000000000000000000000000000081565b6101e76103ea366004611dbb565b611500565b6104026103fd366004611dbb565b611579565b6040516101fc9190611e55565b6101f261041d366004611dbb565b6115e5565b6101f2610430366004611dbb565b6115f6565b61043d61173e565b80801580159061044e575060328111155b6104735760405162461bcd60e51b815260040161046a90611e68565b60405180910390fd5b61047c33611784565b336000908152600a6020526040812080549091036104f557600c80546001818101835560008390527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c790910180546001600160a01b0319163317905590546104e49190611eaa565b336000908152600d60205260409020555b60005b828110156106d757600085858381811061051457610514611ebd565b905060200201359050336001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161057591815260200190565b602060405180830381865afa158015610592573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b69190611ed3565b6001600160a01b0316146106165760405162461bcd60e51b815260206004820152602160248201527f43616e2774207374616b6520746f6b656e7320796f7520646f6e2774206f776e6044820152602160f81b606482015260840161046a565b6000818152600b60205260409020546001600160a01b0316156106725760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88185b1c9958591e481cdd185ad95960621b604482015260640161046a565b60005b828110156106c4578187878381811061069057610690611ebd565b90506020020135036106b45760405162461bcd60e51b815260040161046a90611ef0565b6106bd81611f27565b9050610675565b5050806106d090611f27565b90506104f8565b5060005b828110156107ea5760008585838181106106f7576106f7611ebd565b6040516323b872dd60e01b815233600482015230602482015260209091029290920135604483018190529250506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b15801561077257600080fd5b505af1158015610786573d6000803e3d6000fd5b505084546001818101875560008781526020902090910184905585546107af9350909150611eaa565b6000918252600e6020908152604080842092909255600b9052902080546001600160a01b031916331790556107e381611f27565b90506106db565b5081600460008282546107fd9190611f40565b909155505060405133907f134b166c6094cc1ccbf1e3353ce5c3cd9fd29869051bdb999895854d77cc5ef6906108369087908790611f53565b60405180910390a250505050565b61084c611835565b61085533611784565b33600090815260096020526040902054806108b25760405162461bcd60e51b815260206004820152601c60248201527f596f752068617665206e6f207265776172647320746f20636c61696d00000000604482015260640161046a565b336000818152600960205260408120556108f7907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316908361188e565b60405181815233907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9060200160405180910390a25061093660018055565b565b6109406118e5565b61093661193f565b6001600160a01b0381166000908152600a602052604081206060919061096d846115f6565b8154604080516020808402820181019092528281529184918301828280156109b457602002820191906000526020600020905b8154815260200190600101908083116109a0575b5050505050915091509150915091565b600c81815481106109d457600080fd5b6000918252602090912001546001600160a01b0316905081565b6109f66118e5565b6109fe611991565b6003819055610a0f610e1082611f8c565b6007556040518181527f0e8aab9155419c91f2646dd7278ca787e92050a1300c1042465c4d3367685d9c9060200160405180910390a150565b6000600454600003610a5a5750600090565b600454600754610a6c90610e10611fae565b610a7e90670de0b6b3a7640000611fae565b610a889190611f8c565b905090565b610a956118e5565b61093660006119f6565b610aa76118e5565b610936611a46565b610ab7611835565b808015801590610ac8575060328111155b610ae45760405162461bcd60e51b815260040161046a90611e68565b610aed33611784565b336000908152600a602052604090208054610b465760405162461bcd60e51b8152602060048201526019602482015278165bdd481a185d99481b9bc81d1bdad95b9cc81cdd185ad959603a1b604482015260640161046a565b8054821115610b975760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74207769746864726177206d6f7265207468616e207374616b6564604482015260640161046a565b60005b82811015610c1d5760005b81811015610c0c57858583818110610bbf57610bbf611ebd565b90506020020135868683818110610bd857610bd8611ebd565b9050602002013503610bfc5760405162461bcd60e51b815260040161046a90611ef0565b610c0581611f27565b9050610ba5565b50610c1681611f27565b9050610b9a565b5060005b82811015610e56576000858583818110610c3d57610c3d611ebd565b602090810292909201356000818152600b909352604090922054919250506001600160a01b03163314610ca35760405162461bcd60e51b815260206004820152600e60248201526d2737ba103cb7bab9103a37b5b2b760911b604482015260640161046a565b6000818152600e602052604090205483548110610cf85760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840e8ded6cadc40d2dcc8caf606b1b604482015260640161046a565b8354600090610d0990600190611eaa565b9050808214610d6c576000856000018281548110610d2957610d29611ebd565b9060005260206000200154905080866000018481548110610d4c57610d4c611ebd565b6000918252602080832090910192909255918252600e9052604090208290555b8454859080610d7d57610d7d611fc5565b600082815260208082206000199084018101839055909201909255848252600e81526040808320839055600b9091529081902080546001600160a01b0319169055516323b872dd60e01b8152306004820152336024820152604481018490526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b5050505050505080610e4f90611f27565b9050610c21565b508160046000828254610e699190611eaa565b90915550508054600003610fae57336000908152600d6020526040812054600c54909190610e9990600190611eaa565b905080821115610ee25760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e6e8c2d6cae440d2dcc8caf60631b604482015260640161046a565b808214610f68576000600c8281548110610efe57610efe611ebd565b600091825260209091200154600c80546001600160a01b039092169250829185908110610f2d57610f2d611ebd565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600d909152604090208290555b600c805480610f7957610f79611fc5565b60008281526020808220830160001990810180546001600160a01b0319169055909201909255338252600d9052604081205550505b336001600160a01b03167ff35c46796392b0deae18b1c5ac3cc50df76b67ef9bcf256df595a3607aab62588585604051610fe9929190611f53565b60405180910390a25050610ffc60018055565b5050565b611008611835565b808015801590611019575060328111155b6110355760405162461bcd60e51b815260040161046a90611e68565b336000908152600a60205260409020805461108e5760405162461bcd60e51b8152602060048201526019602482015278165bdd481a185d99481b9bc81d1bdad95b9cc81cdd185ad959603a1b604482015260640161046a565b60005b828110156111145760005b81811015611103578585838181106110b6576110b6611ebd565b905060200201358686838181106110cf576110cf611ebd565b90506020020135036110f35760405162461bcd60e51b815260040161046a90611ef0565b6110fc81611f27565b905061109c565b5061110d81611f27565b9050611091565b5060005b8281101561136557600085858381811061113457611134611ebd565b602090810292909201356000818152600b909352604090922054919250506001600160a01b0316331461119a5760405162461bcd60e51b815260206004820152600e60248201526d2737ba103cb7bab9103a37b5b2b760911b604482015260640161046a565b6000818152600e6020526040902054835481106111ef5760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840e8ded6cadc40d2dcc8caf606b1b604482015260640161046a565b835460009061120090600190611eaa565b905080821461126357600085600001828154811061122057611220611ebd565b906000526020600020015490508086600001848154811061124357611243611ebd565b6000918252602080832090910192909255918252600e9052604090208290555b845485908061127457611274611fc5565b600190038181906000526020600020016000905590556004600081548092919061129d90611fdb565b90915550506000838152600e60209081526040808320839055600b9091529081902080546001600160a01b0319169055516323b872dd60e01b8152306004820152336024820152604481018490526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b15801561133957600080fd5b505af115801561134d573d6000803e3d6000fd5b505050505050508061135e90611f27565b9050611118565b503360009081526009602090815260408083208390556005546008909252822055815490036114c557336000908152600d6020526040812054600c549091906113b090600190611eaa565b9050808211156113f95760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e6e8c2d6cae440d2dcc8caf60631b604482015260640161046a565b80821461147f576000600c828154811061141557611415611ebd565b600091825260209091200154600c80546001600160a01b03909216925082918590811061144457611444611ebd565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600d909152604090208290555b600c80548061149057611490611fc5565b60008281526020808220830160001990810180546001600160a01b0319169055909201909255338252600d9052604081205550505b336001600160a01b03167f1ad6082f7aa3e32095e38fd4c0bf76fa2bb7584e81474cf3519d2dea4081181c8585604051610fe9929190611f53565b6115086118e5565b6001600160a01b03811661156d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161046a565b611576816119f6565b50565b6001600160a01b0381166000908152600a60209081526040918290208054835181840281018401909452808452606093928301828280156115d957602002820191906000526020600020905b8154815260200190600101908083116115c5575b50505050509050919050565b60006115f0826115f6565b92915050565b6001600160a01b0381166000908152600a6020908152604080832081518154808502820184018452938101848152859491938492849184018282801561165b57602002820191906000526020600020905b815481526020019060010190808311611647575b505050919092525050600554600454929350911590506116c2576000600654426116859190611eaa565b9050600454600754826116989190611fae565b6116aa90670de0b6b3a7640000611fae565b6116b49190611f8c565b6116be9083611f40565b9150505b6001600160a01b0384166000908152600860205260408120549081831061171057670de0b6b3a76400006116f68385611eaa565b8551516117039190611fae565b61170d9190611f8c565b90505b6001600160a01b038616600090815260096020526040902054611734908290611f40565b9695505050505050565b60025460ff16156109365760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161046a565b61178c611991565b6001600160a01b0381166000908152600a60209081526040808320600890925290912054600554811161181457670de0b6b3a7640000816005546117d09190611eaa565b83546117dc9190611fae565b6117e69190611f8c565b6001600160a01b0384166000908152600960205260408120805490919061180e908490611f40565b90915550505b50506005546001600160a01b03909116600090815260086020526040902055565b6002600154036118875760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161046a565b6002600155565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526118e0908490611a83565b505050565b6000546001600160a01b031633146109365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046a565b611947611b58565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600454156119f0576000600654426119a99190611eaa565b9050600454600754826119bc9190611fae565b6119ce90670de0b6b3a7640000611fae565b6119d89190611f8c565b600560008282546119e99190611f40565b9091555050505b42600655565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611a4e61173e565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586119743390565b6000611ad8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611ba19092919063ffffffff16565b9050805160001480611af9575080806020019051810190611af99190611ff2565b6118e05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161046a565b60025460ff166109365760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161046a565b6060611bb08484600085611bb8565b949350505050565b606082471015611c195760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161046a565b600080866001600160a01b03168587604051611c359190612038565b60006040518083038185875af1925050503d8060008114611c72576040519150601f19603f3d011682016040523d82523d6000602084013e611c77565b606091505b5091509150611c8887838387611c93565b979650505050505050565b60608315611d02578251600003611cfb576001600160a01b0385163b611cfb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161046a565b5081611bb0565b611bb08383815115611d175781518083602001fd5b8060405162461bcd60e51b815260040161046a9190612054565b60008060208385031215611d4457600080fd5b823567ffffffffffffffff80821115611d5c57600080fd5b818501915085601f830112611d7057600080fd5b813581811115611d7f57600080fd5b8660208260051b8501011115611d9457600080fd5b60209290920196919550909350505050565b6001600160a01b038116811461157657600080fd5b600060208284031215611dcd57600080fd5b8135611dd881611da6565b9392505050565b600081518084526020808501945080840160005b83811015611e0f57815187529582019590820190600101611df3565b509495945050505050565b604081526000611e2d6040830185611ddf565b90508260208301529392505050565b600060208284031215611e4e57600080fd5b5035919050565b602081526000611dd86020830184611ddf565b602080825260129082015271496e76616c69642062617463682073697a6560701b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b818103818111156115f0576115f0611e94565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611ee557600080fd5b8151611dd881611da6565b6020808252601c908201527f4475706c696361746520746f6b656e20696e2073616d652063616c6c00000000604082015260600190565b600060018201611f3957611f39611e94565b5060010190565b808201808211156115f0576115f0611e94565b6020808252810182905260006001600160fb1b03831115611f7357600080fd5b8260051b80856040850137919091016040019392505050565b600082611fa957634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176115f0576115f0611e94565b634e487b7160e01b600052603160045260246000fd5b600081611fea57611fea611e94565b506000190190565b60006020828403121561200457600080fd5b81518015158114611dd857600080fd5b60005b8381101561202f578181015183820152602001612017565b50506000910152565b6000825161204a818460208701612014565b9190910192915050565b6020815260008251806020840152612073816040850160208701612014565b601f01601f1916919091016040019291505056fea2646970667358221220d947817ff4753e42a3d671e055deda8fddedc5e64d7b1a4a1ebb6616dd4a1c3864736f6c6343000813003300000000000000000000000043a9652e2b3ce8970e8d33d8c34252a59a6596aa000000000000000000000000151d5dd986cc7e333a64b985309c30f9718cef5c

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80637b0a47ee11610104578063c8f33c91116100a2578063f2fde38b11610071578063f2fde38b146103dc578063f456b399146103ef578063f6ed20171461040f578063f854a27f1461042257600080fd5b8063c8f33c9114610391578063cfdbf2541461039a578063d1941b06146103a2578063d1af0c7d146103b557600080fd5b80638da5cb5b116100de5780638da5cb5b146103245780639406704514610335578063983d95ce1461035e578063c1030da41461037157600080fd5b80637b0a47ee1461030a578063809aabc8146103135780638456cb591461031c57600080fd5b806350df1e02116101715780635c975abb1161014b5780635c975abb146102bd5780636588103b146102d35780636a2af77f146102fa578063715018a61461030257600080fd5b806350df1e021461025f5780635357e9161461027f578063549df74b146102aa57600080fd5b8063372500ab116101ad578063372500ab1461020e5780633f4ba83a146102165780634a1f99b51461021e5780634ead43271461023e57600080fd5b80630fbf0a93146101d457806313b7f389146101e95780632c9dcbb414610205575b600080fd5b6101e76101e2366004611d31565b610435565b005b6101f260035481565b6040519081526020015b60405180910390f35b6101f260045481565b6101e7610844565b6101e7610938565b6101f261022c366004611dbb565b60086020526000908152604090205481565b61025161024c366004611dbb565b610948565b6040516101fc929190611e1a565b6101f261026d366004611e3c565b600e6020526000908152604090205481565b61029261028d366004611e3c565b6109c4565b6040516001600160a01b0390911681526020016101fc565b6101e76102b8366004611e3c565b6109ee565b60025460ff1660405190151581526020016101fc565b6102927f00000000000000000000000043a9652e2b3ce8970e8d33d8c34252a59a6596aa81565b6101f2610a48565b6101e7610a8d565b6101f260075481565b6101f260055481565b6101e7610a9f565b6000546001600160a01b0316610292565b610292610343366004611e3c565b600b602052600090815260409020546001600160a01b031681565b6101e761036c366004611d31565b610aaf565b6101f261037f366004611dbb565b600d6020526000908152604090205481565b6101f260065481565b6101f2603281565b6101e76103b0366004611d31565b611000565b6102927f000000000000000000000000151d5dd986cc7e333a64b985309c30f9718cef5c81565b6101e76103ea366004611dbb565b611500565b6104026103fd366004611dbb565b611579565b6040516101fc9190611e55565b6101f261041d366004611dbb565b6115e5565b6101f2610430366004611dbb565b6115f6565b61043d61173e565b80801580159061044e575060328111155b6104735760405162461bcd60e51b815260040161046a90611e68565b60405180910390fd5b61047c33611784565b336000908152600a6020526040812080549091036104f557600c80546001818101835560008390527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c790910180546001600160a01b0319163317905590546104e49190611eaa565b336000908152600d60205260409020555b60005b828110156106d757600085858381811061051457610514611ebd565b905060200201359050336001600160a01b03167f00000000000000000000000043a9652e2b3ce8970e8d33d8c34252a59a6596aa6001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161057591815260200190565b602060405180830381865afa158015610592573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b69190611ed3565b6001600160a01b0316146106165760405162461bcd60e51b815260206004820152602160248201527f43616e2774207374616b6520746f6b656e7320796f7520646f6e2774206f776e6044820152602160f81b606482015260840161046a565b6000818152600b60205260409020546001600160a01b0316156106725760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88185b1c9958591e481cdd185ad95960621b604482015260640161046a565b60005b828110156106c4578187878381811061069057610690611ebd565b90506020020135036106b45760405162461bcd60e51b815260040161046a90611ef0565b6106bd81611f27565b9050610675565b5050806106d090611f27565b90506104f8565b5060005b828110156107ea5760008585838181106106f7576106f7611ebd565b6040516323b872dd60e01b815233600482015230602482015260209091029290920135604483018190529250506001600160a01b037f00000000000000000000000043a9652e2b3ce8970e8d33d8c34252a59a6596aa16906323b872dd90606401600060405180830381600087803b15801561077257600080fd5b505af1158015610786573d6000803e3d6000fd5b505084546001818101875560008781526020902090910184905585546107af9350909150611eaa565b6000918252600e6020908152604080842092909255600b9052902080546001600160a01b031916331790556107e381611f27565b90506106db565b5081600460008282546107fd9190611f40565b909155505060405133907f134b166c6094cc1ccbf1e3353ce5c3cd9fd29869051bdb999895854d77cc5ef6906108369087908790611f53565b60405180910390a250505050565b61084c611835565b61085533611784565b33600090815260096020526040902054806108b25760405162461bcd60e51b815260206004820152601c60248201527f596f752068617665206e6f207265776172647320746f20636c61696d00000000604482015260640161046a565b336000818152600960205260408120556108f7907f000000000000000000000000151d5dd986cc7e333a64b985309c30f9718cef5c6001600160a01b0316908361188e565b60405181815233907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9060200160405180910390a25061093660018055565b565b6109406118e5565b61093661193f565b6001600160a01b0381166000908152600a602052604081206060919061096d846115f6565b8154604080516020808402820181019092528281529184918301828280156109b457602002820191906000526020600020905b8154815260200190600101908083116109a0575b5050505050915091509150915091565b600c81815481106109d457600080fd5b6000918252602090912001546001600160a01b0316905081565b6109f66118e5565b6109fe611991565b6003819055610a0f610e1082611f8c565b6007556040518181527f0e8aab9155419c91f2646dd7278ca787e92050a1300c1042465c4d3367685d9c9060200160405180910390a150565b6000600454600003610a5a5750600090565b600454600754610a6c90610e10611fae565b610a7e90670de0b6b3a7640000611fae565b610a889190611f8c565b905090565b610a956118e5565b61093660006119f6565b610aa76118e5565b610936611a46565b610ab7611835565b808015801590610ac8575060328111155b610ae45760405162461bcd60e51b815260040161046a90611e68565b610aed33611784565b336000908152600a602052604090208054610b465760405162461bcd60e51b8152602060048201526019602482015278165bdd481a185d99481b9bc81d1bdad95b9cc81cdd185ad959603a1b604482015260640161046a565b8054821115610b975760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74207769746864726177206d6f7265207468616e207374616b6564604482015260640161046a565b60005b82811015610c1d5760005b81811015610c0c57858583818110610bbf57610bbf611ebd565b90506020020135868683818110610bd857610bd8611ebd565b9050602002013503610bfc5760405162461bcd60e51b815260040161046a90611ef0565b610c0581611f27565b9050610ba5565b50610c1681611f27565b9050610b9a565b5060005b82811015610e56576000858583818110610c3d57610c3d611ebd565b602090810292909201356000818152600b909352604090922054919250506001600160a01b03163314610ca35760405162461bcd60e51b815260206004820152600e60248201526d2737ba103cb7bab9103a37b5b2b760911b604482015260640161046a565b6000818152600e602052604090205483548110610cf85760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840e8ded6cadc40d2dcc8caf606b1b604482015260640161046a565b8354600090610d0990600190611eaa565b9050808214610d6c576000856000018281548110610d2957610d29611ebd565b9060005260206000200154905080866000018481548110610d4c57610d4c611ebd565b6000918252602080832090910192909255918252600e9052604090208290555b8454859080610d7d57610d7d611fc5565b600082815260208082206000199084018101839055909201909255848252600e81526040808320839055600b9091529081902080546001600160a01b0319169055516323b872dd60e01b8152306004820152336024820152604481018490526001600160a01b037f00000000000000000000000043a9652e2b3ce8970e8d33d8c34252a59a6596aa16906323b872dd90606401600060405180830381600087803b158015610e2a57600080fd5b505af1158015610e3e573d6000803e3d6000fd5b5050505050505080610e4f90611f27565b9050610c21565b508160046000828254610e699190611eaa565b90915550508054600003610fae57336000908152600d6020526040812054600c54909190610e9990600190611eaa565b905080821115610ee25760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e6e8c2d6cae440d2dcc8caf60631b604482015260640161046a565b808214610f68576000600c8281548110610efe57610efe611ebd565b600091825260209091200154600c80546001600160a01b039092169250829185908110610f2d57610f2d611ebd565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600d909152604090208290555b600c805480610f7957610f79611fc5565b60008281526020808220830160001990810180546001600160a01b0319169055909201909255338252600d9052604081205550505b336001600160a01b03167ff35c46796392b0deae18b1c5ac3cc50df76b67ef9bcf256df595a3607aab62588585604051610fe9929190611f53565b60405180910390a25050610ffc60018055565b5050565b611008611835565b808015801590611019575060328111155b6110355760405162461bcd60e51b815260040161046a90611e68565b336000908152600a60205260409020805461108e5760405162461bcd60e51b8152602060048201526019602482015278165bdd481a185d99481b9bc81d1bdad95b9cc81cdd185ad959603a1b604482015260640161046a565b60005b828110156111145760005b81811015611103578585838181106110b6576110b6611ebd565b905060200201358686838181106110cf576110cf611ebd565b90506020020135036110f35760405162461bcd60e51b815260040161046a90611ef0565b6110fc81611f27565b905061109c565b5061110d81611f27565b9050611091565b5060005b8281101561136557600085858381811061113457611134611ebd565b602090810292909201356000818152600b909352604090922054919250506001600160a01b0316331461119a5760405162461bcd60e51b815260206004820152600e60248201526d2737ba103cb7bab9103a37b5b2b760911b604482015260640161046a565b6000818152600e6020526040902054835481106111ef5760405162461bcd60e51b8152602060048201526013602482015272092dcecc2d8d2c840e8ded6cadc40d2dcc8caf606b1b604482015260640161046a565b835460009061120090600190611eaa565b905080821461126357600085600001828154811061122057611220611ebd565b906000526020600020015490508086600001848154811061124357611243611ebd565b6000918252602080832090910192909255918252600e9052604090208290555b845485908061127457611274611fc5565b600190038181906000526020600020016000905590556004600081548092919061129d90611fdb565b90915550506000838152600e60209081526040808320839055600b9091529081902080546001600160a01b0319169055516323b872dd60e01b8152306004820152336024820152604481018490526001600160a01b037f00000000000000000000000043a9652e2b3ce8970e8d33d8c34252a59a6596aa16906323b872dd90606401600060405180830381600087803b15801561133957600080fd5b505af115801561134d573d6000803e3d6000fd5b505050505050508061135e90611f27565b9050611118565b503360009081526009602090815260408083208390556005546008909252822055815490036114c557336000908152600d6020526040812054600c549091906113b090600190611eaa565b9050808211156113f95760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e6e8c2d6cae440d2dcc8caf60631b604482015260640161046a565b80821461147f576000600c828154811061141557611415611ebd565b600091825260209091200154600c80546001600160a01b03909216925082918590811061144457611444611ebd565b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055929091168152600d909152604090208290555b600c80548061149057611490611fc5565b60008281526020808220830160001990810180546001600160a01b0319169055909201909255338252600d9052604081205550505b336001600160a01b03167f1ad6082f7aa3e32095e38fd4c0bf76fa2bb7584e81474cf3519d2dea4081181c8585604051610fe9929190611f53565b6115086118e5565b6001600160a01b03811661156d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161046a565b611576816119f6565b50565b6001600160a01b0381166000908152600a60209081526040918290208054835181840281018401909452808452606093928301828280156115d957602002820191906000526020600020905b8154815260200190600101908083116115c5575b50505050509050919050565b60006115f0826115f6565b92915050565b6001600160a01b0381166000908152600a6020908152604080832081518154808502820184018452938101848152859491938492849184018282801561165b57602002820191906000526020600020905b815481526020019060010190808311611647575b505050919092525050600554600454929350911590506116c2576000600654426116859190611eaa565b9050600454600754826116989190611fae565b6116aa90670de0b6b3a7640000611fae565b6116b49190611f8c565b6116be9083611f40565b9150505b6001600160a01b0384166000908152600860205260408120549081831061171057670de0b6b3a76400006116f68385611eaa565b8551516117039190611fae565b61170d9190611f8c565b90505b6001600160a01b038616600090815260096020526040902054611734908290611f40565b9695505050505050565b60025460ff16156109365760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161046a565b61178c611991565b6001600160a01b0381166000908152600a60209081526040808320600890925290912054600554811161181457670de0b6b3a7640000816005546117d09190611eaa565b83546117dc9190611fae565b6117e69190611f8c565b6001600160a01b0384166000908152600960205260408120805490919061180e908490611f40565b90915550505b50506005546001600160a01b03909116600090815260086020526040902055565b6002600154036118875760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161046a565b6002600155565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526118e0908490611a83565b505050565b6000546001600160a01b031633146109365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161046a565b611947611b58565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600454156119f0576000600654426119a99190611eaa565b9050600454600754826119bc9190611fae565b6119ce90670de0b6b3a7640000611fae565b6119d89190611f8c565b600560008282546119e99190611f40565b9091555050505b42600655565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611a4e61173e565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586119743390565b6000611ad8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611ba19092919063ffffffff16565b9050805160001480611af9575080806020019051810190611af99190611ff2565b6118e05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161046a565b60025460ff166109365760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161046a565b6060611bb08484600085611bb8565b949350505050565b606082471015611c195760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161046a565b600080866001600160a01b03168587604051611c359190612038565b60006040518083038185875af1925050503d8060008114611c72576040519150601f19603f3d011682016040523d82523d6000602084013e611c77565b606091505b5091509150611c8887838387611c93565b979650505050505050565b60608315611d02578251600003611cfb576001600160a01b0385163b611cfb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161046a565b5081611bb0565b611bb08383815115611d175781518083602001fd5b8060405162461bcd60e51b815260040161046a9190612054565b60008060208385031215611d4457600080fd5b823567ffffffffffffffff80821115611d5c57600080fd5b818501915085601f830112611d7057600080fd5b813581811115611d7f57600080fd5b8660208260051b8501011115611d9457600080fd5b60209290920196919550909350505050565b6001600160a01b038116811461157657600080fd5b600060208284031215611dcd57600080fd5b8135611dd881611da6565b9392505050565b600081518084526020808501945080840160005b83811015611e0f57815187529582019590820190600101611df3565b509495945050505050565b604081526000611e2d6040830185611ddf565b90508260208301529392505050565b600060208284031215611e4e57600080fd5b5035919050565b602081526000611dd86020830184611ddf565b602080825260129082015271496e76616c69642062617463682073697a6560701b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b818103818111156115f0576115f0611e94565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611ee557600080fd5b8151611dd881611da6565b6020808252601c908201527f4475706c696361746520746f6b656e20696e2073616d652063616c6c00000000604082015260600190565b600060018201611f3957611f39611e94565b5060010190565b808201808211156115f0576115f0611e94565b6020808252810182905260006001600160fb1b03831115611f7357600080fd5b8260051b80856040850137919091016040019392505050565b600082611fa957634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176115f0576115f0611e94565b634e487b7160e01b600052603160045260246000fd5b600081611fea57611fea611e94565b506000190190565b60006020828403121561200457600080fd5b81518015158114611dd857600080fd5b60005b8381101561202f578181015183820152602001612017565b50506000910152565b6000825161204a818460208701612014565b9190910192915050565b6020815260008251806020840152612073816040850160208701612014565b601f01601f1916919091016040019291505056fea2646970667358221220d947817ff4753e42a3d671e055deda8fddedc5e64d7b1a4a1ebb6616dd4a1c3864736f6c63430008130033

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

00000000000000000000000043a9652e2b3ce8970e8d33d8c34252a59a6596aa000000000000000000000000151d5dd986cc7e333a64b985309c30f9718cef5c

-----Decoded View---------------
Arg [0] : _nftCollection (address): 0x43A9652E2B3cE8970e8d33d8C34252a59a6596Aa
Arg [1] : _rewardsToken (address): 0x151d5Dd986cc7E333A64B985309c30F9718cef5c

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000043a9652e2b3ce8970e8d33d8c34252a59a6596aa
Arg [1] : 000000000000000000000000151d5dd986cc7e333a64b985309c30f9718cef5c


Block Transaction Gas Used Reward
view all blocks ##produced##

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