ETH Price: $2,422.37 (+0.04%)

Token

Bunni WETH/swETH LP Liquis Deposit Vault (liqBUNNI-LP-vault)
 

Overview

Max Total Supply

19.359899736331302798 liqBUNNI-LP-vault

Holders

1

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
19.359899736331302798 liqBUNNI-LP-vault

Value
$0.00
0x0fc59C9C998537c940a9Dfc7DacDe533a9c496Fe
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
BaseRewardPool4626

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
istanbul EvmVersion
File 1 of 12 : BaseRewardPool4626.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import { IRewards } from "./Interfaces.sol";
import { BaseRewardPool, IDeposit } from "./BaseRewardPool.sol";
import { IERC4626, IERC20Metadata } from "./interfaces/IERC4626.sol";
import { IERC20 } from "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts-0.6/utils/ReentrancyGuard.sol";
import { SafeERC20 } from "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";

/**
 * @title   BaseRewardPool4626
 * @notice  Simply wraps the BaseRewardPool with the new IERC4626 Vault standard functions.
 * @dev     See https://github.com/fei-protocol/ERC4626/blob/main/src/interfaces/IERC4626.sol#L58
 *          This is not so much a vault as a Reward Pool, therefore asset:share ratio is always 1:1.
 *          To create most utility for this RewardPool, the "asset" has been made to be the crvLP token,
 *          as opposed to the cvxLP token. Therefore, users can easily deposit crvLP, and it will first
 *          go to the Booster and mint the cvxLP before performing the normal staking function.
 */
contract BaseRewardPool4626 is BaseRewardPool, ReentrancyGuard, IERC4626 {
    using SafeERC20 for IERC20;

    /**
     * @notice The address of the underlying ERC20 token used for
     * the Vault for accounting, depositing, and withdrawing.
     */
    address public override asset;

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

    /**
     * @dev See BaseRewardPool.sol
     */
    constructor(
        uint256 pid_,
        address stakingToken_,
        address rewardToken_,
        address operator_,
        address rewardManager_,
        address lptoken_
    ) public BaseRewardPool(pid_, stakingToken_, rewardToken_, operator_, rewardManager_) {
        asset = lptoken_;
        IERC20(asset).safeApprove(operator_, type(uint256).max);
    }

    /**
     * @notice Total amount of the underlying asset that is "managed" by Vault.
     */
    function totalAssets() external view virtual override returns(uint256){
        return totalSupply();
    }

    /**
     * @notice Mints `shares` Vault shares to `receiver`.
     * @dev Because `asset` is not actually what is collected here, first wrap to required token in the booster.
     */
    function deposit(uint256 assets, address receiver) public virtual override nonReentrant returns (uint256) {
        // Transfer "asset" (crvLP) from sender
        IERC20(asset).safeTransferFrom(msg.sender, address(this), assets);

        // Convert crvLP to cvxLP through normal booster deposit process, but don't stake
        uint256 balBefore = stakingToken.balanceOf(address(this));
        IDeposit(operator).deposit(pid, assets, false);
        uint256 balAfter = stakingToken.balanceOf(address(this));

        require(balAfter.sub(balBefore) >= assets, "!deposit");

        // Perform stake manually, now that the funds have been received
        _processStake(assets, receiver);

        emit Deposit(msg.sender, receiver, assets, assets);
        emit Staked(receiver, assets);
        return assets;
    }

    /**
     * @notice Mints exactly `shares` Vault shares to `receiver`
     * by depositing `assets` of underlying tokens.
     */
    function mint(uint256 shares, address receiver) external virtual override returns (uint256) {
        return deposit(shares, receiver);
    }

    /**
     * @notice Redeems `shares` from `owner` and sends `assets`
     * of underlying tokens to `receiver`.
     */
    function withdraw(
        uint256 assets,
        address receiver,
        address owner
    ) public virtual override nonReentrant returns (uint256) {
        if (msg.sender != owner) {
            _approve(owner, msg.sender, _allowances[owner][msg.sender].sub(assets, "ERC4626: withdrawal amount exceeds allowance"));
        }
        
        _withdrawAndUnwrapTo(assets, owner, receiver);

        emit Withdraw(msg.sender, receiver, owner, assets, assets);
        return assets;
    }

    /**
     * @notice Redeems `shares` from `owner` and sends `assets`
     * of underlying tokens to `receiver`.
     */
    function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) external virtual override returns (uint256) {
        return withdraw(shares, receiver, owner);
    }

    /**
     * @notice The amount of shares that the vault would
     * exchange for the amount of assets provided, in an
     * ideal scenario where all the conditions are met.
     */
    function convertToShares(uint256 assets) public view virtual override returns (uint256) {
        return assets;
    }

    /**
     * @notice The amount of assets that the vault would
     * exchange for the amount of shares provided, in an
     * ideal scenario where all the conditions are met.
     */
    function convertToAssets(uint256 shares) public view virtual override returns (uint256) {
        return shares;
    }

    /**
     * @notice Total number of underlying assets that can
     * be deposited by `owner` into the Vault, where `owner`
     * corresponds to the input parameter `receiver` of a
     * `deposit` call.
     */
    function maxDeposit(address /* owner */) public view virtual override returns (uint256) {
        return type(uint256).max;
    }

    /**
     * @notice Allows an on-chain or off-chain user to simulate
     * the effects of their deposit at the current block, given
     * current on-chain conditions.
     */    
    function previewDeposit(uint256 assets) external view virtual override returns(uint256){
        return convertToShares(assets);
    }

    /**
     * @notice Total number of underlying shares that can be minted
     * for `owner`, where `owner` corresponds to the input
     * parameter `receiver` of a `mint` call.
     */
    function maxMint(address owner) external view virtual override returns (uint256) {
        return maxDeposit(owner);
    }

    /**    
     * @notice Allows an on-chain or off-chain user to simulate
     * the effects of their mint at the current block, given
     * current on-chain conditions.
     */
    function previewMint(uint256 shares) external view virtual override returns(uint256){
        return convertToAssets(shares);
    }

    /**
     * @notice Total number of underlying assets that can be
     * withdrawn from the Vault by `owner`, where `owner`
     * corresponds to the input parameter of a `withdraw` call.
     */
    function maxWithdraw(address owner) public view virtual override returns (uint256) {
        return balanceOf(owner);
    }

    /**    
     * @notice Allows an on-chain or off-chain user to simulate
     * the effects of their withdrawal at the current block,
     * given current on-chain conditions.
     */
    function previewWithdraw(uint256 assets) public view virtual override returns(uint256 shares){
        return convertToShares(assets);
    }

    /**
     * @notice Total number of underlying shares that can be
     * redeemed from the Vault by `owner`, where `owner` corresponds
     * to the input parameter of a `redeem` call.
     */
    function maxRedeem(address owner) external view virtual override returns (uint256) {
        return maxWithdraw(owner);
    }
    /**    
     * @notice Allows an on-chain or off-chain user to simulate
     * the effects of their redeemption at the current block,
     * given current on-chain conditions.
     */
    function previewRedeem(uint256 shares) external view virtual override returns(uint256){
        return previewWithdraw(shares);
    }


    /* ========== IERC20 ========== */

    /**
     * @dev Returns the name of the token.
     */
    function name() external view override returns (string memory) {
        return string(
            abi.encodePacked(IERC20Metadata(address(stakingToken)).name(), " Vault")
        );
    }

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view override returns (string memory) {
        return string(
            abi.encodePacked(IERC20Metadata(address(stakingToken)).symbol(), "-vault")
        );
    }

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view override returns (uint8) {
        return 18;
    }

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() public view override(BaseRewardPool, IERC20) returns (uint256) {
        return BaseRewardPool.totalSupply();
    }

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) public view override(BaseRewardPool, IERC20) returns (uint256) {
        return BaseRewardPool.balanceOf(account);
    }

    /**
     * @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 override returns (bool) {
        _transfer(msg.sender, 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(msg.sender, spender, amount);
        return true;
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC4626: approve from the zero address");
        require(spender != address(0), "ERC4626: approve to the zero address");

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

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     */
    function transferFrom(address owner, address recipient, uint256 amount) external override returns (bool) {
        uint256 newAllowance = _allowances[owner][msg.sender].sub(amount, "ERC4626: withdrawal amount exceeds allowance");
        _approve(owner, msg.sender, newAllowance);
        _transfer(owner, recipient, amount);
        return true;
    }

    function _transfer(address from, address to, uint256 amount) internal updateReward(from) updateReward(to) virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");

        for(uint i=0; i < extraRewards.length; i++){
            IRewards(extraRewards[i]).withdraw(from , amount);
            IRewards(extraRewards[i]).stake(to, amount);
        }

        _balances[from] = fromBalance.sub(amount);
        _balances[to] = _balances[to].add(amount);
        emit Transfer(from, to, amount);
    }
}

File 2 of 12 : Interfaces.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;



interface ICurveGauge {
    function deposit(uint256) external;
    function balanceOf(address) external view returns (uint256);
    function withdraw(uint256) external;
    function claim_rewards() external;
    function reward_tokens(uint256) external view returns(address);//v2
    function rewarded_token() external view returns(address);//v1
    function lp_token() external view returns(address);
}

interface ICurveVoteEscrow {
    function create_lock(uint256, uint256) external;
    function increase_amount(uint256) external;
    function increase_unlock_time(uint256) external;
    function withdraw() external;
    function smart_wallet_checker() external view returns (address);
    function commit_smart_wallet_checker(address) external;
    function apply_smart_wallet_checker() external;
}

interface IWalletChecker {
    function check(address) external view returns (bool);
    function approveWallet(address) external;
    function dao() external view returns (address);
}

interface IVoting{
    function vote(uint256, bool, bool) external; //voteId, support, executeIfDecided
    function getVote(uint256) external view returns(bool,bool,uint64,uint64,uint64,uint64,uint256,uint256,uint256,bytes memory); 
    function vote_for_gauge_weights(address,uint256) external;
}

interface IMinter{
    function mint(address) external;
}

interface IStaker{
    function deposit(address, address) external returns (bool);
    function withdraw(address) external returns (uint256);
    function withdraw(address, address, uint256) external returns (bool);
    function withdrawAll(address, address) external returns (bool);
    function createLock(uint256, uint256) external returns(bool);
    function increaseAmount(uint256) external returns(bool);
    function increaseTime(uint256) external returns(bool);
    function release() external returns(bool);
    function claimCrv(address) external returns (uint256);
    function claimRewards(address) external returns(bool);
    function claimFees(address,address) external returns (uint256);
    function setStashAccess(address, bool) external returns (bool);
    function vote(uint256,address,bool) external returns(bool);
    function voteGaugeWeight(address,uint256) external returns(bool);
    function balanceOfPool(address) external view returns (uint256);
    function operator() external view returns (address);
    function execute(address _to, uint256 _value, bytes calldata _data) external returns (bool, bytes memory);
    function setVote(bytes32 hash, bool valid) external;
    function migrate(address to) external;
}

interface IRewards{
    function stake(address, uint256) external;
    function stakeFor(address, uint256) external;
    function withdraw(address, uint256) external;
    function exit(address) external;
    function getReward(address) external;
    function queueNewRewards(uint256) external;
    function notifyRewardAmount(uint256) external;
    function addExtraReward(address) external;
    function extraRewardsLength() external view returns (uint256);
    function stakingToken() external view returns (address);
    function rewardToken() external view returns(address);
    function earned(address account) external view returns (uint256);
}

interface IStash{
    function stashRewards() external returns (bool);
    function processStash() external returns (bool);
    function claimRewards() external returns (bool);
    function initialize(uint256 _pid, address _operator, address _staker, address _gauge, address _rewardFactory) external;
    function setExtraReward(address) external;
}

interface IFeeDistributor {
    function claimToken(address user, address token) external returns (uint256);
    function claimTokens(address user, address[] calldata tokens) external returns (uint256[] memory);
    function getTokenTimeCursor(address token) external view returns (uint256);
}

interface ITokenMinter{
    function mint(address,uint256) external;
    function burn(address,uint256) external;
}

interface IDeposit{
    function isShutdown() external view returns(bool);
    function balanceOf(address _account) external view returns(uint256);
    function totalSupply() external view returns(uint256);
    function poolInfo(uint256) external view returns(address,address,address,address,address, bool);
    function rewardClaimed(uint256,address,uint256) external;
    function withdrawTo(uint256,uint256,address) external;
    function claimRewards(uint256,address) external returns(bool);
    function rewardArbitrator() external returns(address);
    function setGaugeRedirect(uint256 _pid) external returns(bool);
    function owner() external returns(address);
    function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns(bool);
}

interface ICrvDeposit{
    function deposit(uint256, bool) external;
    function lockIncentive() external view returns(uint256);
}

interface IRewardFactory{
    function setAccess(address,bool) external;
    function CreateCrvRewards(uint256,address,address) external returns(address);
    function CreateTokenRewards(address,address,address) external returns(address);
    function activeRewardCount(address) external view returns(uint256);
    function addActiveReward(address,uint256) external returns(bool);
    function removeActiveReward(address,uint256) external returns(bool);
}

interface IStashFactory{
    function CreateStash(uint256,address,address,uint256) external returns(address);
    function setImplementation(address, address, address) external;
}

interface ITokenFactory{
    function CreateDepositToken(address) external returns(address);
}

interface IPools{
    function addPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool);
    function forceAddPool(address _lptoken, address _gauge, uint256 _stashVersion) external returns(bool);
    function shutdownPool(uint256 _pid) external returns(bool);
    function poolInfo(uint256) external view returns(address,address,address,address,address,bool);
    function poolLength() external view returns (uint256);
    function gaugeMap(address) external view returns(bool);
    function setPoolManager(address _poolM) external;
    function shutdownSystem() external;
    function setUsedAddress(address[] memory) external;
}

interface IVestedEscrow{
    function fund(address[] calldata _recipient, uint256[] calldata _amount) external returns(bool);
}

interface IRewardDeposit {
    function addReward(address, uint256) external;
}

interface ILocker {
    function lock(address _account, uint256 _amount) external;
    function checkpointEpoch() external;
    function epochCount() external view returns (uint256);
    function balanceAtEpochOf(uint256 _epoch, address _user) external view returns (uint256 amount);
    function totalSupplyAtEpoch(uint256 _epoch) external view returns (uint256 supply);
    function queueNewRewards(address _rewardsToken, uint256 reward) external;
    function getReward(address _account, bool _stake) external;
    function getReward(address _account) external;
}

File 3 of 12 : BaseRewardPool.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
 *Submitted for verification at Etherscan.io on 2020-07-17
 */

/*
   ____            __   __        __   _
  / __/__ __ ___  / /_ / /  ___  / /_ (_)__ __
 _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
     /___/

* Synthetix: BaseRewardPool.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

import "./Interfaces.sol";
import "./interfaces/MathUtil.sol";
import "./utils/Permission.sol";
import "@openzeppelin/contracts-0.6/math/SafeMath.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-0.6/utils/Address.sol";
import "@openzeppelin/contracts-0.6/token/ERC20/SafeERC20.sol";


/**
 * @title   BaseRewardPool
 * @author  Synthetix -> ConvexFinance
 * @notice  Unipool rewards contract that is re-deployed from rFactory for each staking pool.
 * @dev     Changes made here by ConvexFinance are to do with the delayed reward allocation. Curve is queued for
 *          rewards and the distribution only begins once the new rewards are sufficiently large, or the epoch
 *          has ended. Additionally, enables hooks for `extraRewards` that can be enabled at any point to
 *          distribute a child reward token (i.e. a secondary one from Curve, or a separate one).
 */
contract BaseRewardPool is Permission {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    IERC20 public immutable rewardToken;
    IERC20 public immutable stakingToken;
    uint256 public constant duration = 7 days;

    address public immutable operator;
    address public immutable rewardManager;

    uint256 public immutable pid;
    uint256 public periodFinish = 0;
    uint256 public rewardRate = 0;
    uint256 public lastUpdateTime;
    uint256 public rewardPerTokenStored;
    uint256 public queuedRewards = 0;
    uint256 public currentRewards = 0;
    uint256 public historicalRewards = 0;
    uint256 public constant newRewardRatio = 830;
    uint256 private _totalSupply;
    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) public rewards;
    mapping(address => uint256) internal _balances;

    address[] public extraRewards;

    event RewardAdded(uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev This is called directly from RewardFactory
     * @param pid_           Effectively the pool identifier - used in the Booster
     * @param stakingToken_  Pool LP token
     * @param rewardToken_   Crv
     * @param operator_      Booster
     * @param rewardManager_ RewardFactory
     */
    constructor(
        uint256 pid_,
        address stakingToken_,
        address rewardToken_,
        address operator_,
        address rewardManager_
    ) public {
        pid = pid_;
        stakingToken = IERC20(stakingToken_);
        rewardToken = IERC20(rewardToken_);
        operator = operator_;
        rewardManager = rewardManager_;
    }

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

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

    function extraRewardsLength() external view returns (uint256) {
        return extraRewards.length;
    }

    function addExtraReward(address _reward) external returns (bool) {
        require(msg.sender == rewardManager, "!authorized");
        require(_reward != address(0), "!reward setting");

        if (extraRewards.length >= 12) {
            return false;
        }

        extraRewards.push(_reward);
        return true;
    }

    function clearExtraRewards() external {
        require(msg.sender == rewardManager, "!authorized");
        delete extraRewards;
    }

    modifier updateReward(address account) {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        if (account != address(0)) {
            rewards[account] = earned(account);
            userRewardPerTokenPaid[account] = rewardPerTokenStored;
        }
        _;
    }

    function lastTimeRewardApplicable() public view returns (uint256) {
        return MathUtil.min(block.timestamp, periodFinish);
    }

    function rewardPerToken() public view returns (uint256) {
        if (totalSupply() == 0) {
            return rewardPerTokenStored;
        }
        return
            rewardPerTokenStored.add(
                lastTimeRewardApplicable().sub(lastUpdateTime).mul(rewardRate).mul(1e18).div(totalSupply())
            );
    }

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

    function stake(uint256 _amount) public returns (bool) {
        _processStake(_amount, msg.sender);

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

        return true;
    }

    function stakeAll() external returns (bool) {
        uint256 balance = stakingToken.balanceOf(msg.sender);
        stake(balance);
        return true;
    }

    function stakeFor(address _for, uint256 _amount) public returns (bool) {
        _processStake(_amount, _for);

        //take away from sender
        stakingToken.safeTransferFrom(msg.sender, address(this), _amount);
        emit Staked(_for, _amount);

        return true;
    }

    /**
     * @dev Generic internal staking function that basically does 3 things: update rewards based
     *      on previous balance, trigger also on any child contracts, then update balances.
     * @param _amount    Units to add to the users balance
     * @param _receiver  Address of user who will receive the stake
     */
    function _processStake(uint256 _amount, address _receiver) internal updateReward(_receiver) {
        require(_amount > 0, "RewardPool : Cannot stake 0");

        //also stake to linked rewards
        for (uint256 i = 0; i < extraRewards.length; i++) {
            IRewards(extraRewards[i]).stake(_receiver, _amount);
        }

        _totalSupply = _totalSupply.add(_amount);
        _balances[_receiver] = _balances[_receiver].add(_amount);

        emit Transfer(address(0), _receiver, _amount);
    }

    function withdraw(uint256 amount, bool claim) public updateReward(msg.sender) returns (bool) {
        require(amount > 0, "RewardPool : Cannot withdraw 0");

        //also withdraw from linked rewards
        for (uint256 i = 0; i < extraRewards.length; i++) {
            IRewards(extraRewards[i]).withdraw(msg.sender, amount);
        }

        _totalSupply = _totalSupply.sub(amount);
        _balances[msg.sender] = _balances[msg.sender].sub(amount);

        stakingToken.safeTransfer(msg.sender, amount);
        emit Withdrawn(msg.sender, amount);

        if (claim) {
            getReward(msg.sender, true);
        }

        emit Transfer(msg.sender, address(0), amount);

        return true;
    }

    function withdrawAll(bool claim) external {
        withdraw(_balances[msg.sender], claim);
    }

    function withdrawAndUnwrap(uint256 amount, bool claim) public returns (bool) {
        _withdrawAndUnwrapTo(amount, msg.sender, msg.sender);
        //get rewards too
        if (claim) {
            getReward(msg.sender, true);
        }
        return true;
    }

    function _withdrawAndUnwrapTo(
        uint256 amount,
        address from,
        address receiver
    ) internal updateReward(from) returns (bool) {
        //also withdraw from linked rewards
        for (uint256 i = 0; i < extraRewards.length; i++) {
            IRewards(extraRewards[i]).withdraw(from, amount);
        }

        _totalSupply = _totalSupply.sub(amount);
        _balances[from] = _balances[from].sub(amount);

        //tell operator to withdraw from here directly to user
        IDeposit(operator).withdrawTo(pid, amount, receiver);
        emit Withdrawn(from, amount);

        emit Transfer(from, address(0), amount);

        return true;
    }

    function withdrawAllAndUnwrap(bool claim) external {
        withdrawAndUnwrap(_balances[msg.sender], claim);
    }

    /**
     * @dev Gives a staker their rewards, with the option of claiming extra rewards
     * @param _account     Account for which to claim
     * @param _claimExtras Get the child rewards too?
     */
    function getReward(address _account, bool _claimExtras) public updateReward(_account) returns (bool) {
        uint256 reward = earned(_account);
        if (reward > 0) {
            rewards[_account] = 0;
            rewardToken.safeTransfer(_account, reward);
            IDeposit(operator).rewardClaimed(pid, _account, reward);
            emit RewardPaid(_account, reward);
        }

        //also get rewards from linked rewards
        if (_claimExtras) {
            for (uint256 i = 0; i < extraRewards.length; i++) {
                IRewards(extraRewards[i]).getReward(_account);
            }
        }
        return true;
    }

    /**
     * @dev Called by a staker to get their allocated rewards
     */
    function getReward() external returns (bool) {
        getReward(msg.sender, true);
        return true;
    }

    /**
     * @dev Sends oLIT to OptionsExerciser for converting it to LIT or liqLit, LIQ and extra rewards are sent to the user
     * @param _account      Account for which to claim
     * @param _claimExtras  Get the child rewards too?
     * @return rewardAmount oLIT amount claimed as reward
     */
    function getRewardFor(address _account, bool _claimExtras)
        public
        updateReward(_account)
        returns (uint256 rewardAmount)
    {
        require(hasPermission(_account, msg.sender), "permission not granted");

        uint256 reward = earned(_account);
        if (reward > 0) {
            rewards[_account] = 0;
            //olit to optionsExerciser
            rewardToken.safeTransfer(msg.sender, reward);
            //liq to account
            IDeposit(operator).rewardClaimed(pid, _account, reward);
            emit RewardPaid(_account, reward);
        }

        //also get rewards from linked rewards
        if (_claimExtras) {
            for (uint256 i = 0; i < extraRewards.length; i++) {
                IRewards(extraRewards[i]).getReward(_account);
            }
        }
        return reward;
    }

    /**
     * @dev Processes queued rewards in isolation, providing the period has finished.
     *      This allows a cheaper way to trigger rewards on low value pools.
     */
    function processIdleRewards() external {
        if (block.timestamp >= periodFinish && queuedRewards > 0) {
            notifyRewardAmount(queuedRewards);
            queuedRewards = 0;
        }
    }

    /**
     * @dev Called by the booster to allocate new Crv rewards to this pool
     *      Curve is queued for rewards and the distribution only begins once the new rewards are sufficiently
     *      large, or the epoch has ended.
     */
    function queueNewRewards(uint256 _rewards) external returns (bool) {
        require(msg.sender == operator, "!authorized");

        _rewards = _rewards.add(queuedRewards);

        if (block.timestamp >= periodFinish) {
            notifyRewardAmount(_rewards);
            queuedRewards = 0;
            return true;
        }

        //et = now - (finish-duration)
        uint256 elapsedTime = block.timestamp.sub(periodFinish.sub(duration));
        //current at now: rewardRate * elapsedTime
        uint256 currentAtNow = rewardRate * elapsedTime;
        uint256 queuedRatio = currentAtNow.mul(1000).div(_rewards);

        //uint256 queuedRatio = currentRewards.mul(1000).div(_rewards);
        if (queuedRatio < newRewardRatio) {
            notifyRewardAmount(_rewards);
            queuedRewards = 0;
        } else {
            queuedRewards = _rewards;
        }
        return true;
    }

    function notifyRewardAmount(uint256 reward) internal updateReward(address(0)) {
        historicalRewards = historicalRewards.add(reward);
        if (block.timestamp >= periodFinish) {
            rewardRate = reward.div(duration);
        } else {
            uint256 remaining = periodFinish.sub(block.timestamp);
            uint256 leftover = remaining.mul(rewardRate);
            reward = reward.add(leftover);
            rewardRate = reward.div(duration);
        }
        currentRewards = reward;
        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp.add(duration);
        emit RewardAdded(reward);
    }
}

File 4 of 12 : IERC4626.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import { IERC20Metadata } from "./IERC20Metadata.sol";

/// @title ERC4626 interface
/// See: https://eips.ethereum.org/EIPS/eip-4626

abstract contract IERC4626 is IERC20Metadata {

    /*////////////////////////////////////////////////////////
                      Events
    ////////////////////////////////////////////////////////*/

    /// @notice `caller` has exchanged `assets` for `shares`, and transferred those `shares` to `owner`
    event Deposit(
        address indexed caller,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /// @notice `caller` has exchanged `shares`, owned by `owner`, for
    ///         `assets`, and transferred those `assets` to `receiver`.
    event Withdraw(
        address indexed caller,
        address indexed receiver,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /*////////////////////////////////////////////////////////
                      Vault properties
    ////////////////////////////////////////////////////////*/

    /// @notice The address of the underlying ERC20 token used for
    /// the Vault for accounting, depositing, and withdrawing.
    function asset() external view virtual returns(address);

    /// @notice Total amount of the underlying asset that
    /// is "managed" by Vault.
    function totalAssets() external view virtual returns(uint256);

    /*////////////////////////////////////////////////////////
                      Deposit/Withdrawal Logic
    ////////////////////////////////////////////////////////*/

    /// @notice Mints `shares` Vault shares to `receiver` by
    /// depositing exactly `assets` of underlying tokens.
    function deposit(uint256 assets, address receiver) external virtual returns(uint256 shares);

    /// @notice Mints exactly `shares` Vault shares to `receiver`
    /// by depositing `assets` of underlying tokens.
    function mint(uint256 shares, address receiver) external virtual returns(uint256 assets);

    /// @notice Redeems `shares` from `owner` and sends `assets`
    /// of underlying tokens to `receiver`.
    function withdraw(uint256 assets, address receiver, address owner) external virtual returns(uint256 shares);

    /// @notice Redeems `shares` from `owner` and sends `assets`
    /// of underlying tokens to `receiver`.
    function redeem(uint256 shares, address receiver, address owner) external virtual returns(uint256 assets);

    /*////////////////////////////////////////////////////////
                      Vault Accounting Logic
    ////////////////////////////////////////////////////////*/

    /// @notice The amount of shares that the vault would
    /// exchange for the amount of assets provided, in an
    /// ideal scenario where all the conditions are met.
    function convertToShares(uint256 assets) external view virtual returns(uint256 shares);

    /// @notice The amount of assets that the vault would
    /// exchange for the amount of shares provided, in an
    /// ideal scenario where all the conditions are met.
    function convertToAssets(uint256 shares) external view virtual returns(uint256 assets);

    /// @notice Total number of underlying assets that can
    /// be deposited by `owner` into the Vault, where `owner`
    /// corresponds to the input parameter `receiver` of a
    /// `deposit` call.
    function maxDeposit(address owner) external view virtual returns(uint256 maxAssets);

    /// @notice Allows an on-chain or off-chain user to simulate
    /// the effects of their deposit at the current block, given
    /// current on-chain conditions.
    function previewDeposit(uint256 assets) external view virtual returns(uint256 shares);

    /// @notice Total number of underlying shares that can be minted
    /// for `owner`, where `owner` corresponds to the input
    /// parameter `receiver` of a `mint` call.
    function maxMint(address owner) external view virtual returns(uint256 maxShares);

    /// @notice Allows an on-chain or off-chain user to simulate
    /// the effects of their mint at the current block, given
    /// current on-chain conditions.
    function previewMint(uint256 shares) external view virtual returns(uint256 assets);

    /// @notice Total number of underlying assets that can be
    /// withdrawn from the Vault by `owner`, where `owner`
    /// corresponds to the input parameter of a `withdraw` call.
    function maxWithdraw(address owner) external view virtual returns(uint256 maxAssets);

    /// @notice Allows an on-chain or off-chain user to simulate
    /// the effects of their withdrawal at the current block,
    /// given current on-chain conditions.
    function previewWithdraw(uint256 assets) external view virtual returns(uint256 shares);

    /// @notice Total number of underlying shares that can be
    /// redeemed from the Vault by `owner`, where `owner` corresponds
    /// to the input parameter of a `redeem` call.
    function maxRedeem(address owner) external view virtual returns(uint256 maxShares);

    /// @notice Allows an on-chain or off-chain user to simulate
    /// the effects of their redeemption at the current block,
    /// given current on-chain conditions.
    function previewRedeem(uint256 shares) external view virtual returns(uint256 assets);
}

File 5 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

File 6 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 7 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

File 8 of 12 : MathUtil.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUtil {
    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }
}

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

/**
 * @title   Permission
 * @author  Liquis Finance
 * @notice  A simple permissions system giving a `caller` the ability to act on behalf of `owner`
 * @dev     Other than ERC20 Allowances, Permissions are boolean giving `caller` the ability
 *          to call a specific contract function without further controls. 
 *          Permission are thought to allow users to give peripheral contracts permission to act
 *          on their behalf in order to improve UX e.g. around claiming rewards.
 */
abstract contract Permission {

    event ModifyPermission(address owner, address caller, bool grant);

    /// @dev Specify whether `caller` can act on behalf of `owner`
    mapping(address => mapping(address => bool)) private _permitted;

    /**
     * @notice Allow (or revoke allowance) `caller` to act on behalf of `msg.sender`
     * @param caller Address of the `caller`
     * @param permitted Allow (true) or revoke (false) permission
     */
    function modifyPermission(address caller, bool permitted) external {
        _permitted[msg.sender][caller] = permitted;
        emit ModifyPermission(msg.sender, caller, permitted);
    }

    /** 
     * @notice Checks permission of `caller` to act on behalf of `owner`
     * @param owner Address of the `owner`
     * @param caller Address of the `caller`
     * @return permission Whether `caller` has the permission
     */
    function hasPermission(address owner, address caller) public view returns (bool) {
        return owner == caller || _permitted[owner][caller];
    }
}

File 10 of 12 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity >=0.6.2 <0.8.0;

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

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 12 of 12 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;

import { IERC20 } from "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"pid_","type":"uint256"},{"internalType":"address","name":"stakingToken_","type":"address"},{"internalType":"address","name":"rewardToken_","type":"address"},{"internalType":"address","name":"operator_","type":"address"},{"internalType":"address","name":"rewardManager_","type":"address"},{"internalType":"address","name":"lptoken_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"grant","type":"bool"}],"name":"ModifyPermission","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"_reward","type":"address"}],"name":"addExtraReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"clearExtraRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"extraRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extraRewardsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_claimExtras","type":"bool"}],"name":"getReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_claimExtras","type":"bool"}],"name":"getRewardFor","outputs":[{"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"caller","type":"address"}],"name":"hasPermission","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"historicalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"bool","name":"permitted","type":"bool"}],"name":"modifyPermission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newRewardRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"processIdleRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"queueNewRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"queuedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_for","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stakeFor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claim","type":"bool"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"claim","type":"bool"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"claim","type":"bool"}],"name":"withdrawAllAndUnwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claim","type":"bool"}],"name":"withdrawAndUnwrap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

610120604052600060015560006002556000600555600060065560006007553480156200002b57600080fd5b5060405162003b0738038062003b07833981810160405260c08110156200005157600080fd5b508051602080830151604084015160608086015160808088015160a09889015161010089905286851b6001600160601b0319908116909a5285851b8a1690925282841b891660c0529283901b90971660e0526001600d55600e80546001600160a01b0319166001600160a01b03808a16919091179182905596979496939591949293620000f092911690859060001990620000fc811b620022a217901c565b5050505050506200050f565b80158062000186575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156200015657600080fd5b505afa1580156200016b573d6000803e3d6000fd5b505050506040513d60208110156200018257600080fd5b5051155b620001c35760405162461bcd60e51b815260040180806020018281038252603681526020018062003ad16036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526200021b9185916200022016565b505050565b60606200027c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620002dc60201b620023ba179092919060201c565b8051909150156200021b578080602001905160208110156200029d57600080fd5b50516200021b5760405162461bcd60e51b815260040180806020018281038252602a81526020018062003aa7602a913960400191505060405180910390fd5b6060620002ed8484600085620002f7565b90505b9392505050565b6060824710156200033a5760405162461bcd60e51b815260040180806020018281038252602681526020018062003a816026913960400191505060405180910390fd5b62000345856200045f565b62000397576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310620003d85780518252601f199092019160209182019101620003b7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146200043c576040519150601f19603f3d011682016040523d82523d6000602084013e62000441565b606091505b5090925090506200045482828662000465565b979650505050505050565b3b151590565b6060831562000476575081620002f0565b825115620004875782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620004d3578181015183820152602001620004b9565b50505050905090810190601f168015620005015780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60805160601c60a05160601c60c05160601c60e05160601c610100516134bd620005c4600039806114e752806118085280611fbb52806121195280612f1c525080610adc5280610d4452806112a752508061116e528061119d528061152a52806117d952806120ea5280612f53525080610b4e5280610e245280611022528061144052806115c3528061197d52806119ca5280611a8b5280611c645250806117b052806120c1528061228052506134bd6000f3fe608060405234801561001057600080fd5b50600436106103b95760003560e01c806370a08231116101f4578063c63d75b61161011a578063d9c70f57116100ad578063ef8b30f71161007c578063ef8b30f714610508578063f106845414610a13578063f579513f14610a1b578063f7c618c114610a49576103b9565b8063d9c70f57146109a7578063dd62ed3e146109d5578063df136d6514610a03578063ebe2b12b14610a0b576103b9565b8063cde68041116100e9578063cde6804114610925578063ce96cb7714610953578063d55a23f414610979578063d905777e14610981576103b9565b8063c63d75b6146108ef578063c6e6f592146104ab578063c8f33c9114610915578063cd3daf9d1461091d576103b9565b806394bf804d11610192578063b3d7f6b911610161578063b3d7f6b914610508578063b460af9414610862578063ba08765214610896578063c32e7202146108ca576103b9565b806394bf804d146107e557806395d89b4114610811578063a694fc3a14610819578063a9059cbb14610836576103b9565b806380faa57d116101ce57806380faa57d146107a75780638b876347146107af5780638dcb4061146107d5578063901a7d53146107dd576103b9565b806370a082311461077157806372f702f3146107975780637b0a47ee1461079f576103b9565b8063313ce567116102e45780634cdad5061161027757806363d38c3b1161024657806363d38c3b146107075780636c8bcee81461070f5780636e553f65146107175780637050ccd914610743576103b9565b80634cdad5061461069f578063570ca735146106bc578063590a41f5146106c45780635e43c47b146106e1576103b9565b80633e8b83e3116102b35780633e8b83e314610635578063402d267d1461063d57806340c354461461066357806349f039a214610680576103b9565b8063313ce567146105e257806338d074361461060057806338d52e0f146106255780633d18b9121461062d576103b9565b80630a28a4771161035c5780631c1c6fe51161032b5780631c1c6fe51461055957806323b872dd14610578578063262d3d6d146105ae5780632ee40908146105b6576103b9565b80630a28a477146105085780630f4ef8a6146105255780630fb5a6b41461054957806318160ddd14610551576103b9565b806306fdde031161039857806306fdde03146104085780630700037d1461048557806307a2d13a146104ab578063095ea7b3146104c8576103b9565b80628cc262146103be57806301e1d114146103f65780630569d388146103fe575b600080fd5b6103e4600480360360208110156103d457600080fd5b50356001600160a01b0316610a51565b60408051918252519081900360200190f35b6103e4610ac1565b610406610ad1565b005b610410610b4a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561044a578181015183820152602001610432565b50505050905090810190601f1680156104775780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e46004803603602081101561049b57600080fd5b50356001600160a01b0316610d0e565b6103e4600480360360208110156104c157600080fd5b5035610ace565b6104f4600480360360408110156104de57600080fd5b506001600160a01b038135169060200135610d20565b604080519115158252519081900360200190f35b6103e46004803603602081101561051e57600080fd5b5035610d37565b61052d610d42565b604080516001600160a01b039092168252519081900360200190f35b6103e4610d66565b6103e4610d6d565b6104066004803603602081101561056f57600080fd5b50351515610d77565b6104f46004803603606081101561058e57600080fd5b506001600160a01b03813581169160208101359091169060400135610d95565b6103e4610e05565b6104f4600480360360408110156105cc57600080fd5b506001600160a01b038135169060200135610e0b565b6105ea610e94565b6040805160ff9092168252519081900360200190f35b6104f46004803603604081101561061657600080fd5b50803590602001351515610e99565b61052d6110ca565b6104f46110d9565b6104066110ee565b6103e46004803603602081101561065357600080fd5b50356001600160a01b0316611119565b61052d6004803603602081101561067957600080fd5b5035611120565b6104066004803603602081101561069657600080fd5b50351515611147565b6103e4600480360360208110156106b557600080fd5b5035611161565b61052d61116c565b6104f4600480360360208110156106da57600080fd5b5035611190565b6104f4600480360360208110156106f757600080fd5b50356001600160a01b031661129a565b6103e46113b9565b6103e46113bf565b6103e46004803603604081101561072d57600080fd5b50803590602001356001600160a01b03166113c5565b6104f46004803603604081101561075957600080fd5b506001600160a01b0381351690602001351515611720565b6103e46004803603602081101561078757600080fd5b50356001600160a01b0316611970565b61052d61197b565b6103e461199f565b6103e46119a5565b6103e4600480360360208110156107c557600080fd5b50356001600160a01b03166119b3565b6104f46119c5565b6103e4611a75565b6103e4600480360360408110156107fb57600080fd5b50803590602001356001600160a01b0316611a7b565b610410611a87565b6104f46004803603602081101561082f57600080fd5b5035611c4b565b6104f46004803603604081101561084c57600080fd5b506001600160a01b038135169060200135611cca565b6103e46004803603606081101561087857600080fd5b508035906001600160a01b0360208201358116916040013516611cd7565b6103e4600480360360608110156108ac57600080fd5b508035906001600160a01b0360208201358116916040013516611e0c565b6104f4600480360360408110156108e057600080fd5b50803590602001351515611e21565b6103e46004803603602081101561090557600080fd5b50356001600160a01b0316611e4a565b6103e4611e55565b6103e4611e5b565b6104f46004803603604081101561093b57600080fd5b506001600160a01b0381358116916020013516611ea9565b6103e46004803603602081101561096957600080fd5b50356001600160a01b0316611ef3565b6103e4611efe565b6103e46004803603602081101561099757600080fd5b50356001600160a01b0316611f04565b610406600480360360408110156109bd57600080fd5b506001600160a01b0381351690602001351515611f0f565b6103e4600480360360408110156109eb57600080fd5b506001600160a01b0381358116916020013516611f82565b6103e4611fad565b6103e4611fb3565b6103e4611fb9565b6103e460048036036040811015610a3157600080fd5b506001600160a01b0381351690602001351515611fdd565b61052d61227e565b6001600160a01b0381166000908152600a60209081526040808320546009909252822054610ab99190610ab390670de0b6b3a764000090610aad90610a9e90610a98611e5b565b906123c9565b610aa788611970565b90612426565b9061247f565b906124e6565b90505b919050565b6000610acb610d6d565b90505b90565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b3c576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b610b48600c60006132a2565b565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610ba557600080fd5b505afa158015610bb9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610be257600080fd5b8101908080516040519392919084640100000000821115610c0257600080fd5b908301906020820185811115610c1757600080fd5b8251640100000000811182820188101715610c3157600080fd5b82525081516020918201929091019080838360005b83811015610c5e578181015183820152602001610c46565b50505050905090810190601f168015610c8b5780820380516001836020036101000a031916815260200191505b506040525050506040516020018082805190602001908083835b60208310610cc45780518252601f199092019160209182019101610ca5565b6001836020036101000a03801982511681845116808217855250505050505090500180650815985d5b1d60d21b815250600601915050604051602081830303815290604052905090565b600a6020526000908152604090205481565b6000610d2d338484612540565b5060015b92915050565b6000610ab982610ace565b7f000000000000000000000000000000000000000000000000000000000000000081565b62093a8081565b6000610acb61262c565b336000908152600b6020526040902054610d919082610e99565b5050565b600080610de0836040518060600160405280602c8152602001613370602c91396001600160a01b0388166000908152600f602090815260408083203384529091529020549190612632565b9050610ded853383612540565b610df88585856126c9565b60019150505b9392505050565b60075481565b6000610e1782846129fd565b610e4c6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085612bbf565b6040805183815290516001600160a01b038516917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250600192915050565b601290565b600033610ea4611e5b565b600455610eaf6119a5565b6003556001600160a01b03811615610ef657610eca81610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b60008411610f4b576040805162461bcd60e51b815260206004820152601e60248201527f526577617264506f6f6c203a2043616e6e6f7420776974686472617720300000604482015290519081900360640190fd5b60005b600c54811015610fde57600c8181548110610f6557fe5b60009182526020822001546040805163f3fef3a360e01b81523360048201526024810189905290516001600160a01b039092169263f3fef3a39260448084019382900301818387803b158015610fba57600080fd5b505af1158015610fce573d6000803e3d6000fd5b505060019092019150610f4e9050565b50600854610fec90856123c9565b600855336000908152600b602052604090205461100990856123c9565b336000818152600b6020526040902091909155611051907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169086612c1f565b60408051858152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2821561109a57611098336001611720565b505b60408051858152905160009133916000805160206133bd8339815191529181900360200190a35060019392505050565b600e546001600160a01b031681565b60006110e6336001611720565b506001905090565b600154421015801561110257506000600554115b15610b4857611112600554612c71565b6000600555565b5060001990565b600c818154811061112d57fe5b6000918252602090912001546001600160a01b0316905081565b336000908152600b6020526040902054610d919082611e21565b6000610ab982610d37565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146111fd576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b60055461120b9083906124e6565b9150600154421061122c5761121f82612c71565b5060006005556001610abc565b600061125061124962093a806001546123c990919063ffffffff16565b42906123c9565b6002549091508102600061126a85610aad846103e8612426565b905061033e8110156112895761127f85612c71565b600060055561128f565b60058590555b506001949350505050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611307576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6001600160a01b038216611354576040805162461bcd60e51b815260206004820152600f60248201526e217265776172642073657474696e6760881b604482015290519081900360640190fd5b600c80541061136557506000610abc565b50600c8054600181810183556000929092527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b0384166001600160a01b0319909116179055919050565b60055481565b61033e81565b60006002600d54141561141f576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600d55600e5461143c906001600160a01b0316333086612bbf565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156114ab57600080fd5b505afa1580156114bf573d6000803e3d6000fd5b505050506040513d60208110156114d557600080fd5b5051604080516321d0683360e11b81527f000000000000000000000000000000000000000000000000000000000000000060048201526024810187905260006044820181905291519293506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016926343a0d06692606480840193602093929083900390910190829087803b15801561157457600080fd5b505af1158015611588573d6000803e3d6000fd5b505050506040513d602081101561159e57600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916370a0823191602480820192602092909190829003018186803b15801561160a57600080fd5b505afa15801561161e573d6000803e3d6000fd5b505050506040513d602081101561163457600080fd5b505190508461164382846123c9565b1015611681576040805162461bcd60e51b81526020600482015260086024820152670859195c1bdcda5d60c21b604482015290519081900360640190fd5b61168b85856129fd565b604080518681526020810187905281516001600160a01b0387169233927fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7929081900390910190a36040805186815290516001600160a01b038616917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250506001600d555090919050565b60008261172b611e5b565b6004556117366119a5565b6003556001600160a01b0381161561177d5761175181610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b600061178885610a51565b905080156118ce576001600160a01b038086166000908152600a60205260408120556117d7907f0000000000000000000000000000000000000000000000000000000000000000168683612c1f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371192b177f000000000000000000000000000000000000000000000000000000000000000087846040518463ffffffff1660e01b815260040180848152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561187657600080fd5b505af115801561188a573d6000803e3d6000fd5b50506040805184815290516001600160a01b03891693507fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048692509081900360200190a25b831561128f5760005b600c5481101561196457600c81815481106118ee57fe5b600091825260208220015460408051630c00007b60e41b81526001600160a01b038a811660048301529151919092169263c00007b0926024808201939182900301818387803b15801561194057600080fd5b505af1158015611954573d6000803e3d6000fd5b5050600190920191506118d79050565b50506001949350505050565b6000610ab982612d97565b7f000000000000000000000000000000000000000000000000000000000000000081565b60025481565b6000610acb42600154612db2565b60096020526000908152604090205481565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231336040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611a3557600080fd5b505afa158015611a49573d6000803e3d6000fd5b505050506040513d6020811015611a5f57600080fd5b50519050611a6c81611c4b565b50600191505090565b60065481565b6000610dfe83836113c5565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015611b1f57600080fd5b8101908080516040519392919084640100000000821115611b3f57600080fd5b908301906020820185811115611b5457600080fd5b8251640100000000811182820188101715611b6e57600080fd5b82525081516020918201929091019080838360005b83811015611b9b578181015183820152602001611b83565b50505050905090810190601f168015611bc85780820380516001836020036101000a031916815260200191505b506040525050506040516020018082805190602001908083835b60208310611c015780518252601f199092019160209182019101611be2565b6001836020036101000a03801982511681845116808217855250505050505090500180650b5d985d5b1d60d21b815250600601915050604051602081830303815290604052905090565b6000611c5782336129fd565b611c8c6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085612bbf565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2506001919050565b6000610d2d3384846126c9565b60006002600d541415611d31576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600d55336001600160a01b03831614611d9857611d988233611d93876040518060600160405280602c8152602001613370602c91396001600160a01b0388166000908152600f602090815260408083203384529091529020549190612632565b612540565b611da3848385612dc8565b50816001600160a01b0316836001600160a01b0316336001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8788604051808381526020018281526020019250505060405180910390a450506001600d555090565b6000611e19848484611cd7565b949350505050565b6000611e2e833333612dc8565b508115610d2d57611e40336001611720565b5050600192915050565b6000610ab982611119565b60035481565b6000611e65610d6d565b611e725750600454610ace565b610acb611ea0611e80610d6d565b610aad670de0b6b3a7640000610aa7600254610aa7600354610a986119a5565b600454906124e6565b6000816001600160a01b0316836001600160a01b03161480610dfe5750506001600160a01b0391821660009081526020818152604080832093909416825291909152205460ff1690565b6000610ab982611970565b600c5490565b6000610ab982611ef3565b336000818152602081815260408083206001600160a01b03871680855290835292819020805486151560ff19909116811790915581519485529184019290925282820152517f823163c2ee30de490b1b2a4749c0d0b17ba5b45c29b278d0c041a8338ea381219181900360600190a15050565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205490565b60045481565b60015481565b7f000000000000000000000000000000000000000000000000000000000000000081565b600082611fe8611e5b565b600455611ff36119a5565b6003556001600160a01b0381161561203a5761200e81610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b6120448433611ea9565b61208e576040805162461bcd60e51b81526020600482015260166024820152751c195c9b5a5cdcda5bdb881b9bdd0819dc985b9d195960521b604482015290519081900360640190fd5b600061209985610a51565b905080156121df576001600160a01b038086166000908152600a60205260408120556120e8907f0000000000000000000000000000000000000000000000000000000000000000163383612c1f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371192b177f000000000000000000000000000000000000000000000000000000000000000087846040518463ffffffff1660e01b815260040180848152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561218757600080fd5b505af115801561219b573d6000803e3d6000fd5b50506040805184815290516001600160a01b03891693507fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048692509081900360200190a25b8315611e195760005b600c5481101561227557600c81815481106121ff57fe5b600091825260208220015460408051630c00007b60e41b81526001600160a01b038a811660048301529151919092169263c00007b0926024808201939182900301818387803b15801561225157600080fd5b505af1158015612265573d6000803e3d6000fd5b5050600190920191506121e89050565b50949350505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b801580612328575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156122fa57600080fd5b505afa15801561230e573d6000803e3d6000fd5b505050506040513d602081101561232457600080fd5b5051155b6123635760405162461bcd60e51b81526004018080602001828103825260368152602001806134526036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526123b5908490613029565b505050565b6060611e1984846000856130da565b600082821115612420576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008261243557506000610d31565b8282028284828161244257fe5b0414610dfe5760405162461bcd60e51b815260040180806020018281038252602181526020018061339c6021913960400191505060405180910390fd5b60008082116124d5576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816124de57fe5b049392505050565b600082820183811015610dfe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0383166125855760405162461bcd60e51b81526004018080602001828103825260268152602001806134026026913960400191505060405180910390fd5b6001600160a01b0382166125ca5760405162461bcd60e51b81526004018080602001828103825260248152602001806133266024913960400191505060405180910390fd5b6001600160a01b038084166000818152600f6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60085490565b600081848411156126c15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561268657818101518382015260200161266e565b50505050905090810190601f1680156126b35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b826126d2611e5b565b6004556126dd6119a5565b6003556001600160a01b03811615612724576126f881610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b8261272d611e5b565b6004556127386119a5565b6003556001600160a01b0381161561277f5761275381610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b6001600160a01b0385166127c45760405162461bcd60e51b81526004018080602001828103825260258152602001806133dd6025913960400191505060405180910390fd5b6001600160a01b0384166128095760405162461bcd60e51b81526004018080602001828103825260238152602001806132dd6023913960400191505060405180910390fd5b6001600160a01b0385166000908152600b6020526040902054838110156128615760405162461bcd60e51b81526004018080602001828103825260268152602001806133006026913960400191505060405180910390fd5b60005b600c5481101561297657600c818154811061287b57fe5b60009182526020822001546040805163f3fef3a360e01b81526001600160a01b038b81166004830152602482018a90529151919092169263f3fef3a3926044808201939182900301818387803b1580156128d457600080fd5b505af11580156128e8573d6000803e3d6000fd5b50505050600c81815481106128f957fe5b6000918252602082200154604080516356e4bb9760e11b81526001600160a01b038a81166004830152602482018a90529151919092169263adc9772e926044808201939182900301818387803b15801561295257600080fd5b505af1158015612966573d6000803e3d6000fd5b5050600190920191506128649050565b5061298181856123c9565b6001600160a01b038088166000908152600b602052604080822093909355908716815220546129b090856124e6565b6001600160a01b038087166000818152600b602090815260409182902094909455805188815290519193928a16926000805160206133bd83398151915292918290030190a3505050505050565b80612a06611e5b565b600455612a116119a5565b6003556001600160a01b03811615612a5857612a2c81610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b60008311612aad576040805162461bcd60e51b815260206004820152601b60248201527f526577617264506f6f6c203a2043616e6e6f74207374616b6520300000000000604482015290519081900360640190fd5b60005b600c54811015612b4457600c8181548110612ac757fe5b6000918252602082200154604080516356e4bb9760e11b81526001600160a01b038781166004830152602482018990529151919092169263adc9772e926044808201939182900301818387803b158015612b2057600080fd5b505af1158015612b34573d6000803e3d6000fd5b505060019092019150612ab09050565b50600854612b5290846124e6565b6008556001600160a01b0382166000908152600b6020526040902054612b7890846124e6565b6001600160a01b0383166000818152600b602090815260408083209490945583518781529351929391926000805160206133bd8339815191529281900390910190a3505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612c19908590613029565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526123b5908490613029565b6000612c7b611e5b565b600455612c866119a5565b6003556001600160a01b03811615612ccd57612ca181610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b600754612cda90836124e6565b6007556001544210612cfb57612cf38262093a8061247f565b600255612d45565b600154600090612d0b90426123c9565b90506000612d246002548361242690919063ffffffff16565b9050612d3084826124e6565b9350612d3f8462093a8061247f565b60025550505b6006829055426003819055612d5d9062093a806124e6565b6001556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b6001600160a01b03166000908152600b602052604090205490565b6000818310612dc15781610dfe565b5090919050565b600082612dd3611e5b565b600455612dde6119a5565b6003556001600160a01b03811615612e2557612df981610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b60005b600c54811015612ebc57600c8181548110612e3f57fe5b60009182526020822001546040805163f3fef3a360e01b81526001600160a01b038981166004830152602482018b90529151919092169263f3fef3a3926044808201939182900301818387803b158015612e9857600080fd5b505af1158015612eac573d6000803e3d6000fd5b505060019092019150612e289050565b50600854612eca90866123c9565b6008556001600160a01b0384166000908152600b6020526040902054612ef090866123c9565b6001600160a01b038086166000908152600b60205260408082209390935582516305335c3960e21b81527f0000000000000000000000000000000000000000000000000000000000000000600482015260248101899052868316604482015292517f0000000000000000000000000000000000000000000000000000000000000000909216926314cd70e4926064808301939282900301818387803b158015612f9857600080fd5b505af1158015612fac573d6000803e3d6000fd5b50506040805188815290516001600160a01b03881693507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d592509081900360200190a26040805186815290516000916001600160a01b038716916000805160206133bd8339815191529181900360200190a3506001949350505050565b606061307e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123ba9092919063ffffffff16565b8051909150156123b55780806020019051602081101561309d57600080fd5b50516123b55760405162461bcd60e51b815260040180806020018281038252602a815260200180613428602a913960400191505060405180910390fd5b60608247101561311b5760405162461bcd60e51b815260040180806020018281038252602681526020018061334a6026913960400191505060405180910390fd5b61312485613236565b613175576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106131b45780518252601f199092019160209182019101613195565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613216576040519150601f19603f3d011682016040523d82523d6000602084013e61321b565b606091505b509150915061322b82828661323c565b979650505050505050565b3b151590565b6060831561324b575081610dfe565b82511561325b5782518084602001fd5b60405162461bcd60e51b815260206004820181815284516024840152845185939192839260440191908501908083836000831561268657818101518382015260200161266e565b50805460008255906000526020600020908101906132c091906132c3565b50565b5b808211156132d857600081556001016132c4565b509056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365455243343632363a20617070726f766520746f20746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c455243343632363a207769746864726177616c20616d6f756e74206578636565647320616c6c6f77616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f2061646472657373455243343632363a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a264697066735822122052c962517ecff6f8f38bf7ab68bfa84ca89bedfbf6115c7a603ef62d5de2e7b164736f6c634300060c0033416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000000000000000000000000000000000000000000000000000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c5000000000000000000000000627fee87d0d9d2c55098a06ac805db8f98b158aa000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf2000000000000000000000000368dda6c8cce7283f4ee2577b8cbe454f40f9a4800000000000000000000000005058071e3e799f0c6341f44843636e7c441c1fb

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103b95760003560e01c806370a08231116101f4578063c63d75b61161011a578063d9c70f57116100ad578063ef8b30f71161007c578063ef8b30f714610508578063f106845414610a13578063f579513f14610a1b578063f7c618c114610a49576103b9565b8063d9c70f57146109a7578063dd62ed3e146109d5578063df136d6514610a03578063ebe2b12b14610a0b576103b9565b8063cde68041116100e9578063cde6804114610925578063ce96cb7714610953578063d55a23f414610979578063d905777e14610981576103b9565b8063c63d75b6146108ef578063c6e6f592146104ab578063c8f33c9114610915578063cd3daf9d1461091d576103b9565b806394bf804d11610192578063b3d7f6b911610161578063b3d7f6b914610508578063b460af9414610862578063ba08765214610896578063c32e7202146108ca576103b9565b806394bf804d146107e557806395d89b4114610811578063a694fc3a14610819578063a9059cbb14610836576103b9565b806380faa57d116101ce57806380faa57d146107a75780638b876347146107af5780638dcb4061146107d5578063901a7d53146107dd576103b9565b806370a082311461077157806372f702f3146107975780637b0a47ee1461079f576103b9565b8063313ce567116102e45780634cdad5061161027757806363d38c3b1161024657806363d38c3b146107075780636c8bcee81461070f5780636e553f65146107175780637050ccd914610743576103b9565b80634cdad5061461069f578063570ca735146106bc578063590a41f5146106c45780635e43c47b146106e1576103b9565b80633e8b83e3116102b35780633e8b83e314610635578063402d267d1461063d57806340c354461461066357806349f039a214610680576103b9565b8063313ce567146105e257806338d074361461060057806338d52e0f146106255780633d18b9121461062d576103b9565b80630a28a4771161035c5780631c1c6fe51161032b5780631c1c6fe51461055957806323b872dd14610578578063262d3d6d146105ae5780632ee40908146105b6576103b9565b80630a28a477146105085780630f4ef8a6146105255780630fb5a6b41461054957806318160ddd14610551576103b9565b806306fdde031161039857806306fdde03146104085780630700037d1461048557806307a2d13a146104ab578063095ea7b3146104c8576103b9565b80628cc262146103be57806301e1d114146103f65780630569d388146103fe575b600080fd5b6103e4600480360360208110156103d457600080fd5b50356001600160a01b0316610a51565b60408051918252519081900360200190f35b6103e4610ac1565b610406610ad1565b005b610410610b4a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561044a578181015183820152602001610432565b50505050905090810190601f1680156104775780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e46004803603602081101561049b57600080fd5b50356001600160a01b0316610d0e565b6103e4600480360360208110156104c157600080fd5b5035610ace565b6104f4600480360360408110156104de57600080fd5b506001600160a01b038135169060200135610d20565b604080519115158252519081900360200190f35b6103e46004803603602081101561051e57600080fd5b5035610d37565b61052d610d42565b604080516001600160a01b039092168252519081900360200190f35b6103e4610d66565b6103e4610d6d565b6104066004803603602081101561056f57600080fd5b50351515610d77565b6104f46004803603606081101561058e57600080fd5b506001600160a01b03813581169160208101359091169060400135610d95565b6103e4610e05565b6104f4600480360360408110156105cc57600080fd5b506001600160a01b038135169060200135610e0b565b6105ea610e94565b6040805160ff9092168252519081900360200190f35b6104f46004803603604081101561061657600080fd5b50803590602001351515610e99565b61052d6110ca565b6104f46110d9565b6104066110ee565b6103e46004803603602081101561065357600080fd5b50356001600160a01b0316611119565b61052d6004803603602081101561067957600080fd5b5035611120565b6104066004803603602081101561069657600080fd5b50351515611147565b6103e4600480360360208110156106b557600080fd5b5035611161565b61052d61116c565b6104f4600480360360208110156106da57600080fd5b5035611190565b6104f4600480360360208110156106f757600080fd5b50356001600160a01b031661129a565b6103e46113b9565b6103e46113bf565b6103e46004803603604081101561072d57600080fd5b50803590602001356001600160a01b03166113c5565b6104f46004803603604081101561075957600080fd5b506001600160a01b0381351690602001351515611720565b6103e46004803603602081101561078757600080fd5b50356001600160a01b0316611970565b61052d61197b565b6103e461199f565b6103e46119a5565b6103e4600480360360208110156107c557600080fd5b50356001600160a01b03166119b3565b6104f46119c5565b6103e4611a75565b6103e4600480360360408110156107fb57600080fd5b50803590602001356001600160a01b0316611a7b565b610410611a87565b6104f46004803603602081101561082f57600080fd5b5035611c4b565b6104f46004803603604081101561084c57600080fd5b506001600160a01b038135169060200135611cca565b6103e46004803603606081101561087857600080fd5b508035906001600160a01b0360208201358116916040013516611cd7565b6103e4600480360360608110156108ac57600080fd5b508035906001600160a01b0360208201358116916040013516611e0c565b6104f4600480360360408110156108e057600080fd5b50803590602001351515611e21565b6103e46004803603602081101561090557600080fd5b50356001600160a01b0316611e4a565b6103e4611e55565b6103e4611e5b565b6104f46004803603604081101561093b57600080fd5b506001600160a01b0381358116916020013516611ea9565b6103e46004803603602081101561096957600080fd5b50356001600160a01b0316611ef3565b6103e4611efe565b6103e46004803603602081101561099757600080fd5b50356001600160a01b0316611f04565b610406600480360360408110156109bd57600080fd5b506001600160a01b0381351690602001351515611f0f565b6103e4600480360360408110156109eb57600080fd5b506001600160a01b0381358116916020013516611f82565b6103e4611fad565b6103e4611fb3565b6103e4611fb9565b6103e460048036036040811015610a3157600080fd5b506001600160a01b0381351690602001351515611fdd565b61052d61227e565b6001600160a01b0381166000908152600a60209081526040808320546009909252822054610ab99190610ab390670de0b6b3a764000090610aad90610a9e90610a98611e5b565b906123c9565b610aa788611970565b90612426565b9061247f565b906124e6565b90505b919050565b6000610acb610d6d565b90505b90565b336001600160a01b037f000000000000000000000000368dda6c8cce7283f4ee2577b8cbe454f40f9a481614610b3c576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b610b48600c60006132a2565b565b60607f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c56001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610ba557600080fd5b505afa158015610bb9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610be257600080fd5b8101908080516040519392919084640100000000821115610c0257600080fd5b908301906020820185811115610c1757600080fd5b8251640100000000811182820188101715610c3157600080fd5b82525081516020918201929091019080838360005b83811015610c5e578181015183820152602001610c46565b50505050905090810190601f168015610c8b5780820380516001836020036101000a031916815260200191505b506040525050506040516020018082805190602001908083835b60208310610cc45780518252601f199092019160209182019101610ca5565b6001836020036101000a03801982511681845116808217855250505050505090500180650815985d5b1d60d21b815250600601915050604051602081830303815290604052905090565b600a6020526000908152604090205481565b6000610d2d338484612540565b5060015b92915050565b6000610ab982610ace565b7f000000000000000000000000368dda6c8cce7283f4ee2577b8cbe454f40f9a4881565b62093a8081565b6000610acb61262c565b336000908152600b6020526040902054610d919082610e99565b5050565b600080610de0836040518060600160405280602c8152602001613370602c91396001600160a01b0388166000908152600f602090815260408083203384529091529020549190612632565b9050610ded853383612540565b610df88585856126c9565b60019150505b9392505050565b60075481565b6000610e1782846129fd565b610e4c6001600160a01b037f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c516333085612bbf565b6040805183815290516001600160a01b038516917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250600192915050565b601290565b600033610ea4611e5b565b600455610eaf6119a5565b6003556001600160a01b03811615610ef657610eca81610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b60008411610f4b576040805162461bcd60e51b815260206004820152601e60248201527f526577617264506f6f6c203a2043616e6e6f7420776974686472617720300000604482015290519081900360640190fd5b60005b600c54811015610fde57600c8181548110610f6557fe5b60009182526020822001546040805163f3fef3a360e01b81523360048201526024810189905290516001600160a01b039092169263f3fef3a39260448084019382900301818387803b158015610fba57600080fd5b505af1158015610fce573d6000803e3d6000fd5b505060019092019150610f4e9050565b50600854610fec90856123c9565b600855336000908152600b602052604090205461100990856123c9565b336000818152600b6020526040902091909155611051907f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c56001600160a01b03169086612c1f565b60408051858152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2821561109a57611098336001611720565b505b60408051858152905160009133916000805160206133bd8339815191529181900360200190a35060019392505050565b600e546001600160a01b031681565b60006110e6336001611720565b506001905090565b600154421015801561110257506000600554115b15610b4857611112600554612c71565b6000600555565b5060001990565b600c818154811061112d57fe5b6000918252602090912001546001600160a01b0316905081565b336000908152600b6020526040902054610d919082611e21565b6000610ab982610d37565b7f000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf281565b6000336001600160a01b037f000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf216146111fd576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b60055461120b9083906124e6565b9150600154421061122c5761121f82612c71565b5060006005556001610abc565b600061125061124962093a806001546123c990919063ffffffff16565b42906123c9565b6002549091508102600061126a85610aad846103e8612426565b905061033e8110156112895761127f85612c71565b600060055561128f565b60058590555b506001949350505050565b6000336001600160a01b037f000000000000000000000000368dda6c8cce7283f4ee2577b8cbe454f40f9a481614611307576040805162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b604482015290519081900360640190fd5b6001600160a01b038216611354576040805162461bcd60e51b815260206004820152600f60248201526e217265776172642073657474696e6760881b604482015290519081900360640190fd5b600c80541061136557506000610abc565b50600c8054600181810183556000929092527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b0384166001600160a01b0319909116179055919050565b60055481565b61033e81565b60006002600d54141561141f576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600d55600e5461143c906001600160a01b0316333086612bbf565b60007f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c56001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156114ab57600080fd5b505afa1580156114bf573d6000803e3d6000fd5b505050506040513d60208110156114d557600080fd5b5051604080516321d0683360e11b81527f000000000000000000000000000000000000000000000000000000000000000060048201526024810187905260006044820181905291519293506001600160a01b037f000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf216926343a0d06692606480840193602093929083900390910190829087803b15801561157457600080fd5b505af1158015611588573d6000803e3d6000fd5b505050506040513d602081101561159e57600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b037f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c516916370a0823191602480820192602092909190829003018186803b15801561160a57600080fd5b505afa15801561161e573d6000803e3d6000fd5b505050506040513d602081101561163457600080fd5b505190508461164382846123c9565b1015611681576040805162461bcd60e51b81526020600482015260086024820152670859195c1bdcda5d60c21b604482015290519081900360640190fd5b61168b85856129fd565b604080518681526020810187905281516001600160a01b0387169233927fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7929081900390910190a36040805186815290516001600160a01b038616917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250506001600d555090919050565b60008261172b611e5b565b6004556117366119a5565b6003556001600160a01b0381161561177d5761175181610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b600061178885610a51565b905080156118ce576001600160a01b038086166000908152600a60205260408120556117d7907f000000000000000000000000627fee87d0d9d2c55098a06ac805db8f98b158aa168683612c1f565b7f000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf26001600160a01b03166371192b177f000000000000000000000000000000000000000000000000000000000000000087846040518463ffffffff1660e01b815260040180848152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561187657600080fd5b505af115801561188a573d6000803e3d6000fd5b50506040805184815290516001600160a01b03891693507fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048692509081900360200190a25b831561128f5760005b600c5481101561196457600c81815481106118ee57fe5b600091825260208220015460408051630c00007b60e41b81526001600160a01b038a811660048301529151919092169263c00007b0926024808201939182900301818387803b15801561194057600080fd5b505af1158015611954573d6000803e3d6000fd5b5050600190920191506118d79050565b50506001949350505050565b6000610ab982612d97565b7f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c581565b60025481565b6000610acb42600154612db2565b60096020526000908152604090205481565b6000807f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c56001600160a01b03166370a08231336040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611a3557600080fd5b505afa158015611a49573d6000803e3d6000fd5b505050506040513d6020811015611a5f57600080fd5b50519050611a6c81611c4b565b50600191505090565b60065481565b6000610dfe83836113c5565b60607f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c56001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015611b1f57600080fd5b8101908080516040519392919084640100000000821115611b3f57600080fd5b908301906020820185811115611b5457600080fd5b8251640100000000811182820188101715611b6e57600080fd5b82525081516020918201929091019080838360005b83811015611b9b578181015183820152602001611b83565b50505050905090810190601f168015611bc85780820380516001836020036101000a031916815260200191505b506040525050506040516020018082805190602001908083835b60208310611c015780518252601f199092019160209182019101611be2565b6001836020036101000a03801982511681845116808217855250505050505090500180650b5d985d5b1d60d21b815250600601915050604051602081830303815290604052905090565b6000611c5782336129fd565b611c8c6001600160a01b037f0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c516333085612bbf565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2506001919050565b6000610d2d3384846126c9565b60006002600d541415611d31576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600d55336001600160a01b03831614611d9857611d988233611d93876040518060600160405280602c8152602001613370602c91396001600160a01b0388166000908152600f602090815260408083203384529091529020549190612632565b612540565b611da3848385612dc8565b50816001600160a01b0316836001600160a01b0316336001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8788604051808381526020018281526020019250505060405180910390a450506001600d555090565b6000611e19848484611cd7565b949350505050565b6000611e2e833333612dc8565b508115610d2d57611e40336001611720565b5050600192915050565b6000610ab982611119565b60035481565b6000611e65610d6d565b611e725750600454610ace565b610acb611ea0611e80610d6d565b610aad670de0b6b3a7640000610aa7600254610aa7600354610a986119a5565b600454906124e6565b6000816001600160a01b0316836001600160a01b03161480610dfe5750506001600160a01b0391821660009081526020818152604080832093909416825291909152205460ff1690565b6000610ab982611970565b600c5490565b6000610ab982611ef3565b336000818152602081815260408083206001600160a01b03871680855290835292819020805486151560ff19909116811790915581519485529184019290925282820152517f823163c2ee30de490b1b2a4749c0d0b17ba5b45c29b278d0c041a8338ea381219181900360600190a15050565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205490565b60045481565b60015481565b7f000000000000000000000000000000000000000000000000000000000000000081565b600082611fe8611e5b565b600455611ff36119a5565b6003556001600160a01b0381161561203a5761200e81610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b6120448433611ea9565b61208e576040805162461bcd60e51b81526020600482015260166024820152751c195c9b5a5cdcda5bdb881b9bdd0819dc985b9d195960521b604482015290519081900360640190fd5b600061209985610a51565b905080156121df576001600160a01b038086166000908152600a60205260408120556120e8907f000000000000000000000000627fee87d0d9d2c55098a06ac805db8f98b158aa163383612c1f565b7f000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf26001600160a01b03166371192b177f000000000000000000000000000000000000000000000000000000000000000087846040518463ffffffff1660e01b815260040180848152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561218757600080fd5b505af115801561219b573d6000803e3d6000fd5b50506040805184815290516001600160a01b03891693507fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048692509081900360200190a25b8315611e195760005b600c5481101561227557600c81815481106121ff57fe5b600091825260208220015460408051630c00007b60e41b81526001600160a01b038a811660048301529151919092169263c00007b0926024808201939182900301818387803b15801561225157600080fd5b505af1158015612265573d6000803e3d6000fd5b5050600190920191506121e89050565b50949350505050565b7f000000000000000000000000627fee87d0d9d2c55098a06ac805db8f98b158aa81565b801580612328575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156122fa57600080fd5b505afa15801561230e573d6000803e3d6000fd5b505050506040513d602081101561232457600080fd5b5051155b6123635760405162461bcd60e51b81526004018080602001828103825260368152602001806134526036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526123b5908490613029565b505050565b6060611e1984846000856130da565b600082821115612420576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008261243557506000610d31565b8282028284828161244257fe5b0414610dfe5760405162461bcd60e51b815260040180806020018281038252602181526020018061339c6021913960400191505060405180910390fd5b60008082116124d5576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816124de57fe5b049392505050565b600082820183811015610dfe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0383166125855760405162461bcd60e51b81526004018080602001828103825260268152602001806134026026913960400191505060405180910390fd5b6001600160a01b0382166125ca5760405162461bcd60e51b81526004018080602001828103825260248152602001806133266024913960400191505060405180910390fd5b6001600160a01b038084166000818152600f6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60085490565b600081848411156126c15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561268657818101518382015260200161266e565b50505050905090810190601f1680156126b35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b826126d2611e5b565b6004556126dd6119a5565b6003556001600160a01b03811615612724576126f881610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b8261272d611e5b565b6004556127386119a5565b6003556001600160a01b0381161561277f5761275381610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b6001600160a01b0385166127c45760405162461bcd60e51b81526004018080602001828103825260258152602001806133dd6025913960400191505060405180910390fd5b6001600160a01b0384166128095760405162461bcd60e51b81526004018080602001828103825260238152602001806132dd6023913960400191505060405180910390fd5b6001600160a01b0385166000908152600b6020526040902054838110156128615760405162461bcd60e51b81526004018080602001828103825260268152602001806133006026913960400191505060405180910390fd5b60005b600c5481101561297657600c818154811061287b57fe5b60009182526020822001546040805163f3fef3a360e01b81526001600160a01b038b81166004830152602482018a90529151919092169263f3fef3a3926044808201939182900301818387803b1580156128d457600080fd5b505af11580156128e8573d6000803e3d6000fd5b50505050600c81815481106128f957fe5b6000918252602082200154604080516356e4bb9760e11b81526001600160a01b038a81166004830152602482018a90529151919092169263adc9772e926044808201939182900301818387803b15801561295257600080fd5b505af1158015612966573d6000803e3d6000fd5b5050600190920191506128649050565b5061298181856123c9565b6001600160a01b038088166000908152600b602052604080822093909355908716815220546129b090856124e6565b6001600160a01b038087166000818152600b602090815260409182902094909455805188815290519193928a16926000805160206133bd83398151915292918290030190a3505050505050565b80612a06611e5b565b600455612a116119a5565b6003556001600160a01b03811615612a5857612a2c81610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b60008311612aad576040805162461bcd60e51b815260206004820152601b60248201527f526577617264506f6f6c203a2043616e6e6f74207374616b6520300000000000604482015290519081900360640190fd5b60005b600c54811015612b4457600c8181548110612ac757fe5b6000918252602082200154604080516356e4bb9760e11b81526001600160a01b038781166004830152602482018990529151919092169263adc9772e926044808201939182900301818387803b158015612b2057600080fd5b505af1158015612b34573d6000803e3d6000fd5b505060019092019150612ab09050565b50600854612b5290846124e6565b6008556001600160a01b0382166000908152600b6020526040902054612b7890846124e6565b6001600160a01b0383166000818152600b602090815260408083209490945583518781529351929391926000805160206133bd8339815191529281900390910190a3505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612c19908590613029565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526123b5908490613029565b6000612c7b611e5b565b600455612c866119a5565b6003556001600160a01b03811615612ccd57612ca181610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b600754612cda90836124e6565b6007556001544210612cfb57612cf38262093a8061247f565b600255612d45565b600154600090612d0b90426123c9565b90506000612d246002548361242690919063ffffffff16565b9050612d3084826124e6565b9350612d3f8462093a8061247f565b60025550505b6006829055426003819055612d5d9062093a806124e6565b6001556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b6001600160a01b03166000908152600b602052604090205490565b6000818310612dc15781610dfe565b5090919050565b600082612dd3611e5b565b600455612dde6119a5565b6003556001600160a01b03811615612e2557612df981610a51565b6001600160a01b0382166000908152600a60209081526040808320939093556004546009909152919020555b60005b600c54811015612ebc57600c8181548110612e3f57fe5b60009182526020822001546040805163f3fef3a360e01b81526001600160a01b038981166004830152602482018b90529151919092169263f3fef3a3926044808201939182900301818387803b158015612e9857600080fd5b505af1158015612eac573d6000803e3d6000fd5b505060019092019150612e289050565b50600854612eca90866123c9565b6008556001600160a01b0384166000908152600b6020526040902054612ef090866123c9565b6001600160a01b038086166000908152600b60205260408082209390935582516305335c3960e21b81527f0000000000000000000000000000000000000000000000000000000000000000600482015260248101899052868316604482015292517f000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf2909216926314cd70e4926064808301939282900301818387803b158015612f9857600080fd5b505af1158015612fac573d6000803e3d6000fd5b50506040805188815290516001600160a01b03881693507f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d592509081900360200190a26040805186815290516000916001600160a01b038716916000805160206133bd8339815191529181900360200190a3506001949350505050565b606061307e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123ba9092919063ffffffff16565b8051909150156123b55780806020019051602081101561309d57600080fd5b50516123b55760405162461bcd60e51b815260040180806020018281038252602a815260200180613428602a913960400191505060405180910390fd5b60608247101561311b5760405162461bcd60e51b815260040180806020018281038252602681526020018061334a6026913960400191505060405180910390fd5b61312485613236565b613175576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106131b45780518252601f199092019160209182019101613195565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613216576040519150601f19603f3d011682016040523d82523d6000602084013e61321b565b606091505b509150915061322b82828661323c565b979650505050505050565b3b151590565b6060831561324b575081610dfe565b82511561325b5782518084602001fd5b60405162461bcd60e51b815260206004820181815284516024840152845185939192839260440191908501908083836000831561268657818101518382015260200161266e565b50805460008255906000526020600020908101906132c091906132c3565b50565b5b808211156132d857600081556001016132c4565b509056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365455243343632363a20617070726f766520746f20746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c455243343632363a207769746864726177616c20616d6f756e74206578636565647320616c6c6f77616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f2061646472657373455243343632363a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a264697066735822122052c962517ecff6f8f38bf7ab68bfa84ca89bedfbf6115c7a603ef62d5de2e7b164736f6c634300060c0033

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

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c5000000000000000000000000627fee87d0d9d2c55098a06ac805db8f98b158aa000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf2000000000000000000000000368dda6c8cce7283f4ee2577b8cbe454f40f9a4800000000000000000000000005058071e3e799f0c6341f44843636e7c441c1fb

-----Decoded View---------------
Arg [0] : pid_ (uint256): 0
Arg [1] : stakingToken_ (address): 0x3301E18b6f05AF0caa5744ecBFb64CAe0C1392C5
Arg [2] : rewardToken_ (address): 0x627fee87d0D9D2c55098A06ac805Db8F98B158Aa
Arg [3] : operator_ (address): 0x631e58246A88c3957763e1469cb52f93BC1dDCF2
Arg [4] : rewardManager_ (address): 0x368dDA6c8cce7283F4EE2577b8cbE454F40F9A48
Arg [5] : lptoken_ (address): 0x05058071E3E799f0C6341F44843636e7c441c1fB

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000003301e18b6f05af0caa5744ecbfb64cae0c1392c5
Arg [2] : 000000000000000000000000627fee87d0d9d2c55098a06ac805db8f98b158aa
Arg [3] : 000000000000000000000000631e58246a88c3957763e1469cb52f93bc1ddcf2
Arg [4] : 000000000000000000000000368dda6c8cce7283f4ee2577b8cbe454f40f9a48
Arg [5] : 00000000000000000000000005058071e3e799f0c6341f44843636e7c441c1fb


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.