Contract 0xe713DaAa96035982bf01F041c2BB248B5E07882a 1

 

Contract Overview

Balance:
0 MATIC

MATIC Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xfd2a8872cae847c7bcd06852035c3b1eb0751098796f888318b18ed0a8a050beWithdraw336629782022-09-28 7:44:488 days 7 hrs ago0x7036bb83d9425ca6dc35dce7b2a70439b30e0a50 IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.006976080009 30.000000039
0x565cae92c32c6a8bcb680a7821037c3b2caa8a93596b283a7b4974875e107e22Deposit331433672022-09-15 16:28:3920 days 22 hrs ago0x4ad3a0b9c6ee746908ef304992d801eb8e8ffcfb IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008644137147 30.345105676
0x846070f36be8f3a603eced74d045c969c219beb8eb430785861761685ce969f8Deposit331433642022-09-15 16:28:3320 days 22 hrs ago0x4ad3a0b9c6ee746908ef304992d801eb8e8ffcfb IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008659949252 30.400613818
0xa62df16f1cbbaa165d546b1ac5a8ecc3496dbb49f8737218e2ba6e1d43e8f8a9Deposit331433562022-09-15 16:28:1320 days 22 hrs ago0x4ad3a0b9c6ee746908ef304992d801eb8e8ffcfb IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.010615619982 34.000339447
0xae16b324e1ff3fe60dc36ae2ccca0b7d36a58d6b017ac142f327bef20f8b4e8aDeposit328806802022-09-09 8:39:0127 days 6 hrs ago0x7036bb83d9425ca6dc35dce7b2a70439b30e0a50 IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.01120721316 37.830000002
0x7f56068e313edc948f7db8c492ff248ca8db5f3ab10865fe0c9f96e0540cafcfDeposit328486572022-09-08 14:06:1228 days 52 mins ago0xd1f48eef1cb50bead33f3825cbdcfc403e5e29c7 IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.004971477045 38.948598781
0xda4c2ac7ba9411cd2c970a883757208ad7055ac82d5f10a25dac373b357f853bWithdraw326390862022-09-03 12:53:3533 days 2 hrs ago0x003873fc1ea728a8553f46b1f516effa6336f61f IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.0683150550
0xa80480e1171347648e73afa5dc155ae150f486f67138e29499f928a79a03c28aUpdate Pool Allo...322678672022-08-24 12:50:0843 days 2 hrs ago0x820de2eb0ee8007ee237e02ace3bf2b9cd0ddf1a IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.013776423409 30.007652869
0x81d73ff60e966737a7f1b3c43265e601019fa611f6417cfdb31aa545f669d075Update Pool Allo...322678632022-08-24 12:50:0043 days 2 hrs ago0x820de2eb0ee8007ee237e02ace3bf2b9cd0ddf1a IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.013862328755 30.008548089
0xddc199c5ce05eded32fdeed155617dcbce34dfd233f5999d6b07f4587e63ea72Deposit322157302022-08-23 4:05:0944 days 10 hrs ago0x003873fc1ea728a8553f46b1f516effa6336f61f IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.01300920833341.666666666
0xd1561692b92668fc331f135694dd87c0b52c249e4195cd5293c9a482a4eb58c0Deposit316451822022-08-08 4:16:2559 days 10 hrs ago0x003873fc1ea728a8553f46b1f516effa6336f61f IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.005815688349 30.069999998
0xc152ad747d98db1e6364b47476ce5cf27b34c7aa87016282b9a1817aafe04809Withdraw316332412022-08-07 19:18:2259 days 19 hrs ago0x8db7a537d8478df3c6d95ff33b4270342862957f IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.103188428532 32.010000069
0xa670d30deebcec263973deb789187423c2bc5746215cef4c4045664bfb7ed0efDeposit316245602022-08-07 13:17:5560 days 1 hr ago0xf05f5d4ad1b3fd5ad57ba5ca386d0db2e8b317aa IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008545830003 30.000000014
0xe34135c0d144bd8aa988fe27d87c21a5b549d6ef73993b085f54058d6f4548d9Deposit316245472022-08-07 13:17:2960 days 1 hr ago0xf05f5d4ad1b3fd5ad57ba5ca386d0db2e8b317aa IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008477460003 30.000000013
0xd0b071ea8ae02379f944b5923a0681812748d52fe2e093b63d18a9d11c22e494Deposit316245392022-08-07 13:17:1360 days 1 hr ago0xf05f5d4ad1b3fd5ad57ba5ca386d0db2e8b317aa IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008477460003 30.000000013
0xb0345b40dfdaa29fcc21645e2948b68545e45f296780f7f8a03e967dac39ac6aDeposit316245292022-08-07 13:16:5360 days 1 hr ago0xf05f5d4ad1b3fd5ad57ba5ca386d0db2e8b317aa IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008545830004 30.000000015
0x630fbac8ac25eddfffa997f3f020d968fbfa77de79a8ee2cf71a4b2f64b3075bDeposit316245122022-08-07 13:16:1960 days 1 hr ago0xf05f5d4ad1b3fd5ad57ba5ca386d0db2e8b317aa IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008545830004 30.000000015
0x9b7b780f30192ccc14324dcf3a5a78dc918f5945a8768ef2d5f9fdc219624b62Deposit315251502022-08-04 21:46:0162 days 17 hrs ago0x8db7a537d8478df3c6d95ff33b4270342862957f IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.01041320385 33.352029012
0xd350b5a3514b894d6f9615ef74b8f8dcdacd937eb0bca1ba9b03731fcca6b96bUpdate Pool Allo...315246022022-08-04 21:25:0162 days 17 hrs ago0x820de2eb0ee8007ee237e02ace3bf2b9cd0ddf1a IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.013943850005 30.000000012
0x587f1f051117b6bef8b2de620d6e916ed22f4ab859f442de72d7e3235a219ab4Deposit314910862022-08-04 0:15:5963 days 14 hrs ago0x4ad3a0b9c6ee746908ef304992d801eb8e8ffcfb IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008593402376 30.16700207
0x17a487b58f2b06c498d5f81148ab3d37772918413564e86a25ee1985efc1983eDeposit314910822022-08-04 0:15:4363 days 14 hrs ago0x4ad3a0b9c6ee746908ef304992d801eb8e8ffcfb IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008545834828 30.000016949
0x90efa6e16515b00311a44bf57678637a71015d7dc157bdc7b652ee3e277247a4Deposit314910752022-08-04 0:15:1563 days 14 hrs ago0x4ad3a0b9c6ee746908ef304992d801eb8e8ffcfb IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.008956234254 30.000014251
0xdcb7a3f908129e41b53faf3af87d698983fdec9ba7e0af0a2f74b698740376f0Withdraw314647392022-08-03 7:45:5864 days 7 hrs ago0xf05f5d4ad1b3fd5ad57ba5ca386d0db2e8b317aa IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.020974822834 31.005736789
0x30a9ae2d1376dd9bf249dbfd1197bcd467b2016e53fd9bd7131f96092df27e89Withdraw314023582022-08-01 17:54:5065 days 21 hrs ago0xf05f5d4ad1b3fd5ad57ba5ca386d0db2e8b317aa IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.01184653474 34.9500665
0xb995452591a9e8be2c3b16971fd07e2a60bf97746698539ea421c69e0defdd35Update Pool Allo...313937632022-08-01 12:46:1766 days 2 hrs ago0x820de2eb0ee8007ee237e02ace3bf2b9cd0ddf1a IN  0xe713daaa96035982bf01f041c2bb248b5e07882a0 MATIC0.015873099012 33.000000025
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Farm

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 16 : Farm.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "interfaces/IRewardManager.sol";
import "interfaces/IFYGN.sol";
import "interfaces/IStrategy.sol";

// Farm is the major distributor of FYGN to the community. He gives juicy FYGN rewards as per user's stake.
//
// Note that it's ownable and the owner wields tremendous power. The ownership
// will be transferred to a governance smart contract once FYGN is sufficiently
// distributed and the community can show to govern itself.
//
// Have fun reading it. Hopefully it's bug-free. God bless.
contract Farm is Ownable, ReentrancyGuard, Pausable {
    using SafeMath for uint256;
    using SafeMath for uint16;
    using SafeERC20 for IERC20;
    using Address for address;

    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        uint256 rewardLockedUp; // Reward locked up.
        uint256 nextHarvestUntil; // When can the user harvest again.
        //
        // We do some fancy math here. Basically, any point in time, the amount of FYGNs
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accfYGNPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accfYGNPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }

    // Info of each pool.
    struct PoolInfo {
        IERC20 lpToken; // Address of LP token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. fYGNs to distribute per block.
        uint256 lastRewardBlock; // Last block number that fYGNs distribution occurs.
        uint256 accfYGNPerShare; // Accumulated fYGNs per share, times 1e12. See below.
        uint16 withdrawalFeeBP; // Deposit fee in basis points
        uint256 harvestInterval; // Harvest interval in seconds
        uint256 totalInputTokensStaked; //Total input tokens staked
        IStrategy strategy; //strategy address
    }

    IFYGN public fYGN; // The fYGN TOKEN!
    uint256 public fYGNPerBlock; // FYGN tokens minted per block.
    address public ygnConverter; // YGN Converter address
    uint256 public startBlock; // The block number when fYGN minting starts.
    uint256 public bonusEndBlock; // Block number when bonus FYGN period ends.

    uint256 public BONUS_MULTIPLIER = 1; // Bonus muliplier for early fygn makers.
    uint256 public totalAllocPoint = 0; // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalLockedUpRewards; // Total locked up rewards

    uint256 public constant MAXIMUM_HARVEST_INTERVAL = 14 days; // Max harvest interval: 14 days.
    uint16 public constant MAXIMUM_WITHDRAWAL_FEE_BP = 1000; // Max withdrawal fee: 10%.
    uint256 public constant ACC_FYGN_PRECISION = 1e12;

    bool public isRewardManagerEnabled; //Trigger for RewardManager mode
    address public rewardManager; //Address for reward manager

    PoolInfo[] public poolInfo; // Info of each pool.

    mapping(uint256 => mapping(address => UserInfo)) public userInfo; // Info of each user that stakes LP tokens.

    mapping(address => mapping(address => bool)) public whiteListedHandlers;

    event PoolAddition(
        uint256 indexed pid,
        uint256 allocPoint,
        IERC20 indexed lpToken,
        uint16 withdrawalFeeBP,
        uint256 harvestInterval,
        IStrategy strategy
    );
    event UpdatedPoolAlloc(
        uint256 indexed pid,
        uint256 allocPoint,
        uint16 withdrawalFeeBP,
        uint256 harvestInterval
    );
    event UpdatedPoolAllocPoint(uint256 indexed pid, uint256 allocPoint);
    event UpdatedPoolStrategy(uint256 indexed pid, IStrategy strategy);
    event UpdatedPoolWithdrawalFeeBP(uint256 indexed pid, uint256 withdrawalFeeBP);
    event UpdatedPoolHarvestInterval(uint256 indexed pid, uint256 harvestInterval);
    event PoolUpdated(
        uint256 indexed pid,
        uint256 lastRewardBlock,
        uint256 lpSupply,
        uint256 accfYGNPerShare
    );
    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event SetYGNConverter(address indexed user, address indexed ygnConverter);
    event RewardLockedUp(address indexed user, uint256 indexed pid, uint256 amountLockedUp);
    event BonusMultiplierUpdated(uint256 _bonusMultiplier);
    event BlockRateUpdated(uint256 _blockRate);
    event UserWhitelisted(address _primaryUser, address _whitelistedUser);
    event UserBlacklisted(address _primaryUser, address _blacklistedUser);

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

    modifier ensureNonZeroAddress(address addressToCheck) {
        require(addressToCheck != address(0), "No zero address");
        _;
    }

    constructor(
        IFYGN _fYGN,
        uint256 _fYGNPerBlock,
        address _ygnConverter,
        uint256 _startBlock,
        uint256 _bonusEndBlock
    ) {
        fYGN = _fYGN;
        fYGNPerBlock = _fYGNPerBlock;
        ygnConverter = _ygnConverter;
        startBlock = _startBlock;
        bonusEndBlock = _bonusEndBlock;
        isRewardManagerEnabled = false;
        rewardManager = address(0);
    }

    //Only Owner Functions

    function updateBonusMultiplier(uint256 multiplierNumber) external onlyOwner {
        massUpdatePools();
        BONUS_MULTIPLIER = multiplierNumber;
        emit BonusMultiplierUpdated(BONUS_MULTIPLIER);
    }

    function updateBlockRate(uint256 _fYGNPerBlock) external onlyOwner {
        massUpdatePools();
        fYGNPerBlock = _fYGNPerBlock;
        emit BlockRateUpdated(_fYGNPerBlock);
    }

    function updateRewardManagerMode(bool _isRewardManagerEnabled) external onlyOwner {
        massUpdatePools();
        isRewardManagerEnabled = _isRewardManagerEnabled;
    }

    function updateRewardManager(address _rewardManager)
        external
        onlyOwner
        ensureNonZeroAddress(_rewardManager)
    {
        massUpdatePools();
        rewardManager = _rewardManager;
    }

    // Update YGN Converter
    function setYGNConverter(address _ygnConverter)
        external
        onlyOwner
        ensureNonZeroAddress(_ygnConverter)
    {
        ygnConverter = _ygnConverter;
        emit SetYGNConverter(_msgSender(), _ygnConverter);
    }

    // Add a new lp to the pool. Can only be called by the owner.
    function add(
        uint256 _allocPoint,
        IERC20 _lpToken,
        uint16 _withdrawalFeeBP,
        uint256 _harvestInterval,
        IStrategy _strategy,
        bool _withUpdate
    ) external onlyOwner ensureNonZeroAddress(address(_lpToken)) nonReentrant {
        require(
            _withdrawalFeeBP <= MAXIMUM_WITHDRAWAL_FEE_BP,
            "add: invalid withdrawal fee basis points"
        );
        require(_harvestInterval <= MAXIMUM_HARVEST_INTERVAL, "add: invalid harvest interval");

        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
        totalAllocPoint = totalAllocPoint.add(_allocPoint);
        poolInfo.push(
            PoolInfo({
                lpToken: _lpToken,
                allocPoint: _allocPoint,
                lastRewardBlock: lastRewardBlock,
                accfYGNPerShare: 0,
                withdrawalFeeBP: _withdrawalFeeBP,
                harvestInterval: _harvestInterval,
                totalInputTokensStaked: 0,
                strategy: _strategy
            })
        );

        emit PoolAddition(
            poolInfo.length.sub(1),
            _allocPoint,
            _lpToken,
            _withdrawalFeeBP,
            _harvestInterval,
            _strategy
        );
    }

    function updatePoolAllocPoint(
        uint256 _pid,
        uint256 _allocPoint,
        bool _withUpdate
    ) external onlyOwner validatePoolByPid(_pid) nonReentrant {
        if (_withUpdate) {
            massUpdatePools();
        } else {
            updatePool(_pid);
        }
        PoolInfo storage pool = poolInfo[_pid];
        totalAllocPoint = totalAllocPoint.sub(pool.allocPoint).add(_allocPoint);
        pool.allocPoint = _allocPoint;
        emit UpdatedPoolAllocPoint(_pid, _allocPoint);
    }

    function updatePoolWithdrawalFeeBP(
        uint256 _pid,
        uint16 _withdrawalFeeBP,
        bool _withUpdate
    ) external onlyOwner validatePoolByPid(_pid) nonReentrant {
        require(
            _withdrawalFeeBP <= MAXIMUM_WITHDRAWAL_FEE_BP,
            "set: invalid withdrawal fee basis points"
        );
        if (_withUpdate) {
            massUpdatePools();
        } else {
            updatePool(_pid);
        }
        PoolInfo storage pool = poolInfo[_pid];
        pool.withdrawalFeeBP = _withdrawalFeeBP;
        emit UpdatedPoolWithdrawalFeeBP(_pid, _withdrawalFeeBP);
    }

    function updatePoolHarvestInterval(
        uint256 _pid,
        uint256 _harvestInterval,
        bool _withUpdate
    ) external onlyOwner validatePoolByPid(_pid) nonReentrant {
        require(_harvestInterval <= MAXIMUM_HARVEST_INTERVAL, "add: invalid harvest interval");
        if (_withUpdate) {
            massUpdatePools();
        } else {
            updatePool(_pid);
        }
        PoolInfo storage pool = poolInfo[_pid];
        pool.harvestInterval = _harvestInterval;
        emit UpdatedPoolHarvestInterval(_pid, _harvestInterval);
    }

    //Shouldn't be used and only be used when no LP tokens are staked
    function updatePoolStrategy(
        uint256 _pid,
        IStrategy _strategy,
        bool _withUpdate
    ) external onlyOwner validatePoolByPid(_pid) nonReentrant {
        if (_withUpdate) {
            massUpdatePools();
        } else {
            updatePool(_pid);
        }
        PoolInfo storage pool = poolInfo[_pid];
        pool.strategy = _strategy;
        emit UpdatedPoolStrategy(_pid, _strategy);
    }

    // Update the given pool's fYGN allocation point. Can only be called by the owner.
    function set(
        uint256 _pid,
        uint256 _allocPoint,
        uint16 _withdrawalFeeBP,
        uint256 _harvestInterval,
        bool _withUpdate
    ) external onlyOwner validatePoolByPid(_pid) nonReentrant {
        require(
            _withdrawalFeeBP <= MAXIMUM_WITHDRAWAL_FEE_BP,
            "set: invalid deposit fee basis points"
        );
        require(_harvestInterval <= MAXIMUM_HARVEST_INTERVAL, "add: invalid harvest interval");
        if (_withUpdate) {
            massUpdatePools();
        } else {
            updatePool(_pid);
        }
        PoolInfo storage pool = poolInfo[_pid];
        totalAllocPoint = totalAllocPoint.sub(pool.allocPoint).add(_allocPoint);
        pool.allocPoint = _allocPoint;
        pool.withdrawalFeeBP = _withdrawalFeeBP;
        pool.harvestInterval = _harvestInterval;

        emit UpdatedPoolAlloc(_pid, _allocPoint, _withdrawalFeeBP, _harvestInterval);
    }

    function withdrawFYGN(uint256 _amount) external onlyOwner nonReentrant {
        IERC20(address(fYGN)).safeTransfer(_msgSender(), _amount);
    }

    function pause() external onlyOwner nonReentrant {
        _pause();
    }

    function unpause() external onlyOwner nonReentrant {
        _unpause();
    }

    //View Functions

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

    // Return reward multiplier over the given _from to _to block.
    function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) {
        return _to.sub(_from).mul(BONUS_MULTIPLIER);
    }

    function getLpTokenAmount(uint256 _pid)
        public
        view
        validatePoolByPid(_pid)
        returns (uint256 lpSupply)
    {
        PoolInfo storage pool = poolInfo[_pid];
        if (address(pool.strategy) != address(0)) {
            lpSupply = pool.strategy.totalInputTokensStaked();
        } else {
            lpSupply = pool.totalInputTokensStaked;
        }
    }

    // View function to see pending fYGNs on frontend.
    function pendingFYGN(uint256 _pid, address _user)
        external
        view
        validatePoolByPid(_pid)
        returns (uint256)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accfYGNPerShare = pool.accfYGNPerShare;
        uint256 lpSupply = pool.totalInputTokensStaked;
        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 fygnReward = multiplier.mul(fYGNPerBlock).mul(pool.allocPoint).div(
                totalAllocPoint
            );
            accfYGNPerShare = accfYGNPerShare.add(fygnReward.mul(ACC_FYGN_PRECISION).div(lpSupply));
        }
        uint256 pending = user.amount.mul(accfYGNPerShare).div(ACC_FYGN_PRECISION).sub(
            user.rewardDebt
        );
        return pending.add(user.rewardLockedUp);
    }

    // View function to see if user can harvest fYGN's.
    function canHarvest(uint256 _pid, address _user)
        public
        view
        validatePoolByPid(_pid)
        returns (bool)
    {
        UserInfo memory user = userInfo[_pid][_user];
        return block.timestamp >= user.nextHarvestUntil;
    }

    // View function to see if user harvest until time.
    function getHarvestUntil(uint256 _pid, address _user)
        external
        view
        validatePoolByPid(_pid)
        returns (uint256)
    {
        UserInfo memory user = userInfo[_pid][_user];
        return user.nextHarvestUntil;
    }

    function isUserWhiteListed(address _owner, address _user) external view returns (bool) {
        return whiteListedHandlers[_owner][_user];
    }

    //Public And External Functions for User and Internal Functions

    function addUserToWhiteList(address _user) external ensureNonZeroAddress(_user) {
        whiteListedHandlers[_msgSender()][_user] = true;
        emit UserWhitelisted(_msgSender(), _user);
    }

    function removeUserFromWhiteList(address _user) external ensureNonZeroAddress(_user) {
        whiteListedHandlers[_msgSender()][_user] = false;
        emit UserBlacklisted(_msgSender(), _user);
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public validatePoolByPid(_pid) {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        uint256 lpSupply = pool.totalInputTokensStaked;
        if (lpSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
        uint256 fygnReward = multiplier.mul(fYGNPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
        pool.accfYGNPerShare = pool.accfYGNPerShare.add(
            fygnReward.mul(ACC_FYGN_PRECISION).div(lpSupply)
        );

        fYGN.mint(address(this), fygnReward);

        pool.lastRewardBlock = block.number;
        emit PoolUpdated(_pid, pool.lastRewardBlock, lpSupply, pool.accfYGNPerShare);
    }

    // Update reward variables for all pools. Be careful of gas spending!
    function massUpdatePools() public {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    // Deposit LP tokens to Farm for fYGN allocation.
    function deposit(
        uint256 _pid,
        uint256 _amount,
        bool _userWantsToStake
    ) external validatePoolByPid(_pid) nonReentrant whenNotPaused {
        _deposit(_pid, _amount, _msgSender(), _userWantsToStake);
    }

    // Deposit LP tokens to Farm for fYGN allocation.
    function depositFor(
        uint256 _pid,
        uint256 _amount,
        address _user,
        bool _userWantsToStake
    ) external validatePoolByPid(_pid) nonReentrant ensureNonZeroAddress(_user) whenNotPaused {
        _deposit(_pid, _amount, _user, _userWantsToStake);
    }

    function _deposit(
        uint256 _pid,
        uint256 _amount,
        address _user,
        bool _userWantsToStake
    ) internal {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];

        whiteListedHandlers[_user][_user] = true;

        updatePool(_pid);
        _payOrLockupPendingFYGN(_pid, _user, _user, _userWantsToStake);

        if (_amount > 0) {
            pool.lpToken.safeTransferFrom(address(_msgSender()), address(this), _amount);
            uint256 depositedAmount;
            if (address(pool.strategy) != address(0)) {
                pool.lpToken.safeApprove(address(pool.strategy), _amount);
                depositedAmount = pool.strategy.deposit(address(pool.lpToken), _amount);
            } else {
                depositedAmount = _amount;
            }
            user.amount = user.amount.add(depositedAmount);
            user.nextHarvestUntil = block.timestamp.add(pool.harvestInterval);
            pool.totalInputTokensStaked = pool.totalInputTokensStaked.add(depositedAmount);
        }
        user.rewardDebt = user.amount.mul(pool.accfYGNPerShare).div(ACC_FYGN_PRECISION);
        emit Deposit(_user, _pid, _amount);
    }

    // Withdraw LP tokens from Farm.
    function withdraw(
        uint256 _pid,
        uint256 _amount,
        bool _userWantsToStake
    ) external validatePoolByPid(_pid) nonReentrant whenNotPaused {
        _withdraw(_pid, _amount, _msgSender(), _msgSender(), _userWantsToStake);
    }

    // Withdraw LP tokens from Farm.
    function withdrawFor(
        uint256 _pid,
        uint256 _amount,
        address _user,
        bool _userWantsToStake
    ) external validatePoolByPid(_pid) nonReentrant ensureNonZeroAddress(_user) whenNotPaused {
        require(whiteListedHandlers[_user][_msgSender()], "not whitelisted");
        _withdraw(_pid, _amount, _user, _msgSender(), _userWantsToStake);
    }

    function _withdraw(
        uint256 _pid,
        uint256 _amount,
        address _user,
        address _withdrawer,
        bool _userWantsToStake
    ) internal {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];

        require(user.amount >= _amount, "withdraw: not good");

        updatePool(_pid);
        _payOrLockupPendingFYGN(_pid, _user, _withdrawer, _userWantsToStake);

        if (_amount > 0) {
            user.amount = user.amount.sub(_amount);
            uint256 withdrawnAmount;
            if (address(pool.strategy) != address(0)) {
                withdrawnAmount = pool.strategy.withdraw(address(pool.lpToken), _amount);
                pool.lpToken.safeTransferFrom(
                    address(pool.strategy),
                    address(this),
                    withdrawnAmount
                );
            } else {
                withdrawnAmount = _amount;
            }

            if (pool.withdrawalFeeBP > 0) {
                uint256 withdrawalFee = withdrawnAmount.mul(pool.withdrawalFeeBP).div(10000);
                pool.lpToken.safeTransfer(ygnConverter, withdrawalFee);
                pool.lpToken.safeTransfer(address(_withdrawer), withdrawnAmount.sub(withdrawalFee));
            } else {
                pool.lpToken.safeTransfer(address(_withdrawer), withdrawnAmount);
            }
        }
        pool.totalInputTokensStaked = pool.totalInputTokensStaked.sub(_amount);
        user.rewardDebt = user.amount.mul(pool.accfYGNPerShare).div(ACC_FYGN_PRECISION);
        emit Withdraw(_user, _pid, _amount);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid) external validatePoolByPid(_pid) nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_msgSender()];
        uint256 withdrawnAmount;
        if (address(pool.strategy) != address(0)) {
            withdrawnAmount = pool.strategy.withdraw(address(pool.lpToken), user.amount);
            pool.lpToken.safeTransferFrom(address(pool.strategy), address(this), withdrawnAmount);
        } else {
            withdrawnAmount = user.amount;
        }
        pool.lpToken.safeTransfer(address(_msgSender()), withdrawnAmount);
        emit EmergencyWithdraw(_msgSender(), _pid, user.amount);
        pool.totalInputTokensStaked = pool.totalInputTokensStaked.sub(user.amount);
        user.amount = 0;
        user.rewardDebt = 0;
        user.rewardLockedUp = 0;
        user.nextHarvestUntil = 0;
    }

    // Pay or lockup pending fYGN.
    function _payOrLockupPendingFYGN(
        uint256 _pid,
        address _user,
        address _withdrawer,
        bool _userWantsToStake
    ) internal {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        if (user.nextHarvestUntil == 0) {
            user.nextHarvestUntil = block.timestamp.add(pool.harvestInterval);
        }

        uint256 pending = user.amount.mul(pool.accfYGNPerShare).div(ACC_FYGN_PRECISION).sub(
            user.rewardDebt
        );
        if (canHarvest(_pid, _user)) {
            if (pending > 0 || user.rewardLockedUp > 0) {
                uint256 totalRewards = pending.add(user.rewardLockedUp);

                // reset lockup
                totalLockedUpRewards = totalLockedUpRewards.sub(user.rewardLockedUp);
                user.rewardLockedUp = 0;
                user.nextHarvestUntil = block.timestamp.add(pool.harvestInterval);

                // send rewards
                if (isRewardManagerEnabled == true) {
                    _safeFYGNTransfer(rewardManager, totalRewards);
                    IRewardManager(rewardManager).handleRewardsForUser(
                        _withdrawer,
                        totalRewards,
                        _userWantsToStake
                    );
                } else {
                    _safeFYGNTransfer(_withdrawer, totalRewards);
                }
            }
        } else if (pending > 0) {
            user.rewardLockedUp = user.rewardLockedUp.add(pending);
            totalLockedUpRewards = totalLockedUpRewards.add(pending);
            emit RewardLockedUp(_user, _pid, pending);
        }
    }

    // Safe fygn transfer function, just in case if rounding error causes pool to not have enough fYGNs.
    function _safeFYGNTransfer(address _to, uint256 _amount) internal {
        uint256 fygnBal = fYGN.balanceOf(address(this));
        if (_amount > fygnBal) {
            IERC20(address(fYGN)).safeTransfer(_to, fygnBal);
        } else {
            IERC20(address(fYGN)).safeTransfer(_to, _amount);
        }
    }
}

File 2 of 16 : 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 3 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 4 of 16 : 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 5 of 16 : 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 16 : IRewardManager.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;

import "./IFYGNClaimableBurner.sol";
import "./IYGNStaker.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";

interface IRewardManager {
    event Vested(address indexed _beneficiary, uint256 indexed value);

    event DrawDown(address indexed _beneficiary, uint256 indexed _amount, uint256 indexed bonus);

    event PreMatureDrawn(
        address indexed _beneficiary,
        uint256 indexed burntAmount,
        uint256 indexed userEffectiveWithdrawn
    );

    function startDistribution() external view returns (uint256);

    function endDistribution() external view returns (uint256);

    function updatePreMaturePenalty(uint256 _newpreMaturePenalty) external;

    function updateBonusPercentage(uint256 _newBonusPercentage) external;

    function updateDistributionTime(uint256 _updatedStartTime, uint256 _updatedEndTime) external;

    function updateUpfrontUnlock(uint256 _newUpfrontUnlock) external;

    function updateWhitelistAddress(address _excludeAddress, bool status) external;

    // Can be used by the owner to update the address for the FYGNClaimableBurner
    function updateFYGNClaimableBurner(IFYGNClaimableBurner _fYGNClaimableBurner) external;

    // Can be used by the owner to update the address for the YGNStaker
    function updateYGNStaker(IYGNStaker _ygnStaker) external;

    function updateFYGN(ERC20Burnable _fYGN) external;

    function updateYGN(IERC20 _ygn) external;

    function handleRewardsForUser(
        address _user,
        uint256 _rewardAmount,
        bool _userWantsToStake
    ) external;

    function vestingInfo(address _user)
        external
        view
        returns (
            uint256 totalVested,
            uint256 totalDrawnAmount,
            uint256 amountBurnt,
            uint256 claimable,
            uint256 bonusRewards,
            uint256 stillDue
        );

    function drawDown(address _user, bool _userWantsToStake) external;

    function preMatureDraw(address _beneficiary, bool _userWantsToStake) external;

    function addBonusRewards(uint256 _bonusRewards) external;

    function removeBonusRewards(address _owner) external;
}

File 7 of 16 : IFYGN.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

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

interface IFYGN is IERC20 {
    function mint(address account, uint256 amount) external;
}

File 8 of 16 : IStrategy.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity >=0.6.0 <0.8.0;

interface IStrategy {
    function deposit(address token, uint256 amount) external returns (uint256 depositedAmount);

    function withdraw(address token, uint256 amount) external returns (uint256 withdrawnAmount);

    function strategyDepositFeeBP() external view returns (uint256);

    function strategyWithdrawalFeeBP() external view returns (uint256);

    function rescueFunds(address _token) external returns (uint256 rescuedAssetAmount);

    function totalInputTokensStaked() external view returns (uint256);

    function switchStrategy(IStrategy _strategy) external;

    function updateLiquidityHolder(address _liquidityHolder, bool _status) external;

    function updateStrategyMode(bool _isStrategyEnabled) external;

    function updateSupportsEmergencyWithdraw(bool _supportsEmergencyWithdraw) external;
}

File 9 of 16 : 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 10 of 16 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity >=0.6.2 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 12 of 16 : 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 13 of 16 : IFYGNClaimableBurner.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;

interface IFYGNClaimableBurner {
    function getYGNAmount(uint256 _fYGNShare) external view returns (uint256);

    function burnFYGNFor(address _account, uint256 _fYGNShare) external;

    function burnAndStake(uint256 _fYGNShare) external;

    function leave(uint256 _fYGNShare) external;
}

File 14 of 16 : IYGNStaker.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;

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

interface IYGNStaker {
    function ygn() external view returns (IERC20);

    function getXYGNAmount(uint256 _ygnAmount) external view returns (uint256 xYGNAmount);

    function enterFor(address _account, uint256 _amount) external;

    function enter(uint256 _amount) external;

    function leave(uint256 _share) external;
}

File 15 of 16 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    using SafeMath for uint256;

    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");

        _approve(account, _msgSender(), decreasedAllowance);
        _burn(account, amount);
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

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

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

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(sender, recipient, amount);

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

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IFYGN","name":"_fYGN","type":"address"},{"internalType":"uint256","name":"_fYGNPerBlock","type":"uint256"},{"internalType":"address","name":"_ygnConverter","type":"address"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_bonusEndBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_blockRate","type":"uint256"}],"name":"BlockRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_bonusMultiplier","type":"uint256"}],"name":"BonusMultiplierUpdated","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":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","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":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint16","name":"withdrawalFeeBP","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"harvestInterval","type":"uint256"},{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"PoolAddition","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accfYGNPerShare","type":"uint256"}],"name":"PoolUpdated","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":"amountLockedUp","type":"uint256"}],"name":"RewardLockedUp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"ygnConverter","type":"address"}],"name":"SetYGNConverter","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"withdrawalFeeBP","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"harvestInterval","type":"uint256"}],"name":"UpdatedPoolAlloc","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"}],"name":"UpdatedPoolAllocPoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"harvestInterval","type":"uint256"}],"name":"UpdatedPoolHarvestInterval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"contract IStrategy","name":"strategy","type":"address"}],"name":"UpdatedPoolStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawalFeeBP","type":"uint256"}],"name":"UpdatedPoolWithdrawalFeeBP","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_primaryUser","type":"address"},{"indexed":false,"internalType":"address","name":"_blacklistedUser","type":"address"}],"name":"UserBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_primaryUser","type":"address"},{"indexed":false,"internalType":"address","name":"_whitelistedUser","type":"address"}],"name":"UserWhitelisted","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":"Withdraw","type":"event"},{"inputs":[],"name":"ACC_FYGN_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BONUS_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_HARVEST_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_WITHDRAWAL_FEE_BP","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"uint16","name":"_withdrawalFeeBP","type":"uint16"},{"internalType":"uint256","name":"_harvestInterval","type":"uint256"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"addUserToWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bonusEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"canHarvest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_userWantsToStake","type":"bool"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"_userWantsToStake","type":"bool"}],"name":"depositFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fYGN","outputs":[{"internalType":"contract IFYGN","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fYGNPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"getHarvestUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"getLpTokenAmount","outputs":[{"internalType":"uint256","name":"lpSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRewardManagerEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_user","type":"address"}],"name":"isUserWhiteListed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"pendingFYGN","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":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accfYGNPerShare","type":"uint256"},{"internalType":"uint16","name":"withdrawalFeeBP","type":"uint16"},{"internalType":"uint256","name":"harvestInterval","type":"uint256"},{"internalType":"uint256","name":"totalInputTokensStaked","type":"uint256"},{"internalType":"contract IStrategy","name":"strategy","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"removeUserFromWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint16","name":"_withdrawalFeeBP","type":"uint16"},{"internalType":"uint256","name":"_harvestInterval","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ygnConverter","type":"address"}],"name":"setYGNConverter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLockedUpRewards","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":"_fYGNPerBlock","type":"uint256"}],"name":"updateBlockRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"multiplierNumber","type":"uint256"}],"name":"updateBonusMultiplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","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":"updatePoolAllocPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_harvestInterval","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"updatePoolHarvestInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"contract IStrategy","name":"_strategy","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"updatePoolStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint16","name":"_withdrawalFeeBP","type":"uint16"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"updatePoolWithdrawalFeeBP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardManager","type":"address"}],"name":"updateRewardManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isRewardManagerEnabled","type":"bool"}],"name":"updateRewardManagerMode","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":"rewardLockedUp","type":"uint256"},{"internalType":"uint256","name":"nextHarvestUntil","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"whiteListedHandlers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_userWantsToStake","type":"bool"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFYGN","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"_userWantsToStake","type":"bool"}],"name":"withdrawFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ygnConverter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6080604052600160075560006008553480156200001b57600080fd5b5060405162003fcf38038062003fcf833981810160405260a08110156200004157600080fd5b5080516020820151604083015160608401516080909401519293919290919060006200006c62000117565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055600280546001600160a81b03199081166101006001600160a01b039889160217909155600394909455600480546001600160a01b0319169390951692909217909355600592909255600691909155600a805490911690556200011b565b3390565b613ea4806200012b6000396000f3fe608060405234801561001057600080fd5b50600436106102d45760003560e01c80636278cb50116101825780638dbb1e3a116100e9578063ca1d4779116100a2578063db252d9a1161007c578063db252d9a146108cb578063de73149d146108f9578063f2fde38b14610901578063f59cc48914610927576102d4565b8063ca1d47791461085b578063d0d4a74114610863578063d18154a414610891576102d4565b80638dbb1e3a1461077957806393f1a40b1461079c578063980bdf18146107ee578063ad91c06d146107f6578063b5e69b1714610813578063c0ba8e9414610830576102d4565b806377073e081161013b57806377073e08146106e45780638456cb591461070a578063889f9e03146107125780638aa285501461074c5780638aea42cf146107545780638da5cb5b14610771576102d4565b80636278cb501461063b578063630b5ba11461066a5780636498d1cd146106725780636ec5ab1214610691578063715018a6146106bd57806375819a1e146106c5576102d4565b80632e6c998d11610241578063474fa630116101fa5780634f3bd0b9116101d45780634f3bd0b9146105d357806351eb05a6146105f95780635312ea8e146106165780635c975abb14610633576102d4565b8063474fa6301461059857806348cd4cb1146105a05780634ea1a54c146105a8576102d4565b80632e6c998d146104da57806333cfcd3b1461050657806333f779fa146105315780633ed06fe31461055d5780633f4ba83a1461056557806343a0d0661461056d576102d4565b806317caf6f11161029357806317caf6f1146104195780631aed6553146104215780631b5f27c5146104295780632143e54514610445578063235e8803146104805780632765ec5a146104a6576102d4565b8062110a41146102d9578062904b15146102f8578063050eb2eb14610346578063081e3eda1461036c5780630f4ef8a6146103865780631526fe27146103aa575b600080fd5b6102f6600480360360208110156102ef57600080fd5b503561092f565b005b6102f6600480360360c081101561030e57600080fd5b508035906001600160a01b03602082013581169161ffff6040820135169160608201359160808101359091169060a0013515156109d4565b6102f66004803603602081101561035c57600080fd5b50356001600160a01b0316610dda565b610374610ebb565b60408051918252519081900360200190f35b61038e610ec1565b604080516001600160a01b039092168252519081900360200190f35b6103c7600480360360208110156103c057600080fd5b5035610ed5565b604080516001600160a01b03998a168152602081019890985287810196909652606087019490945261ffff909216608086015260a085015260c084015290921660e08201529051908190036101000190f35b610374610f3d565b610374610f43565b610431610f49565b604080519115158252519081900360200190f35b6102f6600480360360a081101561045b57600080fd5b5080359060208101359061ffff60408201351690606081013590608001351515610f52565b6102f66004803603602081101561049657600080fd5b50356001600160a01b03166111b8565b6102f6600480360360608110156104bc57600080fd5b508035906001600160a01b03602082013516906040013515156112c7565b610431600480360360408110156104f057600080fd5b50803590602001356001600160a01b0316611458565b6102f66004803603606081101561051c57600080fd5b508035906020810135906040013515156114ff565b6103746004803603604081101561054757600080fd5b50803590602001356001600160a01b0316611602565b61037461176d565b6102f6611773565b6102f66004803603606081101561058357600080fd5b5080359060208101359060400135151561182e565b61037461191f565b610374611925565b6102f6600480360360608110156105be57600080fd5b5080359060208101359060400135151561192b565b6102f6600480360360208110156105e957600080fd5b50356001600160a01b0316611ac1565b6102f66004803603602081101561060f57600080fd5b5035611ba4565b6102f66004803603602081101561062c57600080fd5b5035611d58565b610431611fa3565b6102f66004803603606081101561065157600080fd5b5080359061ffff60208201351690604001351515611fac565b6102f6612178565b6102f66004803603602081101561068857600080fd5b50351515612197565b610374600480360360408110156106a757600080fd5b50803590602001356001600160a01b0316612214565b6102f66122b8565b6106cd612364565b6040805161ffff9092168252519081900360200190f35b6102f6600480360360208110156106fa57600080fd5b50356001600160a01b031661236a565b6102f6612427565b6102f66004803603608081101561072857600080fd5b508035906020810135906001600160a01b03604082013516906060013515156124dc565b6103746126a9565b6102f66004803603602081101561076a57600080fd5b50356126af565b61038e612786565b6103746004803603604081101561078f57600080fd5b5080359060200135612795565b6107c8600480360360408110156107b257600080fd5b50803590602001356001600160a01b03166127b2565b604080519485526020850193909352838301919091526060830152519081900360800190f35b61038e6127e4565b6103746004803603602081101561080c57600080fd5b50356127f3565b6102f66004803603602081101561082957600080fd5b5035612903565b6102f66004803603606081101561084657600080fd5b508035906020810135906040013515156129a8565b610374612b7a565b6104316004803603604081101561087957600080fd5b506001600160a01b0381358116916020013516612b83565b6102f6600480360360808110156108a757600080fd5b508035906020810135906001600160a01b0360408201351690606001351515612bb1565b610431600480360360408110156108e157600080fd5b506001600160a01b0381358116916020013516612ce9565b610374612d09565b6102f66004803603602081101561091757600080fd5b50356001600160a01b0316612d10565b61038e612e12565b610937612e26565b6001600160a01b0316610948612786565b6001600160a01b031614610991576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b610999612178565b60038190556040805182815290517feb2ccea799a774a5f19b5377418ee355fe1e175794e1050fb8f06ef6b34dbaf09181900360200190a150565b6109dc612e26565b6001600160a01b03166109ed612786565b6001600160a01b031614610a36576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b846001600160a01b038116610a84576040805162461bcd60e51b815260206004820152600f60248201526e4e6f207a65726f206164647265737360881b604482015290519081900360640190fd5b60026001541415610aca576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b60026001556103e861ffff86161115610b145760405162461bcd60e51b8152600401808060200182810382526028815260200180613d396028913960400191505060405180910390fd5b62127500841115610b6c576040805162461bcd60e51b815260206004820152601d60248201527f6164643a20696e76616c6964206861727665737420696e74657276616c000000604482015290519081900360640190fd5b8115610b7a57610b7a612178565b60006005544311610b8d57600554610b8f565b435b600854909150610b9f9089612e2a565b600890815560408051610100810182526001600160a01b03808b16808352602083018d815293830186815260006060850181815261ffff808f166080880190815260a088018f815260c089018581528f891660e08b01908152600b805460018181018355988290529b519b909d027f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9810180549c8c166001600160a01b03199d8e161790559b517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba8d015596517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb8c015593517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbc8b015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbd8a0180549190931661ffff1990911617909155517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbe880155517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbf87015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dc09095018054959093169490931693909317905591549091610d7a9190612e84565b604080518b815261ffff8a1660208201528082018990526001600160a01b038816606082015290517fe93c781c6f23068d1875c5c5dc5e262a8ad9c4703d5ac9d8059e380aeb63ddfe9181900360800190a3505060018055505050505050565b610de2612e26565b6001600160a01b0316610df3612786565b6001600160a01b031614610e3c576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b806001600160a01b038116610e8a576040805162461bcd60e51b815260206004820152600f60248201526e4e6f207a65726f206164647265737360881b604482015290519081900360640190fd5b610e92612178565b50600a80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600b5490565b600a5461010090046001600160a01b031681565b600b8181548110610ee557600080fd5b6000918252602090912060089091020180546001820154600283015460038401546004850154600586015460068701546007909701546001600160a01b03968716985094969395929461ffff90921693909290911688565b60085481565b60065481565b600a5460ff1681565b610f5a612e26565b6001600160a01b0316610f6b612786565b6001600160a01b031614610fb4576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b600b5485908110610ffa576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b60026001541415611040576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b60026001556103e861ffff8516111561108a5760405162461bcd60e51b8152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b621275008311156110e2576040805162461bcd60e51b815260206004820152601d60248201527f6164643a20696e76616c6964206861727665737420696e74657276616c000000604482015290519081900360640190fd5b81156110f5576110f0612178565b6110fe565b6110fe86611ba4565b6000600b878154811061110d57fe5b906000526020600020906008020190506111408661113a8360010154600854612e8490919063ffffffff16565b90612e2a565b6008556001810186905560048101805461ffff871661ffff199091168117909155600582018590556040805188815260208101929092528181018690525188917f0fbabe687f39d4b1c7528d4c9669c87734a8617dbf7ce248085b50a9284a743a919081900360600190a25050600180555050505050565b6111c0612e26565b6001600160a01b03166111d1612786565b6001600160a01b03161461121a576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b806001600160a01b038116611268576040805162461bcd60e51b815260206004820152600f60248201526e4e6f207a65726f206164647265737360881b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b03841690811790915561128e612e26565b6001600160a01b03167f3bfd77603925bafa2bb0488d6a3fc3c802e56b29b4fc1744f336ee74290f541160405160405180910390a35050565b6112cf612e26565b6001600160a01b03166112e0612786565b6001600160a01b031614611329576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b600b548390811061136f576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b600260015414156113b5576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b600260015581156113cd576113c8612178565b6113d6565b6113d684611ba4565b6000600b85815481106113e557fe5b6000918252602091829020600891909102016007810180546001600160a01b0319166001600160a01b038816908117909155604080519182525191935087927f1029d678dbb8736b7e5a88bb5eedd3d4b2c4430783767aa06aa8484131e7c45492918290030190a2505060018055505050565b600b54600090839081106114a1576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b50506000918252600c602090815260408084206001600160a01b039390931684529181529181902081516080810183528154815260018201549381019390935260028101549183019190915260030154606090910181905242101590565b600b5483908110611545576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b6002600154141561158b576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b6002600155611598611fa3565b156115dd576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6115f884846115ea612e26565b6115f2612e26565b86612ee1565b5050600180555050565b600b546000908390811061164b576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b6000600b858154811061165a57fe5b60009182526020808320888452600c825260408085206001600160a01b038a16865290925292206003600890920290920190810154600682015460028301549294509091431180156116ab57508015155b156117175760006116c0856002015443612795565b905060006116f36008546116ed88600101546116e76003548761316290919063ffffffff16565b90613162565b906131bb565b905061171261170b846116ed8464e8d4a51000613162565b8590612e2a565b935050505b6000611747846001015461174164e8d4a510006116ed87896000015461316290919063ffffffff16565b90612e84565b9050611760846002015482612e2a90919063ffffffff16565b9998505050505050505050565b60035481565b61177b612e26565b6001600160a01b031661178c612786565b6001600160a01b0316146117d5576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b6002600154141561181b576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b6002600155611828613222565b60018055565b600b5483908110611874576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b600260015414156118ba576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b60026001556118c7611fa3565b1561190c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6115f88484611919612e26565b856132c2565b60095481565b60055481565b611933612e26565b6001600160a01b0316611944612786565b6001600160a01b03161461198d576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b600b54839081106119d3576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b60026001541415611a19576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b60026001558115611a3157611a2c612178565b611a3a565b611a3a84611ba4565b6000600b8581548110611a4957fe5b90600052602060002090600802019050611a768461113a8360010154600854612e8490919063ffffffff16565b6008556001810184905560408051858152905186917ff0abc9a314c730a8156f9bf6196696f4bd1cacddcc38ddf77332979011614203919081900360200190a2505060018055505050565b806001600160a01b038116611b0f576040805162461bcd60e51b815260206004820152600f60248201526e4e6f207a65726f206164647265737360881b604482015290519081900360640190fd5b6000600d6000611b1d612e26565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020805460ff19169115159190911790557fb238e099a93706e73d75fdb8fb35f9a0a146e80ead15480e50fbc9db1736aa04611b7e612e26565b604080516001600160a01b03928316815291851660208301528051918290030190a15050565b600b5481908110611bea576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b6000600b8381548110611bf957fe5b9060005260206000209060080201905080600201544311611c1a5750611d54565b600681015480611c31575043600290910155611d54565b6000611c41836002015443612795565b90506000611c686008546116ed86600101546116e76003548761316290919063ffffffff16565b9050611c8b611c80846116ed8464e8d4a51000613162565b600386015490612e2a565b6003850155600254604080516340c10f1960e01b81523060048201526024810184905290516101009092046001600160a01b0316916340c10f199160448082019260009290919082900301818387803b158015611ce757600080fd5b505af1158015611cfb573d6000803e3d6000fd5b505043600287018190556003870154604080519283526020830188905282810191909152518993507fb0a2ded49817748754bcca0474b24011f01d4574dd5c40e14197ffa2e6540fef92509081900360600190a2505050505b5050565b600b5481908110611d9e576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b60026001541415611de4576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b60026001819055506000600b8381548110611dfb57fe5b60009182526020808320868452600c90915260408320600890920201925081611e22612e26565b6001600160a01b03908116825260208201929092526040016000908120600785015490935090911615611efe576007830154835483546040805163f3fef3a360e01b81526001600160a01b039384166004820152602481019290925251919092169163f3fef3a39160448083019260209291908290030181600087803b158015611eab57600080fd5b505af1158015611ebf573d6000803e3d6000fd5b505050506040513d6020811015611ed557600080fd5b505160078401548454919250611ef9916001600160a01b03908116911630846134b8565b611f02565b5080545b611f1f611f0d612e26565b84546001600160a01b03169083613518565b84611f28612e26565b835460408051918252516001600160a01b0392909216917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a381546006840154611f7991612e84565b60069093019290925560008082556001808301829055600283018290556003909201558055505050565b60025460ff1690565b611fb4612e26565b6001600160a01b0316611fc5612786565b6001600160a01b03161461200e576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b600b5483908110612054576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b6002600154141561209a576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b60026001556103e861ffff841611156120e45760405162461bcd60e51b8152600401808060200182810382526028815260200180613de76028913960400191505060405180910390fd5b81156120f7576120f2612178565b612100565b61210084611ba4565b6000600b858154811061210f57fe5b60009182526020918290206008919091020160048101805461ffff191661ffff8816908117909155604080519182525191935087927f644602cfa19cf17020660f7026b085c32c0d895c81f4e9725f10800a0222189292918290030190a2505060018055505050565b600b5460005b81811015611d545761218f81611ba4565b60010161217e565b61219f612e26565b6001600160a01b03166121b0612786565b6001600160a01b0316146121f9576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b612201612178565b600a805460ff1916911515919091179055565b600b546000908390811061225d576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b50506000918252600c602090815260408084206001600160a01b039390931684529181529181902081516080810183528154815260018201549381019390935260028101549183019190915260030154606090910181905290565b6122c0612e26565b6001600160a01b03166122d1612786565b6001600160a01b03161461231a576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6103e881565b806001600160a01b0381166123b8576040805162461bcd60e51b815260206004820152600f60248201526e4e6f207a65726f206164647265737360881b604482015290519081900360640190fd5b6001600d60006123c6612e26565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020805460ff19169115159190911790557f4bc18aa4b0095c9a3b5cdf42d2322d5a145591b04045988a995a5da426075457611b7e612e26565b61242f612e26565b6001600160a01b0316612440612786565b6001600160a01b031614612489576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b600260015414156124cf576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b600260015561182861356f565b600b5484908110612522576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b60026001541415612568576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b6002600155826001600160a01b0381166125bb576040805162461bcd60e51b815260206004820152600f60248201526e4e6f207a65726f206164647265737360881b604482015290519081900360640190fd5b6125c3611fa3565b15612608576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b0384166000908152600d6020526040812090612629612e26565b6001600160a01b0316815260208101919091526040016000205460ff16612689576040805162461bcd60e51b815260206004820152600f60248201526e1b9bdd081dda1a5d195b1a5cdd1959608a1b604482015290519081900360640190fd5b61269d868686612697612e26565b87612ee1565b50506001805550505050565b60075481565b6126b7612e26565b6001600160a01b03166126c8612786565b6001600160a01b031614612711576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b60026001541415612757576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b600260015561277f612767612e26565b60025461010090046001600160a01b03169083613518565b5060018055565b6000546001600160a01b031690565b6007546000906127a9906116e78486612e84565b90505b92915050565b600c60209081526000928352604080842090915290825290208054600182015460028301546003909301549192909184565b6004546001600160a01b031681565b600b546000908290811061283c576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b6000600b848154811061284b57fe5b6000918252602090912060089091020160078101549091506001600160a01b0316156128f4578060070160009054906101000a90046001600160a01b03166001600160a01b03166312036b436040518163ffffffff1660e01b815260040160206040518083038186803b1580156128c157600080fd5b505afa1580156128d5573d6000803e3d6000fd5b505050506040513d60208110156128eb57600080fd5b505192506128fc565b806006015492505b5050919050565b61290b612e26565b6001600160a01b031661291c612786565b6001600160a01b031614612965576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b61296d612178565b60078190556040805182815290517ff3d4fb4a9ca93dbe227dc214a58b283b8c19652c09e15eae6c04e54aa28fa2ae9181900360200190a150565b6129b0612e26565b6001600160a01b03166129c1612786565b6001600160a01b031614612a0a576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b600b5483908110612a50576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b60026001541415612a96576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b600260015562127500831115612af3576040805162461bcd60e51b815260206004820152601d60248201527f6164643a20696e76616c6964206861727665737420696e74657276616c000000604482015290519081900360640190fd5b8115612b0657612b01612178565b612b0f565b612b0f84611ba4565b6000600b8581548110612b1e57fe5b90600052602060002090600802019050838160050181905550847f4d347703a63d64d9da4a8e6e2a5787563466ddd252fb8d32defa5930a5f0280e856040518082815260200191505060405180910390a2505060018055505050565b64e8d4a5100081565b6001600160a01b039182166000908152600d6020908152604080832093909416825291909152205460ff1690565b600b5484908110612bf7576040805162461bcd60e51b81526020600482015260136024820152600080516020613dc7833981519152604482015290519081900360640190fd5b60026001541415612c3d576040805162461bcd60e51b815260206004820152601f6024820152600080516020613ccd833981519152604482015290519081900360640190fd5b6002600155826001600160a01b038116612c90576040805162461bcd60e51b815260206004820152600f60248201526e4e6f207a65726f206164647265737360881b604482015290519081900360640190fd5b612c98611fa3565b15612cdd576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61269d868686866132c2565b600d60209081526000928352604080842090915290825290205460ff1681565b6212750081565b612d18612e26565b6001600160a01b0316612d29612786565b6001600160a01b031614612d72576040805162461bcd60e51b81526020600482018190526024820152600080516020613da7833981519152604482015290519081900360640190fd5b6001600160a01b038116612db75760405162461bcd60e51b8152600401808060200182810382526026815260200180613ced6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60025461010090046001600160a01b031681565b3390565b6000828201838110156127a9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612edb576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000600b8681548110612ef057fe5b60009182526020808320898452600c825260408085206001600160a01b038a1686529092529220805460089092029092019250861115612f6c576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b612f7587611ba4565b612f81878686866135f2565b85156130e5578054612f939087612e84565b815560078201546000906001600160a01b03161561305857600783015483546040805163f3fef3a360e01b81526001600160a01b039283166004820152602481018b90529051919092169163f3fef3a39160448083019260209291908290030181600087803b15801561300557600080fd5b505af1158015613019573d6000803e3d6000fd5b505050506040513d602081101561302f57600080fd5b505160078401548454919250613053916001600160a01b03908116911630846134b8565b61305b565b50855b600483015461ffff16156130cd57600483015460009061308890612710906116ed90859061ffff16613162565b60045485549192506130a7916001600160a01b03908116911683613518565b6130c7866130b58484612e84565b86546001600160a01b03169190613518565b506130e3565b82546130e3906001600160a01b03168683613518565b505b60068201546130f49087612e84565b6006830155600382015481546131149164e8d4a51000916116ed91613162565b600182015560408051878152905188916001600160a01b038816917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a350505050505050565b600082613171575060006127ac565b8282028284828161317e57fe5b04146127a95760405162461bcd60e51b8152600401808060200182810382526021815260200180613d616021913960400191505060405180910390fd5b6000808211613211576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161321a57fe5b049392505050565b61322a611fa3565b613272576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6132a5612e26565b604080516001600160a01b039092168252519081900360200190a1565b6000600b85815481106132d157fe5b60009182526020808320888452600c825260408085206001600160a01b03891686528352808520600d8452818620909352909320805460ff191660011790556008909102909101915061332386611ba4565b61332f868586866135f2565b841561345057613353613340612e26565b83546001600160a01b03169030886134b8565b60078201546000906001600160a01b0316156134145760078301548354613387916001600160a01b0391821691168861382b565b60078301548354604080516311f9fbc960e21b81526001600160a01b039283166004820152602481018a9052905191909216916347e7ef249160448083019260209291908290030181600087803b1580156133e157600080fd5b505af11580156133f5573d6000803e3d6000fd5b505050506040513d602081101561340b57600080fd5b50519050613417565b50845b81546134239082612e2a565b82556005830154613435904290612e2a565b600383015560068301546134499082612e2a565b6006840155505b6003820154815461346b9164e8d4a51000916116ed91613162565b600182015560408051868152905187916001600160a01b038716917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a3505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261351290859061393a565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261356a90849061393a565b505050565b613577611fa3565b156135bc576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586132a5612e26565b6000600b858154811061360157fe5b60009182526020808320888452600c825260408085206001600160a01b038a168652909252922060038101546008909202909201925061365157600582015461364b904290612e2a565b60038201555b600061367f826001015461174164e8d4a510006116ed8760030154876000015461316290919063ffffffff16565b905061368b8787611458565b156137b75760008111806136a3575060008260020154115b156137b25760006136c1836002015483612e2a90919063ffffffff16565b90506136dc8360020154600954612e8490919063ffffffff16565b6009556000600284015560058401546136f6904290612e2a565b6003840155600a5460ff161515600114156137a657600a546137269061010090046001600160a01b0316826139eb565b600a54604080516316e6015960e21b81526001600160a01b038981166004830152602482018590528815156044830152915161010090930490911691635b9805649160648082019260009290919082900301818387803b15801561378957600080fd5b505af115801561379d573d6000803e3d6000fd5b505050506137b0565b6137b086826139eb565b505b613822565b80156138225760028201546137cc9082612e2a565b60028301556009546137de9082612e2a565b60095560408051828152905188916001600160a01b038916917fee470483107f579a55c754fa00613c45a9a3b617a418b39cb0be97e5381ba7c19181900360200190a35b50505050505050565b8015806138b1575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561388357600080fd5b505afa158015613897573d6000803e3d6000fd5b505050506040513d60208110156138ad57600080fd5b5051155b6138ec5760405162461bcd60e51b8152600401808060200182810382526036815260200180613e396036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261356a9084905b600061398f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613aae9092919063ffffffff16565b80519091501561356a578080602001905160208110156139ae57600080fd5b505161356a5760405162461bcd60e51b815260040180806020018281038252602a815260200180613e0f602a913960400191505060405180910390fd5b600254604080516370a0823160e01b8152306004820152905160009261010090046001600160a01b0316916370a08231916024808301926020929190829003018186803b158015613a3b57600080fd5b505afa158015613a4f573d6000803e3d6000fd5b505050506040513d6020811015613a6557600080fd5b5051905080821115613a9257600254613a8d9061010090046001600160a01b03168483613518565b61356a565b60025461356a9061010090046001600160a01b03168484613518565b6060613abd8484600085613ac7565b90505b9392505050565b606082471015613b085760405162461bcd60e51b8152600401808060200182810382526026815260200180613d136026913960400191505060405180910390fd5b613b1185613c22565b613b62576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310613ba05780518252601f199092019160209182019101613b81565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613c02576040519150601f19603f3d011682016040523d82523d6000602084013e613c07565b606091505b5091509150613c17828286613c28565b979650505050505050565b3b151590565b60608315613c37575081613ac0565b825115613c475782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c91578181015183820152602001613c79565b50505050905090810190601f168015613cbe5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe5265656e7472616e637947756172643a207265656e7472616e742063616c6c004f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c6164643a20696e76616c6964207769746864726177616c2066656520626173697320706f696e7473536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f777365743a20696e76616c6964206465706f7369742066656520626173697320706f696e74734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572506f6f6c20646f6573206e6f74206578697374000000000000000000000000007365743a20696e76616c6964207769746864726177616c2066656520626173697320706f696e74735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220e351eb96dc462709d6150e651633cf37a45f94044c1e09c46dc8bff12a2c80fc64736f6c63430007060033000000000000000000000000397e10ee5e315f69b23cb6c8a913a589b5850c8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001188772c9810cfecac6c35ffde41a710983b01ec00000000000000000000000000000000000000000000000000000000016ceeda00000000000000000000000000000000000000000000000000000000016ceeda

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

000000000000000000000000397e10ee5e315f69b23cb6c8a913a589b5850c8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001188772c9810cfecac6c35ffde41a710983b01ec00000000000000000000000000000000000000000000000000000000016ceeda00000000000000000000000000000000000000000000000000000000016ceeda

-----Decoded View---------------
Arg [0] : _fYGN (address): 0x397e10ee5e315f69b23cb6c8a913a589b5850c80
Arg [1] : _fYGNPerBlock (uint256): 0
Arg [2] : _ygnConverter (address): 0x1188772c9810cfecac6c35ffde41a710983b01ec
Arg [3] : _startBlock (uint256): 23916250
Arg [4] : _bonusEndBlock (uint256): 23916250

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000397e10ee5e315f69b23cb6c8a913a589b5850c80
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000001188772c9810cfecac6c35ffde41a710983b01ec
Arg [3] : 00000000000000000000000000000000000000000000000000000000016ceeda
Arg [4] : 00000000000000000000000000000000000000000000000000000000016ceeda


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