ETH Price: $3,385.13 (+4.74%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Exit209777732024-10-16 11:18:1199 days ago1729077491IN
0x1Da83856...e13812714
0 ETH0.0015342511.58405548
Exit178000342023-07-29 16:57:59544 days ago1690649879IN
0x1Da83856...e13812714
0 ETH0.0028162130.68039167
Exit123611032021-05-03 11:59:591361 days ago1620043199IN
0x1Da83856...e13812714
0 ETH0.0043030235.2
Stake With Permi...122994442021-04-23 23:28:191371 days ago1619220499IN
0x1Da83856...e13812714
0 ETH0.0094481171.55764161
Exit122438782021-04-15 9:41:141379 days ago1618479674IN
0x1Da83856...e13812714
0 ETH0.0091763971
Exit121848352021-04-06 7:44:451388 days ago1617695085IN
0x1Da83856...e13812714
0 ETH0.01318299102.00000145
Stake With Permi...121753082021-04-04 20:22:161390 days ago1617567736IN
0x1Da83856...e13812714
0 ETH0.0131263397
Exit119455462021-02-28 11:29:521425 days ago1614511792IN
0x1Da83856...e13812714
0 ETH0.0115828780.3
Exit118511842021-02-13 23:21:451440 days ago1613258505IN
0x1Da83856...e13812714
0 ETH0.0144245100
Exit117457792021-01-28 17:54:491456 days ago1611856489IN
0x1Da83856...e13812714
0 ETH0.0095201766
Exit117430382021-01-28 7:45:021456 days ago1611819902IN
0x1Da83856...e13812714
0 ETH0.0074620363
Exit117190982021-01-24 15:12:451460 days ago1611501165IN
0x1Da83856...e13812714
0 ETH0.0102413971
Exit116966022021-01-21 4:13:561464 days ago1611202436IN
0x1Da83856...e13812714
0 ETH0.0069792354
Exit116744392021-01-17 18:49:091467 days ago1610909349IN
0x1Da83856...e13812714
0 ETH0.0047600833
Exit116737002021-01-17 16:12:041467 days ago1610899924IN
0x1Da83856...e13812714
0 ETH0.0062775853
Exit116735362021-01-17 15:34:171467 days ago1610897657IN
0x1Da83856...e13812714
0 ETH0.0062467852.74
Exit116735302021-01-17 15:32:531467 days ago1610897573IN
0x1Da83856...e13812714
0 ETH0.0052465450.5
Get Reward116735152021-01-17 15:29:171467 days ago1610897357IN
0x1Da83856...e13812714
0 ETH0.0031518149.5
Exit116720372021-01-17 9:54:151467 days ago1610877255IN
0x1Da83856...e13812714
0 ETH0.0053370637
Exit116690462021-01-16 22:47:121468 days ago1610837232IN
0x1Da83856...e13812714
0 ETH0.0069391452
Exit116679142021-01-16 18:42:461468 days ago1610822566IN
0x1Da83856...e13812714
0 ETH0.0104699876
Get Reward116505852021-01-14 2:27:031471 days ago1610591223IN
0x1Da83856...e13812714
0 ETH0.0028142739
Stake116476152021-01-13 15:59:331471 days ago1610553573IN
0x1Da83856...e13812714
0 ETH0.004669350
Exit116453852021-01-13 7:47:011471 days ago1610524021IN
0x1Da83856...e13812714
0 ETH0.0058629146.2
Stake116446252021-01-13 5:03:021472 days ago1610514182IN
0x1Da83856...e13812714
0 ETH0.0047840149
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xE0CE6e6E...4B0E50a14
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
StakingRewards

Compiler Version
v0.5.17+commit.d19bba13

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-11-15
*/

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);
}
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be aplied to your functions to restrict their use to
 * the owner.
 */
contract Ownable {
    address private _owner;

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == _owner;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * > Note: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}
/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

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

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

        return c;
    }

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

        return c;
    }

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

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

        return c;
    }

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

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0, "SafeMath: modulo by zero");
        return a % b;
    }
}
/**
 * @dev Optional functions from the ERC20 standard.
 */
