ETH Price: $3,418.43 (+3.09%)

Contract

0x70e423911bDf6eB7a9d6D5fEE584Fb2D58fAfA74
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Harvest213878292024-12-12 17:10:1111 days ago1734023411IN
0x70e42391...D58fAfA74
0 ETH0.0035522727.21173755
Harvest213878182024-12-12 17:07:5911 days ago1734023279IN
0x70e42391...D58fAfA74
0 ETH0.0042823529.00653236
Harvest213737182024-12-10 17:52:5913 days ago1733853179IN
0x70e42391...D58fAfA74
0 ETH0.0052269135.4026472
Harvest213722602024-12-10 13:00:2313 days ago1733835623IN
0x70e42391...D58fAfA74
0 ETH0.0033742622.85744291
Harvest213598542024-12-08 19:26:2315 days ago1733685983IN
0x70e42391...D58fAfA74
0 ETH0.0021187914.35284286
Harvest213598412024-12-08 19:23:4715 days ago1733685827IN
0x70e42391...D58fAfA74
0 ETH0.0021298914.42608607
Harvest213053262024-12-01 4:39:3523 days ago1733027975IN
0x70e42391...D58fAfA74
0 ETH0.001278999.79756333
Harvest213053162024-12-01 4:37:3523 days ago1733027855IN
0x70e42391...D58fAfA74
0 ETH0.001242469.51919319
Harvest212387762024-11-21 21:24:3532 days ago1732224275IN
0x70e42391...D58fAfA74
0 ETH0.0019020419.73277871
Harvest212144602024-11-18 11:59:3535 days ago1731931175IN
0x70e42391...D58fAfA74
0 ETH0.0017028713.04468647
Harvest212144572024-11-18 11:58:5935 days ago1731931139IN
0x70e42391...D58fAfA74
0 ETH0.0016919912.96327659
Harvest211572432024-11-10 12:23:2343 days ago1731241403IN
0x70e42391...D58fAfA74
0 ETH0.0027585621.13353988
Harvest211572362024-11-10 12:21:5943 days ago1731241319IN
0x70e42391...D58fAfA74
0 ETH0.0031570721.38154491
Harvest210502232024-10-26 13:54:1158 days ago1729950851IN
0x70e42391...D58fAfA74
0 ETH0.001105618.47021206
Harvest210502172024-10-26 13:52:5958 days ago1729950779IN
0x70e42391...D58fAfA74
0 ETH0.001206959.24485975
Harvest210444932024-10-25 18:42:1159 days ago1729881731IN
0x70e42391...D58fAfA74
0 ETH0.00129449.91562219
Harvest210444892024-10-25 18:41:2359 days ago1729881683IN
0x70e42391...D58fAfA74
0 ETH0.0013250910.14980026
Harvest209261922024-10-09 6:18:2375 days ago1728454703IN
0x70e42391...D58fAfA74
0 ETH0.0014729711.28354594
Harvest209261722024-10-09 6:14:2375 days ago1728454463IN
0x70e42391...D58fAfA74
0 ETH0.0014975911.47316021
Harvest200588262024-06-10 3:44:47197 days ago1717991087IN
0x70e42391...D58fAfA74
0 ETH0.000865045.8590687
Harvest199456442024-05-25 8:17:23212 days ago1716625043IN
0x70e42391...D58fAfA74
0 ETH0.000467743.58343889
Harvest199016542024-05-19 4:38:59219 days ago1716093539IN
0x70e42391...D58fAfA74
0 ETH0.000823445.57773399
Harvest199016332024-05-19 4:34:47219 days ago1716093287IN
0x70e42391...D58fAfA74
0 ETH0.000847125.73801396
Harvest198856882024-05-16 23:02:23221 days ago1715900543IN
0x70e42391...D58fAfA74
0 ETH0.000546395.67144794
Harvest198855332024-05-16 22:30:59221 days ago1715898659IN
0x70e42391...D58fAfA74
0 ETH0.000601726.24472263
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
156645352022-10-03 2:06:11813 days ago1664762771
0x70e42391...D58fAfA74
0.01 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Harvest

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 7 : SaleHarvest.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "Ownable.sol";
import "SafeERC20.sol";
import "ECDSA.sol";


contract Harvest is Ownable {

    using ECDSA for bytes32;
    using SafeERC20 for IERC20;

    // user struct
    struct UserInfo {
        uint256 rewardDebt;         // harvested tokens
        uint256 lastBlock;
    }

    struct RewardInfo {
        address rewardToken;
        address transferFrom;
        bool isValid;
    }

    address public defaultRewardToken;

    mapping (address => mapping(address => UserInfo)) private userRewardInfo;

    // user => rewardToken => RewardInfo
    mapping (address => mapping(address => RewardInfo)) public trustedSigner;

    event NewUser(address indexed user);
    event UserHarvest(
        address indexed user,
        uint256 _amount,
        uint256 lastBlockNumber,
        uint256 currentBlockNumber,
        address rewardToken
    );

    /**
      * @param _defaultRewardToken address of default reward token
      */
    constructor(address _defaultRewardToken) {
        trustedSigner[_defaultRewardToken][msg.sender].isValid = true;
        defaultRewardToken = _defaultRewardToken;
    }

    // rewardToken => stage
    mapping(address => uint) public currentStage;
    // rewardToken => stage => timestamp end date
    mapping(address => mapping(uint => uint)) public endStageDate;
    // rewardToken => stage => user => true/false
    mapping(address => mapping(uint => mapping(address => bool))) public claimedInStage;
    /**
      * @dev main function for getting tokens
      * @param _amount amount of tokens - wei style
      * @param _lastBlockNumber last block of user activity in contract (getLastBlock)
      * @param _currentBlockNumber block number, when signature created
      * @param _msgForSign hashed data with prefix
      * @param _signature signed data
      * @param _rewardToken address of tokens, which user get
      */
    function harvest(
        uint256 _amount, 
        uint256 _lastBlockNumber, 
        uint256 _currentBlockNumber, 
        bytes32 _msgForSign, 
        bytes memory _signature,
        address _rewardToken

    ) external 
    {
        if(block.timestamp > endStageDate[_rewardToken][currentStage[_rewardToken]]) {
            //change stage
            while(block.timestamp > endStageDate[_rewardToken][currentStage[_rewardToken]]) {
                currentStage[_rewardToken]++;
            }
        }
        require(!claimedInStage[_rewardToken][currentStage[_rewardToken]][msg.sender], "claimed in this stage");
        require(_currentBlockNumber <= block.number, "Harvest::harvest: currentBlockNumber larger than lastBlock");

        //Double spend check
        require(getLastBlock(msg.sender, _rewardToken) == _lastBlockNumber, "Harvest::harvest: lastBlockNumber error");

        //1. Lets check signer
        address signedBy = _msgForSign.recover(_signature);
        require(trustedSigner[_rewardToken][signedBy].isValid == true, "Harvest::harvest: signature check failed");

        //2. Check signed msg integrety
        bytes32 actualMsg = getMsgForSign(
            _amount,
            _lastBlockNumber,
            _currentBlockNumber,
            msg.sender,
            _rewardToken
        );
        require(actualMsg.toEthSignedMessageHash() == _msgForSign,"Harvest::harvest: integrety check failed");

        //Actions

        userRewardInfo[msg.sender][_rewardToken].rewardDebt += _amount;
        userRewardInfo[msg.sender][_rewardToken].lastBlock = _currentBlockNumber;
        if (_amount > 0) {
            IERC20 ERC20Token = IERC20(_rewardToken);
            ERC20Token.safeTransferFrom(trustedSigner[_rewardToken][signedBy].transferFrom, msg.sender, _amount);
        }
        claimedInStage[_rewardToken][currentStage[_rewardToken]][msg.sender]=true;
        emit UserHarvest(msg.sender, _amount, _lastBlockNumber, _currentBlockNumber, _rewardToken);
    }

    /**
      * @dev get last block of user activity in contract
      * @param _user address of user
      * @param _rewardToken address of reward token
      * @return block number, 0 - if its new user 
      */

    function getLastBlock(address _user, address _rewardToken) public view returns(uint256) {
        return userRewardInfo[_user][_rewardToken].lastBlock;
    }

    /**
      * @dev return amount of tokens, which user claim before (during all time)
      * @param _user address of user
      * @param _rewardToken address of reward token
      * @return amount of tokens
      */

    function getRewards(address _user, address _rewardToken) public view returns(uint256) {
        return userRewardInfo[_user][_rewardToken].rewardDebt;
    }


    /**
      * @dev return hashed data
      * @param _amount amount of tokens
      * @param _lastBlockNumber last block of user activity
      * @param _currentBlockNumber current block number
      * @param _sender user address
      * @param _rewardToken address of token contract
      * @return hashed data
      */

    function getMsgForSign(
        uint256 _amount, 
        uint256 _lastBlockNumber, 
        uint256 _currentBlockNumber, 
        address _sender,
        address _rewardToken
    )
        internal pure returns(bytes32) 
    {
        return keccak256(abi.encode( _amount, _lastBlockNumber, _currentBlockNumber, _sender, _rewardToken));
    }


    ////////////////////////////////////////////////////////////
    /////////// Admin only           ////////////////////////////
    ////////////////////////////////////////////////////////////

    /**
      * @dev set signer address and other settings
      * @param _rewardToken address of token, which user can get
      * @param _signer address of signer
      * @param _transferFrom address of token keeper
      * @param _isValid true/false
      */
      
    function setTrustedSigner(
            address _rewardToken,
            address _signer,
            address _transferFrom,
            bool _isValid
            ) public onlyOwner {
        trustedSigner[_rewardToken][_signer].isValid = _isValid;
        trustedSigner[_rewardToken][_signer].transferFrom = _transferFrom;
    }

    function setEndStageDate(
            uint[] memory stage, 
            uint[] memory endDate, 
            uint _currentStage, 
            address rewardToken
            ) public onlyOwner {
        currentStage[rewardToken] = _currentStage;
        for(uint i=0;i<stage.length;i++) {
            endStageDate[rewardToken][stage[i]] = endDate[i];
        }
    }
}

File 2 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT

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() {
        _setOwner(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 7 : Context.sol
// SPDX-License-Identifier: MIT

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

File 4 of 7 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

    /**
     * @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 5 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

File 6 of 7 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 7 : ECDSA.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_defaultRewardToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"NewUser","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastBlockNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentBlockNumber","type":"uint256"},{"indexed":false,"internalType":"address","name":"rewardToken","type":"address"}],"name":"UserHarvest","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"claimedInStage","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"currentStage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultRewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"endStageDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"}],"name":"getLastBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"}],"name":"getRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_lastBlockNumber","type":"uint256"},{"internalType":"uint256","name":"_currentBlockNumber","type":"uint256"},{"internalType":"bytes32","name":"_msgForSign","type":"bytes32"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"address","name":"_rewardToken","type":"address"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","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":"stage","type":"uint256[]"},{"internalType":"uint256[]","name":"endDate","type":"uint256[]"},{"internalType":"uint256","name":"_currentStage","type":"uint256"},{"internalType":"address","name":"rewardToken","type":"address"}],"name":"setEndStageDate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_signer","type":"address"},{"internalType":"address","name":"_transferFrom","type":"address"},{"internalType":"bool","name":"_isValid","type":"bool"}],"name":"setTrustedSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"trustedSigner","outputs":[{"internalType":"address","name":"rewardToken","type":"address"},{"internalType":"address","name":"transferFrom","type":"address"},{"internalType":"bool","name":"isValid","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5060405161161a38038061161a83398101604081905261002f916100d6565b61003833610086565b6001600160a01b0316600081815260036020908152604080832033845290915290206001908101805460ff60a01b1916600160a01b17905580546001600160a01b0319169091179055610106565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100e857600080fd5b81516001600160a01b03811681146100ff57600080fd5b9392505050565b611505806101156000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063d12ad6441161008c578063ee04102711610066578063ee04102714610233578063ee7e6f59146102a6578063f2fde38b146102c6578063ff3a4ac0146102d957600080fd5b8063d12ad644146101a0578063dd373e00146101b3578063e9895765146101f757600080fd5b806318cc7d84146100d4578063459d6052146100e95780635cac1fe4146100fc578063715018a61461013a578063779bcb9b146101425780638da5cb5b1461017b575b600080fd5b6100e76100e23660046110b7565b6102ec565b005b6100e76100f73660046111f7565b6107be565b61012761010a366004611275565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b6100e7610894565b61012761015036600461129f565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610131565b6100e76101ae3660046112e0565b6108ca565b6101e76101c1366004611336565b600660209081526000938452604080852082529284528284209052825290205460ff1681565b6040519015158152602001610131565b61012761020536600461129f565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152206001015490565b61027e61024136600461129f565b6003602090815260009283526040808420909152908252902080546001909101546001600160a01b0391821691811690600160a01b900460ff1683565b604080516001600160a01b039485168152939092166020840152151590820152606001610131565b6101276102b4366004611372565b60046020526000908152604090205481565b6100e76102d4366004611372565b61094d565b600154610188906001600160a01b031681565b6001600160a01b03811660009081526005602090815260408083206004835281842054845290915290205442111561037f575b6001600160a01b03811660009081526005602090815260408083206004835281842054845290915290205442111561037f576001600160a01b0381166000908152600460205260408120805491610375836113a3565b919050555061031f565b6001600160a01b038116600090815260066020908152604080832060048352818420548452825280832033845290915290205460ff16156103ff5760405162461bcd60e51b8152602060048201526015602482015274636c61696d656420696e207468697320737461676560581b60448201526064015b60405180910390fd5b438411156104755760405162461bcd60e51b815260206004820152603a60248201527f486172766573743a3a686172766573743a2063757272656e74426c6f636b4e7560448201527f6d626572206c6172676572207468616e206c617374426c6f636b00000000000060648201526084016103f6565b3360009081526002602090815260408083206001600160a01b038516845290915290206001015485146104fa5760405162461bcd60e51b815260206004820152602760248201527f486172766573743a3a686172766573743a206c617374426c6f636b4e756d6265604482015266391032b93937b960c91b60648201526084016103f6565b600061050684846109e8565b6001600160a01b038381166000908152600360209081526040808320938516835292905220600190810154919250600160a01b90910460ff1615151461059f5760405162461bcd60e51b815260206004820152602860248201527f486172766573743a3a686172766573743a207369676e617475726520636865636044820152671ac819985a5b195960c21b60648201526084016103f6565b6040805160208082018a9052818301899052606082018890523360808301526001600160a01b03851660a0808401919091528351808403909101815260c0830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000060e084015260fc8084018290528451808503909101815261011c9093019093528151910120851461068c5760405162461bcd60e51b815260206004820152602860248201527f486172766573743a3a686172766573743a20696e7465677265747920636865636044820152671ac819985a5b195960c21b60648201526084016103f6565b3360009081526002602090815260408083206001600160a01b0387168452909152812080548a92906106bf9084906113be565b90915550503360009081526002602090815260408083206001600160a01b03871684529091529020600101869055871561072e576001600160a01b0380841660008181526003602090815260408083208786168452909152902060010154859261072c929116338c610a0c565b505b6001600160a01b03831660008181526006602090815260408083206004835281842054845282528083203380855290835292819020805460ff1916600117905580518c81529182018b905281018990526060810192909252907f94b3f3baafecdc334344438cacaab4b86758d7829ac231734ac573b5735b1d669060800160405180910390a25050505050505050565b6000546001600160a01b031633146107e85760405162461bcd60e51b81526004016103f6906113d6565b6001600160a01b03811660009081526004602052604081208390555b845181101561088d5783818151811061081f5761081f61140b565b602002602001015160056000846001600160a01b03166001600160a01b0316815260200190815260200160002060008784815181106108605761086061140b565b60200260200101518152602001908152602001600020819055508080610885906113a3565b915050610804565b5050505050565b6000546001600160a01b031633146108be5760405162461bcd60e51b81526004016103f6906113d6565b6108c86000610a6c565b565b6000546001600160a01b031633146108f45760405162461bcd60e51b81526004016103f6906113d6565b6001600160a01b0393841660009081526003602090815260408083209587168352949052929092206001018054919093166001600160a01b0319921515600160a01b02929092166001600160a81b031990911617179055565b6000546001600160a01b031633146109775760405162461bcd60e51b81526004016103f6906113d6565b6001600160a01b0381166109dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b6109e581610a6c565b50565b60008060006109f78585610abc565b91509150610a0481610b2c565b509392505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610a66908590610ce7565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080825160411415610af35760208301516040840151606085015160001a610ae787828585610dbe565b94509450505050610b25565b825160401415610b1d5760208301516040840151610b12868383610eab565b935093505050610b25565b506000905060025b9250929050565b6000816004811115610b4057610b40611421565b1415610b495750565b6001816004811115610b5d57610b5d611421565b1415610bab5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016103f6565b6002816004811115610bbf57610bbf611421565b1415610c0d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016103f6565b6003816004811115610c2157610c21611421565b1415610c7a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016103f6565b6004816004811115610c8e57610c8e611421565b14156109e55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016103f6565b6000610d3c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610eda9092919063ffffffff16565b805190915015610db95780806020019051810190610d5a9190611437565b610db95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103f6565b505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610df55750600090506003610ea2565b8460ff16601b14158015610e0d57508460ff16601c14155b15610e1e5750600090506004610ea2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610e72573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e9b57600060019250925050610ea2565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01610ecc87828885610dbe565b935093505050935093915050565b6060610ee98484600085610ef3565b90505b9392505050565b606082471015610f545760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103f6565b843b610fa25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103f6565b600080866001600160a01b03168587604051610fbe9190611480565b60006040518083038185875af1925050503d8060008114610ffb576040519150601f19603f3d011682016040523d82523d6000602084013e611000565b606091505b509150915061101082828661101b565b979650505050505050565b6060831561102a575081610eec565b82511561103a5782518084602001fd5b8160405162461bcd60e51b81526004016103f6919061149c565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561109357611093611054565b604052919050565b80356001600160a01b03811681146110b257600080fd5b919050565b60008060008060008060c087890312156110d057600080fd5b8635955060208088013595506040880135945060608801359350608088013567ffffffffffffffff8082111561110557600080fd5b818a0191508a601f83011261111957600080fd5b81358181111561112b5761112b611054565b61113d601f8201601f1916850161106a565b91508082528b8482850101111561115357600080fd5b808484018584013760008482840101525080945050505061117660a0880161109b565b90509295509295509295565b600082601f83011261119357600080fd5b8135602067ffffffffffffffff8211156111af576111af611054565b8160051b6111be82820161106a565b92835284810182019282810190878511156111d857600080fd5b83870192505b84831015611010578235825291830191908301906111de565b6000806000806080858703121561120d57600080fd5b843567ffffffffffffffff8082111561122557600080fd5b61123188838901611182565b9550602087013591508082111561124757600080fd5b5061125487828801611182565b9350506040850135915061126a6060860161109b565b905092959194509250565b6000806040838503121561128857600080fd5b6112918361109b565b946020939093013593505050565b600080604083850312156112b257600080fd5b6112bb8361109b565b91506112c96020840161109b565b90509250929050565b80151581146109e557600080fd5b600080600080608085870312156112f657600080fd5b6112ff8561109b565b935061130d6020860161109b565b925061131b6040860161109b565b9150606085013561132b816112d2565b939692955090935050565b60008060006060848603121561134b57600080fd5b6113548461109b565b9250602084013591506113696040850161109b565b90509250925092565b60006020828403121561138457600080fd5b610eec8261109b565b634e487b7160e01b600052601160045260246000fd5b60006000198214156113b7576113b761138d565b5060010190565b600082198211156113d1576113d161138d565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60006020828403121561144957600080fd5b8151610eec816112d2565b60005b8381101561146f578181015183820152602001611457565b83811115610a665750506000910152565b60008251611492818460208701611454565b9190910192915050565b60208152600082518060208401526114bb816040850160208701611454565b601f01601f1916919091016040019291505056fea26469706673582212203a3b419f2fd373a8e2758ef492e8cebcee8e1581b0d9cf60894545535f16fd8864736f6c634300080a0033000000000000000000000000549020a9cb845220d66d3e9c6d9f9ef61c981102

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063d12ad6441161008c578063ee04102711610066578063ee04102714610233578063ee7e6f59146102a6578063f2fde38b146102c6578063ff3a4ac0146102d957600080fd5b8063d12ad644146101a0578063dd373e00146101b3578063e9895765146101f757600080fd5b806318cc7d84146100d4578063459d6052146100e95780635cac1fe4146100fc578063715018a61461013a578063779bcb9b146101425780638da5cb5b1461017b575b600080fd5b6100e76100e23660046110b7565b6102ec565b005b6100e76100f73660046111f7565b6107be565b61012761010a366004611275565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b6100e7610894565b61012761015036600461129f565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610131565b6100e76101ae3660046112e0565b6108ca565b6101e76101c1366004611336565b600660209081526000938452604080852082529284528284209052825290205460ff1681565b6040519015158152602001610131565b61012761020536600461129f565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152206001015490565b61027e61024136600461129f565b6003602090815260009283526040808420909152908252902080546001909101546001600160a01b0391821691811690600160a01b900460ff1683565b604080516001600160a01b039485168152939092166020840152151590820152606001610131565b6101276102b4366004611372565b60046020526000908152604090205481565b6100e76102d4366004611372565b61094d565b600154610188906001600160a01b031681565b6001600160a01b03811660009081526005602090815260408083206004835281842054845290915290205442111561037f575b6001600160a01b03811660009081526005602090815260408083206004835281842054845290915290205442111561037f576001600160a01b0381166000908152600460205260408120805491610375836113a3565b919050555061031f565b6001600160a01b038116600090815260066020908152604080832060048352818420548452825280832033845290915290205460ff16156103ff5760405162461bcd60e51b8152602060048201526015602482015274636c61696d656420696e207468697320737461676560581b60448201526064015b60405180910390fd5b438411156104755760405162461bcd60e51b815260206004820152603a60248201527f486172766573743a3a686172766573743a2063757272656e74426c6f636b4e7560448201527f6d626572206c6172676572207468616e206c617374426c6f636b00000000000060648201526084016103f6565b3360009081526002602090815260408083206001600160a01b038516845290915290206001015485146104fa5760405162461bcd60e51b815260206004820152602760248201527f486172766573743a3a686172766573743a206c617374426c6f636b4e756d6265604482015266391032b93937b960c91b60648201526084016103f6565b600061050684846109e8565b6001600160a01b038381166000908152600360209081526040808320938516835292905220600190810154919250600160a01b90910460ff1615151461059f5760405162461bcd60e51b815260206004820152602860248201527f486172766573743a3a686172766573743a207369676e617475726520636865636044820152671ac819985a5b195960c21b60648201526084016103f6565b6040805160208082018a9052818301899052606082018890523360808301526001600160a01b03851660a0808401919091528351808403909101815260c0830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000060e084015260fc8084018290528451808503909101815261011c9093019093528151910120851461068c5760405162461bcd60e51b815260206004820152602860248201527f486172766573743a3a686172766573743a20696e7465677265747920636865636044820152671ac819985a5b195960c21b60648201526084016103f6565b3360009081526002602090815260408083206001600160a01b0387168452909152812080548a92906106bf9084906113be565b90915550503360009081526002602090815260408083206001600160a01b03871684529091529020600101869055871561072e576001600160a01b0380841660008181526003602090815260408083208786168452909152902060010154859261072c929116338c610a0c565b505b6001600160a01b03831660008181526006602090815260408083206004835281842054845282528083203380855290835292819020805460ff1916600117905580518c81529182018b905281018990526060810192909252907f94b3f3baafecdc334344438cacaab4b86758d7829ac231734ac573b5735b1d669060800160405180910390a25050505050505050565b6000546001600160a01b031633146107e85760405162461bcd60e51b81526004016103f6906113d6565b6001600160a01b03811660009081526004602052604081208390555b845181101561088d5783818151811061081f5761081f61140b565b602002602001015160056000846001600160a01b03166001600160a01b0316815260200190815260200160002060008784815181106108605761086061140b565b60200260200101518152602001908152602001600020819055508080610885906113a3565b915050610804565b5050505050565b6000546001600160a01b031633146108be5760405162461bcd60e51b81526004016103f6906113d6565b6108c86000610a6c565b565b6000546001600160a01b031633146108f45760405162461bcd60e51b81526004016103f6906113d6565b6001600160a01b0393841660009081526003602090815260408083209587168352949052929092206001018054919093166001600160a01b0319921515600160a01b02929092166001600160a81b031990911617179055565b6000546001600160a01b031633146109775760405162461bcd60e51b81526004016103f6906113d6565b6001600160a01b0381166109dc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f6565b6109e581610a6c565b50565b60008060006109f78585610abc565b91509150610a0481610b2c565b509392505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610a66908590610ce7565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080825160411415610af35760208301516040840151606085015160001a610ae787828585610dbe565b94509450505050610b25565b825160401415610b1d5760208301516040840151610b12868383610eab565b935093505050610b25565b506000905060025b9250929050565b6000816004811115610b4057610b40611421565b1415610b495750565b6001816004811115610b5d57610b5d611421565b1415610bab5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016103f6565b6002816004811115610bbf57610bbf611421565b1415610c0d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016103f6565b6003816004811115610c2157610c21611421565b1415610c7a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016103f6565b6004816004811115610c8e57610c8e611421565b14156109e55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016103f6565b6000610d3c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610eda9092919063ffffffff16565b805190915015610db95780806020019051810190610d5a9190611437565b610db95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103f6565b505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610df55750600090506003610ea2565b8460ff16601b14158015610e0d57508460ff16601c14155b15610e1e5750600090506004610ea2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610e72573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e9b57600060019250925050610ea2565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01610ecc87828885610dbe565b935093505050935093915050565b6060610ee98484600085610ef3565b90505b9392505050565b606082471015610f545760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103f6565b843b610fa25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103f6565b600080866001600160a01b03168587604051610fbe9190611480565b60006040518083038185875af1925050503d8060008114610ffb576040519150601f19603f3d011682016040523d82523d6000602084013e611000565b606091505b509150915061101082828661101b565b979650505050505050565b6060831561102a575081610eec565b82511561103a5782518084602001fd5b8160405162461bcd60e51b81526004016103f6919061149c565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561109357611093611054565b604052919050565b80356001600160a01b03811681146110b257600080fd5b919050565b60008060008060008060c087890312156110d057600080fd5b8635955060208088013595506040880135945060608801359350608088013567ffffffffffffffff8082111561110557600080fd5b818a0191508a601f83011261111957600080fd5b81358181111561112b5761112b611054565b61113d601f8201601f1916850161106a565b91508082528b8482850101111561115357600080fd5b808484018584013760008482840101525080945050505061117660a0880161109b565b90509295509295509295565b600082601f83011261119357600080fd5b8135602067ffffffffffffffff8211156111af576111af611054565b8160051b6111be82820161106a565b92835284810182019282810190878511156111d857600080fd5b83870192505b84831015611010578235825291830191908301906111de565b6000806000806080858703121561120d57600080fd5b843567ffffffffffffffff8082111561122557600080fd5b61123188838901611182565b9550602087013591508082111561124757600080fd5b5061125487828801611182565b9350506040850135915061126a6060860161109b565b905092959194509250565b6000806040838503121561128857600080fd5b6112918361109b565b946020939093013593505050565b600080604083850312156112b257600080fd5b6112bb8361109b565b91506112c96020840161109b565b90509250929050565b80151581146109e557600080fd5b600080600080608085870312156112f657600080fd5b6112ff8561109b565b935061130d6020860161109b565b925061131b6040860161109b565b9150606085013561132b816112d2565b939692955090935050565b60008060006060848603121561134b57600080fd5b6113548461109b565b9250602084013591506113696040850161109b565b90509250925092565b60006020828403121561138457600080fd5b610eec8261109b565b634e487b7160e01b600052601160045260246000fd5b60006000198214156113b7576113b761138d565b5060010190565b600082198211156113d1576113d161138d565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b60006020828403121561144957600080fd5b8151610eec816112d2565b60005b8381101561146f578181015183820152602001611457565b83811115610a665750506000910152565b60008251611492818460208701611454565b9190910192915050565b60208152600082518060208401526114bb816040850160208701611454565b601f01601f1916919091016040019291505056fea26469706673582212203a3b419f2fd373a8e2758ef492e8cebcee8e1581b0d9cf60894545535f16fd8864736f6c634300080a0033

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

000000000000000000000000549020a9cb845220d66d3e9c6d9f9ef61c981102

-----Decoded View---------------
Arg [0] : _defaultRewardToken (address): 0x549020a9Cb845220D66d3E9c6D9F9eF61C981102

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000549020a9cb845220d66d3e9c6d9f9ef61c981102


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  ]
[ 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.