Contract 0xC0947bd74Bb0E0290F3b6442ae32C89712A628E6

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x22da30ad48bb70b5eaa7febc44e2e8645fa8212e35c344690c8c82b44d140f4fWithdraw117854972021-10-15 5:35:2014 hrs 59 mins ago0x0b4a6cadd7fdbba228e7edff00a6aceefd935083 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.02079027
0x5e4a90d08974f0476e111b1368e653609aa12e9d309ee833efa9b30d01496810Withdraw116183582021-10-09 8:47:276 days 11 hrs ago0x6e919f8d0cbf868337bcaab07e59ec9e17f30f38 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.026163655
0xb008aba691cd3d7226ba3a9e8692065953cdf7865dd16ceef7412772afca586aWithdraw115909182021-10-08 9:49:197 days 10 hrs ago0x22334608cff04330168dbde32fdde0213dcf7568 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.02263602
0x1c817f41e2efb59916c88ced2efeffc0d8d3e785d84168f14551b8ddc94a0a2aDeposit BNB115239322021-10-06 1:56:279 days 18 hrs ago0x0b4a6cadd7fdbba228e7edff00a6aceefd935083 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e66 BNB0.021678995
0xcab9729e9cd2a24eef479377535512836bcb865ea38164d2259a9f284f83939bDeposit BNB114656592021-10-04 1:19:0011 days 19 hrs ago0xb5842f3101ff9f4e3049bf5af6d560ffeb803fbe IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e64 BNB0.0202556
0x98d19dce8506bf6ae7e3833fccfec77eff8818a8d9b01aa1a807467cbf03bd59Deposit BNB114475642021-10-03 10:11:3012 days 10 hrs ago0x22334608cff04330168dbde32fdde0213dcf7568 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.1 BNB0.02025455
0x15ef036487c2772cf47fc5dea37d1d1580f3193c5dbe405fadb9368c3232d1feDeposit BNB114192962021-10-02 10:23:5113 days 10 hrs ago0x22334608cff04330168dbde32fdde0213dcf7568 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.05 BNB0.0202556
0xfc38128d995d545911a8dbf712dd0280e64e1504f2e32e1d373b38635ad0f8e6Deposit BNB113948992021-10-01 13:48:0214 days 6 hrs ago0x0a78c1afdf46b6ac1ca454de7abea9809b3911fc IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e64 BNB0.0204056
0x19a13792ee80dec0f11bb0529a791935c18e6d777721cb604d8fe5c70e2b8fb7Withdraw113876192021-10-01 7:40:0614 days 12 hrs ago0x45b426fc8db36a0d3e522f9a6d27cd060d0d8b08 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.023782985
0xfee52e390bdc0607871970ba215b302fe96e336b07217116f873b4edada57e8dDeposit BNB113687252021-09-30 15:46:4315 days 4 hrs ago0x22334608cff04330168dbde32fdde0213dcf7568 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.06 BNB0.020540435
0xe006196f4d2f27fb73607ac237ae501a10f00048ae9110ccb75ef7c18ce3dfabDeposit BNB113685732021-09-30 15:39:0715 days 4 hrs ago0x22334608cff04330168dbde32fdde0213dcf7568 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e61.5 BNB0.021603995
0xa15710ad92218053e346718aa31cda077015e109094dc9276c5e213bde30e12cDeposit BNB113551392021-09-30 4:19:3715 days 16 hrs ago0x8d0d8f12bbb5e75030fb6c3ce0e7048d0ef10a5c IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e61.08 BNB0.021603535
0x5ab88ac90a9b1d53b5527ac4fcb061ab1bdfe87601993a693a9293e775be7525Deposit BNB112553422021-09-26 16:18:1119 days 4 hrs ago0xae9c2e9c15ba7900e7c21377cbf1bfe4a2373d99 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e63.21 BNB0.0181555
0x6b063f1d2502cdf9aa64b48654051a6ab948a7c0f372f5bdb7c37b2909cae685Deposit BNB112491762021-09-26 11:06:4819 days 9 hrs ago0x05ab2d62c6b36345ce6e36355b93afd0c8687f82 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e62 BNB0.02236035
0x01320907f27b92e243011d6238ea693b1773cab6937fcea3b5e7f90e1a7c6521Withdraw110822302021-09-20 15:12:0825 days 5 hrs ago0x736007e2d3a59632ecd4dc5aa7233578205a01f0 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.02310358
0x681f05aab428cc4e96f0afe890e2b440e6f3fe294dd852874e24addebf982af3Withdraw110579792021-09-19 18:57:0826 days 1 hr ago0x736007e2d3a59632ecd4dc5aa7233578205a01f0 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.00394438
0xdd8d212230a75ebb52fba943b0a1d3a5eb7c343839009fec012a03e1a0dfe9faDeposit BNB109844312021-09-17 5:19:4228 days 15 hrs ago0x11ec98e6931a113d29ca6504e767b5d376816afc IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.156450663728072 BNB0.02021699
0x7bbdc177e78e259c0fbf7e3e19b35118a44927a47351e033247367dcb8679675Deposit BNB109599082021-09-16 8:50:0829 days 11 hrs ago0x736007e2d3a59632ecd4dc5aa7233578205a01f0 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.251695766103741 BNB0.022175445
0xd2f244a0356de53bf68d4a3a5cf1a0bec63f1e40362e0e51ee21326627264d00Withdraw108905292021-09-13 22:51:0831 days 21 hrs ago0xbd44a31739cbfb541b3f43992d1f3dcd762a3211 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.02408215
0x23ff09c509c68b168bdf8f66093e6e7dc21e1566075171290a4953021fbda488Withdraw108828612021-09-13 16:27:3332 days 4 hrs ago0xe633fec1daae7b4e2a7f84506780c4b69564aabf IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.02393215
0x005ad10a1ef1c74a9258f97c45cb3e157a94789c19790616ebebf48a510d7ea6Withdraw108345762021-09-12 0:09:1833 days 20 hrs ago0x77b3833b2528cca6f0f7c86e975009fa47ce4149 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.022376195
0x00688a60a4d377a8fae41b1c4dbda70b661245bed3974ac7f70e385c5236f3cbDeposit BNB108334942021-09-11 23:14:0333 days 21 hrs ago0x77b3833b2528cca6f0f7c86e975009fa47ce4149 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.020183250739337 BNB0.02227663
0x1e52e81df14e9448f435aba4aefbb635b9b26a668f69d668a54a7efaa6106d72Withdraw108085352021-09-11 2:14:3134 days 18 hrs ago0x00f0a5c6b4902a1d11daa71db6dc310c4e53e337 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60 BNB0.024232055
0xccc5685796d4e6e9dfcfba6bd3ac6798f1bc52820f374a0e670404418d377e9aDeposit BNB107910792021-09-10 11:27:0935 days 9 hrs ago0xa0c1ff02fcf5662b0cf8b8edf76dc353f831d0c6 IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.091315530847309 BNB0.002956845
0xfd4c30d945ebd00023e5d1537823f48bc5081b7c7d420797d335dabfd1cd9e39Deposit BNB107812542021-09-10 3:11:5935 days 17 hrs ago0xd896a446544fc886168125abaa4c5e727275eddc IN  0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.01 BNB0.004445315
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x22da30ad48bb70b5eaa7febc44e2e8645fa8212e35c344690c8c82b44d140f4f117854972021-10-15 5:35:2014 hrs 59 mins ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60x0b4a6cadd7fdbba228e7edff00a6aceefd9350836.010312718728874771 BNB
0x22da30ad48bb70b5eaa7febc44e2e8645fa8212e35c344690c8c82b44d140f4f117854972021-10-15 5:35:2014 hrs 59 mins ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 PancakeSwap: Router v20.006016329047776651 BNB
0x22da30ad48bb70b5eaa7febc44e2e8645fa8212e35c344690c8c82b44d140f4f117854972021-10-15 5:35:2014 hrs 59 mins ago 0x9fb42fc7e0a312b9f6bcace2851433db4dd23920 0xc0947bd74bb0e0290f3b6442ae32c89712a628e61.435441879927556946 BNB
0x22da30ad48bb70b5eaa7febc44e2e8645fa8212e35c344690c8c82b44d140f4f117854972021-10-15 5:35:2014 hrs 59 mins ago 0x1cc8fb94fa4c5ef7b918ad858abbc8a6c044bf73 0xc0947bd74bb0e0290f3b6442ae32c89712a628e63.00999827350169814 BNB
0x22da30ad48bb70b5eaa7febc44e2e8645fa8212e35c344690c8c82b44d140f4f117854972021-10-15 5:35:2014 hrs 59 mins ago 0xd55fbff3159821f52b28fb477127642996bc5cb4 0xc0947bd74bb0e0290f3b6442ae32c89712a628e61.570888894347396336 BNB
0x5e4a90d08974f0476e111b1368e653609aa12e9d309ee833efa9b30d01496810116183582021-10-09 8:47:276 days 11 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60x6e919f8d0cbf868337bcaab07e59ec9e17f30f381.215752714180595696 BNB
0x5e4a90d08974f0476e111b1368e653609aa12e9d309ee833efa9b30d01496810116183582021-10-09 8:47:276 days 11 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 PancakeSwap: Router v20.00121696968386446 BNB
0x5e4a90d08974f0476e111b1368e653609aa12e9d309ee833efa9b30d01496810116183582021-10-09 8:47:276 days 11 hrs ago 0x9fb42fc7e0a312b9f6bcace2851433db4dd23920 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.290542389550949643 BNB
0x5e4a90d08974f0476e111b1368e653609aa12e9d309ee833efa9b30d01496810116183582021-10-09 8:47:276 days 11 hrs ago 0x1cc8fb94fa4c5ef7b918ad858abbc8a6c044bf73 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.608631800736266008 BNB
0x5e4a90d08974f0476e111b1368e653609aa12e9d309ee833efa9b30d01496810116183582021-10-09 8:47:276 days 11 hrs ago 0xd55fbff3159821f52b28fb477127642996bc5cb4 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.317795493577244505 BNB
0xb008aba691cd3d7226ba3a9e8692065953cdf7865dd16ceef7412772afca586a115909182021-10-08 9:49:197 days 10 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60x22334608cff04330168dbde32fdde0213dcf75681.723173667994557755 BNB
0xb008aba691cd3d7226ba3a9e8692065953cdf7865dd16ceef7412772afca586a115909182021-10-08 9:49:197 days 10 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 PancakeSwap: Router v20.001724898566561118 BNB
0xb008aba691cd3d7226ba3a9e8692065953cdf7865dd16ceef7412772afca586a115909182021-10-08 9:49:197 days 10 hrs ago 0x9fb42fc7e0a312b9f6bcace2851433db4dd23920 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.411795366101884527 BNB
0xb008aba691cd3d7226ba3a9e8692065953cdf7865dd16ceef7412772afca586a115909182021-10-08 9:49:197 days 10 hrs ago 0x1cc8fb94fa4c5ef7b918ad858abbc8a6c044bf73 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.862718317267720899 BNB
0xb008aba691cd3d7226ba3a9e8692065953cdf7865dd16ceef7412772afca586a115909182021-10-08 9:49:197 days 10 hrs ago 0xd55fbff3159821f52b28fb477127642996bc5cb4 0xc0947bd74bb0e0290f3b6442ae32c89712a628e60.450384883191513447 BNB
0x1c817f41e2efb59916c88ced2efeffc0d8d3e785d84168f14551b8ddc94a0a2a115239322021-10-06 1:56:279 days 18 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 0x9fb42fc7e0a312b9f6bcace2851433db4dd239201.4319666 BNB
0x1c817f41e2efb59916c88ced2efeffc0d8d3e785d84168f14551b8ddc94a0a2a115239322021-10-06 1:56:279 days 18 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 0x1cc8fb94fa4c5ef7b918ad858abbc8a6c044bf732.997 BNB
0x1c817f41e2efb59916c88ced2efeffc0d8d3e785d84168f14551b8ddc94a0a2a115239322021-10-06 1:56:279 days 18 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 0xd55fbff3159821f52b28fb477127642996bc5cb41.5650334 BNB
0x1c817f41e2efb59916c88ced2efeffc0d8d3e785d84168f14551b8ddc94a0a2a115239322021-10-06 1:56:279 days 18 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 PancakeSwap: Router v20.006 BNB
0xcab9729e9cd2a24eef479377535512836bcb865ea38164d2259a9f284f83939b114656592021-10-04 1:19:0011 days 19 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 0x9fb42fc7e0a312b9f6bcace2851433db4dd239200.9546444 BNB
0xcab9729e9cd2a24eef479377535512836bcb865ea38164d2259a9f284f83939b114656592021-10-04 1:19:0011 days 19 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 0x1cc8fb94fa4c5ef7b918ad858abbc8a6c044bf731.998 BNB
0xcab9729e9cd2a24eef479377535512836bcb865ea38164d2259a9f284f83939b114656592021-10-04 1:19:0011 days 19 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 0xd55fbff3159821f52b28fb477127642996bc5cb41.0433556 BNB
0xcab9729e9cd2a24eef479377535512836bcb865ea38164d2259a9f284f83939b114656592021-10-04 1:19:0011 days 19 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 PancakeSwap: Router v20.004 BNB
0x98d19dce8506bf6ae7e3833fccfec77eff8818a8d9b01aa1a807467cbf03bd59114475642021-10-03 10:11:3012 days 10 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 0x9fb42fc7e0a312b9f6bcace2851433db4dd239200.02386611 BNB
0x98d19dce8506bf6ae7e3833fccfec77eff8818a8d9b01aa1a807467cbf03bd59114475642021-10-03 10:11:3012 days 10 hrs ago 0xc0947bd74bb0e0290f3b6442ae32c89712a628e6 0x1cc8fb94fa4c5ef7b918ad858abbc8a6c044bf730.04995 BNB
[ Download CSV Export 
Loading

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

Contract Name:
FeedVaultBNB

Compiler Version
v0.7.3+commit.9bfce1f6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 13 : FeedVaultBNB.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./FeedVault.sol";

contract FeedVaultBNB is FeedVault {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;

    /**
     * @dev Constructor
     */
    constructor(
        address _entryFeesCollector,
        address _exitFeesCollector,
        address _swapRouterAddress
    ) {
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setupRole(ADMIN_ROLE, msg.sender);
        _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);
        _setupRole(MANAGER_ROLE, msg.sender);
        _setRoleAdmin(MANAGER_ROLE, ADMIN_ROLE);

        entryFeesCollector = _entryFeesCollector;
        exitFeesCollector = _exitFeesCollector;
        swapRouterAddress = _swapRouterAddress;
        entryFeesToTokenPath = [wBNB, entrySwapToken];
        exitFeesToTokenPath = [wBNB, exitSwapToken];
    }

    receive() external payable {}

    /**
     * @dev Add target vault
     */
    function addTargetVault(address _targetVault, uint256 _allocPoint)
        public
        override
        onlyRole(MANAGER_ROLE)
        nonDuplicated(_targetVault)
        nonReentrant
    {
        require(_targetVault != address(0), "FeedVault(addTargetVault): Target vault cannot be zero address");
        require(
            ITargetVault(_targetVault).feedVault() == address(this),
            "FeedVault(addTargetVault): Target vault feed vault target is not this vault"
        );
        totalAllocPoint = totalAllocPoint.add(_allocPoint);
        vaultExistence[_targetVault] = true;
        vaultInfo.push(VaultInfo({enabled: true, targetVault: _targetVault, allocPoint: _allocPoint}));
        vaultIdForTargetVaultAddress[_targetVault] = vaultInfo.length - 1;
    }

    function deposit(uint256 _amount) public override isEnabled hasVaults nonReentrant {}

    /**
     * @dev Deposit Fund to FeedVault
     */
    function depositBNB() public payable isEnabled hasVaults nonReentrant {
        // Collect Target Vaults Profit Shares
        uint256 length = vaultInfo.length;
        for (uint256 i = 0; i < length; i++) {
            if (ITargetVault(vaultInfo[i].targetVault).balanceOfToken() > 0) ITargetVault(vaultInfo[i].targetVault).collectFees();
        }

        uint256 _beforeDepositBalance = depositedTokenBalance(false);

        // Transfer BNB from Depositor to Vault
        uint256 _amount = msg.value;

        // Collect Entry Fees
        uint256 _entryFees = _amount.mul(entryFeesBP).div(10000);
        if (_entryFees > 0) {
            if (autoSwapEntryFees) {
                uint256 buyBackBefore = IERC20(entrySwapToken).balanceOf(address(this));
                uint256[] memory amounts = IPancakeRouter02(swapRouterAddress).getAmountsOut(_entryFees, entryFeesToTokenPath);
                uint256 amountOut = amounts[amounts.length.sub(1)];
                IPancakeRouter02(swapRouterAddress).swapExactETHForTokensSupportingFeeOnTransferTokens{value: _entryFees}(
                    amountOut.mul(slippageFactor).div(1000),
                    entryFeesToTokenPath,
                    address(this),
                    block.timestamp + 120
                );
                uint256 buyBackAfter = IERC20(entrySwapToken).balanceOf(address(this));
                uint256 buyBackAmount = buyBackAfter.sub(buyBackBefore);
                IERC20(entrySwapToken).safeTransfer(entryFeesCollector, buyBackAmount);

                emit FeesCollected(true, address(entryFeesCollector), address(entrySwapToken), _entryFees);
            } else {
                payable(address(entryFeesCollector)).transfer(_entryFees);
            }
        }

        // Allocate to vaults in order to get new vaults balance
        _allocate();

        // Get Pool Balance after deposited
        uint256 _afterDepositBalance = depositedTokenBalance(false);

        // Additional check for deflationary tokens
        uint256 _balance = 0;
        if (_afterDepositBalance >= _beforeDepositBalance) {
            _balance = _afterDepositBalance.sub(_beforeDepositBalance);
        }

        if (_balance > 0) {
            uint256 shares = 0;
            if (totalShares == 0) {
                shares = _balance;
            } else {
                shares = (_balance.mul(totalShares)).div(_beforeDepositBalance);
            }
            UserInfo storage user = userInfo[address(msg.sender)];
            totalShares = totalShares.add(shares);
            user.shares = user.shares.add(shares);
            user.depositedAt = block.number;
        }

        emit Deposited(address(msg.sender), _balance);
    }

    /**
     * @dev Deposit from FeedVault to TargetVault
     */
    function _depositToVault(uint256 _vid, uint256 _amount) internal override {
        uint256 _balance = address(this).balance;
        if (_balance < _amount) {
            _amount = _balance;
        }
        if (_amount > 0) {
            payable(address(vaultInfo[_vid].targetVault)).transfer(_amount);
            ITargetVault(vaultInfo[_vid].targetVault).deposit();
        }
    }

    /**
     * @dev Withdraw fund from FeedVault
     */
    function withdraw(uint256 _shares) public override isEnabled hasVaults nonReentrant {
        UserInfo storage user = userInfo[address(msg.sender)];
        require(user.depositedAt != block.number, "FeedVault(withdraw): withdraw cannot be the same block as deposit");

        // Collect Target Vaults Profit Shares
        uint256 length = vaultInfo.length;
        for (uint256 i = 0; i < length; i++) {
            if (ITargetVault(vaultInfo[i].targetVault).balanceOfToken() > 0) ITargetVault(vaultInfo[i].targetVault).collectFees();
        }

        uint256 _tokenInShares = tokenBalance().mul(_shares).div(totalShares);
        uint256 _tokenInVault = address(this).balance;
        totalShares = totalShares.sub(_shares);
        user.shares = user.shares.sub(_shares);

        uint256 _tokenAmount = 0;

        if (_tokenInVault >= _tokenInShares) {
            _tokenAmount = _tokenInShares;
        } else {
            uint256 length = vaultInfo.length;
            uint256 remaining = _tokenInShares.sub(_tokenInVault);
            uint256 depositedToken = depositedTokenBalance(false);
            for (uint256 i = 0; i < length; i++) {
                if (vaultInfo[i].enabled) {
                    uint256 _before = address(this).balance;
                    uint256 _withdrawVaultAmount =
                        (ITargetVault(vaultInfo[i].targetVault).balanceOf()).mul(remaining).div(depositedToken);
                    _withdrawFromVault(i, _withdrawVaultAmount);
                    uint256 _after = address(this).balance;
                    _tokenAmount = _tokenAmount.add(_after.sub(_before));
                }
            }
            _tokenAmount += _tokenInVault;

            if (_tokenAmount > _tokenInShares) {
                _tokenAmount = _tokenInShares;
            }
        }

        // Collect Exit Fees
        uint256 _exitFees = _tokenAmount.mul(entryFeesBP).div(10000);
        if (_exitFees > 0) {
            if (autoSwapEntryFees) {
                uint256 buyBackBefore = IERC20(exitSwapToken).balanceOf(address(this));
                uint256[] memory amounts = IPancakeRouter02(swapRouterAddress).getAmountsOut(_exitFees, exitFeesToTokenPath);
                uint256 amountOut = amounts[amounts.length.sub(1)];
                IPancakeRouter02(swapRouterAddress).swapExactETHForTokensSupportingFeeOnTransferTokens{value: _exitFees}(
                    amountOut.mul(slippageFactor).div(1000),
                    exitFeesToTokenPath,
                    address(this),
                    block.timestamp + 120
                );
                uint256 buyBackAfter = IERC20(exitSwapToken).balanceOf(address(this));
                uint256 buyBackAmount = buyBackAfter.sub(buyBackBefore);
                IERC20(exitSwapToken).safeTransfer(exitFeesCollector, buyBackAmount);

                emit FeesCollected(true, address(exitFeesCollector), address(exitSwapToken), _exitFees);
            } else {
                payable(address(exitFeesCollector)).transfer(_exitFees);
            }

            _tokenAmount = _tokenAmount.sub(_exitFees);
        }

        msg.sender.transfer(_tokenAmount);

        emit Withdrawed(address(msg.sender), _tokenAmount);
    }

    /**
     * @dev Set entry swap token address
     */
    function setEntrySwapToken(address _entrySwapToken) public override onlyRole(ADMIN_ROLE) nonReentrant {
        require(_entrySwapToken != address(0), "FeedVault(setEntrySwapToken): entry swap token cannot be zero address");

        entrySwapToken = _entrySwapToken;

        entryFeesToTokenPath = [wBNB, entrySwapToken];

        emit EntrySwapTokenChanged(entrySwapToken);
    }

    /**
     * @dev Set exit swap token address
     */
    function setExitSwapToken(address _exitSwapToken) public override onlyRole(ADMIN_ROLE) nonReentrant {
        require(_exitSwapToken != address(0), "FeedVault(setExitSwapToken): exit swap token cannot be zero address");

        exitSwapToken = _exitSwapToken;

        exitFeesToTokenPath = [wBNB, exitSwapToken];

        emit ExitSwapTokenChanged(exitSwapToken);
    }

    /**
     * @dev Balance of token in FeedVault
     */
    function availableTokenBalance() public view override returns (uint256) {
        return address(this).balance;
    }
}

File 2 of 13 : 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 3 of 13 : 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 4 of 13 : FeedVault.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../interfaces/targetVaults/ITargetVault.sol";
import "../interfaces/IPancakeRouter02.sol";

abstract contract FeedVault is AccessControl, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;

    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
    bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");

    /**
     * @dev Token accepted by Vault
     */
    IERC20 public token;

    /**
     * @dev Array for Vaults
     */
    struct VaultInfo {
        bool enabled;
        address targetVault;
        uint256 allocPoint;
    }
    VaultInfo[] public vaultInfo;

    /**
     * @dev Array for Users
     */
    struct UserInfo {
        uint256 shares;
        uint256 depositedAt;
    }

    /**
     * @dev Total Shares issued
     */
    uint256 public totalShares;

    /**
     * @dev Total allocation points. Must be the sum of all allocation points in all pools.
     */
    uint256 public totalAllocPoint = 0;

    /**
     * @dev Wrapped BNB
     */
    address public constant wBNB = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;

    /**
     * @dev Swap token address
     */
    address public entrySwapToken = 0x67d66e8Ec1Fd25d98B3Ccd3B19B7dc4b4b7fC493;
    address public exitSwapToken = 0x67d66e8Ec1Fd25d98B3Ccd3B19B7dc4b4b7fC493;

    /**
     * @dev Fees basis points
     */
    uint256 public entryFeesBP = 10;
    uint256 public exitFeesBP = 10;

    /**
     * @dev Maximum Fees Basis points
     */
    uint256 public constant MAXIMUM_ENTRY_FEES_BP = 50;
    uint256 public constant MAXIMUM_EXIT_FEES_BP = 50;

    /**
     * @dev Auto Swap Fees options
     */
    bool public autoSwapEntryFees = true;
    bool public autoSwapExitFees = true;

    /**
     * @dev Auto Swap Fees Token and Path
     */
    address[] public entryFeesToTokenPath;
    address[] public exitFeesToTokenPath;

    /**
     * @dev FeesCollector addresses
     */
    address public entryFeesCollector;
    address public exitFeesCollector;

    /**
     * @dev Slippage factor default at 5% tolerance
     */
    uint256 public slippageFactor = 950;

    /**
     * @dev Maximum slippage factor */
    uint256 public constant slippageFactorMax = 995;

    /**
     * @dev Swap Router Address
     */
    address public swapRouterAddress;

    /**
     * @dev Boolean, that if true, disables the target vault
     */
    bool private _vaultDisabled = false;

    /**
     * @dev Mapping, list of users
     */
    mapping(address => UserInfo) public userInfo;

    /**
     * @dev Mapping, list of vaults
     */
    mapping(address => bool) public vaultExistence;

    /**
     * @dev Mapping, target vault ID by address
     */
    mapping(address => uint256) public vaultIdForTargetVaultAddress;

    /**
     * @dev Emitted when vault is enabled
     */
    event VaultEnabled();

    /**
     * @dev Emitted when vault is disabled
     */
    event VaultDisabled();

    /**
     * @dev Emitted when fees collected
     */
    event FeesCollected(bool isEntryFees, address indexed feesCollector, address indexed token, uint256 _amount);

    /**
     * @dev Emitted when entry fees basis points changed
     */
    event EntryFeesBPChanged(uint256 _feesBP);

    /**
     * @dev Emitted when exit fees basis points changed
     */
    event ExitFeesBPChanged(uint256 _feesBP);

    /**
     * @dev Emitted when fees collector address changed
     */
    event EntryFeesCollectorChanged(address _feesCollector);
    event ExitFeesCollectorChanged(address _feesCollector);

    /**
     * @dev Emitted when entry and exit swap token address changed
     */
    event EntrySwapTokenChanged(address _entrySwapToken);
    event ExitSwapTokenChanged(address _exitSwapToken);

    /**
     * @dev Emitted when swap router address changed
     */
    event SwapRouterChanged(address _router);

    /**
     * @dev Emitted when auto swap settings for entry or exit fees changed
     */
    event AutoSwapEntryFees(bool _status);
    event AutoSwapExitFees(bool _status);

    /**
     * @dev Emitted when user deposited to vault
     */
    event Deposited(address indexed from, uint256 _amount);

    /**
     * @dev Emitted when withdraw from vault
     */
    event Withdrawed(address indexed to, uint256 _amount);

    /**
     * @dev Emitted when slippage factor changed
     */
    event SlippageFactorChanged(uint256 _slippageFactor);

    /**
     * @dev Throws if vault is disabled
     */
    modifier isEnabled() {
        require(!_vaultDisabled, "FeedVault: vault is disabled");
        _;
    }

    /**
     * @dev Throws if caller does not has role
     */
    modifier onlyRole(bytes32 _role) {
        require(hasRole(_role, msg.sender), "FeedVault: Caller has no role");
        _;
    }

    /**
     * @dev Thorws if has no vault
     */
    modifier hasVaults() {
        require(vaultInfo.length > 0, "FeedVault: No target vault");
        _;
    }

    /**
     * @dev Throws if duplicated target vault
     */
    modifier nonDuplicated(address _targetVault) {
        require(!vaultExistence[_targetVault], "FeedVault: Duplicated vault");
        _;
    }

    /**
     * @dev Throws if vault does not exists
     */
    modifier vaultExistsById(uint256 _vid) {
        require(_vid < vaultInfo.length, "FeedVault: Vault does not exists");
        _;
    }

    /**
     * @dev Enable vault for upgrade or security purposes
     */
    function enableVault() public onlyRole(ADMIN_ROLE) nonReentrant {
        require(_vaultDisabled, "FeedVault(enableVault): Vault is already enabled");
        _vaultDisabled = false;

        emit VaultEnabled();
    }

    /**
     * @dev Disable vault for upgrade or security purposes
     */
    function disableVault() public onlyRole(ADMIN_ROLE) nonReentrant {
        require(!_vaultDisabled, "FeedVault(disableVault): Vault is already disabled");
        _vaultDisabled = true;

        emit VaultDisabled();
    }

    /**
     * @dev Balance of token in FeedVault
     */
    function availableTokenBalance() public view virtual returns (uint256) {
        return token.balanceOf(address(this));
    }

    /**
     * @dev Balance of token in TargetVaults
     */
    function depositedBalance() public view virtual returns (uint256) {
        uint256 length = vaultInfo.length;
        uint256 _balance = 0;
        for (uint256 i = 0; i < length; i++) {
            uint256 _balanceOf =
                ITargetVault(vaultInfo[i].targetVault).vaultBalance().mul(vaultInfo[i].allocPoint).div(totalAllocPoint);
            _balance = _balance.add(_balanceOf);
        }
        return _balance;
    }

    /**
     * @dev Balance of token in TargetVaults
     */
    function depositedTokenBalance(bool _cachedPrice) public view virtual returns (uint256) {
        uint256 length = vaultInfo.length;
        uint256 _balance = 0;
        for (uint256 i = 0; i < length; i++) {
            if (vaultInfo[i].enabled) {
                uint256 _balanceOfToken = 0;
                if (!_cachedPrice) {
                    _balanceOfToken = ITargetVault(vaultInfo[i].targetVault).balanceOfToken();
                } else {
                    _balanceOfToken = ITargetVault(vaultInfo[i].targetVault)
                        .vaultBalance()
                        .mul(ITargetVault(vaultInfo[i].targetVault).cachedPricePerShare())
                        .div(1e18);
                }
                _balance = _balance.add(_balanceOfToken);
            }
        }
        return _balance;
    }

    /**
     * @dev Total balance of token in FeedVault and TargetVaults combined
     */
    function tokenBalance() public view virtual returns (uint256) {
        return availableTokenBalance().add(depositedTokenBalance(false));
    }

    /**
     * @dev Add target vault
     */
    function addTargetVault(address _targetVault, uint256 _allocPoint)
        public
        virtual
        onlyRole(MANAGER_ROLE)
        nonDuplicated(_targetVault)
        nonReentrant
    {
        require(_targetVault != address(0), "FeedVault(addTargetVault): Target vault cannot be zero address");
        require(
            address(ITargetVault(_targetVault).token()) == address(token),
            "FeedVault(addTargetVault): Target vault token is not the same"
        );
        require(
            ITargetVault(_targetVault).vaultToken() == address(token),
            "FeedVault(addTargetVault): Target vault strategy token is not the same"
        );
        require(
            ITargetVault(_targetVault).feedVault() == address(this),
            "FeedVault(addTargetVault): Target vault feed vault target is not this vault"
        );
        totalAllocPoint = totalAllocPoint.add(_allocPoint);
        vaultExistence[_targetVault] = true;
        vaultInfo.push(VaultInfo({enabled: true, targetVault: _targetVault, allocPoint: _allocPoint}));
        vaultIdForTargetVaultAddress[_targetVault] = vaultInfo.length - 1;
    }

    /**
     * @dev Update target vault
     */
    function setTargetVault(uint256 _vid, uint256 _allocPoint) public onlyRole(MANAGER_ROLE) {
        totalAllocPoint = totalAllocPoint.sub(vaultInfo[_vid].allocPoint).add(_allocPoint);
        vaultInfo[_vid].allocPoint = _allocPoint;
    }

    /**
     * @dev Toggle enable status of target vault
     */
    function toggleTargetVault(uint256 _vid, bool _status) public onlyRole(ADMIN_ROLE) nonReentrant {
        vaultInfo[_vid].enabled = _status;
    }

    /**
     * @dev Update multiple target vaults alloc point
     */
    function setAllocPoints(uint256[] memory _allocPoints) public onlyRole(MANAGER_ROLE) nonReentrant {
        require(_allocPoints.length == vaultInfo.length, "FeedVault(setAllocPoints): number of vaults is incorrect");
        uint256 length = vaultInfo.length;
        for (uint256 i = 0; i < length; i++) {
            setTargetVault(i, _allocPoints[i]);
        }
    }

    /**
     * @dev Deposit Fund to FeedVault
     */
    function deposit(uint256 _amount) public virtual isEnabled hasVaults nonReentrant {
        // Collect Target Vaults Profit Shares
        uint256 length = vaultInfo.length;
        for (uint256 i = 0; i < length; i++) {
            if (vaultInfo[i].enabled && ITargetVault(vaultInfo[i].targetVault).balanceOfToken() > 0)
                ITargetVault(vaultInfo[i].targetVault).collectFees();
        }

        uint256 _beforeDepositBalance = depositedTokenBalance(false);

        // Transfer Token from Depositor to Vault
        token.safeTransferFrom(address(msg.sender), address(this), _amount);

        // Collect Entry Fees
        uint256 _entryFees = _amount.mul(entryFeesBP).div(10000);
        if (_entryFees > 0) {
            if (autoSwapEntryFees) {
                uint256 buyBackBefore = IERC20(entrySwapToken).balanceOf(address(this));
                uint256[] memory amounts = IPancakeRouter02(swapRouterAddress).getAmountsOut(_entryFees, entryFeesToTokenPath);
                uint256 amountOut = amounts[amounts.length.sub(1)];
                IERC20(token).safeIncreaseAllowance(swapRouterAddress, _entryFees);
                IPancakeRouter02(swapRouterAddress).swapExactTokensForTokensSupportingFeeOnTransferTokens(
                    _entryFees,
                    amountOut.mul(slippageFactor).div(1000),
                    entryFeesToTokenPath,
                    address(this),
                    block.timestamp + 120
                );
                uint256 buyBackAfter = IERC20(entrySwapToken).balanceOf(address(this));
                uint256 buyBackAmount = buyBackAfter.sub(buyBackBefore);
                IERC20(entrySwapToken).safeTransfer(entryFeesCollector, buyBackAmount);

                emit FeesCollected(true, address(entryFeesCollector), address(entrySwapToken), _entryFees);
            } else {
                IERC20(token).safeTransfer(entryFeesCollector, _entryFees);
            }
        }

        // Allocate to vaults in order to get new vaults balance
        _allocate();

        // Get Pool Balance after deposited
        uint256 _afterDepositBalance = depositedTokenBalance(false);

        // Additional check for deflationary tokens
        uint256 _balance = 0;
        if (_afterDepositBalance >= _beforeDepositBalance) {
            _balance = _afterDepositBalance.sub(_beforeDepositBalance);
        }

        if (_balance > 0) {
            uint256 shares = 0;
            if (totalShares == 0) {
                shares = _balance;
            } else {
                shares = (_balance.mul(totalShares)).div(_beforeDepositBalance);
            }
            UserInfo storage user = userInfo[address(msg.sender)];
            totalShares = totalShares.add(shares);
            user.shares = user.shares.add(shares);
            user.depositedAt = block.number;
        }

        emit Deposited(address(msg.sender), _balance);
    }

    /**
     * @dev Deposit all sender's fund to FeedVault
     */
    function depositAll() public virtual isEnabled hasVaults {
        deposit(token.balanceOf(msg.sender));
    }

    /**
     * @dev Withdraw fund from FeedVault
     */
    function withdraw(uint256 _shares) public virtual isEnabled hasVaults nonReentrant {
        UserInfo storage user = userInfo[address(msg.sender)];
        require(user.depositedAt != block.number, "FeedVault(withdraw): withdraw cannot be the same block as deposit");

        // Collect Target Vaults Profit Shares
        uint256 length = vaultInfo.length;
        for (uint256 i = 0; i < length; i++) {
            if (vaultInfo[i].enabled && ITargetVault(vaultInfo[i].targetVault).balanceOfToken() > 0)
                ITargetVault(vaultInfo[i].targetVault).collectFees();
        }
        uint256 _tokenInShares = tokenBalance().mul(_shares).div(totalShares);
        uint256 _tokenInVault = token.balanceOf(address(this));
        totalShares = totalShares.sub(_shares);
        user.shares = user.shares.sub(_shares);

        uint256 _tokenAmount = 0;

        if (_tokenInVault >= _tokenInShares) {
            _tokenAmount = _tokenInShares;
        } else {
            uint256 length = vaultInfo.length;
            uint256 remaining = _tokenInShares.sub(_tokenInVault);
            uint256 depositedToken = depositedTokenBalance(false);
            for (uint256 i = 0; i < length; i++) {
                if (vaultInfo[i].enabled) {
                    uint256 _before = token.balanceOf(address(this));
                    uint256 _withdrawVaultAmount =
                        (ITargetVault(vaultInfo[i].targetVault).balanceOf()).mul(remaining).div(depositedToken);
                    _withdrawFromVault(i, _withdrawVaultAmount);
                    uint256 _after = token.balanceOf(address(this));
                    _tokenAmount = _tokenAmount.add(_after.sub(_before));
                }
            }
            _tokenAmount += _tokenInVault;

            if (_tokenAmount > _tokenInShares) {
                _tokenAmount = _tokenInShares;
            }
        }

        // Collect Exit Fees
        uint256 _exitFees = _tokenAmount.mul(entryFeesBP).div(10000);
        if (_exitFees > 0) {
            if (autoSwapExitFees) {
                uint256 buyBackBefore = IERC20(exitSwapToken).balanceOf(address(this));
                uint256[] memory amounts = IPancakeRouter02(swapRouterAddress).getAmountsOut(_exitFees, exitFeesToTokenPath);
                uint256 amountOut = amounts[amounts.length.sub(1)];
                IERC20(token).safeIncreaseAllowance(swapRouterAddress, _exitFees);
                IPancakeRouter02(swapRouterAddress).swapExactTokensForTokensSupportingFeeOnTransferTokens(
                    _exitFees,
                    amountOut.mul(slippageFactor).div(1000),
                    exitFeesToTokenPath,
                    address(this),
                    block.timestamp + 120
                );
                uint256 buyBackAfter = IERC20(exitSwapToken).balanceOf(address(this));
                uint256 buyBackAmount = buyBackAfter.sub(buyBackBefore);
                IERC20(exitSwapToken).safeTransfer(exitFeesCollector, buyBackAmount);

                emit FeesCollected(false, address(exitFeesCollector), address(exitSwapToken), _exitFees);
            } else {
                IERC20(token).safeTransfer(exitFeesCollector, _exitFees);
            }

            _tokenAmount = _tokenAmount.sub(_exitFees);
        }

        token.safeTransfer(msg.sender, _tokenAmount);

        emit Withdrawed(address(msg.sender), _tokenAmount);
    }

    /**
     * @dev Deposit from FeedVault to TargetVault
     */
    function _depositToVault(uint256 _vid, uint256 _amount) internal virtual {
        uint256 _balance = IERC20(token).balanceOf(address(this));
        if (_balance < _amount) {
            _amount = _balance;
        }
        if (_amount > 0) {
            token.safeTransfer(vaultInfo[_vid].targetVault, _amount);
            ITargetVault(vaultInfo[_vid].targetVault).deposit();
        }
    }

    /**
     * @dev Deposit from FeedVault to TargetVault by Manager
     */
    function depositToVault(uint256 _vid, uint256 _amount) public virtual vaultExistsById(_vid) onlyRole(MANAGER_ROLE) nonReentrant {
        _depositToVault(_vid, _amount);
    }

    /**
     * @dev Withdraw from TargetVault to FeedVault
     */
    function _withdrawFromVault(uint256 _vid, uint256 _amount) internal virtual {
        ITargetVault(vaultInfo[_vid].targetVault).withdraw(_amount);
    }

    /**
     * @dev Withdraw from TargetVault to FeedVault by Manager
     */
    function withdrawFromVault(uint256 _vid, uint256 _amount)
        public
        virtual
        vaultExistsById(_vid)
        onlyRole(MANAGER_ROLE)
        nonReentrant
    {
        if (_amount > 0) {
            _withdrawFromVault(_vid, _amount);
        }
    }

    /**
     * @dev Allocate balance to all TargetVaults
     */
    function _allocate() internal virtual isEnabled {
        // Get available balance in vault
        uint256 _balance = availableTokenBalance();

        if (_balance > 0) {
            uint256 length = vaultInfo.length;
            for (uint256 i = 0; i < length; i++) {
                if (vaultInfo[i].enabled) {
                    uint256 _amount = _balance.mul(vaultInfo[i].allocPoint).div(totalAllocPoint);
                    _depositToVault(i, _amount);
                }
            }
        }
    }

    /**
     * @dev Allocate balance to all TargetVaults by Manager
     */
    function allocate() public virtual onlyRole(MANAGER_ROLE) nonReentrant {
        _allocate();
    }

    /**
     * @dev Get vault length
     */
    function vaultLength() public view returns (uint256) {
        return vaultInfo.length;
    }

    /**
     * @dev Get Vault ID by Token
     */
    function getTargetVaultIdForStrategy(address _targetVault) external view returns (uint256) {
        require(vaultExistence[_targetVault], "FeedVault: Token does not exists in any vault");
        return vaultIdForTargetVaultAddress[_targetVault];
    }

    /**
     * @dev Reallocate based on allocation point
     */
    function reallocate() public onlyRole(MANAGER_ROLE) isEnabled hasVaults nonReentrant {
        uint256 _balance = depositedTokenBalance(false);
        uint256 length = vaultInfo.length;
        for (uint256 i = 0; i < length; i++) {
            if (vaultInfo[i].enabled) {
                uint256 _tvBalance = ITargetVault(vaultInfo[i].targetVault).balanceOfToken();
                uint256 _expectedBalance = _balance.mul(vaultInfo[i].allocPoint).div(totalAllocPoint);
                uint256 _amount = 0;
                if (_tvBalance > _expectedBalance) {
                    if (vaultInfo[i].allocPoint == 0) {
                        _amount = ITargetVault(vaultInfo[i].targetVault).balanceOf();
                    } else {
                        _amount = _tvBalance.sub(_expectedBalance).mul(1e18).div(
                            ITargetVault(vaultInfo[i].targetVault).targetPricePerShare()
                        );
                    }
                    _withdrawFromVault(i, _amount);
                }
            }
        }

        uint256 _totalBalance = tokenBalance();
        for (uint256 i = 0; i < length; i++) {
            if (vaultInfo[i].enabled) {
                uint256 _tvBalance = ITargetVault(vaultInfo[i].targetVault).balanceOfToken();
                uint256 _expectedBalance = _totalBalance.mul(vaultInfo[i].allocPoint).div(totalAllocPoint);
                if (_tvBalance < _expectedBalance) {
                    uint256 _diffBalance = _expectedBalance.sub(_tvBalance);
                    if (availableTokenBalance() < _diffBalance) {
                        _depositToVault(i, availableTokenBalance());
                    } else {
                        _depositToVault(i, _diffBalance);
                    }
                }
            }
        }
    }

    /**
     * @dev Set entry fees collector address
     */
    function setEntryFeesCollector(address _feesCollector) public onlyRole(ADMIN_ROLE) nonReentrant {
        require(_feesCollector != address(0), "TargetVault(setEntryFeesCollector): entry fees collector cannot be zero address");

        entryFeesCollector = _feesCollector;

        emit EntryFeesCollectorChanged(entryFeesCollector);
    }

    /**
     * @dev Set exit fees collector address
     */
    function setExitFeesCollector(address _feesCollector) public onlyRole(ADMIN_ROLE) nonReentrant {
        require(_feesCollector != address(0), "TargetVault(setExitFeesCollector): exit fees collector cannot be zero address");

        exitFeesCollector = _feesCollector;

        emit ExitFeesCollectorChanged(exitFeesCollector);
    }

    /**
     * @dev Set entry fees basis points
     */
    function setEntryFeesBP(uint256 _feesBP) public onlyRole(ADMIN_ROLE) nonReentrant {
        require(_feesBP <= MAXIMUM_ENTRY_FEES_BP, "TargetVault(setFees): entry fees basis points exceeds threshold");

        entryFeesBP = _feesBP;

        emit EntryFeesBPChanged(entryFeesBP);
    }

    /**
     * @dev Set exit fees basis points
     */
    function setExitFeesBP(uint256 _feesBP) public onlyRole(ADMIN_ROLE) nonReentrant {
        require(_feesBP <= MAXIMUM_EXIT_FEES_BP, "FeedVault(setFees): entry fees basis points exceeds threshold");

        exitFeesBP = _feesBP;

        emit ExitFeesBPChanged(exitFeesBP);
    }

    /**
     * @dev Set swap router address
     */
    function setSwapRouterAddress(address _router) public onlyRole(ADMIN_ROLE) nonReentrant {
        require(_router != address(0), "FeedVault(setSwapRouterAddress): swap router cannot be zero address");

        swapRouterAddress = _router;

        emit SwapRouterChanged(swapRouterAddress);
    }

    /**
     * @dev Set entry swap token address
     */
    function setEntrySwapToken(address _entrySwapToken) public virtual onlyRole(ADMIN_ROLE) nonReentrant {
        require(_entrySwapToken != address(0), "FeedVault(setEntrySwapToken): entry swap token cannot be zero address");

        entrySwapToken = _entrySwapToken;

        entryFeesToTokenPath = [address(token), wBNB, entrySwapToken];

        emit EntrySwapTokenChanged(entrySwapToken);
    }

    /**
     * @dev Set exit swap token address
     */
    function setExitSwapToken(address _exitSwapToken) public virtual onlyRole(ADMIN_ROLE) nonReentrant {
        require(_exitSwapToken != address(0), "FeedVault(setExitSwapToken): entry swap token cannot be zero address");

        exitSwapToken = _exitSwapToken;

        exitFeesToTokenPath = [address(token), wBNB, exitSwapToken];

        emit ExitSwapTokenChanged(exitSwapToken);
    }

    /**
     * @dev Set auto buy back entry fees on and off
     */
    function setEntryAutoSwap(bool _status) public onlyRole(ADMIN_ROLE) nonReentrant {
        autoSwapEntryFees = _status;

        emit AutoSwapEntryFees(autoSwapEntryFees);
    }

    /**
     * @dev Set auto buy back exit fees on and off
     */
    function setExitAutoSwap(bool _status) public onlyRole(ADMIN_ROLE) nonReentrant {
        autoSwapExitFees = _status;

        emit AutoSwapExitFees(autoSwapExitFees);
    }

    /**
     * @dev Set slippage factor
     */
    function setSlippageFactor(uint256 _slippageFactor) public onlyRole(ADMIN_ROLE) nonReentrant {
        require(_slippageFactor <= slippageFactorMax, "TargetVault(setSlippageFactor): slippageFactor too high");
        slippageFactor = _slippageFactor;

        emit SlippageFactorChanged(slippageFactor);
    }
}

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

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

File 6 of 13 : 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 7 of 13 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 8 of 13 : 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 9 of 13 : ITargetVault.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;

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

interface ITargetVault {
    function token() external view returns (IERC20);

    function feedVault() external view returns (address);

    function vaultToken() external view returns (address);

    function cachedPricePerShare() external view returns (uint256);

    function balanceOf() external view returns (uint256);

    function availableBalance() external view returns (uint256);

    function targetPricePerShare() external view returns (uint256);

    function balanceOfToken() external view returns (uint256);

    function vaultBalance() external view returns (uint256);

    function deposit() external;

    function withdraw(uint256 _amount) external;

    function collectFees() external;

    function retireTargetVault() external;
}

File 10 of 13 : IPancakeRouter02.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

import "./IPancakeRouter01.sol";

interface IPancakeRouter02 is IPancakeRouter01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountETH);

    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

File 11 of 13 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

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

interface IPancakeRouter01 {
    function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    )
        external
        returns (
            uint256 amountA,
            uint256 amountB,
            uint256 liquidity
        );

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (
            uint256 amountToken,
            uint256 amountETH,
            uint256 liquidity
        );

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETH(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);

    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function swapExactETHForTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function getAmountOut(
        uint256 amountIn,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountOut);

    function getAmountIn(
        uint256 amountOut,
        uint256 reserveIn,
        uint256 reserveOut
    ) external pure returns (uint256 amountIn);

    function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts);

    function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_entryFeesCollector","type":"address"},{"internalType":"address","name":"_exitFeesCollector","type":"address"},{"internalType":"address","name":"_swapRouterAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"AutoSwapEntryFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"_status","type":"bool"}],"name":"AutoSwapExitFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_feesBP","type":"uint256"}],"name":"EntryFeesBPChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_feesCollector","type":"address"}],"name":"EntryFeesCollectorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_entrySwapToken","type":"address"}],"name":"EntrySwapTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_feesBP","type":"uint256"}],"name":"ExitFeesBPChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_feesCollector","type":"address"}],"name":"ExitFeesCollectorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_exitSwapToken","type":"address"}],"name":"ExitSwapTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isEntryFees","type":"bool"},{"indexed":true,"internalType":"address","name":"feesCollector","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"FeesCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_slippageFactor","type":"uint256"}],"name":"SlippageFactorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_router","type":"address"}],"name":"SwapRouterChanged","type":"event"},{"anonymous":false,"inputs":[],"name":"VaultDisabled","type":"event"},{"anonymous":false,"inputs":[],"name":"VaultEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Withdrawed","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_ENTRY_FEES_BP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAXIMUM_EXIT_FEES_BP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_targetVault","type":"address"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"addTargetVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allocate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"autoSwapEntryFees","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"autoSwapExitFees","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availableTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositBNB","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositToVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositedBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_cachedPrice","type":"bool"}],"name":"depositedTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"entryFeesBP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entryFeesCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"entryFeesToTokenPath","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entrySwapToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exitFeesBP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exitFeesCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"exitFeesToTokenPath","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exitSwapToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_targetVault","type":"address"}],"name":"getTargetVaultIdForStrategy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reallocate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_allocPoints","type":"uint256[]"}],"name":"setAllocPoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setEntryAutoSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feesBP","type":"uint256"}],"name":"setEntryFeesBP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feesCollector","type":"address"}],"name":"setEntryFeesCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_entrySwapToken","type":"address"}],"name":"setEntrySwapToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setExitAutoSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feesBP","type":"uint256"}],"name":"setExitFeesBP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feesCollector","type":"address"}],"name":"setExitFeesCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_exitSwapToken","type":"address"}],"name":"setExitSwapToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slippageFactor","type":"uint256"}],"name":"setSlippageFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setSwapRouterAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"setTargetVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slippageFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"slippageFactorMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapRouterAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vid","type":"uint256"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"toggleTargetVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenBalance","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":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"depositedAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultExistence","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vaultIdForTargetVaultAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"vaultInfo","outputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"address","name":"targetVault","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wBNB","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_vid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawFromVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526000600555600680547367d66e8ec1fd25d98b3ccd3b19b7dc4b4b7fc4936001600160a01b03199182168117909255600780549091169091179055600a60088190556009819055805461010060ff1990911660011761ff0019161790556103b6600f556010805460ff60a01b191690553480156200008157600080fd5b50604051620056533803806200565383398181016040526060811015620000a757600080fd5b508051602082015160409092015160018055909190620000c960003362000208565b620000e4600080516020620056338339815191523362000208565b620000ff600080516020620056338339815191528062000218565b6200011a600080516020620056138339815191523362000208565b62000144600080516020620056138339815191526000805160206200563383398151915262000218565b600d80546001600160a01b038086166001600160a01b031992831617909255600e80548584169083161790556010805484841692169190911790556040805180820190915273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81526006549091166020820152620001bb90600b9060026200036e565b506040805180820190915273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81526007546001600160a01b03166020820152620001fe90600c9060026200036e565b50505050620003ef565b6200021482826200026a565b5050565b600082815260208190526040808220600201549051839285917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a460009182526020829052604090912060020155565b6000828152602081815260409091206200028f91839062004248620002e3821b17901c565b1562000214576200029f62000303565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620002fa836001600160a01b03841662000307565b90505b92915050565b3390565b600062000315838362000356565b6200034d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620002fd565b506000620002fd565b60009081526001919091016020526040902054151590565b828054828255906000526020600020908101928215620003c6579160200282015b82811115620003c657825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200038f565b50620003d4929150620003d8565b5090565b5b80821115620003d45760008155600101620003d9565b61521480620003ff6000396000f3fe6080604052600436106103bb5760003560e01c8063872daa36116101f2578063be1c0db51161010d578063de5f6268116100a0578063efc363e51161006f578063efc363e514610ce0578063fc0c546a14610d13578063fe78e5ca14610d28578063ffbd3b1f14610d3d576103c2565b8063de5f626814610c58578063e5acb42b14610c6d578063e8e0aef614610c99578063ec87621c14610ccb576103c2565b8063cafa086b116100dc578063cafa086b14610be0578063d02eb3f414610bf5578063d547741f14610c0a578063d73886fe14610c43576103c2565b8063be1c0db514610b3b578063c177327414610b6e578063c49d6ce414610ba1578063ca15c87314610bb6576103c2565b80639e1a4d1911610185578063abaa991611610154578063abaa991614610ac9578063b6b55f2514610ade578063bb9fb40b14610b08578063bd3d06df14610a04576103c2565b80639e1a4d19146109da578063a217fddf146109ef578063a5367b7514610a04578063a851806c14610a19576103c2565b806390fcdb36116101c157806390fcdb361461091157806391d1485414610926578063929060d81461097357806398084db7146109c5576103c2565b8063872daa36146108635780638b7f6a801461088d5780638c1548ad146108b75780639010d07c146108e1576103c2565b80632f2ff15d116102e25780635249961b1161027557806372845a751161024457806372845a75146107af57806375b238fc146107e85780637cb0d508146107fd578063864c199c14610830576103c2565b80635249961b14610704578063621b778914610737578063700959b61461074c578063709748181461077f576103c2565b806342220f34116102b157806342220f34146106a657806344bfc6bf146106ae578063498c7b65146106c357806351bb99f8146106d8576103c2565b80632f2ff15d146105f357806336568abe1461062c5780633a98ef39146106655780633e2d7f7f1461067a576103c2565b806317caf6f11161035a5780632a664993116103295780632a664993146105755780632b68772c1461059f5780632d17218b146105b45780632e1a7d4d146105c9576103c2565b806317caf6f1146104d55780631959a002146104ea57806321ad88d814610536578063248a9ca31461054b576103c2565b80630af07558116103965780630af07558146104665780630b2a88351461047b57806314cd30831461049057806316f19bb1146104c0576103c2565b80624677e8146103c75780630550473d146103f95780630ac84d8a14610420576103c2565b366103c257005b600080fd5b3480156103d357600080fd5b506103f7600480360360408110156103ea57600080fd5b5080359060200135610d52565b005b34801561040557600080fd5b5061040e610e61565b60408051918252519081900360200190f35b34801561042c57600080fd5b5061044a6004803603602081101561044357600080fd5b5035610e67565b604080516001600160a01b039092168252519081900360200190f35b34801561047257600080fd5b506103f7610e8e565b34801561048757600080fd5b5061044a610fbd565b34801561049c57600080fd5b506103f7600480360360408110156104b357600080fd5b5080359060200135610fcc565b3480156104cc57600080fd5b5061040e61108f565b3480156104e157600080fd5b5061040e611095565b3480156104f657600080fd5b5061051d6004803603602081101561050d57600080fd5b50356001600160a01b031661109b565b6040805192835260208301919091528051918290030190f35b34801561054257600080fd5b506103f76110b4565b34801561055757600080fd5b5061040e6004803603602081101561056e57600080fd5b50356111dc565b34801561058157600080fd5b506103f76004803603602081101561059857600080fd5b50356111f1565b3480156105ab57600080fd5b5061040e611314565b3480156105c057600080fd5b5061040e61131a565b3480156105d557600080fd5b506103f7600480360360208110156105ec57600080fd5b5035611320565b3480156105ff57600080fd5b506103f76004803603604081101561061657600080fd5b50803590602001356001600160a01b0316611c15565b34801561063857600080fd5b506103f76004803603604081101561064f57600080fd5b50803590602001356001600160a01b0316611c81565b34801561067157600080fd5b5061040e611ce2565b34801561068657600080fd5b5061040e6004803603602081101561069d57600080fd5b50351515611ce8565b6103f7611ef4565b3480156106ba57600080fd5b5061040e612673565b3480156106cf57600080fd5b5061044a6126d9565b3480156106e457600080fd5b506103f7600480360360208110156106fb57600080fd5b503515156126e8565b34801561071057600080fd5b506103f76004803603602081101561072757600080fd5b50356001600160a01b03166127ea565b34801561074357600080fd5b5061040e612931565b34801561075857600080fd5b506103f76004803603602081101561076f57600080fd5b50356001600160a01b0316612935565b34801561078b57600080fd5b506103f7600480360360408110156107a257600080fd5b5080359060200135612a7c565b3480156107bb57600080fd5b506103f7600480360360408110156107d257600080fd5b506001600160a01b038135169060200135612b87565b3480156107f457600080fd5b5061040e612e8c565b34801561080957600080fd5b506103f76004803603602081101561082057600080fd5b50356001600160a01b0316612e9e565b34801561083c57600080fd5b506103f76004803603602081101561085357600080fd5b50356001600160a01b0316613025565b34801561086f57600080fd5b5061044a6004803603602081101561088657600080fd5b50356131ac565b34801561089957600080fd5b506103f7600480360360208110156108b057600080fd5b50356131b9565b3480156108c357600080fd5b506103f7600480360360208110156108da57600080fd5b50356132dc565b3480156108ed57600080fd5b5061044a6004803603604081101561090457600080fd5b5080359060200135613400565b34801561091d57600080fd5b5061044a613421565b34801561093257600080fd5b5061095f6004803603604081101561094957600080fd5b50803590602001356001600160a01b0316613430565b604080519115158252519081900360200190f35b34801561097f57600080fd5b5061099d6004803603602081101561099657600080fd5b5035613448565b6040805193151584526001600160a01b03909216602084015282820152519081900360600190f35b3480156109d157600080fd5b506103f7613486565b3480156109e657600080fd5b5061040e6139e1565b3480156109fb57600080fd5b5061040e6139fd565b348015610a1057600080fd5b5061040e613a02565b348015610a2557600080fd5b506103f760048036036020811015610a3c57600080fd5b810190602081018135640100000000811115610a5757600080fd5b820183602082011115610a6957600080fd5b80359060200191846020830284011164010000000083111715610a8b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550613a07945050505050565b348015610ad557600080fd5b506103f7613b1e565b348015610aea57600080fd5b506103f760048036036020811015610b0157600080fd5b5035613bd0565b348015610b1457600080fd5b5061040e60048036036020811015610b2b57600080fd5b50356001600160a01b0316613ca5565b348015610b4757600080fd5b5061095f60048036036020811015610b5e57600080fd5b50356001600160a01b0316613d18565b348015610b7a57600080fd5b5061040e60048036036020811015610b9157600080fd5b50356001600160a01b0316613d2d565b348015610bad57600080fd5b5061095f613d3f565b348015610bc257600080fd5b5061040e60048036036020811015610bd957600080fd5b5035613d4d565b348015610bec57600080fd5b5061095f613d64565b348015610c0157600080fd5b5061044a613d6d565b348015610c1657600080fd5b506103f760048036036040811015610c2d57600080fd5b50803590602001356001600160a01b0316613d85565b348015610c4f57600080fd5b5061044a613dde565b348015610c6457600080fd5b506103f7613ded565b348015610c7957600080fd5b506103f760048036036020811015610c9057600080fd5b50351515613efb565b348015610ca557600080fd5b506103f760048036036040811015610cbc57600080fd5b50803590602001351515613fef565b348015610cd757600080fd5b5061040e6140cb565b348015610cec57600080fd5b506103f760048036036020811015610d0357600080fd5b50356001600160a01b03166140dd565b348015610d1f57600080fd5b5061044a614224565b348015610d3457600080fd5b5061044a614233565b348015610d4957600080fd5b5061040e614242565b60035482908110610daa576040805162461bcd60e51b815260206004820181905260248201527f466565645661756c743a205661756c7420646f6573206e6f7420657869737473604482015290519081900360640190fd5b600080516020614f4e833981519152610dc38133613430565b610e02576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415610e48576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6002600155610e57848461425d565b5050600180555050565b6103e381565b600b8181548110610e7457fe5b6000918252602090912001546001600160a01b0316905081565b6000805160206150f6833981519152610ea78133613430565b610ee6576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415610f2c576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6002600155601054600160a01b900460ff1615610f7a5760405162461bcd60e51b8152600401808060200182810382526032815260200180614db36032913960400191505060405180910390fd5b6010805460ff60a01b1916600160a01b1790556040517fd9b5f2043d0bf9eff96f43914de1de53fac509c424f8a70d9348b1c889ede47790600090a15060018055565b6007546001600160a01b031681565b600080516020614f4e833981519152610fe58133613430565b611024576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b6110618261105b6003868154811061103857fe5b90600052602060002090600202016001015460055461435290919063ffffffff16565b906143af565b600581905550816003848154811061107557fe5b906000526020600020906002020160010181905550505050565b60085481565b60055481565b6011602052600090815260409020805460019091015482565b6000805160206150f68339815191526110cd8133613430565b61110c576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415611152576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6002600155601054600160a01b900460ff1661119f5760405162461bcd60e51b8152600401808060200182810382526030815260200180614de56030913960400191505060405180910390fd5b6010805460ff60a01b191690556040517f8eaa3251e7fc5bb98a6b86bcd8850a884c17f00a0a7b9cfb6d58d98882e2815790600090a15060018055565b60009081526020819052604090206002015490565b6000805160206150f683398151915261120a8133613430565b611249576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b6002600154141561128f576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b600260015560328211156112d45760405162461bcd60e51b815260040180806020018281038252603f815260200180614c75603f913960400191505060405180910390fd5b60088290556040805183815290517f38513f56d06662d667ce256d332fed02f01371f29d9d028f48ed5b472c7419b99181900360200190a1505060018055565b60035490565b60095481565b601054600160a01b900460ff161561136d576040805162461bcd60e51b815260206004820152601c6024820152600080516020614e15833981519152604482015290519081900360640190fd5b6003546113af576040805162461bcd60e51b815260206004820152601a6024820152600080516020614f6e833981519152604482015290519081900360640190fd5b600260015414156113f5576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b600260019081553360009081526011602052604090209081015443141561144d5760405162461bcd60e51b8152600401808060200182810382526041815260200180614faf6041913960600191505060405180910390fd5b60035460005b818110156115865760006003828154811061146a57fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b1580156114c757600080fd5b505afa1580156114db573d6000803e3d6000fd5b505050506040513d60208110156114f157600080fd5b5051111561157e576003818154811061150657fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663c87965726040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561156557600080fd5b505af1158015611579573d6000803e3d6000fd5b505050505b600101611453565b5060006115a76004546115a18661159b6139e1565b90614409565b90614462565b60045490915047906115b99086614352565b60045583546115c89086614352565b845560008282106115da575081611719565b60035460006115e98585614352565b905060006115f76000611ce8565b905060005b83811015611704576003818154811061161157fe5b600091825260209091206002909102015460ff16156116fc57600047905060006116d5846115a1876003878154811061164657fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663722713f76040518163ffffffff1660e01b815260040160206040518083038186803b1580156116a357600080fd5b505afa1580156116b7573d6000803e3d6000fd5b505050506040513d60208110156116cd57600080fd5b505190614409565b90506116e183826144c9565b476116f66116ef8285614352565b89906143af565b97505050505b6001016115fc565b509284019285841115611715578593505b5050505b60006117366127106115a16008548561440990919063ffffffff16565b90508015611ba457600a5460ff1615611b5b57600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561179457600080fd5b505afa1580156117a8573d6000803e3d6000fd5b505050506040513d60208110156117be57600080fd5b50516010546040805163d06ca61f60e01b81526004810186815260248201928352600c8054604484018190529596506060956001600160a01b039095169463d06ca61f94899492939290916064909101908490801561184657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611828575b5050935050505060006040518083038186803b15801561186557600080fd5b505afa158015611879573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156118a257600080fd5b81019080805160405193929190846401000000008211156118c257600080fd5b9083019060208201858111156118d757600080fd5b82518660208202830111640100000000821117156118f457600080fd5b82525081516020918201928201910280838360005b83811015611921578181015183820152602001611909565b5050505090500160405250505090506000816119486001845161435290919063ffffffff16565b8151811061195257fe5b60200260200101519050601060009054906101000a90046001600160a01b03166001600160a01b031663b6f9de958561199c6103e86115a1600f548761440990919063ffffffff16565b600c30426078016040518663ffffffff1660e01b81526004018085815260200180602001846001600160a01b031681526020018381526020018281038252858181548152602001915080548015611a1c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116119fe575b5050955050505050506000604051808303818588803b158015611a3e57600080fd5b505af1158015611a52573d6000803e3d6000fd5b5050600754604080516370a0823160e01b81523060048201529051600095506001600160a01b0390921693506370a082319250602480820192602092909190829003018186803b158015611aa557600080fd5b505afa158015611ab9573d6000803e3d6000fd5b505050506040513d6020811015611acf57600080fd5b505190506000611adf8286614352565b600e54600754919250611aff916001600160a01b0390811691168361454b565b600754600e546040805160018152602081018a905281516001600160a01b0394851694909316927faad7631698e5d5543338d1926cf4860a6ade1fcdf1f3d6ffd09555dee988b0f6929181900390910190a35050505050611b97565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611b95573d6000803e3d6000fd5b505b611ba18282614352565b91505b604051339083156108fc029084906000818181858888f19350505050158015611bd1573d6000803e3d6000fd5b5060408051838152905133917f6cca423c6ffc06e62a0acc433965e074b11c28479b0449250ce3ff65ac9e39fe919081900360200190a25050600180555050505050565b600082815260208190526040902060020154611c3890611c3361459d565b613430565b611c735760405162461bcd60e51b815260040180806020018281038252602f815260200180614cb4602f913960400191505060405180910390fd5b611c7d82826145a1565b5050565b611c8961459d565b6001600160a01b0316816001600160a01b031614611cd85760405162461bcd60e51b815260040180806020018281038252602f8152602001806151b0602f913960400191505060405180910390fd5b611c7d828261460a565b60045481565b60035460009081805b82811015611eec5760038181548110611d0657fe5b600091825260209091206002909102015460ff1615611ee457600085611dc35760038281548110611d3357fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9057600080fd5b505afa158015611da4573d6000803e3d6000fd5b505050506040513d6020811015611dba57600080fd5b50519050611ed6565b611ed3670de0b6b3a76400006115a160038581548110611ddf57fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663048829806040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3c57600080fd5b505afa158015611e50573d6000803e3d6000fd5b505050506040513d6020811015611e6657600080fd5b50516003805487908110611e7657fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316630bf6cc086040518163ffffffff1660e01b815260040160206040518083038186803b1580156116a357600080fd5b90505b611ee083826143af565b9250505b600101611cf1565b509392505050565b601054600160a01b900460ff1615611f41576040805162461bcd60e51b815260206004820152601c6024820152600080516020614e15833981519152604482015290519081900360640190fd5b600354611f83576040805162461bcd60e51b815260206004820152601a6024820152600080516020614f6e833981519152604482015290519081900360640190fd5b60026001541415611fc9576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b600260015560035460005b8181101561210757600060038281548110611feb57fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b15801561204857600080fd5b505afa15801561205c573d6000803e3d6000fd5b505050506040513d602081101561207257600080fd5b505111156120ff576003818154811061208757fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663c87965726040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156120e657600080fd5b505af11580156120fa573d6000803e3d6000fd5b505050505b600101611fd4565b5060006121146000611ce8565b9050600034905060006121386127106115a16008548561440990919063ffffffff16565b9050801561259957600a5460ff161561255d57600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561219657600080fd5b505afa1580156121aa573d6000803e3d6000fd5b505050506040513d60208110156121c057600080fd5b50516010546040805163d06ca61f60e01b81526004810186815260248201928352600b8054604484018190529596506060956001600160a01b039095169463d06ca61f94899492939290916064909101908490801561224857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161222a575b5050935050505060006040518083038186803b15801561226757600080fd5b505afa15801561227b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156122a457600080fd5b81019080805160405193929190846401000000008211156122c457600080fd5b9083019060208201858111156122d957600080fd5b82518660208202830111640100000000821117156122f657600080fd5b82525081516020918201928201910280838360005b8381101561232357818101518382015260200161230b565b50505050905001604052505050905060008161234a6001845161435290919063ffffffff16565b8151811061235457fe5b60200260200101519050601060009054906101000a90046001600160a01b03166001600160a01b031663b6f9de958561239e6103e86115a1600f548761440990919063ffffffff16565b600b30426078016040518663ffffffff1660e01b81526004018085815260200180602001846001600160a01b03168152602001838152602001828103825285818154815260200191508054801561241e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612400575b5050955050505050506000604051808303818588803b15801561244057600080fd5b505af1158015612454573d6000803e3d6000fd5b5050600654604080516370a0823160e01b81523060048201529051600095506001600160a01b0390921693506370a082319250602480820192602092909190829003018186803b1580156124a757600080fd5b505afa1580156124bb573d6000803e3d6000fd5b505050506040513d60208110156124d157600080fd5b5051905060006124e18286614352565b600d54600654919250612501916001600160a01b0390811691168361454b565b600654600d546040805160018152602081018a905281516001600160a01b0394851694909316927faad7631698e5d5543338d1926cf4860a6ade1fcdf1f3d6ffd09555dee988b0f6929181900390910190a35050505050612599565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015612597573d6000803e3d6000fd5b505b6125a1614673565b60006125ad6000611ce8565b905060008482106125c5576125c28286614352565b90505b8015612631576000600454600014156125df5750806125fb565b6125f8866115a16004548561440990919063ffffffff16565b90505b33600090815260116020526040902060045461261790836143af565b600455805461262690836143af565b815543600190910155505b60408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a250506001805550505050565b60035460009081805b828110156126d25760006126bb6005546115a16003858154811061269c57fe5b90600052602060002090600202016001015460038681548110611e7657fe5b90506126c783826143af565b92505060010161267c565b5091505090565b600e546001600160a01b031681565b6000805160206150f68339815191526127018133613430565b612740576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415612786576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6002600155600a805483151561010090810261ff00199092169190911791829055604080519190920460ff161515815290517f4e87b8c54656d7c3f58dbeb46a627c6b558d9ee488aaaaf6bf419e757a4d864d9181900360200190a1505060018055565b6000805160206150f68339815191526128038133613430565b612842576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415612888576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b60026001556001600160a01b0382166128d25760405162461bcd60e51b815260040180806020018281038252604381526020018061516d6043913960600191505060405180910390fd5b601080546001600160a01b0319166001600160a01b03848116919091179182905560408051929091168252517f449a1bd1377b6ad637113368e2e67a7ff6920f8700956c81906a2485fed27909916020908290030190a1505060018055565b4790565b6000805160206150f683398151915261294e8133613430565b61298d576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b600260015414156129d3576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b60026001556001600160a01b038216612a1d5760405162461bcd60e51b815260040180806020018281038252604f815260200180614e92604f913960600191505060405180910390fd5b600d80546001600160a01b0319166001600160a01b03848116919091179182905560408051929091168252517fed9f75e91bdc992b7118fbe3ccf2ee8230e2575969b48a2402cd5fe7246e1e96916020908290030190a1505060018055565b60035482908110612ad4576040805162461bcd60e51b815260206004820181905260248201527f466565645661756c743a205661756c7420646f6573206e6f7420657869737473604482015290519081900360640190fd5b600080516020614f4e833981519152612aed8133613430565b612b2c576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415612b72576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b60026001558215610e5757610e5784846144c9565b600080516020614f4e833981519152612ba08133613430565b612bdf576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b6001600160a01b038316600090815260126020526040902054839060ff1615612c4f576040805162461bcd60e51b815260206004820152601b60248201527f466565645661756c743a204475706c696361746564207661756c740000000000604482015290519081900360640190fd5b60026001541415612c95576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b60026001556001600160a01b038416612cdf5760405162461bcd60e51b815260040180806020018281038252603e815260200180614ff0603e913960400191505060405180910390fd5b306001600160a01b0316846001600160a01b031663508cfff66040518163ffffffff1660e01b815260040160206040518083038186803b158015612d2257600080fd5b505afa158015612d36573d6000803e3d6000fd5b505050506040513d6020811015612d4c57600080fd5b50516001600160a01b031614612d935760405162461bcd60e51b815260040180806020018281038252604b815260200180614d03604b913960600191505060405180910390fd5b600554612da090846143af565b60055550506001600160a01b0391821660008181526012602090815260408083208054600160ff199182168117909255825160608101845282815280850187815281850198895260038054808601825581895292517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b6002909402938401805493519390951690151517610100600160a81b03191661010092909b16919091029990991790915595517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c9096019590955594549282526013905292909220600019929092019091558055565b6000805160206150f683398151915281565b6000805160206150f6833981519152612eb78133613430565b612ef6576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415612f3c576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b60026001556001600160a01b038216612f865760405162461bcd60e51b81526004018080602001828103825260438152602001806150b36043913960600191505060405180910390fd5b600780546001600160a01b0319166001600160a01b0384811691909117918290556040805180820190915273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c815291166020820152612fdd90600c906002614bd8565b50600754604080516001600160a01b039092168252517f5ad2b44c825d53dfd7b1ca00e4cb03fdfd7f47e11072bc2ea3f576f4c97338bf9181900360200190a1505060018055565b6000805160206150f683398151915261303e8133613430565b61307d576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b600260015414156130c3576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b60026001556001600160a01b03821661310d5760405162461bcd60e51b8152600401808060200182810382526045815260200180614d6e6045913960600191505060405180910390fd5b600680546001600160a01b0319166001600160a01b0384811691909117918290556040805180820190915273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81529116602082015261316490600b906002614bd8565b50600654604080516001600160a01b039092168252517fdfe579447f21f2c4e9f4ce7743e70e2a191e0234c83a5665b55dda21056dc25f9181900360200190a1505060018055565b600c8181548110610e7457fe5b6000805160206150f68339815191526131d28133613430565b613211576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415613257576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6002600155603282111561329c5760405162461bcd60e51b815260040180806020018281038252603d815260200180614f11603d913960400191505060405180910390fd5b60098290556040805183815290517f3d2fe976eadb09bdc566cb76c2b61638dfb432c7cc4562a03b30586e348993309181900360200190a1505060018055565b6000805160206150f68339815191526132f58133613430565b613334576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b6002600154141561337a576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b60026001556103e38211156133c05760405162461bcd60e51b8152600401808060200182810382526037815260200180614e5b6037913960400191505060405180910390fd5b600f8290556040805183815290517f7c0b78784b74c7a5d45aaffe8949cf9eda9e2a2bf0b5c48519c4829e563228a49181900360200190a1505060018055565b60008281526020819052604081206134189083614737565b90505b92915050565b6010546001600160a01b031681565b60008281526020819052604081206134189083614743565b6003818154811061345557fe5b60009182526020909120600290910201805460019091015460ff821692506101009091046001600160a01b03169083565b600080516020614f4e83398151915261349f8133613430565b6134de576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b601054600160a01b900460ff161561352b576040805162461bcd60e51b815260206004820152601c6024820152600080516020614e15833981519152604482015290519081900360640190fd5b60035461356d576040805162461bcd60e51b815260206004820152601a6024820152600080516020614f6e833981519152604482015290519081900360640190fd5b600260015414156135b3576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b600260015560006135c381611ce8565b60035490915060005b8181101561386b57600381815481106135e157fe5b600091825260209091206002909102015460ff16156138635760006003828154811061360957fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b15801561366657600080fd5b505afa15801561367a573d6000803e3d6000fd5b505050506040513d602081101561369057600080fd5b5051600554600380549293506000926136d392916115a191879081106136b257fe5b9060005260206000209060020201600101548861440990919063ffffffff16565b905060008183111561385f57600384815481106136ec57fe5b906000526020600020906002020160010154600014156137a3576003848154811061371357fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663722713f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561377057600080fd5b505afa158015613784573d6000803e3d6000fd5b505050506040513d602081101561379a57600080fd5b50519050613855565b613852600385815481106137b357fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663af1a4c5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561381057600080fd5b505afa158015613824573d6000803e3d6000fd5b505050506040513d602081101561383a57600080fd5b50516115a1670de0b6b3a764000061159b8787614352565b90505b61385f84826144c9565b5050505b6001016135cc565b5060006138766139e1565b905060005b828110156139d6576003818154811061389057fe5b600091825260209091206002909102015460ff16156139ce576000600382815481106138b857fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b15801561391557600080fd5b505afa158015613929573d6000803e3d6000fd5b505050506040513d602081101561393f57600080fd5b50516005546003805492935060009261398292916115a1918790811061396157fe5b9060005260206000209060020201600101548761440990919063ffffffff16565b9050808210156139cb5760006139988284614352565b9050806139a3612931565b10156139bf576139ba846139b5612931565b61425d565b6139c9565b6139c9848261425d565b505b50505b60010161387b565b505060018055505050565b60006139f86139f06000611ce8565b61105b612931565b905090565b600081565b603281565b600080516020614f4e833981519152613a208133613430565b613a5f576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415613aa5576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6002600155600354825114613aeb5760405162461bcd60e51b815260040180806020018281038252603881526020018061502e6038913960400191505060405180910390fd5b60035460005b81811015610e5757613b1681858381518110613b0957fe5b6020026020010151610fcc565b600101613af1565b600080516020614f4e833981519152613b378133613430565b613b76576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415613bbc576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6002600155613bc9614673565b5060018055565b601054600160a01b900460ff1615613c1d576040805162461bcd60e51b815260206004820152601c6024820152600080516020614e15833981519152604482015290519081900360640190fd5b600354613c5f576040805162461bcd60e51b815260206004820152601a6024820152600080516020614f6e833981519152604482015290519081900360640190fd5b60026001541415613bc9576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526012602052604081205460ff16613cfc5760405162461bcd60e51b815260040180806020018281038252602d815260200180615140602d913960400191505060405180910390fd5b506001600160a01b031660009081526013602052604090205490565b60126020526000908152604090205460ff1681565b60136020526000908152604090205481565b600a54610100900460ff1681565b600081815260208190526040812061341b90614758565b600a5460ff1681565b73bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81565b600082815260208190526040902060020154613da390611c3361459d565b611cd85760405162461bcd60e51b8152600401808060200182810382526030815260200180614ee16030913960400191505060405180910390fd5b600d546001600160a01b031681565b601054600160a01b900460ff1615613e3a576040805162461bcd60e51b815260206004820152601c6024820152600080516020614e15833981519152604482015290519081900360640190fd5b600354613e7c576040805162461bcd60e51b815260206004820152601a6024820152600080516020614f6e833981519152604482015290519081900360640190fd5b600254604080516370a0823160e01b81523360048201529051613ef9926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015613ec857600080fd5b505afa158015613edc573d6000803e3d6000fd5b505050506040513d6020811015613ef257600080fd5b5051613bd0565b565b6000805160206150f6833981519152613f148133613430565b613f53576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b60026001541415613f99576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b6002600155600a805460ff191683151517908190556040805160ff90921615158252517f6d3ad049914c2d4eb7dcc36dae159166c9d5b5c4cd481d269b2f7c0f1158e4a2916020908290030190a1505060018055565b6000805160206150f68339815191526140088133613430565b614047576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b6002600154141561408d576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b600260018190555081600384815481106140a357fe5b60009182526020909120600290910201805460ff191691151591909117905550506001805550565b600080516020614f4e83398151915281565b6000805160206150f68339815191526140f68133613430565b614135576040805162461bcd60e51b815260206004820152601d6024820152600080516020614d4e833981519152604482015290519081900360640190fd5b6002600154141561417b576040805162461bcd60e51b815260206004820152601f6024820152600080516020614ce3833981519152604482015290519081900360640190fd5b60026001556001600160a01b0382166141c55760405162461bcd60e51b815260040180806020018281038252604d815260200180615066604d913960600191505060405180910390fd5b600e80546001600160a01b0319166001600160a01b03848116919091179182905560408051929091168252517f50d820c8274fe1cf135aea2f21097a0d3aff16185cf6d8a557e3b01ad909ab19916020908290030190a1505060018055565b6002546001600160a01b031681565b6006546001600160a01b031681565b600f5481565b6000613418836001600160a01b038416614763565b478181101561426a578091505b811561434d576003838154811061427d57fe5b60009182526020822060029190910201546040516101009091046001600160a01b0316916108fc851502918591818181858888f193505050501580156142c7573d6000803e3d6000fd5b50600383815481106142d557fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561433457600080fd5b505af1158015614348573d6000803e3d6000fd5b505050505b505050565b6000828211156143a9576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015613418576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826144185750600061341b565b8282028284828161442557fe5b04146134185760405162461bcd60e51b8152600401808060200182810382526021815260200180614f8e6021913960400191505060405180910390fd5b60008082116144b8576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816144c157fe5b049392505050565b600382815481106144d657fe5b600091825260208220600291909102015460408051632e1a7d4d60e01b81526004810185905290516101009092046001600160a01b031692632e1a7d4d9260248084019382900301818387803b15801561452f57600080fd5b505af1158015614543573d6000803e3d6000fd5b505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261434d9084906147ad565b3390565b60008281526020819052604090206145b99082614248565b15611c7d576145c661459d565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081905260409020614622908261485e565b15611c7d5761462f61459d565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b601054600160a01b900460ff16156146c0576040805162461bcd60e51b815260206004820152601c6024820152600080516020614e15833981519152604482015290519081900360640190fd5b60006146ca612931565b905080156147345760035460005b8181101561434d57600381815481106146ed57fe5b600091825260209091206002909102015460ff161561472c57600061471e6005546115a16003858154811061396157fe5b905061472a828261425d565b505b6001016146d8565b50565b60006134188383614873565b6000613418836001600160a01b0384166148d7565b600061341b826148ef565b600061476f83836148d7565b6147a55750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561341b565b50600061341b565b6060614802826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166148f39092919063ffffffff16565b80519091501561434d5780806020019051602081101561482157600080fd5b505161434d5760405162461bcd60e51b815260040180806020018281038252602a815260200180615116602a913960400191505060405180910390fd5b6000613418836001600160a01b03841661490c565b815460009082106148b55760405162461bcd60e51b8152600401808060200182810382526022815260200180614c536022913960400191505060405180910390fd5b8260000182815481106148c457fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b606061490284846000856149d2565b90505b9392505050565b600081815260018301602052604081205480156149c8578354600019808301919081019060009087908390811061493f57fe5b906000526020600020015490508087600001848154811061495c57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061498c57fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061341b565b600091505061341b565b606082471015614a135760405162461bcd60e51b8152600401808060200182810382526026815260200180614e356026913960400191505060405180910390fd5b614a1c85614b2e565b614a6d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310614aac5780518252601f199092019160209182019101614a8d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114614b0e576040519150601f19603f3d011682016040523d82523d6000602084013e614b13565b606091505b5091509150614b23828286614b34565b979650505050505050565b3b151590565b60608315614b43575081614905565b825115614b535782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614b9d578181015183820152602001614b85565b50505050905090810190601f168015614bca5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b828054828255906000526020600020908101928215614c2d579160200282015b82811115614c2d57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614bf8565b50614c39929150614c3d565b5090565b5b80821115614c395760008155600101614c3e56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64735461726765745661756c742873657446656573293a20656e747279206665657320626173697320706f696e74732065786365656473207468726573686f6c64416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e745265656e7472616e637947756172643a207265656e7472616e742063616c6c00466565645661756c74286164645461726765745661756c74293a20546172676574207661756c742066656564207661756c7420746172676574206973206e6f742074686973207661756c74466565645661756c743a2043616c6c657220686173206e6f20726f6c65000000466565645661756c7428736574456e74727953776170546f6b656e293a20656e747279207377617020746f6b656e2063616e6e6f74206265207a65726f2061646472657373466565645661756c742864697361626c655661756c74293a205661756c7420697320616c72656164792064697361626c6564466565645661756c7428656e61626c655661756c74293a205661756c7420697320616c726561647920656e61626c6564466565645661756c743a207661756c742069732064697361626c656400000000416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5461726765745661756c7428736574536c697070616765466163746f72293a20736c697070616765466163746f7220746f6f20686967685461726765745661756c7428736574456e74727946656573436f6c6c6563746f72293a20656e747279206665657320636f6c6c6563746f722063616e6e6f74206265207a65726f2061646472657373416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65466565645661756c742873657446656573293a20656e747279206665657320626173697320706f696e74732065786365656473207468726573686f6c64241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08466565645661756c743a204e6f20746172676574207661756c74000000000000536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77466565645661756c74287769746864726177293a2077697468647261772063616e6e6f74206265207468652073616d6520626c6f636b206173206465706f736974466565645661756c74286164645461726765745661756c74293a20546172676574207661756c742063616e6e6f74206265207a65726f2061646472657373466565645661756c7428736574416c6c6f63506f696e7473293a206e756d626572206f66207661756c747320697320696e636f72726563745461726765745661756c74287365744578697446656573436f6c6c6563746f72293a2065786974206665657320636f6c6c6563746f722063616e6e6f74206265207a65726f2061646472657373466565645661756c74287365744578697453776170546f6b656e293a2065786974207377617020746f6b656e2063616e6e6f74206265207a65726f2061646472657373a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217755361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564466565645661756c743a20546f6b656e20646f6573206e6f742065786973747320696e20616e79207661756c74466565645661756c742873657453776170526f7574657241646472657373293a207377617020726f757465722063616e6e6f74206265207a65726f2061646472657373416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a26469706673582212204a9fc5a757ee8610d9eae8e5e2b4e3374eb19a4aa8a7bfa419fafea27b4150f264736f6c63430007030033241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775000000000000000000000000565de6cb7e5c27fd677cd027fef6e50f82cb197a0000000000000000000000002de4c780fb947805770ee0d93c091ee683ebddb600000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e

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.