ETH Price: $2,313.29 (+0.27%)

Contract

0x80683665ef0E2f4D94927ab5BF97376dB7A733d8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw171506562023-04-29 8:45:47508 days ago1682757947IN
0x80683665...dB7A733d8
0 ETH0.0028615132.96605952
Withdraw171506542023-04-29 8:45:23508 days ago1682757923IN
0x80683665...dB7A733d8
0 ETH0.0030658333.05267603
Withdraw171506512023-04-29 8:44:47508 days ago1682757887IN
0x80683665...dB7A733d8
0 ETH0.0026351732.38591997
Withdraw171506472023-04-29 8:43:59508 days ago1682757839IN
0x80683665...dB7A733d8
0 ETH0.0025770232.76537211
Withdraw171506452023-04-29 8:43:35508 days ago1682757815IN
0x80683665...dB7A733d8
0 ETH0.0026402834.77075702
Stake164470862023-01-20 9:21:35607 days ago1674206495IN
0x80683665...dB7A733d8
0 ETH0.0023906716.45742532
Stake164470792023-01-20 9:20:11607 days ago1674206411IN
0x80683665...dB7A733d8
0 ETH0.0021462614.77493183
Stake164470712023-01-20 9:18:35607 days ago1674206315IN
0x80683665...dB7A733d8
0 ETH0.0023551116.28078568
Stake164470682023-01-20 9:17:59607 days ago1674206279IN
0x80683665...dB7A733d8
0 ETH0.0022836915.7209891
Stake164470652023-01-20 9:17:23607 days ago1674206243IN
0x80683665...dB7A733d8
0 ETH0.0024377116.85181058
Stake164470632023-01-20 9:16:59607 days ago1674206219IN
0x80683665...dB7A733d8
0 ETH0.0029132717.94287606
Claim Rewards163258092023-01-03 10:58:11624 days ago1672743491IN
0x80683665...dB7A733d8
0 ETH0.0013663715.98787614
Stake161189872022-12-05 13:45:23652 days ago1670247923IN
0x80683665...dB7A733d8
0 ETH0.0021044112.96108555
Stake161188932022-12-05 13:26:35652 days ago1670246795IN
0x80683665...dB7A733d8
0 ETH0.002540913.31029985
Stake160486592022-11-25 18:02:59662 days ago1669399379IN
0x80683665...dB7A733d8
0 ETH0.0020383910.67794666
Withdraw158773022022-11-01 19:35:23686 days ago1667331323IN
0x80683665...dB7A733d8
0 ETH0.0004057213.11155408
Withdraw158772982022-11-01 19:34:35686 days ago1667331275IN
0x80683665...dB7A733d8
0 ETH0.0010359914.02815849
Withdraw158772952022-11-01 19:33:59686 days ago1667331239IN
0x80683665...dB7A733d8
0 ETH0.0009840412.95918139
Stake158767332022-11-01 17:41:11686 days ago1667324471IN
0x80683665...dB7A733d8
0 ETH0.0029783718.09924335
Stake158767282022-11-01 17:40:11686 days ago1667324411IN
0x80683665...dB7A733d8
0 ETH0.0035682916.90375918
Stake158439072022-10-28 3:34:47691 days ago1666928087IN
0x80683665...dB7A733d8
0 ETH0.0020830211.03928011
Stake158202272022-10-24 20:07:59694 days ago1666642079IN
0x80683665...dB7A733d8
0 ETH0.0033928816.48695503
0x60c06040158200572022-10-24 19:33:47694 days ago1666640027IN
 Create: ViseCoinStaking
0 ETH0.028520226.68686748

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ViseCoinStaking

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 10 : Staking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "IERC20.sol";
import "SafeERC20.sol";
import "IERC721.sol";
import "ReentrancyGuard.sol";
import "Ownable.sol";

interface IViseCoin is IERC20 {
    function mint(address to, uint256 amount) external;
}

contract ViseCoinStaking is ReentrancyGuard, Ownable {
    using SafeERC20 for IERC20;

    IViseCoin public immutable rewardsToken;
    IERC721 public immutable nftCollection;

    constructor(IERC721 _nftCollection, IViseCoin _rewardsToken) {
        nftCollection = _nftCollection;
        rewardsToken = _rewardsToken;
    }

    struct StakedToken {
        address staker;
        uint256 tokenId;
    }
    
    struct Staker {
        uint256 amountStaked;

        StakedToken[] stakedTokens;

        uint256 timeOfLastUpdate;

        uint256 unclaimedRewards;
    }

    uint256 private rewardsPerHour = 833333333333332000;

    mapping(address => Staker) public stakers;

    mapping(uint256 => address) public stakerAddress;

    bool public stakingPaused = false;

    bool public withdrawPaused = false;

    function stake(uint256 _tokenId) external nonReentrant {
        require(!stakingPaused, "Staking has been paused!");

        if (stakers[msg.sender].amountStaked > 0) {
            uint256 rewards = calculateRewards(msg.sender);
            stakers[msg.sender].unclaimedRewards += rewards;
        }

        require(
            nftCollection.ownerOf(_tokenId) == msg.sender,
            "You don't own this token!"
        );

        nftCollection.transferFrom(msg.sender, address(this), _tokenId);

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

        stakers[msg.sender].stakedTokens.push(stakedToken);

        stakers[msg.sender].amountStaked++;

        stakerAddress[_tokenId] = msg.sender;
 
        stakers[msg.sender].timeOfLastUpdate = block.timestamp;
    }
    
    function withdraw(uint256 _tokenId) external nonReentrant {
        require(!withdrawPaused, "Withdrawals have been paused!");

        require(
            stakers[msg.sender].amountStaked > 0,
            "You have no tokens staked"
        );
        
        require(stakerAddress[_tokenId] == msg.sender, "You don't own this token!");

        uint256 rewards = calculateRewards(msg.sender);
        stakers[msg.sender].unclaimedRewards += rewards;

        uint256 index = 0;
        for (uint256 i = 0; i < stakers[msg.sender].stakedTokens.length; i++) {
            if (
                stakers[msg.sender].stakedTokens[i].tokenId == _tokenId 
                && 
                stakers[msg.sender].stakedTokens[i].staker != address(0)
            ) {
                index = i;
                break;
            }
        }

        stakers[msg.sender].stakedTokens[index].staker = address(0);

        stakers[msg.sender].amountStaked--;

        stakerAddress[_tokenId] = address(0);

        nftCollection.transferFrom(address(this), msg.sender, _tokenId);

        stakers[msg.sender].timeOfLastUpdate = block.timestamp;
    }

    function claimRewards() external {
        uint256 rewards = calculateRewards(msg.sender) +
            stakers[msg.sender].unclaimedRewards;
        require(rewards > 0, "You have no rewards to claim");
        stakers[msg.sender].timeOfLastUpdate = block.timestamp;
        stakers[msg.sender].unclaimedRewards = 0;
        rewardsToken.mint(msg.sender, rewards);
    }


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

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

    function getStakedTokens(address _user) public view returns (StakedToken[] memory) {
        if (stakers[_user].amountStaked > 0) {
            StakedToken[] memory _stakedTokens = new StakedToken[](stakers[_user].amountStaked);
            uint256 _index = 0;

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

            return _stakedTokens;
        }
        else {
            return new StakedToken[](0);
        }
    }

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

    function calculateRewards(address _staker)
        internal
        view
        returns (uint256 _rewards)
    {
        return (((
            ((block.timestamp - stakers[_staker].timeOfLastUpdate) *
                stakers[_staker].amountStaked)
        ) * rewardsPerHour) / 3600);
    }

    /////////////
    // Owner   //
    /////////////
    function setRewardRate(uint256 _rate) external onlyOwner {
        rewardsPerHour = _rate;
    }

    function setStakePause(bool _pause) external onlyOwner {
        stakingPaused = _pause;
    }

    function setWithdrawPause(bool _pause) external onlyOwner {
        withdrawPaused = _pause;
    }

    function destroy(address apocalypse) public onlyOwner {
        selfdestruct(payable(apocalypse));
    }

}

File 2 of 10 : IERC20.sol
// 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);
}

File 3 of 10 : SafeERC20.sol
// 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 "draft-IERC20Permit.sol";
import "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");
        }
    }
}

File 4 of 10 : draft-IERC20Permit.sol
// 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);
}

File 5 of 10 : Address.sol
// 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);
            }
        }
    }
}

File 6 of 10 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "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);
}

File 7 of 10 : IERC165.sol
// 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);
}

File 8 of 10 : 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;
    }
}

