ETH Price: $2,945.47 (-6.71%)
Gas: 7 Gwei

Contract

0x8f06FBA4684B5E0988F215a47775Bb611Af0F986
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Exit132072522021-09-11 22:52:141027 days ago1631400734IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0060586251.03336078
Exit131185562021-08-29 5:37:011041 days ago1630215421IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0058172349
Exit130660052021-08-21 2:30:311049 days ago1629513031IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0027705931
Exit127943182021-07-09 16:49:181091 days ago1625849358IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0026249521
Exit127394562021-07-01 3:39:401100 days ago1625110780IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0021249617
Exit126919852021-06-23 18:28:291107 days ago1624472909IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0019999616
Exit126362042021-06-15 1:52:541116 days ago1623721974IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.000749986
Exit125672172021-06-04 9:42:251127 days ago1622799745IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0027499522
Exit125603832021-06-03 8:09:391128 days ago1622707779IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0026249521.00000145
Exit125551882021-06-02 12:48:001128 days ago1622638080IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0027374521.9
Exit123476232021-05-01 10:07:181161 days ago1619863638IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0034374427.5
Exit123446202021-04-30 22:48:541161 days ago1619822934IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.001832438.5
Exit123446022021-04-30 22:44:341161 days ago1619822674IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0048124238.5
Exit123393022021-04-30 2:58:521162 days ago1619751532IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0046892333
Exit123387422021-04-30 0:53:511162 days ago1619744031IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0047499238
Exit123160572021-04-26 12:57:281165 days ago1619441848IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0048749239
Exit123079682021-04-25 7:02:411167 days ago1619334161IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0046249237
Exit122920672021-04-22 20:05:101169 days ago1619121910IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.01262479101
Exit121972472021-04-08 5:18:381184 days ago1617859118IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.0122376286
Exit121429382021-03-30 20:53:221192 days ago1617137602IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.01678296131.84
Exit121236622021-03-27 21:56:421195 days ago1616882202IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.01867271142
Exit121119452021-03-26 2:37:011197 days ago1616726221IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.01807184127
Exit120470992021-03-16 2:50:121207 days ago1615863012IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.01527576120
Exit120432892021-03-15 12:54:471207 days ago1615812887IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.02689432189.00000145
Exit120357772021-03-14 9:03:111209 days ago1615712591IN
Index Protocol: Initial Liquidity Mining Rewards
0 ETH0.01622197114
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingRewards

Compiler Version
v0.6.10+commit.00c0fcaf

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-10-06
*/

// Dependency file: @openzeppelin/contracts/utils/Address.sol



// pragma solidity ^0.6.2;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [// importANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies 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;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * // importANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

// Dependency file: contracts/staking/RewardsDistributionRecipient.sol

// pragma solidity ^0.6.10;

abstract contract RewardsDistributionRecipient {
    address public rewardsDistribution;

    function notifyRewardAmount(uint256 reward) external virtual;

    modifier onlyRewardsDistribution() {
        require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract");
        _;
    }
}
// Dependency file: @openzeppelin/contracts/utils/ReentrancyGuard.sol



// pragma solidity ^0.6.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

// Dependency file: @openzeppelin/contracts/token/ERC20/SafeERC20.sol



// pragma solidity ^0.6.0;

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

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// Dependency file: @openzeppelin/contracts/math/SafeMath.sol



// pragma solidity ^0.6.0;

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

// Dependency file: @openzeppelin/contracts/math/Math.sol



// pragma solidity ^0.6.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);
    }
}

// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol



// pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * // importANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

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

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

pragma solidity ^0.6.10;

// import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
// import { Math } from  "@openzeppelin/contracts/math/Math.sol";
// import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
// import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
// import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

// Inheritance
// import { RewardsDistributionRecipient } from  "./RewardsDistributionRecipient.sol";

contract StakingRewards is 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 = 60 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 override 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);
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_rewardsDistribution","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_stakingToken","type":"address"}],"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"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDistribution","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260006004556000600555624f1a0060065534801561002157600080fd5b506040516111f33803806111f38339818101604052606081101561004457600080fd5b508051602082015160409092015160018055600280546001600160a01b039485166001600160a01b03199182161790915560038054928516928216929092179091556000805493909216921691909117905561114e806100a56000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c806372f702f3116100b8578063c8f33c911161007c578063c8f33c911461029a578063cd3daf9d146102a2578063d1af0c7d146102aa578063df136d65146102b2578063e9fad8ee146102ba578063ebe2b12b146102c257610136565b806372f702f31461023f5780637b0a47ee1461024757806380faa57d1461024f5780638b87634714610257578063a694fc3a1461027d57610136565b8063386a9525116100ff578063386a9525146101c85780633c6b16ab146101d05780633d18b912146101ed5780633fc6df6e146101f557806370a082311461021957610136565b80628cc2621461013b5780630700037d1461017357806318160ddd146101995780631c1f78eb146101a15780632e1a7d4d146101a9575b600080fd5b6101616004803603602081101561015157600080fd5b50356001600160a01b03166102ca565b60408051918252519081900360200190f35b6101616004803603602081101561018957600080fd5b50356001600160a01b0316610360565b610161610372565b610161610379565b6101c6600480360360208110156101bf57600080fd5b5035610397565b005b610161610538565b6101c6600480360360208110156101e657600080fd5b503561053e565b6101c661078f565b6101fd6108c5565b604080516001600160a01b039092168252519081900360200190f35b6101616004803603602081101561022f57600080fd5b50356001600160a01b03166108d4565b6101fd6108ef565b6101616108fe565b610161610904565b6101616004803603602081101561026d57600080fd5b50356001600160a01b0316610912565b6101c66004803603602081101561029357600080fd5b5035610924565b610161610ac3565b610161610ac9565b6101fd610b23565b610161610b32565b6101c6610b38565b610161610b5b565b6001600160a01b0381166000908152600a6020908152604080832054600990925282205461035a919061034e90670de0b6b3a7640000906103429061031d90610311610ac9565b9063ffffffff610b6116565b6001600160a01b0388166000908152600c60205260409020549063ffffffff610baa16565b9063ffffffff610c0316565b9063ffffffff610c4516565b92915050565b600a6020526000908152604090205481565b600b545b90565b6000610392600654600554610baa90919063ffffffff16565b905090565b600260015414156103ef576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336103fd610ac9565b600855610408610904565b6007556001600160a01b0381161561044f57610423816102ca565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008211610498576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b600b546104ab908363ffffffff610b6116565b600b55336000908152600c60205260409020546104ce908363ffffffff610b6116565b336000818152600c60205260409020919091556003546104fa916001600160a01b039091169084610c9f565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2505060018055565b60065481565b6000546001600160a01b031633146105875760405162461bcd60e51b815260040180806020018281038252602a8152602001806110c5602a913960400191505060405180910390fd5b6000610591610ac9565b60085561059c610904565b6007556001600160a01b038116156105e3576105b7816102ca565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60045442106106085760065461060090839063ffffffff610c0316565b600555610657565b60045460009061061e904263ffffffff610b6116565b9050600061063760055483610baa90919063ffffffff16565b60065490915061065190610342868463ffffffff610c4516565b60055550505b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156106a257600080fd5b505afa1580156106b6573d6000803e3d6000fd5b505050506040513d60208110156106cc57600080fd5b50516006549091506106e590829063ffffffff610c0316565b600554111561073b576040805162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f20686967680000000000000000604482015290519081900360640190fd5b426007819055600654610754919063ffffffff610c4516565b6004556040805184815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a1505050565b600260015414156107e7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336107f5610ac9565b600855610800610904565b6007556001600160a01b038116156108475761081b816102ca565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b336000908152600a602052604090205480156108bd57336000818152600a6020526040812055600254610886916001600160a01b039091169083610c9f565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505060018055565b6000546001600160a01b031681565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b031681565b60055481565b600061039242600454610cf6565b60096020526000908152604090205481565b6002600154141561097c576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001553361098a610ac9565b600855610995610904565b6007556001600160a01b038116156109dc576109b0816102ca565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008211610a22576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b600b54610a35908363ffffffff610c4516565b600b55336000908152600c6020526040902054610a58908363ffffffff610c4516565b336000818152600c6020526040902091909155600354610a85916001600160a01b03909116903085610d0c565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2505060018055565b60075481565b6000600b5460001415610adf5750600854610376565b610392610b14600b54610342670de0b6b3a7640000610b08600554610b08600754610311610904565b9063ffffffff610baa16565b6008549063ffffffff610c4516565b6002546001600160a01b031681565b60085481565b336000908152600c6020526040902054610b5190610397565b610b5961078f565b565b60045481565b6000610ba383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d6c565b9392505050565b600082610bb95750600061035a565b82820282848281610bc657fe5b0414610ba35760405162461bcd60e51b81526004018080602001828103825260218152602001806110a46021913960400191505060405180910390fd5b6000610ba383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e03565b600082820183811015610ba3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610cf1908490610e68565b505050565b6000818310610d055781610ba3565b5090919050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610d66908590610e68565b50505050565b60008184841115610dfb5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610dc0578181015183820152602001610da8565b50505050905090810190601f168015610ded5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610e525760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610dc0578181015183820152602001610da8565b506000838581610e5e57fe5b0495945050505050565b6060610ebd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f199092919063ffffffff16565b805190915015610cf157808060200190516020811015610edc57600080fd5b5051610cf15760405162461bcd60e51b815260040180806020018281038252602a8152602001806110ef602a913960400191505060405180910390fd5b6060610f288484600085610f30565b949350505050565b6060610f3b8561109d565b610f8c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310610fcb5780518252601f199092019160209182019101610fac565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461102d576040519150601f19603f3d011682016040523d82523d6000602084013e611032565b606091505b50915091508115611046579150610f289050565b8051156110565780518082602001fd5b60405162461bcd60e51b8152602060048201818152865160248401528651879391928392604401919085019080838360008315610dc0578181015183820152602001610da8565b3b15159056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616c6c6572206973206e6f742052657761726473446973747269627574696f6e20636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122035f9fb14248919f868692790d8291c6a206e790b1872c798f659fffdd452212e64736f6c634300060a00330000000000000000000000009467cfadc9de245010df95ec6a585a506a8ad5fc0000000000000000000000000954906da0bf32d5479e25f46056d22f08464cab0000000000000000000000004d5ef58aac27d99935e5b6b4a6778ff292059991

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101365760003560e01c806372f702f3116100b8578063c8f33c911161007c578063c8f33c911461029a578063cd3daf9d146102a2578063d1af0c7d146102aa578063df136d65146102b2578063e9fad8ee146102ba578063ebe2b12b146102c257610136565b806372f702f31461023f5780637b0a47ee1461024757806380faa57d1461024f5780638b87634714610257578063a694fc3a1461027d57610136565b8063386a9525116100ff578063386a9525146101c85780633c6b16ab146101d05780633d18b912146101ed5780633fc6df6e146101f557806370a082311461021957610136565b80628cc2621461013b5780630700037d1461017357806318160ddd146101995780631c1f78eb146101a15780632e1a7d4d146101a9575b600080fd5b6101616004803603602081101561015157600080fd5b50356001600160a01b03166102ca565b60408051918252519081900360200190f35b6101616004803603602081101561018957600080fd5b50356001600160a01b0316610360565b610161610372565b610161610379565b6101c6600480360360208110156101bf57600080fd5b5035610397565b005b610161610538565b6101c6600480360360208110156101e657600080fd5b503561053e565b6101c661078f565b6101fd6108c5565b604080516001600160a01b039092168252519081900360200190f35b6101616004803603602081101561022f57600080fd5b50356001600160a01b03166108d4565b6101fd6108ef565b6101616108fe565b610161610904565b6101616004803603602081101561026d57600080fd5b50356001600160a01b0316610912565b6101c66004803603602081101561029357600080fd5b5035610924565b610161610ac3565b610161610ac9565b6101fd610b23565b610161610b32565b6101c6610b38565b610161610b5b565b6001600160a01b0381166000908152600a6020908152604080832054600990925282205461035a919061034e90670de0b6b3a7640000906103429061031d90610311610ac9565b9063ffffffff610b6116565b6001600160a01b0388166000908152600c60205260409020549063ffffffff610baa16565b9063ffffffff610c0316565b9063ffffffff610c4516565b92915050565b600a6020526000908152604090205481565b600b545b90565b6000610392600654600554610baa90919063ffffffff16565b905090565b600260015414156103ef576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336103fd610ac9565b600855610408610904565b6007556001600160a01b0381161561044f57610423816102ca565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008211610498576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b600b546104ab908363ffffffff610b6116565b600b55336000908152600c60205260409020546104ce908363ffffffff610b6116565b336000818152600c60205260409020919091556003546104fa916001600160a01b039091169084610c9f565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2505060018055565b60065481565b6000546001600160a01b031633146105875760405162461bcd60e51b815260040180806020018281038252602a8152602001806110c5602a913960400191505060405180910390fd5b6000610591610ac9565b60085561059c610904565b6007556001600160a01b038116156105e3576105b7816102ca565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60045442106106085760065461060090839063ffffffff610c0316565b600555610657565b60045460009061061e904263ffffffff610b6116565b9050600061063760055483610baa90919063ffffffff16565b60065490915061065190610342868463ffffffff610c4516565b60055550505b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156106a257600080fd5b505afa1580156106b6573d6000803e3d6000fd5b505050506040513d60208110156106cc57600080fd5b50516006549091506106e590829063ffffffff610c0316565b600554111561073b576040805162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f20686967680000000000000000604482015290519081900360640190fd5b426007819055600654610754919063ffffffff610c4516565b6004556040805184815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a1505050565b600260015414156107e7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155336107f5610ac9565b600855610800610904565b6007556001600160a01b038116156108475761081b816102ca565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b336000908152600a602052604090205480156108bd57336000818152600a6020526040812055600254610886916001600160a01b039091169083610c9f565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505060018055565b6000546001600160a01b031681565b6001600160a01b03166000908152600c602052604090205490565b6003546001600160a01b031681565b60055481565b600061039242600454610cf6565b60096020526000908152604090205481565b6002600154141561097c576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001553361098a610ac9565b600855610995610904565b6007556001600160a01b038116156109dc576109b0816102ca565b6001600160a01b0382166000908152600a60209081526040808320939093556008546009909152919020555b60008211610a22576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b600b54610a35908363ffffffff610c4516565b600b55336000908152600c6020526040902054610a58908363ffffffff610c4516565b336000818152600c6020526040902091909155600354610a85916001600160a01b03909116903085610d0c565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2505060018055565b60075481565b6000600b5460001415610adf5750600854610376565b610392610b14600b54610342670de0b6b3a7640000610b08600554610b08600754610311610904565b9063ffffffff610baa16565b6008549063ffffffff610c4516565b6002546001600160a01b031681565b60085481565b336000908152600c6020526040902054610b5190610397565b610b5961078f565b565b60045481565b6000610ba383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d6c565b9392505050565b600082610bb95750600061035a565b82820282848281610bc657fe5b0414610ba35760405162461bcd60e51b81526004018080602001828103825260218152602001806110a46021913960400191505060405180910390fd5b6000610ba383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e03565b600082820183811015610ba3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610cf1908490610e68565b505050565b6000818310610d055781610ba3565b5090919050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610d66908590610e68565b50505050565b60008184841115610dfb5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610dc0578181015183820152602001610da8565b50505050905090810190601f168015610ded5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610e525760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610dc0578181015183820152602001610da8565b506000838581610e5e57fe5b0495945050505050565b6060610ebd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f199092919063ffffffff16565b805190915015610cf157808060200190516020811015610edc57600080fd5b5051610cf15760405162461bcd60e51b815260040180806020018281038252602a8152602001806110ef602a913960400191505060405180910390fd5b6060610f288484600085610f30565b949350505050565b6060610f3b8561109d565b610f8c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310610fcb5780518252601f199092019160209182019101610fac565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461102d576040519150601f19603f3d011682016040523d82523d6000602084013e611032565b606091505b50915091508115611046579150610f289050565b8051156110565780518082602001fd5b60405162461bcd60e51b8152602060048201818152865160248401528651879391928392604401919085019080838360008315610dc0578181015183820152602001610da8565b3b15159056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616c6c6572206973206e6f742052657761726473446973747269627574696f6e20636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122035f9fb14248919f868692790d8291c6a206e790b1872c798f659fffdd452212e64736f6c634300060a0033

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

