ETH Price: $2,378.41 (-4.16%)

Contract

0xc0601973451d9369252Aee01397c0270CD2Ecd60
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00
Transaction Hash
Method
Block
From
To
Withdraw All206430832024-08-30 18:07:4733 days ago1725041267IN
KyberSwap: Fair Launch Sipher
0 ETH0.000406811.88158103
Withdraw All206351382024-08-29 15:29:1134 days ago1724945351IN
KyberSwap: Fair Launch Sipher
0 ETH0.000324814.71616278
Withdraw All206350662024-08-29 15:14:4734 days ago1724944487IN
KyberSwap: Fair Launch Sipher
0 ETH0.000541945.65631299
Withdraw All204519032024-08-04 1:29:1160 days ago1722734951IN
KyberSwap: Fair Launch Sipher
0 ETH0.000297661.37674904
Withdraw All204519022024-08-04 1:28:5960 days ago1722734939IN
KyberSwap: Fair Launch Sipher
0 ETH0.000121481.36845309
Withdraw All202320522024-07-04 8:47:3590 days ago1720082855IN
KyberSwap: Fair Launch Sipher
0 ETH0.0023764910.18605992
Withdraw All201591112024-06-24 4:19:11101 days ago1719202751IN
KyberSwap: Fair Launch Sipher
0 ETH0.000717763.07644143
Withdraw All201380212024-06-21 5:31:47104 days ago1718947907IN
KyberSwap: Fair Launch Sipher
0 ETH0.000290033.02711637
Withdraw All200784262024-06-12 21:26:59112 days ago1718227619IN
KyberSwap: Fair Launch Sipher
0 ETH0.0009800814.23053779
Withdraw198819492024-05-16 10:29:59139 days ago1715855399IN
KyberSwap: Fair Launch Sipher
0 ETH0.001725018.05188305
Withdraw197509882024-04-28 2:59:11158 days ago1714273151IN
KyberSwap: Fair Launch Sipher
0 ETH0.001166695
Withdraw195885142024-04-05 9:00:47180 days ago1712307647IN
KyberSwap: Fair Launch Sipher
0 ETH0.0023987525.02824908
Harvest195885012024-04-05 8:58:11180 days ago1712307491IN
KyberSwap: Fair Launch Sipher
0 ETH0.0009330424.55515585
Harvest Multiple...195884972024-04-05 8:57:23180 days ago1712307443IN
KyberSwap: Fair Launch Sipher
0 ETH0.0041346525.76813502
Withdraw195447382024-03-30 5:35:59187 days ago1711776959IN
KyberSwap: Fair Launch Sipher
0 ETH0.0042869119.82497593
Withdraw194218472024-03-12 22:00:47204 days ago1710280847IN
KyberSwap: Fair Launch Sipher
0 ETH0.014448861.9190289
Withdraw194029522024-03-10 6:37:35207 days ago1710052655IN
KyberSwap: Fair Launch Sipher
0 ETH0.0043713445.60424207
Withdraw193883212024-03-08 5:19:47209 days ago1709875187IN
KyberSwap: Fair Launch Sipher
0 ETH0.0103395747.81307594
Withdraw193798192024-03-07 0:49:11210 days ago1709772551IN
KyberSwap: Fair Launch Sipher
0 ETH0.0157709267.58830802
Withdraw193680222024-03-05 9:18:59211 days ago1709630339IN
KyberSwap: Fair Launch Sipher
0 ETH0.0136545863.14260163
Withdraw193535932024-03-03 8:57:23213 days ago1709456243IN
KyberSwap: Fair Launch Sipher
0 ETH0.0086706140.09753454
Withdraw193508492024-03-02 23:45:59214 days ago1709423159IN
KyberSwap: Fair Launch Sipher
0 ETH0.0093451443.21452629
Withdraw193508262024-03-02 23:41:23214 days ago1709422883IN
KyberSwap: Fair Launch Sipher
0 ETH0.0082027537.93393599
Withdraw193407352024-03-01 13:51:11215 days ago1709301071IN
KyberSwap: Fair Launch Sipher
0 ETH0.011774754.44948548
Withdraw193307972024-02-29 4:29:11217 days ago1709180951IN
KyberSwap: Fair Launch Sipher
0 ETH0.0047004349.03741823
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
137944892021-12-13 3:45:211025 days ago1639367121
KyberSwap: Fair Launch Sipher
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
KyberFairLaunchWithToken

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 14 : KyberFairLaunchWithToken.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;

import {ReentrancyGuard} from '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import {SafeCast} from '@openzeppelin/contracts/utils/SafeCast.sol';
import {IERC20Ext} from '@kyber.network/utils-sc/contracts/IERC20Ext.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberFairLaunchWithToken} from '../interfaces/liquidityMining/IKyberFairLaunchWithToken.sol';
import {IKyberRewardLocker} from '../interfaces/liquidityMining/IKyberRewardLocker.sol';
import {GeneratedToken} from './GeneratedToken.sol';

/// FairLaunch contract for Kyber DMM Liquidity Mining program
/// Allow stakers to stake LP tokens and receive reward tokens
/// A new token will be minted for users to represent their portion of the stake pool
/// Allow extend or renew a pool to continue/restart the LM program
/// When harvesting, rewards will be transferred to a RewardLocker
/// Support multiple reward tokens, reward tokens must be distinct and immutable
contract KyberFairLaunchWithToken is IKyberFairLaunchWithToken, PermissionAdmin, ReentrancyGuard {
  using SafeMath for uint256;
  using SafeCast for uint256;
  using SafeERC20 for IERC20Ext;

  uint256 internal constant PRECISION = 1e12;

  struct UserRewardData {
    uint256 unclaimedReward;
    uint256 lastRewardPerShare;
  }
  // Info of each user.
  struct UserInfo {
    uint256 amount; // How many Staking tokens the user has provided.
    mapping (uint256 => UserRewardData) userRewardData;
    //
    // Basically, any point in time, the amount of reward token
    // entitled to a user but is pending to be distributed is:
    //
    //   pending reward = user.unclaimAmount + (user.amount * (pool.accRewardPerShare - user.lastRewardPerShare)
    //
    // Whenever a user deposits or withdraws Staking tokens to a pool. Here's what happens:
    //   1. The pool's `accRewardPerShare` (and `lastRewardBlock`) gets updated.
    //   2. User receives the pending reward sent to his/her address.
    //   3. User's `lastRewardPerShare` gets updated.
    //   4. User's `amount` gets updated.
  }

  struct PoolRewardData {
    uint256 rewardPerBlock;
    uint256 accRewardPerShare;
  }
  // Info of each pool
  // poolRewardData: reward data for each reward token
  //      rewardPerBlock: amount of reward token per block
  //      accRewardPerShare: accumulated reward per share of token
  // totalStake: total amount of stakeToken has been staked
  // stakeToken: token to stake, should be an ERC20 token
  // startBlock: the block that the reward starts
  // endBlock: the block that the reward ends
  // lastRewardBlock: last block number that rewards distribution occurs
  struct PoolInfo {
    uint256 totalStake;
    address stakeToken;
    uint32 startBlock;
    uint32 endBlock;
    uint32 lastRewardBlock;
    mapping (uint256 => PoolRewardData) poolRewardData;
  }

  // check if a pool exists for a stakeToken
  mapping(address => bool) public poolExists;
  mapping(address => GeneratedToken) public poolToGeneratedToken;
  // contract for locking reward
  IKyberRewardLocker public immutable rewardLocker;
  // list reward tokens, use 0x0 for native token, shouldn't be too many reward tokens
  // don't validate values or length by trusting the deployer
  address[] public rewardTokens;

  // Info of each pool.
  uint256 public override poolLength;
  mapping(uint256 => PoolInfo) internal poolInfo;
  // Info of each user that stakes Staking tokens.
  mapping(uint256 => mapping(address => UserInfo)) internal userInfo;

  event AddNewPool(
    address indexed stakeToken,
    uint32 indexed startBlock,
    uint32 indexed endBlock,
    uint256[] rewardPerBlocks
  );
  event RenewPool(
    uint256 indexed pid,
    uint32 indexed startBlock,
    uint32 indexed endBlock,
    uint256[] rewardPerBlocks
  );
  event UpdatePool(
    uint256 indexed pid,
    uint32 indexed endBlock,
    uint256[] rewardPerBlocks
  );
  event Deposit(
    address indexed user,
    uint256 indexed pid,
    uint256 indexed blockNumber,
    uint256 amount
  );
  event Withdraw(
    address indexed user,
    uint256 indexed pid,
    uint256 indexed blockNumber,
    uint256 amount
  );
  event Harvest(
    address indexed user,
    uint256 indexed pid,
    address indexed rewardToken,
    uint256 lockedAmount,
    uint256 blockNumber
  );
  event EmergencyWithdraw(
    address indexed user,
    uint256 indexed pid,
    uint256 indexed blockNumber,
    uint256 amount
  );

  constructor(
    address _admin,
    address[] memory _rewardTokens,
    IKyberRewardLocker _rewardLocker
  ) PermissionAdmin(_admin) {
    rewardTokens = _rewardTokens;
    rewardLocker = _rewardLocker;

    // approve allowance to reward locker
    for(uint256 i = 0; i < _rewardTokens.length; i++) {
      if (_rewardTokens[i] != address(0)) {
        IERC20Ext(_rewardTokens[i]).safeApprove(address(_rewardLocker), type(uint256).max);
      }
    }
  }

  receive() external payable {}

  /**
   * @dev Allow admin to withdraw only reward tokens
   */
  function adminWithdraw(uint256 rewardTokenIndex, uint256 amount) external onlyAdmin {
    IERC20Ext rewardToken = IERC20Ext(rewardTokens[rewardTokenIndex]);
    if (rewardToken == IERC20Ext(0)) {
      (bool success, ) = msg.sender.call{ value: amount }('');
      require(success, 'transfer reward token failed');
    } else {
      rewardToken.safeTransfer(msg.sender, amount);
    }
  }

  /**
   * @dev Add a new lp to the pool. Can only be called by the admin.
   * @param _stakeToken: token to be staked to the pool
   * @param _startBlock: block where the reward starts
   * @param _endBlock: block where the reward ends
   * @param _rewardPerBlocks: amount of reward token per block for the pool for each reward token
   * @param _tokenName: name of the generated token
   * @param _tokenSymbol: symbol of the generated token
   */
  function addPool(
    address _stakeToken,
    uint32 _startBlock,
    uint32 _endBlock,
    uint256[] calldata _rewardPerBlocks,
    string memory _tokenName,
    string memory _tokenSymbol
  ) external override onlyAdmin {
    require(!poolExists[_stakeToken], 'add: duplicated pool');
    require(_stakeToken != address(0), 'add: invalid stake token');
    require(rewardTokens.length == _rewardPerBlocks.length, 'add: invalid length');

    require(_startBlock > block.number && _endBlock > _startBlock, 'add: invalid blocks');

    poolInfo[poolLength].stakeToken = _stakeToken;
    poolInfo[poolLength].startBlock = _startBlock;
    poolInfo[poolLength].endBlock = _endBlock;
    poolInfo[poolLength].lastRewardBlock = _startBlock;

    GeneratedToken _generatedToken = new GeneratedToken(
      _tokenName, _tokenSymbol
    );
    poolToGeneratedToken[_stakeToken] = _generatedToken;

    for(uint256 i = 0; i < _rewardPerBlocks.length; i++) {
      poolInfo[poolLength].poolRewardData[i] = PoolRewardData({
        rewardPerBlock: _rewardPerBlocks[i],
        accRewardPerShare: 0
      });
    }

    poolLength++;

    poolExists[_stakeToken] = true;

    emit AddNewPool(_stakeToken, _startBlock, _endBlock, _rewardPerBlocks);
  }

  /**
   * @dev Renew a pool to start another liquidity mining program
   * @param _pid: id of the pool to renew, must be pool that has not started or already ended
   * @param _startBlock: block where the reward starts
   * @param _endBlock: block where the reward ends
   * @param _rewardPerBlocks: amount of reward token per block for the pool
   *   0 if we want to stop the pool from accumulating rewards
   */
  function renewPool(
    uint256 _pid,
    uint32 _startBlock,
    uint32 _endBlock,
    uint256[] calldata _rewardPerBlocks
  ) external override onlyAdmin {
    updatePoolRewards(_pid);

    PoolInfo storage pool = poolInfo[_pid];
    // check if pool has not started or already ended
    require(
      pool.startBlock > block.number || pool.endBlock < block.number,
      'renew: invalid pool state to renew'
    );
    // checking data of new pool
    require(rewardTokens.length == _rewardPerBlocks.length, 'renew: invalid length');
    require(_startBlock > block.number && _endBlock > _startBlock, 'renew: invalid blocks');

    pool.startBlock = _startBlock;
    pool.endBlock = _endBlock;
    pool.lastRewardBlock = _startBlock;

    for(uint256 i = 0; i < _rewardPerBlocks.length; i++) {
      pool.poolRewardData[i].rewardPerBlock = _rewardPerBlocks[i];
    }

    emit RenewPool(_pid, _startBlock, _endBlock, _rewardPerBlocks);
  }

  /**
   * @dev Update a pool, allow to change end block, reward per block
   * @param _pid: pool id to be renew
   * @param _endBlock: block where the reward ends
   * @param _rewardPerBlocks: amount of reward token per block for the pool,
   *   0 if we want to stop the pool from accumulating rewards
   */
  function updatePool(
    uint256 _pid,
    uint32 _endBlock,
    uint256[] calldata _rewardPerBlocks
  ) external override onlyAdmin {
    updatePoolRewards(_pid);

    PoolInfo storage pool = poolInfo[_pid];

    // should call renew pool if the pool has ended
    require(pool.endBlock > block.number, 'update: pool already ended');
    require(rewardTokens.length == _rewardPerBlocks.length, 'update: invalid length');
    require(_endBlock > block.number && _endBlock > pool.startBlock, 'update: invalid end block');

    pool.endBlock = _endBlock;
    for(uint256 i = 0; i < _rewardPerBlocks.length; i++) {
      pool.poolRewardData[i].rewardPerBlock = _rewardPerBlocks[i];
    }

    emit UpdatePool(_pid, _endBlock, _rewardPerBlocks);
  }

  /**
   * @dev Deposit tokens to accumulate rewards
   * @param _pid: id of the pool
   * @param _amount: amount of stakeToken to be deposited
   * @param _shouldHarvest: whether to harvest the reward or not
   */
  function deposit(
    uint256 _pid,
    uint256 _amount,
    bool _shouldHarvest
  ) external override nonReentrant {
    // update pool rewards, user's rewards
    updatePoolRewards(_pid);
    _updateUserReward(msg.sender, _pid, _shouldHarvest);

    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][msg.sender];

    // collect stakeToken
    address stakeToken = pool.stakeToken;
    IERC20Ext(stakeToken).safeTransferFrom(msg.sender, address(this), _amount);
    poolToGeneratedToken[stakeToken].mint(msg.sender, _amount);

    // update user staked amount, and total staked amount for the pool
    user.amount = user.amount.add(_amount);
    pool.totalStake = pool.totalStake.add(_amount);

    emit Deposit(msg.sender, _pid, block.number, _amount);
  }

  /**
   * @dev Withdraw token (of the sender) from pool, also harvest rewards
   * @param _pid: id of the pool
   * @param _amount: amount of stakeToken to withdraw
   */
  function withdraw(uint256 _pid, uint256 _amount) external override nonReentrant {
    _withdraw(_pid, _amount);
  }

  /**
   * @dev Withdraw all tokens (of the sender) from pool, also harvest reward
   * @param _pid: id of the pool
   */
  function withdrawAll(uint256 _pid) external override nonReentrant {
    _withdraw(_pid, userInfo[_pid][msg.sender].amount);
  }

  /**
   * @notice EMERGENCY USAGE ONLY, USER'S REWARDS WILL BE RESET
   * @dev Emergency withdrawal function to allow withdraw all deposited tokens (of the sender)
   *   and reset all rewards
   * @param _pid: id of the pool
   */
  function emergencyWithdraw(uint256 _pid) external override nonReentrant {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][msg.sender];
    uint256 amount = user.amount;

    user.amount = 0;
    for(uint256 i = 0; i < rewardTokens.length; i++) {
      UserRewardData storage rewardData = user.userRewardData[i];
      rewardData.lastRewardPerShare = 0;
      rewardData.unclaimedReward = 0;
    }

    pool.totalStake = pool.totalStake.sub(amount);

    if (amount > 0) {
      address stakeToken = pool.stakeToken;
      poolToGeneratedToken[stakeToken].burn(msg.sender, amount);
      IERC20Ext(stakeToken).safeTransfer(msg.sender, amount);
    }

    emit EmergencyWithdraw(msg.sender, _pid, block.number, amount);
  }

  /**
   * @dev Harvest rewards from multiple pools for the sender
   *   combine rewards from all pools and only transfer once to save gas
   */
  function harvestMultiplePools(uint256[] calldata _pids) external override {
    address[] memory rTokens = rewardTokens;
    uint256[] memory totalRewards = new uint256[](rTokens.length);
    address account = msg.sender;
    uint256 pid;

    for (uint256 i = 0; i < _pids.length; i++) {
      pid = _pids[i];
      updatePoolRewards(pid);
      // update user reward without harvesting
      _updateUserReward(account, pid, false);

      for(uint256 j = 0; j < rTokens.length; j++) {
        uint256 reward = userInfo[pid][account].userRewardData[j].unclaimedReward;
        if (reward > 0) {
          totalRewards[j] = totalRewards[j].add(reward);
          userInfo[pid][account].userRewardData[j].unclaimedReward = 0;
          emit Harvest(account, pid, rTokens[j], reward, block.number);
        }
      }
    }

    for(uint256 i = 0; i < totalRewards.length; i++) {
      if (totalRewards[i] > 0) {
        _lockReward(IERC20Ext(rTokens[i]), account, totalRewards[i]);
      }
    }
  }

  /**
   * @dev Get pending rewards of a user from a pool, mostly for front-end
   * @param _pid: id of the pool
   * @param _user: user to check for pending rewards
   */
  function pendingRewards(uint256 _pid, address _user)
    external
    override
    view
    returns (uint256[] memory rewards)
  {
    uint256 rTokensLength = rewardTokens.length;
    rewards = new uint256[](rTokensLength);
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_user];
    uint256 _totalStake = pool.totalStake;
    uint256 _poolLastRewardBlock = pool.lastRewardBlock;
    uint32 lastAccountedBlock = _lastAccountedRewardBlock(_pid);
    for(uint256 i = 0; i < rTokensLength; i++) {
      uint256 _accRewardPerShare = pool.poolRewardData[i].accRewardPerShare;
      if (lastAccountedBlock > _poolLastRewardBlock && _totalStake != 0) {
        uint256 reward = (lastAccountedBlock - _poolLastRewardBlock)
          .mul(pool.poolRewardData[i].rewardPerBlock);
        _accRewardPerShare = _accRewardPerShare.add(reward.mul(PRECISION) / _totalStake);
      }

      rewards[i] = user.amount.mul(
        _accRewardPerShare.sub(user.userRewardData[i].lastRewardPerShare)
        ) / PRECISION;
      rewards[i] = rewards[i].add(user.userRewardData[i].unclaimedReward);
    }
  }

  /**
   * @dev Return list reward tokens
   */
  function getRewardTokens() external override view returns (address[] memory) {
    return rewardTokens;
  }

  /**
   * @dev Return full details of a pool
   */
  function getPoolInfo(uint256 _pid)
    external override view
    returns (
      uint256 totalStake,
      address stakeToken,
      uint32 startBlock,
      uint32 endBlock,
      uint32 lastRewardBlock,
      uint256[] memory rewardPerBlocks,
      uint256[] memory accRewardPerShares
    )
  {
    PoolInfo storage pool = poolInfo[_pid];
    (
      totalStake,
      stakeToken,
      startBlock,
      endBlock,
      lastRewardBlock
    ) = (
      pool.totalStake,
      pool.stakeToken,
      pool.startBlock,
      pool.endBlock,
      pool.lastRewardBlock
    );
    rewardPerBlocks = new uint256[](rewardTokens.length);
    accRewardPerShares = new uint256[](rewardTokens.length);
    for(uint256 i = 0; i < rewardTokens.length; i++) {
      rewardPerBlocks[i] = pool.poolRewardData[i].rewardPerBlock;
      accRewardPerShares[i] = pool.poolRewardData[i].accRewardPerShare;
    }
  }

  /**
   * @dev Return user's info including deposited amount and reward data
   */
  function getUserInfo(uint256 _pid, address _account)
    external override view
    returns (
      uint256 amount,
      uint256[] memory unclaimedRewards,
      uint256[] memory lastRewardPerShares
    )
  {
    UserInfo storage user = userInfo[_pid][_account];
    amount = user.amount;
    unclaimedRewards = new uint256[](rewardTokens.length);
    lastRewardPerShares = new uint256[](rewardTokens.length);
    for(uint256 i = 0; i < rewardTokens.length; i++) {
      unclaimedRewards[i] = user.userRewardData[i].unclaimedReward;
      lastRewardPerShares[i] = user.userRewardData[i].lastRewardPerShare;
    }
  }

  /**
   * @dev Harvest rewards from a pool for the sender
   * @param _pid: id of the pool
   */
  function harvest(uint256 _pid) public override {
    updatePoolRewards(_pid);
    _updateUserReward(msg.sender, _pid, true);
  }

  /**
   * @dev Update rewards for one pool
   */
  function updatePoolRewards(uint256 _pid) public override {
    require(_pid < poolLength, 'invalid pool id');
    PoolInfo storage pool = poolInfo[_pid];
    uint32 lastAccountedBlock = _lastAccountedRewardBlock(_pid);
    if (lastAccountedBlock <= pool.lastRewardBlock) return;
    uint256 _totalStake = pool.totalStake;
    if (_totalStake == 0) {
      pool.lastRewardBlock = lastAccountedBlock;
      return;
    }
    uint256 numberBlocks = lastAccountedBlock - pool.lastRewardBlock;
    for(uint256 i = 0; i < rewardTokens.length; i++) {
      PoolRewardData storage rewardData = pool.poolRewardData[i];
      uint256 reward = numberBlocks.mul(rewardData.rewardPerBlock);
      rewardData.accRewardPerShare = rewardData.accRewardPerShare.add(reward.mul(PRECISION) / _totalStake);
    }
    pool.lastRewardBlock = lastAccountedBlock;
  }

  /**
   * @dev Withdraw _amount of stakeToken from pool _pid, also harvest reward for the sender
   */
  function _withdraw(uint256 _pid, uint256 _amount) internal {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][msg.sender];
    require(user.amount >= _amount, 'withdraw: insufficient amount');

    // update pool reward and harvest
    updatePoolRewards(_pid);
    _updateUserReward(msg.sender, _pid, true);

    user.amount = user.amount.sub(_amount);
    pool.totalStake = pool.totalStake.sub(_amount);

    address stakeToken = pool.stakeToken;
    GeneratedToken(poolToGeneratedToken[stakeToken]).burn(msg.sender, _amount);
    IERC20Ext(stakeToken).safeTransfer(msg.sender, _amount);

    emit Withdraw(msg.sender, _pid, block.number, _amount);
  }

  /**
   * @dev Update reward of _to address from pool _pid, harvest if needed
   */
  function _updateUserReward(
    address _to,
    uint256 _pid,
    bool shouldHarvest
  ) internal {
    uint256 userAmount = userInfo[_pid][_to].amount;
    uint256 rTokensLength = rewardTokens.length;

    if (userAmount == 0) {
      // update user last reward per share to the latest pool reward per share
      // by right if user.amount is 0, user.unclaimedReward should be 0 as well,
      // except when user uses emergencyWithdraw function
      for(uint256 i = 0; i < rTokensLength; i++) {
        userInfo[_pid][_to].userRewardData[i].lastRewardPerShare =
          poolInfo[_pid].poolRewardData[i].accRewardPerShare;
      }
      return;
    }

    for(uint256 i = 0; i < rTokensLength; i++) {
      uint256 lastAccRewardPerShare = poolInfo[_pid].poolRewardData[i].accRewardPerShare;
      UserRewardData storage rewardData = userInfo[_pid][_to].userRewardData[i];
      // user's unclaim reward + user's amount * (pool's accRewardPerShare - user's lastRewardPerShare) / precision
      uint256 _pending = userAmount.mul(lastAccRewardPerShare.sub(rewardData.lastRewardPerShare)) / PRECISION;
      _pending = _pending.add(rewardData.unclaimedReward);

      rewardData.unclaimedReward = shouldHarvest ? 0 : _pending;
      // update user last reward per share to the latest pool reward per share
      rewardData.lastRewardPerShare = lastAccRewardPerShare;

      if (shouldHarvest && _pending > 0) {
        _lockReward(IERC20Ext(rewardTokens[i]), _to, _pending);
        emit Harvest(_to, _pid, rewardTokens[i], _pending, block.number);
      }
    }
  }

  /**
   * @dev Returns last accounted reward block, either the current block number or the endBlock of the pool
   */
  function _lastAccountedRewardBlock(uint256 _pid) internal view returns (uint32 _value) {
    _value = poolInfo[_pid].endBlock;
    if (_value > block.number) _value = block.number.toUint32();
  }

  /**
   * @dev Call locker contract to lock rewards
   */
  function _lockReward(IERC20Ext token, address _account, uint256 _amount) internal {
    uint256 value = token == IERC20Ext(0) ? _amount : 0;
    rewardLocker.lock{ value: value }(token, _account, _amount);
  }
}

File 2 of 14 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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 3 of 14 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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 4 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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 14 : SafeCast.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;


/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such 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.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        require(value < 2**255, "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 6 of 14 : IERC20Ext.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";


/**
 * @dev Interface extending ERC20 standard to include decimals() as
 *      it is optional in the OpenZeppelin IERC20 interface.
 */
interface IERC20Ext is IERC20 {
    /**
     * @dev This function is required as Kyber requires to interact
     *      with token.decimals() with many of its operations.
     */
    function decimals() external view returns (uint8 digits);
}

File 7 of 14 : PermissionAdmin.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;


abstract contract PermissionAdmin {
    address public admin;
    address public pendingAdmin;

    event AdminClaimed(address newAdmin, address previousAdmin);

    event TransferAdminPending(address pendingAdmin);

    constructor(address _admin) {
        require(_admin != address(0), "admin 0");
        admin = _admin;
    }

    modifier onlyAdmin() {
        require(msg.sender == admin, "only admin");
        _;
    }

    /**
     * @dev Allows the current admin to set the pendingAdmin address.
     * @param newAdmin The address to transfer ownership to.
     */
    function transferAdmin(address newAdmin) public onlyAdmin {
        require(newAdmin != address(0), "new admin 0");
        emit TransferAdminPending(newAdmin);
        pendingAdmin = newAdmin;
    }

    /**
     * @dev Allows the current admin to set the admin in one tx. Useful initial deployment.
     * @param newAdmin The address to transfer ownership to.
     */
    function transferAdminQuickly(address newAdmin) public onlyAdmin {
        require(newAdmin != address(0), "admin 0");
        emit TransferAdminPending(newAdmin);
        emit AdminClaimed(newAdmin, admin);
        admin = newAdmin;
    }

    /**
     * @dev Allows the pendingAdmin address to finalize the change admin process.
     */
    function claimAdmin() public {
        require(pendingAdmin == msg.sender, "not pending");
        emit AdminClaimed(pendingAdmin, admin);
        admin = pendingAdmin;
        pendingAdmin = address(0);
    }
}

File 8 of 14 : IKyberFairLaunchWithToken.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;

interface IKyberFairLaunchWithToken {
  /**
   * @dev Add a new lp to the pool. Can only be called by the admin.
   * @param _stakeToken: token to be staked to the pool
   * @param _startBlock: block where the reward starts
   * @param _endBlock: block where the reward ends
   * @param _rewardPerBlocks: amount of reward token per block for the pool
   * @param _tokenName: name of the generated token
   * @param _tokenSymbol: symbol of the generated token
   */
  function addPool(
    address _stakeToken,
    uint32 _startBlock,
    uint32 _endBlock,
    uint256[] calldata _rewardPerBlocks,
    string memory _tokenName,
    string memory _tokenSymbol
  ) external;

  /**
   * @dev Renew a pool to start another liquidity mining program
   * @param _pid: id of the pool to renew, must be pool that has not started or already ended
   * @param _startBlock: block where the reward starts
   * @param _endBlock: block where the reward ends
   * @param _rewardPerBlocks: amount of reward token per block for the pool
   *   0 if we want to stop the pool from accumulating rewards
   */
  function renewPool(
    uint256 _pid,
    uint32 _startBlock,
    uint32 _endBlock,
    uint256[] calldata _rewardPerBlocks
  ) external;

  /**
   * @dev Update a pool, allow to change end block, reward per block
   * @param _pid: pool id to be renew
   * @param _endBlock: block where the reward ends
   * @param _rewardPerBlocks: amount of reward token per block for the pool
   *   0 if we want to stop the pool from accumulating rewards
   */
  function updatePool(
    uint256 _pid,
    uint32 _endBlock,
    uint256[] calldata _rewardPerBlocks
  ) external;

  /**
   * @dev deposit to tokens to accumulate rewards
   * @param _pid: id of the pool
   * @param _amount: amount of stakeToken to be deposited
   * @param _shouldHarvest: whether to harvest the reward or not
   */
  function deposit(
    uint256 _pid,
    uint256 _amount,
    bool _shouldHarvest
  ) external;

  /**
   * @dev withdraw token (of the sender) from pool, also harvest reward
   * @param _pid: id of the pool
   * @param _amount: amount of stakeToken to withdraw
   */
  function withdraw(uint256 _pid, uint256 _amount) external;

  /**
   * @dev withdraw all tokens (of the sender) from pool, also harvest reward
   * @param _pid: id of the pool
   */
  function withdrawAll(uint256 _pid) external;

  /**
   * @dev emergency withdrawal function to allow withdraw all deposited token (of the sender)
   *   without harvesting the reward
   * @param _pid: id of the pool
   */
  function emergencyWithdraw(uint256 _pid) external;

  /**
   * @dev harvest reward from pool for the sender
   * @param _pid: id of the pool
   */
  function harvest(uint256 _pid) external;

  /**
   * @dev harvest rewards from multiple pools for the sender
   */
  function harvestMultiplePools(uint256[] calldata _pids) external;

  /**
   * @dev update reward for one pool
   */
  function updatePoolRewards(uint256 _pid) external;

  /**
   * @dev return the total of pools that have been added
   */
  function poolLength() external view returns (uint256);

  /**
   * @dev return full details of a pool
   */
  function getPoolInfo(uint256 _pid)
    external view
    returns(
      uint256 totalStake,
      address stakeToken,
      uint32 startBlock,
      uint32 endBlock,
      uint32 lastRewardBlock,
      uint256[] memory rewardPerBlocks,
      uint256[] memory accRewardPerShares);

  /**
   * @dev get user's info
   */
  function getUserInfo(uint256 _pid, address _account)
    external view
    returns (
      uint256 amount,
      uint256[] memory unclaimedRewards,
      uint256[] memory lastRewardPerShares);

  /**
  * @dev return list reward tokens
  */
  function getRewardTokens() external view returns (address[] memory);
  /**
   * @dev get pending reward of a user from a pool, mostly for front-end
   * @param _pid: id of the pool
   * @param _user: user to check for pending rewards
   */
  function pendingRewards(
    uint256 _pid,
    address _user
   )
    external view
    returns (uint256[] memory rewards);
}

File 9 of 14 : IKyberRewardLocker.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;

import {IERC20Ext} from '@kyber.network/utils-sc/contracts/IERC20Ext.sol';

interface IKyberRewardLocker {
  struct VestingSchedule {
    uint64 startBlock;
    uint64 endBlock;
    uint128 quantity;
    uint128 vestedQuantity;
  }

  event VestingEntryCreated(
    IERC20Ext indexed token,
    address indexed beneficiary,
    uint256 startBlock,
    uint256 endBlock,
    uint256 quantity,
    uint256 index
  );

  event VestingEntryQueued(
    uint256 indexed index,
    IERC20Ext indexed token,
    address indexed beneficiary,
    uint256 quantity
  );

  event Vested(
    IERC20Ext indexed token,
    address indexed beneficiary,
    uint256 vestedQuantity,
    uint256 index
  );

  /**
   * @dev queue a vesting schedule starting from now
   */
  function lock(
    IERC20Ext token,
    address account,
    uint256 amount
  ) external payable;

  /**
   * @dev queue a vesting schedule
   */
  function lockWithStartBlock(
    IERC20Ext token,
    address account,
    uint256 quantity,
    uint256 startBlock
  ) external payable;

  /**
   * @dev vest all completed schedules for multiple tokens
   */
  function vestCompletedSchedulesForMultipleTokens(IERC20Ext[] calldata tokens)
    external
    returns (uint256[] memory vestedAmounts);

  /**
   * @dev claim multiple tokens for specific vesting schedule,
   *      if schedule has not ended yet, claiming amounts are linear with vesting blocks
   */
  function vestScheduleForMultipleTokensAtIndices(
    IERC20Ext[] calldata tokens,
    uint256[][] calldata indices
  )
    external
    returns (uint256[] memory vestedAmounts);

  /**
   * @dev for all completed schedule, claim token
   */
  function vestCompletedSchedules(IERC20Ext token) external returns (uint256);

  /**
   * @dev claim token for specific vesting schedule,
   * @dev if schedule has not ended yet, claiming amount is linear with vesting blocks
   */
  function vestScheduleAtIndices(IERC20Ext token, uint256[] calldata indexes)
    external
    returns (uint256);

  /**
   * @dev claim token for specific vesting schedule from startIndex to endIndex
   */
  function vestSchedulesInRange(
    IERC20Ext token,
    uint256 startIndex,
    uint256 endIndex
  ) external returns (uint256);

  /**
   * @dev length of vesting schedules array
   */
  function numVestingSchedules(address account, IERC20Ext token) external view returns (uint256);

  /**
   * @dev get detailed of each vesting schedule
   */
  function getVestingScheduleAtIndex(
    address account,
    IERC20Ext token,
    uint256 index
  ) external view returns (VestingSchedule memory);

  /**
   * @dev get vesting shedules array
   */
  function getVestingSchedules(address account, IERC20Ext token)
    external
    view
    returns (VestingSchedule[] memory schedules);
}

File 10 of 14 : GeneratedToken.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;

import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol';


contract GeneratedToken is ERC20 {

  address internal deployer;

  modifier onlyDeployer() {
    require(msg.sender == deployer, 'unauthorized');
    _;
  }

  constructor (string memory name_, string memory symbol_) ERC20(name_, symbol_) {
    deployer = msg.sender;
  }

  function mint(address account, uint256 amount) external onlyDeployer {
    super._mint(account, amount);
  }

  function burn(address account, uint256 amount) external onlyDeployer {
    super._burn(account, amount);
  }
}

File 11 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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 12 of 14 : Address.sol
// SPDX-License-Identifier: MIT

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

File 13 of 14 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

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

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

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

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

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address[]","name":"_rewardTokens","type":"address[]"},{"internalType":"contract IKyberRewardLocker","name":"_rewardLocker","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeToken","type":"address"},{"indexed":true,"internalType":"uint32","name":"startBlock","type":"uint32"},{"indexed":true,"internalType":"uint32","name":"endBlock","type":"uint32"},{"indexed":false,"internalType":"uint256[]","name":"rewardPerBlocks","type":"uint256[]"}],"name":"AddNewPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"}],"name":"AdminClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"blockNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"blockNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"address","name":"rewardToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"lockedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"uint32","name":"startBlock","type":"uint32"},{"indexed":true,"internalType":"uint32","name":"endBlock","type":"uint32"},{"indexed":false,"internalType":"uint256[]","name":"rewardPerBlocks","type":"uint256[]"}],"name":"RenewPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pendingAdmin","type":"address"}],"name":"TransferAdminPending","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"uint32","name":"endBlock","type":"uint32"},{"indexed":false,"internalType":"uint256[]","name":"rewardPerBlocks","type":"uint256[]"}],"name":"UpdatePool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"blockNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"uint32","name":"_startBlock","type":"uint32"},{"internalType":"uint32","name":"_endBlock","type":"uint32"},{"internalType":"uint256[]","name":"_rewardPerBlocks","type":"uint256[]"},{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardTokenIndex","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"adminWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_shouldHarvest","type":"bool"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"getPoolInfo","outputs":[{"internalType":"uint256","name":"totalStake","type":"uint256"},{"internalType":"address","name":"stakeToken","type":"address"},{"internalType":"uint32","name":"startBlock","type":"uint32"},{"internalType":"uint32","name":"endBlock","type":"uint32"},{"internalType":"uint32","name":"lastRewardBlock","type":"uint32"},{"internalType":"uint256[]","name":"rewardPerBlocks","type":"uint256[]"},{"internalType":"uint256[]","name":"accRewardPerShares","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_account","type":"address"}],"name":"getUserInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256[]","name":"unclaimedRewards","type":"uint256[]"},{"internalType":"uint256[]","name":"lastRewardPerShares","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_pids","type":"uint256[]"}],"name":"harvestMultiplePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingRewards","outputs":[{"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolToGeneratedToken","outputs":[{"internalType":"contract GeneratedToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint32","name":"_startBlock","type":"uint32"},{"internalType":"uint32","name":"_endBlock","type":"uint32"},{"internalType":"uint256[]","name":"_rewardPerBlocks","type":"uint256[]"}],"name":"renewPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardLocker","outputs":[{"internalType":"contract IKyberRewardLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdminQuickly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint32","name":"_endBlock","type":"uint32"},{"internalType":"uint256[]","name":"_rewardPerBlocks","type":"uint256[]"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePoolRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523480156200001157600080fd5b5060405162004b1938038062004b198339810160408190526200003491620005f6565b826001600160a01b0381166200007b576040805162461bcd60e51b8152602060048201526007602482015266061646d696e20360cc1b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b039290921691909117905560016002558151620000b590600590602085019062000568565b506001600160601b0319606082901b1660805260005b8251811015620001485760006001600160a01b0316838281518110620000ed57fe5b60200260200101516001600160a01b0316146200013f576200013f826000198584815181106200011957fe5b60200260200101516001600160a01b03166200015260201b62001e85179092919060201c565b600101620000cb565b50505050620006f8565b801580620001dc575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015620001ac57600080fd5b505afa158015620001c1573d6000803e3d6000fd5b505050506040513d6020811015620001d857600080fd5b5051155b620002195760405162461bcd60e51b815260040180806020018281038252603681526020018062004ae36036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b17909152620002719185916200027616565b505050565b6000620002d2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200033260201b62001fd2179092919060201c565b8051909150156200027157808060200190516020811015620002f357600080fd5b5051620002715760405162461bcd60e51b815260040180806020018281038252602a81526020018062004ab9602a913960400191505060405180910390fd5b60606200034384846000856200034d565b90505b9392505050565b606082471015620003905760405162461bcd60e51b815260040180806020018281038252602681526020018062004a936026913960400191505060405180910390fd5b6200039b85620004b4565b620003ed576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106200042d5780518252601f1990920191602091820191016200040c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811462000491576040519150601f19603f3d011682016040523d82523d6000602084013e62000496565b606091505b509092509050620004a9828286620004be565b979650505050505050565b803b15155b919050565b60608315620004cf57508162000346565b825115620004e05782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200052c57818101518382015260200162000512565b50505050905090810190601f1680156200055a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b828054828255906000526020600020908101928215620005c0579160200282015b82811115620005c057825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000589565b50620005ce929150620005d2565b5090565b5b80821115620005ce5760008155600101620005d3565b8051620004b981620006df565b6000806000606084860312156200060b578283fd5b83516200061881620006df565b602085810151919450906001600160401b038082111562000637578485fd5b818701915087601f8301126200064b578485fd5b8151818111156200065857fe5b838102604051858282010181811085821117156200067257fe5b604052828152858101935084860182860187018c101562000691578889fd5b8895505b83861015620006be57620006a981620005e9565b85526001959095019493860193860162000695565b50809750505050505050620006d660408501620005e9565b90509250925092565b6001600160a01b0381168114620006f557600080fd5b50565b60805160601c6143786200071b6000398061087a528061245352506143786000f3fe608060405260043610620001c35760003560e01c806375829def11620000f7578063affb9fc81162000097578063d12e4ceb116200006d578063d12e4ceb1462000505578063d18df53c146200052a578063ddc63262146200055e578063f851a440146200058357620001cb565b8063affb9fc81462000494578063b43c627014620004b9578063c4f59f9b14620004de57620001cb565b80637bb7bed111620000cd5780637bb7bed11462000425578063958e2d31146200044a578063adb82b31146200046f57620001cb565b806375829def14620003c357806377f50f9714620003e85780637acc8678146200040057620001cb565b80633892601c116200016357806344205303116200013957806344205303146200035457806352fd9f2f14620003795780635312ea8e146200039e57620001cb565b80633892601c14620002f057806343a0d0661462000308578063441a3e70146200032f57620001cb565b806326782247116200019957806326782247146200026a5780632bddd8bb14620002915780632f380b3514620002b657620001cb565b8063081e3eda14620001d05780631069f3b514620002005780631e1c6a07146200023657620001cb565b36620001cb57005b600080fd5b348015620001dd57600080fd5b50620001e86200059b565b604051620001f79190620031c5565b60405180910390f35b3480156200020d57600080fd5b50620002256200021f36600462002ba0565b620005a1565b604051620001f79392919062003238565b3480156200024357600080fd5b506200025b6200025536600462002a5a565b620006db565b604051620001f7919062002e73565b3480156200027757600080fd5b5062000282620006f0565b604051620001f7919062002d8e565b3480156200029e57600080fd5b5062000282620002b036600462002a5a565b620006ff565b348015620002c357600080fd5b50620002db620002d536600462002b87565b6200071a565b604051620001f79796959493929190620031ce565b348015620002fd57600080fd5b506200028262000878565b3480156200031557600080fd5b506200032d6200032736600462002bf0565b6200089c565b005b3480156200033c57600080fd5b506200032d6200034e36600462002bce565b62000a52565b3480156200036157600080fd5b506200032d6200037336600462002a77565b62000ac3565b3480156200038657600080fd5b506200032d6200039836600462002b43565b62000ddf565b348015620003ab57600080fd5b506200032d620003bd36600462002b87565b62001067565b348015620003d057600080fd5b506200032d620003e236600462002a5a565b6200121c565b348015620003f557600080fd5b506200032d62001323565b3480156200040d57600080fd5b506200032d6200041f36600462002a5a565b620013f6565b3480156200043257600080fd5b50620002826200044436600462002b87565b62001545565b3480156200045757600080fd5b506200032d6200046936600462002b87565b62001570565b3480156200047c57600080fd5b506200032d6200048e36600462002b87565b620015fb565b348015620004a157600080fd5b506200032d620004b336600462002c2e565b62001746565b348015620004c657600080fd5b506200032d620004d836600462002c8c565b620018f8565b348015620004eb57600080fd5b50620004f662001af9565b604051620001f7919062002dbb565b3480156200051257600080fd5b506200032d6200052436600462002bce565b62001b5d565b3480156200053757600080fd5b506200054f6200054936600462002ba0565b62001c7c565b604051620001f7919062002e5e565b3480156200056b57600080fd5b506200032d6200057d36600462002b87565b62001e5d565b3480156200059057600080fd5b506200028262001e76565b60065481565b60008281526008602090815260408083206001600160a01b038516845290915290208054600554909160609182919067ffffffffffffffff81118015620005e757600080fd5b5060405190808252806020026020018201604052801562000612578160200160208202803683370190505b5060055490935067ffffffffffffffff811180156200063057600080fd5b506040519080825280602002602001820160405280156200065b578160200160208202803683370190505b50915060005b600554811015620006d257600081815260018301602052604090205484518590839081106200068c57fe5b60200260200101818152505081600101600082815260200190815260200160002060010154838281518110620006be57fe5b602090810291909101015260010162000661565b50509250925092565b60036020526000908152604090205460ff1681565b6001546001600160a01b031681565b6004602052600090815260409020546001600160a01b031681565b60008181526007602052604090208054600182015460055491926001600160a01b0382169263ffffffff600160a01b8404811693600160c01b8104821693600160e01b90910490911691606091829167ffffffffffffffff811180156200078057600080fd5b50604051908082528060200260200182016040528015620007ab578160200160208202803683370190505b5060055490935067ffffffffffffffff81118015620007c957600080fd5b50604051908082528060200260200182016040528015620007f4578160200160208202803683370190505b50915060005b6005548110156200086b57600081815260028301602052604090205484518590839081106200082557fe5b602002602001018181525050816002016000828152602001908152602001600020600101548382815181106200085757fe5b6020908102919091010152600101620007fa565b5050919395979092949650565b7f000000000000000000000000000000000000000000000000000000000000000081565b600280541415620008f4576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600280556200090383620015fb565b6200091033848362001fed565b6000838152600760209081526040808320600883528184203380865293529220600183015490916001600160a01b0390911690620009529082903088620021f3565b6001600160a01b038082166000908152600460208190526040918290205491517f40c10f1900000000000000000000000000000000000000000000000000000000815291909216916340c10f1991620009b09133918a910162002da2565b600060405180830381600087803b158015620009cb57600080fd5b505af1158015620009e0573d6000803e3d6000fd5b50508354620009f392509050866200226e565b8255825462000a0390866200226e565b83556040514390879033907f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e9062000a3d908a90620031c5565b60405180910390a45050600160025550505050565b60028054141562000aaa576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002805562000aba8282620022d2565b50506001600255565b6000546001600160a01b0316331462000b10576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03871660009081526003602052604090205460ff161562000b555760405162461bcd60e51b815260040162000b4c90620030c3565b60405180910390fd5b6001600160a01b03871662000b7e5760405162461bcd60e51b815260040162000b4c9062002ed4565b600554831462000ba25760405162461bcd60e51b815260040162000b4c9062002fb0565b438663ffffffff1611801562000bc357508563ffffffff168563ffffffff16115b62000be25760405162461bcd60e51b815260040162000b4c906200318e565b60068054600090815260076020526040808220600190810180546001600160a01b0319166001600160a01b038d16179055835483528183208101805463ffffffff60a01b1916600160a01b63ffffffff8d811691820292909217909255855485528385208301805463ffffffff60c01b1916600160c01b928d1692909202919091179055935483528183200180546001600160e01b0316600160e01b9094029390931790925590518390839062000c99906200295a565b62000ca692919062002ea2565b604051809103906000f08015801562000cc3573d6000803e3d6000fd5b506001600160a01b03898116600090815260046020526040812080546001600160a01b031916928416929092179091559091505b8481101562000d5a57604051806040016040528087878481811062000d1857fe5b60209081029290920135835250600091810182905260065482526007815260408083208584526002018252909120825181559101516001918201550162000cf7565b506006805460019081019091556001600160a01b03891660008181526003602052604090819020805460ff1916909317909255905163ffffffff80891692908a16917feb19e76b03b99eff4d0329a19e44569c131f242c9590234f19b76f2c56a817a19062000dcd908a908a9062002e0a565b60405180910390a45050505050505050565b6000600580548060200260200160405190810160405280929190818152602001828054801562000e3957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000e1a575b505050505090506000815167ffffffffffffffff8111801562000e5b57600080fd5b5060405190808252806020026020018201604052801562000e86578160200160208202803683370190505b509050336000805b8581101562000ff45786868281811062000ea457fe5b90506020020135915062000eb882620015fb565b62000ec68383600062001fed565b60005b855181101562000fea5760008381526008602090815260408083206001600160a01b03881684528252808320848452600101909152902054801562000fe05762000f318187848151811062000f1a57fe5b60200260200101516200226e90919063ffffffff16565b86838151811062000f3e57fe5b60209081029190910181019190915260008581526008825260408082206001600160a01b0389168352835280822085835260010190925290812055865187908390811062000f8857fe5b60200260200101516001600160a01b031684866001600160a01b03167ff75f3d433c6628e04e01a0be1a2c6692a6011ce4b00389824cfa8b8a12f3c1c4844360405162000fd792919062003271565b60405180910390a45b5060010162000ec9565b5060010162000e8e565b5060005b83518110156200105e5760008482815181106200101157fe5b602002602001015111156200105557620010558582815181106200103157fe5b6020026020010151848684815181106200104757fe5b602002602001015162002433565b60010162000ff8565b50505050505050565b600280541415620010bf576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600280556000818152600760209081526040808320600883528184203385529092528220805483825591929091905b6005548110156200111b5760008181526001808501602052604082208082018390559190915501620010ee565b5082546200112a9082620024de565b83558015620011cc5760018301546001600160a01b03908116600081815260046020819052604091829020549151632770a7eb60e21b815292939190911691639dc29fac916200117f91339187910162002da2565b600060405180830381600087803b1580156200119a57600080fd5b505af1158015620011af573d6000803e3d6000fd5b50620011ca925050506001600160a01b03821633846200253c565b505b4384336001600160a01b03167f2369db1bafee945aee5630782f4a170682e3f8188d8dc247a4c73eb8c9e692d284604051620012099190620031c5565b60405180910390a4505060016002555050565b6000546001600160a01b0316331462001269576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038116620012c5576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b0316331462001383576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154600054604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b0316331462001443576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166200149f576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600054604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b600581815481106200155657600080fd5b6000918252602090912001546001600160a01b0316905081565b600280541415620015c8576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600280556000818152600860209081526040808320338452909152902054620015f3908290620022d2565b506001600255565b60065481106200161f5760405162461bcd60e51b815260040162000b4c9062002f79565b6000818152600760205260408120906200163983620025a9565b600183015490915063ffffffff600160e01b9091048116908216116200166157505062001743565b8154806200169657506001909101805463ffffffff909216600160e01b026001600160e01b0390921691909117905562001743565b600183015463ffffffff600160e01b909104811683031660005b6005548110156200171957600081815260028601602052604081208054909190620016dd908590620025e4565b90506200170b85620016f58364e8d4a51000620025e4565b81620016fd57fe5b60018501549190046200226e565b6001928301555001620016b0565b5050506001909101805463ffffffff909216600160e01b026001600160e01b039092169190911790555b50565b6000546001600160a01b0316331462001793576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6200179e84620015fb565b6000848152600760205260409020600181015443600160c01b90910463ffffffff1611620017e05760405162461bcd60e51b815260040162000b4c9062003157565b6005548214620018045760405162461bcd60e51b815260040162000b4c9062002f42565b438463ffffffff161180156200182e5750600181015463ffffffff600160a01b9091048116908516115b6200184d5760405162461bcd60e51b815260040162000b4c9062003055565b60018101805463ffffffff60c01b1916600160c01b63ffffffff87160217905560005b82811015620018ad578383828181106200188657fe5b60008481526002860160209081526040909120910292909201359091555060010162001870565b508363ffffffff16857fba2d8506275d684e80223910f1065a195ea279f37e27eb97ac24f4107eba6cf98585604051620018e992919062002e0a565b60405180910390a35050505050565b6000546001600160a01b0316331462001945576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6200195085620015fb565b6000858152600760205260409020600181015443600160a01b90910463ffffffff161180620019905750600181015443600160c01b90910463ffffffff16105b620019af5760405162461bcd60e51b815260040162000b4c90620030fa565b6005548214620019d35760405162461bcd60e51b815260040162000b4c9062002fe7565b438563ffffffff16118015620019f457508463ffffffff168463ffffffff16115b62001a135760405162461bcd60e51b815260040162000b4c9062002f0b565b60018101805463ffffffff60a01b1916600160a01b63ffffffff8881169182029290921763ffffffff60c01b1916600160c01b92881692909202919091176001600160e01b0316600160e01b9190910217905560005b8281101562001aa65783838281811062001a7f57fe5b60008481526002860160209081526040909120910292909201359091555060010162001a69565b508363ffffffff168563ffffffff16877f4f863dc93468acf71ff8f5770599fbead4d0ff8ea6bd0c3251576f68fdad0904868660405162001ae992919062002e0a565b60405180910390a4505050505050565b6060600580548060200260200160405190810160405280929190818152602001828054801562001b5357602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162001b34575b5050505050905090565b6000546001600160a01b0316331462001baa576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b60006005838154811062001bba57fe5b6000918252602090912001546001600160a01b031690508062001c61576000336001600160a01b03168360405162001bf29062002d8b565b60006040518083038185875af1925050503d806000811462001c31576040519150601f19603f3d011682016040523d82523d6000602084013e62001c36565b606091505b505090508062001c5a5760405162461bcd60e51b815260040162000b4c906200308c565b5062001c77565b62001c776001600160a01b03821633846200253c565b505050565b6005546060908067ffffffffffffffff8111801562001c9a57600080fd5b5060405190808252806020026020018201604052801562001cc5578160200160208202803683370190505b506000858152600760209081526040808320600883528184206001600160a01b038916855290925282208154600183015494965091939092600160e01b90910463ffffffff169062001d1789620025a9565b905060005b8681101562001e5057600081815260028701602052604090206001015463ffffffff83168410801562001d4e57508415155b1562001dac57600082815260028801602052604081205462001d7e9063ffffffff8087168890039190620025e416565b905062001da88662001d968364e8d4a51000620025e4565b8162001d9e57fe5b849190046200226e565b9150505b600082815260018088016020526040909120015464e8d4a510009062001de29062001dd9908490620024de565b885490620025e4565b8162001dea57fe5b0489838151811062001df857fe5b60200260200101818152505062001e2e866001016000848152602001908152602001600020600001548a848151811062000f1a57fe5b89838151811062001e3b57fe5b60209081029190910101525060010162001d1c565b5050505050505092915050565b62001e6881620015fb565b620017433382600162001fed565b6000546001600160a01b031681565b80158062001f285750604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801562001ef857600080fd5b505afa15801562001f0d573d6000803e3d6000fd5b505050506040513d602081101562001f2457600080fd5b5051155b62001f655760405162461bcd60e51b81526004018080602001828103825260368152602001806200430d6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167f095ea7b30000000000000000000000000000000000000000000000000000000017905262001c7790849062002642565b606062001fe38484600085620026f9565b90505b9392505050565b60008281526008602090815260408083206001600160a01b0387168452909152902054600554816200207f5760005b81811015620020765760008581526007602090815260408083208484526002018252808320600190810154898552600884528285206001600160a01b038c168652845282852086865282019093529220820155016200201c565b50505062001c77565b60005b81811015620021eb5760008581526007602090815260408083208484526002018252808320600190810154898552600884528285206001600160a01b038c16865284528285208686528201909352908320908101549192909164e8d4a5100090620020fc90620020f4908690620024de565b8890620025e4565b816200210457fe5b83549190049150620021189082906200226e565b9050866200212757806200212a565b60005b825560018201839055868015620021415750600081115b15620021df5762002176600585815481106200215957fe5b6000918252602090912001546001600160a01b03168a8362002433565b600584815481106200218457fe5b6000918252602090912001546040516001600160a01b03918216918a91908c16907ff75f3d433c6628e04e01a0be1a2c6692a6011ce4b00389824cfa8b8a12f3c1c490620021d6908690439062003271565b60405180910390a45b50505060010162002082565b505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03167f23b872dd000000000000000000000000000000000000000000000000000000001790526200226890859062002642565b50505050565b600082820183811015620022c9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000828152600760209081526040808320600883528184203385529092529091208054831115620023175760405162461bcd60e51b815260040162000b4c906200301e565b6200232284620015fb565b620023303385600162001fed565b80546200233e9084620024de565b815581546200234e9084620024de565b825560018201546001600160a01b03908116600081815260046020819052604091829020549151632770a7eb60e21b815292939190911691639dc29fac916200239c91339189910162002da2565b600060405180830381600087803b158015620023b757600080fd5b505af1158015620023cc573d6000803e3d6000fd5b50620023e7925050506001600160a01b03821633866200253c565b4385336001600160a01b03167f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca9487604051620024249190620031c5565b60405180910390a45050505050565b60006001600160a01b038416156200244d5760006200244f565b815b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637750c9f0828686866040518563ffffffff1660e01b8152600401620024a49392919062002e7e565b6000604051808303818588803b158015620024be57600080fd5b505af1158015620024d3573d6000803e3d6000fd5b505050505050505050565b60008282111562002536576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905262001c7790849062002642565b600081815260076020526040902060010154600160c01b900463ffffffff1643811115620025df57620025dc436200285f565b90505b919050565b600082620025f557506000620022cc565b828202828482816200260357fe5b0414620022c95760405162461bcd60e51b81526004018080602001828103825260218152602001806200429c6021913960400191505060405180910390fd5b600062002699826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031662001fd29092919063ffffffff16565b80519091501562001c7757808060200190516020811015620026ba57600080fd5b505162001c775760405162461bcd60e51b815260040180806020018281038252602a815260200180620042e3602a913960400191505060405180910390fd5b6060824710156200273c5760405162461bcd60e51b8152600401808060200182810382526026815260200180620042766026913960400191505060405180910390fd5b6200274785620028aa565b62002799576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310620027d95780518252601f199092019160209182019101620027b8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146200283d576040519150601f19603f3d011682016040523d82523d6000602084013e62002842565b606091505b509150915062002854828286620028b0565b979650505050505050565b60006401000000008210620028a65760405162461bcd60e51b8152600401808060200182810382526026815260200180620042bd6026913960400191505060405180910390fd5b5090565b3b151590565b60608315620028c157508162001fe6565b825115620028d25782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200291e57818101518382015260200162002904565b50505050905090810190601f1680156200294c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b610ff6806200328083390190565b80356001600160a01b0381168114620025df57600080fd5b60008083601f84011262002992578081fd5b50813567ffffffffffffffff811115620029aa578182fd5b6020830191508360208083028501011115620029c557600080fd5b9250929050565b600082601f830112620029dd578081fd5b813567ffffffffffffffff80821115620029f357fe5b604051601f8301601f19168101602001828111828210171562002a1257fe5b60405282815284830160200186101562002a2a578384fd5b82602086016020830137918201602001929092529392505050565b803563ffffffff81168114620025df57600080fd5b60006020828403121562002a6c578081fd5b62001fe68262002968565b600080600080600080600060c0888a03121562002a92578283fd5b62002a9d8862002968565b965062002aad6020890162002a45565b955062002abd6040890162002a45565b9450606088013567ffffffffffffffff8082111562002ada578485fd5b62002ae88b838c0162002980565b909650945060808a013591508082111562002b01578384fd5b62002b0f8b838c01620029cc565b935060a08a013591508082111562002b25578283fd5b5062002b348a828b01620029cc565b91505092959891949750929550565b6000806020838503121562002b56578182fd5b823567ffffffffffffffff81111562002b6d578283fd5b62002b7b8582860162002980565b90969095509350505050565b60006020828403121562002b99578081fd5b5035919050565b6000806040838503121562002bb3578182fd5b8235915062002bc56020840162002968565b90509250929050565b6000806040838503121562002be1578182fd5b50508035926020909101359150565b60008060006060848603121562002c05578283fd5b83359250602084013591506040840135801515811462002c23578182fd5b809150509250925092565b6000806000806060858703121562002c44578384fd5b8435935062002c566020860162002a45565b9250604085013567ffffffffffffffff81111562002c72578283fd5b62002c808782880162002980565b95989497509550505050565b60008060008060006080868803121562002ca4578081fd5b8535945062002cb66020870162002a45565b935062002cc66040870162002a45565b9250606086013567ffffffffffffffff81111562002ce2578182fd5b62002cf08882890162002980565b969995985093965092949392505050565b6000815180845260208085019450808401835b8381101562002d325781518752958201959082019060010162002d14565b509495945050505050565b60008151808452815b8181101562002d645760208185018101518683018201520162002d46565b8181111562002d765782602083870101525b50601f01601f19169290920160200192915050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b8181101562002dfe5783516001600160a01b03168352928401929184019160010162002dd7565b50909695505050505050565b6000602082528260208301527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111562002e43578081fd5b60208302808560408501379190910160400190815292915050565b60006020825262001fe6602083018462002d01565b901515815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006040825262002eb7604083018562002d3d565b828103602084015262002ecb818562002d3d565b95945050505050565b60208082526018908201527f6164643a20696e76616c6964207374616b6520746f6b656e0000000000000000604082015260600190565b60208082526015908201527f72656e65773a20696e76616c696420626c6f636b730000000000000000000000604082015260600190565b60208082526016908201527f7570646174653a20696e76616c6964206c656e67746800000000000000000000604082015260600190565b6020808252600f908201527f696e76616c696420706f6f6c2069640000000000000000000000000000000000604082015260600190565b60208082526013908201527f6164643a20696e76616c6964206c656e67746800000000000000000000000000604082015260600190565b60208082526015908201527f72656e65773a20696e76616c6964206c656e6774680000000000000000000000604082015260600190565b6020808252601d908201527f77697468647261773a20696e73756666696369656e7420616d6f756e74000000604082015260600190565b60208082526019908201527f7570646174653a20696e76616c696420656e6420626c6f636b00000000000000604082015260600190565b6020808252601c908201527f7472616e736665722072657761726420746f6b656e206661696c656400000000604082015260600190565b60208082526014908201527f6164643a206475706c69636174656420706f6f6c000000000000000000000000604082015260600190565b60208082526022908201527f72656e65773a20696e76616c696420706f6f6c20737461746520746f2072656e60408201527f6577000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601a908201527f7570646174653a20706f6f6c20616c726561647920656e646564000000000000604082015260600190565b60208082526013908201527f6164643a20696e76616c696420626c6f636b7300000000000000000000000000604082015260600190565b90815260200190565b60008882526001600160a01b038816602083015263ffffffff8088166040840152808716606084015280861660808401525060e060a08301526200321660e083018562002d01565b82810360c08401526200322a818562002d01565b9a9950505050505050505050565b60008482526060602083015262003253606083018562002d01565b828103604084015262003267818562002d01565b9695505050505050565b91825260208201526040019056fe60806040523480156200001157600080fd5b5060405162000ff638038062000ff68339810160408190526200003491620001d6565b8151829082906200004d9060039060208501906200008f565b508051620000639060049060208401906200008f565b505060058054601260ff1990911617610100600160a81b0319166101003302179055506200023d915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620000c7576000855562000112565b82601f10620000e257805160ff191683800117855562000112565b8280016001018555821562000112579182015b8281111562000112578251825591602001919060010190620000f5565b506200012092915062000124565b5090565b5b8082111562000120576000815560010162000125565b600082601f8301126200014c578081fd5b81516001600160401b03808211156200016157fe5b6040516020601f8401601f19168201810183811183821017156200018157fe5b604052838252858401810187101562000198578485fd5b8492505b83831015620001bb57858301810151828401820152918201916200019c565b83831115620001cc57848185840101525b5095945050505050565b60008060408385031215620001e9578182fd5b82516001600160401b038082111562000200578384fd5b6200020e868387016200013b565b9350602085015191508082111562000224578283fd5b5062000233858286016200013b565b9150509250929050565b610da9806200024d6000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806340c10f191161008c5780639dc29fac116100665780639dc29fac146101a2578063a457c2d7146101b5578063a9059cbb146101c8578063dd62ed3e146101db576100df565b806340c10f191461017257806370a082311461018757806395d89b411461019a576100df565b806323b872dd116100bd57806323b872dd14610137578063313ce5671461014a578063395093511461015f576100df565b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610122575b600080fd5b6100ec6101ee565b6040516100f99190610b8e565b60405180910390f35b610115610110366004610b5a565b610284565b6040516100f99190610b83565b61012a6102a1565b6040516100f99190610c18565b610115610145366004610b1f565b6102a7565b61015261032e565b6040516100f99190610c21565b61011561016d366004610b5a565b610337565b610185610180366004610b5a565b610385565b005b61012a610195366004610ad3565b6103cb565b6100ec6103ea565b6101856101b0366004610b5a565b61044b565b6101156101c3366004610b5a565b610484565b6101156101d6366004610b5a565b6104ec565b61012a6101e9366004610aed565b610500565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561027a5780601f1061024f5761010080835404028352916020019161027a565b820191906000526020600020905b81548152906001019060200180831161025d57829003601f168201915b5050505050905090565b600061029861029161052b565b848461052f565b50600192915050565b60025490565b60006102b484848461061b565b610324846102c061052b565b61031f85604051806060016040528060288152602001610cbd602891396001600160a01b038a166000908152600160205260408120906102fe61052b565b6001600160a01b031681526020810191909152604001600020549190610776565b61052f565b5060019392505050565b60055460ff1690565b600061029861034461052b565b8461031f856001600061035561052b565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549061080d565b60055461010090046001600160a01b031633146103bd5760405162461bcd60e51b81526004016103b490610be1565b60405180910390fd5b6103c7828261086e565b5050565b6001600160a01b0381166000908152602081905260409020545b919050565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561027a5780601f1061024f5761010080835404028352916020019161027a565b60055461010090046001600160a01b0316331461047a5760405162461bcd60e51b81526004016103b490610be1565b6103c7828261095e565b600061029861049161052b565b8461031f85604051806060016040528060258152602001610d4f60259139600160006104bb61052b565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610776565b60006102986104f961052b565b848461061b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166105745760405162461bcd60e51b8152600401808060200182810382526024815260200180610d2b6024913960400191505060405180910390fd5b6001600160a01b0382166105b95760405162461bcd60e51b8152600401808060200182810382526022815260200180610c756022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106605760405162461bcd60e51b8152600401808060200182810382526025815260200180610d066025913960400191505060405180910390fd5b6001600160a01b0382166106a55760405162461bcd60e51b8152600401808060200182810382526023815260200180610c306023913960400191505060405180910390fd5b6106b0838383610a5a565b6106ed81604051806060016040528060268152602001610c97602691396001600160a01b0386166000908152602081905260409020549190610776565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461071c908261080d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156108055760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107ca5781810151838201526020016107b2565b50505050905090810190601f1680156107f75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610867576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166108c9576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6108d560008383610a5a565b6002546108e2908261080d565b6002556001600160a01b038216600090815260208190526040902054610908908261080d565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b0382166109a35760405162461bcd60e51b8152600401808060200182810382526021815260200180610ce56021913960400191505060405180910390fd5b6109af82600083610a5a565b6109ec81604051806060016040528060228152602001610c53602291396001600160a01b0385166000908152602081905260409020549190610776565b6001600160a01b038316600090815260208190526040902055600254610a129082610a5f565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b505050565b600082821115610ab6576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b80356001600160a01b03811681146103e557600080fd5b600060208284031215610ae4578081fd5b61086782610abc565b60008060408385031215610aff578081fd5b610b0883610abc565b9150610b1660208401610abc565b90509250929050565b600080600060608486031215610b33578081fd5b610b3c84610abc565b9250610b4a60208501610abc565b9150604084013590509250925092565b60008060408385031215610b6c578182fd5b610b7583610abc565b946020939093013593505050565b901515815260200190565b6000602080835283518082850152825b81811015610bba57858101830151858201604001528201610b9e565b81811115610bcb5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600c908201527f756e617574686f72697a65640000000000000000000000000000000000000000604082015260600190565b90815260200190565b60ff9190911681526020019056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220cc13637bec3ad7a53528b8442547c8e1ee4ac55266c9d9b113a2a9d445ef1db964736f6c63430007060033416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7753616665436173743a2076616c756520646f65736e27742066697420696e20333220626974735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a264697066735822122008f65d228344bee86faf0a0a57d8a79afda5b9e7563150f1bc6341ba93e0134464736f6c63430007060033416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000000004bd6037e5cf0cadb0cce85691a5723bc94ae2fae0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000bbd817b146f73f4b8022dc998b2c275ddda166bf0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce97202

Deployed Bytecode

0x608060405260043610620001c35760003560e01c806375829def11620000f7578063affb9fc81162000097578063d12e4ceb116200006d578063d12e4ceb1462000505578063d18df53c146200052a578063ddc63262146200055e578063f851a440146200058357620001cb565b8063affb9fc81462000494578063b43c627014620004b9578063c4f59f9b14620004de57620001cb565b80637bb7bed111620000cd5780637bb7bed11462000425578063958e2d31146200044a578063adb82b31146200046f57620001cb565b806375829def14620003c357806377f50f9714620003e85780637acc8678146200040057620001cb565b80633892601c116200016357806344205303116200013957806344205303146200035457806352fd9f2f14620003795780635312ea8e146200039e57620001cb565b80633892601c14620002f057806343a0d0661462000308578063441a3e70146200032f57620001cb565b806326782247116200019957806326782247146200026a5780632bddd8bb14620002915780632f380b3514620002b657620001cb565b8063081e3eda14620001d05780631069f3b514620002005780631e1c6a07146200023657620001cb565b36620001cb57005b600080fd5b348015620001dd57600080fd5b50620001e86200059b565b604051620001f79190620031c5565b60405180910390f35b3480156200020d57600080fd5b50620002256200021f36600462002ba0565b620005a1565b604051620001f79392919062003238565b3480156200024357600080fd5b506200025b6200025536600462002a5a565b620006db565b604051620001f7919062002e73565b3480156200027757600080fd5b5062000282620006f0565b604051620001f7919062002d8e565b3480156200029e57600080fd5b5062000282620002b036600462002a5a565b620006ff565b348015620002c357600080fd5b50620002db620002d536600462002b87565b6200071a565b604051620001f79796959493929190620031ce565b348015620002fd57600080fd5b506200028262000878565b3480156200031557600080fd5b506200032d6200032736600462002bf0565b6200089c565b005b3480156200033c57600080fd5b506200032d6200034e36600462002bce565b62000a52565b3480156200036157600080fd5b506200032d6200037336600462002a77565b62000ac3565b3480156200038657600080fd5b506200032d6200039836600462002b43565b62000ddf565b348015620003ab57600080fd5b506200032d620003bd36600462002b87565b62001067565b348015620003d057600080fd5b506200032d620003e236600462002a5a565b6200121c565b348015620003f557600080fd5b506200032d62001323565b3480156200040d57600080fd5b506200032d6200041f36600462002a5a565b620013f6565b3480156200043257600080fd5b50620002826200044436600462002b87565b62001545565b3480156200045757600080fd5b506200032d6200046936600462002b87565b62001570565b3480156200047c57600080fd5b506200032d6200048e36600462002b87565b620015fb565b348015620004a157600080fd5b506200032d620004b336600462002c2e565b62001746565b348015620004c657600080fd5b506200032d620004d836600462002c8c565b620018f8565b348015620004eb57600080fd5b50620004f662001af9565b604051620001f7919062002dbb565b3480156200051257600080fd5b506200032d6200052436600462002bce565b62001b5d565b3480156200053757600080fd5b506200054f6200054936600462002ba0565b62001c7c565b604051620001f7919062002e5e565b3480156200056b57600080fd5b506200032d6200057d36600462002b87565b62001e5d565b3480156200059057600080fd5b506200028262001e76565b60065481565b60008281526008602090815260408083206001600160a01b038516845290915290208054600554909160609182919067ffffffffffffffff81118015620005e757600080fd5b5060405190808252806020026020018201604052801562000612578160200160208202803683370190505b5060055490935067ffffffffffffffff811180156200063057600080fd5b506040519080825280602002602001820160405280156200065b578160200160208202803683370190505b50915060005b600554811015620006d257600081815260018301602052604090205484518590839081106200068c57fe5b60200260200101818152505081600101600082815260200190815260200160002060010154838281518110620006be57fe5b602090810291909101015260010162000661565b50509250925092565b60036020526000908152604090205460ff1681565b6001546001600160a01b031681565b6004602052600090815260409020546001600160a01b031681565b60008181526007602052604090208054600182015460055491926001600160a01b0382169263ffffffff600160a01b8404811693600160c01b8104821693600160e01b90910490911691606091829167ffffffffffffffff811180156200078057600080fd5b50604051908082528060200260200182016040528015620007ab578160200160208202803683370190505b5060055490935067ffffffffffffffff81118015620007c957600080fd5b50604051908082528060200260200182016040528015620007f4578160200160208202803683370190505b50915060005b6005548110156200086b57600081815260028301602052604090205484518590839081106200082557fe5b602002602001018181525050816002016000828152602001908152602001600020600101548382815181106200085757fe5b6020908102919091010152600101620007fa565b5050919395979092949650565b7f000000000000000000000000bbd817b146f73f4b8022dc998b2c275ddda166bf81565b600280541415620008f4576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600280556200090383620015fb565b6200091033848362001fed565b6000838152600760209081526040808320600883528184203380865293529220600183015490916001600160a01b0390911690620009529082903088620021f3565b6001600160a01b038082166000908152600460208190526040918290205491517f40c10f1900000000000000000000000000000000000000000000000000000000815291909216916340c10f1991620009b09133918a910162002da2565b600060405180830381600087803b158015620009cb57600080fd5b505af1158015620009e0573d6000803e3d6000fd5b50508354620009f392509050866200226e565b8255825462000a0390866200226e565b83556040514390879033907f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e9062000a3d908a90620031c5565b60405180910390a45050600160025550505050565b60028054141562000aaa576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002805562000aba8282620022d2565b50506001600255565b6000546001600160a01b0316331462000b10576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03871660009081526003602052604090205460ff161562000b555760405162461bcd60e51b815260040162000b4c90620030c3565b60405180910390fd5b6001600160a01b03871662000b7e5760405162461bcd60e51b815260040162000b4c9062002ed4565b600554831462000ba25760405162461bcd60e51b815260040162000b4c9062002fb0565b438663ffffffff1611801562000bc357508563ffffffff168563ffffffff16115b62000be25760405162461bcd60e51b815260040162000b4c906200318e565b60068054600090815260076020526040808220600190810180546001600160a01b0319166001600160a01b038d16179055835483528183208101805463ffffffff60a01b1916600160a01b63ffffffff8d811691820292909217909255855485528385208301805463ffffffff60c01b1916600160c01b928d1692909202919091179055935483528183200180546001600160e01b0316600160e01b9094029390931790925590518390839062000c99906200295a565b62000ca692919062002ea2565b604051809103906000f08015801562000cc3573d6000803e3d6000fd5b506001600160a01b03898116600090815260046020526040812080546001600160a01b031916928416929092179091559091505b8481101562000d5a57604051806040016040528087878481811062000d1857fe5b60209081029290920135835250600091810182905260065482526007815260408083208584526002018252909120825181559101516001918201550162000cf7565b506006805460019081019091556001600160a01b03891660008181526003602052604090819020805460ff1916909317909255905163ffffffff80891692908a16917feb19e76b03b99eff4d0329a19e44569c131f242c9590234f19b76f2c56a817a19062000dcd908a908a9062002e0a565b60405180910390a45050505050505050565b6000600580548060200260200160405190810160405280929190818152602001828054801562000e3957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000e1a575b505050505090506000815167ffffffffffffffff8111801562000e5b57600080fd5b5060405190808252806020026020018201604052801562000e86578160200160208202803683370190505b509050336000805b8581101562000ff45786868281811062000ea457fe5b90506020020135915062000eb882620015fb565b62000ec68383600062001fed565b60005b855181101562000fea5760008381526008602090815260408083206001600160a01b03881684528252808320848452600101909152902054801562000fe05762000f318187848151811062000f1a57fe5b60200260200101516200226e90919063ffffffff16565b86838151811062000f3e57fe5b60209081029190910181019190915260008581526008825260408082206001600160a01b0389168352835280822085835260010190925290812055865187908390811062000f8857fe5b60200260200101516001600160a01b031684866001600160a01b03167ff75f3d433c6628e04e01a0be1a2c6692a6011ce4b00389824cfa8b8a12f3c1c4844360405162000fd792919062003271565b60405180910390a45b5060010162000ec9565b5060010162000e8e565b5060005b83518110156200105e5760008482815181106200101157fe5b602002602001015111156200105557620010558582815181106200103157fe5b6020026020010151848684815181106200104757fe5b602002602001015162002433565b60010162000ff8565b50505050505050565b600280541415620010bf576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600280556000818152600760209081526040808320600883528184203385529092528220805483825591929091905b6005548110156200111b5760008181526001808501602052604082208082018390559190915501620010ee565b5082546200112a9082620024de565b83558015620011cc5760018301546001600160a01b03908116600081815260046020819052604091829020549151632770a7eb60e21b815292939190911691639dc29fac916200117f91339187910162002da2565b600060405180830381600087803b1580156200119a57600080fd5b505af1158015620011af573d6000803e3d6000fd5b50620011ca925050506001600160a01b03821633846200253c565b505b4384336001600160a01b03167f2369db1bafee945aee5630782f4a170682e3f8188d8dc247a4c73eb8c9e692d284604051620012099190620031c5565b60405180910390a4505060016002555050565b6000546001600160a01b0316331462001269576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038116620012c5576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b0316331462001383576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154600054604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b0316331462001443576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166200149f576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600054604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b600581815481106200155657600080fd5b6000918252602090912001546001600160a01b0316905081565b600280541415620015c8576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600280556000818152600860209081526040808320338452909152902054620015f3908290620022d2565b506001600255565b60065481106200161f5760405162461bcd60e51b815260040162000b4c9062002f79565b6000818152600760205260408120906200163983620025a9565b600183015490915063ffffffff600160e01b9091048116908216116200166157505062001743565b8154806200169657506001909101805463ffffffff909216600160e01b026001600160e01b0390921691909117905562001743565b600183015463ffffffff600160e01b909104811683031660005b6005548110156200171957600081815260028601602052604081208054909190620016dd908590620025e4565b90506200170b85620016f58364e8d4a51000620025e4565b81620016fd57fe5b60018501549190046200226e565b6001928301555001620016b0565b5050506001909101805463ffffffff909216600160e01b026001600160e01b039092169190911790555b50565b6000546001600160a01b0316331462001793576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6200179e84620015fb565b6000848152600760205260409020600181015443600160c01b90910463ffffffff1611620017e05760405162461bcd60e51b815260040162000b4c9062003157565b6005548214620018045760405162461bcd60e51b815260040162000b4c9062002f42565b438463ffffffff161180156200182e5750600181015463ffffffff600160a01b9091048116908516115b6200184d5760405162461bcd60e51b815260040162000b4c9062003055565b60018101805463ffffffff60c01b1916600160c01b63ffffffff87160217905560005b82811015620018ad578383828181106200188657fe5b60008481526002860160209081526040909120910292909201359091555060010162001870565b508363ffffffff16857fba2d8506275d684e80223910f1065a195ea279f37e27eb97ac24f4107eba6cf98585604051620018e992919062002e0a565b60405180910390a35050505050565b6000546001600160a01b0316331462001945576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6200195085620015fb565b6000858152600760205260409020600181015443600160a01b90910463ffffffff161180620019905750600181015443600160c01b90910463ffffffff16105b620019af5760405162461bcd60e51b815260040162000b4c90620030fa565b6005548214620019d35760405162461bcd60e51b815260040162000b4c9062002fe7565b438563ffffffff16118015620019f457508463ffffffff168463ffffffff16115b62001a135760405162461bcd60e51b815260040162000b4c9062002f0b565b60018101805463ffffffff60a01b1916600160a01b63ffffffff8881169182029290921763ffffffff60c01b1916600160c01b92881692909202919091176001600160e01b0316600160e01b9190910217905560005b8281101562001aa65783838281811062001a7f57fe5b60008481526002860160209081526040909120910292909201359091555060010162001a69565b508363ffffffff168563ffffffff16877f4f863dc93468acf71ff8f5770599fbead4d0ff8ea6bd0c3251576f68fdad0904868660405162001ae992919062002e0a565b60405180910390a4505050505050565b6060600580548060200260200160405190810160405280929190818152602001828054801562001b5357602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162001b34575b5050505050905090565b6000546001600160a01b0316331462001baa576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b60006005838154811062001bba57fe5b6000918252602090912001546001600160a01b031690508062001c61576000336001600160a01b03168360405162001bf29062002d8b565b60006040518083038185875af1925050503d806000811462001c31576040519150601f19603f3d011682016040523d82523d6000602084013e62001c36565b606091505b505090508062001c5a5760405162461bcd60e51b815260040162000b4c906200308c565b5062001c77565b62001c776001600160a01b03821633846200253c565b505050565b6005546060908067ffffffffffffffff8111801562001c9a57600080fd5b5060405190808252806020026020018201604052801562001cc5578160200160208202803683370190505b506000858152600760209081526040808320600883528184206001600160a01b038916855290925282208154600183015494965091939092600160e01b90910463ffffffff169062001d1789620025a9565b905060005b8681101562001e5057600081815260028701602052604090206001015463ffffffff83168410801562001d4e57508415155b1562001dac57600082815260028801602052604081205462001d7e9063ffffffff8087168890039190620025e416565b905062001da88662001d968364e8d4a51000620025e4565b8162001d9e57fe5b849190046200226e565b9150505b600082815260018088016020526040909120015464e8d4a510009062001de29062001dd9908490620024de565b885490620025e4565b8162001dea57fe5b0489838151811062001df857fe5b60200260200101818152505062001e2e866001016000848152602001908152602001600020600001548a848151811062000f1a57fe5b89838151811062001e3b57fe5b60209081029190910101525060010162001d1c565b5050505050505092915050565b62001e6881620015fb565b620017433382600162001fed565b6000546001600160a01b031681565b80158062001f285750604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801562001ef857600080fd5b505afa15801562001f0d573d6000803e3d6000fd5b505050506040513d602081101562001f2457600080fd5b5051155b62001f655760405162461bcd60e51b81526004018080602001828103825260368152602001806200430d6036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167f095ea7b30000000000000000000000000000000000000000000000000000000017905262001c7790849062002642565b606062001fe38484600085620026f9565b90505b9392505050565b60008281526008602090815260408083206001600160a01b0387168452909152902054600554816200207f5760005b81811015620020765760008581526007602090815260408083208484526002018252808320600190810154898552600884528285206001600160a01b038c168652845282852086865282019093529220820155016200201c565b50505062001c77565b60005b81811015620021eb5760008581526007602090815260408083208484526002018252808320600190810154898552600884528285206001600160a01b038c16865284528285208686528201909352908320908101549192909164e8d4a5100090620020fc90620020f4908690620024de565b8890620025e4565b816200210457fe5b83549190049150620021189082906200226e565b9050866200212757806200212a565b60005b825560018201839055868015620021415750600081115b15620021df5762002176600585815481106200215957fe5b6000918252602090912001546001600160a01b03168a8362002433565b600584815481106200218457fe5b6000918252602090912001546040516001600160a01b03918216918a91908c16907ff75f3d433c6628e04e01a0be1a2c6692a6011ce4b00389824cfa8b8a12f3c1c490620021d6908690439062003271565b60405180910390a45b50505060010162002082565b505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03167f23b872dd000000000000000000000000000000000000000000000000000000001790526200226890859062002642565b50505050565b600082820183811015620022c9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000828152600760209081526040808320600883528184203385529092529091208054831115620023175760405162461bcd60e51b815260040162000b4c906200301e565b6200232284620015fb565b620023303385600162001fed565b80546200233e9084620024de565b815581546200234e9084620024de565b825560018201546001600160a01b03908116600081815260046020819052604091829020549151632770a7eb60e21b815292939190911691639dc29fac916200239c91339189910162002da2565b600060405180830381600087803b158015620023b757600080fd5b505af1158015620023cc573d6000803e3d6000fd5b50620023e7925050506001600160a01b03821633866200253c565b4385336001600160a01b03167f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca9487604051620024249190620031c5565b60405180910390a45050505050565b60006001600160a01b038416156200244d5760006200244f565b815b90507f000000000000000000000000bbd817b146f73f4b8022dc998b2c275ddda166bf6001600160a01b0316637750c9f0828686866040518563ffffffff1660e01b8152600401620024a49392919062002e7e565b6000604051808303818588803b158015620024be57600080fd5b505af1158015620024d3573d6000803e3d6000fd5b505050505050505050565b60008282111562002536576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905262001c7790849062002642565b600081815260076020526040902060010154600160c01b900463ffffffff1643811115620025df57620025dc436200285f565b90505b919050565b600082620025f557506000620022cc565b828202828482816200260357fe5b0414620022c95760405162461bcd60e51b81526004018080602001828103825260218152602001806200429c6021913960400191505060405180910390fd5b600062002699826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031662001fd29092919063ffffffff16565b80519091501562001c7757808060200190516020811015620026ba57600080fd5b505162001c775760405162461bcd60e51b815260040180806020018281038252602a815260200180620042e3602a913960400191505060405180910390fd5b6060824710156200273c5760405162461bcd60e51b8152600401808060200182810382526026815260200180620042766026913960400191505060405180910390fd5b6200274785620028aa565b62002799576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310620027d95780518252601f199092019160209182019101620027b8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146200283d576040519150601f19603f3d011682016040523d82523d6000602084013e62002842565b606091505b509150915062002854828286620028b0565b979650505050505050565b60006401000000008210620028a65760405162461bcd60e51b8152600401808060200182810382526026815260200180620042bd6026913960400191505060405180910390fd5b5090565b3b151590565b60608315620028c157508162001fe6565b825115620028d25782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200291e57818101518382015260200162002904565b50505050905090810190601f1680156200294c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b610ff6806200328083390190565b80356001600160a01b0381168114620025df57600080fd5b60008083601f84011262002992578081fd5b50813567ffffffffffffffff811115620029aa578182fd5b6020830191508360208083028501011115620029c557600080fd5b9250929050565b600082601f830112620029dd578081fd5b813567ffffffffffffffff80821115620029f357fe5b604051601f8301601f19168101602001828111828210171562002a1257fe5b60405282815284830160200186101562002a2a578384fd5b82602086016020830137918201602001929092529392505050565b803563ffffffff81168114620025df57600080fd5b60006020828403121562002a6c578081fd5b62001fe68262002968565b600080600080600080600060c0888a03121562002a92578283fd5b62002a9d8862002968565b965062002aad6020890162002a45565b955062002abd6040890162002a45565b9450606088013567ffffffffffffffff8082111562002ada578485fd5b62002ae88b838c0162002980565b909650945060808a013591508082111562002b01578384fd5b62002b0f8b838c01620029cc565b935060a08a013591508082111562002b25578283fd5b5062002b348a828b01620029cc565b91505092959891949750929550565b6000806020838503121562002b56578182fd5b823567ffffffffffffffff81111562002b6d578283fd5b62002b7b8582860162002980565b90969095509350505050565b60006020828403121562002b99578081fd5b5035919050565b6000806040838503121562002bb3578182fd5b8235915062002bc56020840162002968565b90509250929050565b6000806040838503121562002be1578182fd5b50508035926020909101359150565b60008060006060848603121562002c05578283fd5b83359250602084013591506040840135801515811462002c23578182fd5b809150509250925092565b6000806000806060858703121562002c44578384fd5b8435935062002c566020860162002a45565b9250604085013567ffffffffffffffff81111562002c72578283fd5b62002c808782880162002980565b95989497509550505050565b60008060008060006080868803121562002ca4578081fd5b8535945062002cb66020870162002a45565b935062002cc66040870162002a45565b9250606086013567ffffffffffffffff81111562002ce2578182fd5b62002cf08882890162002980565b969995985093965092949392505050565b6000815180845260208085019450808401835b8381101562002d325781518752958201959082019060010162002d14565b509495945050505050565b60008151808452815b8181101562002d645760208185018101518683018201520162002d46565b8181111562002d765782602083870101525b50601f01601f19169290920160200192915050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b8181101562002dfe5783516001600160a01b03168352928401929184019160010162002dd7565b50909695505050505050565b6000602082528260208301527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111562002e43578081fd5b60208302808560408501379190910160400190815292915050565b60006020825262001fe6602083018462002d01565b901515815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006040825262002eb7604083018562002d3d565b828103602084015262002ecb818562002d3d565b95945050505050565b60208082526018908201527f6164643a20696e76616c6964207374616b6520746f6b656e0000000000000000604082015260600190565b60208082526015908201527f72656e65773a20696e76616c696420626c6f636b730000000000000000000000604082015260600190565b60208082526016908201527f7570646174653a20696e76616c6964206c656e67746800000000000000000000604082015260600190565b6020808252600f908201527f696e76616c696420706f6f6c2069640000000000000000000000000000000000604082015260600190565b60208082526013908201527f6164643a20696e76616c6964206c656e67746800000000000000000000000000604082015260600190565b60208082526015908201527f72656e65773a20696e76616c6964206c656e6774680000000000000000000000604082015260600190565b6020808252601d908201527f77697468647261773a20696e73756666696369656e7420616d6f756e74000000604082015260600190565b60208082526019908201527f7570646174653a20696e76616c696420656e6420626c6f636b00000000000000604082015260600190565b6020808252601c908201527f7472616e736665722072657761726420746f6b656e206661696c656400000000604082015260600190565b60208082526014908201527f6164643a206475706c69636174656420706f6f6c000000000000000000000000604082015260600190565b60208082526022908201527f72656e65773a20696e76616c696420706f6f6c20737461746520746f2072656e60408201527f6577000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601a908201527f7570646174653a20706f6f6c20616c726561647920656e646564000000000000604082015260600190565b60208082526013908201527f6164643a20696e76616c696420626c6f636b7300000000000000000000000000604082015260600190565b90815260200190565b60008882526001600160a01b038816602083015263ffffffff8088166040840152808716606084015280861660808401525060e060a08301526200321660e083018562002d01565b82810360c08401526200322a818562002d01565b9a9950505050505050505050565b60008482526060602083015262003253606083018562002d01565b828103604084015262003267818562002d01565b9695505050505050565b91825260208201526040019056fe60806040523480156200001157600080fd5b5060405162000ff638038062000ff68339810160408190526200003491620001d6565b8151829082906200004d9060039060208501906200008f565b508051620000639060049060208401906200008f565b505060058054601260ff1990911617610100600160a81b0319166101003302179055506200023d915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620000c7576000855562000112565b82601f10620000e257805160ff191683800117855562000112565b8280016001018555821562000112579182015b8281111562000112578251825591602001919060010190620000f5565b506200012092915062000124565b5090565b5b8082111562000120576000815560010162000125565b600082601f8301126200014c578081fd5b81516001600160401b03808211156200016157fe5b6040516020601f8401601f19168201810183811183821017156200018157fe5b604052838252858401810187101562000198578485fd5b8492505b83831015620001bb57858301810151828401820152918201916200019c565b83831115620001cc57848185840101525b5095945050505050565b60008060408385031215620001e9578182fd5b82516001600160401b038082111562000200578384fd5b6200020e868387016200013b565b9350602085015191508082111562000224578283fd5b5062000233858286016200013b565b9150509250929050565b610da9806200024d6000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806340c10f191161008c5780639dc29fac116100665780639dc29fac146101a2578063a457c2d7146101b5578063a9059cbb146101c8578063dd62ed3e146101db576100df565b806340c10f191461017257806370a082311461018757806395d89b411461019a576100df565b806323b872dd116100bd57806323b872dd14610137578063313ce5671461014a578063395093511461015f576100df565b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610122575b600080fd5b6100ec6101ee565b6040516100f99190610b8e565b60405180910390f35b610115610110366004610b5a565b610284565b6040516100f99190610b83565b61012a6102a1565b6040516100f99190610c18565b610115610145366004610b1f565b6102a7565b61015261032e565b6040516100f99190610c21565b61011561016d366004610b5a565b610337565b610185610180366004610b5a565b610385565b005b61012a610195366004610ad3565b6103cb565b6100ec6103ea565b6101856101b0366004610b5a565b61044b565b6101156101c3366004610b5a565b610484565b6101156101d6366004610b5a565b6104ec565b61012a6101e9366004610aed565b610500565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561027a5780601f1061024f5761010080835404028352916020019161027a565b820191906000526020600020905b81548152906001019060200180831161025d57829003601f168201915b5050505050905090565b600061029861029161052b565b848461052f565b50600192915050565b60025490565b60006102b484848461061b565b610324846102c061052b565b61031f85604051806060016040528060288152602001610cbd602891396001600160a01b038a166000908152600160205260408120906102fe61052b565b6001600160a01b031681526020810191909152604001600020549190610776565b61052f565b5060019392505050565b60055460ff1690565b600061029861034461052b565b8461031f856001600061035561052b565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549061080d565b60055461010090046001600160a01b031633146103bd5760405162461bcd60e51b81526004016103b490610be1565b60405180910390fd5b6103c7828261086e565b5050565b6001600160a01b0381166000908152602081905260409020545b919050565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561027a5780601f1061024f5761010080835404028352916020019161027a565b60055461010090046001600160a01b0316331461047a5760405162461bcd60e51b81526004016103b490610be1565b6103c7828261095e565b600061029861049161052b565b8461031f85604051806060016040528060258152602001610d4f60259139600160006104bb61052b565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610776565b60006102986104f961052b565b848461061b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166105745760405162461bcd60e51b8152600401808060200182810382526024815260200180610d2b6024913960400191505060405180910390fd5b6001600160a01b0382166105b95760405162461bcd60e51b8152600401808060200182810382526022815260200180610c756022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106605760405162461bcd60e51b8152600401808060200182810382526025815260200180610d066025913960400191505060405180910390fd5b6001600160a01b0382166106a55760405162461bcd60e51b8152600401808060200182810382526023815260200180610c306023913960400191505060405180910390fd5b6106b0838383610a5a565b6106ed81604051806060016040528060268152602001610c97602691396001600160a01b0386166000908152602081905260409020549190610776565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461071c908261080d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156108055760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107ca5781810151838201526020016107b2565b50505050905090810190601f1680156107f75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610867576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166108c9576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6108d560008383610a5a565b6002546108e2908261080d565b6002556001600160a01b038216600090815260208190526040902054610908908261080d565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b0382166109a35760405162461bcd60e51b8152600401808060200182810382526021815260200180610ce56021913960400191505060405180910390fd5b6109af82600083610a5a565b6109ec81604051806060016040528060228152602001610c53602291396001600160a01b0385166000908152602081905260409020549190610776565b6001600160a01b038316600090815260208190526040902055600254610a129082610a5f565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b505050565b600082821115610ab6576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b80356001600160a01b03811681146103e557600080fd5b600060208284031215610ae4578081fd5b61086782610abc565b60008060408385031215610aff578081fd5b610b0883610abc565b9150610b1660208401610abc565b90509250929050565b600080600060608486031215610b33578081fd5b610b3c84610abc565b9250610b4a60208501610abc565b9150604084013590509250925092565b60008060408385031215610b6c578182fd5b610b7583610abc565b946020939093013593505050565b901515815260200190565b6000602080835283518082850152825b81811015610bba57858101830151858201604001528201610b9e565b81811115610bcb5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600c908201527f756e617574686f72697a65640000000000000000000000000000000000000000604082015260600190565b90815260200190565b60ff9190911681526020019056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220cc13637bec3ad7a53528b8442547c8e1ee4ac55266c9d9b113a2a9d445ef1db964736f6c63430007060033416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7753616665436173743a2076616c756520646f65736e27742066697420696e20333220626974735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a264697066735822122008f65d228344bee86faf0a0a57d8a79afda5b9e7563150f1bc6341ba93e0134464736f6c63430007060033

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

0000000000000000000000004bd6037e5cf0cadb0cce85691a5723bc94ae2fae0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000bbd817b146f73f4b8022dc998b2c275ddda166bf0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce97202

-----Decoded View---------------
Arg [0] : _admin (address): 0x4BD6037E5CF0cADB0CcE85691A5723BC94Ae2faE
Arg [1] : _rewardTokens (address[]): 0xdeFA4e8a7bcBA345F687a2f1456F5Edd9CE97202
Arg [2] : _rewardLocker (address): 0xbbd817b146F73f4b8022DC998B2c275DdDa166Bf

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000004bd6037e5cf0cadb0cce85691a5723bc94ae2fae
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 000000000000000000000000bbd817b146f73f4b8022dc998b2c275ddda166bf
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [4] : 000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce97202


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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