contract ERC20Detailed is IERC20 {
    string private _name;
    string private _symbol;
    uint8 private _decimals;

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

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

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

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei.
     *
     * > Note that this information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * `IERC20.balanceOf` and `IERC20.transfer`.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }
}
/**
 * @dev Collection of functions related to the address type,
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing a contract.
     *
     * > It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }
}
/**
 * @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");
    }
}
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;
}
contract RewardsDistributionRecipient {
    address public rewardsDistribution;

    function notifyRewardAmount(uint256 reward) external;

    modifier onlyRewardsDistribution() {
        require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract");
        _;
    }
}
/**
 * @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");
        }
    }
}

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;
    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,
        uint _rewardsDurationDays
    ) public {
        rewardsToken = IERC20(_rewardsToken);
        stakingToken = IERC20(_stakingToken);
        rewardsDistribution = _rewardsDistribution;
        rewardsDuration = _rewardsDurationDays * (1 days);
    }

    /* ========== 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 stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant updateReward(msg.sender) {
        require(amount > 0, "Cannot stake 0");
        _totalSupply = _totalSupply.add(amount);
        _balances[msg.sender] = _balances[msg.sender].add(amount);

        // permit
        IUniswapV2ERC20(address(stakingToken)).permit(msg.sender, address(this), amount, deadline, v, r, s);

        stakingToken.safeTransferFrom(msg.sender, address(this), amount);
        emit Staked(msg.sender, amount);
    }

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

interface IUniswapV2ERC20 {
    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
contract StakingRewardsFactory is Ownable {
    // immutables
    address public rewardsToken;

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

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

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

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

    ///// permissioned functions

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

        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"},{"internalType":"uint256","name":"_rewardsDurationDays","type":"uint256"}],"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":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"stakeWithPermit","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"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101415760003560e01c80637b0a47ee116100b8578063cd3daf9d1161007c578063cd3daf9d14610482578063d1af0c7d146104a0578063df136d65146104ea578063e9fad8ee14610508578063ebe2b12b14610512578063ecd9ba821461053057610141565b80637b0a47ee146103a257806380faa57d146103c05780638b876347146103de578063a694fc3a14610436578063c8f33c911461046457610141565b8063386a95251161010a578063386a9525146102605780633c6b16ab1461027e5780633d18b912146102ac5780633fc6df6e146102b657806370a082311461030057806372f702f31461035857610141565b80628cc262146101465780630700037d1461019e57806318160ddd146101f65780631c1f78eb146102145780632e1a7d4d14610232575b600080fd5b6101886004803603602081101561015c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610589565b6040518082815260200191505060405180910390f35b6101e0600480360360208110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106a7565b6040518082815260200191505060405180910390f35b6101fe6106bf565b6040518082815260200191505060405180910390f35b61021c6106c9565b6040518082815260200191505060405180910390f35b61025e6004803603602081101561024857600080fd5b81019080803590602001909291905050506106e7565b005b610268610a1f565b6040518082815260200191505060405180910390f35b6102aa6004803603602081101561029457600080fd5b8101908080359060200190929190505050610a25565b005b6102b4610e02565b005b6102be6110a7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103426004803603602081101561031657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110cc565b6040518082815260200191505060405180910390f35b610360611115565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103aa61113b565b6040518082815260200191505060405180910390f35b6103c8611141565b6040518082815260200191505060405180910390f35b610420600480360360208110156103f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611154565b6040518082815260200191505060405180910390f35b6104626004803603602081101561044c57600080fd5b810190808035906020019092919050505061116c565b005b61046c6114a6565b6040518082815260200191505060405180910390f35b61048a6114ac565b6040518082815260200191505060405180910390f35b6104a861153a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104f2611560565b6040518082815260200191505060405180910390f35b610510611566565b005b61051a6115b8565b6040518082815260200191505060405180910390f35b610587600480360360a081101561054657600080fd5b810190808035906020019092919080359060200190929190803560ff16906020019092919080359060200190929190803590602001909291905050506115be565b005b60006106a0600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610692670de0b6b3a7640000610684610636600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106286114ac565b611a1790919063ffffffff16565b600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aa090919063ffffffff16565b611b2690919063ffffffff16565b611bb590919063ffffffff16565b9050919050565b600a6020528060005260406000206000915090505481565b6000600b54905090565b60006106e2600654600554611aa090919063ffffffff16565b905090565b6001806000828254019250508190555060006001549050336107076114ac565b600881905550610715611141565b600781905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107e25761075881610589565b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600854600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60008311610858576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b61086d83600b54611a1790919063ffffffff16565b600b819055506108c583600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1790919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109553384600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c3d9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5846040518082815260200191505060405180910390a2506001548114610a1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b5050565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610aca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806120ad602a913960400191505060405180910390fd5b6000610ad46114ac565b600881905550610ae2611141565b600781905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610baf57610b2581610589565b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600854600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6004544210610bd857610bcd60065483611b2690919063ffffffff16565b600581905550610c3a565b6000610bef42600454611a1790919063ffffffff16565b90506000610c0860055483611aa090919063ffffffff16565b9050610c31600654610c238387611bb590919063ffffffff16565b611b2690919063ffffffff16565b60058190555050505b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610cdb57600080fd5b505afa158015610cef573d6000803e3d6000fd5b505050506040513d6020811015610d0557600080fd5b81019080805190602001909291905050509050610d2d60065482611b2690919063ffffffff16565b6005541115610da4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f50726f76696465642072657761726420746f6f2068696768000000000000000081525060200191505060405180910390fd5b42600781905550610dc060065442611bb590919063ffffffff16565b6004819055507fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d836040518082815260200191505060405180910390a1505050565b600180600082825401925050819055506000600154905033610e226114ac565b600881905550610e30611141565b600781905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610efd57610e7381610589565b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600854600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600081111561102b576000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fdc3382600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c3d9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486826040518082815260200191505060405180910390a25b505060015481146110a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b600061114f42600454611d0e565b905090565b60096020528060005260406000206000915090505481565b60018060008282540192505081905550600060015490503361118c6114ac565b60088190555061119a611141565b600781905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611267576111dd81610589565b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600854600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600083116112dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b6112f283600b54611bb590919063ffffffff16565b600b8190555061134a83600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb590919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113dc333085600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d27909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d846040518082815260200191505060405180910390a25060015481146114a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b5050565b60075481565b600080600b5414156114c2576008549050611537565b611534611523600b54611515670de0b6b3a76400006115076005546114f96007546114eb611141565b611a1790919063ffffffff16565b611aa090919063ffffffff16565b611aa090919063ffffffff16565b611b2690919063ffffffff16565b600854611bb590919063ffffffff16565b90505b90565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b6115ae600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106e7565b6115b6610e02565b565b60045481565b6001806000828254019250508190555060006001549050336115de6114ac565b6008819055506115ec611141565b600781905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146116b95761162f81610589565b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600854600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000871161172f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b61174487600b54611bb590919063ffffffff16565b600b8190555061179c87600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bb590919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d505accf33308a8a8a8a8a6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018460ff1660ff168152602001838152602001828152602001975050505050505050600060405180830381600087803b1580156118e257600080fd5b505af11580156118f6573d6000803e3d6000fd5b50505050611949333089600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d27909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d886040518082815260200191505060405180910390a2506001548114611a0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b505050505050565b600082821115611a8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080831415611ab35760009050611b20565b6000828402905082848281611ac457fe5b0414611b1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061208c6021913960400191505060405180910390fd5b809150505b92915050565b6000808211611b9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b6000828481611ba857fe5b0490508091505092915050565b600080828401905083811015611c33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b611d09838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611e2d565b505050565b6000818310611d1d5781611d1f565b825b905092915050565b611e27848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611e2d565b50505050565b611e4c8273ffffffffffffffffffffffffffffffffffffffff16612078565b611ebe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310611f0d5780518252602082019150602081019050602083039250611eea565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611f6f576040519150601f19603f3d011682016040523d82523d6000602084013e611f74565b606091505b509150915081611fec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b6000815111156120725780806020019051602081101561200b57600080fd5b8101908080519060200190929190505050612071576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806120d7602a913960400191505060405180910390fd5b5b50505050565b600080823b90506000811191505091905056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616c6c6572206973206e6f742052657761726473446973747269627574696f6e20636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820ab31837dea4b1fa1d1247a6c6fd618b6bec3d63ef118a16879c081e044bd586b64736f6c63430005110032

Deployed Bytecode Sourcemap

18198:5755:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;18198:5755:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20049:198;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;20049:198:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;18735:42;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;18735:42:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;19351:93;;;:::i;:::-;;;;;;;;;;;;;;;;;;;20255:121;;;:::i;:::-;;;;;;;;;;;;;;;;;;;21381:357;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;21381:357:0;;;;;;;;;;;;;;;;;:::i;:::-;;18554:30;;;:::i;:::-;;;;;;;;;;;;;;;;;;;22222:1083;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;22222:1083:0;;;;;;;;;;;;;;;;;:::i;:::-;;21746:307;;;:::i;:::-;;14262:34;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;19452:112;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;19452:112:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;18447:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;18518:29;;;:::i;:::-;;;;;;;;;;;;;;;;;;;19572:131;;;:::i;:::-;;;;;;;;;;;;;;;;;;;18671:57;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;18671:57:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;21004:369;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;21004:369:0;;;;;;;;;;;;;;;;;:::i;:::-;;18591:29;;;:::i;:::-;;;;;;;;;;;;;;;;;;;19711:330;;;:::i;:::-;;;;;;;;;;;;;;;;;;;18414:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;18627:35;;;:::i;:::-;;;;;;;;;;;;;;;;;;;22061:97;;;:::i;:::-;;18480:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;20438:558;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;20438:558:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;20049:198;20103:7;20130:109;20222:7;:16;20230:7;20222:16;;;;;;;;;;;;;;;;20130:87;20212:4;20130:77;20153:53;20174:22;:31;20197:7;20174:31;;;;;;;;;;;;;;;;20153:16;:14;:16::i;:::-;:20;;:53;;;;:::i;:::-;20130:9;:18;20140:7;20130:18;;;;;;;;;;;;;;;;:22;;:77;;;;:::i;:::-;:81;;:87;;;;:::i;:::-;:91;;:109;;;;:::i;:::-;20123:116;;20049:198;;;:::o;18735:42::-;;;;;;;;;;;;;;;;;:::o;19351:93::-;19397:7;19424:12;;19417:19;;19351:93;:::o;20255:121::-;20310:7;20337:31;20352:15;;20337:10;;:14;;:31;;;;:::i;:::-;20330:38;;20255:121;:::o;21381:357::-;13401:1;13384:13;;:18;;;;;;;;;;;13413:20;13436:13;;13413:36;;21448:10;23431:16;:14;:16::i;:::-;23408:20;:39;;;;23475:26;:24;:26::i;:::-;23458:14;:43;;;;23535:1;23516:21;;:7;:21;;;23512:157;;23573:15;23580:7;23573:6;:15::i;:::-;23554:7;:16;23562:7;23554:16;;;;;;;;;;;;;;;:34;;;;23637:20;;23603:22;:31;23626:7;23603:31;;;;;;;;;;;;;;;:54;;;;23512:157;21488:1;21479:6;:10;21471:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21537:24;21554:6;21537:12;;:16;;:24;;;;:::i;:::-;21522:12;:39;;;;21596:33;21622:6;21596:9;:21;21606:10;21596:21;;;;;;;;;;;;;;;;:25;;:33;;;;:::i;:::-;21572:9;:21;21582:10;21572:21;;;;;;;;;;;;;;;:57;;;;21640:45;21666:10;21678:6;21640:12;;;;;;;;;;;:25;;;;:45;;;;;:::i;:::-;21711:10;21701:29;;;21723:6;21701:29;;;;;;;;;;;;;;;;;;13460:1;13496:13;;13480:12;:29;13472:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21381:357;;:::o;18554:30::-;;;;:::o;22222:1083::-;14434:19;;;;;;;;;;;14420:33;;:10;:33;;;14412:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22320:1;23431:16;:14;:16::i;:::-;23408:20;:39;;;;23475:26;:24;:26::i;:::-;23458:14;:43;;;;23535:1;23516:21;;:7;:21;;;23512:157;;23573:15;23580:7;23573:6;:15::i;:::-;23554:7;:16;23562:7;23554:16;;;;;;;;;;;;;;;:34;;;;23637:20;;23603:22;:31;23626:7;23603:31;;;;;;;;;;;;;;;:54;;;;23512:157;22358:12;;22339:15;:31;22335:318;;22400:27;22411:15;;22400:6;:10;;:27;;;;:::i;:::-;22387:10;:40;;;;22335:318;;;22460:17;22480:33;22497:15;22480:12;;:16;;:33;;;;:::i;:::-;22460:53;;22528:16;22547:25;22561:10;;22547:9;:13;;:25;;;;:::i;:::-;22528:44;;22600:41;22625:15;;22600:20;22611:8;22600:6;:10;;:20;;;;:::i;:::-;:24;;:41;;;;:::i;:::-;22587:10;:54;;;;22335:318;;;23013:12;23028;;;;;;;;;;;:22;;;23059:4;23028:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;23028:37:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;23028:37:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;23028:37:0;;;;;;;;;;;;;;;;23013:52;;23098:28;23110:15;;23098:7;:11;;:28;;;;:::i;:::-;23084:10;;:42;;23076:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23185:15;23168:14;:32;;;;23226:36;23246:15;;23226;:19;;:36;;;;:::i;:::-;23211:12;:51;;;;23278:19;23290:6;23278:19;;;;;;;;;;;;;;;;;;23679:1;14511;22222:1083;:::o;21746:307::-;13401:1;13384:13;;:18;;;;;;;;;;;13413:20;13436:13;;13413:36;;21800:10;23431:16;:14;:16::i;:::-;23408:20;:39;;;;23475:26;:24;:26::i;:::-;23458:14;:43;;;;23535:1;23516:21;;:7;:21;;;23512:157;;23573:15;23580:7;23573:6;:15::i;:::-;23554:7;:16;23562:7;23554:16;;;;;;;;;;;;;;;:34;;;;23637:20;;23603:22;:31;23626:7;23603:31;;;;;;;;;;;;;;;:54;;;;23512:157;21823:14;21840:7;:19;21848:10;21840:19;;;;;;;;;;;;;;;;21823:36;;21883:1;21874:6;:10;21870:176;;;21923:1;21901:7;:19;21909:10;21901:19;;;;;;;;;;;;;;;:23;;;;21939:45;21965:10;21977:6;21939:12;;;;;;;;;;;:25;;;;:45;;;;;:::i;:::-;22015:10;22004:30;;;22027:6;22004:30;;;;;;;;;;;;;;;;;;21870:176;23679:1;13460;13496:13;;13480:12;:29;13472:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21746:307;:::o;14262:34::-;;;;;;;;;;;;;:::o;19452:112::-;19511:7;19538:9;:18;19548:7;19538:18;;;;;;;;;;;;;;;;19531:25;;19452:112;;;:::o;18447:26::-;;;;;;;;;;;;;:::o;18518:29::-;;;;:::o;19572:131::-;19629:7;19656:39;19665:15;19682:12;;19656:8;:39::i;:::-;19649:46;;19572:131;:::o;18671:57::-;;;;;;;;;;;;;;;;;:::o;21004:369::-;13401:1;13384:13;;:18;;;;;;;;;;;13413:20;13436:13;;13413:36;;21070:10;23431:16;:14;:16::i;:::-;23408:20;:39;;;;23475:26;:24;:26::i;:::-;23458:14;:43;;;;23535:1;23516:21;;:7;:21;;;23512:157;;23573:15;23580:7;23573:6;:15::i;:::-;23554:7;:16;23562:7;23554:16;;;;;;;;;;;;;;;:34;;;;23637:20;;23603:22;:31;23626:7;23603:31;;;;;;;;;;;;;;;:54;;;;23512:157;21110:1;21101:6;:10;21093:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21156:24;21173:6;21156:12;;:16;;:24;;;;:::i;:::-;21141:12;:39;;;;21215:33;21241:6;21215:9;:21;21225:10;21215:21;;;;;;;;;;;;;;;;:25;;:33;;;;:::i;:::-;21191:9;:21;21201:10;21191:21;;;;;;;;;;;;;;;:57;;;;21259:64;21289:10;21309:4;21316:6;21259:12;;;;;;;;;;;:29;;;;:64;;;;;;:::i;:::-;21346:10;21339:26;;;21358:6;21339:26;;;;;;;;;;;;;;;;;;13460:1;13496:13;;13480:12;:29;13472:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21004:369;;:::o;18591:29::-;;;;:::o;19711:330::-;19758:7;19798:1;19782:12;;:17;19778:77;;;19823:20;;19816:27;;;;19778:77;19885:148;19928:90;20005:12;;19928:72;19995:4;19928:62;19979:10;;19928:46;19959:14;;19928:26;:24;:26::i;:::-;:30;;:46;;;;:::i;:::-;:50;;:62;;;;:::i;:::-;:66;;:72;;;;:::i;:::-;:76;;:90;;;;:::i;:::-;19885:20;;:24;;:148;;;;:::i;:::-;19865:168;;19711:330;;:::o;18414:26::-;;;;;;;;;;;;;:::o;18627:35::-;;;;:::o;22061:97::-;22097:31;22106:9;:21;22116:10;22106:21;;;;;;;;;;;;;;;;22097:8;:31::i;:::-;22139:11;:9;:11::i;:::-;22061:97::o;18480:31::-;;;;:::o;20438:558::-;13401:1;13384:13;;:18;;;;;;;;;;;13413:20;13436:13;;13413:36;;20560:10;23431:16;:14;:16::i;:::-;23408:20;:39;;;;23475:26;:24;:26::i;:::-;23458:14;:43;;;;23535:1;23516:21;;:7;:21;;;23512:157;;23573:15;23580:7;23573:6;:15::i;:::-;23554:7;:16;23562:7;23554:16;;;;;;;;;;;;;;;:34;;;;23637:20;;23603:22;:31;23626:7;23603:31;;;;;;;;;;;;;;;:54;;;;23512:157;20600:1;20591:6;:10;20583:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20646:24;20663:6;20646:12;;:16;;:24;;;;:::i;:::-;20631:12;:39;;;;20705:33;20731:6;20705:9;:21;20715:10;20705:21;;;;;;;;;;;;;;;;:25;;:33;;;;:::i;:::-;20681:9;:21;20691:10;20681:21;;;;;;;;;;;;;;;:57;;;;20794:12;;;;;;;;;;;20770:45;;;20816:10;20836:4;20843:6;20851:8;20861:1;20864;20867;20770:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;20770:99:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;20770:99:0;;;;20882:64;20912:10;20932:4;20939:6;20882:12;;;;;;;;;;;:29;;;;:64;;;;;;:::i;:::-;20969:10;20962:26;;;20981:6;20962:26;;;;;;;;;;;;;;;;;;13460:1;13496:13;;13480:12;:29;13472:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20438:558;;;;;;:::o;7237:184::-;7295:7;7328:1;7323;:6;;7315:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7375:9;7391:1;7387;:5;7375:17;;7412:1;7405:8;;;7237:184;;;;:::o;7672:470::-;7730:7;7979:1;7974;:6;7970:47;;;8004:1;7997:8;;;;7970:47;8029:9;8045:1;8041;:5;8029:17;;8074:1;8069;8065;:5;;;;;;:10;8057:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8133:1;8126:8;;;7672:470;;;;;:::o;8610:333::-;8668:7;8767:1;8763;:5;8755:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8810:9;8826:1;8822;:5;;;;;;8810:17;;8934:1;8927:8;;;8610:333;;;;:::o;6781:181::-;6839:7;6859:9;6875:1;6871;:5;6859:17;;6900:1;6895;:6;;6887:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6953:1;6946:8;;;6781:181;;;;:::o;15083:176::-;15166:85;15185:5;15215;:14;;;:23;;;;15240:2;15244:5;15192:58;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;15192:58:0;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;15192:58:0;15166:18;:85::i;:::-;15083:176;;;:::o;5526:106::-;5584:7;5615:1;5611;:5;:13;;5623:1;5611:13;;;5619:1;5611:13;5604:20;;5526:106;;;;:::o;15267:204::-;15368:95;15387:5;15417;:18;;;:27;;;;15446:4;15452:2;15456:5;15394:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;15394:68:0;;;;;;;38:4:-1;29:7;25:18;67:10;61:17;96:58;199:8;192:4;186;182:15;179:29;167:10;160:49;0:215;;;15394:68:0;15368:18;:95::i;:::-;15267:204;;;;:::o;17077:1114::-;17681:27;17689:5;17681:25;;;:27::i;:::-;17673:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17818:12;17832:23;17867:5;17859:19;;17879:4;17859:25;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;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;;;17859: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;;17817:67:0;;;;17903:7;17895:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17984:1;17964:10;:17;:21;17960:224;;;18106:10;18095:30;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;18095:30:0;;;;;;;;;;;;;;;;18087:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17960:224;17077:1114;;;;:::o;11651:422::-;11711:4;11919:12;12030:7;12018:20;12010:28;;12064:1;12057:4;:8;12050:15;;;11651:422;;;:::o

Swarm Source

bzzr://ab31837dea4b1fa1d1247a6c6fd618b6bec3d63ef118a16879c081e044bd586b

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.