Contract 0xa74eEcDb5c9f37844211C4B8bcAEaf3Fcd6709E4

 

Contract Overview

Balance:
0 BNB

BNB Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x297e2e62858a2e76767d5f0d063eb5273c186afa5f124db34ddcb269ea84530aDeposit BNB117761892021-10-14 21:49:4423 hrs 18 mins ago0x5d5d0fb2c33b87ff1a0b24b7e5bc93ffaa2a9ce0 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e43.66 BNB0.003098465
0x72d7140a7037e7788334704487f674f207ae6c5a9429994c6cf3cd1cdadd0aa6Withdraw117395162021-10-13 15:06:142 days 6 hrs ago0xd8389a42834246600ec7ed69be584d8c2af7d500 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280282
0xfde54fb127de42fcd3c1082d9619705c788966bfcb4b1fad7d675cc23d82b58fWithdraw116877802021-10-11 19:27:334 days 1 hr ago0x4d8222965d7ab82c5c4eed9ae7d55448c22c15d9 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280282
0xd784602a47e20a2ff66f4c5694a819f73da525b93bec1624c970622476a96354Deposit BNB116799582021-10-11 12:16:454 days 8 hrs ago0x01928f5eaae0032b5e2836336ffd97fb82b8cc0a IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e46 BNB0.003024475
0x44219fcc6bf10959bc77761adcbbcaebcb1172acb02452054fe4264031da4c9eWithdraw116785042021-10-11 11:03:324 days 10 hrs ago0x62a3aaf79967a4b5491c8d272340e1545dc2d769 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280282
0x8a2a2b9bd28779fcbf36ee6d65365464e287f9bf553e94b007faba3271d85fb7Withdraw116640632021-10-10 23:00:154 days 22 hrs ago0x70ad053098e308faf30d5e4d0b74ffd460080963 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280282
0xbb1099ae49e93e1b6aa3f6ec4ac25ddf861e3d769787720ed7573d11a9d9d3d7Withdraw115635592021-10-07 11:00:168 days 10 hrs ago0x421eed84de843f198e713ca5bf98ef3ba7ca7cc6 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.0028034
0x52d8a7e28f594e8397aad0c950b8b9517c05c715d0af00170164223c39b2fe25Withdraw115435582021-10-06 18:19:059 days 2 hrs ago0x4faba1ea67f84df7f5c179a9ed4a4109aaa30739 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280282
0x232a1e0054c220943e7c1546cf554e458893f48902804ea9d6ab8cd0da113a71Withdraw115403822021-10-06 15:40:139 days 5 hrs ago0x4faba1ea67f84df7f5c179a9ed4a4109aaa30739 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00287782
0x0fa9c61a447134e9f91c4a178f2d13433d6ccb203b7aa76b7ef0da076ea6959eDeposit BNB115269512021-10-06 4:27:459 days 16 hrs ago0xd8389a42834246600ec7ed69be584d8c2af7d500 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.85 BNB0.003025115
0x34f275340490f1722f947c83fae1b6ace72495f388b8af66684ecb7200a9e96fDeposit BNB115242722021-10-06 2:13:279 days 18 hrs ago0x421eed84de843f198e713ca5bf98ef3ba7ca7cc6 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.022988738282933 BNB0.002950115
0x8ff31d5fb9f94f1be0ce07ed77adbbc0d68bb108b00f1cac1a363ad50181e330Withdraw115223722021-10-06 0:38:259 days 20 hrs ago0xd7c65c2c6a55a19e5db51205d6d2296fc9f2d766 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00272846
0x63f29e5670268b5d7943644b0326dcbd71aa4b5a6c2d6c025df0454fba4bd918Deposit BNB115223472021-10-06 0:37:109 days 20 hrs ago0xd7c65c2c6a55a19e5db51205d6d2296fc9f2d766 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.2 BNB0.003025115
0x4b292c15a4300d5416a24b3d3ee69f95e8468d66c7ad8e4b7f8e681331360e0eWithdraw115188962021-10-05 21:44:119 days 23 hrs ago0x4faba1ea67f84df7f5c179a9ed4a4109aaa30739 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.0028784
0xcdb9b63897ce672eae8da1c934aa669d9c696ff18045770dc73ccaaf516e9f93Deposit BNB115075852021-10-05 12:17:5010 days 8 hrs ago0x62a3aaf79967a4b5491c8d272340e1545dc2d769 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.145942169219423 BNB0.003100115
0xda8c7ef4dad63888176f5c3ab4a066e1f0011537492dcfade801e7447caddc76Withdraw114401512021-10-03 3:58:4612 days 17 hrs ago0x395081577a5745f19b05c96313f33e55aae757b9 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280346
0x21dcb8143e9c734eb4a848822f2fbc0c665b00a0c3940401a95e5166df45cf04Withdraw114310932021-10-02 20:21:0613 days 47 mins ago0x4faba1ea67f84df7f5c179a9ed4a4109aaa30739 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.0028784
0x18623a37c9bc18b3cee9dfb9b138edc078eb994b4702ff9816e09611a75acb52Withdraw114256072021-10-02 15:42:5213 days 5 hrs ago0xbdcc576e2120cafba4ce26f15ac4ec6cfd8cb8e2 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280346
0xf4d0c4bf3f667d179ab1b19268d4028d3e82be5fc5d81f551ca0420fe731845eWithdraw113656202021-09-30 13:10:1815 days 7 hrs ago0x397d5ce2166be3f11a1a56ec61be4dc456261e59 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280346
0x8e6d805b03bf5001778d42c73e55204b1bdfe9b5fdd20ec780ab4f694134cd75Withdraw113564742021-09-30 5:28:1315 days 15 hrs ago0x9e21f1290a2f202003ff58472ab8a564c291f760 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280346
0xc8baea54910c33e7d9c7e3d2367178f79720fcfb449a6d5d5928709138031354Withdraw113551042021-09-30 4:17:4615 days 16 hrs ago0x8d0d8f12bbb5e75030fb6c3ce0e7048d0ef10a5c IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280181
0xb52f7921c41a793d3834b8b0999940a72fa216cf239ec02e0d5fd47958ebae0cWithdraw113127692021-09-28 16:41:3617 days 4 hrs ago0x4faba1ea67f84df7f5c179a9ed4a4109aaa30739 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00280282
0x6af61b83532d8f13e7f134910ffe929b9ec6e2fd554edd828e48fc301a2e674eWithdraw113110612021-09-28 15:15:3317 days 5 hrs ago0x4faba1ea67f84df7f5c179a9ed4a4109aaa30739 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00287782
0xc2ca4b39e18999c0b357cdc6ccb128dbfe42907c9962c9a43ba762cd9103186fDeposit BNB112854902021-09-27 17:40:5518 days 3 hrs ago0x70ad053098e308faf30d5e4d0b74ffd460080963 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.11 BNB0.003099475
0xfde230a386f55ba841f289ed347c1472e23dc312319dff938330c72583ea646cWithdraw112819832021-09-27 14:45:2018 days 6 hrs ago0x4faba1ea67f84df7f5c179a9ed4a4109aaa30739 IN  0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40 BNB0.00287776
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x297e2e62858a2e76767d5f0d063eb5273c186afa5f124db34ddcb269ea84530a117761892021-10-14 21:49:4423 hrs 18 mins ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 0x050629d11e489d0661397ee1c652fb55a0f34afb3.656340368716916099 BNB
0x297e2e62858a2e76767d5f0d063eb5273c186afa5f124db34ddcb269ea84530a117761892021-10-14 21:49:4423 hrs 18 mins ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.00366 BNB
0x72d7140a7037e7788334704487f674f207ae6c5a9429994c6cf3cd1cdadd0aa6117395162021-10-13 15:06:142 days 6 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40xd8389a42834246600ec7ed69be584d8c2af7d5000.85309665270639066 BNB
0x72d7140a7037e7788334704487f674f207ae6c5a9429994c6cf3cd1cdadd0aa6117395162021-10-13 15:06:142 days 6 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.0008539506033097 BNB
0x72d7140a7037e7788334704487f674f207ae6c5a9429994c6cf3cd1cdadd0aa6117395162021-10-13 15:06:142 days 6 hrs ago 0x050629d11e489d0661397ee1c652fb55a0f34afb 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.85392219308179182 BNB
0xfde54fb127de42fcd3c1082d9619705c788966bfcb4b1fad7d675cc23d82b58f116877802021-10-11 19:27:334 days 1 hr ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40x4d8222965d7ab82c5c4eed9ae7d55448c22c15d97.48787238598815042 BNB
0xfde54fb127de42fcd3c1082d9619705c788966bfcb4b1fad7d675cc23d82b58f116877802021-10-11 19:27:334 days 1 hr ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.007495367753741892 BNB
0xfde54fb127de42fcd3c1082d9619705c788966bfcb4b1fad7d675cc23d82b58f116877802021-10-11 19:27:334 days 1 hr ago 0x050629d11e489d0661397ee1c652fb55a0f34afb 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e47.495396532686716951 BNB
0xd784602a47e20a2ff66f4c5694a819f73da525b93bec1624c970622476a96354116799582021-10-11 12:16:454 days 8 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 0x050629d11e489d0661397ee1c652fb55a0f34afb5.994000322968112744 BNB
0xd784602a47e20a2ff66f4c5694a819f73da525b93bec1624c970622476a96354116799582021-10-11 12:16:454 days 8 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.006 BNB
0x44219fcc6bf10959bc77761adcbbcaebcb1172acb02452054fe4264031da4c9e116785042021-10-11 11:03:324 days 10 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40x62a3aaf79967a4b5491c8d272340e1545dc2d7690.146735943778920312 BNB
0x44219fcc6bf10959bc77761adcbbcaebcb1172acb02452054fe4264031da4c9e116785042021-10-11 11:03:324 days 10 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.000146882826605525 BNB
0x44219fcc6bf10959bc77761adcbbcaebcb1172acb02452054fe4264031da4c9e116785042021-10-11 11:03:324 days 10 hrs ago 0x050629d11e489d0661397ee1c652fb55a0f34afb 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.146883088346091267 BNB
0x8a2a2b9bd28779fcbf36ee6d65365464e287f9bf553e94b007faba3271d85fb7116640632021-10-10 23:00:154 days 22 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40x70ad053098e308faf30d5e4d0b74ffd4600809630.110937471678790805 BNB
0x8a2a2b9bd28779fcbf36ee6d65365464e287f9bf553e94b007faba3271d85fb7116640632021-10-10 23:00:154 days 22 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.000111048520198989 BNB
0x8a2a2b9bd28779fcbf36ee6d65365464e287f9bf553e94b007faba3271d85fb7116640632021-10-10 23:00:154 days 22 hrs ago 0x050629d11e489d0661397ee1c652fb55a0f34afb 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.111048094756113973 BNB
0xbb1099ae49e93e1b6aa3f6ec4ac25ddf861e3d769787720ed7573d11a9d9d3d7115635592021-10-07 11:00:168 days 10 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40x421eed84de843f198e713ca5bf98ef3ba7ca7cc60.058202410344139887 BNB
0xbb1099ae49e93e1b6aa3f6ec4ac25ddf861e3d769787720ed7573d11a9d9d3d7115635592021-10-07 11:00:168 days 10 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.000058260671015155 BNB
0xbb1099ae49e93e1b6aa3f6ec4ac25ddf861e3d769787720ed7573d11a9d9d3d7115635592021-10-07 11:00:168 days 10 hrs ago 0x050629d11e489d0661397ee1c652fb55a0f34afb 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.058261142318429003 BNB
0x52d8a7e28f594e8397aad0c950b8b9517c05c715d0af00170164223c39b2fe25115435582021-10-06 18:19:059 days 2 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40x4faba1ea67f84df7f5c179a9ed4a4109aaa307390.102539148428105491 BNB
0x52d8a7e28f594e8397aad0c950b8b9517c05c715d0af00170164223c39b2fe25115435582021-10-06 18:19:059 days 2 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.000102641790218323 BNB
0x52d8a7e28f594e8397aad0c950b8b9517c05c715d0af00170164223c39b2fe25115435582021-10-06 18:19:059 days 2 hrs ago 0x050629d11e489d0661397ee1c652fb55a0f34afb 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.102641736108054625 BNB
0x232a1e0054c220943e7c1546cf554e458893f48902804ea9d6ab8cd0da113a71115403822021-10-06 15:40:139 days 5 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40x4faba1ea67f84df7f5c179a9ed4a4109aaa307390.102530294545486134 BNB
0x232a1e0054c220943e7c1546cf554e458893f48902804ea9d6ab8cd0da113a71115403822021-10-06 15:40:139 days 5 hrs ago 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e4 PancakeSwap: Router v20.000102632927472959 BNB
0x232a1e0054c220943e7c1546cf554e458893f48902804ea9d6ab8cd0da113a71115403822021-10-06 15:40:139 days 5 hrs ago 0x050629d11e489d0661397ee1c652fb55a0f34afb 0xa74eecdb5c9f37844211c4b8bcaeaf3fcd6709e40.102632996950377456 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

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 = false;
    bool public autoSwapExitFees = false;

    /**
     * @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 {
        require(
            ITargetVault(vaultInfo[_vid].targetVault).balanceOfToken() == 0,
            "FeedVault(toggleTargetVault): balance of token is not zero"
        );
        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"}]

60806040526000600555600680547367d66e8ec1fd25d98b3ccd3b19b7dc4b4b7fc4936001600160a01b03199182168117909255600780549091169091179055600a60088190556009819055805461ffff191690556103b6600f556010805460ff60a01b191690553480156200007457600080fd5b506040516200575038038062005750833981810160405260608110156200009a57600080fd5b508051602082015160409092015160018055909190620000bc600033620001fb565b620000d76000805160206200573083398151915233620001fb565b620000f260008051602062005730833981519152806200020b565b6200010d6000805160206200571083398151915233620001fb565b6200013760008051602062005710833981519152600080516020620057308339815191526200020b565b600d80546001600160a01b038086166001600160a01b031992831617909255600e80548584169083161790556010805484841692169190911790556040805180820190915273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81526006549091166020820152620001ae90600b90600262000361565b506040805180820190915273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81526007546001600160a01b03166020820152620001f190600c90600262000361565b50505050620003e2565b6200020782826200025d565b5050565b600082815260208190526040808220600201549051839285917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a460009182526020829052604090912060020155565b6000828152602081815260409091206200028291839062004318620002d6821b17901c565b15620002075762000292620002f6565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620002ed836001600160a01b038416620002fa565b90505b92915050565b3390565b600062000308838362000349565b6200034057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620002f0565b506000620002f0565b60009081526001919091016020526040902054151590565b828054828255906000526020600020908101928215620003b9579160200282015b82811115620003b957825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000382565b50620003c7929150620003cb565b5090565b5b80821115620003c75760008155600101620003cc565b61531e80620003f26000396000f3fe6080604052600436106103bb5760003560e01c8063872daa36116101f2578063be1c0db51161010d578063de5f6268116100a0578063efc363e51161006f578063efc363e514610ce0578063fc0c546a14610d13578063fe78e5ca14610d28578063ffbd3b1f14610d3d576103c2565b8063de5f626814610c58578063e5acb42b14610c6d578063e8e0aef614610c99578063ec87621c14610ccb576103c2565b8063cafa086b116100dc578063cafa086b14610be0578063d02eb3f414610bf5578063d547741f14610c0a578063d73886fe14610c43576103c2565b8063be1c0db514610b3b578063c177327414610b6e578063c49d6ce414610ba1578063ca15c87314610bb6576103c2565b80639e1a4d1911610185578063abaa991611610154578063abaa991614610ac9578063b6b55f2514610ade578063bb9fb40b14610b08578063bd3d06df14610a04576103c2565b80639e1a4d19146109da578063a217fddf146109ef578063a5367b7514610a04578063a851806c14610a19576103c2565b806390fcdb36116101c157806390fcdb361461091157806391d1485414610926578063929060d81461097357806398084db7146109c5576103c2565b8063872daa36146108635780638b7f6a801461088d5780638c1548ad146108b75780639010d07c146108e1576103c2565b80632f2ff15d116102e25780635249961b1161027557806372845a751161024457806372845a75146107af57806375b238fc146107e85780637cb0d508146107fd578063864c199c14610830576103c2565b80635249961b14610704578063621b778914610737578063700959b61461074c578063709748181461077f576103c2565b806342220f34116102b157806342220f34146106a657806344bfc6bf146106ae578063498c7b65146106c357806351bb99f8146106d8576103c2565b80632f2ff15d146105f357806336568abe1461062c5780633a98ef39146106655780633e2d7f7f1461067a576103c2565b806317caf6f11161035a5780632a664993116103295780632a664993146105755780632b68772c1461059f5780632d17218b146105b45780632e1a7d4d146105c9576103c2565b806317caf6f1146104d55780631959a002146104ea57806321ad88d814610536578063248a9ca31461054b576103c2565b80630af07558116103965780630af07558146104665780630b2a88351461047b57806314cd30831461049057806316f19bb1146104c0576103c2565b80624677e8146103c75780630550473d146103f95780630ac84d8a14610420576103c2565b366103c257005b600080fd5b3480156103d357600080fd5b506103f7600480360360408110156103ea57600080fd5b5080359060200135610d52565b005b34801561040557600080fd5b5061040e610e61565b60408051918252519081900360200190f35b34801561042c57600080fd5b5061044a6004803603602081101561044357600080fd5b5035610e67565b604080516001600160a01b039092168252519081900360200190f35b34801561047257600080fd5b506103f7610e8e565b34801561048757600080fd5b5061044a610fbd565b34801561049c57600080fd5b506103f7600480360360408110156104b357600080fd5b5080359060200135610fcc565b3480156104cc57600080fd5b5061040e61108f565b3480156104e157600080fd5b5061040e611095565b3480156104f657600080fd5b5061051d6004803603602081101561050d57600080fd5b50356001600160a01b031661109b565b6040805192835260208301919091528051918290030190f35b34801561054257600080fd5b506103f76110b4565b34801561055757600080fd5b5061040e6004803603602081101561056e57600080fd5b50356111dc565b34801561058157600080fd5b506103f76004803603602081101561059857600080fd5b50356111f1565b3480156105ab57600080fd5b5061040e611314565b3480156105c057600080fd5b5061040e61131a565b3480156105d557600080fd5b506103f7600480360360208110156105ec57600080fd5b5035611320565b3480156105ff57600080fd5b506103f76004803603604081101561061657600080fd5b50803590602001356001600160a01b0316611c15565b34801561063857600080fd5b506103f76004803603604081101561064f57600080fd5b50803590602001356001600160a01b0316611c81565b34801561067157600080fd5b5061040e611ce2565b34801561068657600080fd5b5061040e6004803603602081101561069d57600080fd5b50351515611ce8565b6103f7611ef4565b3480156106ba57600080fd5b5061040e612673565b3480156106cf57600080fd5b5061044a6126d9565b3480156106e457600080fd5b506103f7600480360360208110156106fb57600080fd5b503515156126e8565b34801561071057600080fd5b506103f76004803603602081101561072757600080fd5b50356001600160a01b03166127ea565b34801561074357600080fd5b5061040e612931565b34801561075857600080fd5b506103f76004803603602081101561076f57600080fd5b50356001600160a01b0316612935565b34801561078b57600080fd5b506103f7600480360360408110156107a257600080fd5b5080359060200135612a7c565b3480156107bb57600080fd5b506103f7600480360360408110156107d257600080fd5b506001600160a01b038135169060200135612b87565b3480156107f457600080fd5b5061040e612e8c565b34801561080957600080fd5b506103f76004803603602081101561082057600080fd5b50356001600160a01b0316612e9e565b34801561083c57600080fd5b506103f76004803603602081101561085357600080fd5b50356001600160a01b0316613025565b34801561086f57600080fd5b5061044a6004803603602081101561088657600080fd5b50356131ac565b34801561089957600080fd5b506103f7600480360360208110156108b057600080fd5b50356131b9565b3480156108c357600080fd5b506103f7600480360360208110156108da57600080fd5b50356132dc565b3480156108ed57600080fd5b5061044a6004803603604081101561090457600080fd5b5080359060200135613400565b34801561091d57600080fd5b5061044a613421565b34801561093257600080fd5b5061095f6004803603604081101561094957600080fd5b50803590602001356001600160a01b0316613430565b604080519115158252519081900360200190f35b34801561097f57600080fd5b5061099d6004803603602081101561099657600080fd5b5035613448565b6040805193151584526001600160a01b03909216602084015282820152519081900360600190f35b3480156109d157600080fd5b506103f7613486565b3480156109e657600080fd5b5061040e6139e1565b3480156109fb57600080fd5b5061040e6139fd565b348015610a1057600080fd5b5061040e613a02565b348015610a2557600080fd5b506103f760048036036020811015610a3c57600080fd5b810190602081018135640100000000811115610a5757600080fd5b820183602082011115610a6957600080fd5b80359060200191846020830284011164010000000083111715610a8b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550613a07945050505050565b348015610ad557600080fd5b506103f7613b1e565b348015610aea57600080fd5b506103f760048036036020811015610b0157600080fd5b5035613bd0565b348015610b1457600080fd5b5061040e60048036036020811015610b2b57600080fd5b50356001600160a01b0316613ca5565b348015610b4757600080fd5b5061095f60048036036020811015610b5e57600080fd5b50356001600160a01b0316613d18565b348015610b7a57600080fd5b5061040e60048036036020811015610b9157600080fd5b50356001600160a01b0316613d2d565b348015610bad57600080fd5b5061095f613d3f565b348015610bc257600080fd5b5061040e60048036036020811015610bd957600080fd5b5035613d4d565b348015610bec57600080fd5b5061095f613d64565b348015610c0157600080fd5b5061044a613d6d565b348015610c1657600080fd5b506103f760048036036040811015610c2d57600080fd5b50803590602001356001600160a01b0316613d85565b348015610c4f57600080fd5b5061044a613dde565b348015610c6457600080fd5b506103f7613ded565b348015610c7957600080fd5b506103f760048036036020811015610c9057600080fd5b50351515613efb565b348015610ca557600080fd5b506103f760048036036040811015610cbc57600080fd5b50803590602001351515613fef565b348015610cd757600080fd5b5061040e61419b565b348015610cec57600080fd5b506103f760048036036020811015610d0357600080fd5b50356001600160a01b03166141ad565b348015610d1f57600080fd5b5061044a6142f4565b348015610d3457600080fd5b5061044a614303565b348015610d4957600080fd5b5061040e614312565b60035482908110610daa576040805162461bcd60e51b815260206004820181905260248201527f466565645661756c743a205661756c7420646f6573206e6f7420657869737473604482015290519081900360640190fd5b600080516020615058833981519152610dc38133613430565b610e02576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415610e48576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6002600155610e57848461432d565b5050600180555050565b6103e381565b600b8181548110610e7457fe5b6000918252602090912001546001600160a01b0316905081565b600080516020615200833981519152610ea78133613430565b610ee6576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415610f2c576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6002600155601054600160a01b900460ff1615610f7a5760405162461bcd60e51b8152600401808060200182810382526032815260200180614ebd6032913960400191505060405180910390fd5b6010805460ff60a01b1916600160a01b1790556040517fd9b5f2043d0bf9eff96f43914de1de53fac509c424f8a70d9348b1c889ede47790600090a15060018055565b6007546001600160a01b031681565b600080516020615058833981519152610fe58133613430565b611024576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b6110618261105b6003868154811061103857fe5b90600052602060002090600202016001015460055461442290919063ffffffff16565b9061447f565b600581905550816003848154811061107557fe5b906000526020600020906002020160010181905550505050565b60085481565b60055481565b6011602052600090815260409020805460019091015482565b6000805160206152008339815191526110cd8133613430565b61110c576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415611152576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6002600155601054600160a01b900460ff1661119f5760405162461bcd60e51b8152600401808060200182810382526030815260200180614eef6030913960400191505060405180910390fd5b6010805460ff60a01b191690556040517f8eaa3251e7fc5bb98a6b86bcd8850a884c17f00a0a7b9cfb6d58d98882e2815790600090a15060018055565b60009081526020819052604090206002015490565b60008051602061520083398151915261120a8133613430565b611249576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b6002600154141561128f576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b600260015560328211156112d45760405162461bcd60e51b815260040180806020018281038252603f815260200180614d45603f913960400191505060405180910390fd5b60088290556040805183815290517f38513f56d06662d667ce256d332fed02f01371f29d9d028f48ed5b472c7419b99181900360200190a1505060018055565b60035490565b60095481565b601054600160a01b900460ff161561136d576040805162461bcd60e51b815260206004820152601c6024820152600080516020614f1f833981519152604482015290519081900360640190fd5b6003546113af576040805162461bcd60e51b815260206004820152601a6024820152600080516020615078833981519152604482015290519081900360640190fd5b600260015414156113f5576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b600260019081553360009081526011602052604090209081015443141561144d5760405162461bcd60e51b81526004018080602001828103825260418152602001806150b96041913960600191505060405180910390fd5b60035460005b818110156115865760006003828154811061146a57fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b1580156114c757600080fd5b505afa1580156114db573d6000803e3d6000fd5b505050506040513d60208110156114f157600080fd5b5051111561157e576003818154811061150657fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663c87965726040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561156557600080fd5b505af1158015611579573d6000803e3d6000fd5b505050505b600101611453565b5060006115a76004546115a18661159b6139e1565b906144d9565b90614532565b60045490915047906115b99086614422565b60045583546115c89086614422565b845560008282106115da575081611719565b60035460006115e98585614422565b905060006115f76000611ce8565b905060005b83811015611704576003818154811061161157fe5b600091825260209091206002909102015460ff16156116fc57600047905060006116d5846115a1876003878154811061164657fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663722713f76040518163ffffffff1660e01b815260040160206040518083038186803b1580156116a357600080fd5b505afa1580156116b7573d6000803e3d6000fd5b505050506040513d60208110156116cd57600080fd5b5051906144d9565b90506116e18382614599565b476116f66116ef8285614422565b899061447f565b97505050505b6001016115fc565b509284019285841115611715578593505b5050505b60006117366127106115a1600854856144d990919063ffffffff16565b90508015611ba457600a5460ff1615611b5b57600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561179457600080fd5b505afa1580156117a8573d6000803e3d6000fd5b505050506040513d60208110156117be57600080fd5b50516010546040805163d06ca61f60e01b81526004810186815260248201928352600c8054604484018190529596506060956001600160a01b039095169463d06ca61f94899492939290916064909101908490801561184657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611828575b5050935050505060006040518083038186803b15801561186557600080fd5b505afa158015611879573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156118a257600080fd5b81019080805160405193929190846401000000008211156118c257600080fd5b9083019060208201858111156118d757600080fd5b82518660208202830111640100000000821117156118f457600080fd5b82525081516020918201928201910280838360005b83811015611921578181015183820152602001611909565b5050505090500160405250505090506000816119486001845161442290919063ffffffff16565b8151811061195257fe5b60200260200101519050601060009054906101000a90046001600160a01b03166001600160a01b031663b6f9de958561199c6103e86115a1600f54876144d990919063ffffffff16565b600c30426078016040518663ffffffff1660e01b81526004018085815260200180602001846001600160a01b031681526020018381526020018281038252858181548152602001915080548015611a1c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116119fe575b5050955050505050506000604051808303818588803b158015611a3e57600080fd5b505af1158015611a52573d6000803e3d6000fd5b5050600754604080516370a0823160e01b81523060048201529051600095506001600160a01b0390921693506370a082319250602480820192602092909190829003018186803b158015611aa557600080fd5b505afa158015611ab9573d6000803e3d6000fd5b505050506040513d6020811015611acf57600080fd5b505190506000611adf8286614422565b600e54600754919250611aff916001600160a01b0390811691168361461b565b600754600e546040805160018152602081018a905281516001600160a01b0394851694909316927faad7631698e5d5543338d1926cf4860a6ade1fcdf1f3d6ffd09555dee988b0f6929181900390910190a35050505050611b97565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611b95573d6000803e3d6000fd5b505b611ba18282614422565b91505b604051339083156108fc029084906000818181858888f19350505050158015611bd1573d6000803e3d6000fd5b5060408051838152905133917f6cca423c6ffc06e62a0acc433965e074b11c28479b0449250ce3ff65ac9e39fe919081900360200190a25050600180555050505050565b600082815260208190526040902060020154611c3890611c3361466d565b613430565b611c735760405162461bcd60e51b815260040180806020018281038252602f815260200180614d84602f913960400191505060405180910390fd5b611c7d8282614671565b5050565b611c8961466d565b6001600160a01b0316816001600160a01b031614611cd85760405162461bcd60e51b815260040180806020018281038252602f8152602001806152ba602f913960400191505060405180910390fd5b611c7d82826146da565b60045481565b60035460009081805b82811015611eec5760038181548110611d0657fe5b600091825260209091206002909102015460ff1615611ee457600085611dc35760038281548110611d3357fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9057600080fd5b505afa158015611da4573d6000803e3d6000fd5b505050506040513d6020811015611dba57600080fd5b50519050611ed6565b611ed3670de0b6b3a76400006115a160038581548110611ddf57fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663048829806040518163ffffffff1660e01b815260040160206040518083038186803b158015611e3c57600080fd5b505afa158015611e50573d6000803e3d6000fd5b505050506040513d6020811015611e6657600080fd5b50516003805487908110611e7657fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316630bf6cc086040518163ffffffff1660e01b815260040160206040518083038186803b1580156116a357600080fd5b90505b611ee0838261447f565b9250505b600101611cf1565b509392505050565b601054600160a01b900460ff1615611f41576040805162461bcd60e51b815260206004820152601c6024820152600080516020614f1f833981519152604482015290519081900360640190fd5b600354611f83576040805162461bcd60e51b815260206004820152601a6024820152600080516020615078833981519152604482015290519081900360640190fd5b60026001541415611fc9576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b600260015560035460005b8181101561210757600060038281548110611feb57fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b15801561204857600080fd5b505afa15801561205c573d6000803e3d6000fd5b505050506040513d602081101561207257600080fd5b505111156120ff576003818154811061208757fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663c87965726040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156120e657600080fd5b505af11580156120fa573d6000803e3d6000fd5b505050505b600101611fd4565b5060006121146000611ce8565b9050600034905060006121386127106115a1600854856144d990919063ffffffff16565b9050801561259957600a5460ff161561255d57600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561219657600080fd5b505afa1580156121aa573d6000803e3d6000fd5b505050506040513d60208110156121c057600080fd5b50516010546040805163d06ca61f60e01b81526004810186815260248201928352600b8054604484018190529596506060956001600160a01b039095169463d06ca61f94899492939290916064909101908490801561224857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161222a575b5050935050505060006040518083038186803b15801561226757600080fd5b505afa15801561227b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156122a457600080fd5b81019080805160405193929190846401000000008211156122c457600080fd5b9083019060208201858111156122d957600080fd5b82518660208202830111640100000000821117156122f657600080fd5b82525081516020918201928201910280838360005b8381101561232357818101518382015260200161230b565b50505050905001604052505050905060008161234a6001845161442290919063ffffffff16565b8151811061235457fe5b60200260200101519050601060009054906101000a90046001600160a01b03166001600160a01b031663b6f9de958561239e6103e86115a1600f54876144d990919063ffffffff16565b600b30426078016040518663ffffffff1660e01b81526004018085815260200180602001846001600160a01b03168152602001838152602001828103825285818154815260200191508054801561241e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612400575b5050955050505050506000604051808303818588803b15801561244057600080fd5b505af1158015612454573d6000803e3d6000fd5b5050600654604080516370a0823160e01b81523060048201529051600095506001600160a01b0390921693506370a082319250602480820192602092909190829003018186803b1580156124a757600080fd5b505afa1580156124bb573d6000803e3d6000fd5b505050506040513d60208110156124d157600080fd5b5051905060006124e18286614422565b600d54600654919250612501916001600160a01b0390811691168361461b565b600654600d546040805160018152602081018a905281516001600160a01b0394851694909316927faad7631698e5d5543338d1926cf4860a6ade1fcdf1f3d6ffd09555dee988b0f6929181900390910190a35050505050612599565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015612597573d6000803e3d6000fd5b505b6125a1614743565b60006125ad6000611ce8565b905060008482106125c5576125c28286614422565b90505b8015612631576000600454600014156125df5750806125fb565b6125f8866115a1600454856144d990919063ffffffff16565b90505b336000908152601160205260409020600454612617908361447f565b6004558054612626908361447f565b815543600190910155505b60408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a250506001805550505050565b60035460009081805b828110156126d25760006126bb6005546115a16003858154811061269c57fe5b90600052602060002090600202016001015460038681548110611e7657fe5b90506126c7838261447f565b92505060010161267c565b5091505090565b600e546001600160a01b031681565b6000805160206152008339815191526127018133613430565b612740576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415612786576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6002600155600a805483151561010090810261ff00199092169190911791829055604080519190920460ff161515815290517f4e87b8c54656d7c3f58dbeb46a627c6b558d9ee488aaaaf6bf419e757a4d864d9181900360200190a1505060018055565b6000805160206152008339815191526128038133613430565b612842576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415612888576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b60026001556001600160a01b0382166128d25760405162461bcd60e51b81526004018080602001828103825260438152602001806152776043913960600191505060405180910390fd5b601080546001600160a01b0319166001600160a01b03848116919091179182905560408051929091168252517f449a1bd1377b6ad637113368e2e67a7ff6920f8700956c81906a2485fed27909916020908290030190a1505060018055565b4790565b60008051602061520083398151915261294e8133613430565b61298d576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b600260015414156129d3576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b60026001556001600160a01b038216612a1d5760405162461bcd60e51b815260040180806020018281038252604f815260200180614f9c604f913960600191505060405180910390fd5b600d80546001600160a01b0319166001600160a01b03848116919091179182905560408051929091168252517fed9f75e91bdc992b7118fbe3ccf2ee8230e2575969b48a2402cd5fe7246e1e96916020908290030190a1505060018055565b60035482908110612ad4576040805162461bcd60e51b815260206004820181905260248201527f466565645661756c743a205661756c7420646f6573206e6f7420657869737473604482015290519081900360640190fd5b600080516020615058833981519152612aed8133613430565b612b2c576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415612b72576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b60026001558215610e5757610e578484614599565b600080516020615058833981519152612ba08133613430565b612bdf576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b6001600160a01b038316600090815260126020526040902054839060ff1615612c4f576040805162461bcd60e51b815260206004820152601b60248201527f466565645661756c743a204475706c696361746564207661756c740000000000604482015290519081900360640190fd5b60026001541415612c95576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b60026001556001600160a01b038416612cdf5760405162461bcd60e51b815260040180806020018281038252603e8152602001806150fa603e913960400191505060405180910390fd5b306001600160a01b0316846001600160a01b031663508cfff66040518163ffffffff1660e01b815260040160206040518083038186803b158015612d2257600080fd5b505afa158015612d36573d6000803e3d6000fd5b505050506040513d6020811015612d4c57600080fd5b50516001600160a01b031614612d935760405162461bcd60e51b815260040180806020018281038252604b815260200180614e0d604b913960600191505060405180910390fd5b600554612da0908461447f565b60055550506001600160a01b0391821660008181526012602090815260408083208054600160ff199182168117909255825160608101845282815280850187815281850198895260038054808601825581895292517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b6002909402938401805493519390951690151517610100600160a81b03191661010092909b16919091029990991790915595517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c9096019590955594549282526013905292909220600019929092019091558055565b60008051602061520083398151915281565b600080516020615200833981519152612eb78133613430565b612ef6576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415612f3c576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b60026001556001600160a01b038216612f865760405162461bcd60e51b81526004018080602001828103825260438152602001806151bd6043913960600191505060405180910390fd5b600780546001600160a01b0319166001600160a01b0384811691909117918290556040805180820190915273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c815291166020820152612fdd90600c906002614ca8565b50600754604080516001600160a01b039092168252517f5ad2b44c825d53dfd7b1ca00e4cb03fdfd7f47e11072bc2ea3f576f4c97338bf9181900360200190a1505060018055565b60008051602061520083398151915261303e8133613430565b61307d576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b600260015414156130c3576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b60026001556001600160a01b03821661310d5760405162461bcd60e51b8152600401808060200182810382526045815260200180614e786045913960600191505060405180910390fd5b600680546001600160a01b0319166001600160a01b0384811691909117918290556040805180820190915273bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81529116602082015261316490600b906002614ca8565b50600654604080516001600160a01b039092168252517fdfe579447f21f2c4e9f4ce7743e70e2a191e0234c83a5665b55dda21056dc25f9181900360200190a1505060018055565b600c8181548110610e7457fe5b6000805160206152008339815191526131d28133613430565b613211576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415613257576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6002600155603282111561329c5760405162461bcd60e51b815260040180806020018281038252603d81526020018061501b603d913960400191505060405180910390fd5b60098290556040805183815290517f3d2fe976eadb09bdc566cb76c2b61638dfb432c7cc4562a03b30586e348993309181900360200190a1505060018055565b6000805160206152008339815191526132f58133613430565b613334576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b6002600154141561337a576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b60026001556103e38211156133c05760405162461bcd60e51b8152600401808060200182810382526037815260200180614f656037913960400191505060405180910390fd5b600f8290556040805183815290517f7c0b78784b74c7a5d45aaffe8949cf9eda9e2a2bf0b5c48519c4829e563228a49181900360200190a1505060018055565b60008281526020819052604081206134189083614807565b90505b92915050565b6010546001600160a01b031681565b60008281526020819052604081206134189083614813565b6003818154811061345557fe5b60009182526020909120600290910201805460019091015460ff821692506101009091046001600160a01b03169083565b60008051602061505883398151915261349f8133613430565b6134de576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b601054600160a01b900460ff161561352b576040805162461bcd60e51b815260206004820152601c6024820152600080516020614f1f833981519152604482015290519081900360640190fd5b60035461356d576040805162461bcd60e51b815260206004820152601a6024820152600080516020615078833981519152604482015290519081900360640190fd5b600260015414156135b3576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b600260015560006135c381611ce8565b60035490915060005b8181101561386b57600381815481106135e157fe5b600091825260209091206002909102015460ff16156138635760006003828154811061360957fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b15801561366657600080fd5b505afa15801561367a573d6000803e3d6000fd5b505050506040513d602081101561369057600080fd5b5051600554600380549293506000926136d392916115a191879081106136b257fe5b906000526020600020906002020160010154886144d990919063ffffffff16565b905060008183111561385f57600384815481106136ec57fe5b906000526020600020906002020160010154600014156137a3576003848154811061371357fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663722713f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561377057600080fd5b505afa158015613784573d6000803e3d6000fd5b505050506040513d602081101561379a57600080fd5b50519050613855565b613852600385815481106137b357fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663af1a4c5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561381057600080fd5b505afa158015613824573d6000803e3d6000fd5b505050506040513d602081101561383a57600080fd5b50516115a1670de0b6b3a764000061159b8787614422565b90505b61385f8482614599565b5050505b6001016135cc565b5060006138766139e1565b905060005b828110156139d6576003818154811061389057fe5b600091825260209091206002909102015460ff16156139ce576000600382815481106138b857fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b15801561391557600080fd5b505afa158015613929573d6000803e3d6000fd5b505050506040513d602081101561393f57600080fd5b50516005546003805492935060009261398292916115a1918790811061396157fe5b906000526020600020906002020160010154876144d990919063ffffffff16565b9050808210156139cb5760006139988284614422565b9050806139a3612931565b10156139bf576139ba846139b5612931565b61432d565b6139c9565b6139c9848261432d565b505b50505b60010161387b565b505060018055505050565b60006139f86139f06000611ce8565b61105b612931565b905090565b600081565b603281565b600080516020615058833981519152613a208133613430565b613a5f576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415613aa5576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6002600155600354825114613aeb5760405162461bcd60e51b81526004018080602001828103825260388152602001806151386038913960400191505060405180910390fd5b60035460005b81811015610e5757613b1681858381518110613b0957fe5b6020026020010151610fcc565b600101613af1565b600080516020615058833981519152613b378133613430565b613b76576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415613bbc576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6002600155613bc9614743565b5060018055565b601054600160a01b900460ff1615613c1d576040805162461bcd60e51b815260206004820152601c6024820152600080516020614f1f833981519152604482015290519081900360640190fd5b600354613c5f576040805162461bcd60e51b815260206004820152601a6024820152600080516020615078833981519152604482015290519081900360640190fd5b60026001541415613bc9576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526012602052604081205460ff16613cfc5760405162461bcd60e51b815260040180806020018281038252602d81526020018061524a602d913960400191505060405180910390fd5b506001600160a01b031660009081526013602052604090205490565b60126020526000908152604090205460ff1681565b60136020526000908152604090205481565b600a54610100900460ff1681565b600081815260208190526040812061341b90614828565b600a5460ff1681565b73bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c81565b600082815260208190526040902060020154613da390611c3361466d565b611cd85760405162461bcd60e51b8152600401808060200182810382526030815260200180614feb6030913960400191505060405180910390fd5b600d546001600160a01b031681565b601054600160a01b900460ff1615613e3a576040805162461bcd60e51b815260206004820152601c6024820152600080516020614f1f833981519152604482015290519081900360640190fd5b600354613e7c576040805162461bcd60e51b815260206004820152601a6024820152600080516020615078833981519152604482015290519081900360640190fd5b600254604080516370a0823160e01b81523360048201529051613ef9926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015613ec857600080fd5b505afa158015613edc573d6000803e3d6000fd5b505050506040513d6020811015613ef257600080fd5b5051613bd0565b565b600080516020615200833981519152613f148133613430565b613f53576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b60026001541415613f99576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b6002600155600a805460ff191683151517908190556040805160ff90921615158252517f6d3ad049914c2d4eb7dcc36dae159166c9d5b5c4cd481d269b2f7c0f1158e4a2916020908290030190a1505060018055565b6000805160206152008339815191526140088133613430565b614047576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b6002600154141561408d576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b600260015560038054849081106140a057fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b0316636b0f1c816040518163ffffffff1660e01b815260040160206040518083038186803b1580156140fd57600080fd5b505afa158015614111573d6000803e3d6000fd5b505050506040513d602081101561412757600080fd5b5051156141655760405162461bcd60e51b815260040180806020018281038252603a815260200180614dd3603a913960400191505060405180910390fd5b816003848154811061417357fe5b60009182526020909120600290910201805460ff191691151591909117905550506001805550565b60008051602061505883398151915281565b6000805160206152008339815191526141c68133613430565b614205576040805162461bcd60e51b815260206004820152601d6024820152600080516020614e58833981519152604482015290519081900360640190fd5b6002600154141561424b576040805162461bcd60e51b815260206004820152601f6024820152600080516020614db3833981519152604482015290519081900360640190fd5b60026001556001600160a01b0382166142955760405162461bcd60e51b815260040180806020018281038252604d815260200180615170604d913960600191505060405180910390fd5b600e80546001600160a01b0319166001600160a01b03848116919091179182905560408051929091168252517f50d820c8274fe1cf135aea2f21097a0d3aff16185cf6d8a557e3b01ad909ab19916020908290030190a1505060018055565b6002546001600160a01b031681565b6006546001600160a01b031681565b600f5481565b6000613418836001600160a01b038416614833565b478181101561433a578091505b811561441d576003838154811061434d57fe5b60009182526020822060029190910201546040516101009091046001600160a01b0316916108fc851502918591818181858888f19350505050158015614397573d6000803e3d6000fd5b50600383815481106143a557fe5b906000526020600020906002020160000160019054906101000a90046001600160a01b03166001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561440457600080fd5b505af1158015614418573d6000803e3d6000fd5b505050505b505050565b600082821115614479576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015613418576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826144e85750600061341b565b828202828482816144f557fe5b04146134185760405162461bcd60e51b81526004018080602001828103825260218152602001806150986021913960400191505060405180910390fd5b6000808211614588576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161459157fe5b049392505050565b600382815481106145a657fe5b600091825260208220600291909102015460408051632e1a7d4d60e01b81526004810185905290516101009092046001600160a01b031692632e1a7d4d9260248084019382900301818387803b1580156145ff57600080fd5b505af1158015614613573d6000803e3d6000fd5b505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261441d90849061487d565b3390565b60008281526020819052604090206146899082614318565b15611c7d5761469661466d565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206146f2908261492e565b15611c7d576146ff61466d565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b601054600160a01b900460ff1615614790576040805162461bcd60e51b815260206004820152601c6024820152600080516020614f1f833981519152604482015290519081900360640190fd5b600061479a612931565b905080156148045760035460005b8181101561441d57600381815481106147bd57fe5b600091825260209091206002909102015460ff16156147fc5760006147ee6005546115a16003858154811061396157fe5b90506147fa828261432d565b505b6001016147a8565b50565b60006134188383614943565b6000613418836001600160a01b0384166149a7565b600061341b826149bf565b600061483f83836149a7565b6148755750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561341b565b50600061341b565b60606148d2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166149c39092919063ffffffff16565b80519091501561441d578080602001905160208110156148f157600080fd5b505161441d5760405162461bcd60e51b815260040180806020018281038252602a815260200180615220602a913960400191505060405180910390fd5b6000613418836001600160a01b0384166149dc565b815460009082106149855760405162461bcd60e51b8152600401808060200182810382526022815260200180614d236022913960400191505060405180910390fd5b82600001828154811061499457fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b60606149d28484600085614aa2565b90505b9392505050565b60008181526001830160205260408120548015614a985783546000198083019190810190600090879083908110614a0f57fe5b9060005260206000200154905080876000018481548110614a2c57fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080614a5c57fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061341b565b600091505061341b565b606082471015614ae35760405162461bcd60e51b8152600401808060200182810382526026815260200180614f3f6026913960400191505060405180910390fd5b614aec85614bfe565b614b3d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310614b7c5780518252601f199092019160209182019101614b5d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114614bde576040519150601f19603f3d011682016040523d82523d6000602084013e614be3565b606091505b5091509150614bf3828286614c04565b979650505050505050565b3b151590565b60608315614c135750816149d5565b825115614c235782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614c6d578181015183820152602001614c55565b50505050905090810190601f168015614c9a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b828054828255906000526020600020908101928215614cfd579160200282015b82811115614cfd57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614cc8565b50614d09929150614d0d565b5090565b5b80821115614d095760008155600101614d0e56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64735461726765745661756c742873657446656573293a20656e747279206665657320626173697320706f696e74732065786365656473207468726573686f6c64416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e745265656e7472616e637947756172643a207265656e7472616e742063616c6c00466565645661756c7428746f67676c655461726765745661756c74293a2062616c616e6365206f6620746f6b656e206973206e6f74207a65726f466565645661756c74286164645461726765745661756c74293a20546172676574207661756c742066656564207661756c7420746172676574206973206e6f742074686973207661756c74466565645661756c743a2043616c6c657220686173206e6f20726f6c65000000466565645661756c7428736574456e74727953776170546f6b656e293a20656e747279207377617020746f6b656e2063616e6e6f74206265207a65726f2061646472657373466565645661756c742864697361626c655661756c74293a205661756c7420697320616c72656164792064697361626c6564466565645661756c7428656e61626c655661756c74293a205661756c7420697320616c726561647920656e61626c6564466565645661756c743a207661756c742069732064697361626c656400000000416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5461726765745661756c7428736574536c697070616765466163746f72293a20736c697070616765466163746f7220746f6f20686967685461726765745661756c7428736574456e74727946656573436f6c6c6563746f72293a20656e747279206665657320636f6c6c6563746f722063616e6e6f74206265207a65726f2061646472657373416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b65466565645661756c742873657446656573293a20656e747279206665657320626173697320706f696e74732065786365656473207468726573686f6c64241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08466565645661756c743a204e6f20746172676574207661756c74000000000000536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77466565645661756c74287769746864726177293a2077697468647261772063616e6e6f74206265207468652073616d6520626c6f636b206173206465706f736974466565645661756c74286164645461726765745661756c74293a20546172676574207661756c742063616e6e6f74206265207a65726f2061646472657373466565645661756c7428736574416c6c6f63506f696e7473293a206e756d626572206f66207661756c747320697320696e636f72726563745461726765745661756c74287365744578697446656573436f6c6c6563746f72293a2065786974206665657320636f6c6c6563746f722063616e6e6f74206265207a65726f2061646472657373466565645661756c74287365744578697453776170546f6b656e293a2065786974207377617020746f6b656e2063616e6e6f74206265207a65726f2061646472657373a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217755361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564466565645661756c743a20546f6b656e20646f6573206e6f742065786973747320696e20616e79207661756c74466565645661756c742873657453776170526f7574657241646472657373293a207377617020726f757465722063616e6e6f74206265207a65726f2061646472657373416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a26469706673582212201914f72546ec964b2836397e0b042cdf2b4f595533ffd2f9ac11a85a51f91ef564736f6c63430007030033241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217750000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a000000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a0000000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e

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

0000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a000000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a0000000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e

-----Decoded View---------------
Arg [0] : _entryFeesCollector (address): 0x7a818e7e0edc038a3b80d4d8e55400b3c3ee8a00
Arg [1] : _exitFeesCollector (address): 0x7a818e7e0edc038a3b80d4d8e55400b3c3ee8a00
Arg [2] : _swapRouterAddress (address): 0x10ed43c718714eb63d5aa57b78b54704e256024e

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a00
Arg [1] : 0000000000000000000000007a818e7e0edc038a3b80d4d8e55400b3c3ee8a00
Arg [2] : 00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e


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.