0000000000000000000000009467cfadc9de245010df95ec6a585a506a8ad5fc0000000000000000000000000954906da0bf32d5479e25f46056d22f08464cab0000000000000000000000004d5ef58aac27d99935e5b6b4a6778ff292059991

-----Decoded View---------------
Arg [0] : _rewardsDistribution (address): 0x9467cfADC9DE245010dF95Ec6a585A506A8ad5FC
Arg [1] : _rewardsToken (address): 0x0954906da0Bf32d5479e25f46056d22f08464cab
Arg [2] : _stakingToken (address): 0x4d5ef58aAc27d99935E5b6B4A6778ff292059991

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000009467cfadc9de245010df95ec6a585a506a8ad5fc
Arg [1] : 0000000000000000000000000954906da0bf32d5479e25f46056d22f08464cab
Arg [2] : 0000000000000000000000004d5ef58aac27d99935e5b6b4a6778ff292059991


Deployed Bytecode Sourcemap

22657:5095:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24405:198;;;;;;;;;;;;;;;;-1:-1:-1;24405:198:0;-1:-1:-1;;;;;24405:198:0;;:::i;:::-;;;;;;;;;;;;;;;;23187:42;;;;;;;;;;;;;;;;-1:-1:-1;23187:42:0;-1:-1:-1;;;;;23187:42:0;;:::i;23707:93::-;;;:::i;24611:121::-;;;:::i;25171:357::-;;;;;;;;;;;;;;;;-1:-1:-1;25171:357:0;;:::i;:::-;;22996:40;;;:::i;26012:1092::-;;;;;;;;;;;;;;;;-1:-1:-1;26012:1092:0;;:::i;25536:307::-;;;:::i;6226:34::-;;;:::i;:::-;;;;-1:-1:-1;;;;;6226:34:0;;;;;;;;;;;;;;23808:112;;;;;;;;;;;;;;;;-1:-1:-1;23808:112:0;-1:-1:-1;;;;;23808:112:0;;:::i;22889:26::-;;;:::i;22960:29::-;;;:::i;23928:131::-;;;:::i;23123:57::-;;;;;;;;;;;;;;;;-1:-1:-1;23123:57:0;-1:-1:-1;;;;;23123:57:0;;:::i;24794:369::-;;;;;;;;;;;;;;;;-1:-1:-1;24794:369:0;;:::i;23043:29::-;;;:::i;24067:330::-;;;:::i;22856:26::-;;;:::i;23079:35::-;;;:::i;25851:97::-;;;:::i;22922:31::-;;;:::i;24405:198::-;-1:-1:-1;;;;;24578:16:0;;24459:7;24578:16;;;:7;:16;;;;;;;;;24530:22;:31;;;;;;24486:109;;24578:16;24486:87;;24568:4;;24486:77;;24509:53;;:16;:14;:16::i;:::-;:20;:53;:20;:53;:::i;:::-;-1:-1:-1;;;;;24486:18:0;;;;;;:9;:18;;;;;;;:77;:22;:77;:::i;:::-;:81;:87;:81;:87;:::i;:::-;:91;:109;:91;:109;:::i;:::-;24479:116;24405:198;-1:-1:-1;;24405:198:0:o;23187:42::-;;;;;;;;;;;;;:::o;23707:93::-;23780:12;;23707:93;;:::o;24611:121::-;24666:7;24693:31;24708:15;;24693:10;;:14;;:31;;;;:::i;:::-;24686:38;;24611:121;:::o;25171:357::-;8246:1;8852:7;;:19;;8844:63;;;;;-1:-1:-1;;;8844:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;8246:1;8985:7;:18;25238:10:::1;27230:16;:14;:16::i;:::-;27207:20;:39:::0;27274:26:::1;:24;:26::i;:::-;27257:14;:43:::0;-1:-1:-1;;;;;27315:21:0;::::1;::::0;27311:157:::1;;27372:15;27379:7;27372:6;:15::i;:::-;-1:-1:-1::0;;;;;27353:16:0;::::1;;::::0;;;:7:::1;:16;::::0;;;;;;;:34;;;;27436:20:::1;::::0;27402:22:::1;:31:::0;;;;;;:54;27311:157:::1;25278:1:::2;25269:6;:10;25261:40;;;::::0;;-1:-1:-1;;;25261:40:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;25261:40:0;;;;;;;;;;;;;::::2;;25327:12;::::0;:24:::2;::::0;25344:6;25327:24:::2;:16;:24;:::i;:::-;25312:12;:39:::0;25396:10:::2;25386:21;::::0;;;:9:::2;:21;::::0;;;;;:33:::2;::::0;25412:6;25386:33:::2;:25;:33;:::i;:::-;25372:10;25362:21;::::0;;;:9:::2;:21;::::0;;;;:57;;;;25430:12:::2;::::0;:45:::2;::::0;-1:-1:-1;;;;;25430:12:0;;::::2;::::0;25468:6;25430:25:::2;:45::i;:::-;25491:29;::::0;;;;;;;25501:10:::2;::::0;25491:29:::2;::::0;;;;;::::2;::::0;;::::2;-1:-1:-1::0;;8202:1:0;9164:22;;25171:357::o;22996:40::-;;;;:::o;26012:1092::-;6406:19;;-1:-1:-1;;;;;6406:19:0;6392:10;:33;6384:88;;;;-1:-1:-1;;;6384:88:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26119:1:::1;27230:16;:14;:16::i;:::-;27207:20;:39:::0;27274:26:::1;:24;:26::i;:::-;27257:14;:43:::0;-1:-1:-1;;;;;27315:21:0;::::1;::::0;27311:157:::1;;27372:15;27379:7;27372:6;:15::i;:::-;-1:-1:-1::0;;;;;27353:16:0;::::1;;::::0;;;:7:::1;:16;::::0;;;;;;;:34;;;;27436:20:::1;::::0;27402:22:::1;:31:::0;;;;;;:54;27311:157:::1;26157:12:::2;;26138:15;:31;26134:318;;26210:15;::::0;26199:27:::2;::::0;:6;;:27:::2;:10;:27;:::i;:::-;26186:10;:40:::0;26134:318:::2;;;26279:12;::::0;26259:17:::2;::::0;26279:33:::2;::::0;26296:15:::2;26279:33;:16;:33;:::i;:::-;26259:53;;26327:16;26346:25;26360:10;;26346:9;:13;;:25;;;;:::i;:::-;26424:15;::::0;26327:44;;-1:-1:-1;26399:41:0::2;::::0;:20:::2;:6:::0;26327:44;26399:20:::2;:10;:20;:::i;:41::-;26386:10;:54:::0;-1:-1:-1;;26134:318:0::2;26827:12;::::0;:37:::2;::::0;;-1:-1:-1;;;26827:37:0;;26858:4:::2;26827:37;::::0;::::2;::::0;;;26812:12:::2;::::0;-1:-1:-1;;;;;26827:12:0::2;::::0;:22:::2;::::0;:37;;;;;::::2;::::0;;;;;;;;:12;:37;::::2;;::::0;::::2;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;::::0;::::2;;-1:-1:-1::0;26827:37:0;26909:15:::2;::::0;26827:37;;-1:-1:-1;26897:28:0::2;::::0;26827:37;;26897:28:::2;:11;:28;:::i;:::-;26883:10;;:42;;26875:79;;;::::0;;-1:-1:-1;;;26875:79:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;::::2;::::0;;;;;;;;;;;;;::::2;;26984:15;26967:14;:32:::0;;;27045:15:::2;::::0;27025:36:::2;::::0;26984:15;27025:36:::2;:19;:36;:::i;:::-;27010:12;:51:::0;27077:19:::2;::::0;;;;;;;::::2;::::0;;;;::::2;::::0;;::::2;27478:1;6483::::1;26012:1092:::0;:::o;25536:307::-;8246:1;8852:7;;:19;;8844:63;;;;;-1:-1:-1;;;8844:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;8246:1;8985:7;:18;25590:10:::1;27230:16;:14;:16::i;:::-;27207:20;:39:::0;27274:26:::1;:24;:26::i;:::-;27257:14;:43:::0;-1:-1:-1;;;;;27315:21:0;::::1;::::0;27311:157:::1;;27372:15;27379:7;27372:6;:15::i;:::-;-1:-1:-1::0;;;;;27353:16:0;::::1;;::::0;;;:7:::1;:16;::::0;;;;;;;:34;;;;27436:20:::1;::::0;27402:22:::1;:31:::0;;;;;;:54;27311:157:::1;25638:10:::2;25613:14;25630:19:::0;;;:7:::2;:19;::::0;;;;;25664:10;;25660:176:::2;;25699:10;25713:1;25691:19:::0;;;:7:::2;:19;::::0;;;;:23;25729:12:::2;::::0;:45:::2;::::0;-1:-1:-1;;;;;25729:12:0;;::::2;::::0;25767:6;25729:25:::2;:45::i;:::-;25794:30;::::0;;;;;;;25805:10:::2;::::0;25794:30:::2;::::0;;;;;::::2;::::0;;::::2;25660:176;-1:-1:-1::0;;8202:1:0;9164:22;;25536:307::o;6226:34::-;;;-1:-1:-1;;;;;6226:34:0;;:::o;23808:112::-;-1:-1:-1;;;;;23894:18:0;23867:7;23894:18;;;:9;:18;;;;;;;23808:112::o;22889:26::-;;;-1:-1:-1;;;;;22889:26:0;;:::o;22960:29::-;;;;:::o;23928:131::-;23985:7;24012:39;24021:15;24038:12;;24012:8;:39::i;23123:57::-;;;;;;;;;;;;;:::o;24794:369::-;8246:1;8852:7;;:19;;8844:63;;;;;-1:-1:-1;;;8844:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;8246:1;8985:7;:18;24860:10:::1;27230:16;:14;:16::i;:::-;27207:20;:39:::0;27274:26:::1;:24;:26::i;:::-;27257:14;:43:::0;-1:-1:-1;;;;;27315:21:0;::::1;::::0;27311:157:::1;;27372:15;27379:7;27372:6;:15::i;:::-;-1:-1:-1::0;;;;;27353:16:0;::::1;;::::0;;;:7:::1;:16;::::0;;;;;;;:34;;;;27436:20:::1;::::0;27402:22:::1;:31:::0;;;;;;:54;27311:157:::1;24900:1:::2;24891:6;:10;24883:37;;;::::0;;-1:-1:-1;;;24883:37:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;24883:37:0;;;;;;;;;;;;;::::2;;24946:12;::::0;:24:::2;::::0;24963:6;24946:24:::2;:16;:24;:::i;:::-;24931:12;:39:::0;25015:10:::2;25005:21;::::0;;;:9:::2;:21;::::0;;;;;:33:::2;::::0;25031:6;25005:33:::2;:25;:33;:::i;:::-;24991:10;24981:21;::::0;;;:9:::2;:21;::::0;;;;:57;;;;25049:12:::2;::::0;:64:::2;::::0;-1:-1:-1;;;;;25049:12:0;;::::2;::::0;25099:4:::2;25106:6:::0;25049:29:::2;:64::i;:::-;25129:26;::::0;;;;;;;25136:10:::2;::::0;25129:26:::2;::::0;;;;;::::2;::::0;;::::2;-1:-1:-1::0;;8202:1:0;9164:22;;24794:369::o;23043:29::-;;;;:::o;24067:330::-;24114:7;24138:12;;24154:1;24138:17;24134:77;;;-1:-1:-1;24179:20:0;;24172:27;;24134:77;24241:148;24284:90;24361:12;;24284:72;24351:4;24284:62;24335:10;;24284:46;24315:14;;24284:26;:24;:26::i;:46::-;:50;:62;:50;:62;:::i;:90::-;24241:20;;;:148;:24;:148;:::i;22856:26::-;;;-1:-1:-1;;;;;22856:26:0;;:::o;23079:35::-;;;;:::o;25851:97::-;25906:10;25896:21;;;;:9;:21;;;;;;25887:31;;:8;:31::i;:::-;25929:11;:9;:11::i;:::-;25851:97::o;22922:31::-;;;;:::o;14448:136::-;14506:7;14533:43;14537:1;14540;14533:43;;;;;;;;;;;;;;;;;:3;:43::i;:::-;14526:50;14448:136;-1:-1:-1;;;14448:136:0:o;15338:471::-;15396:7;15641:6;15637:47;;-1:-1:-1;15671:1:0;15664:8;;15637:47;15708:5;;;15712:1;15708;:5;:1;15732:5;;;;;:10;15724:56;;;;-1:-1:-1;;;15724:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16285:132;16343:7;16370:39;16374:1;16377;16370:39;;;;;;;;;;;;;;;;;:3;:39::i;13984:181::-;14042:7;14074:5;;;14098:6;;;;14090:46;;;;;-1:-1:-1;;;14090:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;9972:177;10082:58;;;-1:-1:-1;;;;;10082:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;10082:58:0;-1:-1:-1;;;10082:58:0;;;10055:86;;10075:5;;10055:19;:86::i;:::-;9972:177;;;:::o;18886:106::-;18944:7;18975:1;18971;:5;:13;;18983:1;18971:13;;;-1:-1:-1;18979:1:0;;18886:106;-1:-1:-1;18886:106:0:o;10157:205::-;10285:68;;;-1:-1:-1;;;;;10285:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;10285:68:0;-1:-1:-1;;;10285:68:0;;;10258:96;;10278:5;;10258:19;:96::i;:::-;10157:205;;;;:::o;14887:192::-;14973:7;15009:12;15001:6;;;;14993:29;;;;-1:-1:-1;;;14993:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;15045:5:0;;;14887:192::o;16913:278::-;16999:7;17034:12;17027:5;17019:28;;;;-1:-1:-1;;;17019:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17058:9;17074:1;17070;:5;;;;;;;16913:278;-1:-1:-1;;;;;16913:278:0:o;12277:761::-;12701:23;12727:69;12755:4;12727:69;;;;;;;;;;;;;;;;;12735:5;-1:-1:-1;;;;;12727:27:0;;;:69;;;;;:::i;:::-;12811:17;;12701:95;;-1:-1:-1;12811:21:0;12807:224;;12953:10;12942:30;;;;;;;;;;;;;;;-1:-1:-1;12942:30:0;12934:85;;;;-1:-1:-1;;;12934:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3704:196;3807:12;3839:53;3862:6;3870:4;3876:1;3879:12;3839:22;:53::i;:::-;3832:60;3704:196;-1:-1:-1;;;;3704:196:0:o;5081:979::-;5211:12;5244:18;5255:6;5244:10;:18::i;:::-;5236:60;;;;;-1:-1:-1;;;5236:60:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;5370:12;5384:23;5411:6;-1:-1:-1;;;;;5411:11:0;5431:8;5442:4;5411:36;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;5411:36:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5369:78;;;;5462:7;5458:595;;;5493:10;-1:-1:-1;5486:17:0;;-1:-1:-1;5486:17:0;5458:595;5607:17;;:21;5603:439;;5870:10;5864:17;5931:15;5918:10;5914:2;5910:19;5903:44;5818:148;6006:20;;-1:-1:-1;;;6006:20:0;;;;;;;;;;;;;;;;;6013:12;;6006:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;783:422;1150:20;1189:8;;;783:422::o

Swarm Source

ipfs://35f9fb14248919f868692790d8291c6a206e790b1872c798f659fffdd452212e

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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