Contract 0x1653A3A3c4cceE0538685F1600a30dF5E3EE830A

Contract Overview

Balance:
0 ETH
Txn Hash Method
Block
From
To
Value
0xfc99cbf856f3ac252014a30740b84a7fcfea84c8e9bb4e1111fb3adcf17783f6Unstake120803932023-07-17 10:14:1470 days 10 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001796453930.388801306
0x85ed5c55b44c898a20623fbb526f1171a92e8ab1ecd09efcc9d4cfd7655fdf11Stake120803872023-07-17 10:14:0270 days 10 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001799131540.388801306
0x31f3cbec01ccd605f5132848cc2fb2f96afd2f9dd1d99dc65a54958ace1d9b7aStake120792442023-07-17 9:35:5670 days 11 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000640688190.03000005
0x8c6d0358cbd25a98a7c263cffd22288f36d0f7e27a514b6753afc2507a599bf8Unstake120789502023-07-17 9:26:0870 days 11 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000498968740.03000005
0x179978a024ff8e5cd4c07fed12c3f32afa281968909263d33caaa5e5873d78b0Stake120787732023-07-17 9:20:1470 days 11 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000480532370.03000005
0xdfe7dff3b13f8fb42abdea8b3362fec1ed26e2c65d72ea1ea768970264f656a2Unstake119582012023-07-14 14:21:1073 days 6 hrs ago0x64af258f8522bb9dd2c2b648b9cbbcdbe986b0bf IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000158637810.00100005
0xd52c1f416a238c05a3fb6119b08e4fd793e04c45bf40e6c85f6a0551c9bc9664Unstake119578522023-07-14 14:09:3273 days 6 hrs ago0xde28499d5290bbbfd87a51e52a8bfe434e53ed17 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000199342460.00100005
0x5ff865609d58671539777f9f268d8356b564f4035bd58ebb2a70c7d0721569acGet Reward119578322023-07-14 14:08:5273 days 6 hrs ago0xde28499d5290bbbfd87a51e52a8bfe434e53ed17 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000168974080.00100005
0x676a79fa1e0479cbd2321060c1f58ecda1eee957588184edfa23d529327ee72bUnstake119567842023-07-14 13:33:5673 days 7 hrs ago0xf5cad67a16bb2db15ba76d665e62b2eb641de451 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000247379320.00100005
0x9b9a354c10d58a18fc365334e9c06de06e2b4300d87d96185752948000448152Stake119566702023-07-14 13:30:0873 days 7 hrs ago0xf5cad67a16bb2db15ba76d665e62b2eb641de451 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000275093950.00100005
0xc91ae8ea14f16376dec6ecb6e7a101631c95e2e7f288b046742724ca7c1e66f5Get Reward119561802023-07-14 13:13:4873 days 7 hrs ago0xf5cad67a16bb2db15ba76d665e62b2eb641de451 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000415499320.00100005
0x2267daee76bd5e2cbcf199c95087c4c8be4f71ef52311a1a6b639c1313456aa8Unstake117762602023-07-10 9:16:2877 days 11 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001051811940.00100005
0x2f1e75a251c6ed6421ab5a6813f52f6f82cbe4008e4d43069cbe4d2803735102Stake117762412023-07-10 9:15:5077 days 11 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001115471130.00100005
0x1fd8b6d9beaa1e5ad8172221c1cbeedc9ff8852c9afa42776586e22479cbfc70Unstake117761972023-07-10 9:14:2277 days 11 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001006732120.00100005
0xab244f5ab2d88dffc9e6e0abdf2909032d67ffa24abb73440db16ef1eeeac1beStake117761612023-07-10 9:13:1077 days 11 hrs ago0xc2ecd777d06ffdf8b3179286beabf52b67e9d991 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001063866960.00100005
0x8b41040fde854ca04068dec42ebaa9945dfdb54d5e51d40eea44aa10aa9655e5Stake117759702023-07-10 9:06:4877 days 11 hrs ago0x64af258f8522bb9dd2c2b648b9cbbcdbe986b0bf IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001021603690.00100005
0x467f8242fa6ea0adda2dce51b8cd4af31facd7351420915cc8a350d4041b0401Unstake117757692023-07-10 9:00:0677 days 11 hrs ago0x64af258f8522bb9dd2c2b648b9cbbcdbe986b0bf IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000911880840.00100005
0xd69501e63d0a8bdffa1685d30b2044b046202a0171844c86acd999c39bd47232Stake117757522023-07-10 8:59:3277 days 11 hrs ago0x64af258f8522bb9dd2c2b648b9cbbcdbe986b0bf IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000878672790.00100005
0x5ee99739131e0635b9f79a20dab108579a8fab78701ae0473097b4b9bacdeae6Unstake116929062023-07-08 10:58:0079 days 9 hrs ago0x1f29a435881cc0603ce6d19414a46bf692ba626a IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001313190041.50000005
0x71107eb28f910119862779285a597184bb64aceae0b0b3a85dfd37d1b240e8a2Stake116923262023-07-08 10:38:4079 days 10 hrs ago0x1f29a435881cc0603ce6d19414a46bf692ba626a IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001652850051.50000005
0x3d936ae84ec0864e16ac25063070f7f6405b0d75583a6faa4684c013d14e8226Unstake116728172023-07-07 23:48:2279 days 20 hrs ago0x64af258f8522bb9dd2c2b648b9cbbcdbe986b0bf IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000000752610.00100005
0x46b5f1a539ec7eca324e9d77373d4e45a7dc2c8605499fdd415e1840dfc14e20Get Reward116728102023-07-07 23:48:0879 days 20 hrs ago0x64af258f8522bb9dd2c2b648b9cbbcdbe986b0bf IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0000001894310.00100005
0xfcfa906c05fb50784ce34e4c7ce4868685d81221f6ac2a132dee7382bf114abeUnstake116565792023-07-07 14:47:0680 days 5 hrs ago0x043e7c673f2bd9c62e69921395bfd1f97acc0a78 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001505400032.00000005
0x7305b14b89c0a3e07655dfcbe4d100b6d3183b37d7f778e4e1ffe14c84025da9Unstake116135112023-07-06 14:51:3081 days 5 hrs ago0x043e7c673f2bd9c62e69921395bfd1f97acc0a78 IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0002007089041.5000004
0xd6beb25748e6f2cd3edc4fa3e1b3cea583a4bf9d5e702f59b8fc93c125b265edUnstake116134112023-07-06 14:48:1081 days 5 hrs ago0xf18742cf293ebf6c397f1be2eefb58e22ee9354e IN  0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH0.0001948283221.50000005
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x117b88d2cd1fa448ca7b8b062cf15e779821291941f57e9958f67e2c8eb545dd120914552023-07-17 16:22:5870 days 4 hrs ago 0x3e5371d909bf1996c95e9d179b0bc91c26fb1279 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x117b88d2cd1fa448ca7b8b062cf15e779821291941f57e9958f67e2c8eb545dd120914552023-07-17 16:22:5870 days 4 hrs ago 0x3e5371d909bf1996c95e9d179b0bc91c26fb1279 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x117b88d2cd1fa448ca7b8b062cf15e779821291941f57e9958f67e2c8eb545dd120914552023-07-17 16:22:5870 days 4 hrs ago 0x3e5371d909bf1996c95e9d179b0bc91c26fb1279 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xbed79439bb089161888d84341f6d09fff7141bb0e7516d015fd0dcc86df79223120913892023-07-17 16:20:4670 days 4 hrs ago 0x3e5371d909bf1996c95e9d179b0bc91c26fb1279 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xbed79439bb089161888d84341f6d09fff7141bb0e7516d015fd0dcc86df79223120913892023-07-17 16:20:4670 days 4 hrs ago 0x3e5371d909bf1996c95e9d179b0bc91c26fb1279 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xbed79439bb089161888d84341f6d09fff7141bb0e7516d015fd0dcc86df79223120913892023-07-17 16:20:4670 days 4 hrs ago 0x3e5371d909bf1996c95e9d179b0bc91c26fb1279 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x65af6842308d3e82cf31fcb3c58076f4a5fd225ccff49cbc29c70476cd5fc31d120827372023-07-17 11:32:2270 days 9 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x2513310baa652705e3802612d5be9971177d8771850286cfb262bfaa1b5f0709120827282023-07-17 11:32:0470 days 9 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x2513310baa652705e3802612d5be9971177d8771850286cfb262bfaa1b5f0709120827282023-07-17 11:32:0470 days 9 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xfe7cbb80c5b249f03bfcc3ab384ea36e7893c3db8563c539bd2e6602ed2a9a16120804832023-07-17 10:17:1470 days 10 hrs ago 0x3e5371d909bf1996c95e9d179b0bc91c26fb1279 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xd61a291bf2bedb350171e98fc96e306e148aeae2643d1abbec11e5ae82f25544120804202023-07-17 10:15:0870 days 10 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xd61a291bf2bedb350171e98fc96e306e148aeae2643d1abbec11e5ae82f25544120804202023-07-17 10:15:0870 days 10 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xaf0dea1f43bef7c414d98eef2dfc49f7db7e848cc86be26a88da15f72d4ebdbc120804052023-07-17 10:14:3870 days 10 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x25423015ae2d9dd4a28a79eedbac0c75b8cafbad6eb63a94d6621ef26701f32f120804002023-07-17 10:14:2870 days 10 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x25423015ae2d9dd4a28a79eedbac0c75b8cafbad6eb63a94d6621ef26701f32f120804002023-07-17 10:14:2870 days 10 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xfc99cbf856f3ac252014a30740b84a7fcfea84c8e9bb4e1111fb3adcf17783f6120803932023-07-17 10:14:1470 days 10 hrs ago 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a 0xda0c33402fc1e10d18c532f0ed9c1a6c5c9e386c0 ETH
0x85ed5c55b44c898a20623fbb526f1171a92e8ab1ecd09efcc9d4cfd7655fdf11120803872023-07-17 10:14:0270 days 10 hrs ago 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a 0xda0c33402fc1e10d18c532f0ed9c1a6c5c9e386c0 ETH
0xd7374fe83170b1704520a0b728f41f52c99484028cdaaa96170fa76f0dc65b2b120792652023-07-17 9:36:3870 days 11 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xb22efb64628fa2dcd83ea02804e267cb7857f45fc40ce2ecd4d0ae1abed06fc2120792582023-07-17 9:36:2470 days 11 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0xb22efb64628fa2dcd83ea02804e267cb7857f45fc40ce2ecd4d0ae1abed06fc2120792582023-07-17 9:36:2470 days 11 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x31f3cbec01ccd605f5132848cc2fb2f96afd2f9dd1d99dc65a54958ace1d9b7a120792442023-07-17 9:35:5670 days 11 hrs ago 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a 0xda0c33402fc1e10d18c532f0ed9c1a6c5c9e386c0 ETH
0x8c6d0358cbd25a98a7c263cffd22288f36d0f7e27a514b6753afc2507a599bf8120789502023-07-17 9:26:0870 days 11 hrs ago 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a 0xda0c33402fc1e10d18c532f0ed9c1a6c5c9e386c0 ETH
0x4cd928672da0b902a67ce0f91ccfa272a80cf899bd3f08cbff58e5bec28ef984120788242023-07-17 9:21:5670 days 11 hrs ago 0xafd87d1a62260bd5714c55a1bb4057bdc8dfa413 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
0x179978a024ff8e5cd4c07fed12c3f32afa281968909263d33caaa5e5873d78b0120787732023-07-17 9:20:1470 days 11 hrs ago 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a 0xda0c33402fc1e10d18c532f0ed9c1a6c5c9e386c0 ETH
0x6b752da948a7f5e5b940a70c35a66b755803634fbcabc2bc9a5ef7a16a37f1a5120787022023-07-17 9:17:5270 days 11 hrs ago 0x3e5371d909bf1996c95e9d179b0bc91c26fb1279 0x1653a3a3c4ccee0538685f1600a30df5e3ee830a0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingRewards

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : StakingRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "./utils/Owned.sol";
import "./interfaces/IStakingRewards.sol";
import "./interfaces/ISupplySchedule.sol";
import "./interfaces/IRewardEscrow.sol";

/// @title KWENTA Staking Rewards
/// @author SYNTHETIX, JaredBorders ([email protected]), JChiaramonte7 ([email protected])
/// @notice Updated version of Synthetix's StakingRewards with new features specific
/// to Kwenta
contract StakingRewards is IStakingRewards, Owned, ReentrancyGuard, Pausable {
    using SafeERC20 for IERC20;

    /*///////////////////////////////////////////////////////////////
                                CONSTANTS
    ///////////////////////////////////////////////////////////////*/

    /// @notice token used for BOTH staking and rewards
    IERC20 public immutable token;

    /// @notice escrow contract which holds (and may stake) reward tokens
    IRewardEscrow public immutable rewardEscrow;

    /// @notice handles reward token minting logic
    ISupplySchedule public immutable supplySchedule;

    /*///////////////////////////////////////////////////////////////
                                STATE
    ///////////////////////////////////////////////////////////////*/

    /// @notice number of tokens staked by address
    /// @dev this includes escrowed tokens stake
    mapping(address => uint256) private balances;

    /// @notice number of staked escrow tokens by address
    mapping(address => uint256) private escrowedBalances;

    /// @notice marks applicable reward period finish time
    uint256 public periodFinish = 0;

    /// @notice amount of tokens minted per second
    uint256 public rewardRate = 0;

    /// @notice period for rewards
    uint256 public rewardsDuration = 7 days;

    /// @notice track last time the rewards were updated
    uint256 public lastUpdateTime;

    /// @notice summation of rewardRate divided by total staked tokens
    uint256 public rewardPerTokenStored;

    /// @notice total number of tokens staked in this contract
    uint256 public _totalSupply;

    /// @notice represents the rewardPerToken
    /// value the last time the stake calculated earned() rewards
    mapping(address => uint256) public userRewardPerTokenPaid;

    /// @notice track rewards for a given user which changes when
    /// a user stakes, unstakes, or claims rewards
    mapping(address => uint256) public rewards;

    /*///////////////////////////////////////////////////////////////
                                EVENTS
    ///////////////////////////////////////////////////////////////*/

    /// @notice update reward rate
    /// @param reward: amount to be distributed over applicable rewards duration
    event RewardAdded(uint256 reward);

    /// @notice emitted when user stakes tokens
    /// @param user: staker address
    /// @param amount: amount staked
    event Staked(address indexed user, uint256 amount);

    /// @notice emitted when user unstakes tokens
    /// @param user: address of user unstaking
    /// @param amount: amount unstaked
    event Unstaked(address indexed user, uint256 amount);

    /// @notice emitted when escrow staked
    /// @param user: owner of escrowed tokens address
    /// @param amount: amount staked
    event EscrowStaked(address indexed user, uint256 amount);

    /// @notice emitted when staked escrow tokens are unstaked
    /// @param user: owner of escrowed tokens address
    /// @param amount: amount unstaked
    event EscrowUnstaked(address user, uint256 amount);

    /// @notice emitted when user claims rewards
    /// @param user: address of user claiming rewards
    /// @param reward: amount of reward token claimed
    event RewardPaid(address indexed user, uint256 reward);

    /// @notice emitted when rewards duration changes
    /// @param newDuration: denoted in seconds
    event RewardsDurationUpdated(uint256 newDuration);

    /// @notice emitted when tokens are recovered from this contract
    /// @param token: address of token recovered
    /// @param amount: amount of token recovered
    event Recovered(address token, uint256 amount);

    /*///////////////////////////////////////////////////////////////
                                AUTH
    ///////////////////////////////////////////////////////////////*/

    /// @notice access control modifier for rewardEscrow
    modifier onlyRewardEscrow() {
        require(
            msg.sender == address(rewardEscrow),
            "StakingRewards: Only Reward Escrow"
        );
        _;
    }

    /// @notice access control modifier for rewardEscrow
    modifier onlySupplySchedule() {
        require(
            msg.sender == address(supplySchedule),
            "StakingRewards: Only Supply Schedule"
        );
        _;
    }

    /*///////////////////////////////////////////////////////////////
                            CONSTRUCTOR
    ///////////////////////////////////////////////////////////////*/

    /// @notice configure StakingRewards state
    /// @dev owner set to address that deployed StakingRewards
    /// @param _token: token used for staking and for rewards
    /// @param _rewardEscrow: escrow contract which holds (and may stake) reward tokens
    /// @param _supplySchedule: handles reward token minting logic
    constructor(
        address _token,
        address _rewardEscrow,
        address _supplySchedule
    ) Owned(msg.sender) {
        // define reward/staking token
        token = IERC20(_token);

        // define contracts which will interact with StakingRewards
        rewardEscrow = IRewardEscrow(_rewardEscrow);
        supplySchedule = ISupplySchedule(_supplySchedule);
    }

    /*///////////////////////////////////////////////////////////////
                                VIEWS
    ///////////////////////////////////////////////////////////////*/

    /// @dev returns staked tokens which will likely not be equal to total tokens
    /// in the contract since reward and staking tokens are the same
    /// @return total amount of tokens that are being staked
    function totalSupply() external view override returns (uint256) {
        return _totalSupply;
    }

    /// @param account: address of potential staker
    /// @return amount of tokens staked by account
    function balanceOf(address account)
        external
        view
        override
        returns (uint256)
    {
        return balances[account];
    }

    /// @notice Getter function for number of staked escrow tokens
    /// @param account address to check the escrowed tokens staked
    /// @return amount of escrowed tokens staked
    function escrowedBalanceOf(address account)
        external
        view
        override
        returns (uint256)
    {
        return escrowedBalances[account];
    }

    /// @return rewards for the duration specified by rewardsDuration
    function getRewardForDuration() external view override returns (uint256) {
        return rewardRate * rewardsDuration;
    }

    /// @notice Getter function for number of staked non-escrow tokens
    /// @param account address to check the non-escrowed tokens staked
    /// @return amount of non-escrowed tokens staked
    function nonEscrowedBalanceOf(address account)
        public
        view
        override
        returns (uint256)
    {
        return balances[account] - escrowedBalances[account];
    }

    /*///////////////////////////////////////////////////////////////
                            STAKE/UNSTAKE
    ///////////////////////////////////////////////////////////////*/

    /// @notice stake token
    /// @param amount: amount to stake
    /// @dev updateReward() called prior to function logic
    function stake(uint256 amount)
        external
        override
        nonReentrant
        whenNotPaused
        updateReward(msg.sender)
    {
        require(amount > 0, "StakingRewards: Cannot stake 0");

        // update state
        _totalSupply += amount;
        balances[msg.sender] += amount;

        // transfer token to this contract from the caller
        token.safeTransferFrom(msg.sender, address(this), amount);

        // emit staking event and index msg.sender
        emit Staked(msg.sender, amount);
    }

    /// @notice unstake token
    /// @param amount: amount to unstake
    /// @dev updateReward() called prior to function logic
    function unstake(uint256 amount)
        public
        override
        nonReentrant
        updateReward(msg.sender)
    {
        require(amount > 0, "StakingRewards: Cannot Unstake 0");
        require(
            amount <= nonEscrowedBalanceOf(msg.sender),
            "StakingRewards: Invalid Amount"
        );

        // update state
        _totalSupply -= amount;
        balances[msg.sender] -= amount;

        // transfer token from this contract to the caller
        token.safeTransfer(msg.sender, amount);

        // emit unstake event and index msg.sender
        emit Unstaked(msg.sender, amount);
    }

    /// @notice stake escrowed token
    /// @param account: address which owns token
    /// @param amount: amount to stake
    /// @dev updateReward() called prior to function logic
    /// @dev msg.sender NOT used (account is used)
    function stakeEscrow(address account, uint256 amount)
        external
        override
        whenNotPaused
        onlyRewardEscrow
        updateReward(account)
    {
        require(amount > 0, "StakingRewards: Cannot stake 0");

        // update state
        balances[account] += amount;
        escrowedBalances[account] += amount;

        // updates total supply despite no new staking token being transfered.
        // escrowed tokens are locked in RewardEscrow
        _totalSupply += amount;

        // emit escrow staking event and index _account
        emit EscrowStaked(account, amount);
    }

    /// @notice unstake escrowed token
    /// @param account: address which owns token
    /// @param amount: amount to unstake
    /// @dev updateReward() called prior to function logic
    /// @dev msg.sender NOT used (account is used)
    function unstakeEscrow(address account, uint256 amount)
        external
        override
        nonReentrant
        onlyRewardEscrow
        updateReward(account)
    {
        require(amount > 0, "StakingRewards: Cannot Unstake 0");
        require(
            escrowedBalances[account] >= amount,
            "StakingRewards: Invalid Amount"
        );

        // update state
        balances[account] -= amount;
        escrowedBalances[account] -= amount;

        // updates total supply despite no new staking token being transfered.
        // escrowed tokens are locked in RewardEscrow
        _totalSupply -= amount;

        // emit escrow unstaked event and index account
        emit EscrowUnstaked(account, amount);
    }

    /// @notice unstake all available staked non-escrowed tokens and
    /// claim any rewards
    function exit() external override {
        unstake(nonEscrowedBalanceOf(msg.sender));
        getReward();
    }    

    /*///////////////////////////////////////////////////////////////
                            CLAIM REWARDS
    ///////////////////////////////////////////////////////////////*/

    /// @notice caller claims any rewards generated from staking
    /// @dev rewards are escrowed in RewardEscrow
    /// @dev updateReward() called prior to function logic
    function getReward() public override nonReentrant updateReward(msg.sender) {
        uint256 reward = rewards[msg.sender];
        if (reward > 0) {
            // update state (first)
            rewards[msg.sender] = 0;

            // transfer token from this contract to the caller
            token.safeTransfer(address(rewardEscrow), reward);
            rewardEscrow.appendVestingEntry(msg.sender, reward, 52 weeks);

            // emit reward claimed event and index msg.sender
            emit RewardPaid(msg.sender, reward);
        }
    }

    /*///////////////////////////////////////////////////////////////
                        REWARD UPDATE CALCULATIONS
    ///////////////////////////////////////////////////////////////*/

    /// @notice update reward state for the account and contract
    /// @param account: address of account which rewards are being updated for
    /// @dev contract state not specific to an account will be updated also
    modifier updateReward(address account) {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();

        if (account != address(0)) {
            // update amount of rewards a user can claim
            rewards[account] = earned(account);

            // update reward per token staked AT this given time
            // (i.e. when this user is interacting with StakingRewards)
            userRewardPerTokenPaid[account] = rewardPerTokenStored;
        }
        _;
    }

    /// @notice calculate running sum of reward per total tokens staked
    /// at this specific time
    /// @return running sum of reward per total tokens staked
    function rewardPerToken() public view override returns (uint256) {
        if (_totalSupply == 0) {
            return rewardPerTokenStored;
        }

        return
            rewardPerTokenStored +
            (((lastTimeRewardApplicable() - lastUpdateTime) *
                rewardRate *
                1e18) / (_totalSupply));
    }

    /// @return timestamp of the last time rewards are applicable
    function lastTimeRewardApplicable() public view override returns (uint256) {
        return block.timestamp < periodFinish ? block.timestamp : periodFinish;
    }

    /// @notice determine how much reward token an account has earned thus far
    /// @param account: address of account earned amount is being calculated for
    function earned(address account) public view override returns (uint256) {
        return
            ((balances[account] *
                (rewardPerToken() - userRewardPerTokenPaid[account])) / 1e18) +
            rewards[account];
    }

    /*///////////////////////////////////////////////////////////////
                            SETTINGS
    ///////////////////////////////////////////////////////////////*/

    /// @notice configure reward rate
    /// @param reward: amount of token to be distributed over a period
    /// @dev updateReward() called prior to function logic (with zero address)
    function notifyRewardAmount(uint256 reward)
        external
        override
        onlySupplySchedule
        updateReward(address(0))
    {
        if (block.timestamp >= periodFinish) {
            rewardRate = reward / rewardsDuration;
        } else {
            uint256 remaining = periodFinish - block.timestamp;
            uint256 leftover = remaining * rewardRate;
            rewardRate = (reward + leftover) / rewardsDuration;
        }

        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp + rewardsDuration;
        emit RewardAdded(reward);
    }

    /// @notice set rewards duration
    /// @param _rewardsDuration: denoted in seconds
    function setRewardsDuration(uint256 _rewardsDuration)
        external
        override
        onlyOwner
    {
        require(
            block.timestamp > periodFinish,
            "StakingRewards: Previous rewards period must be complete before changing the duration for the new period"
        );
        rewardsDuration = _rewardsDuration;
        emit RewardsDurationUpdated(rewardsDuration);
    }

    /*///////////////////////////////////////////////////////////////
                            PAUSABLE
    ///////////////////////////////////////////////////////////////*/

    /// @dev Triggers stopped state
    function pauseStakingRewards() external override onlyOwner {
        Pausable._pause();
    }

    /// @dev Returns to normal state.
    function unpauseStakingRewards() external override onlyOwner {
        Pausable._unpause();
    }

    /*///////////////////////////////////////////////////////////////
                            MISCELLANEOUS
    ///////////////////////////////////////////////////////////////*/

    /// @notice added to support recovering LP Rewards from other systems
    /// such as BAL to be distributed to holders
    /// @param tokenAddress: address of token to be recovered
    /// @param tokenAmount: amount of token to be recovered
    function recoverERC20(address tokenAddress, uint256 tokenAmount)
        external
        override
        onlyOwner
    {
        require(
            tokenAddress != address(token),
            "StakingRewards: Cannot unstake the staking token"
        );
        IERC20(tokenAddress).safeTransfer(owner, tokenAmount);
        emit Recovered(tokenAddress, tokenAmount);
    }
}

File 2 of 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.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 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'
        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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

File 3 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.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].
 */
abstract 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() {
        _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;
    }
}

File 4 of 16 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 5 of 16 : Owned.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// https://docs.synthetix.io/contracts/source/contracts/owned
contract Owned {
    address public owner;
    address public nominatedOwner;

    constructor(address _owner) {
        require(_owner != address(0), "Owner address cannot be 0");
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}

File 6 of 16 : IStakingRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IStakingRewards {
    /// VIEWS
    // token state
    function totalSupply() external view returns (uint256);
    // staking state
    function balanceOf(address account) external view returns (uint256);
    function escrowedBalanceOf(address account) external view returns (uint256);
    function nonEscrowedBalanceOf(address account) external view returns (uint256);
    // rewards
    function getRewardForDuration() external view returns (uint256);
    function rewardPerToken() external view returns (uint256);
    function lastTimeRewardApplicable() external view returns (uint256);
    function earned(address account) external view returns (uint256);

    /// MUTATIVE
    // Staking/Unstaking
    function stake(uint256 amount) external;
    function unstake(uint256 amount) external;
    function stakeEscrow(address account, uint256 amount) external;
    function unstakeEscrow(address account, uint256 amount) external;
    function exit() external;
    // claim rewards
    function getReward() external;
    // settings
    function notifyRewardAmount(uint256 reward) external;
    function setRewardsDuration(uint256 _rewardsDuration) external;
    // pausable
    function pauseStakingRewards() external;
    function unpauseStakingRewards() external;
    // misc.
    function recoverERC20(address tokenAddress, uint256 tokenAmount) external;
}

File 7 of 16 : ISupplySchedule.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.24;

interface ISupplySchedule {
    // Views
    function mintableSupply() external view returns (uint);

    function isMintable() external view returns (bool);

    // Mutative functions

    function mint() external;

    function setTreasuryDiversion(uint _treasuryDiversion) external;

    function setTradingRewardsDiversion(uint _tradingRewardsDiversion) external;
    
    function setStakingRewards(address _stakingRewards) external;

    function setTradingRewards(address _tradingRewards) external;
}

File 8 of 16 : IRewardEscrow.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

library VestingEntries {
    struct VestingEntry {
        uint64 endTime;
        uint256 escrowAmount;
        uint256 duration;
    }
    struct VestingEntryWithID {
        uint64 endTime;
        uint256 escrowAmount;
        uint256 entryID;
    }
}

interface IRewardEscrow {
    // Views
    function getKwentaAddress() external view returns (address);

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

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

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

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

    function getVestingQuantity(address account, uint256[] calldata entryIDs)
        external
        view
        returns (uint256, uint256);

    function getVestingSchedules(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (VestingEntries.VestingEntryWithID[] memory);

    function getAccountVestingEntryIDs(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (uint256[] memory);

    function getVestingEntryClaimable(address account, uint256 entryID)
        external
        view
        returns (uint256, uint256);

    function getVestingEntry(address account, uint256 entryID)
        external
        view
        returns (
            uint64,
            uint256,
            uint256
        );

    // Mutative functions
    function vest(uint256[] calldata entryIDs) external;

    function createEscrowEntry(
        address beneficiary,
        uint256 deposit,
        uint256 duration
    ) external;

    function appendVestingEntry(
        address account,
        uint256 quantity,
        uint256 duration
    ) external;

    function stakeEscrow(uint256 _amount) external;

    function unstakeEscrow(uint256 _amount) external;
}

File 9 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 10 of 16 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        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");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 12 of 16 : StakingRewards.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.6.0;

import "../contracts/StakingRewards.sol";

contract $StakingRewards is StakingRewards {
    constructor(address _token, address _rewardEscrow, address _supplySchedule) StakingRewards(_token, _rewardEscrow, _supplySchedule) {}

    function $_pause() external {
        return super._pause();
    }

    function $_unpause() external {
        return super._unpause();
    }

    function $_msgSender() external view returns (address) {
        return super._msgSender();
    }

    function $_msgData() external view returns (bytes memory) {
        return super._msgData();
    }
}

File 13 of 16 : IRewardEscrow.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.6.0;

import "../../contracts/interfaces/IRewardEscrow.sol";

contract $VestingEntries {
    constructor() {}
}

abstract contract $IRewardEscrow is IRewardEscrow {
    constructor() {}
}

File 14 of 16 : IStakingRewards.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.6.0;

import "../../contracts/interfaces/IStakingRewards.sol";

abstract contract $IStakingRewards is IStakingRewards {
    constructor() {}
}

File 15 of 16 : ISupplySchedule.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.6.0;

import "../../contracts/interfaces/ISupplySchedule.sol";

abstract contract $ISupplySchedule is ISupplySchedule {
    constructor() {}
}

File 16 of 16 : Owned.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.6.0;

import "../../contracts/utils/Owned.sol";

contract $Owned is Owned {
    constructor(address _owner) Owned(_owner) {}
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_rewardEscrow","type":"address"},{"internalType":"address","name":"_supplySchedule","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EscrowStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EscrowUnstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"RewardsDurationUpdated","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstaked","type":"event"},{"inputs":[],"name":"_totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"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":[{"internalType":"address","name":"account","type":"address"}],"name":"escrowedBalanceOf","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":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"nonEscrowedBalanceOf","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":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseStakingRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardEscrow","outputs":[{"internalType":"contract IRewardEscrow","name":"","type":"address"}],"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":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardsDuration","type":"uint256"}],"name":"setRewardsDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stakeEscrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supplySchedule","outputs":[{"internalType":"contract ISupplySchedule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","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":[],"name":"unpauseStakingRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstakeEscrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60e06040526000600655600060075562093a806008553480156200002257600080fd5b506040516200378b3803806200378b833981810160405281019062000048919062000221565b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620000bc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000b390620002e2565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60008260405162000130929190620002b5565b60405180910390a15060016002819055506000600360006101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250508073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff1660601b8152505050505062000391565b6000815190506200021b8162000377565b92915050565b6000806000606084860312156200023d576200023c62000349565b5b60006200024d868287016200020a565b935050602062000260868287016200020a565b925050604062000273868287016200020a565b9150509250925092565b620002888162000315565b82525050565b60006200029d60198362000304565b9150620002aa826200034e565b602082019050919050565b6000604082019050620002cc60008301856200027d565b620002db60208301846200027d565b9392505050565b60006020820190508181036000830152620002fd816200028e565b9050919050565b600082825260208201905092915050565b6000620003228262000329565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000600082015250565b620003828162000315565b81146200038e57600080fd5b50565b60805160601c60a05160601c60c05160601c6133826200040960003960008181610b080152611acd015260008181610efe01528181610f660152818161150b015281816117d80152611b43015260008181610a6201528181610f200152818161135e01528181611a2c0152611fa601526133826000f3fe608060405234801561001057600080fd5b50600436106102105760003560e01c80637b0a47ee11610125578063c40dd66f116100ad578063cd3daf9d1161007c578063cd3daf9d146105a5578063df136d65146105c3578063e9fad8ee146105e1578063ebe2b12b146105eb578063fc0c546a1461060957610210565b8063c40dd66f14610531578063c8f33c911461054f578063c9c7da161461056d578063cc1a378f1461058957610210565b80638b876347116100f45780638b8763471461048d5780638da5cb5b146104bd578063985134fb146104db578063a430be6c146104f7578063a694fc3a1461051557610210565b80637b0a47ee1461042b57806380faa57d146104495780638980f11f1461046757806389997f9a1461048357610210565b80633c6b16ab116101a857806353a47bb71161017757806353a47bb7146103ab5780635c975abb146103c95780636079916f146103e757806370a08231146103f157806379ba50971461042157610210565b80633c6b16ab146103375780633d18b912146103535780633eaaf86b1461035d578063514a16c91461037b57610210565b806318160ddd116101e457806318160ddd146102c15780631c1f78eb146102df5780632e17de78146102fd578063386a95251461031957610210565b80628cc26214610215578063057a601b146102455780630700037d146102755780631627540c146102a5575b600080fd5b61022f600480360381019061022a9190612560565b610627565b60405161023c9190612c67565b60405180910390f35b61025f600480360381019061025a9190612560565b610729565b60405161026c9190612c67565b60405180910390f35b61028f600480360381019061028a9190612560565b610772565b60405161029c9190612c67565b60405180910390f35b6102bf60048036038101906102ba9190612560565b61078a565b005b6102c961080d565b6040516102d69190612c67565b60405180910390f35b6102e7610817565b6040516102f49190612c67565b60405180910390f35b610317600480360381019061031291906125fa565b61082e565b005b610321610b00565b60405161032e9190612c67565b60405180910390f35b610351600480360381019061034c91906125fa565b610b06565b005b61035b610d37565b005b610365611052565b6040516103729190612c67565b60405180910390f35b61039560048036038101906103909190612560565b611058565b6040516103a29190612c67565b60405180910390f35b6103b36110eb565b6040516103c0919061291e565b60405180910390f35b6103d1611111565b6040516103de91906129f9565b60405180910390f35b6103ef611128565b005b61040b60048036038101906104069190612560565b61113a565b6040516104189190612c67565b60405180910390f35b610429611183565b005b610433611334565b6040516104409190612c67565b60405180910390f35b61045161133a565b60405161045e9190612c67565b60405180910390f35b610481600480360381019061047c919061258d565b611354565b005b61048b611473565b005b6104a760048036038101906104a29190612560565b611485565b6040516104b49190612c67565b60405180910390f35b6104c561149d565b6040516104d2919061291e565b60405180910390f35b6104f560048036038101906104f0919061258d565b6114c1565b005b6104ff6117d6565b60405161050c9190612a2f565b60405180910390f35b61052f600480360381019061052a91906125fa565b6117fa565b005b610539611acb565b6040516105469190612a4a565b60405180910390f35b610557611aef565b6040516105649190612c67565b60405180910390f35b6105876004803603810190610582919061258d565b611af5565b005b6105a3600480360381019061059e91906125fa565b611e83565b005b6105ad611f12565b6040516105ba9190612c67565b60405180910390f35b6105cb611f7d565b6040516105d89190612c67565b60405180910390f35b6105e9611f83565b005b6105f3611f9e565b6040516106009190612c67565b60405180910390f35b610611611fa4565b60405161061e9190612a14565b60405180910390f35b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054670de0b6b3a7640000600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106ba611f12565b6106c49190612d95565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461070e9190612d3b565b6107189190612d0a565b6107229190612cb4565b9050919050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d6020528060005260406000206000915090505481565b610792611fc8565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2281604051610802919061291e565b60405180910390a150565b6000600b54905090565b60006008546007546108299190612d3b565b905090565b600280541415610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612c47565b60405180910390fd5b6002808190555033610883611f12565b600a8190555061089161133a565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461095e576108d481610627565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600082116109a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099890612c27565b60405180910390fd5b6109aa33611058565b8211156109ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e390612ac7565b60405180910390fd5b81600b60008282546109fe9190612d95565b9250508190555081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610a549190612d95565b92505081905550610aa633837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120589092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f0f5bb82176feb1b5e747e28471aa92156a04d9f3ab9f45f28e2d704232b93f7583604051610aec9190612c67565b60405180910390a250600160028190555050565b60085481565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b90612bc7565b60405180910390fd5b6000610b9e611f12565b600a81905550610bac61133a565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610c7957610bef81610627565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6006544210610c9b5760085482610c909190612d0a565b600781905550610ce1565b600042600654610cab9190612d95565b9050600060075482610cbd9190612d3b565b90506008548185610cce9190612cb4565b610cd89190612d0a565b60078190555050505b4260098190555060085442610cf69190612cb4565b6006819055507fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d82604051610d2b9190612c67565b60405180910390a15050565b600280541415610d7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7390612c47565b60405180910390fd5b6002808190555033610d8c611f12565b600a81905550610d9a61133a565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e6757610ddd81610627565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115611046576000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f647f0000000000000000000000000000000000000000000000000000000000000000827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166120589092919063ffffffff16565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631bb47b4433836301dfe2006040518463ffffffff1660e01b8152600401610fc5939291906129c2565b600060405180830381600087803b158015610fdf57600080fd5b505af1158015610ff3573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04868260405161103d9190612c67565b60405180910390a25b50506001600281905550565b600b5481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110e49190612d95565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900460ff16905090565b611130611fc8565b6111386120de565b565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611213576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120a90612aa7565b60405180910390fd5b7fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051611286929190612939565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b6000600654421061134d5760065461134f565b425b905090565b61135c611fc8565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e290612b07565b60405180910390fd5b61143660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff166120589092919063ffffffff16565b7f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa288282604051611467929190612999565b60405180910390a15050565b61147b611fc8565b611483612181565b565b600c6020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6114c9611111565b15611509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150090612b27565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612ba7565b60405180910390fd5b816115a0611f12565b600a819055506115ae61133a565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461167b576115f181610627565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600082116116be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b590612b87565b60405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461170d9190612cb4565b9250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546117639190612cb4565b9250508190555081600b600082825461177c9190612cb4565b925050819055508273ffffffffffffffffffffffffffffffffffffffff167f945856e466506640ce955f1ec0de49513761175bad680d8503f7c8d45beabb20836040516117c99190612c67565b60405180910390a2505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60028054141561183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690612c47565b60405180910390fd5b6002808190555061184e611111565b1561188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188590612b27565b60405180910390fd5b33611897611f12565b600a819055506118a561133a565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611972576118e881610627565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600082116119b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ac90612b87565b60405180910390fd5b81600b60008282546119c79190612cb4565b9250508190555081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611a1d9190612cb4565b92505081905550611a713330847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16612223909392919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d83604051611ab79190612c67565b60405180910390a250600160028190555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60095481565b600280541415611b3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3190612c47565b60405180910390fd5b600280819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc690612ba7565b60405180910390fd5b81611bd8611f12565b600a81905550611be661133a565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611cb357611c2981610627565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60008211611cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ced90612c27565b60405180910390fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611d78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6f90612ac7565b60405180910390fd5b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611dc79190612d95565b9250508190555081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e1d9190612d95565b9250508190555081600b6000828254611e369190612d95565b925050819055507fbd0d30ac1729a6f57b09c27c8f39102f2704fbbf708747dcd198e45cf27f52828383604051611e6e929190612999565b60405180910390a15060016002819055505050565b611e8b611fc8565b6006544211611ecf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec690612b67565b60405180910390fd5b806008819055507ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d3600854604051611f079190612c67565b60405180910390a150565b600080600b541415611f2857600a549050611f7a565b600b54670de0b6b3a7640000600754600954611f4261133a565b611f4c9190612d95565b611f569190612d3b565b611f609190612d3b565b611f6a9190612d0a565b600a54611f779190612cb4565b90505b90565b600a5481565b611f94611f8f33611058565b61082e565b611f9c610d37565b565b60065481565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612056576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204d90612b47565b60405180910390fd5b565b6120d98363a9059cbb60e01b8484604051602401612077929190612999565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506122ac565b505050565b6120e6611111565b15612126576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211d90612b27565b60405180910390fd5b6001600360006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861216a612373565b604051612177919061291e565b60405180910390a1565b612189611111565b6121c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bf90612a87565b60405180910390fd5b6000600360006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61220c612373565b604051612219919061291e565b60405180910390a1565b6122a6846323b872dd60e01b85858560405160240161224493929190612962565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506122ac565b50505050565b600061230e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661237b9092919063ffffffff16565b905060008151111561236e578080602001905181019061232e91906125cd565b61236d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236490612c07565b60405180910390fd5b5b505050565b600033905090565b606061238a8484600085612393565b90509392505050565b6060824710156123d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123cf90612ae7565b60405180910390fd5b6123e1856124a7565b612420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241790612be7565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516124499190612907565b60006040518083038185875af1925050503d8060008114612486576040519150601f19603f3d011682016040523d82523d6000602084013e61248b565b606091505b509150915061249b8282866124ba565b92505050949350505050565b600080823b905060008111915050919050565b606083156124ca5782905061251a565b6000835111156124dd5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125119190612a65565b60405180910390fd5b9392505050565b60008135905061253081613307565b92915050565b6000815190506125458161331e565b92915050565b60008135905061255a81613335565b92915050565b60006020828403121561257657612575612f0e565b5b600061258484828501612521565b91505092915050565b600080604083850312156125a4576125a3612f0e565b5b60006125b285828601612521565b92505060206125c38582860161254b565b9150509250929050565b6000602082840312156125e3576125e2612f0e565b5b60006125f184828501612536565b91505092915050565b6000602082840312156126105761260f612f0e565b5b600061261e8482850161254b565b91505092915050565b61263081612dc9565b82525050565b61263f81612ddb565b82525050565b600061265082612c82565b61265a8185612c98565b935061266a818560208601612e7d565b80840191505092915050565b61267f81612e11565b82525050565b61268e81612e23565b82525050565b61269d81612e35565b82525050565b6126ac81612e47565b82525050565b60006126bd82612c8d565b6126c78185612ca3565b93506126d7818560208601612e7d565b6126e081612f13565b840191505092915050565b60006126f8601483612ca3565b915061270382612f24565b602082019050919050565b600061271b603583612ca3565b915061272682612f4d565b604082019050919050565b600061273e601e83612ca3565b915061274982612f9c565b602082019050919050565b6000612761602683612ca3565b915061276c82612fc5565b604082019050919050565b6000612784603083612ca3565b915061278f82613014565b604082019050919050565b60006127a7601083612ca3565b91506127b282613063565b602082019050919050565b60006127ca602f83612ca3565b91506127d58261308c565b604082019050919050565b60006127ed606883612ca3565b91506127f8826130db565b608082019050919050565b6000612810601e83612ca3565b915061281b82613176565b602082019050919050565b6000612833602283612ca3565b915061283e8261319f565b604082019050919050565b6000612856602483612ca3565b9150612861826131ee565b604082019050919050565b6000612879601d83612ca3565b91506128848261323d565b602082019050919050565b600061289c602a83612ca3565b91506128a782613266565b604082019050919050565b60006128bf602083612ca3565b91506128ca826132b5565b602082019050919050565b60006128e2601f83612ca3565b91506128ed826132de565b602082019050919050565b61290181612e07565b82525050565b60006129138284612645565b915081905092915050565b60006020820190506129336000830184612627565b92915050565b600060408201905061294e6000830185612627565b61295b6020830184612627565b9392505050565b60006060820190506129776000830186612627565b6129846020830185612627565b61299160408301846128f8565b949350505050565b60006040820190506129ae6000830185612627565b6129bb60208301846128f8565b9392505050565b60006060820190506129d76000830186612627565b6129e460208301856128f8565b6129f160408301846126a3565b949350505050565b6000602082019050612a0e6000830184612636565b92915050565b6000602082019050612a296000830184612676565b92915050565b6000602082019050612a446000830184612685565b92915050565b6000602082019050612a5f6000830184612694565b92915050565b60006020820190508181036000830152612a7f81846126b2565b905092915050565b60006020820190508181036000830152612aa0816126eb565b9050919050565b60006020820190508181036000830152612ac08161270e565b9050919050565b60006020820190508181036000830152612ae081612731565b9050919050565b60006020820190508181036000830152612b0081612754565b9050919050565b60006020820190508181036000830152612b2081612777565b9050919050565b60006020820190508181036000830152612b408161279a565b9050919050565b60006020820190508181036000830152612b60816127bd565b9050919050565b60006020820190508181036000830152612b80816127e0565b9050919050565b60006020820190508181036000830152612ba081612803565b9050919050565b60006020820190508181036000830152612bc081612826565b9050919050565b60006020820190508181036000830152612be081612849565b9050919050565b60006020820190508181036000830152612c008161286c565b9050919050565b60006020820190508181036000830152612c208161288f565b9050919050565b60006020820190508181036000830152612c40816128b2565b9050919050565b60006020820190508181036000830152612c60816128d5565b9050919050565b6000602082019050612c7c60008301846128f8565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000612cbf82612e07565b9150612cca83612e07565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612cff57612cfe612eb0565b5b828201905092915050565b6000612d1582612e07565b9150612d2083612e07565b925082612d3057612d2f612edf565b5b828204905092915050565b6000612d4682612e07565b9150612d5183612e07565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612d8a57612d89612eb0565b5b828202905092915050565b6000612da082612e07565b9150612dab83612e07565b925082821015612dbe57612dbd612eb0565b5b828203905092915050565b6000612dd482612de7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612e1c82612e59565b9050919050565b6000612e2e82612e59565b9050919050565b6000612e4082612e59565b9050919050565b6000612e5282612e07565b9050919050565b6000612e6482612e6b565b9050919050565b6000612e7682612de7565b9050919050565b60005b83811015612e9b578082015181840152602081019050612e80565b83811115612eaa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560008201527f2063616e20616363657074206f776e6572736869700000000000000000000000602082015250565b7f5374616b696e67526577617264733a20496e76616c696420416d6f756e740000600082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f5374616b696e67526577617264733a2043616e6e6f7420756e7374616b65207460008201527f6865207374616b696e6720746f6b656e00000000000000000000000000000000602082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660008201527f6f726d207468697320616374696f6e0000000000000000000000000000000000602082015250565b7f5374616b696e67526577617264733a2050726576696f7573207265776172647360008201527f20706572696f64206d75737420626520636f6d706c657465206265666f72652060208201527f6368616e67696e6720746865206475726174696f6e20666f7220746865206e6560408201527f7720706572696f64000000000000000000000000000000000000000000000000606082015250565b7f5374616b696e67526577617264733a2043616e6e6f74207374616b6520300000600082015250565b7f5374616b696e67526577617264733a204f6e6c7920526577617264204573637260008201527f6f77000000000000000000000000000000000000000000000000000000000000602082015250565b7f5374616b696e67526577617264733a204f6e6c7920537570706c79205363686560008201527f64756c6500000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5374616b696e67526577617264733a2043616e6e6f7420556e7374616b652030600082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b61331081612dc9565b811461331b57600080fd5b50565b61332781612ddb565b811461333257600080fd5b50565b61333e81612e07565b811461334957600080fd5b5056fea264697066735822122075771eb759f0d2fa58617bdb3c9f0a718a1c873dcd567101f876bf201342941564736f6c63430008070033000000000000000000000000da0c33402fc1e10d18c532f0ed9c1a6c5c9e386c000000000000000000000000afd87d1a62260bd5714c55a1bb4057bdc8dfa413000000000000000000000000671423b2e8a99882fd14bbd07e90ae8b64a0e63a

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

000000000000000000000000da0c33402fc1e10d18c532f0ed9c1a6c5c9e386c000000000000000000000000afd87d1a62260bd5714c55a1bb4057bdc8dfa413000000000000000000000000671423b2e8a99882fd14bbd07e90ae8b64a0e63a

-----Decoded View---------------
Arg [0] : _token (address): 0xDA0C33402Fc1e10d18c532F0Ed9c1A6c5C9e386C
Arg [1] : _rewardEscrow (address): 0xaFD87d1a62260bD5714C55a1BB4057bDc8dFA413
Arg [2] : _supplySchedule (address): 0x671423b2e8a99882FD14BbD07e90Ae8B64A0E63A

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000da0c33402fc1e10d18c532f0ed9c1a6c5c9e386c
Arg [1] : 000000000000000000000000afd87d1a62260bd5714c55a1bb4057bdc8dfa413
Arg [2] : 000000000000000000000000671423b2e8a99882fd14bbd07e90ae8b64a0e63a


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading