Contract 0xd0BaA984Cd2D25A555710B4f199e873Af668866a

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xfd9828f534df3bfb9af6bcb9dbd4667453b39a3c104a7998da25d4077d4cf88aExit85667112022-03-25 10:14:18100 days 16 hrs ago0x96a2699644a7be70a4f6bf4d42548f765399d649 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000192113613 ETH
0xbe2a6e644ffde788d449869ba15c5a780fe9c9af64a72627565dfe9eb54ad5abExit68858162022-02-25 14:04:37128 days 13 hrs ago0xbfef9cb0e0bfc34087af07cbad4312a0f64b817b IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000315738958 ETH
0x4bd57d002c4fec159a97baf807cd561deb17911a10bb392deb0dfb6c9530cf2fExit68758472022-02-25 10:41:19128 days 16 hrs ago0xf66257823682ac8ee6a6082e844bdcfa368a10f6 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000301770442 ETH
0x1001cd02d89454e0e0ca200d4557b463cdec5eb5275a5cd58d91c06544fdc7d5Get Reward63104182022-02-18 11:29:03135 days 15 hrs ago0xf66257823682ac8ee6a6082e844bdcfa368a10f6 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000320992054 ETH
0xfc7e2b2ca3c918294e637ae84ffd470d92d93f24f76548cb04e942f39dbe1542Exit59405272022-02-12 19:43:37141 days 7 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000358125119 ETH
0xc8aa904827d49e4cb6916ea897b19d09d6c8707738767522e5ac1f19d0f572c4Get Reward57354192022-02-09 16:57:31144 days 10 hrs ago0xf66257823682ac8ee6a6082e844bdcfa368a10f6 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000362000484 ETH
0xfd01f9bcbeb95f1537295f7eec4e480606555394c8b12a86f89f632dcf50119aStake56435682022-02-08 14:07:41145 days 12 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000374837599 ETH
0xf429102aa67c0e9a49b1246b356ff7a3c122e1d7a847280d05bf68d9f7be0369Stake55142012022-02-06 17:11:21147 days 9 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000367814367 ETH
0xb73dce0b6d2cfe88e2b72f0cb9f0efad45487a6dfb0acad4d7a2e2e2ef9209dfGet Reward55140822022-02-06 17:09:28147 days 9 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000312520122 ETH
0x1d66f44bcb55018b3e4a28115ddef75e1e5dc72aff44cdc01a2338b7d8294353Stake54505242022-02-05 14:16:55148 days 12 hrs ago0xbfef9cb0e0bfc34087af07cbad4312a0f64b817b IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000500436925 ETH
0x6c56c04f7082175b110262f6e7302ac39e31bcf8405be2842e95da3ad809b9abStake54472592022-02-05 11:02:19148 days 16 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000515442097 ETH
0x0686dfa3c6a3f5c7ba2d3fe37ff81b0a29489a760c70319eb7165ccb2f6f6433Get Reward54444922022-02-05 8:13:09148 days 18 hrs ago0xbfef9cb0e0bfc34087af07cbad4312a0f64b817b IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000458568586 ETH
0xd4121a816f97937d0aa2d5893d537542951b2d7598652b7bb8f30a293284160dExit53209042022-02-01 15:43:26152 days 11 hrs ago0x03b69bacb4af22ce577510329807116d57a55d8d IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000503896392 ETH
0x6b7eb1a395e5c579038a4d8c49462d967d7ea28d5468825ac794e6601062bd7fGet Reward53204292022-02-01 15:27:54152 days 11 hrs ago0x03b69bacb4af22ce577510329807116d57a55d8d IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.00044619075 ETH
0xe20fb713700c3aceed45bf06df9867244951f1fb380f81b8eb6468e645314b1fStake52926002022-01-31 20:06:33153 days 6 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000529605945 ETH
0x53e4e8eda143272d8bd1ac38ef5dd38676ddbeef93dbe86839b429d9286120caGet Reward51285142022-01-27 13:17:26157 days 13 hrs ago0xf66257823682ac8ee6a6082e844bdcfa368a10f6 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000567759475 ETH
0x43c3bdab6cc98fdf9ccde5b2553524aa9ec3fc134b83608c27abf4eccc457106Stake51240502022-01-27 10:21:22157 days 16 hrs ago0x03b69bacb4af22ce577510329807116d57a55d8d IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000614010224 ETH
0xe5aa3c5214f70b473a6fa3c5cf3e61da7be930061d5c76d1f14120555dc71105Get Reward51238792022-01-27 10:15:49157 days 16 hrs ago0x03b69bacb4af22ce577510329807116d57a55d8d IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000518057104 ETH
0x47f9fb74092a481a4aa737411c1637732e08146cc1afbdb15b8e967ac3d78b41Exit48752312022-01-21 22:44:57163 days 4 hrs ago0x705f8f0eaac561aabb1d5d8f4d0dab36d5a62e86 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000768982397 ETH
0xacabda6f307cac3c63e19fffcd423ae04450e19ba3e1fe0a9874f929735aad39Get Reward48558992022-01-21 11:41:47163 days 15 hrs ago0xf66257823682ac8ee6a6082e844bdcfa368a10f6 IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000841460192 ETH
0x40ba9c202fca3cff55764d9474c1c0dc59711477c4f045c4b38685e9de0aebabStake48551942022-01-21 10:58:30163 days 16 hrs ago0x03b69bacb4af22ce577510329807116d57a55d8d IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.001013831538 ETH
0x76f5d5b67f5ffd4509e9eada2569786c553dfa50599a57525c9de08f0dfe5bcdExit48550762022-01-21 10:51:38163 days 16 hrs ago0x03b69bacb4af22ce577510329807116d57a55d8d IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000979788987 ETH
0x56d9995831ff576c0fe1aec780a51dfd81f31778e2a9eec8c52f28d6d4bc7906Stake48550472022-01-21 10:48:24163 days 16 hrs ago0x03b69bacb4af22ce577510329807116d57a55d8d IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.001012069619 ETH
0x1a9f630e95a15d8ef6aade3ee469f782e5475391459a1bf8d81356086d2c08e2Get Reward48549412022-01-21 10:41:04163 days 16 hrs ago0x03b69bacb4af22ce577510329807116d57a55d8d IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000979315074 ETH
0x304da6de04476d5ba91d551ecb5591fbdeddc21068f0a3dd4daccda23ad99358Stake47306122022-01-17 13:51:35167 days 13 hrs ago0xbfef9cb0e0bfc34087af07cbad4312a0f64b817b IN 0xd0baa984cd2d25a555710b4f199e873af668866a0 ETH0.000960000824 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xfd9828f534df3bfb9af6bcb9dbd4667453b39a3c104a7998da25d4077d4cf88a85667112022-03-25 10:14:18100 days 16 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0xfd9828f534df3bfb9af6bcb9dbd4667453b39a3c104a7998da25d4077d4cf88a85667112022-03-25 10:14:18100 days 16 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x790b4a80fb1094589a3c0efc8740aa9b0c1733fb0 ETH
0xfd9828f534df3bfb9af6bcb9dbd4667453b39a3c104a7998da25d4077d4cf88a85667112022-03-25 10:14:18100 days 16 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a dForce: DF Token0 ETH
0xfd9828f534df3bfb9af6bcb9dbd4667453b39a3c104a7998da25d4077d4cf88a85667112022-03-25 10:14:18100 days 16 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a0xd7efe569bc7081a3bee3b27232eea7545e36a16e0 ETH
0xbe2a6e644ffde788d449869ba15c5a780fe9c9af64a72627565dfe9eb54ad5ab68858162022-02-25 14:04:37128 days 13 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0xbe2a6e644ffde788d449869ba15c5a780fe9c9af64a72627565dfe9eb54ad5ab68858162022-02-25 14:04:37128 days 13 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x790b4a80fb1094589a3c0efc8740aa9b0c1733fb0 ETH
0xbe2a6e644ffde788d449869ba15c5a780fe9c9af64a72627565dfe9eb54ad5ab68858162022-02-25 14:04:37128 days 13 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a dForce: DF Token0 ETH
0xbe2a6e644ffde788d449869ba15c5a780fe9c9af64a72627565dfe9eb54ad5ab68858162022-02-25 14:04:37128 days 13 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a0xd7efe569bc7081a3bee3b27232eea7545e36a16e0 ETH
0x4bd57d002c4fec159a97baf807cd561deb17911a10bb392deb0dfb6c9530cf2f68758472022-02-25 10:41:19128 days 16 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0x4bd57d002c4fec159a97baf807cd561deb17911a10bb392deb0dfb6c9530cf2f68758472022-02-25 10:41:19128 days 16 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x790b4a80fb1094589a3c0efc8740aa9b0c1733fb0 ETH
0x4bd57d002c4fec159a97baf807cd561deb17911a10bb392deb0dfb6c9530cf2f68758472022-02-25 10:41:19128 days 16 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a dForce: DF Token0 ETH
0x4bd57d002c4fec159a97baf807cd561deb17911a10bb392deb0dfb6c9530cf2f68758472022-02-25 10:41:19128 days 16 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a0xd7efe569bc7081a3bee3b27232eea7545e36a16e0 ETH
0x3825c24545439b2514342befbbeb14df2f124e054e208a14fcd193ee8e17c46268721052022-02-25 9:15:13128 days 17 hrs ago 0xc0dc7c5057141c9065bd9bedf79fd4e9ea69a7390xd0baa984cd2d25a555710b4f199e873af668866a0 ETH
0x1001cd02d89454e0e0ca200d4557b463cdec5eb5275a5cd58d91c06544fdc7d563104182022-02-18 11:29:03135 days 15 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0x1001cd02d89454e0e0ca200d4557b463cdec5eb5275a5cd58d91c06544fdc7d563104182022-02-18 11:29:03135 days 15 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a dForce: DF Token0 ETH
0xfc7e2b2ca3c918294e637ae84ffd470d92d93f24f76548cb04e942f39dbe154259405272022-02-12 19:43:37141 days 7 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0xfc7e2b2ca3c918294e637ae84ffd470d92d93f24f76548cb04e942f39dbe154259405272022-02-12 19:43:37141 days 7 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x790b4a80fb1094589a3c0efc8740aa9b0c1733fb0 ETH
0xfc7e2b2ca3c918294e637ae84ffd470d92d93f24f76548cb04e942f39dbe154259405272022-02-12 19:43:37141 days 7 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a dForce: DF Token0 ETH
0xfc7e2b2ca3c918294e637ae84ffd470d92d93f24f76548cb04e942f39dbe154259405272022-02-12 19:43:37141 days 7 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a0xd7efe569bc7081a3bee3b27232eea7545e36a16e0 ETH
0x6659805cbd0b2e6d64ea03faf20fe0adbe382ea8802f58a4515950d0bb16dded58509032022-02-11 10:46:45142 days 16 hrs ago 0xc0dc7c5057141c9065bd9bedf79fd4e9ea69a7390xd0baa984cd2d25a555710b4f199e873af668866a0 ETH
0xc8aa904827d49e4cb6916ea897b19d09d6c8707738767522e5ac1f19d0f572c457354192022-02-09 16:57:31144 days 10 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x3f770ac673856f105b586bb393d122721265ad460 ETH
0xc8aa904827d49e4cb6916ea897b19d09d6c8707738767522e5ac1f19d0f572c457354192022-02-09 16:57:31144 days 10 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a dForce: DF Token0 ETH
0xfd01f9bcbeb95f1537295f7eec4e480606555394c8b12a86f89f632dcf50119a56435682022-02-08 14:07:41145 days 12 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x790b4a80fb1094589a3c0efc8740aa9b0c1733fb0 ETH
0xfd01f9bcbeb95f1537295f7eec4e480606555394c8b12a86f89f632dcf50119a56435682022-02-08 14:07:41145 days 12 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a0xd7efe569bc7081a3bee3b27232eea7545e36a16e0 ETH
0xf429102aa67c0e9a49b1246b356ff7a3c122e1d7a847280d05bf68d9f7be036955142012022-02-06 17:11:21147 days 9 hrs ago 0xd0baa984cd2d25a555710b4f199e873af668866a 0x790b4a80fb1094589a3c0efc8740aa9b0c1733fb0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingPool

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 9 : StakingPool.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";

import "./Ownable.sol";
import "./LPTokenWrapper.sol";

contract StakingPool is Ownable, LPTokenWrapper {
  using SafeERC20 for IERC20;

  IERC20 public rewardToken;

  uint256 public rewardRate = 0;
  uint256 public startTime;
  uint256 public lastUpdateTime;
  uint256 public rewardPerTokenStored;

  uint256 public lastRateUpdateTime;
  uint256 public rewardDistributedStored;

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

  event RewardRateUpdated(uint256 oldRewardRate, uint256 newRewardRate);
  event Staked(address indexed user, uint256 amount);
  event Withdrawn(address indexed user, uint256 amount);
  event RewardPaid(address indexed user, uint256 reward);

  constructor(
    address _lp,
    address _rewardToken,
    uint256 _startTime
  ) public {
    __Ownable_init();
    uni_lp = IERC20(_lp);
    rewardToken = IERC20(_rewardToken);
    startTime = _startTime;
  }

  modifier updateReward(address _account) {
    rewardPerTokenStored = rewardPerToken();
    lastUpdateTime = block.timestamp;
    if (_account != address(0)) {
      rewards[_account] = earned(_account);
      userRewardPerTokenPaid[_account] = rewardPerTokenStored;
    }
    _;
  }

  modifier updateRewardDistributed() {
    rewardDistributedStored = rewardDistributed();
    lastRateUpdateTime = block.timestamp;
    _;
  }

  function rewardPerToken() public view returns (uint256) {
    uint256 _lastTimeApplicable = Math.max(startTime, lastUpdateTime);

    if (totalSupply() == 0 || block.timestamp < _lastTimeApplicable) {
      return rewardPerTokenStored;
    }

    return
      rewardPerTokenStored.add(
        block.timestamp.sub(_lastTimeApplicable).mul(rewardRate).mul(1e18).div(
          totalSupply()
        )
      );
  }

  function rewardDistributed() public view returns (uint256) {
    // Have not started yet
    if (block.timestamp < startTime) {
      return rewardDistributedStored;
    }

    return
      rewardDistributedStored.add(
        block.timestamp.sub(Math.max(startTime, lastRateUpdateTime)).mul(
          rewardRate
        )
      );
  }

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

  // stake visibility is public as overriding LPTokenWrapper's stake() function
  function stake(uint256 _amount) public override updateReward(msg.sender) {
    require(_amount > 0, "Cannot stake 0");
    super.stake(_amount);
    emit Staked(msg.sender, _amount);
  }

  function withdraw(uint256 _amount) public override updateReward(msg.sender) {
    require(_amount > 0, "Cannot withdraw 0");
    super.withdraw(_amount);
    emit Withdrawn(msg.sender, _amount);
  }

  function exit() external {
    withdraw(balanceOf(msg.sender));
    getReward();
  }

  function getReward() public updateReward(msg.sender) {
    uint256 _reward = rewards[msg.sender];
    if (_reward > 0) {
      rewards[msg.sender] = 0;
      rewardToken.safeTransferFrom(owner, msg.sender, _reward);
      emit RewardPaid(msg.sender, _reward);
    }
  }

  function setRewardRate(uint256 _rewardRate)
    external
    onlyOwner
    updateRewardDistributed
    updateReward(address(0))
  {
    uint256 _oldRewardRate = rewardRate;
    rewardRate = _rewardRate;

    emit RewardRateUpdated(_oldRewardRate, _rewardRate);
  }

  // This function allows governance to take unsupported tokens out of the
  // contract, since this one exists longer than the other pools.
  // This is in an effort to make someone whole, should they seriously
  // mess up. There is no guarantee governance will vote to return these.
  // It also allows for removal of airdropped tokens.
  function rescueTokens(
    IERC20 _token,
    uint256 _amount,
    address _to
  ) external onlyOwner {
    // cant take staked asset
    require(_token != uni_lp, "uni_lp");

    // transfer _to
    _token.safeTransfer(_to, _amount);
  }
}

File 2 of 9 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

pragma solidity >=0.6.0 <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 4 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

File 5 of 9 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 6 of 9 : Ownable.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {_setPendingOwner} and {_acceptOwner}.
 */
contract Ownable {
    /**
     * @dev Returns the address of the current owner.
     */
    address payable public owner;

    /**
     * @dev Returns the address of the current pending owner.
     */
    address payable public pendingOwner;

    event NewOwner(address indexed previousOwner, address indexed newOwner);
    event NewPendingOwner(
        address indexed oldPendingOwner,
        address indexed newPendingOwner
    );

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

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

    /**
     * @notice Base on the inputing parameter `newPendingOwner` to check the exact error reason.
     * @dev Transfer contract control to a new owner. The newPendingOwner must call `_acceptOwner` to finish the transfer.
     * @param newPendingOwner New pending owner.
     */
    function _setPendingOwner(address payable newPendingOwner)
        external
        onlyOwner
    {
        require(
            newPendingOwner != address(0) && newPendingOwner != pendingOwner,
            "_setPendingOwner: New owenr can not be zero address and owner has been set!"
        );

        // Gets current owner.
        address oldPendingOwner = pendingOwner;

        // Sets new pending owner.
        pendingOwner = newPendingOwner;

        emit NewPendingOwner(oldPendingOwner, newPendingOwner);
    }

    /**
     * @dev Accepts the admin rights, but only for pendingOwenr.
     */
    function _acceptOwner() external {
        require(
            msg.sender == pendingOwner,
            "_acceptOwner: Only for pending owner!"
        );

        // Gets current values for events.
        address oldOwner = owner;
        address oldPendingOwner = pendingOwner;

        // Set the new contract owner.
        owner = pendingOwner;

        // Clear the pendingOwner.
        pendingOwner = address(0);

        emit NewOwner(oldOwner, owner);
        emit NewPendingOwner(oldPendingOwner, pendingOwner);
    }

    uint256[50] private __gap;
}

