ETH Price: $2,079.14 (-4.58%)

Contract

0x3aCfb212fa85dDa043cB71Aa3e430f2Ea2BA7A7f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Batch Unstake189109122024-01-01 6:48:47794 days ago1704091727IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.006352669.04726092
Batch Unstake185896052023-11-17 5:45:23839 days ago1700199923IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0038244818.37280962
Batch Unstake185379032023-11-10 0:15:23846 days ago1699575323IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0068973142.81809665
Batch Unstake184787692023-11-01 17:32:59855 days ago1698859979IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0082314536.54202358
Batch Unstake180702262023-09-05 12:17:59912 days ago1693916279IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0029290413.00295991
Batch Unstake177736502023-07-26 0:22:23953 days ago1690330943IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0032877422.83409378
Batch Unstake169818762023-04-05 10:05:351065 days ago1680689135IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0043782927.18019517
Batch Unstake168363582023-03-15 22:48:231085 days ago1678920503IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0030360321.08588484
Batch Stake168351442023-03-15 18:42:231086 days ago1678905743IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0043912529.89482733
Batch Unstake167736472023-03-07 3:05:591094 days ago1678158359IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0009398228.58350602
Batch Unstake167736472023-03-07 3:05:591094 days ago1678158359IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0132874728.58350602
Batch Stake166939522023-02-23 22:05:591105 days ago1677189959IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0178113333.91240567
Batch Unstake166827562023-02-22 8:18:231107 days ago1677053903IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0058236240.44631566
Batch Stake166825282023-02-22 7:32:351107 days ago1677051155IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0036015424.51867314
Batch Unstake166766362023-02-21 11:40:111108 days ago1676979611IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0057494925.52383046
Batch Stake166663582023-02-20 1:01:111109 days ago1676854871IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0050981221.15178322
Batch Unstake166632862023-02-19 14:39:591110 days ago1676817599IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0041048825.48288833
Batch Unstake166587402023-02-18 23:20:231110 days ago1676762423IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0025773416
Batch Stake166008392023-02-10 20:46:591118 days ago1676062019IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0050502720.95323554
Batch Stake165989602023-02-10 14:29:231119 days ago1676039363IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0008791624.948554
Batch Stake165989592023-02-10 14:29:111119 days ago1676039351IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0034504723.49017574
Batch Unstake165744112023-02-07 4:05:471122 days ago1675742747IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0033665120.89911556
Batch Stake165606912023-02-05 6:07:471124 days ago1675577267IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0134871116.66295721
Batch Stake164887822023-01-26 5:04:111134 days ago1674709451IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0025331117.24499309
Batch Stake164755462023-01-24 8:42:231136 days ago1674549743IN
0x3aCfb212...Ea2BA7A7f
0 ETH0.0021485414.62691337
View all transactions

View more zero value Internal Transactions in Advanced View mode

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

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x0A1a9746...a8Fb7b77f
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Stake

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

pragma solidity ^0.8.17;

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

contract Stake is IERC721Receiver, Ownable, ReentrancyGuard {
    IERC20 public coinAddress;
    IERC721 public NFTcontract;
    bool public locked;
    uint256 minimumStakeTimeS;
    uint256 coinPerS;

    struct StakeInfo {
        address staker;
        uint256 stakedAt;
    }

    mapping(uint256 => StakeInfo) stakers;

    event Staked(uint256 indexed tokenId, uint256 time, address indexed user);

    event Unstaked(uint256 indexed tokenId, uint256 time, address indexed user);

    event UserEmergencyWithdraw(
        uint256 indexed tokenId,
        uint256 time,
        address indexed user
    );

    modifier callerIsUser() {
        require(tx.origin == msg.sender, "The caller is another contract");
        _;
    }

    constructor(IERC20 coin, IERC721 nft) {
        coinAddress = coin;
        NFTcontract = nft;
        locked = true;
    }

    function stake(uint256 tokenId) internal {
        require(!locked, "Contract locked");
        require(NFTcontract.ownerOf(tokenId) == msg.sender, "Not the owner");
        require(stakers[tokenId].staker == address(0), "Already being staked");

        stakers[tokenId].staker = msg.sender;
        stakers[tokenId].stakedAt = block.timestamp;
        NFTcontract.safeTransferFrom(msg.sender, address(this), tokenId);
        emit Staked(tokenId, block.timestamp, msg.sender);
    }

    function batchStake(
        uint256[] memory _calldata
    ) external nonReentrant callerIsUser {
        for (uint256 i = 0; i < _calldata.length; ++i) {
            stake(_calldata[i]);
        }
    }

    function unstake(uint256 tokenId) internal {
        require(!locked, "Contract locked");
        require(
            stakers[tokenId].staker == msg.sender,
            "Not being staked by you"
        );
        require(
            (block.timestamp - stakers[tokenId].stakedAt) > minimumStakeTimeS,
            "Not staked long enough"
        );
        uint256 reward = (block.timestamp - stakers[tokenId].stakedAt) *
            coinPerS;

        delete stakers[tokenId];
        SafeERC20.safeTransfer(coinAddress, msg.sender, reward);
        NFTcontract.safeTransferFrom(address(this), msg.sender, tokenId);
        emit Unstaked(tokenId, block.timestamp, msg.sender);
    }

    function batchUnstake(
        uint256[] memory _calldata
    ) external nonReentrant callerIsUser {
        for (uint256 i = 0; i < _calldata.length; ++i) {
            unstake(_calldata[i]);
        }
    }

    function userEmergencyWithdraw(
        uint256 tokenId
    ) external nonReentrant callerIsUser {
        require(
            stakers[tokenId].staker == msg.sender,
            "Not being staked by you"
        );
        delete stakers[tokenId];
        NFTcontract.safeTransferFrom(address(this), msg.sender, tokenId);
        emit UserEmergencyWithdraw(tokenId, block.timestamp, msg.sender);
    }

    function toggleLock() external onlyOwner {
        locked = !locked;
    }

    function emergencyWithdrawCoin() external onlyOwner {
        SafeERC20.safeTransfer(
            coinAddress,
            msg.sender,
            coinAddress.balanceOf(address(this))
        );
    }

    function emergencyWithdrawNFTs(uint256[] memory tokens) external onlyOwner {
        for (uint256 i = 0; i < tokens.length; ++i) {
            delete stakers[tokens[i]];
            NFTcontract.safeTransferFrom(address(this), msg.sender, tokens[i]);
            emit UserEmergencyWithdraw(tokens[i], block.timestamp, msg.sender);
        }
    }

    function setMinimumStakeTime(uint64 minTime) external onlyOwner {
        minimumStakeTimeS = minTime;
    }

    function setCoinPerS(uint256 _coinPerS) external onlyOwner {
        coinPerS = _coinPerS;
    }

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

    function stakeInfo(
        uint256 tokenId
    ) external view returns (address, uint256) {
        return (stakers[tokenId].staker, stakers[tokenId].stakedAt);
    }
}

File 2 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 3 of 13 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

File 4 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

// 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 6 of 13 : 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);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

    /**
     * @dev 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 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);
}

// 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;
    }
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IERC20","name":"coin","type":"address"},{"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":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Unstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"UserEmergencyWithdraw","type":"event"},{"inputs":[],"name":"NFTcontract","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_calldata","type":"uint256[]"}],"name":"batchStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_calldata","type":"uint256[]"}],"name":"batchUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"coinAddress","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdrawCoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"emergencyWithdrawNFTs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_coinPerS","type":"uint256"}],"name":"setCoinPerS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"minTime","type":"uint64"}],"name":"setMinimumStakeTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakeInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleLock","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":"userEmergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

0x608060405234801561001057600080fd5b506040516200148338038062001483833981016040819052610031916100e4565b61003a3361007c565b60018055600280546001600160a01b039384166001600160a01b0319909116179055600380546001600160a81b0319169190921617600160a01b17905561011e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146100e157600080fd5b50565b600080604083850312156100f757600080fd5b8251610102816100cc565b6020840151909250610113816100cc565b809150509250929050565b611355806200012e6000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063abd8ddf711610097578063d2acd13d11610066578063d2acd13d14610264578063f2fde38b14610277578063fdc61dd11461028a578063ff9413d81461029d57600080fd5b8063abd8ddf714610212578063b6c767c414610225578063c21277931461022d578063cf3090121461024057600080fd5b80634e533572116100d35780634e533572146101955780635479df64146101e6578063715018a6146101f95780638da5cb5b1461020157600080fd5b80630d23f97714610105578063150b7a0214610135578063183453531461016d5780632907faef14610182575b600080fd5b600354610118906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610154610143366004610f7a565b630a85bd0160e11b95945050505050565b6040516001600160e01b0319909116815260200161012c565b61018061017b366004611019565b6102a5565b005b610180610190366004611032565b61041b565b6101c76101a3366004611019565b600090815260066020526040902080546001909101546001600160a01b0390911691565b604080516001600160a01b03909316835260208301919091520161012c565b6101806101f4366004611072565b610432565b610180610580565b6000546001600160a01b0316610118565b610180610220366004611019565b610594565b6101806105a1565b61018061023b366004611072565b610620565b60035461025490600160a01b900460ff1681565b604051901515815260200161012c565b610180610272366004611072565b6106ac565b610180610285366004611130565b610730565b600254610118906001600160a01b031681565b6101806107a9565b6002600154036102d05760405162461bcd60e51b81526004016102c79061114d565b60405180910390fd5b60026001553233146102f45760405162461bcd60e51b81526004016102c790611184565b6000818152600660205260409020546001600160a01b031633146103545760405162461bcd60e51b81526020600482015260176024820152764e6f74206265696e67207374616b656420627920796f7560481b60448201526064016102c7565b60008181526006602052604080822080546001600160a01b0319168155600101919091556003549051632142170760e11b81526001600160a01b03909116906342842e0e906103ab903090339086906004016111bb565b600060405180830381600087803b1580156103c557600080fd5b505af11580156103d9573d6000803e3d6000fd5b50506040514281523392508391507f6347267c17accd660f88de50b921d0945a0981bd6def02b6d9020ef9d19ef2e79060200160405180910390a35060018055565b6104236107d2565b67ffffffffffffffff16600455565b61043a6107d2565b60005b815181101561057c576006600083838151811061045c5761045c6111df565b6020908102919091018101518252810191909152604001600090812080546001600160a01b03191681556001015560035482516001600160a01b03909116906342842e0e90309033908690869081106104b7576104b76111df565b60200260200101516040518463ffffffff1660e01b81526004016104dd939291906111bb565b600060405180830381600087803b1580156104f757600080fd5b505af115801561050b573d6000803e3d6000fd5b50505050336001600160a01b031682828151811061052b5761052b6111df565b60200260200101517f6347267c17accd660f88de50b921d0945a0981bd6def02b6d9020ef9d19ef2e74260405161056491815260200190565b60405180910390a36105758161120b565b905061043d565b5050565b6105886107d2565b610592600061082c565b565b61059c6107d2565b600555565b6105a96107d2565b6002546040516370a0823160e01b8152306004820152610592916001600160a01b031690339082906370a0823190602401602060405180830381865afa1580156105f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b9190611224565b61087c565b6002600154036106425760405162461bcd60e51b81526004016102c79061114d565b60026001553233146106665760405162461bcd60e51b81526004016102c790611184565b60005b81518110156106a457610694828281518110610687576106876111df565b60200260200101516108d3565b61069d8161120b565b9050610669565b505060018055565b6002600154036106ce5760405162461bcd60e51b81526004016102c79061114d565b60026001553233146106f25760405162461bcd60e51b81526004016102c790611184565b60005b81518110156106a457610720828281518110610713576107136111df565b6020026020010151610af8565b6107298161120b565b90506106f5565b6107386107d2565b6001600160a01b03811661079d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102c7565b6107a68161082c565b50565b6107b16107d2565b6003805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6000546001600160a01b031633146105925760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526108ce908490610d10565b505050565b600354600160a01b900460ff161561091f5760405162461bcd60e51b815260206004820152600f60248201526e10dbdb9d1c9858dd081b1bd8dad959608a1b60448201526064016102c7565b6003546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c919061123d565b6001600160a01b0316146109d25760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b60448201526064016102c7565b6000818152600660205260409020546001600160a01b031615610a2e5760405162461bcd60e51b8152602060048201526014602482015273105b1c9958591e4818995a5b99c81cdd185ad95960621b60448201526064016102c7565b6000818152600660205260409081902080546001600160a01b031916339081178255426001909201919091556003549151632142170760e11b81526001600160a01b0392909216916342842e0e91610a8c91309086906004016111bb565b600060405180830381600087803b158015610aa657600080fd5b505af1158015610aba573d6000803e3d6000fd5b50506040514281523392508391507f1b52f0db6b5f755caa8f232eebe353a340637e6c55969d84b3ee0cee945aa4339060200160405180910390a350565b600354600160a01b900460ff1615610b445760405162461bcd60e51b815260206004820152600f60248201526e10dbdb9d1c9858dd081b1bd8dad959608a1b60448201526064016102c7565b6000818152600660205260409020546001600160a01b03163314610ba45760405162461bcd60e51b81526020600482015260176024820152764e6f74206265696e67207374616b656420627920796f7560481b60448201526064016102c7565b600454600082815260066020526040902060010154610bc3904261125a565b11610c095760405162461bcd60e51b815260206004820152601660248201527509cdee840e6e8c2d6cac840d8dedcce40cadcdeeaced60531b60448201526064016102c7565b600554600082815260066020526040812060010154909190610c2b904261125a565b610c359190611273565b600083815260066020526040812080546001600160a01b031916815560010155600254909150610c6f906001600160a01b0316338361087c565b600354604051632142170760e11b81526001600160a01b03909116906342842e0e90610ca3903090339087906004016111bb565b600060405180830381600087803b158015610cbd57600080fd5b505af1158015610cd1573d6000803e3d6000fd5b50506040514281523392508491507f7d3c803765ec6329bfc61627600c66b23d6663e88dfec119fd0457cd4b7e40439060200160405180910390a35050565b6000610d65826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610de29092919063ffffffff16565b8051909150156108ce5780806020019051810190610d83919061128a565b6108ce5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102c7565b6060610df18484600085610dfb565b90505b9392505050565b606082471015610e5c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102c7565b6001600160a01b0385163b610eb35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102c7565b600080866001600160a01b03168587604051610ecf91906112d0565b60006040518083038185875af1925050503d8060008114610f0c576040519150601f19603f3d011682016040523d82523d6000602084013e610f11565b606091505b5091509150610f21828286610f2c565b979650505050505050565b60608315610f3b575081610df4565b825115610f4b5782518084602001fd5b8160405162461bcd60e51b81526004016102c791906112ec565b6001600160a01b03811681146107a657600080fd5b600080600080600060808688031215610f9257600080fd5b8535610f9d81610f65565b94506020860135610fad81610f65565b935060408601359250606086013567ffffffffffffffff80821115610fd157600080fd5b818801915088601f830112610fe557600080fd5b813581811115610ff457600080fd5b89602082850101111561100657600080fd5b9699959850939650602001949392505050565b60006020828403121561102b57600080fd5b5035919050565b60006020828403121561104457600080fd5b813567ffffffffffffffff81168114610df457600080fd5b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561108557600080fd5b823567ffffffffffffffff8082111561109d57600080fd5b818501915085601f8301126110b157600080fd5b8135818111156110c3576110c361105c565b8060051b604051601f19603f830116810181811085821117156110e8576110e861105c565b60405291825284820192508381018501918883111561110657600080fd5b938501935b828510156111245784358452938501939285019261110b565b98975050505050505050565b60006020828403121561114257600080fd5b8135610df481610f65565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601e908201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163740000604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161121d5761121d6111f5565b5060010190565b60006020828403121561123657600080fd5b5051919050565b60006020828403121561124f57600080fd5b8151610df481610f65565b8181038181111561126d5761126d6111f5565b92915050565b808202811582820484141761126d5761126d6111f5565b60006020828403121561129c57600080fd5b81518015158114610df457600080fd5b60005b838110156112c75781810151838201526020016112af565b50506000910152565b600082516112e28184602087016112ac565b9190910192915050565b602081526000825180602084015261130b8160408501602087016112ac565b601f01601f1916919091016040019291505056fea26469706673582212208b4983955171e02b2691045e81ed70323efe1d3d0c7cf7d784d16519ed24625964736f6c634300081100330000000000000000000000007476d8b314607990957dda4479acf44ffa552034000000000000000000000000ce50f3ca1f1dbd6fa042666bc0e369565dda457d

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063abd8ddf711610097578063d2acd13d11610066578063d2acd13d14610264578063f2fde38b14610277578063fdc61dd11461028a578063ff9413d81461029d57600080fd5b8063abd8ddf714610212578063b6c767c414610225578063c21277931461022d578063cf3090121461024057600080fd5b80634e533572116100d35780634e533572146101955780635479df64146101e6578063715018a6146101f95780638da5cb5b1461020157600080fd5b80630d23f97714610105578063150b7a0214610135578063183453531461016d5780632907faef14610182575b600080fd5b600354610118906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610154610143366004610f7a565b630a85bd0160e11b95945050505050565b6040516001600160e01b0319909116815260200161012c565b61018061017b366004611019565b6102a5565b005b610180610190366004611032565b61041b565b6101c76101a3366004611019565b600090815260066020526040902080546001909101546001600160a01b0390911691565b604080516001600160a01b03909316835260208301919091520161012c565b6101806101f4366004611072565b610432565b610180610580565b6000546001600160a01b0316610118565b610180610220366004611019565b610594565b6101806105a1565b61018061023b366004611072565b610620565b60035461025490600160a01b900460ff1681565b604051901515815260200161012c565b610180610272366004611072565b6106ac565b610180610285366004611130565b610730565b600254610118906001600160a01b031681565b6101806107a9565b6002600154036102d05760405162461bcd60e51b81526004016102c79061114d565b60405180910390fd5b60026001553233146102f45760405162461bcd60e51b81526004016102c790611184565b6000818152600660205260409020546001600160a01b031633146103545760405162461bcd60e51b81526020600482015260176024820152764e6f74206265696e67207374616b656420627920796f7560481b60448201526064016102c7565b60008181526006602052604080822080546001600160a01b0319168155600101919091556003549051632142170760e11b81526001600160a01b03909116906342842e0e906103ab903090339086906004016111bb565b600060405180830381600087803b1580156103c557600080fd5b505af11580156103d9573d6000803e3d6000fd5b50506040514281523392508391507f6347267c17accd660f88de50b921d0945a0981bd6def02b6d9020ef9d19ef2e79060200160405180910390a35060018055565b6104236107d2565b67ffffffffffffffff16600455565b61043a6107d2565b60005b815181101561057c576006600083838151811061045c5761045c6111df565b6020908102919091018101518252810191909152604001600090812080546001600160a01b03191681556001015560035482516001600160a01b03909116906342842e0e90309033908690869081106104b7576104b76111df565b60200260200101516040518463ffffffff1660e01b81526004016104dd939291906111bb565b600060405180830381600087803b1580156104f757600080fd5b505af115801561050b573d6000803e3d6000fd5b50505050336001600160a01b031682828151811061052b5761052b6111df565b60200260200101517f6347267c17accd660f88de50b921d0945a0981bd6def02b6d9020ef9d19ef2e74260405161056491815260200190565b60405180910390a36105758161120b565b905061043d565b5050565b6105886107d2565b610592600061082c565b565b61059c6107d2565b600555565b6105a96107d2565b6002546040516370a0823160e01b8152306004820152610592916001600160a01b031690339082906370a0823190602401602060405180830381865afa1580156105f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b9190611224565b61087c565b6002600154036106425760405162461bcd60e51b81526004016102c79061114d565b60026001553233146106665760405162461bcd60e51b81526004016102c790611184565b60005b81518110156106a457610694828281518110610687576106876111df565b60200260200101516108d3565b61069d8161120b565b9050610669565b505060018055565b6002600154036106ce5760405162461bcd60e51b81526004016102c79061114d565b60026001553233146106f25760405162461bcd60e51b81526004016102c790611184565b60005b81518110156106a457610720828281518110610713576107136111df565b6020026020010151610af8565b6107298161120b565b90506106f5565b6107386107d2565b6001600160a01b03811661079d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102c7565b6107a68161082c565b50565b6107b16107d2565b6003805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6000546001600160a01b031633146105925760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526108ce908490610d10565b505050565b600354600160a01b900460ff161561091f5760405162461bcd60e51b815260206004820152600f60248201526e10dbdb9d1c9858dd081b1bd8dad959608a1b60448201526064016102c7565b6003546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c919061123d565b6001600160a01b0316146109d25760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b60448201526064016102c7565b6000818152600660205260409020546001600160a01b031615610a2e5760405162461bcd60e51b8152602060048201526014602482015273105b1c9958591e4818995a5b99c81cdd185ad95960621b60448201526064016102c7565b6000818152600660205260409081902080546001600160a01b031916339081178255426001909201919091556003549151632142170760e11b81526001600160a01b0392909216916342842e0e91610a8c91309086906004016111bb565b600060405180830381600087803b158015610aa657600080fd5b505af1158015610aba573d6000803e3d6000fd5b50506040514281523392508391507f1b52f0db6b5f755caa8f232eebe353a340637e6c55969d84b3ee0cee945aa4339060200160405180910390a350565b600354600160a01b900460ff1615610b445760405162461bcd60e51b815260206004820152600f60248201526e10dbdb9d1c9858dd081b1bd8dad959608a1b60448201526064016102c7565b6000818152600660205260409020546001600160a01b03163314610ba45760405162461bcd60e51b81526020600482015260176024820152764e6f74206265696e67207374616b656420627920796f7560481b60448201526064016102c7565b600454600082815260066020526040902060010154610bc3904261125a565b11610c095760405162461bcd60e51b815260206004820152601660248201527509cdee840e6e8c2d6cac840d8dedcce40cadcdeeaced60531b60448201526064016102c7565b600554600082815260066020526040812060010154909190610c2b904261125a565b610c359190611273565b600083815260066020526040812080546001600160a01b031916815560010155600254909150610c6f906001600160a01b0316338361087c565b600354604051632142170760e11b81526001600160a01b03909116906342842e0e90610ca3903090339087906004016111bb565b600060405180830381600087803b158015610cbd57600080fd5b505af1158015610cd1573d6000803e3d6000fd5b50506040514281523392508491507f7d3c803765ec6329bfc61627600c66b23d6663e88dfec119fd0457cd4b7e40439060200160405180910390a35050565b6000610d65826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610de29092919063ffffffff16565b8051909150156108ce5780806020019051810190610d83919061128a565b6108ce5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102c7565b6060610df18484600085610dfb565b90505b9392505050565b606082471015610e5c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102c7565b6001600160a01b0385163b610eb35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102c7565b600080866001600160a01b03168587604051610ecf91906112d0565b60006040518083038185875af1925050503d8060008114610f0c576040519150601f19603f3d011682016040523d82523d6000602084013e610f11565b606091505b5091509150610f21828286610f2c565b979650505050505050565b60608315610f3b575081610df4565b825115610f4b5782518084602001fd5b8160405162461bcd60e51b81526004016102c791906112ec565b6001600160a01b03811681146107a657600080fd5b600080600080600060808688031215610f9257600080fd5b8535610f9d81610f65565b94506020860135610fad81610f65565b935060408601359250606086013567ffffffffffffffff80821115610fd157600080fd5b818801915088601f830112610fe557600080fd5b813581811115610ff457600080fd5b89602082850101111561100657600080fd5b9699959850939650602001949392505050565b60006020828403121561102b57600080fd5b5035919050565b60006020828403121561104457600080fd5b813567ffffffffffffffff81168114610df457600080fd5b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561108557600080fd5b823567ffffffffffffffff8082111561109d57600080fd5b818501915085601f8301126110b157600080fd5b8135818111156110c3576110c361105c565b8060051b604051601f19603f830116810181811085821117156110e8576110e861105c565b60405291825284820192508381018501918883111561110657600080fd5b938501935b828510156111245784358452938501939285019261110b565b98975050505050505050565b60006020828403121561114257600080fd5b8135610df481610f65565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601e908201527f5468652063616c6c657220697320616e6f7468657220636f6e74726163740000604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161121d5761121d6111f5565b5060010190565b60006020828403121561123657600080fd5b5051919050565b60006020828403121561124f57600080fd5b8151610df481610f65565b8181038181111561126d5761126d6111f5565b92915050565b808202811582820484141761126d5761126d6111f5565b60006020828403121561129c57600080fd5b81518015158114610df457600080fd5b60005b838110156112c75781810151838201526020016112af565b50506000910152565b600082516112e28184602087016112ac565b9190910192915050565b602081526000825180602084015261130b8160408501602087016112ac565b601f01601f1916919091016040019291505056fea26469706673582212208b4983955171e02b2691045e81ed70323efe1d3d0c7cf7d784d16519ed24625964736f6c63430008110033

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

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