ETH Price: $3,938.85 (+4.59%)

Contract

0xB4A3C079ACBD57668bF5292C13878F9225678381
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Batch Stake ERC7...213039932024-12-01 0:11:5911 days ago1733011919IN
0xB4A3C079...225678381
0 ETH0.0050806312.63598451
Batch Unstake ER...213039792024-12-01 0:09:1111 days ago1733011751IN
0xB4A3C079...225678381
0 ETH0.0030351313.18874733
Batch Unstake ER...212920092024-11-29 7:58:1113 days ago1732867091IN
0xB4A3C079...225678381
0 ETH0.005329765
Batch Stake ERC7...212674652024-11-25 21:31:1116 days ago1732570271IN
0xB4A3C079...225678381
0 ETH0.006471038.83836226
Batch Stake ERC7...212603862024-11-24 21:47:3517 days ago1732484855IN
0xB4A3C079...225678381
0 ETH0.003497518.69680318
Batch Unstake ER...212603682024-11-24 21:43:5917 days ago1732484639IN
0xB4A3C079...225678381
0 ETH0.002251598.71320852
Batch Unstake ER...212424452024-11-22 9:42:2320 days ago1732268543IN
0xB4A3C079...225678381
0 ETH0.00252399.76699232
Batch Stake ERC7...212328562024-11-21 1:34:2321 days ago1732152863IN
0xB4A3C079...225678381
0 ETH0.003305878.22028673
Batch Unstake ER...212328372024-11-21 1:30:3521 days ago1732152635IN
0xB4A3C079...225678381
0 ETH0.002236279.63320591
Batch Stake ERC7...212318182024-11-20 22:05:3521 days ago1732140335IN
0xB4A3C079...225678381
0 ETH0.0061808516.05162057
Batch Unstake ER...212318022024-11-20 22:02:2321 days ago1732140143IN
0xB4A3C079...225678381
0 ETH0.0107129216.62740814
Batch Stake ERC7...211068122024-11-03 11:27:2339 days ago1730633243IN
0xB4A3C079...225678381
0 ETH0.007918934.64686735
Batch Unstake ER...211067022024-11-03 11:05:1139 days ago1730631911IN
0xB4A3C079...225678381
0 ETH0.002393783.2
Batch Stake ERC7...210403632024-10-25 4:53:3548 days ago1729832015IN
0xB4A3C079...225678381
0 ETH0.001804554.68626148
Batch Unstake ER...210403222024-10-25 4:45:2348 days ago1729831523IN
0xB4A3C079...225678381
0 ETH0.000734964.44182052
Batch Unstake ER...210387372024-10-24 23:26:2348 days ago1729812383IN
0xB4A3C079...225678381
0 ETH0.001692816.45466676
Batch Stake ERC7...209607812024-10-14 2:19:1159 days ago1728872351IN
0xB4A3C079...225678381
0 ETH0.003065897.96209695
Batch Unstake ER...209607372024-10-14 2:10:2359 days ago1728871823IN
0xB4A3C079...225678381
0 ETH0.001509817.6334778
Batch Unstake ER...209422362024-10-11 11:59:3562 days ago1728647975IN
0xB4A3C079...225678381
0 ETH0.006076220.5619627
Batch Stake ERC7...209407272024-10-11 6:55:4762 days ago1728629747IN
0xB4A3C079...225678381
0 ETH0.0112738310.79259136
Batch Stake ERC7...209335282024-10-10 6:50:5963 days ago1728543059IN
0xB4A3C079...225678381
0 ETH0.003417338.87450363
Batch Unstake ER...209226412024-10-08 18:25:2364 days ago1728411923IN
0xB4A3C079...225678381
0 ETH0.0100819621.31309327
Batch Stake ERC7...209196402024-10-08 8:23:3565 days ago1728375815IN
0xB4A3C079...225678381
0 ETH0.0046315712.02777486
Batch Stake ERC7...209195272024-10-08 8:00:5965 days ago1728374459IN
0xB4A3C079...225678381
0 ETH0.0047356412.2980552
Batch Unstake ER...209168682024-10-07 23:07:3565 days ago1728342455IN
0xB4A3C079...225678381
0 ETH0.0003373211.42069522
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Staking

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 6 : Staking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

// ERC721 Interface
interface IERC721 {
    function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;
    function ownerOf(uint256 _tokenId) external view returns (address);
    function totalSupply() external view returns (uint256);
}

contract Staking is ERC721Holder, Ownable, ReentrancyGuard {

    IERC721 private immutable nft;

    uint256 public currentPoolId;
    uint256 public stakingUnlock = 3600; // 3600 seconds

    bool public stakingPaused = true;

    struct Pool {
        uint256 firstTokenAllowed;
        uint256 limitPool;
        uint256 costElectricity;
        uint256 lifeTime;
        string typeMachine;
        string area;
        mapping(uint256 => ItemInfo) tokensPool;
        uint256[] ownedTokensPool;
    }

    struct ItemInfo {
        address owner;
        uint256 poolId;
        uint256 timestamp;
        string addressBTC;
    }

    struct Staker {
        mapping(uint256 => ItemInfo) tokensStaker;
        uint256[] ownedTokensStaker;
    }

    /// @notice mapping of a pool to an id.
    mapping(uint256 => Pool) public poolInfos;

    /// @notice mapping of a staker to its wallet.
    mapping(address => Staker) private stakers;


    /* ********************************** */
    /*             Events                 */
    /* ********************************** */

    event Staked721(address indexed owner, uint256 itemId, uint256 poolId);    /// @notice event emitted when a user has staked a nft.
    event Unstaked721(address indexed owner, uint256 itemId, uint256 poolId);    /// @notice event emitted when a user has unstaked a nft.
    event UnlockPeriodUpdated(uint256 period);    /// @notice event emitted when the unlock period is updated.
    event PauseUpdated(bool notPaused);    /// @notice event emitted when the pause is updated.
    event PoolInformationsUpdated(uint256 poolId, uint256 firstTokenAllowed, uint256 limitPool, uint256 costElectricity, uint256 lifetime, string typeMachine, string area); /// @notice event emitted when the informations in a pool has been updated.
    event PoolCreated(uint256 nextPoolId, uint256 firstTokenAllowed, uint256 limitPool, uint256 costElectricity, uint256 lifeTime, string typeMachine, string area); /// @notice event emitted when a pool has been created.

    /* ********************************** */
    /*             Constructor            */
    /* ********************************** */

    /*
    * @notice Constructor of the contract Staking.
    * @param IERC721 _nft : Address of the mint contract.
    */
    constructor(IERC721 _nft) {
        nft = _nft;
        currentPoolId++;
        poolInfos[currentPoolId].firstTokenAllowed = 1;
        poolInfos[currentPoolId].limitPool = 435;
        poolInfos[currentPoolId].costElectricity = 750;
        poolInfos[currentPoolId].lifeTime = 1803230952;
        poolInfos[currentPoolId].typeMachine = "Mining";
        poolInfos[currentPoolId].area = "Iceland";
    }

    /* ********************************** */
    /*             Modifier               */
    /* ********************************** */

    /*
    * @notice Safety checks common to each stake function.
    * @param uint256 _poolId : Id of the pool where to stake.
    * @param string calldata _addressBTC : BTC address that will receive the rewards.
    */
    modifier stakeModifier(uint256 _poolId, string calldata _addressBTC, uint256 _amount) {
        require(!stakingPaused, "Staking unavailable at the moment");
        require(_poolId > 0 && _poolId <= currentPoolId, "Pool doesn't exist");
        require(
            poolInfos[_poolId].ownedTokensPool.length + _amount <= poolInfos[_poolId].limitPool, "Pool limit exceeded"
        );
        _;
    }

    /* ********************************** */
    /*              Pools                 */
    /* ********************************** */

    /*
    * @notice Allows to create a new pool.
    * @param uint256 _firstTokenAllowed : First NFT accepted, only ids greater than or equal to this value will be accepted.
    * @param uint256 _limitPool : Maximum amount of NFT stakable in the pool.
    * @param uint256 _costElectricity : The average cost of electricity.
    * @param uint256 _lifeTime : The life time of the machine.
    * @param string calldata _typeMachine : The type of machine.
    * @param string calldata _area : The area where the machine is located.
    */
    function createPool(uint256 _firstTokenAllowed, uint256 _limitPool, uint256 _costElectricity, uint256 _lifeTime, string calldata _typeMachine, string calldata _area) external onlyOwner {
        currentPoolId++;
        poolInfos[currentPoolId].firstTokenAllowed = _firstTokenAllowed;
        poolInfos[currentPoolId].limitPool = _limitPool;
        poolInfos[currentPoolId].costElectricity = _costElectricity;
        poolInfos[currentPoolId].lifeTime = _lifeTime;
        poolInfos[currentPoolId].typeMachine = _typeMachine;
        poolInfos[currentPoolId].area = _area;
        emit PoolCreated(currentPoolId, _firstTokenAllowed, _limitPool, _costElectricity, _lifeTime, _typeMachine, _area);
    }

    /*
    * @notice Change the one pool information's.
    * @param uint256 _poolId : Id of the pool.
    * @param uint256 _firstTokenAllowed : First NFT accepted, only ids greater than or equal to this value will be accepted.
    * @param uint256 _limitPool : Maximum amount of NFT stakable in the pool.
    * @param uint256 _costElectricity : The average cost of electricity.
    * @param string calldata _area : The area where the machine is located.
    */
    function setPoolInformation(uint256 _poolId, uint256 _firstTokenAllowed, uint256 _limitPool, uint256 _costElectricity,uint256 _lifeTime,string calldata _typeMachine, string calldata _area) external onlyOwner {
        require(_poolId > 0 && _poolId <= currentPoolId, "Pool doesn't exist");
        poolInfos[_poolId].firstTokenAllowed = _firstTokenAllowed;
        poolInfos[_poolId].limitPool = _limitPool;
        poolInfos[_poolId].costElectricity = _costElectricity;
        poolInfos[_poolId].lifeTime = _lifeTime;
        poolInfos[_poolId].typeMachine = _typeMachine;
        poolInfos[_poolId].area = _area;
        emit PoolInformationsUpdated(_poolId, _firstTokenAllowed, _limitPool, _costElectricity, _lifeTime, _typeMachine, _area);
    }

    /* ********************************** */
    /*              Staking               */
    /* ********************************** */

    /*
    * @notice Private function used in stakeERC721.
    * @param uint256 _poolId : Id of the pool where to stake.
    * @param uint256 _tokenId : Id of the token to stake.
    * @param string calldata : _addressBTC BTC address that will receive the rewards.
    */
    function _stakeERC721(uint256 _poolId, uint256 _tokenId, string calldata _addressBTC) private {
        
        require(
            _tokenId >= poolInfos[_poolId].firstTokenAllowed,
            "NFT can't be staked in this pool"
        );

        require(
            nft.ownerOf(_tokenId) == msg.sender,
            "Not owner"
        );

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

        Staker storage staker = stakers[msg.sender];
        Pool storage pool = poolInfos[_poolId];

        ItemInfo memory info = ItemInfo(
            msg.sender,
            _poolId,
            block.timestamp,
            _addressBTC
        );
        staker.tokensStaker[_tokenId] = info;
        staker.ownedTokensStaker.push(_tokenId);

        pool.tokensPool[_tokenId] = info;
        pool.ownedTokensPool.push(_tokenId);
        
        emit Staked721(msg.sender, _tokenId, _poolId);
    }

    /*
    * @notice Allows to stake an NFT in the desired quantity.
    * @param uint256 _poolId : Id of the pool where to stake.
    * @param uint256 _tokenId : Id of the token to stake.
    * @param string calldata _addressBTC : BTC address that will receive the rewards.
    */
    function stakeERC721(uint256 _poolId, uint256 _tokenId, string calldata _addressBTC) external nonReentrant stakeModifier(_poolId, _addressBTC, 1) {
        _stakeERC721(_poolId, _tokenId, _addressBTC);
    }

    /*
    * @notice Allows to stake several NFT in the desired quantity.
    * @param uint256 _poolId : Id of the pool where to stake.
    * @param uint256[] _tokenIds : List of IDs of the tokens to stake.
    * @param string calldata _addressBTC : BTC address that will receive the rewards.
    */
    function batchStakeERC721(uint256 _poolId, uint256[] calldata _tokenIds, string calldata _addressBTC) external nonReentrant stakeModifier(_poolId, _addressBTC, _tokenIds.length) {
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            _stakeERC721(_poolId, _tokenIds[i], _addressBTC);
        }
    }

    /*
    * @notice Changes the minimum period before it's possible to unstake.
    * @param uint256 _period : New minimum period before being able to unstake.
    */
    function setUnlockPeriod(uint256 _period) external onlyOwner {
        stakingUnlock = _period;
        emit UnlockPeriodUpdated(stakingUnlock);
    }

    /* ********************************** */
    /*              Unstaking             */
    /* ********************************** */

    /*
    * @notice Private function used in unstakeERC721.
    * @param uint256 _tokenId : Id of the token to unstake.
    */
    function _unstakeERC721(uint256 _tokenId) private {
        require(stakers[msg.sender].tokensStaker[_tokenId].timestamp != 0, "No NFT staked");
        uint256 elapsedTime = block.timestamp - stakers[msg.sender].tokensStaker[_tokenId].timestamp;
        require(stakingUnlock < elapsedTime, "Unable to unstake before the minimum period");
        Staker storage staker = stakers[msg.sender];
        uint256 poolId = staker.tokensStaker[_tokenId].poolId;
        Pool storage pool = poolInfos[poolId];

        delete staker.tokensStaker[_tokenId];
        delete pool.tokensPool[_tokenId];

        for (uint256 i = 0; i < staker.ownedTokensStaker.length; i++) {
            if (staker.ownedTokensStaker[i] == _tokenId) {
                staker.ownedTokensStaker[i] = staker.ownedTokensStaker[
                staker.ownedTokensStaker.length - 1
                ];
                staker.ownedTokensStaker.pop();
                break;
            }
        }

        for (uint256 i = 0; i < pool.ownedTokensPool.length; i++) {
            if (pool.ownedTokensPool[i] == _tokenId) {
                pool.ownedTokensPool[i] = pool.ownedTokensPool[
                pool.ownedTokensPool.length - 1
                ];
                pool.ownedTokensPool.pop();
                break;
            }
        }

        nft.safeTransferFrom(address(this), msg.sender, _tokenId);
        emit Unstaked721(msg.sender, _tokenId, poolId);
    }


    /*
    * @notice Allows you to unstake an NFT staked.
    * @param uint256 _tokenId : Id of the token to unstake.
    */
    function unstakeERC721(uint256 _tokenId) external nonReentrant {
        _unstakeERC721(_tokenId);
    }

    /*
    * @notice Allows you to unstake several NFT staked.
    * @param uint256[] _tokenIds : Ids of the token to unstake.
    */
    function batchUnstakeERC721(uint256[] calldata _tokenIds) external nonReentrant {
        for (uint256 i = 0; i < _tokenIds.length; i++) {
            _unstakeERC721(_tokenIds[i]);
        }
    }

    /* ********************************** */
    /*              Getters               */
    /* ********************************** */


    /*
    * @notice Returns the ItemInfo of a specific NFT staked by a user.
    * @param address _user : Address of the user.
    * @param uint256 : _tokenId Id of the token.
    * @return ItemInfo memory : Details of tokenId.
    */
    function getStakedERC721(address _user, uint256 _tokenId) external view returns (ItemInfo memory) {
        return stakers[_user].tokensStaker[_tokenId];
    }

    /*
    * @notice Returns the list of NFT staked by a user.
    * @param address _user : Address of the user.
    * @return uint256[] : List of tokenIds.
    */
    function getAllStakedERC721(address _user) external view returns (uint256[] memory) {
        return stakers[_user].ownedTokensStaker;
    }

    /*
    * @notice Returns the ItemInfo of a specific NFT staked in a pool.
    * @param uint256 _poolId : Id of the pool.
    * @param uint256 _tokenId : Id of the token.
    * @return ItemInfo : Details of tokenId.
    */
    function getStakedERC721Pool(uint256 _poolId, uint256 _tokenId) external view returns (ItemInfo memory) {
        return poolInfos[_poolId].tokensPool[_tokenId];
    }


    /*
    * @notice Returns the list of NFT staked in a pool.
    * @param uint256 _poolId : Id of the pool.
    * @return uint256[] : List of tokenIds.
    */
    function getAllStakedERC721Pool(uint256 _poolId) external view returns (uint256[] memory) {
        return poolInfos[_poolId].ownedTokensPool;
    }

    /*
    * @notice Returns the list of NFT staked in a pool by a user.
    * @param uint256 _poolId : Id of the pool.
    * @param address _user : Address of the user.
    * @return uint256[] : List of tokenIds.
    */
    function getAllStakedERC721PoolByUser(uint256 _poolId, address _user) external view returns (uint256[] memory) {
        uint totalSupply = nft.totalSupply();
        uint256[] memory tmpList = new uint256[](totalSupply);
        uint256 counter = 0;

        for (uint256 i = 0; i <= totalSupply; i++) {
            if (poolInfos[_poolId].tokensPool[i].owner == _user) {
                tmpList[counter] = i;
                counter++;
            }
        }

        uint256[] memory stakedList = new uint256[](counter);
        for (uint256 i = 0; i < counter; i++) {
            stakedList[i] = tmpList[i];
        }

        return stakedList;
    }

    /* ********************************** */
    /*               Pauser               */
    /* ********************************** */

    /*
    * @notice Changes the variable notPaused to allow or not the staking.
    */
    function toggleStakingPaused() external onlyOwner {
        stakingPaused = !stakingPaused;
        emit PauseUpdated(stakingPaused);
    }

}

File 2 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _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);
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

File 4 of 6 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 5 of 6 : ERC721Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

File 6 of 6 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC721","name":"_nft","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"notPaused","type":"bool"}],"name":"PauseUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"nextPoolId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"firstTokenAllowed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"limitPool","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"costElectricity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lifeTime","type":"uint256"},{"indexed":false,"internalType":"string","name":"typeMachine","type":"string"},{"indexed":false,"internalType":"string","name":"area","type":"string"}],"name":"PoolCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"firstTokenAllowed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"limitPool","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"costElectricity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lifetime","type":"uint256"},{"indexed":false,"internalType":"string","name":"typeMachine","type":"string"},{"indexed":false,"internalType":"string","name":"area","type":"string"}],"name":"PoolInformationsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"Staked721","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"}],"name":"UnlockPeriodUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"Unstaked721","type":"event"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"string","name":"_addressBTC","type":"string"}],"name":"batchStakeERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"batchUnstakeERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_firstTokenAllowed","type":"uint256"},{"internalType":"uint256","name":"_limitPool","type":"uint256"},{"internalType":"uint256","name":"_costElectricity","type":"uint256"},{"internalType":"uint256","name":"_lifeTime","type":"uint256"},{"internalType":"string","name":"_typeMachine","type":"string"},{"internalType":"string","name":"_area","type":"string"}],"name":"createPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAllStakedERC721","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"getAllStakedERC721Pool","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"getAllStakedERC721PoolByUser","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getStakedERC721","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"string","name":"addressBTC","type":"string"}],"internalType":"struct Staking.ItemInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getStakedERC721Pool","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"string","name":"addressBTC","type":"string"}],"internalType":"struct Staking.ItemInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfos","outputs":[{"internalType":"uint256","name":"firstTokenAllowed","type":"uint256"},{"internalType":"uint256","name":"limitPool","type":"uint256"},{"internalType":"uint256","name":"costElectricity","type":"uint256"},{"internalType":"uint256","name":"lifeTime","type":"uint256"},{"internalType":"string","name":"typeMachine","type":"string"},{"internalType":"string","name":"area","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_firstTokenAllowed","type":"uint256"},{"internalType":"uint256","name":"_limitPool","type":"uint256"},{"internalType":"uint256","name":"_costElectricity","type":"uint256"},{"internalType":"uint256","name":"_lifeTime","type":"uint256"},{"internalType":"string","name":"_typeMachine","type":"string"},{"internalType":"string","name":"_area","type":"string"}],"name":"setPoolInformation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"setUnlockPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_addressBTC","type":"string"}],"name":"stakeERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingUnlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleStakingPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"unstakeERC721","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a0604052610e106003556004805460ff191660011790553480156200002457600080fd5b50604051620023d3380380620023d3833981016040819052620000479162000193565b620000523362000143565b600180556001600160a01b038116608052600280549060006200007583620001c5565b9091555050600280546000908152600560208181526040808420600190819055855485528185206101b3910155845484528084206102ee9086015584548452808420636b7b1ee86003909101558051808201825260068152654d696e696e6760d01b8184015294548452919052902060040190620000f4908262000292565b50604051806040016040528060078152602001661258d95b185b9960ca1b81525060056000600254815260200190815260200160002060050190816200013b919062000292565b50506200035e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620001a657600080fd5b81516001600160a01b0381168114620001be57600080fd5b9392505050565b600060018201620001e657634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200021857607f821691505b6020821081036200023957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200028d57600081815260208120601f850160051c81016020861015620002685750805b601f850160051c820191505b81811015620002895782815560010162000274565b5050505b505050565b81516001600160401b03811115620002ae57620002ae620001ed565b620002c681620002bf845462000203565b846200023f565b602080601f831160018114620002fe5760008415620002e55750858301515b600019600386901b1c1916600185901b17855562000289565b600085815260208120601f198616915b828110156200032f578886015182559484019460019091019084016200030e565b50858210156200034e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516120446200038f6000396000818161097f015281816111c10152818161138f015261145e01526120446000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80638a0ddc6a116100b8578063bfafa3781161007c578063bfafa378146102b4578063c432de61146102c7578063d1e03d48146102da578063ebc5163b146102ed578063f2fde38b146102f6578063fbe151491461030957600080fd5b80638a0ddc6a1461024a5780638da5cb5b14610261578063a70199671461027c578063b1a3bc811461028f578063bbb781cc1461029757600080fd5b80634737781e116100ff5780634737781e146101e4578063689d84e4146101f7578063715018a61461021c57806374c781a91461022457806376f72fb71461023757600080fd5b8063035019511461013c578063150b7a02146101655780632291d9911461019c57806339782899146101b15780633d0ddf84146101d1575b600080fd5b61014f61014a3660046116ab565b61031c565b60405161015c91906116c4565b60405180910390f35b610183610173366004611733565b630a85bd0160e11b949350505050565b6040516001600160e01b0319909116815260200161015c565b6101af6101aa3660046116ab565b610381565b005b6101c46101bf366004611813565b61039e565b60405161015c919061187b565b6101af6101df3660046116ab565b6104bf565b6101c46101f23660046118c4565b610502565b61020a6102053660046116ab565b610597565b60405161015c969594939291906118f0565b6101af6106de565b6101af610232366004611983565b6106f2565b6101af610245366004611a25565b6107d6565b61025360035481565b60405190815260200161015c565b6000546040516001600160a01b03909116815260200161015c565b61014f61028a366004611abb565b6108b7565b6101af610924565b6004546102a49060ff1681565b604051901515815260200161015c565b61014f6102c2366004611adf565b610979565b6101af6102d5366004611b54565b610b67565b6101af6102e8366004611bce565b610c86565b61025360025481565b6101af610304366004611abb565b610cda565b6101af610317366004611c10565b610d50565b60008181526005602090815260409182902060070180548351818402810184019094528084526060939283018282801561037557602002820191906000526020600020905b815481526020019060010190808311610361575b50505050509050919050565b610389610e39565b61039281610e92565b61039b60018055565b50565b6103d2604051806080016040528060006001600160a01b031681526020016000815260200160008152602001606081525090565b6000838152600560209081526040808320858452600601825291829020825160808101845281546001600160a01b0316815260018201549281019290925260028101549282019290925260038201805491929160608401919061043490611c63565b80601f016020809104026020016040519081016040528092919081815260200182805461046090611c63565b80156104ad5780601f10610482576101008083540402835291602001916104ad565b820191906000526020600020905b81548152906001019060200180831161049057829003601f168201915b50505050508152505090505b92915050565b6104c7611267565b60038190556040518181527fde54dea4de0ecd62134dfb7475515f86b11b5112290f869c50c668af0a3c10bb9060200160405180910390a150565b610536604051806080016040528060006001600160a01b031681526020016000815260200160008152602001606081525090565b6001600160a01b03808416600090815260066020908152604080832086845282529182902082516080810184528154909416845260018101549184019190915260028101549183019190915260038101805460608401919061043490611c63565b6005602052600090815260409020805460018201546002830154600384015460048501805494959394929391926105cd90611c63565b80601f01602080910402602001604051908101604052809291908181526020018280546105f990611c63565b80156106465780601f1061061b57610100808354040283529160200191610646565b820191906000526020600020905b81548152906001019060200180831161062957829003601f168201915b50505050509080600501805461065b90611c63565b80601f016020809104026020016040519081016040528092919081815260200182805461068790611c63565b80156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b5050505050905086565b6106e6611267565b6106f060006112c1565b565b6106fa611267565b60008911801561070c57506002548911155b6107315760405162461bcd60e51b815260040161072890611c9d565b60405180910390fd5b6000898152600560205260409020888155600181018890556002810187905560038101869055600401610765848683611d18565b50600089815260056020819052604090912001610783828483611d18565b507f2b7ef3e12da30feace371c47c292fd57def5d34c8b6326aaac4b1d58c46a2cb28989898989898989896040516107c399989796959493929190611e01565b60405180910390a1505050505050505050565b6107de611267565b600280549060006107ee83611e6c565b9091555050600280546000908152600560205260408082208b9055825482528082206001018a9055825482528082208301899055825482528082206003018890559154815220600401610842848683611d18565b50600254600090815260056020819052604090912001610863828483611d18565b507f4bded557d21d086d094345e1f2323b4faa4af81a15b807892f5835cc03141d2460025489898989898989896040516108a599989796959493929190611e01565b60405180910390a15050505050505050565b6001600160a01b03811660009081526006602090815260409182902060010180548351818402810184019094528084526060939283018282801561037557602002820191906000526020600020908154815260200190600101908083116103615750505050509050919050565b61092c611267565b6004805460ff8082161560ff1990921682179092556040519116151581527f77860e247ab9186dbe64e5bd0e0b93273cc4273e01818420e788f500078886f59060200160405180910390a1565b606060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ff9190611e85565b905060008167ffffffffffffffff811115610a1c57610a1c61171d565b604051908082528060200260200182016040528015610a45578160200160208202803683370190505b5090506000805b838111610ac05760008781526005602090815260408083208484526006019091529020546001600160a01b03808816911603610aae5780838381518110610a9557610a95611e9e565b602090810291909101015281610aaa81611e6c565b9250505b80610ab881611e6c565b915050610a4c565b5060008167ffffffffffffffff811115610adc57610adc61171d565b604051908082528060200260200182016040528015610b05578160200160208202803683370190505b50905060005b82811015610b5c57838181518110610b2557610b25611e9e565b6020026020010151828281518110610b3f57610b3f611e9e565b602090810291909101015280610b5481611e6c565b915050610b0b565b509695505050505050565b610b6f610e39565b600454859083908390869060ff1615610b9a5760405162461bcd60e51b815260040161072890611eb4565b600084118015610bac57506002548411155b610bc85760405162461bcd60e51b815260040161072890611c9d565b60008481526005602052604090206001810154600790910154610bec908390611ef5565b1115610c305760405162461bcd60e51b8152602060048201526013602482015272141bdbdb081b1a5b5a5d08195e18d959591959606a1b6044820152606401610728565b60005b87811015610c7157610c5f8a8a8a84818110610c5157610c51611e9e565b905060200201358989611311565b80610c6981611e6c565b915050610c33565b5050505050610c7f60018055565b5050505050565b610c8e610e39565b60005b81811015610ccc57610cba838383818110610cae57610cae611e9e565b90506020020135610e92565b80610cc481611e6c565b915050610c91565b50610cd660018055565b5050565b610ce2611267565b6001600160a01b038116610d475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610728565b61039b816112c1565b610d58610e39565b60045484908390839060019060ff1615610d845760405162461bcd60e51b815260040161072890611eb4565b600084118015610d9657506002548411155b610db25760405162461bcd60e51b815260040161072890611c9d565b60008481526005602052604090206001810154600790910154610dd6908390611ef5565b1115610e1a5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb081b1a5b5a5d08195e18d959591959606a1b6044820152606401610728565b610e2688888888611311565b50505050610e3360018055565b50505050565b600260015403610e8b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610728565b6002600155565b3360009081526006602090815260408083208484529091528120600201549003610eee5760405162461bcd60e51b815260206004820152600d60248201526c139bc8139195081cdd185ad959609a1b6044820152606401610728565b336000908152600660209081526040808320848452909152812060020154610f169042611f08565b90508060035410610f7d5760405162461bcd60e51b815260206004820152602b60248201527f556e61626c6520746f20756e7374616b65206265666f726520746865206d696e60448201526a1a5b5d5b481c195c9a5bd960aa1b6064820152608401610728565b336000908152600660209081526040808320858452808352818420600181018054808752600586529386208887529483905281546001600160a01b0319168255859055600281018590559093919291610fd9600383018261165d565b50506000858152600682016020526040812080546001600160a01b0319168155600181018290556002810182905590611015600383018261165d565b505060005b60018401548110156110da578584600101828154811061103c5761103c611e9e565b9060005260206000200154036110c85760018085018054909161105e91611f08565b8154811061106e5761106e611e9e565b906000526020600020015484600101828154811061108e5761108e611e9e565b600091825260209091200155600184018054806110ad576110ad611f1b565b600190038181906000526020600020016000905590556110da565b806110d281611e6c565b91505061101a565b5060005b600782015481101561119e578582600701828154811061110057611100611e9e565b90600052602060002001540361118c5760078201805461112290600190611f08565b8154811061113257611132611e9e565b906000526020600020015482600701828154811061115257611152611e9e565b6000918252602090912001556007820180548061117157611171611f1b565b6001900381819060005260206000200160009055905561119e565b8061119681611e6c565b9150506110de565b50604051632142170760e11b8152306004820152336024820152604481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342842e0e90606401600060405180830381600087803b15801561120d57600080fd5b505af1158015611221573d6000803e3d6000fd5b505060408051888152602081018690523393507fdf0644937d8f62c31eabad75fe2af68e796328c104b8076b6ebde2a14941e4ff92500160405180910390a25050505050565b6000546001600160a01b031633146106f05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610728565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008481526005602052604090205483101561136f5760405162461bcd60e51b815260206004820181905260248201527f4e46542063616e2774206265207374616b656420696e207468697320706f6f6c6044820152606401610728565b6040516331a9108f60e11b81526004810184905233906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa1580156113d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fa9190611f31565b6001600160a01b03161461143c5760405162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b6044820152606401610728565b604051632142170760e11b8152336004820152306024820152604481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342842e0e90606401600060405180830381600087803b1580156114aa57600080fd5b505af11580156114be573d6000803e3d6000fd5b50503360008181526006602090815260408083208a84526005835281842082516080810184529586528584018c905242868401528251601f8a0185900485028101850190935288835290965094509192916060830191889088908190840183828082843760009201829052509390945250508881526020868152604091829020845181546001600160a01b0319166001600160a01b039091161781559084015160018201559083015160028201556060830151929350839290915060038201906115889082611f4e565b50505060018381018054808301825560009182526020808320909101899055888252600685018152604091829020845181546001600160a01b0319166001600160a01b0390911617815590840151928101929092558201516002820155606082015182919060038201906115fc9082611f4e565b5050506007820180546001810182556000918252602091829020018790556040805188815291820189905233917f3531133cf5c53b0134299da512efdc6f661443c767bfb700936f71d967d3ee0d910160405180910390a250505050505050565b50805461166990611c63565b6000825580601f10611679575050565b601f01602090049060005260206000209081019061039b91905b808211156116a75760008155600101611693565b5090565b6000602082840312156116bd57600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b818110156116fc578351835292840192918401916001016116e0565b50909695505050505050565b6001600160a01b038116811461039b57600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561174957600080fd5b843561175481611708565b9350602085013561176481611708565b925060408501359150606085013567ffffffffffffffff8082111561178857600080fd5b818701915087601f83011261179c57600080fd5b8135818111156117ae576117ae61171d565b604051601f8201601f19908116603f011681019083821181831017156117d6576117d661171d565b816040528281528a60208487010111156117ef57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561182657600080fd5b50508035926020909101359150565b6000815180845260005b8181101561185b5760208185018101518683018201520161183f565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260018060a01b0382511660208201526020820151604082015260408201516060820152600060608301516080808401526118bc60a0840182611835565b949350505050565b600080604083850312156118d757600080fd5b82356118e281611708565b946020939093013593505050565b86815285602082015284604082015283606082015260c06080820152600061191b60c0830185611835565b82810360a084015261192d8185611835565b9998505050505050505050565b60008083601f84011261194c57600080fd5b50813567ffffffffffffffff81111561196457600080fd5b60208301915083602082850101111561197c57600080fd5b9250929050565b600080600080600080600080600060e08a8c0312156119a157600080fd5b8935985060208a0135975060408a0135965060608a0135955060808a0135945060a08a013567ffffffffffffffff808211156119dc57600080fd5b6119e88d838e0161193a565b909650945060c08c0135915080821115611a0157600080fd5b50611a0e8c828d0161193a565b915080935050809150509295985092959850929598565b60008060008060008060008060c0898b031215611a4157600080fd5b88359750602089013596506040890135955060608901359450608089013567ffffffffffffffff80821115611a7557600080fd5b611a818c838d0161193a565b909650945060a08b0135915080821115611a9a57600080fd5b50611aa78b828c0161193a565b999c989b5096995094979396929594505050565b600060208284031215611acd57600080fd5b8135611ad881611708565b9392505050565b60008060408385031215611af257600080fd5b823591506020830135611b0481611708565b809150509250929050565b60008083601f840112611b2157600080fd5b50813567ffffffffffffffff811115611b3957600080fd5b6020830191508360208260051b850101111561197c57600080fd5b600080600080600060608688031215611b6c57600080fd5b85359450602086013567ffffffffffffffff80821115611b8b57600080fd5b611b9789838a01611b0f565b90965094506040880135915080821115611bb057600080fd5b50611bbd8882890161193a565b969995985093965092949392505050565b60008060208385031215611be157600080fd5b823567ffffffffffffffff811115611bf857600080fd5b611c0485828601611b0f565b90969095509350505050565b60008060008060608587031215611c2657600080fd5b8435935060208501359250604085013567ffffffffffffffff811115611c4b57600080fd5b611c578782880161193a565b95989497509550505050565b600181811c90821680611c7757607f821691505b602082108103611c9757634e487b7160e01b600052602260045260246000fd5b50919050565b602080825260129082015271141bdbdb08191bd95cdb89dd08195e1a5cdd60721b604082015260600190565b601f821115611d1357600081815260208120601f850160051c81016020861015611cf05750805b601f850160051c820191505b81811015611d0f57828155600101611cfc565b5050505b505050565b67ffffffffffffffff831115611d3057611d3061171d565b611d4483611d3e8354611c63565b83611cc9565b6000601f841160018114611d785760008515611d605750838201355b600019600387901b1c1916600186901b178355610c7f565b600083815260209020601f19861690835b82811015611da95786850135825560209485019460019092019101611d89565b5086821015611dc65760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b89815288602082015287604082015286606082015285608082015260e060a08201526000611e3360e083018688611dd8565b82810360c0840152611e46818587611dd8565b9c9b505050505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201611e7e57611e7e611e56565b5060010190565b600060208284031215611e9757600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b60208082526021908201527f5374616b696e6720756e617661696c61626c6520617420746865206d6f6d656e6040820152601d60fa1b606082015260800190565b808201808211156104b9576104b9611e56565b818103818111156104b9576104b9611e56565b634e487b7160e01b600052603160045260246000fd5b600060208284031215611f4357600080fd5b8151611ad881611708565b815167ffffffffffffffff811115611f6857611f6861171d565b611f7c81611f768454611c63565b84611cc9565b602080601f831160018114611fb15760008415611f995750858301515b600019600386901b1c1916600185901b178555611d0f565b600085815260208120601f198616915b82811015611fe057888601518255948401946001909101908401611fc1565b5085821015611ffe5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fea2646970667358221220d15494fc61b0581ca9ceec380cc451232992b7ad5f62ca228a1a646160eac90664736f6c6343000811003300000000000000000000000031b4c124e8e021402a2b89f8ec1af54f68fd256d

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638a0ddc6a116100b8578063bfafa3781161007c578063bfafa378146102b4578063c432de61146102c7578063d1e03d48146102da578063ebc5163b146102ed578063f2fde38b146102f6578063fbe151491461030957600080fd5b80638a0ddc6a1461024a5780638da5cb5b14610261578063a70199671461027c578063b1a3bc811461028f578063bbb781cc1461029757600080fd5b80634737781e116100ff5780634737781e146101e4578063689d84e4146101f7578063715018a61461021c57806374c781a91461022457806376f72fb71461023757600080fd5b8063035019511461013c578063150b7a02146101655780632291d9911461019c57806339782899146101b15780633d0ddf84146101d1575b600080fd5b61014f61014a3660046116ab565b61031c565b60405161015c91906116c4565b60405180910390f35b610183610173366004611733565b630a85bd0160e11b949350505050565b6040516001600160e01b0319909116815260200161015c565b6101af6101aa3660046116ab565b610381565b005b6101c46101bf366004611813565b61039e565b60405161015c919061187b565b6101af6101df3660046116ab565b6104bf565b6101c46101f23660046118c4565b610502565b61020a6102053660046116ab565b610597565b60405161015c969594939291906118f0565b6101af6106de565b6101af610232366004611983565b6106f2565b6101af610245366004611a25565b6107d6565b61025360035481565b60405190815260200161015c565b6000546040516001600160a01b03909116815260200161015c565b61014f61028a366004611abb565b6108b7565b6101af610924565b6004546102a49060ff1681565b604051901515815260200161015c565b61014f6102c2366004611adf565b610979565b6101af6102d5366004611b54565b610b67565b6101af6102e8366004611bce565b610c86565b61025360025481565b6101af610304366004611abb565b610cda565b6101af610317366004611c10565b610d50565b60008181526005602090815260409182902060070180548351818402810184019094528084526060939283018282801561037557602002820191906000526020600020905b815481526020019060010190808311610361575b50505050509050919050565b610389610e39565b61039281610e92565b61039b60018055565b50565b6103d2604051806080016040528060006001600160a01b031681526020016000815260200160008152602001606081525090565b6000838152600560209081526040808320858452600601825291829020825160808101845281546001600160a01b0316815260018201549281019290925260028101549282019290925260038201805491929160608401919061043490611c63565b80601f016020809104026020016040519081016040528092919081815260200182805461046090611c63565b80156104ad5780601f10610482576101008083540402835291602001916104ad565b820191906000526020600020905b81548152906001019060200180831161049057829003601f168201915b50505050508152505090505b92915050565b6104c7611267565b60038190556040518181527fde54dea4de0ecd62134dfb7475515f86b11b5112290f869c50c668af0a3c10bb9060200160405180910390a150565b610536604051806080016040528060006001600160a01b031681526020016000815260200160008152602001606081525090565b6001600160a01b03808416600090815260066020908152604080832086845282529182902082516080810184528154909416845260018101549184019190915260028101549183019190915260038101805460608401919061043490611c63565b6005602052600090815260409020805460018201546002830154600384015460048501805494959394929391926105cd90611c63565b80601f01602080910402602001604051908101604052809291908181526020018280546105f990611c63565b80156106465780601f1061061b57610100808354040283529160200191610646565b820191906000526020600020905b81548152906001019060200180831161062957829003601f168201915b50505050509080600501805461065b90611c63565b80601f016020809104026020016040519081016040528092919081815260200182805461068790611c63565b80156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b5050505050905086565b6106e6611267565b6106f060006112c1565b565b6106fa611267565b60008911801561070c57506002548911155b6107315760405162461bcd60e51b815260040161072890611c9d565b60405180910390fd5b6000898152600560205260409020888155600181018890556002810187905560038101869055600401610765848683611d18565b50600089815260056020819052604090912001610783828483611d18565b507f2b7ef3e12da30feace371c47c292fd57def5d34c8b6326aaac4b1d58c46a2cb28989898989898989896040516107c399989796959493929190611e01565b60405180910390a1505050505050505050565b6107de611267565b600280549060006107ee83611e6c565b9091555050600280546000908152600560205260408082208b9055825482528082206001018a9055825482528082208301899055825482528082206003018890559154815220600401610842848683611d18565b50600254600090815260056020819052604090912001610863828483611d18565b507f4bded557d21d086d094345e1f2323b4faa4af81a15b807892f5835cc03141d2460025489898989898989896040516108a599989796959493929190611e01565b60405180910390a15050505050505050565b6001600160a01b03811660009081526006602090815260409182902060010180548351818402810184019094528084526060939283018282801561037557602002820191906000526020600020908154815260200190600101908083116103615750505050509050919050565b61092c611267565b6004805460ff8082161560ff1990921682179092556040519116151581527f77860e247ab9186dbe64e5bd0e0b93273cc4273e01818420e788f500078886f59060200160405180910390a1565b606060007f00000000000000000000000031b4c124e8e021402a2b89f8ec1af54f68fd256d6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ff9190611e85565b905060008167ffffffffffffffff811115610a1c57610a1c61171d565b604051908082528060200260200182016040528015610a45578160200160208202803683370190505b5090506000805b838111610ac05760008781526005602090815260408083208484526006019091529020546001600160a01b03808816911603610aae5780838381518110610a9557610a95611e9e565b602090810291909101015281610aaa81611e6c565b9250505b80610ab881611e6c565b915050610a4c565b5060008167ffffffffffffffff811115610adc57610adc61171d565b604051908082528060200260200182016040528015610b05578160200160208202803683370190505b50905060005b82811015610b5c57838181518110610b2557610b25611e9e565b6020026020010151828281518110610b3f57610b3f611e9e565b602090810291909101015280610b5481611e6c565b915050610b0b565b509695505050505050565b610b6f610e39565b600454859083908390869060ff1615610b9a5760405162461bcd60e51b815260040161072890611eb4565b600084118015610bac57506002548411155b610bc85760405162461bcd60e51b815260040161072890611c9d565b60008481526005602052604090206001810154600790910154610bec908390611ef5565b1115610c305760405162461bcd60e51b8152602060048201526013602482015272141bdbdb081b1a5b5a5d08195e18d959591959606a1b6044820152606401610728565b60005b87811015610c7157610c5f8a8a8a84818110610c5157610c51611e9e565b905060200201358989611311565b80610c6981611e6c565b915050610c33565b5050505050610c7f60018055565b5050505050565b610c8e610e39565b60005b81811015610ccc57610cba838383818110610cae57610cae611e9e565b90506020020135610e92565b80610cc481611e6c565b915050610c91565b50610cd660018055565b5050565b610ce2611267565b6001600160a01b038116610d475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610728565b61039b816112c1565b610d58610e39565b60045484908390839060019060ff1615610d845760405162461bcd60e51b815260040161072890611eb4565b600084118015610d9657506002548411155b610db25760405162461bcd60e51b815260040161072890611c9d565b60008481526005602052604090206001810154600790910154610dd6908390611ef5565b1115610e1a5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb081b1a5b5a5d08195e18d959591959606a1b6044820152606401610728565b610e2688888888611311565b50505050610e3360018055565b50505050565b600260015403610e8b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610728565b6002600155565b3360009081526006602090815260408083208484529091528120600201549003610eee5760405162461bcd60e51b815260206004820152600d60248201526c139bc8139195081cdd185ad959609a1b6044820152606401610728565b336000908152600660209081526040808320848452909152812060020154610f169042611f08565b90508060035410610f7d5760405162461bcd60e51b815260206004820152602b60248201527f556e61626c6520746f20756e7374616b65206265666f726520746865206d696e60448201526a1a5b5d5b481c195c9a5bd960aa1b6064820152608401610728565b336000908152600660209081526040808320858452808352818420600181018054808752600586529386208887529483905281546001600160a01b0319168255859055600281018590559093919291610fd9600383018261165d565b50506000858152600682016020526040812080546001600160a01b0319168155600181018290556002810182905590611015600383018261165d565b505060005b60018401548110156110da578584600101828154811061103c5761103c611e9e565b9060005260206000200154036110c85760018085018054909161105e91611f08565b8154811061106e5761106e611e9e565b906000526020600020015484600101828154811061108e5761108e611e9e565b600091825260209091200155600184018054806110ad576110ad611f1b565b600190038181906000526020600020016000905590556110da565b806110d281611e6c565b91505061101a565b5060005b600782015481101561119e578582600701828154811061110057611100611e9e565b90600052602060002001540361118c5760078201805461112290600190611f08565b8154811061113257611132611e9e565b906000526020600020015482600701828154811061115257611152611e9e565b6000918252602090912001556007820180548061117157611171611f1b565b6001900381819060005260206000200160009055905561119e565b8061119681611e6c565b9150506110de565b50604051632142170760e11b8152306004820152336024820152604481018690527f00000000000000000000000031b4c124e8e021402a2b89f8ec1af54f68fd256d6001600160a01b0316906342842e0e90606401600060405180830381600087803b15801561120d57600080fd5b505af1158015611221573d6000803e3d6000fd5b505060408051888152602081018690523393507fdf0644937d8f62c31eabad75fe2af68e796328c104b8076b6ebde2a14941e4ff92500160405180910390a25050505050565b6000546001600160a01b031633146106f05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610728565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008481526005602052604090205483101561136f5760405162461bcd60e51b815260206004820181905260248201527f4e46542063616e2774206265207374616b656420696e207468697320706f6f6c6044820152606401610728565b6040516331a9108f60e11b81526004810184905233906001600160a01b037f00000000000000000000000031b4c124e8e021402a2b89f8ec1af54f68fd256d1690636352211e90602401602060405180830381865afa1580156113d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fa9190611f31565b6001600160a01b03161461143c5760405162461bcd60e51b81526020600482015260096024820152682737ba1037bbb732b960b91b6044820152606401610728565b604051632142170760e11b8152336004820152306024820152604481018490527f00000000000000000000000031b4c124e8e021402a2b89f8ec1af54f68fd256d6001600160a01b0316906342842e0e90606401600060405180830381600087803b1580156114aa57600080fd5b505af11580156114be573d6000803e3d6000fd5b50503360008181526006602090815260408083208a84526005835281842082516080810184529586528584018c905242868401528251601f8a0185900485028101850190935288835290965094509192916060830191889088908190840183828082843760009201829052509390945250508881526020868152604091829020845181546001600160a01b0319166001600160a01b039091161781559084015160018201559083015160028201556060830151929350839290915060038201906115889082611f4e565b50505060018381018054808301825560009182526020808320909101899055888252600685018152604091829020845181546001600160a01b0319166001600160a01b0390911617815590840151928101929092558201516002820155606082015182919060038201906115fc9082611f4e565b5050506007820180546001810182556000918252602091829020018790556040805188815291820189905233917f3531133cf5c53b0134299da512efdc6f661443c767bfb700936f71d967d3ee0d910160405180910390a250505050505050565b50805461166990611c63565b6000825580601f10611679575050565b601f01602090049060005260206000209081019061039b91905b808211156116a75760008155600101611693565b5090565b6000602082840312156116bd57600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b818110156116fc578351835292840192918401916001016116e0565b50909695505050505050565b6001600160a01b038116811461039b57600080fd5b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561174957600080fd5b843561175481611708565b9350602085013561176481611708565b925060408501359150606085013567ffffffffffffffff8082111561178857600080fd5b818701915087601f83011261179c57600080fd5b8135818111156117ae576117ae61171d565b604051601f8201601f19908116603f011681019083821181831017156117d6576117d661171d565b816040528281528a60208487010111156117ef57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561182657600080fd5b50508035926020909101359150565b6000815180845260005b8181101561185b5760208185018101518683018201520161183f565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260018060a01b0382511660208201526020820151604082015260408201516060820152600060608301516080808401526118bc60a0840182611835565b949350505050565b600080604083850312156118d757600080fd5b82356118e281611708565b946020939093013593505050565b86815285602082015284604082015283606082015260c06080820152600061191b60c0830185611835565b82810360a084015261192d8185611835565b9998505050505050505050565b60008083601f84011261194c57600080fd5b50813567ffffffffffffffff81111561196457600080fd5b60208301915083602082850101111561197c57600080fd5b9250929050565b600080600080600080600080600060e08a8c0312156119a157600080fd5b8935985060208a0135975060408a0135965060608a0135955060808a0135945060a08a013567ffffffffffffffff808211156119dc57600080fd5b6119e88d838e0161193a565b909650945060c08c0135915080821115611a0157600080fd5b50611a0e8c828d0161193a565b915080935050809150509295985092959850929598565b60008060008060008060008060c0898b031215611a4157600080fd5b88359750602089013596506040890135955060608901359450608089013567ffffffffffffffff80821115611a7557600080fd5b611a818c838d0161193a565b909650945060a08b0135915080821115611a9a57600080fd5b50611aa78b828c0161193a565b999c989b5096995094979396929594505050565b600060208284031215611acd57600080fd5b8135611ad881611708565b9392505050565b60008060408385031215611af257600080fd5b823591506020830135611b0481611708565b809150509250929050565b60008083601f840112611b2157600080fd5b50813567ffffffffffffffff811115611b3957600080fd5b6020830191508360208260051b850101111561197c57600080fd5b600080600080600060608688031215611b6c57600080fd5b85359450602086013567ffffffffffffffff80821115611b8b57600080fd5b611b9789838a01611b0f565b90965094506040880135915080821115611bb057600080fd5b50611bbd8882890161193a565b969995985093965092949392505050565b60008060208385031215611be157600080fd5b823567ffffffffffffffff811115611bf857600080fd5b611c0485828601611b0f565b90969095509350505050565b60008060008060608587031215611c2657600080fd5b8435935060208501359250604085013567ffffffffffffffff811115611c4b57600080fd5b611c578782880161193a565b95989497509550505050565b600181811c90821680611c7757607f821691505b602082108103611c9757634e487b7160e01b600052602260045260246000fd5b50919050565b602080825260129082015271141bdbdb08191bd95cdb89dd08195e1a5cdd60721b604082015260600190565b601f821115611d1357600081815260208120601f850160051c81016020861015611cf05750805b601f850160051c820191505b81811015611d0f57828155600101611cfc565b5050505b505050565b67ffffffffffffffff831115611d3057611d3061171d565b611d4483611d3e8354611c63565b83611cc9565b6000601f841160018114611d785760008515611d605750838201355b600019600387901b1c1916600186901b178355610c7f565b600083815260209020601f19861690835b82811015611da95786850135825560209485019460019092019101611d89565b5086821015611dc65760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b89815288602082015287604082015286606082015285608082015260e060a08201526000611e3360e083018688611dd8565b82810360c0840152611e46818587611dd8565b9c9b505050505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201611e7e57611e7e611e56565b5060010190565b600060208284031215611e9757600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b60208082526021908201527f5374616b696e6720756e617661696c61626c6520617420746865206d6f6d656e6040820152601d60fa1b606082015260800190565b808201808211156104b9576104b9611e56565b818103818111156104b9576104b9611e56565b634e487b7160e01b600052603160045260246000fd5b600060208284031215611f4357600080fd5b8151611ad881611708565b815167ffffffffffffffff811115611f6857611f6861171d565b611f7c81611f768454611c63565b84611cc9565b602080601f831160018114611fb15760008415611f995750858301515b600019600386901b1c1916600185901b178555611d0f565b600085815260208120601f198616915b82811015611fe057888601518255948401946001909101908401611fc1565b5085821015611ffe5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fea2646970667358221220d15494fc61b0581ca9ceec380cc451232992b7ad5f62ca228a1a646160eac90664736f6c63430008110033

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

00000000000000000000000031b4c124e8e021402a2b89f8ec1af54f68fd256d

-----Decoded View---------------
Arg [0] : _nft (address): 0x31b4C124E8e021402A2b89F8EC1AF54F68Fd256D

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000031b4c124e8e021402a2b89f8ec1af54f68fd256d


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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