File 9 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "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 10 of 10 : 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
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "libraries": {
    "Staking.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC721","name":"_nftCollection","type":"address"},{"internalType":"contract IViseCoin","name":"_rewardsToken","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"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"availableRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"apocalypse","type":"address"}],"name":"destroy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getStakedTokens","outputs":[{"components":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ViseCoinStaking.StakedToken[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftCollection","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IViseCoin","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"setRewardRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_pause","type":"bool"}],"name":"setStakePause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_pause","type":"bool"}],"name":"setWithdrawPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakers","outputs":[{"internalType":"uint256","name":"amountStaked","type":"uint256"},{"internalType":"uint256","name":"timeOfLastUpdate","type":"uint256"},{"internalType":"uint256","name":"unclaimedRewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60c0604052670b90984060d350206002556005805461ffff1916905534801561002757600080fd5b5060405161125a38038061125a833981016040819052610046916100d5565b60016000556100543361006b565b6001600160a01b0391821660a0521660805261010f565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811681146100d257600080fd5b50565b600080604083850312156100e857600080fd5b82516100f3816100bd565b6020840151909250610104816100bd565b809150509250929050565b60805160a05161110a610150600039600081816101960152818161064c01528181610b320152610c200152600081816102a60152610784015261110a6000f3fe608060405234801561001057600080fd5b50600436106101155760003560e01c806394067045116100a2578063bbb781cc11610071578063bbb781cc14610294578063d1af0c7d146102a1578063f2fde38b146102c8578063f37171e9146102db578063f854a27f146102ee57600080fd5b80639406704514610232578063941e8e4d1461025b5780639e447fc61461026e578063a694fc3a1461028157600080fd5b806363c28db1116100e957806363c28db1146101715780636588103b14610191578063715018a6146101d05780638da5cb5b146101d85780639168ae72146101e957600080fd5b8062f55d9d1461011a5780632e1a7d4d1461012f5780632f3ffb9f14610142578063372500ab14610169575b600080fd5b61012d610128366004610f23565b61030f565b005b61012d61013d366004610f40565b610323565b60055461015490610100900460ff1681565b60405190151581526020015b60405180910390f35b61012d6106c7565b61018461017f366004610f23565b6107e3565b6040516101609190610f59565b6101b87f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610160565b61012d6109dd565b6001546001600160a01b03166101b8565b6102176101f7366004610f23565b600360208190526000918252604090912080546002820154919092015483565b60408051938452602084019290925290820152606001610160565b6101b8610240366004610f40565b6004602052600090815260409020546001600160a01b031681565b61012d610269366004610fb1565b6109f1565b61012d61027c366004610f40565b610a0c565b61012d61028f366004610f40565b610a19565b6005546101549060ff1681565b6101b87f000000000000000000000000000000000000000000000000000000000000000081565b61012d6102d6366004610f23565b610d39565b61012d6102e9366004610fb1565b610db2565b6103016102fc366004610f23565b610dd4565b604051908152602001610160565b610317610e0c565b806001600160a01b0316ff5b6002600054141561037b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600055600554610100900460ff16156103d85760405162461bcd60e51b815260206004820152601d60248201527f5769746864726177616c732068617665206265656e20706175736564210000006044820152606401610372565b336000908152600360205260409020546104345760405162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f20746f6b656e73207374616b6564000000000000006044820152606401610372565b6000818152600460205260409020546001600160a01b031633146104965760405162461bcd60e51b8152602060048201526019602482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b6044820152606401610372565b60006104a133610e66565b336000908152600360208190526040822001805492935083929091906104c8908490610fe9565b9091555060009050805b3360009081526003602052604090206001015481101561058d5733600090815260036020526040902060010180548591908390811061051357610513611001565b90600052602060002090600202016001015414801561056e575033600090815260036020526040812060010180548390811061055157610551611001565b60009182526020909120600290910201546001600160a01b031614155b1561057b5780915061058d565b8061058581611017565b9150506104d2565b503360009081526003602052604081206001018054839081106105b2576105b2611001565b6000918252602080832060029290920290910180546001600160a01b0319166001600160a01b0394909416939093179092553381526003909152604081208054916105fc83611032565b909155505060008381526004602081905260409182902080546001600160a01b031916905590516323b872dd60e01b81523091810191909152336024820152604481018490526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b15801561069057600080fd5b505af11580156106a4573d6000803e3d6000fd5b505033600090815260036020526040812042600290910155600190555050505050565b3360008181526003602081905260408220015490916106e590610e66565b6106ef9190610fe9565b9050600081116107415760405162461bcd60e51b815260206004820152601c60248201527f596f752068617665206e6f207265776172647320746f20636c61696d000000006044820152606401610372565b33600081815260036020819052604080832042600282015590910191909155516340c10f1960e01b81526004810191909152602481018290526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401600060405180830381600087803b1580156107c857600080fd5b505af11580156107dc573d6000803e3d6000fd5b5050505050565b6001600160a01b03811660009081526003602052604090205460609015610999576001600160a01b03821660009081526003602052604081205467ffffffffffffffff81111561083557610835611049565b60405190808252806020026020018201604052801561087a57816020015b60408051808201909152600080825260208201528152602001906001900390816108535790505b5090506000805b6001600160a01b038516600090815260036020526040902060010154811015610990576001600160a01b03851660009081526003602052604081206001018054839081106108d1576108d1611001565b60009182526020909120600290910201546001600160a01b03161461097e576001600160a01b038516600090815260036020526040902060010180548290811061091d5761091d611001565b60009182526020918290206040805180820190915260029092020180546001600160a01b031682526001015491810191909152835184908490811061096457610964611001565b6020026020010181905250818061097a90611017565b9250505b8061098881611017565b915050610881565b50909392505050565b60408051600080825260208201909252906109d6565b60408051808201909152600080825260208201528152602001906001900390816109af5790505b5092915050565b6109e5610e0c565b6109ef6000610ebc565b565b6109f9610e0c565b6005805460ff1916911515919091179055565b610a14610e0c565b600255565b60026000541415610a6c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610372565b600260005560055460ff1615610ac45760405162461bcd60e51b815260206004820152601860248201527f5374616b696e6720686173206265656e207061757365642100000000000000006044820152606401610372565b3360009081526003602052604090205415610b12576000610ae433610e66565b33600090815260036020819052604082200180549293508392909190610b0b908490610fe9565b9091555050505b6040516331a9108f60e11b81526004810182905233906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e9060240160206040518083038186803b158015610b7457600080fd5b505afa158015610b88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bac919061105f565b6001600160a01b031614610bfe5760405162461bcd60e51b8152602060048201526019602482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b6044820152606401610372565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd90606401600060405180830381600087803b158015610c6c57600080fd5b505af1158015610c80573d6000803e3d6000fd5b5050604080518082018252338082526020808301878152600083815260038352948520600180820180548083018255908852938720865160029095020180546001600160a01b0319166001600160a01b0390951694909417845591519290910191909155908352805491945090925090610cf983611017565b909155505050600090815260046020908152604080832080546001600160a01b031916339081179091558352600390915281204260029091015560019055565b610d41610e0c565b6001600160a01b038116610da65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610372565b610daf81610ebc565b50565b610dba610e0c565b600580549115156101000261ff0019909216919091179055565b6001600160a01b0381166000908152600360208190526040822001548190610dfb84610e66565b610e059190610fe9565b9392505050565b6001546001600160a01b031633146109ef5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610372565b600280546001600160a01b038316600090815260036020526040812080549301549092610e109291610e98904261107c565b610ea29190611093565b610eac9190611093565b610eb691906110b2565b92915050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381168114610daf57600080fd5b600060208284031215610f3557600080fd5b8135610e0581610f0e565b600060208284031215610f5257600080fd5b5035919050565b602080825282518282018190526000919060409081850190868401855b82811015610fa457815180516001600160a01b03168552860151868501529284019290850190600101610f76565b5091979650505050505050565b600060208284031215610fc357600080fd5b81358015158114610e0557600080fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115610ffc57610ffc610fd3565b500190565b634e487b7160e01b600052603260045260246000fd5b600060001982141561102b5761102b610fd3565b5060010190565b60008161104157611041610fd3565b506000190190565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561107157600080fd5b8151610e0581610f0e565b60008282101561108e5761108e610fd3565b500390565b60008160001904831182151516156110ad576110ad610fd3565b500290565b6000826110cf57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220f2594199ac15ac98db547418107c1988d5ac7d864307e9a2f876c59da92a351764736f6c63430008090033000000000000000000000000f0f74cb4bf2fc2ddffb1b07749657363b413bc78000000000000000000000000c374c16e221cce10e12ac67c3125999e9c5158a1

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101155760003560e01c806394067045116100a2578063bbb781cc11610071578063bbb781cc14610294578063d1af0c7d146102a1578063f2fde38b146102c8578063f37171e9146102db578063f854a27f146102ee57600080fd5b80639406704514610232578063941e8e4d1461025b5780639e447fc61461026e578063a694fc3a1461028157600080fd5b806363c28db1116100e957806363c28db1146101715780636588103b14610191578063715018a6146101d05780638da5cb5b146101d85780639168ae72146101e957600080fd5b8062f55d9d1461011a5780632e1a7d4d1461012f5780632f3ffb9f14610142578063372500ab14610169575b600080fd5b61012d610128366004610f23565b61030f565b005b61012d61013d366004610f40565b610323565b60055461015490610100900460ff1681565b60405190151581526020015b60405180910390f35b61012d6106c7565b61018461017f366004610f23565b6107e3565b6040516101609190610f59565b6101b87f000000000000000000000000f0f74cb4bf2fc2ddffb1b07749657363b413bc7881565b6040516001600160a01b039091168152602001610160565b61012d6109dd565b6001546001600160a01b03166101b8565b6102176101f7366004610f23565b600360208190526000918252604090912080546002820154919092015483565b60408051938452602084019290925290820152606001610160565b6101b8610240366004610f40565b6004602052600090815260409020546001600160a01b031681565b61012d610269366004610fb1565b6109f1565b61012d61027c366004610f40565b610a0c565b61012d61028f366004610f40565b610a19565b6005546101549060ff1681565b6101b87f000000000000000000000000c374c16e221cce10e12ac67c3125999e9c5158a181565b61012d6102d6366004610f23565b610d39565b61012d6102e9366004610fb1565b610db2565b6103016102fc366004610f23565b610dd4565b604051908152602001610160565b610317610e0c565b806001600160a01b0316ff5b6002600054141561037b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600055600554610100900460ff16156103d85760405162461bcd60e51b815260206004820152601d60248201527f5769746864726177616c732068617665206265656e20706175736564210000006044820152606401610372565b336000908152600360205260409020546104345760405162461bcd60e51b815260206004820152601960248201527f596f752068617665206e6f20746f6b656e73207374616b6564000000000000006044820152606401610372565b6000818152600460205260409020546001600160a01b031633146104965760405162461bcd60e51b8152602060048201526019602482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b6044820152606401610372565b60006104a133610e66565b336000908152600360208190526040822001805492935083929091906104c8908490610fe9565b9091555060009050805b3360009081526003602052604090206001015481101561058d5733600090815260036020526040902060010180548591908390811061051357610513611001565b90600052602060002090600202016001015414801561056e575033600090815260036020526040812060010180548390811061055157610551611001565b60009182526020909120600290910201546001600160a01b031614155b1561057b5780915061058d565b8061058581611017565b9150506104d2565b503360009081526003602052604081206001018054839081106105b2576105b2611001565b6000918252602080832060029290920290910180546001600160a01b0319166001600160a01b0394909416939093179092553381526003909152604081208054916105fc83611032565b909155505060008381526004602081905260409182902080546001600160a01b031916905590516323b872dd60e01b81523091810191909152336024820152604481018490526001600160a01b037f000000000000000000000000f0f74cb4bf2fc2ddffb1b07749657363b413bc7816906323b872dd90606401600060405180830381600087803b15801561069057600080fd5b505af11580156106a4573d6000803e3d6000fd5b505033600090815260036020526040812042600290910155600190555050505050565b3360008181526003602081905260408220015490916106e590610e66565b6106ef9190610fe9565b9050600081116107415760405162461bcd60e51b815260206004820152601c60248201527f596f752068617665206e6f207265776172647320746f20636c61696d000000006044820152606401610372565b33600081815260036020819052604080832042600282015590910191909155516340c10f1960e01b81526004810191909152602481018290526001600160a01b037f000000000000000000000000c374c16e221cce10e12ac67c3125999e9c5158a116906340c10f1990604401600060405180830381600087803b1580156107c857600080fd5b505af11580156107dc573d6000803e3d6000fd5b5050505050565b6001600160a01b03811660009081526003602052604090205460609015610999576001600160a01b03821660009081526003602052604081205467ffffffffffffffff81111561083557610835611049565b60405190808252806020026020018201604052801561087a57816020015b60408051808201909152600080825260208201528152602001906001900390816108535790505b5090506000805b6001600160a01b038516600090815260036020526040902060010154811015610990576001600160a01b03851660009081526003602052604081206001018054839081106108d1576108d1611001565b60009182526020909120600290910201546001600160a01b03161461097e576001600160a01b038516600090815260036020526040902060010180548290811061091d5761091d611001565b60009182526020918290206040805180820190915260029092020180546001600160a01b031682526001015491810191909152835184908490811061096457610964611001565b6020026020010181905250818061097a90611017565b9250505b8061098881611017565b915050610881565b50909392505050565b60408051600080825260208201909252906109d6565b60408051808201909152600080825260208201528152602001906001900390816109af5790505b5092915050565b6109e5610e0c565b6109ef6000610ebc565b565b6109f9610e0c565b6005805460ff1916911515919091179055565b610a14610e0c565b600255565b60026000541415610a6c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610372565b600260005560055460ff1615610ac45760405162461bcd60e51b815260206004820152601860248201527f5374616b696e6720686173206265656e207061757365642100000000000000006044820152606401610372565b3360009081526003602052604090205415610b12576000610ae433610e66565b33600090815260036020819052604082200180549293508392909190610b0b908490610fe9565b9091555050505b6040516331a9108f60e11b81526004810182905233906001600160a01b037f000000000000000000000000f0f74cb4bf2fc2ddffb1b07749657363b413bc781690636352211e9060240160206040518083038186803b158015610b7457600080fd5b505afa158015610b88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bac919061105f565b6001600160a01b031614610bfe5760405162461bcd60e51b8152602060048201526019602482015278596f7520646f6e2774206f776e207468697320746f6b656e2160381b6044820152606401610372565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f000000000000000000000000f0f74cb4bf2fc2ddffb1b07749657363b413bc786001600160a01b0316906323b872dd90606401600060405180830381600087803b158015610c6c57600080fd5b505af1158015610c80573d6000803e3d6000fd5b5050604080518082018252338082526020808301878152600083815260038352948520600180820180548083018255908852938720865160029095020180546001600160a01b0319166001600160a01b0390951694909417845591519290910191909155908352805491945090925090610cf983611017565b909155505050600090815260046020908152604080832080546001600160a01b031916339081179091558352600390915281204260029091015560019055565b610d41610e0c565b6001600160a01b038116610da65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610372565b610daf81610ebc565b50565b610dba610e0c565b600580549115156101000261ff0019909216919091179055565b6001600160a01b0381166000908152600360208190526040822001548190610dfb84610e66565b610e059190610fe9565b9392505050565b6001546001600160a01b031633146109ef5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610372565b600280546001600160a01b038316600090815260036020526040812080549301549092610e109291610e98904261107c565b610ea29190611093565b610eac9190611093565b610eb691906110b2565b92915050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381168114610daf57600080fd5b600060208284031215610f3557600080fd5b8135610e0581610f0e565b600060208284031215610f5257600080fd5b5035919050565b602080825282518282018190526000919060409081850190868401855b82811015610fa457815180516001600160a01b03168552860151868501529284019290850190600101610f76565b5091979650505050505050565b600060208284031215610fc357600080fd5b81358015158114610e0557600080fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115610ffc57610ffc610fd3565b500190565b634e487b7160e01b600052603260045260246000fd5b600060001982141561102b5761102b610fd3565b5060010190565b60008161104157611041610fd3565b506000190190565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561107157600080fd5b8151610e0581610f0e565b60008282101561108e5761108e610fd3565b500390565b60008160001904831182151516156110ad576110ad610fd3565b500290565b6000826110cf57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220f2594199ac15ac98db547418107c1988d5ac7d864307e9a2f876c59da92a351764736f6c63430008090033

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

000000000000000000000000f0f74cb4bf2fc2ddffb1b07749657363b413bc78000000000000000000000000c374c16e221cce10e12ac67c3125999e9c5158a1

-----Decoded View---------------
Arg [0] : _nftCollection (address): 0xF0f74CB4BF2fC2DDffB1B07749657363b413bc78
Arg [1] : _rewardsToken (address): 0xc374c16e221ccE10E12AC67C3125999e9c5158a1

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f0f74cb4bf2fc2ddffb1b07749657363b413bc78
Arg [1] : 000000000000000000000000c374c16e221cce10e12ac67c3125999e9c5158a1


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.