File 7 of 9 : LPTokenWrapper.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";

contract LPTokenWrapper {
  using SafeMath for uint256;
  using SafeERC20 for IERC20;

  IERC20 public uni_lp;

  uint256 private _totalSupply;

  mapping(address => uint256) private _balances;

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

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

  function stake(uint256 amount) public virtual {
    _totalSupply = _totalSupply.add(amount);
    _balances[msg.sender] = _balances[msg.sender].add(amount);
    uni_lp.safeTransferFrom(msg.sender, address(this), amount);
  }

  function withdraw(uint256 amount) public virtual {
    _totalSupply = _totalSupply.sub(amount);
    _balances[msg.sender] = _balances[msg.sender].sub(amount);
    uni_lp.safeTransfer(msg.sender, amount);
  }
}

File 8 of 9 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

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

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

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

pragma solidity >=0.6.2 <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;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

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

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

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

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_lp","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldPendingOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newPendingOwner","type":"address"}],"name":"NewPendingOwner","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":"oldRewardRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRewardRate","type":"uint256"}],"name":"RewardRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"_acceptOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newPendingOwner","type":"address"}],"name":"_setPendingOwner","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":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastRateUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardDistributedStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardRate","type":"uint256"}],"name":"setRewardRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uni_lp","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600060385534801561001557600080fd5b506040516113473803806113478339818101604052606081101561003857600080fd5b5080516020820151604090920151909190610051610089565b603480546001600160a01b039485166001600160a01b03199182161790915560378054939094169216919091179091556039556100ca565b600080546001600160a01b0319163390811782556040519091907f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364908290a3565b61126e806100d96000396000f3fe608060405234801561001057600080fd5b50600436106101725760003560e01c80638da5cb5b116100de578063df136d6511610097578063e9fad8ee11610071578063e9fad8ee14610352578063f7bc2afd1461035a578063f7c618c114610362578063fc4d33f91461036a57610172565b8063df136d651461033a578063e30c397814610342578063e9483ac01461034a57610172565b80638da5cb5b146102b25780639e447fc6146102ba578063a694fc3a146102d7578063b37fd190146102f4578063c8f33c911461032a578063cd3daf9d1461033257610172565b80636e96dfd7116101305780636e96dfd71461020c57806370a082311461023257806378e97925146102585780637b0a47ee1461026057806383d0fdc1146102685780638b8763471461028c57610172565b80628cc262146101775780630700037d146101af5780630762bed2146101d557806318160ddd146101dd5780632e1a7d4d146101e55780633d18b91214610204575b600080fd5b61019d6004803603602081101561018d57600080fd5b50356001600160a01b0316610372565b60408051918252519081900360200190f35b61019d600480360360208110156101c557600080fd5b50356001600160a01b03166103e0565b61019d6103f2565b61019d6103f8565b610202600480360360208110156101fb57600080fd5b50356103ff565b005b6102026104df565b6102026004803603602081101561022257600080fd5b50356001600160a01b03166105b4565b61019d6004803603602081101561024857600080fd5b50356001600160a01b03166106b0565b61019d6106cb565b61019d6106d1565b6102706106d7565b604080516001600160a01b039092168252519081900360200190f35b61019d600480360360208110156102a257600080fd5b50356001600160a01b03166106e6565b6102706106f8565b610202600480360360208110156102d057600080fd5b5035610707565b610202600480360360208110156102ed57600080fd5b50356107fc565b6102026004803603606081101561030a57600080fd5b506001600160a01b038135811691602081013591604090910135166108d9565b61019d610987565b61019d61098d565b61019d610a04565b610270610a0a565b61019d610a19565b610202610a5d565b61019d610a78565b610270610a7e565b610202610a8d565b6001600160a01b0381166000908152603f6020908152604080832054603e9092528220546103da91906103d490670de0b6b3a7640000906103ce906103bf906103b961098d565b90610b70565b6103c8886106b0565b90610bcd565b90610c2d565b90610c94565b92915050565b603f6020526000908152604090205481565b603c5481565b6035545b90565b3361040861098d565b603b5542603a556001600160a01b038116156104535761042781610372565b6001600160a01b0382166000908152603f6020908152604080832093909355603b54603e909152919020555b6000821161049c576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b6104a582610cee565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b336104e861098d565b603b5542603a556001600160a01b038116156105335761050781610372565b6001600160a01b0382166000908152603f6020908152604080832093909355603b54603e909152919020555b336000908152603f602052604090205480156105b057336000818152603f6020526040812081905554603754610579926001600160a01b03918216929091169084610d47565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b5050565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004018080602001828103825260228152602001806111c86022913960400191505060405180910390fd5b6001600160a01b0381161580159061062357506001546001600160a01b03828116911614155b61065e5760405162461bcd60e51b815260040180806020018281038252604b815260200180611136604b913960600191505060405180910390fd5b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b90600090a35050565b6001600160a01b031660009081526036602052604090205490565b60395481565b60385481565b6034546001600160a01b031681565b603e6020526000908152604090205481565b6000546001600160a01b031681565b6000546001600160a01b031633146107505760405162461bcd60e51b81526004018080602001828103825260228152602001806111c86022913960400191505060405180910390fd5b610758610a19565b603d5542603c55600061076961098d565b603b5542603a556001600160a01b038116156107b45761078881610372565b6001600160a01b0382166000908152603f6020908152604080832093909355603b54603e909152919020555b6038805490839055604080518281526020810185905281517fc390a98ace15a7bb6bab611eedfdbb2685043b241a869420043cdfb23ccfee50929181900390910190a1505050565b3361080561098d565b603b5542603a556001600160a01b038116156108505761082481610372565b6001600160a01b0382166000908152603f6020908152604080832093909355603b54603e909152919020555b60008211610896576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b61089f82610da7565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a25050565b6000546001600160a01b031633146109225760405162461bcd60e51b81526004018080602001828103825260228152602001806111c86022913960400191505060405180910390fd5b6034546001600160a01b038481169116141561096e576040805162461bcd60e51b81526020600482015260066024820152650756e695f6c760d41b604482015290519081900360640190fd5b6109826001600160a01b0384168284610dfe565b505050565b603a5481565b60008061099e603954603a54610e50565b90506109a86103f8565b15806109b357508042105b156109c2575050603b546103fc565b6109fe6109f56109d06103f8565b6103ce670de0b6b3a76400006103c86038546103c88842610b7090919063ffffffff16565b603b5490610c94565b91505090565b603b5481565b6001546001600160a01b031681565b6000603954421015610a2e5750603d546103fc565b610a58610a4f6038546103c8610a48603954603c54610e50565b4290610b70565b603d5490610c94565b905090565b610a6e610a69336106b0565b6103ff565b610a766104df565b565b603d5481565b6037546001600160a01b031681565b6001546001600160a01b03163314610ad65760405162461bcd60e51b81526004018080602001828103825260258152602001806111ea6025913960400191505060405180910390fd5b60008054600180546001600160a01b038082166001600160a01b03198086168217808855931690935560405193811694929391169184917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b23649190a36001546040516001600160a01b03918216918316907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b90600090a35050565b600082821115610bc7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082610bdc575060006103da565b82820282848281610be957fe5b0414610c265760405162461bcd60e51b81526004018080602001828103825260218152602001806111a76021913960400191505060405180910390fd5b9392505050565b6000808211610c83576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610c8c57fe5b049392505050565b600082820183811015610c26576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b603554610cfb9082610b70565b60355533600090815260366020526040902054610d189082610b70565b33600081815260366020526040902091909155603454610d44916001600160a01b039091169083610dfe565b50565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610da1908590610e67565b50505050565b603554610db49082610c94565b60355533600090815260366020526040902054610dd19082610c94565b33600081815260366020526040902091909155603454610d44916001600160a01b03909116903084610d47565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610982908490610e67565b600081831015610e605781610c26565b5090919050565b6060610ebc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f189092919063ffffffff16565b80519091501561098257808060200190516020811015610edb57600080fd5b50516109825760405162461bcd60e51b815260040180806020018281038252602a81526020018061120f602a913960400191505060405180910390fd5b6060610f278484600085610f2f565b949350505050565b606082471015610f705760405162461bcd60e51b81526004018080602001828103825260268152602001806111816026913960400191505060405180910390fd5b610f798561108b565b610fca576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106110095780518252601f199092019160209182019101610fea565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461106b576040519150601f19603f3d011682016040523d82523d6000602084013e611070565b606091505b5091509150611080828286611091565b979650505050505050565b3b151590565b606083156110a0575081610c26565b8251156110b05782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110fa5781810151838201526020016110e2565b50505050905090810190601f1680156111275780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe5f73657450656e64696e674f776e65723a204e6577206f77656e722063616e206e6f74206265207a65726f206164647265737320616e64206f776e657220686173206265656e2073657421416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f776f6e6c794f776e65723a2063616c6c6572206973206e6f7420746865206f776e65725f6163636570744f776e65723a204f6e6c7920666f722070656e64696e67206f776e6572215361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220dd842cef71281722cb8bed9579cff1ceebb72939d17dac9663029e647398c20364736f6c634300060c0033000000000000000000000000d7efe569bc7081a3bee3b27232eea7545e36a16e000000000000000000000000ae6aab43c4f3e0cea4ab83752c278f8debaba68900000000000000000000000000000000000000000000000000000000617be240

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

000000000000000000000000d7efe569bc7081a3bee3b27232eea7545e36a16e000000000000000000000000ae6aab43c4f3e0cea4ab83752c278f8debaba68900000000000000000000000000000000000000000000000000000000617be240

-----Decoded View---------------
Arg [0] : _lp (address): 0xd7efe569bc7081a3bee3b27232eea7545e36a16e
Arg [1] : _rewardToken (address): 0xae6aab43c4f3e0cea4ab83752c278f8debaba689
Arg [2] : _startTime (uint256): 1635508800

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000d7efe569bc7081a3bee3b27232eea7545e36a16e
Arg [1] : 000000000000000000000000ae6aab43c4f3e0cea4ab83752c278f8debaba689
Arg [2] : 00000000000000000000000000000000000000000000000000000000617be240


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.