Contract 0xba54bf4ebaef6868a373354616bece168b2d4c6f

Contract Overview

Balance:
0 BNB

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x935f2818fd288c689a8f7512d6fd56bed8b89821bba23ad4169c5018141579dcHarvest196245472021-06-11 0:22:46101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.0017891
0x8a3d80e2a4ef6e730caffbb818931556d1b5f0707bf8a4a1f6a33824ebd9f25eHarvest196245422021-06-11 0:22:31101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.0017891
0x27a92e425158ec63b5405167a8595aca12ec41f15c0a2039b2fa2415b09fd9e4Harvest196244752021-06-11 0:19:10101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.00156368
0x2887251ffa0344a2916babf6be0c7f5c9f40c339c75e8e008c864eacfcfe0024Harvest296244672021-06-11 0:18:46101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.00156369
0x15075fdbd80c189c0e69994265135505647b74d1a8dfdb3200609376fdee64ecHarvest396244622021-06-11 0:18:31101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.00156346
0x60e63f2dc0a8993b107fbf0bc5d147fb643d36317a3238bc5c04033d7ea92877Harvest496244572021-06-11 0:18:16101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.00156391
0x2598a6f182eaf7143353b15ea6a1f04f02e01850e95cbeb6fd4bba77de1a0801Harvest96244352021-06-11 0:17:10101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.00156347
0x3d26505202538f91096ed8331dc116610d58e7dc152abb7ed117393ce3053831Harvest96243812021-06-11 0:14:28101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.00167959
0x16abc638b153aa529f289325545150d9b089fe2de9a2a2732069b0a508398355Deposit96243712021-06-11 0:13:58101 days 20 hrs ago0x281f47e30490e4c8638e8ccffcfb2e547881bae7 IN  0xba54bf4ebaef6868a373354616bece168b2d4c6f0 BNB0.00338567
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x935f2818fd288c689a8f7512d6fd56bed8b89821bba23ad4169c5018141579dc96245472021-06-11 0:22:46101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x935f2818fd288c689a8f7512d6fd56bed8b89821bba23ad4169c5018141579dc96245472021-06-11 0:22:46101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x8a5a76401ada8998603d982d8343752fec75972b0 BNB
0x935f2818fd288c689a8f7512d6fd56bed8b89821bba23ad4169c5018141579dc96245472021-06-11 0:22:46101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x4d751991267545db23f5b8f7bad4cc975b1f53510 BNB
0x8a3d80e2a4ef6e730caffbb818931556d1b5f0707bf8a4a1f6a33824ebd9f25e96245422021-06-11 0:22:31101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x8a3d80e2a4ef6e730caffbb818931556d1b5f0707bf8a4a1f6a33824ebd9f25e96245422021-06-11 0:22:31101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x8a5a76401ada8998603d982d8343752fec75972b0 BNB
0x8a3d80e2a4ef6e730caffbb818931556d1b5f0707bf8a4a1f6a33824ebd9f25e96245422021-06-11 0:22:31101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x4d751991267545db23f5b8f7bad4cc975b1f53510 BNB
0x27a92e425158ec63b5405167a8595aca12ec41f15c0a2039b2fa2415b09fd9e496244752021-06-11 0:19:10101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x27a92e425158ec63b5405167a8595aca12ec41f15c0a2039b2fa2415b09fd9e496244752021-06-11 0:19:10101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x8a5a76401ada8998603d982d8343752fec75972b0 BNB
0x27a92e425158ec63b5405167a8595aca12ec41f15c0a2039b2fa2415b09fd9e496244752021-06-11 0:19:10101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x4d751991267545db23f5b8f7bad4cc975b1f53510 BNB
0x2887251ffa0344a2916babf6be0c7f5c9f40c339c75e8e008c864eacfcfe002496244672021-06-11 0:18:46101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x2887251ffa0344a2916babf6be0c7f5c9f40c339c75e8e008c864eacfcfe002496244672021-06-11 0:18:46101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x8a5a76401ada8998603d982d8343752fec75972b0 BNB
0x2887251ffa0344a2916babf6be0c7f5c9f40c339c75e8e008c864eacfcfe002496244672021-06-11 0:18:46101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x4d751991267545db23f5b8f7bad4cc975b1f53510 BNB
0x15075fdbd80c189c0e69994265135505647b74d1a8dfdb3200609376fdee64ec96244622021-06-11 0:18:31101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x15075fdbd80c189c0e69994265135505647b74d1a8dfdb3200609376fdee64ec96244622021-06-11 0:18:31101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x8a5a76401ada8998603d982d8343752fec75972b0 BNB
0x15075fdbd80c189c0e69994265135505647b74d1a8dfdb3200609376fdee64ec96244622021-06-11 0:18:31101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x4d751991267545db23f5b8f7bad4cc975b1f53510 BNB
0x60e63f2dc0a8993b107fbf0bc5d147fb643d36317a3238bc5c04033d7ea9287796244572021-06-11 0:18:16101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x60e63f2dc0a8993b107fbf0bc5d147fb643d36317a3238bc5c04033d7ea9287796244572021-06-11 0:18:16101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x8a5a76401ada8998603d982d8343752fec75972b0 BNB
0x60e63f2dc0a8993b107fbf0bc5d147fb643d36317a3238bc5c04033d7ea9287796244572021-06-11 0:18:16101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x4d751991267545db23f5b8f7bad4cc975b1f53510 BNB
0x2598a6f182eaf7143353b15ea6a1f04f02e01850e95cbeb6fd4bba77de1a080196244352021-06-11 0:17:10101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x2598a6f182eaf7143353b15ea6a1f04f02e01850e95cbeb6fd4bba77de1a080196244352021-06-11 0:17:10101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x8a5a76401ada8998603d982d8343752fec75972b0 BNB
0x2598a6f182eaf7143353b15ea6a1f04f02e01850e95cbeb6fd4bba77de1a080196244352021-06-11 0:17:10101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0x4d751991267545db23f5b8f7bad4cc975b1f53510 BNB
0x3d26505202538f91096ed8331dc116610d58e7dc152abb7ed117393ce305383196243812021-06-11 0:14:28101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x3d26505202538f91096ed8331dc116610d58e7dc152abb7ed117393ce305383196243812021-06-11 0:14:28101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x3d26505202538f91096ed8331dc116610d58e7dc152abb7ed117393ce305383196243812021-06-11 0:14:28101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
0x3d26505202538f91096ed8331dc116610d58e7dc152abb7ed117393ce305383196243812021-06-11 0:14:28101 days 20 hrs ago 0xba54bf4ebaef6868a373354616bece168b2d4c6f 0xb194f73255dcce6788188117cc2882e61ad7d5ac0 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x09dA73f58bBa8494164C9Bf60222121DDD8eC40e

Contract Name:
VaultInitializable

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 15 : VaultInitializable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "./libs/IBEP20.sol";
import "./libs/SafeBEP20.sol";
import "./libs/IMasterChef.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";

pragma solidity 0.6.12;

contract VaultInitializable is Ownable, Pausable {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;

    struct UserInfo {
        uint256 shares; // number of shares for a user
        uint256 lastDepositedTime; // keeps track of deposited time for potential penalty
        uint256 lastUserAction; // keeps track of token deposited at the last user action
        uint256 lastUserActionTime; // keeps track of the last user action time
    }

    // The address of the factory
    address public VAULT_FACTORY;

    // Whether it is initialized
    bool public isInitialized;

    IERC20 public token; // Staked Token/LP
    IERC20 public reward; // Reward Token
    uint256 public pid; // Farm pid
    IMasterChef public masterchef; // Master Chef

    mapping(address => UserInfo) public userInfo;

    uint256 public totalShares;
    uint256 public lastHarvestedTime;
    address public feeAddress;
    IUniswapV2Router02 public swapRouter;

    uint256 public constant MAX_PERFORMANCE_FEE = 500; // 5%
    uint256 public constant MAX_CALL_FEE = 100; // 1%
    uint256 public constant MAX_DEPOSIT_FEE = 400; // 4%
    uint256 public constant MAX_WITHDRAW_FEE = 400; // 4%
    uint256 public constant MAX_WITHDRAW_FEE_PERIOD = 72 hours; // 3 days

    uint256 public performanceFee = 400; // 4%
    uint256 public callFee = 50; // 0.5%
    uint256 public depositFee = 0; // 0%
    uint256 public withdrawFee = 400; // 4%
    uint256 public withdrawFeePeriod = 48 hours; // 2 days

    event Deposit(address indexed sender, uint256 amount, uint256 shares, uint256 lastDepositedTime);
    event Withdraw(address indexed sender, uint256 amount, uint256 shares);
    event Harvest(address indexed sender, uint256 performanceFee, uint256 callFee);
    event Pause();
    event Unpause();
    event SwapRouterUpdated(address indexed operator, address indexed router);

    constructor() public {
        VAULT_FACTORY = msg.sender;
    }

    /*
     * @notice Initialize the contract
     * @param _token: Staked Token/LP contract
     * @param _reward: Reward Token contract
     * @param _pid: Farm pid
     * @param _depositFee: depositFee
     * @param _masterchef: MasterChef contract
     * @param _swapRouter: Router contract
     * @param _admin: address of the admin
     * @param _feeAddress: address of the feeAddress
     */
    function initialize(
        IERC20 _token,
        IERC20 _reward,
        uint256 _pid,
        uint256 _depositFee,
        IMasterChef _masterchef,
        IUniswapV2Router02 _swapRouter,
        address _admin,
        address _feeAddress
    ) external {
        require(!isInitialized, "Already initialized");
        require(msg.sender == VAULT_FACTORY, "Not factory");

        // Make this contract initialized
        isInitialized = true;

        token = _token;
        reward = _reward;
        pid = _pid;
        depositFee = _depositFee;
        masterchef = _masterchef;
        swapRouter = _swapRouter;
        feeAddress = _feeAddress;

        // Infinite approve
        IERC20(_token).safeApprove(address(_masterchef), uint256(-1));

        // Transfer ownership to the admin address who becomes owner of the contract
        transferOwnership(_admin);
    }

    /**
     * @notice Checks if the msg.sender is a contract or a proxy
     */
    modifier notContract() {
        require(!_isContract(msg.sender), "contract not allowed");
        require(msg.sender == tx.origin, "proxy contract not allowed");
        _;
    }

    /**
     * @notice Deposits funds into the Vault
     * @dev Only possible when contract not paused.
     * @param _amount: number of tokens to deposit
     */
    function deposit(uint256 _amount) external whenNotPaused notContract {
        require(_amount > 0, "Nothing to deposit");

        uint256 pool = balanceOf();
        token.safeTransferFrom(msg.sender, address(this), _amount);

        if (depositFee > 0) {
            uint256 _depositFee = _amount.mul(depositFee).div(10000);
            if (token != reward) token.safeTransfer(feeAddress, _depositFee);
            _amount = _amount.sub(_depositFee);
        }

        uint256 currentShares = 0;
        if (totalShares != 0) {
            currentShares = (_amount.mul(totalShares)).div(pool);
        } else {
            currentShares = _amount;
        }
        UserInfo storage user = userInfo[msg.sender];

        user.shares = user.shares.add(currentShares);
        user.lastDepositedTime = block.timestamp;

        totalShares = totalShares.add(currentShares);

        user.lastUserAction = user.shares.mul(balanceOf()).div(totalShares);
        user.lastUserActionTime = block.timestamp;

        _earn();

        emit Deposit(msg.sender, _amount, currentShares, block.timestamp);
    }

    /**
     * @notice Withdraws all funds for a user
     */
    function withdrawAll() external notContract {
        withdraw(userInfo[msg.sender].shares);
    }

    /**
     * @notice Reinvests tokens into MasterChef in case reward token is different will be swaped and created lp token
     * @dev Only possible when contract not paused.
     */
    function harvest() external notContract whenNotPaused {
        IMasterChef(masterchef).deposit(pid, 0);

        uint256 bal = availableReward();
        uint256 currentCallFee = bal.mul(callFee).div(10000);
        token.safeTransfer(msg.sender, currentCallFee);
        bal = bal.sub(currentCallFee);

        if (bal > 0 && token != reward) {
            reward.approve(address(swapRouter), uint256(-1));
            IUniswapV2Pair pair = IUniswapV2Pair(address(token));
            IBEP20 token0 = IBEP20(pair.token0());
            IBEP20 token1 = IBEP20(pair.token1());
            uint256 half0 = bal.div(2);
            uint256 half1 = bal.sub(half0);
            address[] memory path = new address[](2);
            path[0] = address(reward);

            if (address(token0) != address(reward)) {
                path[1] = address(token0);
                swapRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(half0, 0, path, address(this), block.timestamp);
                token0.approve(address(swapRouter), uint256(-1));
            }

            if (address(token1) != address(reward)) {
                path[1] = address(token1);
                swapRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(half1, 0, path, address(this), block.timestamp);
                token1.approve(address(swapRouter), uint256(-1));
            }

            swapRouter.addLiquidity(address(token0), address(token1), token0.balanceOf(address(this)), token1.balanceOf(address(this)), 0, 0, address(this), block.timestamp);
        }

        bal = availableToken();
        uint256 currentPerformanceFee = bal.mul(performanceFee).div(10000);
        token.safeTransfer(feeAddress, currentPerformanceFee);

        _earn();

        lastHarvestedTime = block.timestamp;

        emit Harvest(msg.sender, currentPerformanceFee, currentCallFee);
    }


    /**
     * @notice Reinvests tokens into MasterChef in case reward token is different will be swaped and created lp token
     * @dev Only possible when contract not paused.
     */
    function harvest1() external notContract whenNotPaused {
        IMasterChef(masterchef).deposit(pid, 0);

        uint256 bal = availableReward();
        uint256 currentCallFee = bal.mul(callFee).div(10000);
        token.safeTransfer(msg.sender, currentCallFee);
        bal = bal.sub(currentCallFee);

        if (bal > 0 && token != reward) {
            reward.approve(address(swapRouter), uint256(-1));
            IUniswapV2Pair pair = IUniswapV2Pair(address(token));
            IBEP20 token0 = IBEP20(pair.token0());
            IBEP20 token1 = IBEP20(pair.token1());
        }

        bal = availableToken();
        uint256 currentPerformanceFee = bal.mul(performanceFee).div(10000);
        token.safeTransfer(feeAddress, currentPerformanceFee);

        _earn();

        lastHarvestedTime = block.timestamp;

        emit Harvest(msg.sender, currentPerformanceFee, currentCallFee);
    }


    /**
     * @notice Reinvests tokens into MasterChef in case reward token is different will be swaped and created lp token
     * @dev Only possible when contract not paused.
     */
    function harvest2() external notContract whenNotPaused {
        IMasterChef(masterchef).deposit(pid, 0);

        uint256 bal = availableReward();
        uint256 currentCallFee = bal.mul(callFee).div(10000);
        token.safeTransfer(msg.sender, currentCallFee);
        bal = bal.sub(currentCallFee);

        if (bal > 0 && token != reward) {
            reward.approve(address(swapRouter), uint256(-1));
            IUniswapV2Pair pair = IUniswapV2Pair(address(token));
            IBEP20 token0 = IBEP20(pair.token0());
            IBEP20 token1 = IBEP20(pair.token1());
            uint256 half0 = bal.div(2);
            uint256 half1 = bal.sub(half0);
        }

        bal = availableToken();
        uint256 currentPerformanceFee = bal.mul(performanceFee).div(10000);
        token.safeTransfer(feeAddress, currentPerformanceFee);

        _earn();

        lastHarvestedTime = block.timestamp;

        emit Harvest(msg.sender, currentPerformanceFee, currentCallFee);
    }


    /**
     * @notice Reinvests tokens into MasterChef in case reward token is different will be swaped and created lp token
     * @dev Only possible when contract not paused.
     */
    function harvest3() external notContract whenNotPaused {
        IMasterChef(masterchef).deposit(pid, 0);

        uint256 bal = availableReward();
        uint256 currentCallFee = bal.mul(callFee).div(10000);
        token.safeTransfer(msg.sender, currentCallFee);
        bal = bal.sub(currentCallFee);

        if (bal > 0 && token != reward) {
            reward.approve(address(swapRouter), uint256(-1));
            IUniswapV2Pair pair = IUniswapV2Pair(address(token));
            IBEP20 token0 = IBEP20(pair.token0());
            IBEP20 token1 = IBEP20(pair.token1());
            uint256 half0 = bal.div(2);
            uint256 half1 = bal.sub(half0);
            address[] memory path = new address[](2);
            path[0] = address(reward);

            if (address(token0) != address(reward)) {
                path[1] = address(token0);
                swapRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(half0, 0, path, address(this), block.timestamp);
                token0.approve(address(swapRouter), uint256(-1));
            }
        }

        bal = availableToken();
        uint256 currentPerformanceFee = bal.mul(performanceFee).div(10000);
        token.safeTransfer(feeAddress, currentPerformanceFee);

        _earn();

        lastHarvestedTime = block.timestamp;

        emit Harvest(msg.sender, currentPerformanceFee, currentCallFee);
    }


    /**
     * @notice Reinvests tokens into MasterChef in case reward token is different will be swaped and created lp token
     * @dev Only possible when contract not paused.
     */
    function harvest4() external notContract whenNotPaused {
        IMasterChef(masterchef).deposit(pid, 0);

        uint256 bal = availableReward();
        uint256 currentCallFee = bal.mul(callFee).div(10000);
        token.safeTransfer(msg.sender, currentCallFee);
        bal = bal.sub(currentCallFee);

        if (bal > 0 && token != reward) {
            reward.approve(address(swapRouter), uint256(-1));
            IUniswapV2Pair pair = IUniswapV2Pair(address(token));
            IBEP20 token0 = IBEP20(pair.token0());
            IBEP20 token1 = IBEP20(pair.token1());
            uint256 half0 = bal.div(2);
            uint256 half1 = bal.sub(half0);
            address[] memory path = new address[](2);
            path[0] = address(reward);

            if (address(token0) != address(reward)) {
                path[1] = address(token0);
                swapRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(half0, 0, path, address(this), block.timestamp);
                token0.approve(address(swapRouter), uint256(-1));
            }

            if (address(token1) != address(reward)) {
                path[1] = address(token1);
                swapRouter.swapExactTokensForTokensSupportingFeeOnTransferTokens(half1, 0, path, address(this), block.timestamp);
                token1.approve(address(swapRouter), uint256(-1));
            }
        }

        bal = availableToken();
        uint256 currentPerformanceFee = bal.mul(performanceFee).div(10000);
        token.safeTransfer(feeAddress, currentPerformanceFee);

        _earn();

        lastHarvestedTime = block.timestamp;

        emit Harvest(msg.sender, currentPerformanceFee, currentCallFee);
    }

    /**
     * @notice Sets feeAddress address
     * @dev Only callable by the contract owner.
     */
    function setFeeAddress(address _feeAddress) external onlyOwner {
        require(_feeAddress != address(0), "Cannot be zero address");
        feeAddress = _feeAddress;
    }

    /**
     * @notice Sets performance fee
     * @dev Only callable by the contract owner.
     */
    function setPerformanceFee(uint256 _performanceFee) external onlyOwner {
        require(_performanceFee <= MAX_PERFORMANCE_FEE, "performanceFee cannot be more than MAX_PERFORMANCE_FEE");
        performanceFee = _performanceFee;
    }

    /**
     * @notice Sets call fee
     * @dev Only callable by the contract owner.
     */
    function setCallFee(uint256 _callFee) external onlyOwner {
        require(_callFee <= MAX_CALL_FEE, "callFee cannot be more than MAX_CALL_FEE");
        callFee = _callFee;
    }

    /**
     * @notice Sets deposit fee
     * @dev Only callable by the contract owner.
     */
    function setDeposit(uint256 _depositFee) external onlyOwner {
        require(_depositFee <= MAX_DEPOSIT_FEE, "depositFee cannot be more than MAX_DEPOSIT_FEE");
        depositFee = _depositFee;
    }

    /**
     * @notice Sets withdraw fee
     * @dev Only callable by the contract owner.
     */
    function setWithdrawFee(uint256 _withdrawFee) external onlyOwner {
        require(_withdrawFee <= MAX_WITHDRAW_FEE, "withdrawFee cannot be more than MAX_WITHDRAW_FEE");
        withdrawFee = _withdrawFee;
    }

    /**
     * @notice Sets withdraw fee period
     * @dev Only callable by the contract owner.
     */
    function setWithdrawFeePeriod(uint256 _withdrawFeePeriod) external onlyOwner {
        require(
            _withdrawFeePeriod <= MAX_WITHDRAW_FEE_PERIOD,
            "withdrawFeePeriod cannot be more than MAX_WITHDRAW_FEE_PERIOD"
        );
        withdrawFeePeriod = _withdrawFeePeriod;
    }

    /**
     * @notice Withdraws from MasterChef to Vault without caring about rewards.
     * @dev EMERGENCY ONLY. Only callable by the contract owner.
     */
    function emergencyWithdraw() external onlyOwner {
        IMasterChef(masterchef).emergencyWithdraw(pid);
    }

    /**
     * @notice Withdraw unexpected tokens sent to the Vault
     */
    function inCaseTokensGetStuck(address _token) external onlyOwner {
        require(_token != address(token), "Token cannot be same as deposit token");
        require(_token != address(reward), "Token cannot be same as reward token");

        uint256 amount = IERC20(_token).balanceOf(address(this));
        IERC20(_token).safeTransfer(msg.sender, amount);
    }

    /**
     * @notice Triggers stopped state
     * @dev Only possible when contract not paused.
     */
    function pause() external onlyOwner whenNotPaused {
        _pause();
        emit Pause();
    }

    /**
     * @notice Returns to normal state
     * @dev Only possible when contract is paused.
     */
    function unpause() external onlyOwner whenPaused {
        _unpause();
        emit Unpause();
    }

    /**
     * @notice Calculates the expected harvest reward from third party
     * @return Expected reward to collect
     */
    function calculateHarvestRewards() external view returns (uint256) {
        uint256 amount = IMasterChef(masterchef).pendingDeFi(pid, address(this));
        amount = amount.add(availableReward());
        uint256 currentCallFee = amount.mul(callFee).div(10000);

        return currentCallFee;
    }

    /**
     * @notice Calculates the total pending rewards that can be restaked
     * @return Returns total pending rewards
     */
    function calculateTotalPendingRewards() external view returns (uint256) {
        uint256 amount = IMasterChef(masterchef).pendingDeFi(pid, address(this));
        amount = amount.add(availableReward());

        return amount;
    }

    /**
     * @notice Calculates the price per share
     */
    function getPricePerFullShare() external view returns (uint256) {
        return totalShares == 0 ? 1e18 : balanceOf().mul(1e18).div(totalShares);
    }

    /**
     * @notice Withdraws from funds from the Vault
     * @param _shares: Number of shares to withdraw
     */
    function withdraw(uint256 _shares) public notContract {
        UserInfo storage user = userInfo[msg.sender];
        require(_shares > 0, "Nothing to withdraw");
        require(_shares <= user.shares, "Withdraw amount exceeds balance");

        uint256 currentAmount = (balanceOf().mul(_shares)).div(totalShares);
        user.shares = user.shares.sub(_shares);
        totalShares = totalShares.sub(_shares);

        uint256 bal = availableToken();
        if (bal < currentAmount) {
            uint256 balWithdraw = currentAmount.sub(bal);
            IMasterChef(masterchef).withdraw(pid, balWithdraw);
            uint256 balAfter = availableToken();
            uint256 diff = balAfter.sub(bal);
            if (diff < balWithdraw) {
                currentAmount = bal.add(diff);
            }
        }

        if (block.timestamp < user.lastDepositedTime.add(withdrawFeePeriod)) {
            uint256 currentWithdrawFee = currentAmount.mul(withdrawFee).div(10000);
            token.safeTransfer(feeAddress, currentWithdrawFee);
            currentAmount = currentAmount.sub(currentWithdrawFee);
        }

        if (user.shares > 0) {
            user.lastUserAction = user.shares.mul(balanceOf()).div(totalShares);
        } else {
            user.lastUserAction = 0;
        }

        user.lastUserActionTime = block.timestamp;

        token.safeTransfer(msg.sender, currentAmount);

        emit Withdraw(msg.sender, currentAmount, _shares);
    }

    /**
     * @notice Custom logic for how much the vault allows to be borrowed
     * @dev The contract puts 100% of the tokens to work.
     */
    function availableToken() public view returns (uint256) {
        return token.balanceOf(address(this));
    }

    /**
     * @notice Custom logic for how much the vault allows to be borrowed
     * @dev The contract puts 100% of the tokens to work.
     */
    function availableReward() public view returns (uint256) {
        return reward.balanceOf(address(this));
    }

    /**
     * @notice Calculates the total underlying tokens
     * @dev It includes tokens held by the contract and held in MasterChef
     */
    function balanceOf() public view returns (uint256) {
        (uint256 amount, ) = IMasterChef(masterchef).userInfo(pid, address(this));
        return token.balanceOf(address(this)).add(amount);
    }

    /**
     * @notice Deposits tokens into MasterChef
     */
    function _earn() internal {
        uint256 bal = availableToken();
        if (bal > 0) {
            IMasterChef(masterchef).deposit(pid, bal);
        }
    }

    /**
     * @notice Checks if address is a contract
     * @dev It prevents contract from being targetted
     */
    function _isContract(address addr) internal view returns (bool) {
        uint256 size;
        assembly {
            size := extcodesize(addr)
        }
        return size > 0;
    }

    // Update the swap router.
    function setSwapRouter(address _router) public onlyOwner {
        swapRouter = IUniswapV2Router02(_router);
        emit SwapRouterUpdated(msg.sender, address(swapRouter));
    }
}

File 2 of 15 : IBEP20.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.4.0;

interface IBEP20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

    /**
     * @dev Returns the bep token owner.
     */
    function getOwner() external view returns (address);

    /**
     * @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 3 of 15 : IMasterChef.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

interface IMasterChef {
    function deposit(uint256 _pid, uint256 _amount) external;

    function withdraw(uint256 _pid, uint256 _amount) external;

    function pendingDeFi(uint256 _pid, address _user) external view returns (uint256);

    function userInfo(uint256 _pid, address _user) external view returns (uint256, uint256);

    function emergencyWithdraw(uint256 _pid) external;
}

File 4 of 15 : SafeBEP20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IBEP20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";

/**
 * @title SafeBEP20
 * @dev Wrappers around BEP20 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 SafeBEP20 for IBEP20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeBEP20 {
    using SafeMath for uint256;
    using Address for address;

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

    function safeTransferFrom(
        IBEP20 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
     * {IBEP20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IBEP20 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),
            "SafeBEP20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IBEP20 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(
        IBEP20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(
            value,
            "SafeBEP20: 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(IBEP20 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, "SafeBEP20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeBEP20: BEP20 operation did not succeed");
        }
    }
}

File 5 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/Context.sol";
/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 6 of 15 : 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 7 of 15 : 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 8 of 15 : 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 9 of 15 : 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 10 of 15 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

File 11 of 15 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

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

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

    bool private _paused;

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

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

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

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

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

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

File 12 of 15 : IUniswapV2Factory.sol
pragma solidity >=0.5.0;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

File 13 of 15 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 14 of 15 : IUniswapV2Router01.sol
pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

File 15 of 15 : IUniswapV2Router02.sol
pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastDepositedTime","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"performanceFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"callFee","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"router","type":"address"}],"name":"SwapRouterUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MAX_CALL_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_DEPOSIT_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PERFORMANCE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_WITHDRAW_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_WITHDRAW_FEE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VAULT_FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateHarvestRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateTotalPendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPricePerFullShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvest1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvest2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvest3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvest4","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"inCaseTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"contract IERC20","name":"_reward","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_depositFee","type":"uint256"},{"internalType":"contract IMasterChef","name":"_masterchef","type":"address"},{"internalType":"contract IUniswapV2Router02","name":"_swapRouter","type":"address"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastHarvestedTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterchef","outputs":[{"internalType":"contract IMasterChef","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"performanceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reward","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_callFee","type":"uint256"}],"name":"setCallFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositFee","type":"uint256"}],"name":"setDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_performanceFee","type":"uint256"}],"name":"setPerformanceFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setSwapRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawFee","type":"uint256"}],"name":"setWithdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_withdrawFeePeriod","type":"uint256"}],"name":"setWithdrawFeePeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapRouter","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"lastDepositedTime","type":"uint256"},{"internalType":"uint256","name":"lastUserAction","type":"uint256"},{"internalType":"uint256","name":"lastUserActionTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFeePeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6080604052610190600b556032600c556000600d55610190600e556202a300600f553480156200002e57600080fd5b5060006200003b620000aa565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000805460ff60a01b19169055600180546001600160a01b03191633179055620000ae565b3390565b6142de80620000be6000396000f3fe608060405234801561001057600080fd5b50600436106102f15760003560e01c80637ba132fe1161019d578063c31c9c07116100e9578063df10b4e6116100a2578063f2fde38b1161007c578063f2fde38b14610619578063f5bade661461063f578063fb1db2781461065c578063fc0c546a14610664576102f1565b8063df10b4e614610601578063e941fa7814610609578063f106845414610611576102f1565b8063c31c9c07146105bb578063c6d87dd5146105c3578063d2c6dc94146105cb578063d4b0de2f146105c3578063db2e21bc146105d3578063def68a9c146105db576102f1565b806390321e1a11610156578063b6ac642a11610130578063b6ac642a14610571578063b6b55f251461058e578063bbebeec8146105ab578063bdca9165146105b3576102f1565b806390321e1a146105065780639b3ee16e1461050e578063b60f053114610569576102f1565b80637ba132fe146104b85780638456cb59146104c0578063853828b6146104c85780638705fcd4146104d057806387788782146104f65780638da5cb5b146104fe576102f1565b8063412736571161025c5780635c975abb1161021557806370897b23116101ef57806370897b2314610483578063715018a6146104a0578063722713f7146104a857806377c7b8fc146104b0576102f1565b80635c975abb1461046b57806367a5279314610473578063680d55fc1461047b576102f1565b8063412736571461041d57806341275358146104435780634641257d1461044b5780634ad84b34146104535780634d8def871461045b578063564b28a014610463576102f1565b80632ad5a53f116102ae5780632ad5a53f146103c45780632cfc5f01146103cc5780632e1a7d4d146103d4578063392e53cd146103f15780633a98ef391461040d5780633f4ba83a14610415576102f1565b8063103f2907146102f65780631959a0021461031a5780631efac1b814610366578063228cb73314610385578063264658261461038d5780632816cc4a146103aa575b600080fd5b6102fe61066c565b604080516001600160a01b039092168252519081900360200190f35b6103406004803603602081101561033057600080fd5b50356001600160a01b031661067b565b604080519485526020850193909352838301919091526060830152519081900360800190f35b6103836004803603602081101561037c57600080fd5b50356106a2565b005b6102fe61074b565b610383600480360360208110156103a357600080fd5b503561075a565b6103b2610801565b60408051918252519081900360200190f35b6103b26108a1565b6103b26108a6565b610383600480360360208110156103ea57600080fd5b50356108ad565b6103f9610bdd565b604080519115158252519081900360200190f35b6103b2610bed565b610383610bf3565b6103836004803603602081101561043357600080fd5b50356001600160a01b0316610cd8565b6102fe610d8c565b610383610d9b565b6103b26116a6565b610383611722565b6103b2611e02565b6103f9611e4d565b6103b2611e5d565b610383611e63565b6103836004803603602081101561049957600080fd5b50356121b7565b61038361225f565b6103b261230b565b6103b261240f565b6103b2612449565b610383612502565b6103836125e4565b610383600480360360208110156104e657600080fd5b50356001600160a01b031661268a565b6103b2612762565b6102fe612768565b6103b2612777565b610383600480360361010081101561052557600080fd5b506001600160a01b0381358116916020810135821691604082013591606081013591608082013581169160a081013582169160c082013581169160e001351661277d565b6103b26128b1565b6103836004803603602081101561058757600080fd5b50356128b7565b610383600480360360208110156105a457600080fd5b503561295f565b610383612be7565b6103b2612f1b565b6102fe612f21565b6103b2612f30565b610383612f36565b61038361343d565b610383600480360360208110156105f157600080fd5b50356001600160a01b0316613509565b6103b261369a565b6103b26136a0565b6103b26136a6565b6103836004803603602081101561062f57600080fd5b50356001600160a01b03166136ac565b6103836004803603602081101561065557600080fd5b50356137ae565b6102fe613856565b6102fe613865565b6001546001600160a01b031681565b60066020526000908152604090208054600182015460028301546003909301549192909184565b6106aa613874565b6001600160a01b03166106bb612768565b6001600160a01b031614610704576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b6203f4808111156107465760405162461bcd60e51b815260040180806020018281038252603d8152602001806141dc603d913960400191505060405180910390fd5b600f55565b6003546001600160a01b031681565b610762613874565b6001600160a01b0316610773612768565b6001600160a01b0316146107bc576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b60648111156107fc5760405162461bcd60e51b815260040180806020018281038252602881526020018061411d6028913960400191505060405180910390fd5b600c55565b600554600480546040805163df26f69760e01b8152928301919091523060248301525160009283926001600160a01b039091169163df26f69791604480820192602092909190829003018186803b15801561085b57600080fd5b505afa15801561086f573d6000803e3d6000fd5b505050506040513d602081101561088557600080fd5b5051905061089b6108946116a6565b8290613878565b91505090565b606481565b6203f48081565b6108b6336138db565b156108f6576040805162461bcd60e51b815260206004820152601460248201526000805160206140b2833981519152604482015290519081900360640190fd5b333214610938576040805162461bcd60e51b815260206004820152601a602482015260008051602061417b833981519152604482015290519081900360640190fd5b3360009081526006602052604090208161098f576040805162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20776974686472617760681b604482015290519081900360640190fd5b80548211156109e5576040805162461bcd60e51b815260206004820152601f60248201527f576974686472617720616d6f756e7420657863656564732062616c616e636500604482015290519081900360640190fd5b6000610a056007546109ff856109f961230b565b906138e1565b9061393a565b8254909150610a1490846139a1565b8255600754610a2390846139a1565b6007556000610a30611e02565b905081811015610aeb576000610a4683836139a1565b6005546004805460408051630441a3e760e41b81529283019190915260248201849052519293506001600160a01b039091169163441a3e709160448082019260009290919082900301818387803b158015610aa057600080fd5b505af1158015610ab4573d6000803e3d6000fd5b505050506000610ac2611e02565b90506000610ad082856139a1565b905082811015610ae757610ae48482613878565b94505b5050505b600f546001840154610afc91613878565b421015610b4e576000610b206127106109ff600e54866138e190919063ffffffff16565b600954600254919250610b40916001600160a01b039081169116836139fe565b610b4a83826139a1565b9250505b825415610b7857610b6e6007546109ff610b6661230b565b8654906138e1565b6002840155610b80565b600060028401555b426003840155600254610b9d906001600160a01b031633846139fe565b6040805183815260208101869052815133927ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568928290030190a250505050565b600154600160a01b900460ff1681565b60075481565b610bfb613874565b6001600160a01b0316610c0c612768565b6001600160a01b031614610c55576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b610c5d611e4d565b610ca5576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b610cad613a55565b6040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b610ce0613874565b6001600160a01b0316610cf1612768565b6001600160a01b031614610d3a576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b03838116919091179182905560405191169033907fca394f95d8dbf1e8b2e76b9a8da90cacce1da85181a65508dab13212dc1df53b90600090a350565b6009546001600160a01b031681565b610da4336138db565b15610de4576040805162461bcd60e51b815260206004820152601460248201526000805160206140b2833981519152604482015290519081900360640190fd5b333214610e26576040805162461bcd60e51b815260206004820152601a602482015260008051602061417b833981519152604482015290519081900360640190fd5b610e2e611e4d565b15610e73576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6005546004805460408051631c57762b60e31b81529283019190915260006024830181905290516001600160a01b039093169263e2bbb15892604480820193929182900301818387803b158015610ec957600080fd5b505af1158015610edd573d6000803e3d6000fd5b505050506000610eeb6116a6565b90506000610f0a6127106109ff600c54856138e190919063ffffffff16565b600254909150610f24906001600160a01b031633836139fe565b610f2e82826139a1565b9150600082118015610f5157506003546002546001600160a01b03908116911614155b1561161457600354600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610fb057600080fd5b505af1158015610fc4573d6000803e3d6000fd5b505050506040513d6020811015610fda57600080fd5b505060025460408051630dfe168160e01b815290516001600160a01b03909216916000918391630dfe168191600480820192602092909190829003018186803b15801561102657600080fd5b505afa15801561103a573d6000803e3d6000fd5b505050506040513d602081101561105057600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b0385169163d21220a7916004808301926020929190829003018186803b15801561109857600080fd5b505afa1580156110ac573d6000803e3d6000fd5b505050506040513d60208110156110c257600080fd5b5051905060006110d386600261393a565b905060006110e187836139a1565b604080516002808252606080830184529394509091602083019080368337505060035482519293506001600160a01b03169183915060009061111f57fe5b6001600160a01b0392831660209182029290920101526003548682169116146112cf57848160018151811061115057fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600a60009054906101000a90046001600160a01b03166001600160a01b0316635c11d7958460008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561120a5781810151838201526020016111f2565b505050509050019650505050505050600060405180830381600087803b15801561123357600080fd5b505af1158015611247573d6000803e3d6000fd5b5050600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051918916935063095ea7b392506044808201926020929091908290030181600087803b1580156112a257600080fd5b505af11580156112b6573d6000803e3d6000fd5b505050506040513d60208110156112cc57600080fd5b50505b6003546001600160a01b038581169116146114715783816001815181106112f257fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600a60009054906101000a90046001600160a01b03166001600160a01b0316635c11d7958360008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156113ac578181015183820152602001611394565b505050509050019650505050505050600060405180830381600087803b1580156113d557600080fd5b505af11580156113e9573d6000803e3d6000fd5b5050600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051918816935063095ea7b392506044808201926020929091908290030181600087803b15801561144457600080fd5b505af1158015611458573d6000803e3d6000fd5b505050506040513d602081101561146e57600080fd5b50505b600a54604080516370a0823160e01b815230600482015290516001600160a01b039283169263e8e3370092899289928416916370a08231916024808301926020929190829003018186803b1580156114c857600080fd5b505afa1580156114dc573d6000803e3d6000fd5b505050506040513d60208110156114f257600080fd5b5051604080516370a0823160e01b815230600482015290516001600160a01b038b16916370a08231916024808301926020929190829003018186803b15801561153a57600080fd5b505afa15801561154e573d6000803e3d6000fd5b505050506040513d602081101561156457600080fd5b5051604080516001600160e01b031960e088901b1681526001600160a01b0395861660048201529390941660248401526044830191909152606482015260006084820181905260a482018190523060c48301524260e483015291516101048083019360609383900390910190829087803b1580156115e157600080fd5b505af11580156115f5573d6000803e3d6000fd5b505050506040513d606081101561160b57600080fd5b50505050505050505b61161c611e02565b9150600061163b6127106109ff600b54866138e190919063ffffffff16565b60095460025491925061165b916001600160a01b039081169116836139fe565b611663613af8565b426008556040805182815260208101849052815133927f71bab65ced2e5750775a0613be067df48ef06cf92a496ebf7663ae0660924954928290030190a2505050565b600354604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156116f157600080fd5b505afa158015611705573d6000803e3d6000fd5b505050506040513d602081101561171b57600080fd5b5051905090565b61172b336138db565b1561176b576040805162461bcd60e51b815260206004820152601460248201526000805160206140b2833981519152604482015290519081900360640190fd5b3332146117ad576040805162461bcd60e51b815260206004820152601a602482015260008051602061417b833981519152604482015290519081900360640190fd5b6117b5611e4d565b156117fa576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6005546004805460408051631c57762b60e31b81529283019190915260006024830181905290516001600160a01b039093169263e2bbb15892604480820193929182900301818387803b15801561185057600080fd5b505af1158015611864573d6000803e3d6000fd5b5050505060006118726116a6565b905060006118916127106109ff600c54856138e190919063ffffffff16565b6002549091506118ab906001600160a01b031633836139fe565b6118b582826139a1565b91506000821180156118d857506003546002546001600160a01b03908116911614155b1561161457600354600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561193757600080fd5b505af115801561194b573d6000803e3d6000fd5b505050506040513d602081101561196157600080fd5b505060025460408051630dfe168160e01b815290516001600160a01b03909216916000918391630dfe168191600480820192602092909190829003018186803b1580156119ad57600080fd5b505afa1580156119c1573d6000803e3d6000fd5b505050506040513d60208110156119d757600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b0385169163d21220a7916004808301926020929190829003018186803b158015611a1f57600080fd5b505afa158015611a33573d6000803e3d6000fd5b505050506040513d6020811015611a4957600080fd5b505190506000611a5a86600261393a565b90506000611a6887836139a1565b604080516002808252606080830184529394509091602083019080368337505060035482519293506001600160a01b031691839150600090611aa657fe5b6001600160a01b039283166020918202929092010152600354868216911614611c56578481600181518110611ad757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600a60009054906101000a90046001600160a01b03166001600160a01b0316635c11d7958460008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015611b91578181015183820152602001611b79565b505050509050019650505050505050600060405180830381600087803b158015611bba57600080fd5b505af1158015611bce573d6000803e3d6000fd5b5050600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051918916935063095ea7b392506044808201926020929091908290030181600087803b158015611c2957600080fd5b505af1158015611c3d573d6000803e3d6000fd5b505050506040513d6020811015611c5357600080fd5b50505b6003546001600160a01b03858116911614611df8578381600181518110611c7957fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600a60009054906101000a90046001600160a01b03166001600160a01b0316635c11d7958360008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015611d33578181015183820152602001611d1b565b505050509050019650505050505050600060405180830381600087803b158015611d5c57600080fd5b505af1158015611d70573d6000803e3d6000fd5b5050600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051918816935063095ea7b392506044808201926020929091908290030181600087803b158015611dcb57600080fd5b505af1158015611ddf573d6000803e3d6000fd5b505050506040513d6020811015611df557600080fd5b50505b50505050505061161c5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156116f157600080fd5b600054600160a01b900460ff1690565b600d5481565b611e6c336138db565b15611eac576040805162461bcd60e51b815260206004820152601460248201526000805160206140b2833981519152604482015290519081900360640190fd5b333214611eee576040805162461bcd60e51b815260206004820152601a602482015260008051602061417b833981519152604482015290519081900360640190fd5b611ef6611e4d565b15611f3b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6005546004805460408051631c57762b60e31b81529283019190915260006024830181905290516001600160a01b039093169263e2bbb15892604480820193929182900301818387803b158015611f9157600080fd5b505af1158015611fa5573d6000803e3d6000fd5b505050506000611fb36116a6565b90506000611fd26127106109ff600c54856138e190919063ffffffff16565b600254909150611fec906001600160a01b031633836139fe565b611ff682826139a1565b915060008211801561201957506003546002546001600160a01b03908116911614155b1561161457600354600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561207857600080fd5b505af115801561208c573d6000803e3d6000fd5b505050506040513d60208110156120a257600080fd5b505060025460408051630dfe168160e01b815290516001600160a01b03909216916000918391630dfe168191600480820192602092909190829003018186803b1580156120ee57600080fd5b505afa158015612102573d6000803e3d6000fd5b505050506040513d602081101561211857600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b0385169163d21220a7916004808301926020929190829003018186803b15801561216057600080fd5b505afa158015612174573d6000803e3d6000fd5b505050506040513d602081101561218a57600080fd5b50519050600061219b86600261393a565b905060006121a987836139a1565b50505050505061161c611e02565b6121bf613874565b6001600160a01b03166121d0612768565b6001600160a01b031614612219576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b6101f481111561225a5760405162461bcd60e51b81526004018080602001828103825260368152602001806141456036913960400191505060405180910390fd5b600b55565b612267613874565b6001600160a01b0316612278612768565b6001600160a01b0316146122c1576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60055460048054604080516393f1a40b60e01b815292830191909152306024830152805160009384936001600160a01b03909116926393f1a40b92604480840193829003018186803b15801561236057600080fd5b505afa158015612374573d6000803e3d6000fd5b505050506040513d604081101561238a57600080fd5b5051600254604080516370a0823160e01b8152306004820152905192935061089b9284926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156123dd57600080fd5b505afa1580156123f1573d6000803e3d6000fd5b505050506040513d602081101561240757600080fd5b505190613878565b600060075460001461243a576124356007546109ff670de0b6b3a76400006109f961230b565b612444565b670de0b6b3a76400005b905090565b600554600480546040805163df26f69760e01b8152928301919091523060248301525160009283926001600160a01b039091169163df26f69791604480820192602092909190829003018186803b1580156124a357600080fd5b505afa1580156124b7573d6000803e3d6000fd5b505050506040513d60208110156124cd57600080fd5b505190506124dc6108946116a6565b905060006124fb6127106109ff600c54856138e190919063ffffffff16565b9250505090565b61250a613874565b6001600160a01b031661251b612768565b6001600160a01b031614612564576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b61256c611e4d565b156125b1576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6125b9613b7d565b6040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6125ed336138db565b1561262d576040805162461bcd60e51b815260206004820152601460248201526000805160206140b2833981519152604482015290519081900360640190fd5b33321461266f576040805162461bcd60e51b815260206004820152601a602482015260008051602061417b833981519152604482015290519081900360640190fd5b33600090815260066020526040902054612688906108ad565b565b612692613874565b6001600160a01b03166126a3612768565b6001600160a01b0316146126ec576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b6001600160a01b038116612740576040805162461bcd60e51b815260206004820152601660248201527543616e6e6f74206265207a65726f206164647265737360501b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b5481565b6000546001600160a01b031690565b600c5481565b600154600160a01b900460ff16156127d2576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b6001546001600160a01b0316331461281f576040805162461bcd60e51b815260206004820152600b60248201526a4e6f7420666163746f727960a81b604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b179055600280546001600160a01b03808b166001600160a01b03199283168117909355600380548b83169084161790556004899055600d88905560058054888316908416179055600a8054878316908416179055600980549185169190921617905561289e9085600019613c06565b6128a7826136ac565b5050505050505050565b60085481565b6128bf613874565b6001600160a01b03166128d0612768565b6001600160a01b031614612919576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b61019081111561295a5760405162461bcd60e51b81526004018080602001828103825260308152602001806142436030913960400191505060405180910390fd5b600e55565b612967611e4d565b156129ac576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6129b5336138db565b156129f5576040805162461bcd60e51b815260206004820152601460248201526000805160206140b2833981519152604482015290519081900360640190fd5b333214612a37576040805162461bcd60e51b815260206004820152601a602482015260008051602061417b833981519152604482015290519081900360640190fd5b60008111612a81576040805162461bcd60e51b8152602060048201526012602482015271139bdd1a1a5b99c81d1bc819195c1bdcda5d60721b604482015290519081900360640190fd5b6000612a8b61230b565b600254909150612aa6906001600160a01b0316333085613d19565b600d5415612b11576000612acb6127106109ff600d54866138e190919063ffffffff16565b6003546002549192506001600160a01b03918216911614612b0357600954600254612b03916001600160a01b039182169116836139fe565b612b0d83826139a1565b9250505b6000600754600014612b3d57612b36826109ff600754866138e190919063ffffffff16565b9050612b40565b50815b3360009081526006602052604090208054612b5b9083613878565b8155426001820155600754612b709083613878565b6007819055612b8c906109ff612b8461230b565b8454906138e1565b6002820155426003820155612b9f613af8565b60408051858152602081018490524281830152905133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e919081900360600190a250505050565b612bf0336138db565b15612c30576040805162461bcd60e51b815260206004820152601460248201526000805160206140b2833981519152604482015290519081900360640190fd5b333214612c72576040805162461bcd60e51b815260206004820152601a602482015260008051602061417b833981519152604482015290519081900360640190fd5b612c7a611e4d565b15612cbf576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6005546004805460408051631c57762b60e31b81529283019190915260006024830181905290516001600160a01b039093169263e2bbb15892604480820193929182900301818387803b158015612d1557600080fd5b505af1158015612d29573d6000803e3d6000fd5b505050506000612d376116a6565b90506000612d566127106109ff600c54856138e190919063ffffffff16565b600254909150612d70906001600160a01b031633836139fe565b612d7a82826139a1565b9150600082118015612d9d57506003546002546001600160a01b03908116911614155b1561161457600354600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015612dfc57600080fd5b505af1158015612e10573d6000803e3d6000fd5b505050506040513d6020811015612e2657600080fd5b505060025460408051630dfe168160e01b815290516001600160a01b03909216916000918391630dfe168191600480820192602092909190829003018186803b158015612e7257600080fd5b505afa158015612e86573d6000803e3d6000fd5b505050506040513d6020811015612e9c57600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b0385169163d21220a7916004808301926020929190829003018186803b158015612ee457600080fd5b505afa158015612ef8573d6000803e3d6000fd5b505050506040513d6020811015612f0e57600080fd5b505050505061161c611e02565b6101f481565b600a546001600160a01b031681565b61019081565b612f3f336138db565b15612f7f576040805162461bcd60e51b815260206004820152601460248201526000805160206140b2833981519152604482015290519081900360640190fd5b333214612fc1576040805162461bcd60e51b815260206004820152601a602482015260008051602061417b833981519152604482015290519081900360640190fd5b612fc9611e4d565b1561300e576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6005546004805460408051631c57762b60e31b81529283019190915260006024830181905290516001600160a01b039093169263e2bbb15892604480820193929182900301818387803b15801561306457600080fd5b505af1158015613078573d6000803e3d6000fd5b5050505060006130866116a6565b905060006130a56127106109ff600c54856138e190919063ffffffff16565b6002549091506130bf906001600160a01b031633836139fe565b6130c982826139a1565b91506000821180156130ec57506003546002546001600160a01b03908116911614155b1561161457600354600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b15801561314b57600080fd5b505af115801561315f573d6000803e3d6000fd5b505050506040513d602081101561317557600080fd5b505060025460408051630dfe168160e01b815290516001600160a01b03909216916000918391630dfe168191600480820192602092909190829003018186803b1580156131c157600080fd5b505afa1580156131d5573d6000803e3d6000fd5b505050506040513d60208110156131eb57600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b0385169163d21220a7916004808301926020929190829003018186803b15801561323357600080fd5b505afa158015613247573d6000803e3d6000fd5b505050506040513d602081101561325d57600080fd5b50519050600061326e86600261393a565b9050600061327c87836139a1565b604080516002808252606080830184529394509091602083019080368337505060035482519293506001600160a01b0316918391506000906132ba57fe5b6001600160a01b039283166020918202929092010152600354868216911614611df85784816001815181106132eb57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600a60009054906101000a90046001600160a01b03166001600160a01b0316635c11d7958460008430426040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156133a557818101518382015260200161338d565b505050509050019650505050505050600060405180830381600087803b1580156133ce57600080fd5b505af11580156133e2573d6000803e3d6000fd5b5050600a546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051918916935063095ea7b392506044808201926020929091908290030181600087803b158015611dcb57600080fd5b613445613874565b6001600160a01b0316613456612768565b6001600160a01b03161461349f576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b6005546004805460408051632989754760e11b815292830191909152516001600160a01b0390921691635312ea8e9160248082019260009290919082900301818387803b1580156134ef57600080fd5b505af1158015613503573d6000803e3d6000fd5b50505050565b613511613874565b6001600160a01b0316613522612768565b6001600160a01b03161461356b576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b6002546001600160a01b03828116911614156135b85760405162461bcd60e51b81526004018080602001828103825260258152602001806140d26025913960400191505060405180910390fd5b6003546001600160a01b03828116911614156136055760405162461bcd60e51b815260040180806020018281038252602481526020018061403a6024913960400191505060405180910390fd5b6000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561365457600080fd5b505afa158015613668573d6000803e3d6000fd5b505050506040513d602081101561367e57600080fd5b505190506136966001600160a01b03831633836139fe565b5050565b600f5481565b600e5481565b60045481565b6136b4613874565b6001600160a01b03166136c5612768565b6001600160a01b03161461370e576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b6001600160a01b0381166137535760405162461bcd60e51b815260040180806020018281038252602681526020018061405e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6137b6613874565b6001600160a01b03166137c7612768565b6001600160a01b031614613810576040805162461bcd60e51b815260206004820181905260248201526000805160206141bc833981519152604482015290519081900360640190fd5b6101908111156138515760405162461bcd60e51b815260040180806020018281038252602e815260200180614084602e913960400191505060405180910390fd5b600d55565b6005546001600160a01b031681565b6002546001600160a01b031681565b3390565b6000828201838110156138d2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b3b151590565b6000826138f0575060006138d5565b828202828482816138fd57fe5b04146138d25760405162461bcd60e51b815260040180806020018281038252602181526020018061419b6021913960400191505060405180910390fd5b6000808211613990576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161399957fe5b049392505050565b6000828211156139f8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052613a50908490613d6f565b505050565b613a5d611e4d565b613aa5576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa613adb613874565b604080516001600160a01b039092168252519081900360200190a1565b6000613b02611e02565b90508015613b7a576005546004805460408051631c57762b60e31b81529283019190915260248201849052516001600160a01b039092169163e2bbb1589160448082019260009290919082900301818387803b158015613b6157600080fd5b505af1158015613b75573d6000803e3d6000fd5b505050505b50565b613b85611e4d565b15613bca576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613adb613874565b801580613c8c575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015613c5e57600080fd5b505afa158015613c72573d6000803e3d6000fd5b505050506040513d6020811015613c8857600080fd5b5051155b613cc75760405162461bcd60e51b81526004018080602001828103825260368152602001806142736036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052613a50908490613d6f565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526135039085905b6060613dc4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613e209092919063ffffffff16565b805190915015613a5057808060200190516020811015613de357600080fd5b5051613a505760405162461bcd60e51b815260040180806020018281038252602a815260200180614219602a913960400191505060405180910390fd5b6060613e2f8484600085613e39565b90505b9392505050565b606082471015613e7a5760405162461bcd60e51b81526004018080602001828103825260268152602001806140f76026913960400191505060405180910390fd5b613e83856138db565b613ed4576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310613f135780518252601f199092019160209182019101613ef4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613f75576040519150601f19603f3d011682016040523d82523d6000602084013e613f7a565b606091505b5091509150613f8a828286613f95565b979650505050505050565b60608315613fa4575081613e32565b825115613fb45782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613ffe578181015183820152602001613fe6565b50505050905090810190601f16801561402b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe546f6b656e2063616e6e6f742062652073616d652061732072657761726420746f6b656e4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573736465706f7369744665652063616e6e6f74206265206d6f7265207468616e204d41585f4445504f5349545f464545636f6e7472616374206e6f7420616c6c6f776564000000000000000000000000546f6b656e2063616e6e6f742062652073616d65206173206465706f73697420746f6b656e416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c63616c6c4665652063616e6e6f74206265206d6f7265207468616e204d41585f43414c4c5f464545706572666f726d616e63654665652063616e6e6f74206265206d6f7265207468616e204d41585f504552464f524d414e43455f46454570726f787920636f6e7472616374206e6f7420616c6c6f776564000000000000536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65727769746864726177466565506572696f642063616e6e6f74206265206d6f7265207468616e204d41585f57495448445241575f4645455f504552494f445361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656477697468647261774665652063616e6e6f74206265206d6f7265207468616e204d41585f57495448445241575f4645455361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220514e226c2a04e510abbc2cf5a4c17e9dee7ac6651c0b39196fc5fb10a912e86264736f6c634300060c0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading