ETH Price: $2,508.14 (+0.67%)

Contract

0x06ee68E690290A1d51a353Cd1D66ec70540C53fc
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Get Reward156550632022-10-01 18:22:35758 days ago1664648555IN
0x06ee68E6...0540C53fc
0 ETH0.000533376.08676445
Get Reward136562772021-11-21 5:20:101072 days ago1637472010IN
0x06ee68E6...0540C53fc
0 ETH0.0059737884.70083488
Withdraw135460812021-11-03 20:34:031089 days ago1635971643IN
0x06ee68E6...0540C53fc
0 ETH0.01678263154.79421534
Withdraw133987332021-10-11 17:57:081113 days ago1633975028IN
0x06ee68E6...0540C53fc
0 ETH0.01503691175.44556061
Get Reward133987272021-10-11 17:54:361113 days ago1633974876IN
0x06ee68E6...0540C53fc
0 ETH0.01322962143.06471487
Withdraw132518192021-09-18 20:23:211135 days ago1631996601IN
0x06ee68E6...0540C53fc
0 ETH0.0045110252.63304309
Get Reward132518122021-09-18 20:21:501135 days ago1631996510IN
0x06ee68E6...0540C53fc
0 ETH0.0031674241.55689949
Get Reward132355192021-09-16 7:50:001138 days ago1631778600IN
0x06ee68E6...0540C53fc
0 ETH0.0036953952.39615528
Withdraw132103662021-09-12 10:20:511142 days ago1631442051IN
0x06ee68E6...0540C53fc
0 ETH0.0064265159.27476595
Get Reward131929912021-09-09 17:54:311145 days ago1631210071IN
0x06ee68E6...0540C53fc
0 ETH0.00727698103.17872841
Withdraw131929642021-09-09 17:49:511145 days ago1631209791IN
0x06ee68E6...0540C53fc
0 ETH0.01095754101.06665249
Get Reward131336982021-08-31 13:55:201154 days ago1630418120IN
0x06ee68E6...0540C53fc
0 ETH0.0067001695
Withdraw131336982021-08-31 13:55:201154 days ago1630418120IN
0x06ee68E6...0540C53fc
0 ETH0.0107322999
Withdraw131167122021-08-28 22:57:121156 days ago1630191432IN
0x06ee68E6...0540C53fc
0 ETH0.0067500362.25875293
Withdraw131141222021-08-28 13:22:431157 days ago1630156963IN
0x06ee68E6...0540C53fc
0 ETH0.0053145762
Get Reward131141132021-08-28 13:21:271157 days ago1630156887IN
0x06ee68E6...0540C53fc
0 ETH0.0033503871.38350445
Get Reward130913132021-08-25 0:28:511160 days ago1629851331IN
0x06ee68E6...0540C53fc
0 ETH0.0038691754.86013578
Withdraw130912672021-08-25 0:19:531160 days ago1629850793IN
0x06ee68E6...0540C53fc
0 ETH0.0080035173.82842551
Withdraw130724452021-08-22 2:36:251163 days ago1629599785IN
0x06ee68E6...0540C53fc
0 ETH0.0018010921.01158321
Get Reward130724362021-08-22 2:34:231163 days ago1629599663IN
0x06ee68E6...0540C53fc
0 ETH0.0018368219.86337501
Withdraw130707912021-08-21 20:34:271163 days ago1629578067IN
0x06ee68E6...0540C53fc
0 ETH0.0033572839.16622
Withdraw130631542021-08-20 16:18:091165 days ago1629476289IN
0x06ee68E6...0540C53fc
0 ETH0.0042175638.90056312
Withdraw130482832021-08-18 8:56:241167 days ago1629276984IN
0x06ee68E6...0540C53fc
0 ETH0.0033430439
Get Reward130482682021-08-18 8:51:591167 days ago1629276719IN
0x06ee68E6...0540C53fc
0 ETH0.0032011942
Withdraw130482412021-08-18 8:46:281167 days ago1629276388IN
0x06ee68E6...0540C53fc
0 ETH0.0029140334
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
125695682021-06-04 18:09:501242 days ago1622830190  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingRewards

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-06-04
*/

/**
 *Submitted for verification at Etherscan.io on 2021-05-29
*/

/**
 *Submitted for verification at Etherscan.io on 2021-03-08
*/

// File: openzeppelin-solidity-2.3.0/contracts/token/ERC20/IERC20.sol

pragma solidity ^0.5.0;

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

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

    /**
     * @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: openzeppelin-solidity-2.3.0/contracts/ownership/Ownable.sol

pragma solidity ^0.5.0;

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

// File: openzeppelin-solidity-2.3.0/contracts/math/Math.sol

pragma solidity ^0.5.0;

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

// File: openzeppelin-solidity-2.3.0/contracts/math/SafeMath.sol

pragma solidity ^0.5.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) {
        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;
    }
}

// File: openzeppelin-solidity-2.3.0/contracts/token/ERC20/ERC20Detailed.sol

pragma solidity ^0.5.0;


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

// File: openzeppelin-solidity-2.3.0/contracts/utils/Address.sol

pragma solidity ^0.5.0;

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

// File: openzeppelin-solidity-2.3.0/contracts/token/ERC20/SafeERC20.sol

pragma solidity ^0.5.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");
        }
    }
}

// File: openzeppelin-solidity-2.3.0/contracts/utils/ReentrancyGuard.sol

pragma solidity ^0.5.0;

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

// File: contracts/interfaces/IStakingRewards.sol

pragma solidity >=0.4.24;


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;

    function exit() external;
}

// File: contracts/RewardsDistributionRecipient.sol

pragma solidity ^0.5.16;

contract RewardsDistributionRecipient {
    address public rewardsDistribution;

    function notifyRewardAmount(uint256 reward) external;

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

// File: contracts/StakingRewards.sol

pragma solidity ^0.5.16;






// Inheritance



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;

    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
    ) public {
        rewardsToken = IERC20(_rewardsToken);
        stakingToken = IERC20(_stakingToken);
        rewardsDistribution = _rewardsDistribution;
    }

    /* ========== 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) {
        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) {
        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) {
        uint256 reward = rewards[msg.sender];
        if (reward > 0) {
            rewards[msg.sender] = 0;
            rewardsToken.safeTransfer(msg.sender, reward);
            emit RewardPaid(msg.sender, reward);
        }
    }

    function exit() external {
        withdraw(_balances[msg.sender]);
        getReward();
    }

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

    function notifyRewardAmount(uint256 reward) external onlyRewardsDistribution updateReward(address(0)) {
        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);
        }

        // Ensure the provided reward amount is not more than the balance in the contract.
        // This keeps the reward rate in the right range, preventing overflows due to
        // very high values of rewardRate in the earned and rewardsPerToken functions;
        // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow.
        uint balance = rewardsToken.balanceOf(address(this));
        require(rewardRate <= balance.div(rewardsDuration), "Provided reward too high");

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

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

// File: contracts/StakingRewardsFactory.sol

pragma solidity ^0.5.16;




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

    // 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,
        uint _stakingRewardsGenesis
    ) Ownable() public {
        require(_stakingRewardsGenesis >= block.timestamp, 'StakingRewardsFactory::constructor: genesis too soon');

        rewardsToken = _rewardsToken;
        stakingRewardsGenesis = _stakingRewardsGenesis;
    }

    ///// permissioned functions

    // deploy a staking reward contract for the staking token, and store the reward amount
    // the reward will be distributed to the staking reward contract no sooner than the genesis
    function deploy(address stakingToken, uint rewardAmount) 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));
        info.rewardAmount = rewardAmount;
        stakingTokens.push(stakingToken);
    }

    ///// permissionless functions

    // call notifyRewardAmount for all staking tokens.
    function notifyRewardAmounts() public {
        require(stakingTokens.length > 0, 'StakingRewardsFactory::notifyRewardAmounts: called before any deploys');
        for (uint i = 0; i < stakingTokens.length; i++) {
            notifyRewardAmount(stakingTokens[i]);
        }
    }

    // notify reward amount for an individual staking token.
    // this is a fallback in case the notifyRewardAmounts costs too much gas to call for all contracts
    function notifyRewardAmount(address stakingToken) public {
        require(block.timestamp >= stakingRewardsGenesis, 'StakingRewardsFactory::notifyRewardAmount: not ready');

        StakingRewardsInfo storage info = stakingRewardsInfoByStakingToken[stakingToken];
        require(info.stakingRewards != address(0), 'StakingRewardsFactory::notifyRewardAmount: not deployed');

        if (info.rewardAmount > 0) {
            uint rewardAmount = info.rewardAmount;
            info.rewardAmount = 0;

            require(
                IERC20(rewardsToken).transfer(info.stakingRewards, rewardAmount),
                'StakingRewardsFactory::notifyRewardAmount: transfer failed'
            );
            StakingRewards(info.stakingRewards).notifyRewardAmount(rewardAmount);
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_rewardsDistribution","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_stakingToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"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":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":"exit","outputs":[],"payable":false,"stateMutability":"nonpayable","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":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"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":"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"}]

60806040526000600455600060055562093a8060065534801561002157600080fd5b506040516111883803806111888339818101604052606081101561004457600080fd5b508051602082015160409092015160018055600280546001600160a01b039485166001600160a01b0319918216179091556003805492851692821692909217909155600080549390921692169190911790556110e3806100a56000396000f3fe608060405234801561001057600080fd5b50600436106101765760003560e01c806372f702f3116100d8578063c8f33c911161008c578063df136d6511610066578063df136d65146102f2578063e9fad8ee146102fa578063ebe2b12b1461030257610176565b8063c8f33c91146102da578063cd3daf9d146102e2578063d1af0c7d146102ea57610176565b806380faa57d116100bd57806380faa57d1461028f5780638b87634714610297578063a694fc3a146102bd57610176565b806372f702f31461027f5780637b0a47ee1461028757610176565b8063386a95251161012f5780633d18b912116101145780633d18b9121461022d5780633fc6df6e1461023557806370a082311461025957610176565b8063386a9525146102085780633c6b16ab1461021057610176565b806318160ddd1161016057806318160ddd146101d95780631c1f78eb146101e15780632e1a7d4d146101e957610176565b80628cc2621461017b5780630700037d146101b3575b600080fd5b6101a16004803603602081101561019157600080fd5b50356001600160a01b031661030a565b60408051918252519081900360200190f35b6101a1600480360360208110156101c957600080fd5b50356001600160a01b03166103a0565b6101a16103b2565b6101a16103b9565b610206600480360360208110156101ff57600080fd5b50356103d7565b005b6101a1610584565b6102066004803603602081101561022657600080fd5b503561058a565b6102066107f4565b61023d61092a565b604080516001600160a01b039092168252519081900360200190f35b6101a16004803603602081101561026f57600080fd5b50356001600160a01b0316610939565b61023d610954565b6101a1610963565b6101a1610969565b6101a1600480360360208110156102ad57600080fd5b50356001600160a01b0316610977565b610206600480360360208110156102d357600080fd5b5035610989565b6101a1610b33565b6101a1610b39565b61023d610b93565b6101a1610ba2565b610206610ba8565b6101a1610bcb565b6001600160a01b0381166000908152600a6020908152604080832054600990925282205461039a919061038e90670de0b6b3a7640000906103829061035d90610351610b39565b9063ffffffff610bd116565b6001600160a01b0388166000908152600c60205260409020549063ffffffff610c2e16565b9063ffffffff610c8e16565b9063ffffffff610cf816565b92915050565b600a6020526000908152604090205481565b600b545b90565b60006103d2600654600554610c2e90919063ffffffff16565b905090565b60018054810190819055336103ea610b39565b6008556103f5610969565b6007556001600160a01b0381161561043c576104108161030a565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008311610491576040805162461bcd60e51b815260206004820152601160248201527f43616e6e6f742077697468647261772030000000000000000000000000000000604482015290519081900360640190fd5b600b546104a4908463ffffffff610bd116565b600b55336000908152600c60205260409020546104c7908463ffffffff610bd116565b336000818152600c60205260409020919091556003546104f3916001600160a01b039091169085610d52565b60408051848152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2506001548114610580576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b5050565b60065481565b6000546001600160a01b031633146105d35760405162461bcd60e51b815260040180806020018281038252602a81526020018061105b602a913960400191505060405180910390fd5b60006105dd610b39565b6008556105e8610969565b6007556001600160a01b0381161561062f576106038161030a565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60045442106106545760065461064c90839063ffffffff610c8e16565b6005556106a3565b60045460009061066a904263ffffffff610bd116565b9050600061068360055483610c2e90919063ffffffff16565b60065490915061069d90610382868463ffffffff610cf816565b60055550505b600254604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561070757600080fd5b505afa15801561071b573d6000803e3d6000fd5b505050506040513d602081101561073157600080fd5b505160065490915061074a90829063ffffffff610c8e16565b60055411156107a0576040805162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f20686967680000000000000000604482015290519081900360640190fd5b4260078190556006546107b9919063ffffffff610cf816565b6004556040805184815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a1505050565b6001805481019081905533610807610b39565b600855610812610969565b6007556001600160a01b038116156108595761082d8161030a565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b336000908152600a602052604090205480156108cf57336000818152600a6020526040812055600254610898916001600160a01b039091169083610d52565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b50506001548114610927576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b50565b6000546001600160a01b031681565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b031681565b60055481565b60006103d242600454610dd7565b60096020526000908152604090205481565b600180548101908190553361099c610b39565b6008556109a7610969565b6007556001600160a01b038116156109ee576109c28161030a565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008311610a43576040805162461bcd60e51b815260206004820152600e60248201527f43616e6e6f74207374616b652030000000000000000000000000000000000000604482015290519081900360640190fd5b600b54610a56908463ffffffff610cf816565b600b55336000908152600c6020526040902054610a79908463ffffffff610cf816565b336000818152600c6020526040902091909155600354610aa6916001600160a01b03909116903086610ded565b60408051848152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2506001548114610580576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60075481565b6000600b5460001415610b4f57506008546103b6565b6103d2610b84600b54610382670de0b6b3a7640000610b78600554610b78600754610351610969565b9063ffffffff610c2e16565b6008549063ffffffff610cf816565b6002546001600160a01b031681565b60085481565b336000908152600c6020526040902054610bc1906103d7565b610bc96107f4565b565b60045481565b600082821115610c28576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082610c3d5750600061039a565b82820282848281610c4a57fe5b0414610c875760405162461bcd60e51b815260040180806020018281038252602181526020018061103a6021913960400191505060405180910390fd5b9392505050565b6000808211610ce4576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481610cef57fe5b04949350505050565b600082820183811015610c87576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610dd2908490610e7b565b505050565b6000818310610de65781610c87565b5090919050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610e75908590610e7b565b50505050565b610e8d826001600160a01b0316611033565b610ede576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610f1c5780518252601f199092019160209182019101610efd565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610f7e576040519150601f19603f3d011682016040523d82523d6000602084013e610f83565b606091505b509150915081610fda576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610e7557808060200190516020811015610ff657600080fd5b5051610e755760405162461bcd60e51b815260040180806020018281038252602a815260200180611085602a913960400191505060405180910390fd5b3b15159056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616c6c6572206973206e6f742052657761726473446973747269627574696f6e20636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a7231582052f7b49387150402c0b680044261604cbd0d36e6c092960f34eb86f97a4e3df164736f6c6343000510003200000000000000000000000068eadc093642fb377c01856e7dc5b5fee37bcbbe000000000000000000000000d23ac27148af6a2f339bd82d0e3cff380b5093de00000000000000000000000030045ad74f4475e82dcdc269952581ecb7cd2bad

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101765760003560e01c806372f702f3116100d8578063c8f33c911161008c578063df136d6511610066578063df136d65146102f2578063e9fad8ee146102fa578063ebe2b12b1461030257610176565b8063c8f33c91146102da578063cd3daf9d146102e2578063d1af0c7d146102ea57610176565b806380faa57d116100bd57806380faa57d1461028f5780638b87634714610297578063a694fc3a146102bd57610176565b806372f702f31461027f5780637b0a47ee1461028757610176565b8063386a95251161012f5780633d18b912116101145780633d18b9121461022d5780633fc6df6e1461023557806370a082311461025957610176565b8063386a9525146102085780633c6b16ab1461021057610176565b806318160ddd1161016057806318160ddd146101d95780631c1f78eb146101e15780632e1a7d4d146101e957610176565b80628cc2621461017b5780630700037d146101b3575b600080fd5b6101a16004803603602081101561019157600080fd5b50356001600160a01b031661030a565b60408051918252519081900360200190f35b6101a1600480360360208110156101c957600080fd5b50356001600160a01b03166103a0565b6101a16103b2565b6101a16103b9565b610206600480360360208110156101ff57600080fd5b50356103d7565b005b6101a1610584565b6102066004803603602081101561022657600080fd5b503561058a565b6102066107f4565b61023d61092a565b604080516001600160a01b039092168252519081900360200190f35b6101a16004803603602081101561026f57600080fd5b50356001600160a01b0316610939565b61023d610954565b6101a1610963565b6101a1610969565b6101a1600480360360208110156102ad57600080fd5b50356001600160a01b0316610977565b610206600480360360208110156102d357600080fd5b5035610989565b6101a1610b33565b6101a1610b39565b61023d610b93565b6101a1610ba2565b610206610ba8565b6101a1610bcb565b6001600160a01b0381166000908152600a6020908152604080832054600990925282205461039a919061038e90670de0b6b3a7640000906103829061035d90610351610b39565b9063ffffffff610bd116565b6001600160a01b0388166000908152600c60205260409020549063ffffffff610c2e16565b9063ffffffff610c8e16565b9063ffffffff610cf816565b92915050565b600a6020526000908152604090205481565b600b545b90565b60006103d2600654600554610c2e90919063ffffffff16565b905090565b60018054810190819055336103ea610b39565b6008556103f5610969565b6007556001600160a01b0381161561043c576104108161030a565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008311610491576040805162461bcd60e51b815260206004820152601160248201527f43616e6e6f742077697468647261772030000000000000000000000000000000604482015290519081900360640190fd5b600b546104a4908463ffffffff610bd116565b600b55336000908152600c60205260409020546104c7908463ffffffff610bd116565b336000818152600c60205260409020919091556003546104f3916001600160a01b039091169085610d52565b60408051848152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2506001548114610580576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b5050565b60065481565b6000546001600160a01b031633146105d35760405162461bcd60e51b815260040180806020018281038252602a81526020018061105b602a913960400191505060405180910390fd5b60006105dd610b39565b6008556105e8610969565b6007556001600160a01b0381161561062f576106038161030a565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60045442106106545760065461064c90839063ffffffff610c8e16565b6005556106a3565b60045460009061066a904263ffffffff610bd116565b9050600061068360055483610c2e90919063ffffffff16565b60065490915061069d90610382868463ffffffff610cf816565b60055550505b600254604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561070757600080fd5b505afa15801561071b573d6000803e3d6000fd5b505050506040513d602081101561073157600080fd5b505160065490915061074a90829063ffffffff610c8e16565b60055411156107a0576040805162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f20686967680000000000000000604482015290519081900360640190fd5b4260078190556006546107b9919063ffffffff610cf816565b6004556040805184815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a1505050565b6001805481019081905533610807610b39565b600855610812610969565b6007556001600160a01b038116156108595761082d8161030a565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b336000908152600a602052604090205480156108cf57336000818152600a6020526040812055600254610898916001600160a01b039091169083610d52565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b50506001548114610927576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b50565b6000546001600160a01b031681565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b031681565b60055481565b60006103d242600454610dd7565b60096020526000908152604090205481565b600180548101908190553361099c610b39565b6008556109a7610969565b6007556001600160a01b038116156109ee576109c28161030a565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008311610a43576040805162461bcd60e51b815260206004820152600e60248201527f43616e6e6f74207374616b652030000000000000000000000000000000000000604482015290519081900360640190fd5b600b54610a56908463ffffffff610cf816565b600b55336000908152600c6020526040902054610a79908463ffffffff610cf816565b336000818152600c6020526040902091909155600354610aa6916001600160a01b03909116903086610ded565b60408051848152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2506001548114610580576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60075481565b6000600b5460001415610b4f57506008546103b6565b6103d2610b84600b54610382670de0b6b3a7640000610b78600554610b78600754610351610969565b9063ffffffff610c2e16565b6008549063ffffffff610cf816565b6002546001600160a01b031681565b60085481565b336000908152600c6020526040902054610bc1906103d7565b610bc96107f4565b565b60045481565b600082821115610c28576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082610c3d5750600061039a565b82820282848281610c4a57fe5b0414610c875760405162461bcd60e51b815260040180806020018281038252602181526020018061103a6021913960400191505060405180910390fd5b9392505050565b6000808211610ce4576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481610cef57fe5b04949350505050565b600082820183811015610c87576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610dd2908490610e7b565b505050565b6000818310610de65781610c87565b5090919050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052610e75908590610e7b565b50505050565b610e8d826001600160a01b0316611033565b610ede576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610f1c5780518252601f199092019160209182019101610efd565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610f7e576040519150601f19603f3d011682016040523d82523d6000602084013e610f83565b606091505b509150915081610fda576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610e7557808060200190516020811015610ff657600080fd5b5051610e755760405162461bcd60e51b815260040180806020018281038252602a815260200180611085602a913960400191505060405180910390fd5b3b15159056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616c6c6572206973206e6f742052657761726473446973747269627574696f6e20636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a7231582052f7b49387150402c0b680044261604cbd0d36e6c092960f34eb86f97a4e3df164736f6c63430005100032

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

00000000000000000000000068eadc093642fb377c01856e7dc5b5fee37bcbbe000000000000000000000000d23ac27148af6a2f339bd82d0e3cff380b5093de00000000000000000000000030045ad74f4475e82dcdc269952581ecb7cd2bad

-----Decoded View---------------
Arg [0] : _rewardsDistribution (address): 0x68EadC093642FB377c01856e7dC5b5FEe37bcbbe
Arg [1] : _rewardsToken (address): 0xD23Ac27148aF6A2f339BD82D0e3CFF380b5093de
Arg [2] : _stakingToken (address): 0x30045ad74f4475E82DcDC269952581ECb7CD2bAd

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000068eadc093642fb377c01856e7dc5b5fee37bcbbe
Arg [1] : 000000000000000000000000d23ac27148af6a2f339bd82d0e3cff380b5093de
Arg [2] : 00000000000000000000000030045ad74f4475e82dcdc269952581ecb7cd2bad


Deployed Bytecode Sourcemap

19400:5102:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;19400:5102:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21164:198;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21164:198:0;-1:-1:-1;;;;;21164:198:0;;:::i;:::-;;;;;;;;;;;;;;;;19946:42;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19946:42:0;-1:-1:-1;;;;;19946:42:0;;:::i;20466:93::-;;;:::i;21370:121::-;;;:::i;21930:357::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21930:357:0;;:::i;:::-;;19756:39;;;:::i;22771:1083::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;22771:1083:0;;:::i;22295:307::-;;;:::i;19034:34::-;;;:::i;:::-;;;;-1:-1:-1;;;;;19034:34:0;;;;;;;;;;;;;;20567:112;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;20567:112:0;-1:-1:-1;;;;;20567:112:0;;:::i;19649:26::-;;;:::i;19720:29::-;;;:::i;20687:131::-;;;:::i;19882:57::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;19882:57:0;-1:-1:-1;;;;;19882:57:0;;:::i;21553:369::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;21553:369:0;;:::i;19802:29::-;;;:::i;20826:330::-;;;:::i;19616:26::-;;;:::i;19838:35::-;;;:::i;22610:97::-;;;:::i;19682:31::-;;;:::i;21164:198::-;-1:-1:-1;;;;;21337:16:0;;21218:7;21337:16;;;:7;:16;;;;;;;;;21289:22;:31;;;;;;21245:109;;21337:16;21245:87;;21327:4;;21245:77;;21268:53;;:16;:14;:16::i;:::-;:20;:53;:20;:53;:::i;:::-;-1:-1:-1;;;;;21245:18:0;;;;;;:9;:18;;;;;;;:22;:77::i;:::-;:81;:87;:81;:87;:::i;:::-;:91;:109;:91;:109;:::i;:::-;21238:116;21164:198;-1:-1:-1;;21164:198:0:o;19946:42::-;;;;;;;;;;;;;:::o;20466:93::-;20539:12;;20466:93;;:::o;21370:121::-;21425:7;21452:31;21467:15;;21452:10;;:14;;:31;;;;:::i;:::-;21445:38;;21370:121;:::o;21930:357::-;18002:1;17985:18;;;;;;;;21997:10;23980:16;:14;:16::i;:::-;23957:20;:39;24024:26;:24;:26::i;:::-;24007:14;:43;-1:-1:-1;;;;;24065:21:0;;;24061:157;;24122:15;24129:7;24122:6;:15::i;:::-;-1:-1:-1;;;;;24103:16:0;;;;;;:7;:16;;;;;;;;:34;;;;24186:20;;24152:22;:31;;;;;;:54;24061:157;22037:1;22028:6;:10;22020:40;;;;;-1:-1:-1;;;22020:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;22086:12;;:24;;22103:6;22086:24;:16;:24;:::i;:::-;22071:12;:39;22155:10;22145:21;;;;:9;:21;;;;;;:33;;22171:6;22145:33;:25;:33;:::i;:::-;22131:10;22121:21;;;;:9;:21;;;;;:57;;;;22189:12;;:45;;-1:-1:-1;;;;;22189:12:0;;;;22227:6;22189:25;:45::i;:::-;22250:29;;;;;;;;22260:10;;22250:29;;;;;;;;;;18061:1;18097:13;;18081:12;:29;18073:73;;;;;-1:-1:-1;;;18073:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;21930:357;;:::o;19756:39::-;;;;:::o;22771:1083::-;19206:19;;-1:-1:-1;;;;;19206:19:0;19192:10;:33;19184:88;;;;-1:-1:-1;;;19184:88:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22869:1;23980:16;:14;:16::i;:::-;23957:20;:39;24024:26;:24;:26::i;:::-;24007:14;:43;-1:-1:-1;;;;;24065:21:0;;;24061:157;;24122:15;24129:7;24122:6;:15::i;:::-;-1:-1:-1;;;;;24103:16:0;;;;;;:7;:16;;;;;;;;:34;;;;24186:20;;24152:22;:31;;;;;;:54;24061:157;22907:12;;22888:15;:31;22884:318;;22960:15;;22949:27;;:6;;:27;:10;:27;:::i;:::-;22936:10;:40;22884:318;;;23029:12;;23009:17;;23029:33;;23046:15;23029:33;:16;:33;:::i;:::-;23009:53;;23077:16;23096:25;23110:10;;23096:9;:13;;:25;;;;:::i;:::-;23174:15;;23077:44;;-1:-1:-1;23149:41:0;;:20;:6;23077:44;23149:20;:10;:20;:::i;:41::-;23136:10;:54;-1:-1:-1;;22884:318:0;23577:12;;:37;;;;;;23608:4;23577:37;;;;;;-1:-1:-1;;;;;;;23577:12:0;;:22;;:37;;;;;;;;;;;;;;:12;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;23577:37:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;23577:37:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;23577:37:0;23659:15;;23577:37;;-1:-1:-1;23647:28:0;;23577:37;;23647:28;:11;:28;:::i;:::-;23633:10;;:42;;23625:79;;;;;-1:-1:-1;;;23625:79:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;23734:15;23717:14;:32;;;23795:15;;23775:36;;23734:15;23775:36;:19;:36;:::i;:::-;23760:12;:51;23827:19;;;;;;;;;;;;;;;;;24228:1;19283;22771:1083;:::o;22295:307::-;18002:1;17985:18;;;;;;;;22349:10;23980:16;:14;:16::i;:::-;23957:20;:39;24024:26;:24;:26::i;:::-;24007:14;:43;-1:-1:-1;;;;;24065:21:0;;;24061:157;;24122:15;24129:7;24122:6;:15::i;:::-;-1:-1:-1;;;;;24103:16:0;;;;;;:7;:16;;;;;;;;:34;;;;24186:20;;24152:22;:31;;;;;;:54;24061:157;22397:10;22372:14;22389:19;;;:7;:19;;;;;;22423:10;;22419:176;;22458:10;22472:1;22450:19;;;:7;:19;;;;;:23;22488:12;;:45;;-1:-1:-1;;;;;22488:12:0;;;;22526:6;22488:25;:45::i;:::-;22553:30;;;;;;;;22564:10;;22553:30;;;;;;;;;;22419:176;24228:1;18061;18097:13;;18081:12;:29;18073:73;;;;;-1:-1:-1;;;18073:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;22295:307;:::o;19034:34::-;;;-1:-1:-1;;;;;19034:34:0;;:::o;20567:112::-;-1:-1:-1;;;;;20653:18:0;20626:7;20653:18;;;:9;:18;;;;;;;20567:112::o;19649:26::-;;;-1:-1:-1;;;;;19649:26:0;;:::o;19720:29::-;;;;:::o;20687:131::-;20744:7;20771:39;20780:15;20797:12;;20771:8;:39::i;19882:57::-;;;;;;;;;;;;;:::o;21553:369::-;18002:1;17985:18;;;;;;;;21619:10;23980:16;:14;:16::i;:::-;23957:20;:39;24024:26;:24;:26::i;:::-;24007:14;:43;-1:-1:-1;;;;;24065:21:0;;;24061:157;;24122:15;24129:7;24122:6;:15::i;:::-;-1:-1:-1;;;;;24103:16:0;;;;;;:7;:16;;;;;;;;:34;;;;24186:20;;24152:22;:31;;;;;;:54;24061:157;21659:1;21650:6;:10;21642:37;;;;;-1:-1:-1;;;21642:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;21705:12;;:24;;21722:6;21705:24;:16;:24;:::i;:::-;21690:12;:39;21774:10;21764:21;;;;:9;:21;;;;;;:33;;21790:6;21764:33;:25;:33;:::i;:::-;21750:10;21740:21;;;;:9;:21;;;;;:57;;;;21808:12;;:64;;-1:-1:-1;;;;;21808:12:0;;;;21858:4;21865:6;21808:29;:64::i;:::-;21888:26;;;;;;;;21895:10;;21888:26;;;;;;;;;;18061:1;18097:13;;18081:12;:29;18073:73;;;;;-1:-1:-1;;;18073:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;19802:29;;;;:::o;20826:330::-;20873:7;20897:12;;20913:1;20897:17;20893:77;;;-1:-1:-1;20938:20:0;;20931:27;;20893:77;21000:148;21043:90;21120:12;;21043:72;21110:4;21043:62;21094:10;;21043:46;21074:14;;21043:26;:24;:26::i;:46::-;:50;:62;:50;:62;:::i;:90::-;21000:20;;;:148;:24;:148;:::i;19616:26::-;;;-1:-1:-1;;;;;19616:26:0;;:::o;19838:35::-;;;;:::o;22610:97::-;22665:10;22655:21;;;;:9;:21;;;;;;22646:31;;:8;:31::i;:::-;22688:11;:9;:11::i;:::-;22610:97::o;19682:31::-;;;;:::o;7743:184::-;7801:7;7834:1;7829;:6;;7821:49;;;;;-1:-1:-1;;;7821:49:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7893:5:0;;;7743:184::o;8178:470::-;8236:7;8480:6;8476:47;;-1:-1:-1;8510:1:0;8503:8;;8476:47;8547:5;;;8551:1;8547;:5;:1;8571:5;;;;;:10;8563:56;;;;-1:-1:-1;;;8563:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8639:1;8178:470;-1:-1:-1;;;8178:470:0:o;9116:333::-;9174:7;9273:1;9269;:5;9261:44;;;;;-1:-1:-1;;;9261:44:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;9316:9;9332:1;9328;:5;;;;;;;9116:333;-1:-1:-1;;;;9116:333:0:o;7287:181::-;7345:7;7377:5;;;7401:6;;;;7393:46;;;;;-1:-1:-1;;;7393:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;13461:176;13570:58;;;-1:-1:-1;;;;;13570:58:0;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;13570:58:0;;;;;;;;25:18:-1;;61:17;;13570:58:0;182:15:-1;13593:23:0;179:29:-1;160:49;;13544:85:0;;13563:5;;13544:18;:85::i;:::-;13461:176;;;:::o;5935:106::-;5993:7;6024:1;6020;:5;:13;;6032:1;6020:13;;;-1:-1:-1;6028:1:0;;6013:20;-1:-1:-1;5935:106:0:o;13645:204::-;13772:68;;;-1:-1:-1;;;;;13772:68:0;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;13772:68:0;;;;;;;;25:18:-1;;61:17;;13772:68:0;182:15:-1;13795:27:0;179:29:-1;160:49;;13746:95:0;;13765:5;;13746:18;:95::i;:::-;13645:204;;;;:::o;15455:1114::-;16059:27;-1:-1:-1;;;;;16059:25:0;;;:27::i;:::-;16051:71;;;;;-1:-1:-1;;;16051:71:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;16196:12;16210:23;16245:5;-1:-1:-1;;;;;16237:19:0;16257:4;16237: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;;;16237: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;;16195:67:0;;;;16281:7;16273:52;;;;;-1:-1:-1;;;16273:52:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16342:17;;:21;16338:224;;16484:10;16473:30;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;16473:30:0;16465:85;;;;-1:-1:-1;;;16465:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12365:422;12732:20;12771:8;;;12365:422::o

Swarm Source

bzzr://52f7b49387150402c0b680044261604cbd0d36e6c092960f34eb86f97a4e3df1

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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