ETH Price: $2,284.62 (-3.48%)

Contract

0xe7Af6DE6029AEC11e772E0A825df6e4D4185A21e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Link Addresses135727252021-11-08 0:50:041034 days ago1636332604IN
0xe7Af6DE6...D4185A21e
0 ETH0.00570342148.60802028
Link Addresses135558252021-11-05 9:34:451037 days ago1636104885IN
0xe7Af6DE6...D4185A21e
0 ETH0.00408315106.42352095
Link Addresses134837662021-10-25 2:01:151048 days ago1635127275IN
0xe7Af6DE6...D4185A21e
0 ETH0.003173682.7169848
Link Addresses134465592021-10-19 6:21:281054 days ago1634624488IN
0xe7Af6DE6...D4185A21e
0 ETH0.002066353.87319002
Link Addresses134457812021-10-19 3:23:461054 days ago1634613826IN
0xe7Af6DE6...D4185A21e
0 ETH0.0017255744.96153497
Link Addresses134452902021-10-19 1:36:491054 days ago1634607409IN
0xe7Af6DE6...D4185A21e
0 ETH0.0022543358.73874622
Link Addresses134450862021-10-19 0:53:551054 days ago1634604835IN
0xe7Af6DE6...D4185A21e
0 ETH0.0025546966.56493615
Link Addresses134132892021-10-14 0:52:181059 days ago1634172738IN
0xe7Af6DE6...D4185A21e
0 ETH0.00395886103.15185022
Link Addresses134015852021-10-12 4:37:501061 days ago1634013470IN
0xe7Af6DE6...D4185A21e
0 ETH0.0033974388.55109691
Link Addresses134014672021-10-12 4:13:511061 days ago1634012031IN
0xe7Af6DE6...D4185A21e
0 ETH0.00407299106.12556008
Link Addresses133999692021-10-11 22:29:211061 days ago1633991361IN
0xe7Af6DE6...D4185A21e
0 ETH0.00386748100.77099085
Link Addresses133051022021-09-27 2:06:241076 days ago1632708384IN
0xe7Af6DE6...D4185A21e
0 ETH0.0020316667.97599245
0x60806040133050372021-09-27 1:48:441076 days ago1632707324IN
 Create: RewardProgram
0 ETH0.1275562173.8475132

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RewardProgram

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 10 runs

Other Settings:
default evmVersion
File 1 of 7 : RewardProgram.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "./openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
import "./openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./openzeppelin-solidity/contracts/access/Ownable.sol";

contract RewardProgram is Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    bytes32 public merkleRoot;
    bool public cancelable;
    IERC20 public tokenContract;
    uint256 public fullRewardTimeoutPeriod = 180 days;
    uint256 public shortRewardTimeoutPeriod = 30 days;
    uint256 public shortRewardPercentage = 2;
    uint256 public merkleRootLastUpdateTime;
    uint256 public merkleRootLastUpdateBlock;

    struct User {
        string sidechainAddress;
        bytes signature;
        string message;
    }

    struct AmountWithTime {
        uint amount;
        uint timestamp;
        bool isWithdrowedByNominator;
        bool isFullWithdrawal;
    }

    mapping(address => uint256) public lastRewardRequestTime;

    mapping(address => AmountWithTime[]) public requestedRewards;

    mapping(address => AmountWithTime[]) public receivedRewards;

    modifier isCancelable() {
        require(!cancelable, "forbidden action");
        _;
    }

    event AddLink (address indexed ethereumAddress, string target, bytes signature, string message);
    event RequestReward (address target, uint amount, bool isFullWithdrawal);
    event ReceiveReward (address target, uint amount, bool indexed isWithdrowedByNominator);
    event UpdateMerkleRoot (bytes32 merkleRoot);

    function contractTokenBalance() public view returns(uint) {
		return tokenContract.balanceOf(address(this));
	}

    function getRequestedRewardArray(address target) public view returns(AmountWithTime[] memory) {
        return requestedRewards[target];
    }

    function getReceivedRewardArray(address target) public view returns(AmountWithTime[] memory) {
        return receivedRewards[target];
    }

    constructor(address _tokenContract, bool _cancelable) public  {
        tokenContract = IERC20(_tokenContract);
        cancelable = _cancelable;
    }

    function setCancelable(bool _cancelable) public onlyOwner {
        cancelable = _cancelable;
    }

    function setFullRewardTimeoutPeriod(uint256 period) public onlyOwner {
	    fullRewardTimeoutPeriod = period;
	}

	function setShortRewardTimeoutPeriod(uint256 period) public onlyOwner {
	    shortRewardTimeoutPeriod = period;
	}

	function setShortRewardPercentage(uint256 percentage) public onlyOwner {
	    shortRewardPercentage = percentage;
	}

    function linkAddresses(string memory target, bytes memory signature, string memory message) public {
        emit AddLink(msg.sender, target, signature, message);
    }

    function setRoot(bytes32 _merkleRoot, uint256 amount) public onlyOwner {
        address ownContractAddress = address(this);
        if (amount > 0) {
            require(tokenContract.allowance(owner(), ownContractAddress) >= amount, "approved balance not enough");
            tokenContract.transferFrom(owner(), ownContractAddress, amount);
        }
        merkleRoot = _merkleRoot;
        merkleRootLastUpdateTime = block.timestamp;
        merkleRootLastUpdateBlock = block.number;
        cancelable = false;
        emit UpdateMerkleRoot(_merkleRoot);
    }

    function requestReward(uint256 amount, bool isFullWithdrawal) internal returns (bool) {
        uint timestamp = block.timestamp;
        lastRewardRequestTime[msg.sender] = timestamp;
        requestedRewards[msg.sender].push(AmountWithTime(amount, timestamp, false, isFullWithdrawal));
        emit RequestReward(msg.sender, amount, isFullWithdrawal);
        return true;
    }

    function calculateShortAmount(uint amount) internal view returns(uint) {
        return amount.mul(shortRewardPercentage).div(10);
    }

    function getRequestAmountWithError(address target, uint item) internal view returns(uint amount, uint timestamp, bool isWithdrowedByNominator, bool isFullWithdrawal) {
        require(item < requestedRewards[target].length, "item is not exist");

        AmountWithTime storage request = requestedRewards[target][item];
        uint256 fullAmount = request.amount;
        uint256 fullTimestamp = request.timestamp;
        bool fullWithdrawal = request.isFullWithdrawal;
        uint256 timePeriod = fullWithdrawal ? fullRewardTimeoutPeriod : shortRewardTimeoutPeriod;
        require(fullAmount > 0, "item is empty");
        require(block.timestamp >= fullTimestamp + timePeriod, "expiration period is not over");
        amount = fullAmount;
        timestamp = request.timestamp;
        isWithdrowedByNominator = request.isWithdrowedByNominator;
        isFullWithdrawal = fullWithdrawal;
    }

    function transferOrApproveRewardToAddress(address target, uint amount, bool isWithdrowedByNominator, bool isApprove, bool isFullWithdrawal) internal {
        receivedRewards[target].push(AmountWithTime(amount, block.timestamp, isWithdrowedByNominator, isFullWithdrawal));
        if (isApprove) {
            tokenContract.approve(target, amount);
        } else {
            tokenContract.transfer(target, amount);
        }
        emit ReceiveReward(target, amount, isWithdrowedByNominator);
    }

    function receiveResidue(address target, uint item, address receiver) public onlyOwner {
        (uint amount, uint timestamp, bool isWithdrowedByNominator, bool isFullWithdrawal) = getRequestAmountWithError(target, item);
        require(isWithdrowedByNominator, "reward is not received by user");
        require(contractTokenBalance() >= amount, "not enough balance");
        delete requestedRewards[target][item];
        bool isApprove = true;
        transferOrApproveRewardToAddress(receiver, amount, false, isApprove, isFullWithdrawal);
    }

    function receiveReward(uint item) public {
        address target = msg.sender;
        (uint fullAmount, uint timestamp, bool isWithdrowedByNominator, bool isFullWithdrawal) = getRequestAmountWithError(target, item);

        require(!isWithdrowedByNominator, "reward already received");

        uint amount = fullAmount;
        uint residue = 0;
        if (!isFullWithdrawal) {
            amount = calculateShortAmount(fullAmount);
            residue = fullAmount.sub(amount);
        }
        require(contractTokenBalance() >= amount, "not enough balance");

        AmountWithTime storage request = requestedRewards[target][item];

        if (!isFullWithdrawal) {
            request.isWithdrowedByNominator = true;
            request.amount = residue;
            request.isFullWithdrawal = true;
            request.timestamp = block.timestamp;
        } else {
            delete requestedRewards[target][item];
        }
        bool isApprove = false;
        transferOrApproveRewardToAddress(target, amount, true, isApprove, isFullWithdrawal);
    }

    function transferAllTokensToOwner() public onlyOwner returns(bool) {
        tokenContract.transfer(owner(), contractTokenBalance());
        return true;
    }

    function leafFromAddressAndAmount(address _a, uint256 _n) internal pure returns(bytes32) {
        return keccak256(abi.encodePacked(_a, _n));
    }

    function checkProof(bytes32[] memory proof, bytes32 hash) internal view returns (bool) {
        bytes32 el;
        bytes32 h = hash;

        for (uint i = 0; i <= proof.length - 1; i += 1) {
            el = proof[i];

            if (h <= el) {
                h = keccak256(abi.encodePacked(h, el));
            } else {
                h = keccak256(abi.encodePacked(el, h));
            }
        }

        return h == merkleRoot;
    }

    function requestTokensByMerkleProof(bytes32[] memory _proof, uint256 _amount, bool _isFullWithdrawal) public isCancelable returns(bool) {
        require(lastRewardRequestTime[msg.sender] < merkleRootLastUpdateTime, "already withdrawn in this period");
        require(_amount > 0, "amount should be not zero");
        if (!_isFullWithdrawal) {
            require(calculateShortAmount(_amount) > 0, "amount too low"); 
        }
        require(checkProof(_proof, leafFromAddressAndAmount(msg.sender, _amount)), "proof is not correct");
        return requestReward(_amount, _isFullWithdrawal);
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

import "../GSN/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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

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

pragma solidity >=0.6.0 <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 4 of 7 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    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'
        // solhint-disable-next-line max-line-length
        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).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

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

pragma solidity >=0.6.2 <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;
        // solhint-disable-next-line no-inline-assembly
        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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

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

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 10
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"bool","name":"_cancelable","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ethereumAddress","type":"address"},{"indexed":false,"internalType":"string","name":"target","type":"string"},{"indexed":false,"internalType":"bytes","name":"signature","type":"bytes"},{"indexed":false,"internalType":"string","name":"message","type":"string"}],"name":"AddLink","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"bool","name":"isWithdrowedByNominator","type":"bool"}],"name":"ReceiveReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isFullWithdrawal","type":"bool"}],"name":"RequestReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"UpdateMerkleRoot","type":"event"},{"inputs":[],"name":"cancelable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fullRewardTimeoutPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"getReceivedRewardArray","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bool","name":"isWithdrowedByNominator","type":"bool"},{"internalType":"bool","name":"isFullWithdrawal","type":"bool"}],"internalType":"struct RewardProgram.AmountWithTime[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"getRequestedRewardArray","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bool","name":"isWithdrowedByNominator","type":"bool"},{"internalType":"bool","name":"isFullWithdrawal","type":"bool"}],"internalType":"struct RewardProgram.AmountWithTime[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastRewardRequestTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"target","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"string","name":"message","type":"string"}],"name":"linkAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootLastUpdateBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootLastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"item","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"receiveResidue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"item","type":"uint256"}],"name":"receiveReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"receivedRewards","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bool","name":"isWithdrowedByNominator","type":"bool"},{"internalType":"bool","name":"isFullWithdrawal","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_isFullWithdrawal","type":"bool"}],"name":"requestTokensByMerkleProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"requestedRewards","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bool","name":"isWithdrowedByNominator","type":"bool"},{"internalType":"bool","name":"isFullWithdrawal","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_cancelable","type":"bool"}],"name":"setCancelable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"setFullRewardTimeoutPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"setShortRewardPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"}],"name":"setShortRewardTimeoutPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shortRewardPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"shortRewardTimeoutPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenContract","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferAllTokensToOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405262ed4e0060035562278d0060045560026005553480156200002457600080fd5b5060405162001d5a38038062001d5a8339810160408190526200004791620000d7565b600062000053620000d3565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060028054610100600160a81b0319166101006001600160a01b0394909416939093029290921760ff191690151517905562000122565b3390565b60008060408385031215620000ea578182fd5b82516001600160a01b038116811462000101578283fd5b6020840151909250801515811462000117578182fd5b809150509250929050565b611c2880620001326000396000f3fe608060405234801561001057600080fd5b50600436106101495760003560e01c8063022e4d111461014e5780631d08e0b21461017a5780632eb4a7ab1461018f578063384929a4146101a45780633a813b68146101c457806355a373d6146101d7578063602905e4146101ec5780636d819b53146101ff5780636d9edc7114610212578063715018a61461021a578063738bf675146102225780638bd8669e1461022a5780638da5cb5b1461023f5780639ce94d3f146102475780639e9aed621461025a578063ae10d5ea14610262578063b44645b614610275578063bbcd5c401461027d578063cefd7de814610290578063d0dd9979146102a3578063db8fdda0146102b6578063e4ebff00146102be578063ebecfc0d146102c6578063edbe2a21146102d9578063eee56564146102ec578063f2fde38b146102f4578063f4660dd714610307575b600080fd5b61016161015c366004611453565b61031a565b6040516101719493929190611b48565b60405180910390f35b61018d61018836600461164c565b610365565b005b6101976103a8565b60405161017191906117f3565b6101b76101b2366004611438565b6103ae565b6040516101719190611780565b61018d6101d236600461164c565b610453565b6101df61048d565b60405161017191906116f2565b6101b76101fa366004611438565b6104a1565b61018d61020d36600461147d565b610538565b61019761062f565b61018d610635565b6101976106a2565b6102326106a8565b60405161017191906117e8565b6101df61077c565b61018d610255366004611570565b61078b565b6101976107d3565b61018d61027036600461164c565b61085e565b6101976109a4565b61023261028b3660046114be565b6109aa565b61019761029e366004611438565b610a8e565b6101616102b1366004611453565b610aa0565b610197610ab9565b610197610abf565b61018d6102d436600461164c565b610ac5565b61018d6102e73660046115a8565b610aff565b610232610ccd565b61018d610302366004611438565b610cd6565b61018d6103153660046115c9565b610d7a565b6009602052816000526040600020818154811061033357fe5b600091825260209091206003909102018054600182015460029092015490935090915060ff8082169161010090041684565b61036d610dc4565b6000546001600160a01b039081169116146103a35760405162461bcd60e51b815260040161039a90611a7f565b60405180910390fd5b600355565b60015481565b6001600160a01b0381166000908152600a60209081526040808320805482518185028101850190935280835260609492939192909184015b828210156104485760008481526020908190206040805160808101825260038602909201805483526001808201548486015260029091015460ff80821615159385019390935261010090049091161515606083015290835290920191016103e6565b505050509050919050565b61045b610dc4565b6000546001600160a01b039081169116146104885760405162461bcd60e51b815260040161039a90611a7f565b600455565b60025461010090046001600160a01b031681565b6001600160a01b03811660009081526009602090815260408083208054825181850281018501909352808352606094929391929091840182156104485760008481526020908190206040805160808101825260038602909201805483526001808201548486015260029091015460ff80821615159385019390935261010090049091161515606083015290835290920191016103e6565b610540610dc4565b6000546001600160a01b0390811691161461056d5760405162461bcd60e51b815260040161039a90611a7f565b60008060008061057d8787610dc8565b9350935093509350816105a25760405162461bcd60e51b815260040161039a90611a07565b836105ab6107d3565b10156105c95760405162461bcd60e51b815260040161039a90611956565b6001600160a01b03871660009081526009602052604090208054879081106105ed57fe5b60009182526020822060039091020181815560018082018390556002909101805461ffff191690559061062590879087908486610ecd565b5050505050505050565b60035481565b61063d610dc4565b6000546001600160a01b0390811691161461066a5760405162461bcd60e51b815260040161039a90611a7f565b600080546040516001600160a01b0390911690600080516020611bd3833981519152908390a3600080546001600160a01b0319169055565b60075481565b60006106b2610dc4565b6000546001600160a01b039081169116146106df5760405162461bcd60e51b815260040161039a90611a7f565b60025461010090046001600160a01b031663a9059cbb6106fd61077c565b6107056107d3565b6040518363ffffffff1660e01b8152600401610722929190611767565b602060405180830381600087803b15801561073c57600080fd5b505af1158015610750573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610774919061158c565b506001905090565b6000546001600160a01b031690565b610793610dc4565b6000546001600160a01b039081169116146107c05760405162461bcd60e51b815260040161039a90611a7f565b6002805460ff1916911515919091179055565b6002546040516370a0823160e01b815260009161010090046001600160a01b0316906370a08231906108099030906004016116f2565b60206040518083038186803b15801561082157600080fd5b505afa158015610835573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108599190611664565b905090565b33600080808061086e8587610dc8565b935093509350935081156108945760405162461bcd60e51b815260040161039a90611898565b836000826108b4576108a5866110bb565b91506108b186836110e3565b90505b816108bd6107d3565b10156108db5760405162461bcd60e51b815260040161039a90611956565b6001600160a01b038716600090815260096020526040812080548a9081106108ff57fe5b906000526020600020906003020190508361093d57600281018054838355610100600160ff19909216821761ff001916179091554290820155610988565b6001600160a01b038816600090815260096020526040902080548a90811061096157fe5b6000918252602082206003909102018181556001810191909155600201805461ffff191690555b6000610998898560018489610ecd565b50505050505050505050565b60045481565b60025460009060ff16156109d05760405162461bcd60e51b815260040161039a90611b1e565b6006543360009081526008602052604090205410610a005760405162461bcd60e51b815260040161039a90611ab4565b60008311610a205760405162461bcd60e51b815260040161039a90611982565b81610a4d576000610a30846110bb565b11610a4d5760405162461bcd60e51b815260040161039a9061192e565b610a6084610a5b338661112c565b61115f565b610a7c5760405162461bcd60e51b815260040161039a906118c9565b610a8683836111fe565b949350505050565b60086020526000908152604090205481565b600a602052816000526040600020818154811061033357fe5b60055481565b60065481565b610acd610dc4565b6000546001600160a01b03908116911614610afa5760405162461bcd60e51b815260040161039a90611a7f565b600555565b610b07610dc4565b6000546001600160a01b03908116911614610b345760405162461bcd60e51b815260040161039a90611a7f565b308115610c7957600254829061010090046001600160a01b031663dd62ed3e610b5b61077c565b846040518363ffffffff1660e01b8152600401610b79929190611729565b60206040518083038186803b158015610b9157600080fd5b505afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190611664565b1015610be75760405162461bcd60e51b815260040161039a90611ae9565b60025461010090046001600160a01b03166323b872dd610c0561077c565b83856040518463ffffffff1660e01b8152600401610c2593929190611743565b602060405180830381600087803b158015610c3f57600080fd5b505af1158015610c53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c77919061158c565b505b600183905542600655436007556002805460ff191690556040517fae8bdbc15b982b030d313524fca26f653a8826332c662cb93c670068172d217e90610cc09085906117f3565b60405180910390a1505050565b60025460ff1681565b610cde610dc4565b6000546001600160a01b03908116911614610d0b5760405162461bcd60e51b815260040161039a90611a7f565b6001600160a01b038116610d315760405162461bcd60e51b815260040161039a90611852565b600080546040516001600160a01b0380851693921691600080516020611bd383398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b336001600160a01b03167f2727aa097a70e69a14678f6713c7b94909e98116c7f21ac8a6b9f25836cc5986848484604051610db79392919061180f565b60405180910390a2505050565b3390565b6001600160a01b0382166000908152600960205260408120548190819081908510610e055760405162461bcd60e51b815260040161039a906119dc565b6001600160a01b0386166000908152600960205260408120805487908110610e2957fe5b6000918252602082206003909102018054600182015460028301549294509092909160ff610100909104169081610e6257600454610e66565b6003545b905060008411610e885760405162461bcd60e51b815260040161039a906119b5565b808301421015610eaa5760405162461bcd60e51b815260040161039a906118f7565b506001840154600290940154929a93995060ff9092169750909550909350505050565b6001600160a01b0385166000908152600a6020908152604080832081516080810183528881524281850190815288151593820193845286151560608301908152835460018181018655948852959096209151600390950290910193845551908301555160029091018054925115156101000261ff001992151560ff1990941693909317919091169190911790558115610fee5760025460405163095ea7b360e01b81526101009091046001600160a01b03169063095ea7b390610f969088908890600401611767565b602060405180830381600087803b158015610fb057600080fd5b505af1158015610fc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe8919061158c565b50611078565b60025460405163a9059cbb60e01b81526101009091046001600160a01b03169063a9059cbb906110249088908890600401611767565b602060405180830381600087803b15801561103e57600080fd5b505af1158015611052573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611076919061158c565b505b8215157fd4b6fb77a6f17bb40dfa5726076ef7931d18f404053ec43e4521d67a1ec6ec8986866040516110ac929190611767565b60405180910390a25050505050565b60006110dd600a6110d7600554856112d290919063ffffffff16565b9061130c565b92915050565b600061112583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061134b565b9392505050565b600082826040516020016111419291906116c7565b60405160208183030381529060405280519060200120905092915050565b60008082815b600186510381116111f15785818151811061117c57fe5b602002602001015192508282116111bd5781836040516020016111a09291906116e4565b6040516020818303038152906040528051906020012091506111e9565b82826040516020016111d09291906116e4565b6040516020818303038152906040528051906020012091505b600101611165565b5060015414949350505050565b336000818152600860209081526040808320429081905560098352818420825160808101845288815280850183815281850187815289151560608401908152845460018181018755958a5297892093516003909802909301968755905192860192909255905160029094018054915115156101000261ff001995151560ff1990931692909217949094161790925551919290917fa1f1c6f1afad76383864b1cf7a5fd777e66603e34a7025a63a889a33719f69b3916112c09187908790611706565b60405180910390a15060019392505050565b6000826112e1575060006110dd565b828202828482816112ee57fe5b04146111255760405162461bcd60e51b815260040161039a90611a3e565b600061112583836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b815250611377565b6000818484111561136f5760405162461bcd60e51b815260040161039a91906117fc565b505050900390565b600081836113985760405162461bcd60e51b815260040161039a91906117fc565b5060008385816113a457fe5b0495945050505050565b80356001600160a01b03811681146110dd57600080fd5b80356110dd81611bc4565b600082601f8301126113e0578081fd5b81356001600160401b038111156113f5578182fd5b611408601f8201601f1916602001611b67565b915080825283602082850101111561141f57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215611449578081fd5b61112583836113ae565b60008060408385031215611465578081fd5b61146f84846113ae565b946020939093013593505050565b600080600060608486031215611491578081fd5b833561149c81611bac565b92506020840135915060408401356114b381611bac565b809150509250925092565b6000806000606084860312156114d2578283fd5b83356001600160401b038111156114e7578384fd5b8401601f810186136114f7578384fd5b803561150a61150582611b8d565b611b67565b80828252602080830192508085018a82838702880101111561152a578889fd5b8895505b8486101561154c57803584526001959095019492810192810161152e565b509096508701359450611567925087915050604086016113c5565b90509250925092565b600060208284031215611581578081fd5b813561112581611bc4565b60006020828403121561159d578081fd5b815161112581611bc4565b600080604083850312156115ba578182fd5b50508035926020909101359150565b6000806000606084860312156115dd578283fd5b83356001600160401b03808211156115f3578485fd5b6115ff878388016113d0565b94506020860135915080821115611614578384fd5b611620878388016113d0565b93506040860135915080821115611635578283fd5b50611642868287016113d0565b9150509250925092565b60006020828403121561165d578081fd5b5035919050565b600060208284031215611675578081fd5b5051919050565b60008151808452815b818110156116a157602081850181015186830182015201611685565b818111156116b25782602083870101525b50601f01601f19169290920160200192915050565b60609290921b6001600160601b0319168252601482015260340190565b918252602082015260400190565b6001600160a01b0391909116815260200190565b6001600160a01b0393909316835260208301919091521515604082015260600190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b602080825282518282018190526000919060409081850190868401855b828110156117db578151805185528681015187860152858101511515868601526060908101511515908501526080909301929085019060010161179d565b5091979650505050505050565b901515815260200190565b90815260200190565b600060208252611125602083018461167c565b600060608252611822606083018661167c565b8281036020840152611834818661167c565b90508281036040840152611848818561167c565b9695505050505050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601790820152761c995dd85c9908185b1c9958591e481c9958d95a5d9959604a1b604082015260600190565b6020808252601490820152731c1c9bdbd9881a5cc81b9bdd0818dbdc9c9958dd60621b604082015260600190565b6020808252601d908201527f65787069726174696f6e20706572696f64206973206e6f74206f766572000000604082015260600190565b6020808252600e908201526d616d6f756e7420746f6f206c6f7760901b604082015260600190565b6020808252601290820152716e6f7420656e6f7567682062616c616e636560701b604082015260600190565b602080825260199082015278616d6f756e742073686f756c64206265206e6f74207a65726f60381b604082015260600190565b6020808252600d908201526c6974656d20697320656d70747960981b604082015260600190565b6020808252601190820152701a5d195b481a5cc81b9bdd08195e1a5cdd607a1b604082015260600190565b6020808252601e908201527f726577617264206973206e6f7420726563656976656420627920757365720000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252818101527f616c72656164792077697468647261776e20696e207468697320706572696f64604082015260600190565b6020808252601b908201527a0c2e0e0e4deeccac840c4c2d8c2dcc6ca40dcdee840cadcdeeaced602b1b604082015260600190565b60208082526010908201526f3337b93134b23232b71030b1ba34b7b760811b604082015260600190565b9384526020840192909252151560408301521515606082015260800190565b6040518181016001600160401b0381118282101715611b8557600080fd5b604052919050565b60006001600160401b03821115611ba2578081fd5b5060209081020190565b6001600160a01b0381168114611bc157600080fd5b50565b8015158114611bc157600080fdfe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220e264fb299a0e867b55eb863fa21d7c972f513699e23ab8e9b5730658900f41b264736f6c634300060c00330000000000000000000000003593d125a4f7849a1b059e64f4517a86dd60c95d0000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101495760003560e01c8063022e4d111461014e5780631d08e0b21461017a5780632eb4a7ab1461018f578063384929a4146101a45780633a813b68146101c457806355a373d6146101d7578063602905e4146101ec5780636d819b53146101ff5780636d9edc7114610212578063715018a61461021a578063738bf675146102225780638bd8669e1461022a5780638da5cb5b1461023f5780639ce94d3f146102475780639e9aed621461025a578063ae10d5ea14610262578063b44645b614610275578063bbcd5c401461027d578063cefd7de814610290578063d0dd9979146102a3578063db8fdda0146102b6578063e4ebff00146102be578063ebecfc0d146102c6578063edbe2a21146102d9578063eee56564146102ec578063f2fde38b146102f4578063f4660dd714610307575b600080fd5b61016161015c366004611453565b61031a565b6040516101719493929190611b48565b60405180910390f35b61018d61018836600461164c565b610365565b005b6101976103a8565b60405161017191906117f3565b6101b76101b2366004611438565b6103ae565b6040516101719190611780565b61018d6101d236600461164c565b610453565b6101df61048d565b60405161017191906116f2565b6101b76101fa366004611438565b6104a1565b61018d61020d36600461147d565b610538565b61019761062f565b61018d610635565b6101976106a2565b6102326106a8565b60405161017191906117e8565b6101df61077c565b61018d610255366004611570565b61078b565b6101976107d3565b61018d61027036600461164c565b61085e565b6101976109a4565b61023261028b3660046114be565b6109aa565b61019761029e366004611438565b610a8e565b6101616102b1366004611453565b610aa0565b610197610ab9565b610197610abf565b61018d6102d436600461164c565b610ac5565b61018d6102e73660046115a8565b610aff565b610232610ccd565b61018d610302366004611438565b610cd6565b61018d6103153660046115c9565b610d7a565b6009602052816000526040600020818154811061033357fe5b600091825260209091206003909102018054600182015460029092015490935090915060ff8082169161010090041684565b61036d610dc4565b6000546001600160a01b039081169116146103a35760405162461bcd60e51b815260040161039a90611a7f565b60405180910390fd5b600355565b60015481565b6001600160a01b0381166000908152600a60209081526040808320805482518185028101850190935280835260609492939192909184015b828210156104485760008481526020908190206040805160808101825260038602909201805483526001808201548486015260029091015460ff80821615159385019390935261010090049091161515606083015290835290920191016103e6565b505050509050919050565b61045b610dc4565b6000546001600160a01b039081169116146104885760405162461bcd60e51b815260040161039a90611a7f565b600455565b60025461010090046001600160a01b031681565b6001600160a01b03811660009081526009602090815260408083208054825181850281018501909352808352606094929391929091840182156104485760008481526020908190206040805160808101825260038602909201805483526001808201548486015260029091015460ff80821615159385019390935261010090049091161515606083015290835290920191016103e6565b610540610dc4565b6000546001600160a01b0390811691161461056d5760405162461bcd60e51b815260040161039a90611a7f565b60008060008061057d8787610dc8565b9350935093509350816105a25760405162461bcd60e51b815260040161039a90611a07565b836105ab6107d3565b10156105c95760405162461bcd60e51b815260040161039a90611956565b6001600160a01b03871660009081526009602052604090208054879081106105ed57fe5b60009182526020822060039091020181815560018082018390556002909101805461ffff191690559061062590879087908486610ecd565b5050505050505050565b60035481565b61063d610dc4565b6000546001600160a01b0390811691161461066a5760405162461bcd60e51b815260040161039a90611a7f565b600080546040516001600160a01b0390911690600080516020611bd3833981519152908390a3600080546001600160a01b0319169055565b60075481565b60006106b2610dc4565b6000546001600160a01b039081169116146106df5760405162461bcd60e51b815260040161039a90611a7f565b60025461010090046001600160a01b031663a9059cbb6106fd61077c565b6107056107d3565b6040518363ffffffff1660e01b8152600401610722929190611767565b602060405180830381600087803b15801561073c57600080fd5b505af1158015610750573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610774919061158c565b506001905090565b6000546001600160a01b031690565b610793610dc4565b6000546001600160a01b039081169116146107c05760405162461bcd60e51b815260040161039a90611a7f565b6002805460ff1916911515919091179055565b6002546040516370a0823160e01b815260009161010090046001600160a01b0316906370a08231906108099030906004016116f2565b60206040518083038186803b15801561082157600080fd5b505afa158015610835573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108599190611664565b905090565b33600080808061086e8587610dc8565b935093509350935081156108945760405162461bcd60e51b815260040161039a90611898565b836000826108b4576108a5866110bb565b91506108b186836110e3565b90505b816108bd6107d3565b10156108db5760405162461bcd60e51b815260040161039a90611956565b6001600160a01b038716600090815260096020526040812080548a9081106108ff57fe5b906000526020600020906003020190508361093d57600281018054838355610100600160ff19909216821761ff001916179091554290820155610988565b6001600160a01b038816600090815260096020526040902080548a90811061096157fe5b6000918252602082206003909102018181556001810191909155600201805461ffff191690555b6000610998898560018489610ecd565b50505050505050505050565b60045481565b60025460009060ff16156109d05760405162461bcd60e51b815260040161039a90611b1e565b6006543360009081526008602052604090205410610a005760405162461bcd60e51b815260040161039a90611ab4565b60008311610a205760405162461bcd60e51b815260040161039a90611982565b81610a4d576000610a30846110bb565b11610a4d5760405162461bcd60e51b815260040161039a9061192e565b610a6084610a5b338661112c565b61115f565b610a7c5760405162461bcd60e51b815260040161039a906118c9565b610a8683836111fe565b949350505050565b60086020526000908152604090205481565b600a602052816000526040600020818154811061033357fe5b60055481565b60065481565b610acd610dc4565b6000546001600160a01b03908116911614610afa5760405162461bcd60e51b815260040161039a90611a7f565b600555565b610b07610dc4565b6000546001600160a01b03908116911614610b345760405162461bcd60e51b815260040161039a90611a7f565b308115610c7957600254829061010090046001600160a01b031663dd62ed3e610b5b61077c565b846040518363ffffffff1660e01b8152600401610b79929190611729565b60206040518083038186803b158015610b9157600080fd5b505afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc99190611664565b1015610be75760405162461bcd60e51b815260040161039a90611ae9565b60025461010090046001600160a01b03166323b872dd610c0561077c565b83856040518463ffffffff1660e01b8152600401610c2593929190611743565b602060405180830381600087803b158015610c3f57600080fd5b505af1158015610c53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c77919061158c565b505b600183905542600655436007556002805460ff191690556040517fae8bdbc15b982b030d313524fca26f653a8826332c662cb93c670068172d217e90610cc09085906117f3565b60405180910390a1505050565b60025460ff1681565b610cde610dc4565b6000546001600160a01b03908116911614610d0b5760405162461bcd60e51b815260040161039a90611a7f565b6001600160a01b038116610d315760405162461bcd60e51b815260040161039a90611852565b600080546040516001600160a01b0380851693921691600080516020611bd383398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b336001600160a01b03167f2727aa097a70e69a14678f6713c7b94909e98116c7f21ac8a6b9f25836cc5986848484604051610db79392919061180f565b60405180910390a2505050565b3390565b6001600160a01b0382166000908152600960205260408120548190819081908510610e055760405162461bcd60e51b815260040161039a906119dc565b6001600160a01b0386166000908152600960205260408120805487908110610e2957fe5b6000918252602082206003909102018054600182015460028301549294509092909160ff610100909104169081610e6257600454610e66565b6003545b905060008411610e885760405162461bcd60e51b815260040161039a906119b5565b808301421015610eaa5760405162461bcd60e51b815260040161039a906118f7565b506001840154600290940154929a93995060ff9092169750909550909350505050565b6001600160a01b0385166000908152600a6020908152604080832081516080810183528881524281850190815288151593820193845286151560608301908152835460018181018655948852959096209151600390950290910193845551908301555160029091018054925115156101000261ff001992151560ff1990941693909317919091169190911790558115610fee5760025460405163095ea7b360e01b81526101009091046001600160a01b03169063095ea7b390610f969088908890600401611767565b602060405180830381600087803b158015610fb057600080fd5b505af1158015610fc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe8919061158c565b50611078565b60025460405163a9059cbb60e01b81526101009091046001600160a01b03169063a9059cbb906110249088908890600401611767565b602060405180830381600087803b15801561103e57600080fd5b505af1158015611052573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611076919061158c565b505b8215157fd4b6fb77a6f17bb40dfa5726076ef7931d18f404053ec43e4521d67a1ec6ec8986866040516110ac929190611767565b60405180910390a25050505050565b60006110dd600a6110d7600554856112d290919063ffffffff16565b9061130c565b92915050565b600061112583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061134b565b9392505050565b600082826040516020016111419291906116c7565b60405160208183030381529060405280519060200120905092915050565b60008082815b600186510381116111f15785818151811061117c57fe5b602002602001015192508282116111bd5781836040516020016111a09291906116e4565b6040516020818303038152906040528051906020012091506111e9565b82826040516020016111d09291906116e4565b6040516020818303038152906040528051906020012091505b600101611165565b5060015414949350505050565b336000818152600860209081526040808320429081905560098352818420825160808101845288815280850183815281850187815289151560608401908152845460018181018755958a5297892093516003909802909301968755905192860192909255905160029094018054915115156101000261ff001995151560ff1990931692909217949094161790925551919290917fa1f1c6f1afad76383864b1cf7a5fd777e66603e34a7025a63a889a33719f69b3916112c09187908790611706565b60405180910390a15060019392505050565b6000826112e1575060006110dd565b828202828482816112ee57fe5b04146111255760405162461bcd60e51b815260040161039a90611a3e565b600061112583836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b815250611377565b6000818484111561136f5760405162461bcd60e51b815260040161039a91906117fc565b505050900390565b600081836113985760405162461bcd60e51b815260040161039a91906117fc565b5060008385816113a457fe5b0495945050505050565b80356001600160a01b03811681146110dd57600080fd5b80356110dd81611bc4565b600082601f8301126113e0578081fd5b81356001600160401b038111156113f5578182fd5b611408601f8201601f1916602001611b67565b915080825283602082850101111561141f57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215611449578081fd5b61112583836113ae565b60008060408385031215611465578081fd5b61146f84846113ae565b946020939093013593505050565b600080600060608486031215611491578081fd5b833561149c81611bac565b92506020840135915060408401356114b381611bac565b809150509250925092565b6000806000606084860312156114d2578283fd5b83356001600160401b038111156114e7578384fd5b8401601f810186136114f7578384fd5b803561150a61150582611b8d565b611b67565b80828252602080830192508085018a82838702880101111561152a578889fd5b8895505b8486101561154c57803584526001959095019492810192810161152e565b509096508701359450611567925087915050604086016113c5565b90509250925092565b600060208284031215611581578081fd5b813561112581611bc4565b60006020828403121561159d578081fd5b815161112581611bc4565b600080604083850312156115ba578182fd5b50508035926020909101359150565b6000806000606084860312156115dd578283fd5b83356001600160401b03808211156115f3578485fd5b6115ff878388016113d0565b94506020860135915080821115611614578384fd5b611620878388016113d0565b93506040860135915080821115611635578283fd5b50611642868287016113d0565b9150509250925092565b60006020828403121561165d578081fd5b5035919050565b600060208284031215611675578081fd5b5051919050565b60008151808452815b818110156116a157602081850181015186830182015201611685565b818111156116b25782602083870101525b50601f01601f19169290920160200192915050565b60609290921b6001600160601b0319168252601482015260340190565b918252602082015260400190565b6001600160a01b0391909116815260200190565b6001600160a01b0393909316835260208301919091521515604082015260600190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b602080825282518282018190526000919060409081850190868401855b828110156117db578151805185528681015187860152858101511515868601526060908101511515908501526080909301929085019060010161179d565b5091979650505050505050565b901515815260200190565b90815260200190565b600060208252611125602083018461167c565b600060608252611822606083018661167c565b8281036020840152611834818661167c565b90508281036040840152611848818561167c565b9695505050505050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601790820152761c995dd85c9908185b1c9958591e481c9958d95a5d9959604a1b604082015260600190565b6020808252601490820152731c1c9bdbd9881a5cc81b9bdd0818dbdc9c9958dd60621b604082015260600190565b6020808252601d908201527f65787069726174696f6e20706572696f64206973206e6f74206f766572000000604082015260600190565b6020808252600e908201526d616d6f756e7420746f6f206c6f7760901b604082015260600190565b6020808252601290820152716e6f7420656e6f7567682062616c616e636560701b604082015260600190565b602080825260199082015278616d6f756e742073686f756c64206265206e6f74207a65726f60381b604082015260600190565b6020808252600d908201526c6974656d20697320656d70747960981b604082015260600190565b6020808252601190820152701a5d195b481a5cc81b9bdd08195e1a5cdd607a1b604082015260600190565b6020808252601e908201527f726577617264206973206e6f7420726563656976656420627920757365720000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252818101527f616c72656164792077697468647261776e20696e207468697320706572696f64604082015260600190565b6020808252601b908201527a0c2e0e0e4deeccac840c4c2d8c2dcc6ca40dcdee840cadcdeeaced602b1b604082015260600190565b60208082526010908201526f3337b93134b23232b71030b1ba34b7b760811b604082015260600190565b9384526020840192909252151560408301521515606082015260800190565b6040518181016001600160401b0381118282101715611b8557600080fd5b604052919050565b60006001600160401b03821115611ba2578081fd5b5060209081020190565b6001600160a01b0381168114611bc157600080fd5b50565b8015158114611bc157600080fdfe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220e264fb299a0e867b55eb863fa21d7c972f513699e23ab8e9b5730658900f41b264736f6c634300060c0033

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

0000000000000000000000003593d125a4f7849a1b059e64f4517a86dd60c95d0000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _tokenContract (address): 0x3593D125a4f7849a1B059E64F4517A86Dd60c95d
Arg [1] : _cancelable (bool): False

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000003593d125a4f7849a1b059e64f4517a86dd60c95d
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000


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.