Contract 0x794a204EeAB3b5D33618495013Ba5da5C0b9775B

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xaf2e0f7e7d8a2d9d54bd22e994e10126c8269147189de8f5ddbfdb6a0970a834Withdraw94574532021-10-26 16:38:4714 hrs 41 mins ago0xe1a0e264ce247e01d00fade87db433dd7b116e8f IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000164450252.25
0x87c4099820e0c2114de8da744b52a01c3e1eadb426f8c14a22f15712176b1204Stake94271072021-10-25 15:21:231 day 15 hrs ago0xe1a0e264ce247e01d00fade87db433dd7b116e8f IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000236657252.25
0x0c5a74f4e2afa103d8536146449c9e537fc2996f404afe197cb32e2c7d6c7708Get Reward94192262021-10-25 8:47:191 day 22 hrs ago0x33bc2e4d2688a252bd11e29559da67a97c8765bd IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000179358752.25
0xc440d2a3ab3a19ba23e349a6cc6d27dbef071cf0047219adff36039b69c69c4eWithdraw93656962021-10-23 12:10:493 days 19 hrs ago0x4f452ad8b0ee36c7ad03e3b97c3dbe7476625cd8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000164450252.25
0x31fbff17285df7357da5f36b78ee2aa126126b41c50282bc57caedda304be09eStake93593212021-10-23 6:52:044 days 28 mins ago0x4f452ad8b0ee36c7ad03e3b97c3dbe7476625cd8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000230357252.25
0x4613880d7d0b6ddcfd23458018715d01b91008adb553dbb6d6647af820f070f6Get Reward93305692021-10-22 6:54:285 days 26 mins ago0x702ff9797a2b9335efc11fca263fa0685e298952 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.00025827663.24
0x7500309fb01c3b8a56f9a128b97f05bac5168bfcaa1af99c2508e832584312a5Withdraw92875232021-10-20 19:02:096 days 12 hrs ago0xc37ace7b3af355cce3d2aaa33f221176eb237794 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000164450252.25
0x233782e7560043ec8c1a7591360c095812723e7009f4d3118f9516c0968e3ea5Withdraw92843782021-10-20 16:24:546 days 14 hrs ago0x572a9ead188feb37100e10f80612cd9ded857cce IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000164450252.25
0x810cb671798b8154077928df0205127973f5bd92cc8801e079b49a65b5debaa6Get Reward92480522021-10-19 10:08:327 days 21 hrs ago0xc37ace7b3af355cce3d2aaa33f221176eb237794 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000179358752.25
0xa40eef8f2d20679ef86aafb262037853086dfe2b0e391da19fd6adfaceebeb44Withdraw92478102021-10-19 9:56:267 days 21 hrs ago0x4f452ad8b0ee36c7ad03e3b97c3dbe7476625cd8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.00016445025 2.25
0xb6eb785602d052d717843d789d500498be7c32be1fb527b12442a59e912b49beStake92181012021-10-18 9:10:528 days 22 hrs ago0x4f452ad8b0ee36c7ad03e3b97c3dbe7476625cd8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.00023035725 2.25
0xf0dc9b819290c8914db395a1a7de1a02a433618777730b2cbfa273417962b2d3Withdraw92180852021-10-18 9:10:048 days 22 hrs ago0x4f452ad8b0ee36c7ad03e3b97c3dbe7476625cd8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.00016445025 2.25
0xbf5137d51915a09b0fb595399d2426bff1b9bbb9f3b9e63444fae34fdfa5959fWithdraw92140782021-10-18 5:49:439 days 1 hr ago0x0447a8e5b31db4e4b38f0ff6234d0c51d09d78f8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000164450252.25
0xa6ab7b7bfec6c27e7d55610f0a706bf9a292bc15aa33daaa6e2e2f0c8017a3bcStake92095882021-10-18 2:05:139 days 5 hrs ago0x07398693bab6e3a151db164233d5205115561490 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.00023038425 2.25
0x52427765bf4632d6cfe36452567738322393ff653e732a2ad179da53e75838a7Withdraw92095552021-10-18 2:03:349 days 5 hrs ago0x07398693bab6e3a151db164233d5205115561490 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.00021555225 2.25
0x6c1f383f2b76ff60000677d4399912f0b6d604261993d69d74893f4968e78f96Withdraw91940402021-10-17 13:07:499 days 18 hrs ago0x74ea7dbd0413ca6b92ce3ca9276a7a427308a87e IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000164450252.25
0xe1e7d57e7c42b777039494ac10abe6a2060d4f2a40aa9cbe21c2d00aa5420517Stake91909202021-10-17 10:31:499 days 20 hrs ago0x0447a8e5b31db4e4b38f0ff6234d0c51d09d78f8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000230357252.25
0x83d5037a4d670213348bc00696c24eab96ea1453537a6380634046aaf2d1b458Get Reward91904202021-10-17 10:06:499 days 21 hrs ago0x0447a8e5b31db4e4b38f0ff6234d0c51d09d78f8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.00016845752.25
0x81c61e8753342285b37b1d6ecf958b7b407e47a97844ee3e3ce1c381de4481edWithdraw91904102021-10-17 10:06:199 days 21 hrs ago0x0447a8e5b31db4e4b38f0ff6234d0c51d09d78f8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000215525252.25
0x996a8cc111568bea6ab39adb1d35369bc65213017572b1758b63408e37b58245Withdraw91793182021-10-17 0:51:4310 days 6 hrs ago0x7f1f75c3e0e2c7939543ad9d7cf6b060ddfe2838 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000164450252.25
0x069d9de97f2c40b4e4cebde152b0eac1efb49f36ffb5e8cef646b9f2684219b6Get Reward91792972021-10-17 0:50:4010 days 6 hrs ago0x7f1f75c3e0e2c7939543ad9d7cf6b060ddfe2838 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000179358752.25
0xdbbc935f64038ec65145691a03ea483790e3126f8482ef948be9df9404afd4f5Stake91747382021-10-16 21:02:4310 days 10 hrs ago0x572a9ead188feb37100e10f80612cd9ded857cce IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000230357252.25
0x5d5a4426e3477fc29ccfcbdac42ebcc190f222ab4e0891c260c6fe9c58a3c59bWithdraw91734152021-10-16 19:56:3410 days 11 hrs ago0x572a9ead188feb37100e10f80612cd9ded857cce IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000123162752.25
0x8bb8b7950dacfef87e29bf7723a71163b298196ec13a853abe0a309c388e8429Withdraw91734142021-10-16 19:56:3110 days 11 hrs ago0x572a9ead188feb37100e10f80612cd9ded857cce IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000164450252.25
0x1174db6b0de7c5ec0b3261545f577600c2a8156b5b5d224c7dc039297a43e69bStake91660672021-10-16 13:49:1010 days 17 hrs ago0x4f452ad8b0ee36c7ad03e3b97c3dbe7476625cd8 IN  0x794a204eeab3b5d33618495013ba5da5c0b9775b0 HT0.000236657252.25
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x2b445fc83e6aaa2335da81a850ef7a9416c4ee4e9021d8faf2d7c465ecf6b7f868297342021-07-27 10:49:2791 days 20 hrs ago 0xd6163b4c36b3f8ba7a6dd176df2ad1befac796af  Contract Creation0 HT
[ Download CSV Export 
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x82fbd740824b4a3d699ba9d676a5443f350b59ab

Contract Name:
StakingRewards

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at hecoinfo.com on 2021-03-12
*/

pragma solidity ^0.5.16;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see `ERC20Detailed`.
 */
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);

    function mint(address account, uint amount) external;

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * > 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);

    function burn(address account, uint256 amount) external;

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

/**
 * @dev 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.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be aplied to your functions to restrict their use to
 * the owner.
 */
contract Ownable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }

    /**
     * @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(isOwner(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == _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 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 onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

/**
 * @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) {
        require(b <= a, "SafeMath: subtraction overflow");
        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-solidity/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) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, "SafeMath: division by zero");
        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) {
        require(b != 0, "SafeMath: modulo by zero");
        return a % b;
    }
}

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

/**
 * @dev Optional functions from the ERC20 standard.
 */
contract ERC20Detailed is IERC20 {
    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
     * these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol, uint8 decimals) public {
        _name = name;
        _symbol = symbol;
        _decimals = decimals;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei.
     *
     * > Note that this information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * `IERC20.balanceOf` and `IERC20.transfer`.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }
}

/**
 * @dev Collection of functions related to the address type,
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing a contract.
     *
     * > It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in 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;
    }
}

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

    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);
        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.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "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");
        }
    }
}

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the `nonReentrant` modifier
 * available, which can be aplied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 */
contract ReentrancyGuard {
    /// @dev counter to allow mutex lock with only one SSTORE operation
    uint256 private _guardCounter;

    constructor () internal {
        // The counter starts at one to prevent changing it from zero to a non-zero
        // value, which is a more expensive operation.
        _guardCounter = 1;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _guardCounter += 1;
        uint256 localCounter = _guardCounter;
        _;
        require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
    }
}

// Inheritance
interface IStakingRewards {
    // Views
    function lastTimeRewardApplicable() external view returns (uint256);

    function rewardPerToken() external view returns (uint256);

    function earned(address account) external view returns (uint256);

    function getRewardForDuration() external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    // Mutative

    function stake(uint256 amount) external;

    function withdraw(uint256 amount) external;

    function getReward() external;
}

contract RewardsDistributionRecipient {
    address public rewardsDistribution;

    function notifyRewardAmount(uint256 reward) external;

    modifier onlyRewardsDistribution() {
        require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract");
        _;
    }
}

contract StakingRewards is IStakingRewards, RewardsDistributionRecipient, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    /* ========== STATE VARIABLES ========== */

    IERC20 public rewardsToken;
    IERC20 public stakingToken;
    uint256 public periodFinish = 0;
    uint256 public rewardRate = 0;
    uint256 public rewardsDuration = 7 days;
    uint256 public lastUpdateTime;
    uint256 public rewardPerTokenStored;
    uint256 public totalRewards = 0;
    uint256 private rewardsNext = 0;
    uint256 public rewardsPaid = 0;
    uint256 public startTime = 0;
    uint256 public rewardsed = 0;
    uint256 private leftRewardTimes = 12;

    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) public rewards;

    uint256 private _totalSupply;
    mapping(address => uint256) private _balances;

    /* ========== CONSTRUCTOR ========== */

    constructor(
        address _rewardsDistribution,
        address _rewardsToken,
        address _stakingToken,
        uint256 _rewardAmount,
        uint256 _startTime
    ) public {
        rewardsToken = IERC20(_rewardsToken);
        stakingToken = IERC20(_stakingToken);
        rewardsDistribution = _rewardsDistribution;
        totalRewards = _rewardAmount;
        startTime = _startTime;
    }

    /* ========== VIEWS ========== */

    function totalSupply() external view returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) external view returns (uint256) {
        return _balances[account];
    }

    function lastTimeRewardApplicable() public view returns (uint256) {
        return Math.min(block.timestamp, periodFinish);
    }

    function rewardPerToken() public view returns (uint256) {
        if (_totalSupply == 0) {
            return rewardPerTokenStored;
        }
        return
            rewardPerTokenStored.add(
                lastTimeRewardApplicable().sub(lastUpdateTime).mul(rewardRate).mul(1e18).div(_totalSupply)
            );
    }

    function earned(address account) public view returns (uint256) {
        return _balances[account].mul(rewardPerToken().sub(userRewardPerTokenPaid[account])).div(1e18).add(rewards[account]);
    }

    function getRewardForDuration() external view returns (uint256) {
        return rewardRate.mul(rewardsDuration);
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    function stake(uint256 amount) external nonReentrant updateReward(msg.sender) checkhalve checkStart {
        require(amount > 0, "Cannot stake 0");
        _totalSupply = _totalSupply.add(amount);
        _balances[msg.sender] = _balances[msg.sender].add(amount);
        stakingToken.safeTransferFrom(msg.sender, address(this), amount);
        emit Staked(msg.sender, amount);
    }

    function withdraw(uint256 amount) public nonReentrant updateReward(msg.sender) checkhalve checkStart {
        require(amount > 0, "Cannot withdraw 0");
        _totalSupply = _totalSupply.sub(amount);
        _balances[msg.sender] = _balances[msg.sender].sub(amount);
        stakingToken.safeTransfer(msg.sender, amount);
        emit Withdrawn(msg.sender, amount);
    }

    function getReward() public nonReentrant updateReward(msg.sender) checkhalve checkStart {
        uint256 reward = rewards[msg.sender];
        if (reward > 0) {
            rewards[msg.sender] = 0;
            rewardsToken.safeTransfer(msg.sender, reward);
            rewardsPaid = rewardsPaid.add(reward);
            emit RewardPaid(msg.sender, reward);
        }
    }

    function burn(uint256 amount) external onlyRewardsDistribution {
        leftRewardTimes = 0;
        rewardsNext = 0;
        rewardsToken.burn(address(this), amount);
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    function notifyRewardAmount(uint256 reward) external onlyRewardsDistribution updateReward(address(0)) {
        require(rewardsed == 0, "reward already inited");
        if (block.timestamp >= periodFinish) {
            rewardRate = reward.div(rewardsDuration);
        } else {
            uint256 remaining = periodFinish.sub(block.timestamp);
            uint256 leftover = remaining.mul(rewardRate);
            rewardRate = reward.add(leftover).div(rewardsDuration);
        }
        rewardsToken.mint(address(this),reward);
        rewardsed = reward;
        rewardsNext = rewardsed.mul(70).div(100);
        leftRewardTimes = leftRewardTimes.sub(1);
        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp.add(rewardsDuration);
        emit RewardAdded(reward);
    }

    /* ========== MODIFIERS ========== */

    modifier updateReward(address account) {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        if (account != address(0)) {
            rewards[account] = earned(account);
            userRewardPerTokenPaid[account] = rewardPerTokenStored;
        }
        _;
    }

    modifier checkhalve(){
        if (block.timestamp >= periodFinish && leftRewardTimes > 0) {
            leftRewardTimes = leftRewardTimes.sub(1);
            uint256 reward = leftRewardTimes == 0 ? totalRewards.sub(rewardsed) : rewardsNext;
            rewardsToken.mint(address(this), reward);
            rewardsed = rewardsed.add(reward);
            rewardRate = reward.div(rewardsDuration);
            periodFinish = block.timestamp.add(rewardsDuration);
            rewardsNext = leftRewardTimes > 0 ? rewardsNext.mul(70).div(100) : 0;
            emit RewardAdded(reward);
        }
        _;
    }

    modifier checkStart(){
        require(block.timestamp > startTime,"not start");
        _;
    }

    /* ========== EVENTS ========== */

    event RewardAdded(uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);
    event Burn(uint256 amount);
}

contract StakingRewardsFactory is Ownable {
    // immutables
    address public rewardsToken;

    // the staking tokens for which the rewards contract has been deployed
    address[] public stakingTokens;

    // info about rewards for a particular staking token
    struct StakingRewardsInfo {
        address stakingRewards;
        uint rewardAmount;
    }

    // rewards info by staking token
    mapping(address => StakingRewardsInfo) public stakingRewardsInfoByStakingToken;

    constructor(
        address _rewardsToken
    ) Ownable() public {
        rewardsToken = _rewardsToken;
    }

    ///// permissioned functions

    // deploy a staking reward contract for the staking token, and store the total reward amount
    function deploy(address stakingToken, uint rewardAmount, uint256 startTime) public onlyOwner {
        StakingRewardsInfo storage info = stakingRewardsInfoByStakingToken[stakingToken];
        require(info.stakingRewards == address(0), 'StakingRewardsFactory::deploy: already deployed');
        info.stakingRewards = address(new StakingRewards(/*_rewardsDistribution=*/ address(this), rewardsToken, stakingToken, rewardAmount, startTime));
        stakingTokens.push(stakingToken);
    }

    // notify initial reward amount for an individual staking token.
    function notifyRewardAmount(address stakingToken, uint256 rewardAmount) public onlyOwner {
        require(rewardAmount > 0, 'amount should > 0');
        StakingRewardsInfo storage info = stakingRewardsInfoByStakingToken[stakingToken];
        require(info.stakingRewards != address(0), 'StakingRewardsFactory::notifyRewardAmount: not deployed');
        if (info.rewardAmount <= 0) {
            info.rewardAmount = rewardAmount;
            StakingRewards(info.stakingRewards).notifyRewardAmount(rewardAmount);
        }
    }

    function burn(address stakingToken, uint256 amount) public onlyOwner {
        StakingRewardsInfo storage info = stakingRewardsInfoByStakingToken[stakingToken];
        require(info.stakingRewards != address(0), 'StakingRewardsFactory::burn: not deployed');
        StakingRewards(info.stakingRewards).burn(amount);
    }

}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_rewardsDistribution","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"uint256","name":"_rewardAmount","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"getReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsDistribution","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardsed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040526000600455600060055562093a8060065560006009556000600a556000600b556000600c556000600d55600c600e5534801561003f57600080fd5b5060405161170a38038061170a833981810160405260a081101561006257600080fd5b50805160208201516040830151606084015160809094015160018055600280546001600160a01b03199081166001600160a01b0395861617909155600380548216938516939093179092556000805490921692909316919091178155600992909255600c556116339081906100d790396000f3fe608060405234801561001057600080fd5b50600436106101725760003560e01c806370a08231116100de578063a694fc3a11610097578063d1af0c7d11610071578063d1af0c7d1461031b578063df136d6514610323578063e32d2a741461032b578063ebe2b12b1461033357610172565b8063a694fc3a146102ee578063c8f33c911461030b578063cd3daf9d1461031357610172565b806370a082311461028257806372f702f3146102a857806378e97925146102b05780637b0a47ee146102b857806380faa57d146102c05780638b876347146102c857610172565b8063386a952511610130578063386a95251461020c5780633c6b16ab146102145780633d18b912146102315780633fc6df6e1461023957806342966c681461025d57806369d8d6d21461027a57610172565b80628cc262146101775780630700037d146101af5780630e15561a146101d557806318160ddd146101dd5780631c1f78eb146101e55780632e1a7d4d146101ed575b600080fd5b61019d6004803603602081101561018d57600080fd5b50356001600160a01b031661033b565b60408051918252519081900360200190f35b61019d600480360360208110156101c557600080fd5b50356001600160a01b03166103d1565b61019d6103e3565b61019d6103e9565b61019d6103f0565b61020a6004803603602081101561020357600080fd5b503561040e565b005b61019d61074a565b61020a6004803603602081101561022a57600080fd5b5035610750565b61020a610997565b610241610c7e565b604080516001600160a01b039092168252519081900360200190f35b61020a6004803603602081101561027357600080fd5b5035610c8d565b61019d610d4a565b61019d6004803603602081101561029857600080fd5b50356001600160a01b0316610d50565b610241610d6b565b61019d610d7a565b61019d610d80565b61019d610d86565b61019d600480360360208110156102de57600080fd5b50356001600160a01b0316610d94565b61020a6004803603602081101561030457600080fd5b5035610da6565b61019d6110dc565b61019d6110e2565b61024161113c565b61019d61114b565b61019d611151565b61019d611157565b6001600160a01b038116600090815260106020908152604080832054600f9092528220546103cb91906103bf90670de0b6b3a7640000906103b39061038e906103826110e2565b9063ffffffff61115d16565b6001600160a01b0388166000908152601260205260409020549063ffffffff6111ba16565b9063ffffffff61121a16565b9063ffffffff61128416565b92915050565b60106020526000908152604090205481565b60095481565b6011545b90565b60006104096006546005546111ba90919063ffffffff16565b905090565b60018054810190819055336104216110e2565b60085561042c610d86565b6007556001600160a01b03811615610473576104478161033b565b6001600160a01b038216600090815260106020908152604080832093909355600854600f909152919020555b600454421015801561048757506000600e54115b156105cc57600e546104a090600163ffffffff61115d16565b600e819055600090156104b557600a546104ca565b600d546009546104ca9163ffffffff61115d16565b600254604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b15801561052057600080fd5b505af1158015610534573d6000803e3d6000fd5b5050600d5461054c925090508263ffffffff61128416565b600d5560065461056390829063ffffffff61121a16565b60055560065461057a90429063ffffffff61128416565b600455600e5461058b5760006105a6565b6105a660646103b36046600a546111ba90919063ffffffff16565b600a5560408051828152905160008051602061156a8339815191529181900360200190a1505b600c54421161060e576040805162461bcd60e51b81526020600482015260096024820152681b9bdd081cdd185c9d60ba1b604482015290519081900360640190fd5b60008311610657576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b60115461066a908463ffffffff61115d16565b6011553360009081526012602052604090205461068d908463ffffffff61115d16565b336000818152601260205260409020919091556003546106b9916001600160a01b0390911690856112de565b60408051848152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2506001548114610746576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b5050565b60065481565b6000546001600160a01b031633146107995760405162461bcd60e51b815260040180806020018281038252602a8152602001806115ab602a913960400191505060405180910390fd5b60006107a36110e2565b6008556107ae610d86565b6007556001600160a01b038116156107f5576107c98161033b565b6001600160a01b038216600090815260106020908152604080832093909355600854600f909152919020555b600d5415610842576040805162461bcd60e51b81526020600482015260156024820152741c995dd85c9908185b1c9958591e481a5b9a5d1959605a1b604482015290519081900360640190fd5b60045442106108675760065461085f90839063ffffffff61121a16565b6005556108b6565b60045460009061087d904263ffffffff61115d16565b90506000610896600554836111ba90919063ffffffff16565b6006549091506108b0906103b3868463ffffffff61128416565b60055550505b600254604080516340c10f1960e01b81523060048201526024810185905290516001600160a01b03909216916340c10f199160448082019260009290919082900301818387803b15801561090957600080fd5b505af115801561091d573d6000803e3d6000fd5b505050600d8390555061093c60646103b384604663ffffffff6111ba16565b600a55600e5461095390600163ffffffff61115d16565b600e5542600781905560065461096f919063ffffffff61128416565b60045560408051838152905160008051602061156a8339815191529181900360200190a15050565b60018054810190819055336109aa6110e2565b6008556109b5610d86565b6007556001600160a01b038116156109fc576109d08161033b565b6001600160a01b038216600090815260106020908152604080832093909355600854600f909152919020555b6004544210158015610a1057506000600e54115b15610b5557600e54610a2990600163ffffffff61115d16565b600e81905560009015610a3e57600a54610a53565b600d54600954610a539163ffffffff61115d16565b600254604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015610aa957600080fd5b505af1158015610abd573d6000803e3d6000fd5b5050600d54610ad5925090508263ffffffff61128416565b600d55600654610aec90829063ffffffff61121a16565b600555600654610b0390429063ffffffff61128416565b600455600e54610b14576000610b2f565b610b2f60646103b36046600a546111ba90919063ffffffff16565b600a5560408051828152905160008051602061156a8339815191529181900360200190a1505b600c544211610b97576040805162461bcd60e51b81526020600482015260096024820152681b9bdd081cdd185c9d60ba1b604482015290519081900360640190fd5b336000908152601060205260409020548015610c235733600081815260106020526040812055600254610bd6916001600160a01b0390911690836112de565b600b54610be9908263ffffffff61128416565b600b5560408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b50506001548114610c7b576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b50565b6000546001600160a01b031681565b6000546001600160a01b03163314610cd65760405162461bcd60e51b815260040180806020018281038252602a8152602001806115ab602a913960400191505060405180910390fd5b6000600e819055600a81905560025460408051632770a7eb60e21b81523060048201526024810185905290516001600160a01b0390921692639dc29fac9260448084019382900301818387803b158015610d2f57600080fd5b505af1158015610d43573d6000803e3d6000fd5b5050505050565b600b5481565b6001600160a01b031660009081526012602052604090205490565b6003546001600160a01b031681565b600c5481565b60055481565b600061040942600454611335565b600f6020526000908152604090205481565b6001805481019081905533610db96110e2565b600855610dc4610d86565b6007556001600160a01b03811615610e0b57610ddf8161033b565b6001600160a01b038216600090815260106020908152604080832093909355600854600f909152919020555b6004544210158015610e1f57506000600e54115b15610f6457600e54610e3890600163ffffffff61115d16565b600e81905560009015610e4d57600a54610e62565b600d54600954610e629163ffffffff61115d16565b600254604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b158015610eb857600080fd5b505af1158015610ecc573d6000803e3d6000fd5b5050600d54610ee4925090508263ffffffff61128416565b600d55600654610efb90829063ffffffff61121a16565b600555600654610f1290429063ffffffff61128416565b600455600e54610f23576000610f3e565b610f3e60646103b36046600a546111ba90919063ffffffff16565b600a5560408051828152905160008051602061156a8339815191529181900360200190a1505b600c544211610fa6576040805162461bcd60e51b81526020600482015260096024820152681b9bdd081cdd185c9d60ba1b604482015290519081900360640190fd5b60008311610fec576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b601154610fff908463ffffffff61128416565b60115533600090815260126020526040902054611022908463ffffffff61128416565b3360008181526012602052604090209190915560035461104f916001600160a01b0390911690308661134b565b60408051848152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2506001548114610746576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60075481565b6000601154600014156110f857506008546103ed565b61040961112d6011546103b3670de0b6b3a7640000611121600554611121600754610382610d86565b9063ffffffff6111ba16565b6008549063ffffffff61128416565b6002546001600160a01b031681565b60085481565b600d5481565b60045481565b6000828211156111b4576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000826111c9575060006103cb565b828202828482816111d657fe5b04146112135760405162461bcd60e51b815260040180806020018281038252602181526020018061158a6021913960400191505060405180910390fd5b9392505050565b6000808211611270576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161127b57fe5b04949350505050565b600082820183811015611213576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526113309084906113ab565b505050565b60008183106113445781611213565b5090919050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526113a59085906113ab565b50505050565b6113bd826001600160a01b0316611563565b61140e576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061144c5780518252601f19909201916020918201910161142d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146114ae576040519150601f19603f3d011682016040523d82523d6000602084013e6114b3565b606091505b50915091508161150a576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156113a55780806020019051602081101561152657600080fd5b50516113a55760405162461bcd60e51b815260040180806020018281038252602a8152602001806115d5602a913960400191505060405180910390fd5b3b15159056fede88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616c6c6572206973206e6f742052657761726473446973747269627574696f6e20636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820c0121458810aa31dcd6770f08096c15e37d591a2d1d39ce2c1baf5471c12897664736f6c63430005100032000000000000000000000000d6163b4c36b3f8ba7a6dd176df2ad1befac796af00000000000000000000000052ee54dd7a68e9cf131b0a57fd6015c74d7140e2000000000000000000000000be36e5f7226a328dc1fa899d8ffec1ea216b8c98000000000000000000000000000000000000000000006168a6643f8c0780000000000000000000000000000000000000000000000000000000000000604b1f80

Deployed ByteCode Sourcemap

18325:6164:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18325:6164:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20448:198;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;20448:198:0;-1:-1:-1;;;;;20448:198:0;;:::i;:::-;;;;;;;;;;;;;;;;19097:42;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19097:42:0;-1:-1:-1;;;;;19097:42:0;;:::i;18805:31::-;;;:::i;19750:93::-;;;:::i;20654:121::-;;;:::i;21236:379::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21236:379:0;;:::i;:::-;;18681:39;;;:::i;22254:818::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;22254:818:0;;:::i;21623:381::-;;;:::i;18060:34::-;;;:::i;:::-;;;;-1:-1:-1;;;;;18060:34:0;;;;;;;;;;;;;;22012:178;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;22012:178:0;;:::i;18881:30::-;;;:::i;19851:112::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19851:112:0;-1:-1:-1;;;;;19851:112:0;;:::i;18574:26::-;;;:::i;18918:28::-;;;:::i;18645:29::-;;;:::i;19971:131::-;;;:::i;19033:57::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19033:57:0;-1:-1:-1;;;;;19033:57:0;;:::i;20837:391::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;20837:391:0;;:::i;18727:29::-;;;:::i;20110:330::-;;;:::i;18541:26::-;;;:::i;18763:35::-;;;:::i;18953:28::-;;;:::i;18607:31::-;;;:::i;20448:198::-;-1:-1:-1;;;;;20621:16:0;;20502:7;20621:16;;;:7;:16;;;;;;;;;20573:22;:31;;;;;;20529:109;;20621:16;20529:87;;20611:4;;20529:77;;20552:53;;:16;:14;:16::i;:::-;:20;:53;:20;:53;:::i;:::-;-1:-1:-1;;;;;20529:18:0;;;;;;:9;:18;;;;;;;:22;:77::i;:::-;:81;:87;:81;:87;:::i;:::-;:91;:109;:91;:109;:::i;:::-;20522:116;20448:198;-1:-1:-1;;20448:198:0:o;19097:42::-;;;;;;;;;;;;;:::o;18805:31::-;;;;:::o;19750:93::-;19823:12;;19750:93;;:::o;20654:121::-;20709:7;20736:31;20751:15;;20736:10;;:14;;:31;;;;:::i;:::-;20729:38;;20654:121;:::o;21236:379::-;17212:1;17195:18;;;;;;;;21303:10;23198:16;:14;:16::i;:::-;23175:20;:39;23242:26;:24;:26::i;:::-;23225:14;:43;-1:-1:-1;;;;;23283:21:0;;;23279:157;;23340:15;23347:7;23340:6;:15::i;:::-;-1:-1:-1;;;;;23321:16:0;;;;;;:7;:16;;;;;;;;:34;;;;23404:20;;23370:22;:31;;;;;;:54;23279:157;23518:12;;23499:15;:31;;:54;;;;;23552:1;23534:15;;:19;23499:54;23495:569;;;23588:15;;:22;;23608:1;23588:22;:19;:22;:::i;:::-;23570:15;:40;;;23625:14;;23642:20;:64;;23695:11;;23642:64;;;23682:9;;23665:12;;:27;;;:16;:27;:::i;:::-;23721:12;;:40;;;-1:-1:-1;;;23721:40:0;;23747:4;23721:40;;;;;;;;;;;;;;-1:-1:-1;;;;;;23721:12:0;;;;-1:-1:-1;;23721:40:0;;;;;-1:-1:-1;;23721:40:0;;;;;;;;-1:-1:-1;23721:12:0;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;23721:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;23788:9:0;;:21;;-1:-1:-1;23788:9:0;-1:-1:-1;23802:6:0;23788:21;:13;:21;:::i;:::-;23776:9;:33;23848:15;;23837:27;;:6;;:27;:10;:27;:::i;:::-;23824:10;:40;23914:15;;23894:36;;:15;;:36;:19;:36;:::i;:::-;23879:12;:51;23959:15;;:54;;24012:1;23959:54;;;23981:28;24005:3;23981:19;23997:2;23981:11;;:15;;:19;;;;:::i;:28::-;23945:11;:68;24033:19;;;;;;;;-1:-1:-1;;;;;;;;;;;24033:19:0;;;;;;;;23495:569;;24149:9;;24131:15;:27;24123:48;;;;;-1:-1:-1;;;24123:48:0;;;;;;;;;;;;-1:-1:-1;;;24123:48:0;;;;;;;;;;;;;;;21365:1;21356:6;:10;21348:40;;;;;-1:-1:-1;;;21348:40:0;;;;;;;;;;;;-1:-1:-1;;;21348:40:0;;;;;;;;;;;;;;;21414:12;;:24;;21431:6;21414:24;:16;:24;:::i;:::-;21399:12;:39;21483:10;21473:21;;;;:9;:21;;;;;;:33;;21499:6;21473:33;:25;:33;:::i;:::-;21459:10;21449:21;;;;:9;:21;;;;;:57;;;;21517:12;;:45;;-1:-1:-1;;;;;21517:12:0;;;;21555:6;21517:25;:45::i;:::-;21578:29;;;;;;;;21588:10;;21578:29;;;;;;;;;;17271:1;17307:13;;17291:12;:29;17283:73;;;;;-1:-1:-1;;;17283:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;21236:379;;:::o;18681:39::-;;;;:::o;22254:818::-;18232:19;;-1:-1:-1;;;;;18232:19:0;18218:10;:33;18210:88;;;;-1:-1:-1;;;18210:88:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22352:1;23198:16;:14;:16::i;:::-;23175:20;:39;23242:26;:24;:26::i;:::-;23225:14;:43;-1:-1:-1;;;;;23283:21:0;;;23279:157;;23340:15;23347:7;23340:6;:15::i;:::-;-1:-1:-1;;;;;23321:16:0;;;;;;:7;:16;;;;;;;;:34;;;;23404:20;;23370:22;:31;;;;;;:54;23279:157;22375:9;;:14;22367:48;;;;;-1:-1:-1;;;22367:48:0;;;;;;;;;;;;-1:-1:-1;;;22367:48:0;;;;;;;;;;;;;;;22449:12;;22430:15;:31;22426:318;;22502:15;;22491:27;;:6;;:27;:10;:27;:::i;:::-;22478:10;:40;22426:318;;;22571:12;;22551:17;;22571:33;;22588:15;22571:33;:16;:33;:::i;:::-;22551:53;;22619:16;22638:25;22652:10;;22638:9;:13;;:25;;;;:::i;:::-;22716:15;;22619:44;;-1:-1:-1;22691:41:0;;:20;:6;22619:44;22691:20;:10;:20;:::i;:41::-;22678:10;:54;-1:-1:-1;;22426:318:0;22754:12;;:39;;;-1:-1:-1;;;22754:39:0;;22780:4;22754:39;;;;;;;;;;;;-1:-1:-1;;;;;22754:12:0;;;;-1:-1:-1;;22754:39:0;;;;;-1:-1:-1;;22754:39:0;;;;;;;;-1:-1:-1;22754:12:0;:39;;;5:2:-1;;;;30:1;27;20:12;5:2;22754:39:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;;22804:9:0;:18;;;-1:-1:-1;22847:26:0;22869:3;22847:17;22816:6;22861:2;22847:17;:13;:17;:::i;:26::-;22833:11;:40;22902:15;;:22;;22922:1;22902:22;:19;:22;:::i;:::-;22884:15;:40;22952:15;22935:14;:32;;;23013:15;;22993:36;;22952:15;22993:36;:19;:36;:::i;:::-;22978:12;:51;23045:19;;;;;;;;-1:-1:-1;;;;;;;;;;;23045:19:0;;;;;;;;18309:1;22254:818;:::o;21623:381::-;17212:1;17195:18;;;;;;;;21677:10;23198:16;:14;:16::i;:::-;23175:20;:39;23242:26;:24;:26::i;:::-;23225:14;:43;-1:-1:-1;;;;;23283:21:0;;;23279:157;;23340:15;23347:7;23340:6;:15::i;:::-;-1:-1:-1;;;;;23321:16:0;;;;;;:7;:16;;;;;;;;:34;;;;23404:20;;23370:22;:31;;;;;;:54;23279:157;23518:12;;23499:15;:31;;:54;;;;;23552:1;23534:15;;:19;23499:54;23495:569;;;23588:15;;:22;;23608:1;23588:22;:19;:22;:::i;:::-;23570:15;:40;;;23625:14;;23642:20;:64;;23695:11;;23642:64;;;23682:9;;23665:12;;:27;;;:16;:27;:::i;:::-;23721:12;;:40;;;-1:-1:-1;;;23721:40:0;;23747:4;23721:40;;;;;;;;;;;;;;-1:-1:-1;;;;;;23721:12:0;;;;-1:-1:-1;;23721:40:0;;;;;-1:-1:-1;;23721:40:0;;;;;;;;-1:-1:-1;23721:12:0;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;23721:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;23788:9:0;;:21;;-1:-1:-1;23788:9:0;-1:-1:-1;23802:6:0;23788:21;:13;:21;:::i;:::-;23776:9;:33;23848:15;;23837:27;;:6;;:27;:10;:27;:::i;:::-;23824:10;:40;23914:15;;23894:36;;:15;;:36;:19;:36;:::i;:::-;23879:12;:51;23959:15;;:54;;24012:1;23959:54;;;23981:28;24005:3;23981:19;23997:2;23981:11;;:15;;:19;;;;:::i;:28::-;23945:11;:68;24033:19;;;;;;;;-1:-1:-1;;;;;;;;;;;24033:19:0;;;;;;;;23495:569;;24149:9;;24131:15;:27;24123:48;;;;;-1:-1:-1;;;24123:48:0;;;;;;;;;;;;-1:-1:-1;;;24123:48:0;;;;;;;;;;;;;;;21747:10;21722:14;21739:19;;;:7;:19;;;;;;21773:10;;21769:228;;21808:10;21822:1;21800:19;;;:7;:19;;;;;:23;21838:12;;:45;;-1:-1:-1;;;;;21838:12:0;;;;21876:6;21838:25;:45::i;:::-;21912:11;;:23;;21928:6;21912:23;:15;:23;:::i;:::-;21898:11;:37;21955:30;;;;;;;;21966:10;;21955:30;;;;;;;;;;21769:228;24182:1;17271;17307:13;;17291:12;:29;17283:73;;;;;-1:-1:-1;;;17283:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;21623:381;:::o;18060:34::-;;;-1:-1:-1;;;;;18060:34:0;;:::o;22012:178::-;18232:19;;-1:-1:-1;;;;;18232:19:0;18218:10;:33;18210:88;;;;-1:-1:-1;;;18210:88:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22104:1;22086:15;:19;;;22116:11;:15;;;22142:12;;:40;;;-1:-1:-1;;;22142:40:0;;22168:4;-1:-1:-1;22142:40:0;;;;;;;;;;;-1:-1:-1;;;;;22142:12:0;;;;:17;;:40;;;;;;;;;;22104:1;22142:12;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;22142:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;22142:40:0;;;;22012:178;:::o;18881:30::-;;;;:::o;19851:112::-;-1:-1:-1;;;;;19937:18:0;19910:7;19937:18;;;:9;:18;;;;;;;19851:112::o;18574:26::-;;;-1:-1:-1;;;;;18574:26:0;;:::o;18918:28::-;;;;:::o;18645:29::-;;;;:::o;19971:131::-;20028:7;20055:39;20064:15;20081:12;;20055:8;:39::i;19033:57::-;;;;;;;;;;;;;:::o;20837:391::-;17212:1;17195:18;;;;;;;;20903:10;23198:16;:14;:16::i;:::-;23175:20;:39;23242:26;:24;:26::i;:::-;23225:14;:43;-1:-1:-1;;;;;23283:21:0;;;23279:157;;23340:15;23347:7;23340:6;:15::i;:::-;-1:-1:-1;;;;;23321:16:0;;;;;;:7;:16;;;;;;;;:34;;;;23404:20;;23370:22;:31;;;;;;:54;23279:157;23518:12;;23499:15;:31;;:54;;;;;23552:1;23534:15;;:19;23499:54;23495:569;;;23588:15;;:22;;23608:1;23588:22;:19;:22;:::i;:::-;23570:15;:40;;;23625:14;;23642:20;:64;;23695:11;;23642:64;;;23682:9;;23665:12;;:27;;;:16;:27;:::i;:::-;23721:12;;:40;;;-1:-1:-1;;;23721:40:0;;23747:4;23721:40;;;;;;;;;;;;;;-1:-1:-1;;;;;;23721:12:0;;;;-1:-1:-1;;23721:40:0;;;;;-1:-1:-1;;23721:40:0;;;;;;;;-1:-1:-1;23721:12:0;:40;;;5:2:-1;;;;30:1;27;20:12;5:2;23721:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;23788:9:0;;:21;;-1:-1:-1;23788:9:0;-1:-1:-1;23802:6:0;23788:21;:13;:21;:::i;:::-;23776:9;:33;23848:15;;23837:27;;:6;;:27;:10;:27;:::i;:::-;23824:10;:40;23914:15;;23894:36;;:15;;:36;:19;:36;:::i;:::-;23879:12;:51;23959:15;;:54;;24012:1;23959:54;;;23981:28;24005:3;23981:19;23997:2;23981:11;;:15;;:19;;;;:::i;:28::-;23945:11;:68;24033:19;;;;;;;;-1:-1:-1;;;;;;;;;;;24033:19:0;;;;;;;;23495:569;;24149:9;;24131:15;:27;24123:48;;;;;-1:-1:-1;;;24123:48:0;;;;;;;;;;;;-1:-1:-1;;;24123:48:0;;;;;;;;;;;;;;;20965:1;20956:6;:10;20948:37;;;;;-1:-1:-1;;;20948:37:0;;;;;;;;;;;;-1:-1:-1;;;20948:37:0;;;;;;;;;;;;;;;21011:12;;:24;;21028:6;21011:24;:16;:24;:::i;:::-;20996:12;:39;21080:10;21070:21;;;;:9;:21;;;;;;:33;;21096:6;21070:33;:25;:33;:::i;:::-;21056:10;21046:21;;;;:9;:21;;;;;:57;;;;21114:12;;:64;;-1:-1:-1;;;;;21114:12:0;;;;21164:4;21171:6;21114:29;:64::i;:::-;21194:26;;;;;;;;21201:10;;21194:26;;;;;;;;;;17271:1;17307:13;;17291:12;:29;17283:73;;;;;-1:-1:-1;;;17283:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;18727:29;;;;:::o;20110:330::-;20157:7;20181:12;;20197:1;20181:17;20177:77;;;-1:-1:-1;20222:20:0;;20215:27;;20177:77;20284:148;20327:90;20404:12;;20327:72;20394:4;20327:62;20378:10;;20327:46;20358:14;;20327:26;:24;:26::i;:46::-;:50;:62;:50;:62;:::i;:90::-;20284:20;;;:148;:24;:148;:::i;18541:26::-;;;-1:-1:-1;;;;;18541:26:0;;:::o;18763:35::-;;;;:::o;18953:28::-;;;;:::o;18607:31::-;;;;:::o;6597:184::-;6655:7;6688:1;6683;:6;;6675:49;;;;;-1:-1:-1;;;6675:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6747:5:0;;;6597:184::o;7032:470::-;7090:7;7334:6;7330:47;;-1:-1:-1;7364:1:0;7357:8;;7330:47;7401:5;;;7405:1;7401;:5;:1;7425:5;;;;;:10;7417:56;;;;-1:-1:-1;;;7417:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7493:1;7032:470;-1:-1:-1;;;7032:470:0:o;7970:333::-;8028:7;8127:1;8123;:5;8115:44;;;;;-1:-1:-1;;;8115:44:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;8170:9;8186:1;8182;:5;;;;;;;7970:333;-1:-1:-1;;;;7970:333:0:o;6141:181::-;6199:7;6231:5;;;6255:6;;;;6247:46;;;;;-1:-1:-1;;;6247:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;12774:176;12883:58;;;-1:-1:-1;;;;;12883:58:0;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;12883:58:0;;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;12857:85:0;;12876:5;;12857:18;:85::i;:::-;12774:176;;;:::o;9266:106::-;9324:7;9355:1;9351;:5;:13;;9363:1;9351:13;;;-1:-1:-1;9359:1:0;;9344:20;-1:-1:-1;9266:106:0:o;12958:204::-;13085:68;;;-1:-1:-1;;;;;13085:68:0;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;13085:68:0;;;;;;;;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;13059:95:0;;13078:5;;13059:18;:95::i;:::-;12958:204;;;;:::o;14768:1114::-;15372:27;-1:-1:-1;;;;;15372:25:0;;;:27::i;:::-;15364:71;;;;;-1:-1:-1;;;15364:71:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;15509:12;15523:23;15558:5;-1:-1:-1;;;;;15550:19:0;15570:4;15550:25;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;15550:25:0;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;15508:67:0;;;;15594:7;15586:52;;;;;-1:-1:-1;;;15586:52:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15655:17;;:21;15651:224;;15797:10;15786:30;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;15786:30:0;15778:85;;;;-1:-1:-1;;;15778:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11787:422;12154:20;12193:8;;;11787:422::o

Swarm Source

bzzr://c0121458810aa31dcd6770f08096c15e37d591a2d1d39ce2c1baf5471c128976
Block Transaction Gas Used Reward
Age Block Fee Address Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading