Contract 0x598ebac38cf211749b1277c9a34d217226a476af

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x45ec0c86f492cf21127803edf0c025ba3cbccfe633d1cdd7b125ddb9e39f5ba0Deposit257115592023-02-01 22:30:2115 mins ago0xcaba2926977dd0680123620b2745a85bad14b816 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.004609622 26.5
0x3baa9b8f596678d8eb7fc12fb64291826a1c0de1698be5c0258f3c35702ed0b9Deposit257115502023-02-01 22:30:0315 mins ago0xcaba2926977dd0680123620b2745a85bad14b816 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005877369475 27.425
0x1d54f552c4a6cd5d74d4a2f6fba9ca5713764708808cf5fa8c5199401f18f233Claim257112892023-02-01 22:21:2923 mins ago0xcaba2926977dd0680123620b2745a85bad14b816 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005138986 26.5
0xc5b4568e0b5d2f82761e9627498cd984ff59301dbffdb9f440ddccf932b4c910Claim257112552023-02-01 22:20:2225 mins ago0x8fd637002898f63054a6ee45ede432ef934b0062 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.004685518 26.5
0x9b5a6e57010c59f53dfdb5094173683eedf862fceb7602dbe2c3ed37ef5d07eeClaim257112222023-02-01 22:19:1426 mins ago0x8fd637002898f63054a6ee45ede432ef934b0062 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.004695366168 26.55389635
0xfdd66d5640e55fba08fcac8ea35e09ff88cc660bba9ecc6bab53cc53075a0041Request Withdraw257090652023-02-01 21:07:441 hr 37 mins ago0xb062e4fa99881f14ecd48b17cf3e8b6c06c8edc6 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.011958975 27
0xf35a0cd424072a3f9c2bcb6f410c170410689f9117f1db9d0445b224ae3c4646Deposit257063212023-02-01 19:40:593 hrs 4 mins ago0xe85e076f1409e23765d5c98591749976ebb799fd IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.00479105231 28.365031115
0x2d70f1879ca9258fd933a29ad6ea850f0362dd004e460e2acbebc7575c72c4ecClaim257062742023-02-01 19:39:323 hrs 5 mins ago0xe85e076f1409e23765d5c98591749976ebb799fd IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005442272829 30.777908143
0x61f30cca21133412d7e24a773690a0394cde29c15edd8e6cad7c70645714191dClaim257057042023-02-01 19:21:343 hrs 23 mins ago0x1bfcb6b1ee66fe339a9dc452359c4c111cc5ffc0 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005138986 26.5
0xcd5e54dd39b9bd9c33367479c6db636187de5343f6d5676c52a202ae1b443f18Claim257024342023-02-01 17:33:045 hrs 12 mins ago0x343d5500298d7b730a81acc17d80fb00a4b21905 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.004685836 26.5
0x75457e1b41a69734cb1406c4757721cf873c5313ccd6d7b0a380be0c4be327afClaim257024142023-02-01 17:32:245 hrs 12 mins ago0x343d5500298d7b730a81acc17d80fb00a4b21905 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.004685518 26.5
0x0107500f80a557b7d81fc0b882492c0e7b3ab3bda89d0e4f2ca8a5ec5323488eClaim257015112023-02-01 17:02:155 hrs 43 mins ago0x2b185c762f6fb49a07116ec06b238b58fe2bec53 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.004774248 27
0x9dbe29293f90d0444eca6434183f27f948f8340e61c5f1217690006fe7b8987bClaim257011432023-02-01 16:50:035 hrs 55 mins ago0x9049e18574e1ebe1d718d61a4308c0b843dfa2ec IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005138668 26.5
0xcdb621c277951289bb8fd532425787d510c5f31fc7f196e9bfe3e0b40b1c4e93Deposit257005092023-02-01 16:28:506 hrs 16 mins ago0x49bc81ea7783153e34ed5e823206f3dc45e20ca6 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.0052263035 26.5
0x6737098a661dddc5e62b7b45b79cf95aa8867995ff6bded4a022d672ee4ab04dClaim256995002023-02-01 15:54:566 hrs 50 mins ago0x4fbe24863c408324b8598c86f1cdaa08965764fd IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.00470386409 26.601955
0x6dbd18758925c193d324d4c31413f38211f368f0bfe2ba27c4ea54a0a3a41887Claim256993332023-02-01 15:49:236 hrs 56 mins ago0x5c72dfe4e7521ff41d4644d1b0022ebd5ea411d8 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005718642453 29.489090846
0xae1829a2d28f699903822d54aa2a4efb696d51d332481844190cf97d9296430eClaim256981342023-02-01 15:09:547 hrs 35 mins ago0xd3d01518d10022c14a9662015c283c4702a20746 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.0053329127.5
0x194c882ed1ac26d55bf665d667835b2cf7cde5fcf670832a10a5bb69c8987e64Claim256977202023-02-01 14:56:047 hrs 49 mins ago0x041fc0ba13e01925df08966996d4faad03a6a8f5 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005138986 26.5
0x73b8f184581901645feff26aabea907a1691c2dd238f43e97604083904213c08Claim256960702023-02-01 14:01:038 hrs 44 mins ago0xa9efdc366ec338a2c1e4e1014bbd5fa0ab5c4131 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005138986 26.5
0xa51a14423851f41cecf061c55e19aa3d2213869dc6db5110a33cbffa0594ab44Request Withdraw256944112023-02-01 13:05:389 hrs 39 mins ago0x76b32f589904e78af65b773561133446c77bb70d IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.011255082875 27.425
0xcc3d5b8603e17f985cdd06d61118b8951e0079e228fca7a75da73d19f1ea377cDeposit256943782023-02-01 13:04:319 hrs 40 mins ago0x76b32f589904e78af65b773561133446c77bb70d IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.00552674093 27.35225
0x8beb271a4466ccba561676846fdb6c4561f8d9d2225c9d23b8ae8f3364e6546bClaim256902052023-02-01 10:44:5112 hrs ago0x8e0a4f4b5f7df88cbb3883cc915fc2480cea2f77 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.005138668 26.5
0x6f1cb6891de7d9548fa6f01252254a327e20fed5638de2f49e04cd0d64c89feeClaim256893272023-02-01 10:15:3312 hrs 29 mins ago0x01f9d7b596beec17f328e288394098b79cd77336 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.0048626627.5
0x6df23708ffe6aab4681a301340eb7393cbe10ac961e52cb3bfa4f288418e14a5Claim256893202023-02-01 10:15:1812 hrs 30 mins ago0x01f9d7b596beec17f328e288394098b79cd77336 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.0048623327.5
0xfb7fe7dd1cd352ea4179701c6d762827c38facc375fe6d703fcc122b4ab737e9Claim256872632023-02-01 9:06:3313 hrs 38 mins ago0xff8fd621a848ca882b57e492303e033d5213a124 IN  0x598ebac38cf211749b1277c9a34d217226a476af0 AVAX0.004685518 26.5
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x4dde4331eabc68e0af662c8ccfebc85974a9f4e78406105f5121a3be7fc19d92107581672022-02-11 1:05:28355 days 21 hrs ago 0x45f20b41eef20edcf67a3884519cedc2dd59da1f  Contract Creation0 AVAX
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Farming

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 11 : Farming.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

import "../interfaces/staking/IFarming.sol";
import "../interfaces/staking/ITokenLocker.sol";
import "../interfaces/staking/IFarmingFactory.sol";

/** @title Farming
 *
 * @notice Contract that distribute rewards to multiple pools based on allocation point ratio
 *
 */
contract Farming is Ownable, ReentrancyGuard, IFarming, Pausable {
    using SafeERC20 for IERC20;

    struct UserInfo {
        uint256 amount; // amount of tokens deposited by the user
        uint256 rewardDebt; // amount to be cut off in rewards calculation - updated when deposit, withdraw or claim
        uint256 pendingRewards; // pending rewards for the user
    }

    struct PoolInfo {
        IERC20 lpToken;
        uint256 allocPoint; // allocation point for the pool for rewards distribution
        uint256 accTokenPerShare; // accumulative rewards per deposited token
        uint256 lockupDuration;
    }

    IFarmingFactory public factory;
    address public token;

    uint256 public totalDistributed;
    uint256 public totalReleased;

    PoolInfo[] public poolInfo;
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;
    uint256 public totalAllocPoint = 0; // sum of pools' allocation points

    uint256 public constant SHARE_MULTIPLIER = 1e12;

    mapping(address => bool) private isLPPoolAdded; // lp token already added flag

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event RequestWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event Claim(address indexed user, uint256 indexed pid, uint256 amount);
    event PoolAdded(uint256 pid, uint256 allocPoint, uint256 lockupDuration, address lp);
    event PoolLockDurationChanged(uint256 pid, uint256 lockupDuration);
    event Pause();
    event Unpause();

    modifier validatePoolByPid(uint256 _pid) {
        require(_pid < poolInfo.length, "Pool does not exist");
        _;
    }

    constructor(IFarmingFactory _factory, address _token) {
        require(address(_factory) != address(0), "Invalid factory!");
        require(address(_token) != address(0), "Invalid token");

        factory = _factory;
        token = _token;
    }

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    // balance of the contract includes already distributed and not distributed amounts
    function getTotalDistributableRewards() public view returns (uint256) {
        // (totalDistributed - totalReleased) is the sum of members' pending amounts
        return IERC20(token).balanceOf(address(this)) + totalReleased - totalDistributed;
    }

    // accumulative rewards for deposited amount
    function accumulativeRewards(uint256 amount, uint256 _accTokenPerShare) internal pure returns (uint256) {
        return (amount * _accTokenPerShare) / (SHARE_MULTIPLIER);
    }

    function pendingToken(uint256 _pid, address _user) external view validatePoolByPid(_pid) returns (uint256) {
        require(_user != address(0), "Invalid address!");

        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accTokenPerShare = pool.accTokenPerShare;
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (lpSupply != 0) {
            uint256 tokenReward = (getTotalDistributableRewards() * (pool.allocPoint)) / (totalAllocPoint);
            accTokenPerShare += (tokenReward * (SHARE_MULTIPLIER)) / (lpSupply);
        }

        // last_accumulated_reward is expressed as rewardDebt
        // accumulated_rewards - last_accumulated_reward + last_pending_rewards
        return accumulativeRewards(user.amount, accTokenPerShare) - user.rewardDebt + user.pendingRewards;
    }

    // update all pools' accumulative rewards per share
    function massUpdatePools() public {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            _updatePool(pid);
        }

        totalDistributed += getTotalDistributableRewards();
    }

    // update pool's accumulative rewards per share by id
    function _updatePool(uint256 _pid) internal validatePoolByPid(_pid) {
        PoolInfo storage pool = poolInfo[_pid];

        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (lpSupply == 0) {
            return;
        }

        uint256 tokenReward = (getTotalDistributableRewards() * pool.allocPoint) / totalAllocPoint;
        // accTokenPerShare is by definition accumulation of token rewards per staked token
        pool.accTokenPerShare += (tokenReward * (SHARE_MULTIPLIER)) / (lpSupply);
    }

    function _updateUserPendingRewards(uint256 _pid, address addr) internal {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][addr];
        if (user.amount == 0) {
            return;
        }

        user.pendingRewards += accumulativeRewards(user.amount, pool.accTokenPerShare) - user.rewardDebt;
    }

    function deposit(
        uint256 _pid,
        uint256 _amount,
        bool _withdrawRewards
    ) public validatePoolByPid(_pid) whenNotPaused nonReentrant {
        require(_amount > 0, "amount should be positive");

        massUpdatePools();
        _updateUserPendingRewards(_pid, msg.sender);

        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        if (_withdrawRewards) {
            processReward(user, _pid);
        }
        pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);
        user.amount += _amount;
        // last_accumulated_reward is expressed as rewardDebt
        user.rewardDebt = accumulativeRewards(user.amount, pool.accTokenPerShare);
        emit Deposit(msg.sender, _pid, _amount);
    }

    function requestWithdraw(
        uint256 _pid,
        uint256 _amount,
        bool _withdrawRewards
    ) public nonReentrant validatePoolByPid(_pid) whenNotPaused {
        massUpdatePools();
        _updateUserPendingRewards(_pid, msg.sender);

        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "withdraw: should withdraw less than balance");
        require(_amount > 0, "withdraw: amount should be positive");
        if (_withdrawRewards) {
            processReward(user, _pid);
        }

        address tokenLocker = factory.tokenLocker();
        pool.lpToken.approve(tokenLocker, _amount);
        ITokenLocker(tokenLocker).lockToken(
            address(pool.lpToken),
            msg.sender,
            _amount,
            block.timestamp + pool.lockupDuration
        );
        user.amount -= _amount;
        // last_accumulated_reward is expressed as rewardDebt
        user.rewardDebt = accumulativeRewards(user.amount, pool.accTokenPerShare);
        emit RequestWithdraw(msg.sender, _pid, _amount);
    }

    function processReward(UserInfo storage user, uint256 _pid) private {
        uint256 amount = safeTokenTransfer(msg.sender, user.pendingRewards);

        emit Claim(msg.sender, _pid, amount);
        user.pendingRewards = user.pendingRewards - amount;

        totalReleased += amount;
    }

    function claim(uint256 _pid) public nonReentrant validatePoolByPid(_pid) whenNotPaused {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        massUpdatePools();
        _updateUserPendingRewards(_pid, msg.sender);
        processReward(user, _pid);
        // last_accumulated_reward is expressed as rewardDebt
        user.rewardDebt = accumulativeRewards(user.amount, pool.accTokenPerShare);
    }

    function safeTokenTransfer(address _to, uint256 _amount) internal returns (uint256) {
        uint256 tokenBal = IERC20(token).balanceOf(address(this));
        if (_amount > tokenBal) {
            IERC20(token).safeTransfer(_to, tokenBal);
            return tokenBal;
        } else {
            IERC20(token).safeTransfer(_to, _amount);
            return _amount;
        }
    }

    function getDepositAmount(address user, uint256 _pid)
        external
        view
        override
        validatePoolByPid(_pid)
        returns (uint256)
    {
        return userInfo[_pid][user].amount;
    }

    function withdrawAnyToken(IERC20 _token, uint256 amount) external onlyOwner {
        _token.safeTransfer(msg.sender, amount);
    }

    function updatePoolDuration(uint256 _pid, uint256 _lockupDuration) external onlyOwner validatePoolByPid(_pid) {
        poolInfo[_pid].lockupDuration = _lockupDuration;

        emit PoolLockDurationChanged(_pid, _lockupDuration);
    }

    function addPool(
        uint256 _allocPoint,
        IERC20 _lpToken,
        bool _withUpdate
    ) public onlyOwner {
        require(!isLPPoolAdded[address(_lpToken)], "There's already a pool with that LP token!");
        // Note: it is designed to support when staking token is different from reward token
        require(address(_lpToken) != token, "Staking token should be different from reward token");
        require(address(_lpToken) != address(0), "Invalid lp");
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint += _allocPoint;
        uint256 lockupDuration = 14 days;
        poolInfo.push(
            PoolInfo({
                lpToken: _lpToken,
                allocPoint: _allocPoint,
                accTokenPerShare: 0,
                lockupDuration: lockupDuration
            })
        );

        isLPPoolAdded[address(_lpToken)] = true;

        emit PoolAdded(poolInfo.length - 1, _allocPoint, lockupDuration, address(_lpToken));
    }

    function setPool(
        uint256 _pid,
        uint256 _allocPoint,
        bool _withUpdate
    ) public onlyOwner validatePoolByPid(_pid) {
        if (_withUpdate) {
            massUpdatePools();
        }
        totalAllocPoint = totalAllocPoint - (poolInfo[_pid].allocPoint) + (_allocPoint);
        poolInfo[_pid].allocPoint = _allocPoint;
    }

    /**
     * @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();
    }
}

File 2 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 3 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 4 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^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() {
        _transferOwnership(_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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 6 of 11 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

File 7 of 11 : IFarming.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IFarming {
    function getDepositAmount(address user, uint256 _pid) external view returns (uint256);
}

File 8 of 11 : ITokenLocker.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/** @title ITokenLocker
 * @notice
 */

interface ITokenLocker {
    function lockToken(
        address token,
        address beneficiary,
        uint256 amount,
        uint256 unlockTime
    ) external;
}

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

pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IFarmingFactory {
    function tokenLocker() external view returns (address);
}

File 10 of 11 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 11 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

Contract ABI

[{"inputs":[{"internalType":"contract IFarmingFactory","name":"_factory","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","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":false,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockupDuration","type":"uint256"},{"indexed":false,"internalType":"address","name":"lp","type":"address"}],"name":"PoolAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockupDuration","type":"uint256"}],"name":"PoolLockDurationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RequestWithdraw","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"SHARE_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_withdrawRewards","type":"bool"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"contract IFarmingFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"getDepositAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalDistributableRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"accTokenPerShare","type":"uint256"},{"internalType":"uint256","name":"lockupDuration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_withdrawRewards","type":"bool"}],"name":"requestWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReleased","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":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_lockupDuration","type":"uint256"}],"name":"updatePoolDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"pendingRewards","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawAnyToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260006008553480156200001657600080fd5b506040516200257538038062002575833981016040819052620000399162000175565b620000443362000125565b600180556002805460ff191690556001600160a01b038216620000a15760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420666163746f72792160801b60448201526064015b60405180910390fd5b6001600160a01b038116620000e95760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b604482015260640162000098565b60028054610100600160a81b0319166101006001600160a01b0394851602179055600380546001600160a01b03191691909216179055620001cc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806040838503121562000188578182fd5b82516200019581620001b3565b6020840151909250620001a881620001b3565b809150509250929050565b6001600160a01b0381168114620001c957600080fd5b50565b61239980620001dc6000396000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c8063795af039116100ee578063c45a015511610097578063e33b7de311610071578063e33b7de314610399578063efca2eed146103a2578063f2fde38b146103ab578063fc0c546a146103be576101ae565b8063c45a01551461035b578063d02bf22f14610373578063e02c499d14610386576101ae565b806387a35382116100c857806387a35382146102ce5780638da5cb5b146102e157806393f1a40b14610306576101ae565b8063795af039146102a05780637abceffd146102b35780638456cb59146102c6576101ae565b806342868c281161015b57806348e43af41161013557806348e43af4146102675780635c975abb1461027a578063630b5ba114610290578063715018a614610298576101ae565b806342868c281461023957806343a0d0661461024157806346ca6bea14610254576101ae565b8063291c3f791161018c578063291c3f7914610210578063379607f51461021c5780633f4ba83a14610231576101ae565b8063081e3eda146101b35780631526fe27146101ca57806317caf6f114610207575b600080fd5b6006545b6040519081526020015b60405180910390f35b6101dd6101d8366004612161565b6103d1565b604080516001600160a01b03909516855260208501939093529183015260608201526080016101c1565b6101b760085481565b6101b764e8d4a5100081565b61022f61022a366004612161565b610415565b005b61022f610587565b6101b7610666565b61022f61024f366004612222565b610706565b61022f610262366004612222565b610930565b6101b7610275366004612191565b610a6f565b60025460ff1660405190151581526020016101c1565b61022f610c71565b61022f610cba565b61022f6102ae366004612201565b610d20565b61022f6102c13660046121c0565b610e41565b61022f6111a1565b61022f6102dc36600461214f565b611274565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101c1565b610340610314366004612191565b600760209081526000928352604080842090915290825290208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101c1565b6002546102ee9061010090046001600160a01b031681565b6101b7610381366004612108565b6112e6565b61022f610394366004612222565b61135b565b6101b760055481565b6101b760045481565b61022f6103b93660046120d0565b6117b3565b6003546102ee906001600160a01b031681565b600681815481106103e157600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169350919084565b6002600154141561046d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600155600654819081106104bb5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610464565b60025460ff16156105015760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610464565b60006006838154811061052457634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600782526040808520338652909252922060049091029091019150610554610c71565b61055e8433611895565b6105688185611935565b61057a816000015483600201546119bf565b6001918201558055505050565b6000546001600160a01b031633146105e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610464565b60025460ff166106335760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610464565b61063b6119e4565b6040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600480546005546003546040516370a0823160e01b815230948101949094526000936001600160a01b03909116906370a082319060240160206040518083038186803b1580156106b557600080fd5b505afa1580156106c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ed9190612179565b6106f7919061229e565b61070191906122f5565b905090565b6006548390811061074f5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610464565b60025460ff16156107955760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610464565b600260015414156107e85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610464565b60026001558261083a5760405162461bcd60e51b815260206004820152601960248201527f616d6f756e742073686f756c6420626520706f736974697665000000000000006044820152606401610464565b610842610c71565b61084c8433611895565b60006006858154811061086f57634e487b7160e01b600052603260045260246000fd5b6000918252602080832088845260078252604080852033865290925292206004909102909101915083156108a7576108a78187611935565b81546108be906001600160a01b0316333088611a80565b848160000160008282546108d2919061229e565b9091555050805460028301546108e891906119bf565b6001820155604051858152869033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a350506001805550505050565b6000546001600160a01b0316331461098a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610464565b600654839081106109d35760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610464565b81156109e1576109e1610c71565b8260068581548110610a0357634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160010154600854610a2291906122f5565b610a2c919061229e565b6008819055508260068581548110610a5457634e487b7160e01b600052603260045260246000fd5b90600052602060002090600402016001018190555050505050565b60065460009083908110610abb5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610464565b6001600160a01b038316610b115760405162461bcd60e51b815260206004820152601060248201527f496e76616c6964206164647265737321000000000000000000000000000000006044820152606401610464565b600060068581548110610b3457634e487b7160e01b600052603260045260246000fd5b600091825260208083208884526007825260408085206001600160a01b038a81168752935280852060049485029092016002810154815492516370a0823160e01b8152309681019690965290965091949193919216906370a082319060240160206040518083038186803b158015610bab57600080fd5b505afa158015610bbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be39190612179565b90508015610c3b5760006008548560010154610bfd610666565b610c0791906122d6565b610c1191906122b6565b905081610c2364e8d4a51000836122d6565b610c2d91906122b6565b610c37908461229e565b9250505b600283015460018401548454610c5190856119bf565b610c5b91906122f5565b610c65919061229e565b98975050505050505050565b60065460005b81811015610c9857610c8881611b1e565b610c9181612338565b9050610c77565b50610ca1610666565b60046000828254610cb2919061229e565b909155505050565b6000546001600160a01b03163314610d145760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610464565b610d1e6000611c85565b565b6000546001600160a01b03163314610d7a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610464565b60065482908110610dc35760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610464565b8160068481548110610de557634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201600301819055507f4bd832da909427f335ae5fa586bb7b1f69cdd865999e5d9b85f4c9a1aafecce38383604051610e34929190918252602082015260400190565b60405180910390a1505050565b6000546001600160a01b03163314610e9b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610464565b6001600160a01b03821660009081526009602052604090205460ff1615610f2a5760405162461bcd60e51b815260206004820152602a60248201527f5468657265277320616c7265616479206120706f6f6c2077697468207468617460448201527f204c5020746f6b656e21000000000000000000000000000000000000000000006064820152608401610464565b6003546001600160a01b0383811691161415610fae5760405162461bcd60e51b815260206004820152603360248201527f5374616b696e6720746f6b656e2073686f756c6420626520646966666572656e60448201527f742066726f6d2072657761726420746f6b656e000000000000000000000000006064820152608401610464565b6001600160a01b0382166110045760405162461bcd60e51b815260206004820152600a60248201527f496e76616c6964206c70000000000000000000000000000000000000000000006044820152606401610464565b801561101257611012610c71565b8260086000828254611024919061229e565b9091555050604080516080810182526001600160a01b0384811680835260208084018881526000858701818152621275006060880181815260068054600180820183558287529a517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f6004909202918201805473ffffffffffffffffffffffffffffffffffffffff191691909b161790995594517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4089015591517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d4188015590517ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d42909601959095559283526009909152939020805460ff19168317905591547f6b62e2a4361b4ec557bae6ad4ec355efa8c881160803373408ccdb4c918473db9161116e916122f5565b604080519182526020820187905281018390526001600160a01b038516606082015260800160405180910390a150505050565b6000546001600160a01b031633146111fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610464565b60025460ff16156112415760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610464565b611249611ce2565b6040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b6000546001600160a01b031633146112ce5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610464565b6112e26001600160a01b0383163383611d5d565b5050565b600654600090829081106113325760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610464565b505060009081526007602090815260408083206001600160a01b03949094168352929052205490565b600260015414156113ae5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610464565b6002600155600654839081106113fc5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610464565b60025460ff16156114425760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610464565b61144a610c71565b6114548433611895565b60006006858154811061147757634e487b7160e01b600052603260045260246000fd5b6000918252602080832088845260078252604080852033865290925292208054600490920290920192508511156115165760405162461bcd60e51b815260206004820152602b60248201527f77697468647261773a2073686f756c64207769746864726177206c657373207460448201527f68616e2062616c616e63650000000000000000000000000000000000000000006064820152608401610464565b600085116115725760405162461bcd60e51b815260206004820152602360248201527f77697468647261773a20616d6f756e742073686f756c6420626520706f73697460448201526269766560e81b6064820152608401610464565b8315611582576115828187611935565b6000600260019054906101000a90046001600160a01b03166001600160a01b031663a80bf3e66040518163ffffffff1660e01b815260040160206040518083038186803b1580156115d257600080fd5b505afa1580156115e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160a91906120ec565b835460405163095ea7b360e01b81526001600160a01b038084166004830152602482018a905292935091169063095ea7b390604401602060405180830381600087803b15801561165957600080fd5b505af115801561166d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116919190612133565b50825460038401546001600160a01b038084169263e4ddc77c9291169033908a906116bc904261229e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b1681526001600160a01b03948516600482015293909216602484015260448301526064820152608401600060405180830381600087803b15801561172857600080fd5b505af115801561173c573d6000803e3d6000fd5b505050508582600001600082825461175491906122f5565b90915550508154600284015461176a91906119bf565b6001830155604051868152879033907febeaa8785285a4f7c37a305351997dceebabc3c357dab98023dc37514a1b6ed69060200160405180910390a35050600180555050505050565b6000546001600160a01b0316331461180d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610464565b6001600160a01b0381166118895760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610464565b61189281611c85565b50565b6000600683815481106118b857634e487b7160e01b600052603260045260246000fd5b600091825260208083208684526007825260408085206001600160a01b038816865290925292208054600490920290920192506118f65750506112e2565b806001015461190d826000015484600201546119bf565b61191791906122f5565b81600201600082825461192a919061229e565b909155505050505050565b6000611945338460020154611d92565b905081336001600160a01b03167f34fcbac0073d7c3d388e51312faf357774904998eeb8fca628b9e6f65ee1cbf78360405161198391815260200190565b60405180910390a380836002015461199b91906122f5565b836002018190555080600560008282546119b5919061229e565b9091555050505050565b600064e8d4a510006119d183856122d6565b6119db91906122b6565b90505b92915050565b60025460ff16611a365760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610464565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6040516001600160a01b0380851660248301528316604482015260648101829052611b189085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611e5a565b50505050565b60065481908110611b675760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610464565b600060068381548110611b8a57634e487b7160e01b600052603260045260246000fd5b60009182526020822060049182020180546040516370a0823160e01b815230938101939093529093506001600160a01b0316906370a082319060240160206040518083038186803b158015611bde57600080fd5b505afa158015611bf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c169190612179565b905080611c245750506112e2565b60006008548360010154611c36610666565b611c4091906122d6565b611c4a91906122b6565b905081611c5c64e8d4a51000836122d6565b611c6691906122b6565b836002016000828254611c79919061229e565b90915550505050505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60025460ff1615611d285760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610464565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611a633390565b6040516001600160a01b038316602482015260448101829052611d8d90849063a9059cbb60e01b90606401611ab4565b505050565b6003546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a082319060240160206040518083038186803b158015611dda57600080fd5b505afa158015611dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e129190612179565b905080831115611e3a57600354611e33906001600160a01b03168583611d5d565b90506119de565b600354611e51906001600160a01b03168585611d5d565b829150506119de565b6000611eaf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f3f9092919063ffffffff16565b805190915015611d8d5780806020019051810190611ecd9190612133565b611d8d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610464565b6060611f4e8484600085611f58565b90505b9392505050565b606082471015611fd05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610464565b843b61201e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610464565b600080866001600160a01b0316858760405161203a919061224f565b60006040518083038185875af1925050503d8060008114612077576040519150601f19603f3d011682016040523d82523d6000602084013e61207c565b606091505b509150915061208c828286612097565b979650505050505050565b606083156120a6575081611f51565b8251156120b65782518084602001fd5b8160405162461bcd60e51b8152600401610464919061226b565b6000602082840312156120e1578081fd5b8135611f5181612369565b6000602082840312156120fd578081fd5b8151611f5181612369565b6000806040838503121561211a578081fd5b823561212581612369565b946020939093013593505050565b600060208284031215612144578081fd5b8151611f518161237e565b6000806040838503121561211a578182fd5b600060208284031215612172578081fd5b5035919050565b60006020828403121561218a578081fd5b5051919050565b600080604083850312156121a3578182fd5b8235915060208301356121b581612369565b809150509250929050565b6000806000606084860312156121d4578081fd5b8335925060208401356121e681612369565b915060408401356121f68161237e565b809150509250925092565b60008060408385031215612213578182fd5b50508035926020909101359150565b600080600060608486031215612236578283fd5b833592506020840135915060408401356121f68161237e565b6000825161226181846020870161230c565b9190910192915050565b600060208252825180602084015261228a81604085016020870161230c565b601f01601f19169190910160400192915050565b600082198211156122b1576122b1612353565b500190565b6000826122d157634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156122f0576122f0612353565b500290565b60008282101561230757612307612353565b500390565b60005b8381101561232757818101518382015260200161230f565b83811115611b185750506000910152565b600060001982141561234c5761234c612353565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461189257600080fd5b801515811461189257600080fdfea164736f6c6343000802000a00000000000000000000000045f20b41eef20edcf67a3884519cedc2dd59da1f00000000000000000000000000ee200df31b869a321b10400da10b561f3ee60d

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

00000000000000000000000045f20b41eef20edcf67a3884519cedc2dd59da1f00000000000000000000000000ee200df31b869a321b10400da10b561f3ee60d

-----Decoded View---------------
Arg [0] : _factory (address): 0x45f20b41eef20edcf67a3884519cedc2dd59da1f
Arg [1] : _token (address): 0x00ee200df31b869a321b10400da10b561f3ee60d

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000045f20b41eef20edcf67a3884519cedc2dd59da1f
Arg [1] : 00000000000000000000000000ee200df31b869a321b10400da10b561f3ee60d


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