Contract 0x5BA98Ad75AB87eB90fFc2b680bCfC6b9030E1246

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xcf978b1dc4216aa147297e022cd18939ea6889231bb3e648d3c0ca2d3e071e4fDeposit419687602022-11-28 20:04:207 days 1 hr ago0x01684ded0415d64e03a15ea6e5413236e260b057 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00003073
0xe8650f30c86281abb76fc1dbcc647417f4e6643901faa877c465a1ce9c14fc08Deposit419673102022-11-28 19:57:017 days 1 hr ago0x5c8172e296cb23b9a0a173454a76ac347c6f9611 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00003053
0x3f3174e9fc9862c580d89afbad193243a45a3384787683355f03ed881b08fcd4Deposit419387102022-11-28 17:37:467 days 3 hrs ago0xce1aac18ee472da6d90b68b6685df910046cb8ad IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00004532
0x2418e95d27885e8d54ffcfacba8581eb9b89aab7221eefb6f579788007b148ccDeposit419363262022-11-28 17:26:167 days 4 hrs ago0xbeb64391801daaaaa084030ea00647b6cfa270e6 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00004562
0x74966745cc2722eb87a315dd103a5faff06c2dca2148ff54f3610491f6177568Deposit419338442022-11-28 17:13:537 days 4 hrs ago0x993f759b607bb3831e4d957fb7aedadd7447726f IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00004055
0x74866c6bc2ce1809d8e723c0dc973ff62e2213977232d1750988f8e4363a0913Redeem419201092022-11-28 16:06:487 days 5 hrs ago0x11147456da6f04768ace9547b0bb8b8fcf616530 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00006073
0xbfcd9743abb6c6f5b91993fd4d9c8f5744efa0f3bed5734dab7de3cbac7f86deRedeem419199692022-11-28 16:06:067 days 5 hrs ago0x11147456da6f04768ace9547b0bb8b8fcf616530 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00006073
0xed172d7d519019e8903a9daa19c3d5699f332af57df7b2f3c1d7af91d6077a80Redeem419198342022-11-28 16:05:247 days 5 hrs ago0x11147456da6f04768ace9547b0bb8b8fcf616530 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00006073
0x9c3c586cf3ebaa5022617b520412099acac949ec432eba111748383cdf6f2474Deposit419154502022-11-28 15:42:387 days 5 hrs ago0x65ba38e21528e45e9cdd2f6950d9254fe2af8580 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00006257
0x9616e0bd395f3d3c36cd1c26d387f70ca4354bcc9cfd9afa459bcfd77cdd5d59Deposit418697922022-11-28 11:58:507 days 9 hrs ago0xbe3c423af46464c33254fc7e496f7ba809e0c39e IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002728
0x96f754572e9b962409cd327f13086af5c693a870ad6a109e3edfa3bb54aeb91dDeposit418626382022-11-28 11:23:247 days 10 hrs ago0x52ae07c317424c62f04453918045a82ec8cc34e1 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002811
0x358fb6f102a41a941900d2eeeaede30860668ff2195b32cb2b501910296cfc5aDeposit418372672022-11-28 9:09:157 days 12 hrs ago0x918602b520530ee49e8b24565fc7a51170cf3d48 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.0000241
0xee5c0760b9fd6cbe4560671db92ee38fbdd82585b3c3ff727993c65216ecc82bRedeem418006562022-11-28 5:48:017 days 15 hrs ago0xb50aa6ee870952e3d7a1795c49c664e05c60cabd IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002315
0x7a39c1c7ccb68a6d077b1cdf717a59c26bff8e74893e6ed22d9ac501f22748bcRedeem417974452022-11-28 5:29:067 days 16 hrs ago0xaa98c7afabbc0ea3acdc029a9d71b9ac83ff8cef IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002449
0xfb5b0d71bfb85e15830af310850c51efb9b8c9bff0caf0505ff75d5551f60b7dDeposit417973402022-11-28 5:28:217 days 16 hrs ago0x83967d911526fb8bea93155d6e2921352bdcd4f5 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002544
0x574906ac101030ab4f8daf0717c4a26d4a17f01f9980076e35df3c398520e957Deposit417950352022-11-28 5:14:177 days 16 hrs ago0x2c94af4866859c9a07f997cfd22ad538c621fa56 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002591
0xb887687a31d943b34804525b956895b0e08f860ca021270297f9df2ad2e5bb15Deposit417890752022-11-28 4:34:117 days 16 hrs ago0x5c55e6b297f36eefc58365849ebe8061699e5448 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002558
0x31472a0878f3c1c2ec6f6bcec1ccb6ecc16188676fd0294c740dfb1fc23cc2adRedeem417889972022-11-28 4:33:407 days 16 hrs ago0x5c55e6b297f36eefc58365849ebe8061699e5448 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002279
0x5bb51cdddcb64f86b4b6e9cc95d0daa69faabd9017f2428f27a8832120496bf5Deposit417888382022-11-28 4:32:517 days 17 hrs ago0x5c55e6b297f36eefc58365849ebe8061699e5448 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002558
0xe9698cdb695351a4027b165a46c50fa6144aa667b020b69c09ba903445daafb8Deposit417316322022-11-27 22:30:167 days 23 hrs ago0x32cf8e7884b904e93961e046564bfd90dd7bc7e8 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002613
0x9fa1f32ebdb11e375c5ee85f504d4bef8411d55d6dbf33845040f7b8d1d0dcddDeposit417112252022-11-27 20:25:578 days 1 hr ago0x92f13a3a27b50252b62c0d1eec5838c94f8520c0 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002885
0x4ce68cd8b94b163487ad090fd6ec9d27fa8a275753dae2a82bbd4ad0ceaa89a9Deposit417038702022-11-27 19:40:038 days 1 hr ago0x81c1f165c96df154febe4730ae021778f025e490 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002631
0xf070310a6c81b0b1babcc3f683594b7de88ef48c05978a97b6f6bfbadae67091Deposit417021172022-11-27 19:29:118 days 2 hrs ago0x55432de4a9b98d2046b4173b8e59a7b540651f20 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.0000269
0xddc56d017853bf0e9e3b4f159465d4c2e6c244abb429aefdd0614351b8725bd7Deposit416907292022-11-27 18:23:288 days 3 hrs ago0x46fac64c94ad27fde11be992849a02c42eeca762 IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002677
0x31689f3fb55c154627fe815d125dfcb3a1be67d8e418e5e8eed91f03675c5de4Deposit416390582022-11-27 14:17:098 days 7 hrs ago0x8aaad448a1fec285ff786ae226160e9a9bcbf8ca IN  0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH0.00002515
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x19cebc1ad6c202dda29b85360c20d4ca101d5cc77d384d75318effb8a9a1cc4d424667372022-11-30 14:57:115 days 6 hrs ago Jones DAO: Asset Management Multisig 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH
0xe505fca428134b8ccca4e6750bdb225ab04a5be73330e6f42e329250c50d7239419729262022-11-28 20:25:077 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
0xe505fca428134b8ccca4e6750bdb225ab04a5be73330e6f42e329250c50d7239419729262022-11-28 20:25:077 days 1 hr ago 0x6ecaa3203aeb4d0cc21745f2752a73b41ced7c24 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH
0x3d19161636e53fb03be0df0463bd398900276e53cef1300cd94ddb04e879999d419689252022-11-28 20:05:147 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: Retired DPX Farm0 ETH
0x3d19161636e53fb03be0df0463bd398900276e53cef1300cd94ddb04e879999d419689252022-11-28 20:05:147 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
0x3d19161636e53fb03be0df0463bd398900276e53cef1300cd94ddb04e879999d419689252022-11-28 20:05:147 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246 Jones DAO: jDPX Token0 ETH
0x3d19161636e53fb03be0df0463bd398900276e53cef1300cd94ddb04e879999d419689252022-11-28 20:05:147 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: Retired DPX Farm0 ETH
0x3d19161636e53fb03be0df0463bd398900276e53cef1300cd94ddb04e879999d419689252022-11-28 20:05:147 days 1 hr ago Jones DAO: Asset Management Multisig 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e12460 ETH
0xcf978b1dc4216aa147297e022cd18939ea6889231bb3e648d3c0ca2d3e071e4f419687602022-11-28 20:04:207 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: Retired DPX Farm0 ETH
0xcf978b1dc4216aa147297e022cd18939ea6889231bb3e648d3c0ca2d3e071e4f419687602022-11-28 20:04:207 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246 0x315e79536b0bd3617293ba4f68ef5772b7d8d0f30 ETH
0xcf978b1dc4216aa147297e022cd18939ea6889231bb3e648d3c0ca2d3e071e4f419687602022-11-28 20:04:207 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
0xcf978b1dc4216aa147297e022cd18939ea6889231bb3e648d3c0ca2d3e071e4f419687602022-11-28 20:04:207 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246 Jones DAO: jDPX Token0 ETH
0xcf978b1dc4216aa147297e022cd18939ea6889231bb3e648d3c0ca2d3e071e4f419687602022-11-28 20:04:207 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
0xcf978b1dc4216aa147297e022cd18939ea6889231bb3e648d3c0ca2d3e071e4f419687602022-11-28 20:04:207 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
0xcf978b1dc4216aa147297e022cd18939ea6889231bb3e648d3c0ca2d3e071e4f419687602022-11-28 20:04:207 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: Retired DPX Farm0 ETH
0xe8650f30c86281abb76fc1dbcc647417f4e6643901faa877c465a1ce9c14fc08419673102022-11-28 19:57:017 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: Retired DPX Farm0 ETH
0xe8650f30c86281abb76fc1dbcc647417f4e6643901faa877c465a1ce9c14fc08419673102022-11-28 19:57:017 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246 0x315e79536b0bd3617293ba4f68ef5772b7d8d0f30 ETH
0xe8650f30c86281abb76fc1dbcc647417f4e6643901faa877c465a1ce9c14fc08419673102022-11-28 19:57:017 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
0xe8650f30c86281abb76fc1dbcc647417f4e6643901faa877c465a1ce9c14fc08419673102022-11-28 19:57:017 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246 Jones DAO: jDPX Token0 ETH
0xe8650f30c86281abb76fc1dbcc647417f4e6643901faa877c465a1ce9c14fc08419673102022-11-28 19:57:017 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
0xe8650f30c86281abb76fc1dbcc647417f4e6643901faa877c465a1ce9c14fc08419673102022-11-28 19:57:017 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
0xe8650f30c86281abb76fc1dbcc647417f4e6643901faa877c465a1ce9c14fc08419673102022-11-28 19:57:017 days 1 hr ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: Retired DPX Farm0 ETH
0x3f3174e9fc9862c580d89afbad193243a45a3384787683355f03ed881b08fcd4419387102022-11-28 17:37:467 days 3 hrs ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: Retired DPX Farm0 ETH
0x3f3174e9fc9862c580d89afbad193243a45a3384787683355f03ed881b08fcd4419387102022-11-28 17:37:467 days 3 hrs ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246 0x315e79536b0bd3617293ba4f68ef5772b7d8d0f30 ETH
0x3f3174e9fc9862c580d89afbad193243a45a3384787683355f03ed881b08fcd4419387102022-11-28 17:37:467 days 3 hrs ago 0x5ba98ad75ab87eb90ffc2b680bcfc6b9030e1246Dopex: DPX Token0 ETH
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
JonesDPXVaultV3

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 21 : JonesDPXVaultV3.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

import {IERC20, IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {JonesVaultV3} from "./JonesVaultV3.sol";
import {DopexFarmWrapper} from "../VaultsV2/library/DopexFarmWrapper.sol";
import {IDPXSingleStaking} from "../interfaces/IDPXSingleStaking.sol";
import {IUniswapV2Router01} from "../interfaces/IUniswapV2Router01.sol";

contract JonesDPXVaultV3 is JonesVaultV3 {
    using DopexFarmWrapper for IDPXSingleStaking;

    /// Role for the keeper used to call the farm methods
    bytes32 public constant KEEPER = keccak256("KEEPER_ROLE");

    /// The amount of rewards that can be kept in the vault when the management window is closed.
    /// `0` means that all rewards need to be swapped before closing the management window
    uint256 public rewardsTolerance;

    /// The DPX farm
    IDPXSingleStaking internal _farm;
    /// The router to swap rewards
    IUniswapV2Router01 internal _router;
    /// The address of the reward asset that needs to be swapped for the base asset
    address internal _rewardAsset;
    /// The route used for swapping rewards
    address[] internal _rewardSwapRoute;

    constructor(
        address _asset,
        address _share,
        address _governor,
        address _feeDistributor,
        uint256 _vaultCap
    ) JonesVaultV3(_asset, _share, _governor, _feeDistributor, _vaultCap) {
        _farm = IDPXSingleStaking(0xc6D714170fE766691670f12c2b45C1f34405AAb6);
        _router = IUniswapV2Router01(
            0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506
        );
        _rewardAsset = 0x32Eb7902D4134bf98A28b963D26de779AF92A212;

        // Setup swap route
        _rewardSwapRoute = new address[](3);
        _rewardSwapRoute[0] = _rewardAsset;
        _rewardSwapRoute[1] = _router.WETH();
        _rewardSwapRoute[2] = asset;

        // Setup a default value for rewards tolerance
        // 1 `rDPX` is small enough to keep on the vault and not hurt the performance
        // 1 `rDPX` is big enough to discourage users from sending tokens directly to the vault
        // Can be modified by using `updateRewardsTolerance`
        rewardsTolerance = 10**IERC20Metadata(_rewardAsset).decimals();

        // Give allowance to the farm
        IERC20(_asset).approve(address(_farm), type(uint256).max);
        // Give allowance to the router to sell rewards
        IERC20(_rewardAsset).approve(address(_router), type(uint256).max);
        _grantRole(KEEPER, _governor);
    }

    /**
     * @notice Returns the total assets managed by the vault + the ones on the farm
     * @inheritdoc JonesVaultV3
     */
    function totalAssets() public view virtual override returns (uint256) {
        return
            state == State.MANAGED
                ? super.totalAssets()
                : (super.totalAssets() + _farm.balanceOf(address(this)));
    }

    /**
     * @notice Sell all rewards for the base asset
     * @dev Can be called only by `GOVERNOR` and on `State.MANAGED`
     * @param _minOutputAmount the minimum asset amount to receive from the swap
     */
    function sellRewards(uint256 _minOutputAmount)
        public
        virtual
        onlyRole(GOVERNOR)
    {
        _onState(State.MANAGED);
        // If we have rewards
        uint256 rewardsBalance = IERC20(_rewardAsset).balanceOf(address(this));
        if (rewardsBalance > 0) {
            // Swap them for the base asset
            _router.swapExactTokensForTokens(
                rewardsBalance,
                _minOutputAmount,
                _rewardSwapRoute,
                address(this),
                block.timestamp
            );
        }
    }

    function grantKeeperRole(address _to) public onlyRole(GOVERNOR) {
        if (_to == address(0)) {
            revert ADDRESS_CANNOT_BE_ZERO_ADDRESS();
        }
        _grantRole(KEEPER, _to);
    }

    function revokeKeeperRole(address _from) public onlyRole(GOVERNOR) {
        _revokeRole(KEEPER, _from);
    }

    /**
     * @notice Stakes a specific `_amount` of `asset` into the farm
     * @param _amount The amount to stake
     */
    function stake(uint256 _amount) public virtual onlyRole(KEEPER) {
        _farm.stake(_amount);
        emit Stake(msg.sender, _amount);
    }

    /**
     * @notice Stakes the complete amount of `asset` into the farm
     */
    function stakeAll() public virtual onlyRole(KEEPER) {
        stake(IERC20(asset).balanceOf(address(this)));
    }

    /**
     * @notice Unstakes a specific `_amount` of `asset` from the farm
     * @param _amount The amount to unstake
     * @param _claimRewards It will try to claim rewards if `true`
     */
    function unstake(uint256 _amount, bool _claimRewards)
        public
        virtual
        onlyRole(KEEPER)
    {
        _farm.removeSingleStakeAsset(_amount, _claimRewards);
        emit Unstake(msg.sender, _amount, _claimRewards);
    }

    /**
     * @notice Unstakes everything & claim rewards from the farm
     */
    function unstakeAll() public virtual onlyRole(KEEPER) {
        unstake(_farm.balanceOf(address(this)), true);
    }

    /**
     * @notice Used to update the rewards tolerance value
     * @dev Can be called only by `GOVERNOR` role
     * @param _newRewardsTolerance The new rewards tolerance
     */
    function updateRewardsTolerance(uint256 _newRewardsTolerance)
        public
        virtual
        onlyRole(GOVERNOR)
    {
        rewardsTolerance = _newRewardsTolerance;
    }

    /**
     * @inheritdoc JonesVaultV3
     */
    function _beforeCloseManagementWindow() internal virtual override {
        // To help us prevent getting locked if people sends rewards tokens directly to the vault
        if (IERC20(_rewardAsset).balanceOf(address(this)) >= rewardsTolerance) {
            revert VAULT_STILL_HAS_REWARDS();
        }

        super._beforeCloseManagementWindow();
    }

    /**
     * @inheritdoc JonesVaultV3
     */
    function _afterCloseManagementWindow() internal virtual override {
        // Deposit all DPX into the farm again
        uint256 currentBalance = IERC20(asset).balanceOf(address(this));
        if (currentBalance > 0) {
            _farm.depositAllIfWhitelisted(address(this));
        }
    }

    /**
     * @notice Withdraws from farm before snapshot, claim rewards after snapshot
     * @inheritdoc JonesVaultV3
     */
    function _beforeOpenManagementWindow() internal virtual override {
        // Withdraw from farm
        if (_farm.balanceOf(address(this)) > 0) {
            _farm.removeAll(address(this));
        }

        super._beforeOpenManagementWindow();

        // Claim rewards
        // Internally it checks if the sender has DPX or rDPX rewards
        // Won't fail if rewards are zero
        _farm.getReward(2);
    }

    /**
     * @inheritdoc JonesVaultV3
     */
    function _afterOpenManagementWindow() internal virtual override {}

    /**
     * @inheritdoc JonesVaultV3
     */
    function _afterDeposit(uint256, uint256) internal virtual override {
        // Deposit DPX into farm
        uint256 currentBalance = IERC20(asset).balanceOf(address(this));
        if (currentBalance > 0) {
            _farm.depositAllIfWhitelisted(address(this));
        }
    }

    /**
     * @inheritdoc JonesVaultV3
     */
    function _beforeWithdraw(uint256 assets, uint256)
        internal
        virtual
        override
    {
        // If not enough DPX on vault withdraw from farm
        uint256 currentBalance = IERC20(asset).balanceOf(address(this));
        if (assets > currentBalance) {
            uint256 diff = assets - currentBalance;
            _farm.removeSingleStakeAsset(diff, false);
        }
    }

    // Events

    /**
     * @notice Emitted when a `GOVERNOR` stakes into the farm
     * @param _governor The `GOVERNOR` that staked
     * @param _amount The amount that was staked
     */
    event Stake(address indexed _governor, uint256 _amount);
    /**
     * @notice Emitted when a `GOVERNOR` unstakes from the farm
     * @param _governor The `GOVERNOR` that unstaked
     * @param _amount The amount that was unstaked
     * @param _claimRewards Whether the rewards were claimed or not
     */
    event Unstake(
        address indexed _governor,
        uint256 _amount,
        bool _claimRewards
    );

    // Errors

    error VAULT_STILL_HAS_REWARDS();
    error ADDRESS_CANNOT_BE_ZERO_ADDRESS();
}

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

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

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

File 3 of 21 : JonesVaultV3.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {JonesAsset} from "../VaultsV2/JonesAsset.sol";
import {IVault} from "./IVault.sol";
import {FixedPointMath} from "./library/FixedPointMath.sol";

/**
 * @title Jones Abstract Vault V3
 * @author JonesDAO
 */
abstract contract JonesVaultV3 is IVault, AccessControl, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using FixedPointMath for uint256;

    /// Role for the entities that will manage the vault
    bytes32 public constant GOVERNOR = keccak256("GOVERNOR_ROLE");
    /// Role for the strategies that will use the vault's assets
    bytes32 public constant STRATEGIES = keccak256("STRATEGIES_ROLE");

    /// The asset that can be deposited into the vault
    address public immutable asset;
    /// The shares that will represent the deposits
    address public immutable share;

    /// Snapshot of total shares supply from previous epoch / before management starts
    uint256 public snapshotSharesSupply;

    /// Snapshot of total asset supply from previous epoch / before management starts
    uint256 public snapshotAssetBalance;

    /// Max amount of assets that can be deposited into the vault
    uint256 public vaultCap;

    /// `true` if the vault should charge management & performance fees, `false` otherwise
    bool public chargeFees;
    /// The address that will receive the fees
    address public feeDistributor;

    /// By default, deposits and withdrawals can only be called by
    /// allowed users (ie when `msg.sender` is not a contract). This
    /// mapping can be used to whitelist contracts that need to be able to
    /// perform deposits and withdrawals.
    mapping(address => bool) public whitelistedContract;

    /// The current state of the vault
    State public state = State.INITIAL;

    /**
     * @param _asset The address of the asset that can be deposited into the vault
     * @param _share The address of the asset that will represent deposits
     * @param _governor The address of the entity that will manage the vault
     * @param _feeDistributor The address of the entity that will receive fees
     * @param _vaultCap The initial vault cap
     */
    constructor(
        address _asset,
        address _share,
        address _governor,
        address _feeDistributor,
        uint256 _vaultCap
    ) {
        if (_asset == address(0)) {
            revert INVALID_ADDRESS();
        }

        if (_share == address(0)) {
            revert INVALID_ADDRESS();
        }

        if (_governor == address(0)) {
            revert INVALID_ADDRESS();
        }

        if (_feeDistributor == address(0)) {
            revert INVALID_ADDRESS();
        }

        asset = _asset;
        share = _share;
        feeDistributor = _feeDistributor;
        vaultCap = _vaultCap;

        // Default value for snapshot. Will be overridden when calling `initialRun`
        snapshotSharesSupply = 1;
        snapshotAssetBalance = 1;

        // Grant roles
        _grantRole(GOVERNOR, _governor);
    }

    // ============================= View functions ================================

    /**
     * @inheritdoc IVault
     */
    function convertToShares(uint256 _assets)
        public
        view
        virtual
        override
        returns (uint256)
    {
        uint256 supply = snapshotSharesSupply;
        return
            supply == 0
                ? _assets
                : _assets.mulDivDown(supply, snapshotAssetBalance);
    }

    /**
     * @dev We charge fees at the end of an epoch so it doens't make sense to calculate fees here
     * @inheritdoc IVault
     */
    function previewDeposit(uint256 _assets)
        public
        view
        virtual
        override
        returns (uint256)
    {
        return convertToShares(_assets);
    }

    /**
     * @inheritdoc IVault
     */
    function convertToAssets(uint256 _shares)
        public
        view
        virtual
        override
        returns (uint256)
    {
        uint256 supply = snapshotSharesSupply;
        return
            supply == 0
                ? _shares
                : _shares.mulDivDown(snapshotAssetBalance, supply);
    }

    /**
     * @inheritdoc IVault
     */
    function maxWithdraw(address _owner)
        public
        view
        virtual
        override
        returns (uint256)
    {
        return convertToAssets(JonesAsset(share).balanceOf(_owner));
    }

    /**
     * @inheritdoc IVault
     */
    function maxDeposit(address)
        public
        view
        virtual
        override
        returns (uint256)
    {
        // If management window is open deposits are disabled
        if (state == State.INITIAL || state == State.MANAGED) {
            return 0;
        }

        // If vault cap was breached deposits are disabled
        if (totalAssets() >= vaultCap) {
            return 0;
        }

        return vaultCap;
    }

    /**
     * @dev If the vault deposit assets in farms, those should be considered here too
     * @inheritdoc IVault
     */
    function totalAssets() public view virtual override returns (uint256) {
        if (state == State.MANAGED) {
            return snapshotAssetBalance;
        }

        return IERC20(asset).balanceOf(address(this));
    }

    /**
     * @inheritdoc IVault
     */
    function maxMint(address) public view virtual override returns (uint256) {
        return type(uint256).max;
    }

    /**
     * @inheritdoc IVault
     */
    function previewMint(uint256 _shares)
        public
        view
        virtual
        override
        returns (uint256)
    {
        uint256 supply = snapshotSharesSupply;
        return
            supply == 0
                ? _shares
                : _shares.mulDivUp(snapshotAssetBalance, supply);
    }

    /**
     * @inheritdoc IVault
     */
    function previewWithdraw(uint256 _assets)
        public
        view
        virtual
        override
        returns (uint256)
    {
        uint256 supply = snapshotSharesSupply;
        return
            supply == 0
                ? _assets
                : _assets.mulDivUp(supply, snapshotAssetBalance);
    }

    /**
     * @inheritdoc IVault
     */
    function maxRedeem(address _owner)
        public
        view
        virtual
        override
        returns (uint256)
    {
        return JonesAsset(share).balanceOf(_owner);
    }

    /**
     * @inheritdoc IVault
     */
    function previewRedeem(uint256 _shares)
        public
        view
        virtual
        override
        returns (uint256)
    {
        return convertToAssets(_shares);
    }

    // ============================= User functions ================================

    /**
     * @inheritdoc IVault
     */
    function deposit(uint256 _assets, address _receiver)
        public
        virtual
        override
        nonReentrant
        returns (uint256 shares)
    {
        _senderIsEligible();
        _onState(State.UNMANAGED);

        if (_assets == 0) {
            revert INVALID_ASSETS_AMOUNT();
        }

        _checkDepositAmountIsValid(_assets);
        shares = previewDeposit(_assets);

        // Check for rounding error since we round down in previewDeposit.
        if (shares == 0) {
            revert ZERO_SHARES_AVAILABLE_WHEN_DEPOSITING();
        }

        _mint(_receiver, _assets, shares);
    }

    /**
     * @inheritdoc IVault
     */
    function mint(uint256 _shares, address _receiver)
        public
        virtual
        override
        nonReentrant
        returns (uint256 assets)
    {
        _senderIsEligible();
        _onState(State.UNMANAGED);

        if (_shares == 0) {
            revert INVALID_SHARES_AMOUNT();
        }

        assets = previewMint(_shares); // No need to check for rounding error, previewMint rounds up.
        _checkDepositAmountIsValid(assets);
        _mint(_receiver, assets, _shares);
    }

    /**
     * @inheritdoc IVault
     */
    function withdraw(
        uint256 _assets,
        address _receiver,
        address
    ) public virtual override nonReentrant returns (uint256 shares) {
        _onState(State.UNMANAGED);
        if (_assets == 0) {
            revert INVALID_ASSETS_AMOUNT();
        }
        shares = previewWithdraw(_assets); // No need to check for rounding error, previewWithdraw rounds up.

        _burn(_receiver, _assets, shares);
    }

    /**
     * @inheritdoc IVault
     */
    function redeem(
        uint256 _shares,
        address _receiver,
        address
    ) public virtual override nonReentrant returns (uint256 assets) {
        _onState(State.UNMANAGED);

        assets = previewRedeem(_shares);
        // Check for rounding error since we round down in previewRedeem.
        if (assets == 0) {
            revert INVALID_ASSETS_AMOUNT();
        }

        _burn(_receiver, assets, _shares);
    }

    // ============================= Strategy functions ================================

    /**
     * @inheritdoc IVault
     */
    function pull(uint256 _assets)
        public
        virtual
        override
        onlyRole(STRATEGIES)
    {
        _onState(State.MANAGED);
        if (_assets == 0) {
            revert INVALID_ASSETS_AMOUNT();
        }
        IERC20(asset).safeTransfer(msg.sender, _assets);
    }

    /**
     * @inheritdoc IVault
     */
    function depositStrategyFunds(uint256 _assets)
        public
        virtual
        override
        onlyRole(STRATEGIES)
    {
        _onState(State.MANAGED);
        if (_assets == 0) {
            revert INVALID_ASSETS_AMOUNT();
        }
        IERC20(asset).safeTransferFrom(msg.sender, address(this), _assets);
    }

    // ============================= Admin functions ================================

    /**
     * @inheritdoc IVault
     */
    function whitelistStrategy(address _strategyAddress)
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        _grantRole(STRATEGIES, _strategyAddress);
    }

    /**
     * @inheritdoc IVault
     */
    function removeStrategyFromWhitelist(address _strategyAddress)
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        _revokeRole(STRATEGIES, _strategyAddress);
    }

    /**
     * @inheritdoc IVault
     */
    function addContractAddressToWhitelist(address _contractAddress)
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        whitelistedContract[_contractAddress] = true;
    }

    /**
     * @inheritdoc IVault
     */
    function removeContractAddressFromWhitelist(address _contractAddress)
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        whitelistedContract[_contractAddress] = false;
    }

    /**
     * @inheritdoc IVault
     */
    function migrate(address _to, address[] memory _tokens)
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        // migrate other ERC20 Tokens
        for (uint256 i = 0; i < _tokens.length; i++) {
            IERC20 token = IERC20(_tokens[i]);
            uint256 assetBalance = token.balanceOf(address(this));
            if (assetBalance > 0) {
                token.transfer(_to, assetBalance);
            }
        }

        // migrate ETH balance
        uint256 balanceGwei = address(this).balance;
        if (balanceGwei > 0) {
            payable(_to).transfer(balanceGwei);
        }
    }

    /**
     * @inheritdoc IVault
     */
    function setVaultCap(uint256 _amount)
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        vaultCap = _amount;
    }

    /**
     * @inheritdoc IVault
     */
    function setChargeFees(bool _status)
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        chargeFees = _status;
    }

    function setFeeDistributor(address _feeDistributor)
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        if (_feeDistributor == address(0)) {
            revert INVALID_ADDRESS();
        }

        feeDistributor = _feeDistributor;
    }

    /**
     * @inheritdoc IVault
     */
    function initialRun(
        uint256 _snapshotAssetBalance,
        uint256 _snapshotSharesSupply
    ) public virtual override onlyRole(GOVERNOR) {
        _onState(State.INITIAL);

        if (_snapshotAssetBalance == 0 || _snapshotSharesSupply == 0) {
            revert INVALID_SNAPSHOT_VALUE();
        }

        snapshotAssetBalance = _snapshotAssetBalance;
        snapshotSharesSupply = _snapshotSharesSupply;

        state = State.UNMANAGED;

        emit EpochEnded(
            block.timestamp,
            snapshotAssetBalance,
            snapshotSharesSupply
        );
    }

    /**
     * @inheritdoc IVault
     */
    function openManagementWindow() public virtual override onlyRole(GOVERNOR) {
        _onState(State.UNMANAGED);

        _beforeOpenManagementWindow();

        state = State.MANAGED;

        emit EpochStarted(
            block.timestamp,
            snapshotAssetBalance,
            snapshotSharesSupply
        );

        _afterOpenManagementWindow();
    }

    /**
     * @inheritdoc IVault
     */
    function closeManagementWindow()
        public
        virtual
        override
        onlyRole(GOVERNOR)
    {
        _onState(State.MANAGED);

        _beforeCloseManagementWindow();

        state = State.UNMANAGED;

        emit EpochEnded(
            block.timestamp,
            snapshotAssetBalance,
            snapshotSharesSupply
        );

        _afterCloseManagementWindow();
    }

    // ============================= INTERNAL HOOKS LOGIC ================================
    function _beforeWithdraw(uint256 _assets, uint256 _shares) internal virtual;

    function _afterDeposit(uint256 _assets, uint256 _shares) internal virtual;

    /**
     * @notice Executed before updating the `state` on `closeManagementWindow()`
     */
    function _beforeOpenManagementWindow() internal virtual {
        // Snapshot asset and share supply
        _executeSnapshot();
    }

    /**
     * @notice Executed after updating the `state` on `closeManagementWindow()`
     */
    function _afterOpenManagementWindow() internal virtual;

    /**
     * @notice Executed before updating the `state` on `openmanagementWindow()`
     */
    function _beforeCloseManagementWindow() internal virtual {
        // Charge fees
        _chargeFees();

        // Snapshot asset and share supply
        _executeSnapshot();
    }

    /**
     * @notice Executed after updating the `state` on `openmanagementWindow()`
     */
    function _afterCloseManagementWindow() internal virtual;

    // ============================== Helpers ==============================
    /**
     * @notice Mint `_shares` to `_receiver` and receives `_assets`
     * @dev It doesn't provide any checks so use carefully
     * @param _receiver The address that will receive the minted shares
     * @param _assets The amount of assets to transfer to the vault
     * @param _shares The amount of shares to mint
     */
    function _mint(
        address _receiver,
        uint256 _assets,
        uint256 _shares
    ) internal virtual {
        IERC20(asset).safeTransferFrom(msg.sender, address(this), _assets);
        JonesAsset(share).mint(_receiver, _shares);
        emit Deposit(msg.sender, _receiver, _assets, _shares);
        _afterDeposit(_assets, _shares);
    }

    /**
     * @notice Burn `_shares` from `msg.sender` transfer `_assets` to `_receiver`
     * @dev It doesn't provide any checks so use carefully
     * @param _receiver The address that will receive the asset tokens
     * @param _assets The amount of assets to transfer to `_receiver`
     * @param _shares The amount of shares to burn from `owner`
     */
    function _burn(
        address _receiver,
        uint256 _assets,
        uint256 _shares
    ) internal virtual {
        _beforeWithdraw(_assets, _shares);

        JonesAsset(share).burnFrom(msg.sender, _shares);
        emit Withdraw(msg.sender, _receiver, msg.sender, _assets, _shares);
        IERC20(asset).safeTransfer(_receiver, _assets);
    }

    function _senderIsEligible() internal view {
        if (msg.sender != tx.origin) {
            if (!whitelistedContract[msg.sender]) {
                revert CONTRACT_ADDRESS_MAKING_PROHIBITED_FUNCTION_CALL();
            }
        }
    }

    /**
     * Checks if `assets` amount is depositable given the vault cap. Reverts if amount is invalid.
     */
    function _checkDepositAmountIsValid(uint256 _assets) internal virtual {
        if (vaultCap < type(uint256).max) {
            if (totalAssets() + _assets > vaultCap) {
                revert DEPOSIT_ASSET_AMOUNT_EXCEEDS_MAX_DEPOSIT();
            }
        }
    }

    /**
     * @notice Checks if the vault is on `_expectedState`
     * @dev Will revert if `_expectedState != state`
     */
    function _onState(State _expectedState) internal view virtual {
        if (state != _expectedState) {
            revert INVALID_STATE(_expectedState, state);
        }
    }

    /**
     * @notice Takes a snapshot of the deposited assets and the minted shares
     */
    function _executeSnapshot() internal virtual {
        snapshotSharesSupply = JonesAsset(share).totalSupply();
        snapshotAssetBalance = IERC20(asset).balanceOf(address(this));

        emit Snapshot(
            block.timestamp,
            snapshotAssetBalance,
            snapshotSharesSupply
        );
    }

    /**
     * @notice Charges management & performance fees.
     * @dev Fees are transferred to `feeDistributor`.
     * @dev Only if `chargeFees == true`.
     */
    function _chargeFees() internal virtual {
        if (chargeFees) {
            uint256 balanceNow = IERC20(asset).balanceOf(address(this));

            if (balanceNow > snapshotAssetBalance) {
                // send performance fee to fee distributor (20% on profit wrt benchmark)
                // 1 / 5 = 20 / 100
                IERC20(asset).safeTransfer(
                    feeDistributor,
                    (balanceNow - snapshotAssetBalance) / 5
                );
            }
            // send management fee to fee distributor (2% annually)
            // 1 / 600 = 2 / (100 * 12)
            IERC20(asset).safeTransfer(
                feeDistributor,
                snapshotAssetBalance / 600
            );
        }
    }
}

File 4 of 21 : DopexFarmWrapper.sol
// SPDX-License-Identifier: GPL-3.0
/*                            ******@@@@@@@@@**@*                               
                        ***@@@@@@@@@@@@@@@@@@@@@@**                             
                     *@@@@@@**@@@@@@@@@@@@@@@@@*@@@*                            
                  *@@@@@@@@@@@@@@@@@@@*@@@@@@@@@@@*@**                          
                 *@@@@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@@@*                         
                **@@@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@@@@@**                       
                **@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@@@@@@@@@*                      
                **@@@@@@@@@@@@@@@@*************************                    
                **@@@@@@@@***********************************                   
                 *@@@***********************&@@@@@@@@@@@@@@@****,    ******@@@@*
           *********************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@************* 
      ***@@@@@@@@@@@@@@@*****@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@****@@*********      
   **@@@@@**********************@@@@*****************#@@@@**********            
  *@@******************************************************                     
 *@************************************                                         
 @*******************************                                               
 *@*************************                                                    
   *********************  
   
    /$$$$$                                               /$$$$$$$   /$$$$$$   /$$$$$$ 
   |__  $$                                              | $$__  $$ /$$__  $$ /$$__  $$
      | $$  /$$$$$$  /$$$$$$$   /$$$$$$   /$$$$$$$      | $$  \ $$| $$  \ $$| $$  \ $$
      | $$ /$$__  $$| $$__  $$ /$$__  $$ /$$_____/      | $$  | $$| $$$$$$$$| $$  | $$
 /$$  | $$| $$  \ $$| $$  \ $$| $$$$$$$$|  $$$$$$       | $$  | $$| $$__  $$| $$  | $$
| $$  | $$| $$  | $$| $$  | $$| $$_____/ \____  $$      | $$  | $$| $$  | $$| $$  | $$
|  $$$$$$/|  $$$$$$/| $$  | $$|  $$$$$$$ /$$$$$$$/      | $$$$$$$/| $$  | $$|  $$$$$$/
 \______/  \______/ |__/  |__/ \_______/|_______/       |_______/ |__/  |__/ \______/                                      
*/
pragma solidity ^0.8.2;

/// Interfaces
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IDPXSingleStaking} from "../../interfaces/IDPXSingleStaking.sol";

/// @title A Dopex single stake farm wrapper library
/// @author Jones DAO
/// @notice Adds a few utility functions to Dopex single stake farms
library DopexFarmWrapper {
    /**
     * @notice Stakes an amount of assets
     * @param _amount a parameter just like in doxygen (must be followed by parameter name)
     */
    function addSingleStakeAsset(IDPXSingleStaking self, uint256 _amount)
        external
        returns (bool)
    {
        self.stake(_amount);

        return true;
    }

    /**
     * @notice Stakes the complete balance if the caller is whitelisted
     * @param _caller The address to check whitelist and get the staking token balance
     */
    function depositAllIfWhitelisted(IDPXSingleStaking self, address _caller)
        external
        returns (bool)
    {
        if (self.whitelistedContracts(_caller)) {
            uint256 amount = IERC20(self.stakingToken()).balanceOf(_caller);

            self.stake(amount);
        }

        return true;
    }

    /**
     * @notice Removes an amount from staking with an option to claim rewards
     * @param _amount the amount to withdraw from staking
     * @param _getRewards if true the function will claim rewards
     */
    function removeSingleStakeAsset(
        IDPXSingleStaking self,
        uint256 _amount,
        bool _getRewards
    ) public returns (bool) {
        if (_getRewards) {
            self.getReward(2);
        }

        if (_amount > 0) {
            self.withdraw(_amount);
        }

        return true;
    }

    /**
     * @notice Removes the complete position from staking
     * @param _caller The address to get the deposited balance
     */
    function removeAll(IDPXSingleStaking self, address _caller)
        external
        returns (bool)
    {
        uint256 amount = self.balanceOf(_caller);

        removeSingleStakeAsset(self, amount, false);

        return true;
    }

    /**
     * @notice Claim all rewards
     */
    function claimRewards(IDPXSingleStaking self) external returns (bool) {
        return removeSingleStakeAsset(self, 0, true);
    }

    /**
     * @notice Removes all assets from the farm and claim all rewards
     */
    function exitSingleStakeAsset(IDPXSingleStaking self)
        external
        returns (bool)
    {
        self.exit();

        return true;
    }

    /**
     * @notice Removes all assets from the farm and claim rewards only if the caller has assets staked
     * @param _caller the address used to check if it has staked assets on the farm
     */
    function exitIfPossible(IDPXSingleStaking self, address _caller)
        external
        returns (bool)
    {
        if (self.balanceOf(_caller) > 0) {
            self.exit();
        }

        return true;
    }

    /**
     * @notice Obtain the amount of DPX earned on the farm
     * @param _caller the address used to check if it has rewards
     */
    function earnedDPX(IDPXSingleStaking self, address _caller)
        public
        view
        returns (uint256)
    {
        (uint256 reward, ) = self.earned(_caller);

        return reward;
    }

    /**
     * @notice Obtain the amount of rDPX earned on the farm
     * @param _caller the address used to check if it has rewards
     */
    function earnedRDPX(IDPXSingleStaking self, address _caller)
        external
        view
        returns (uint256)
    {
        (, uint256 reward) = self.earned(_caller);

        return reward;
    }

    /**
     * @notice Compound Single stake rewards
     */
    function compoundRewards(IDPXSingleStaking self) external returns (bool) {
        self.compound();
        return true;
    }
}

File 5 of 21 : IDPXSingleStaking.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.2;

interface IDPXSingleStaking {
    function balanceOf(address account) external view returns (uint256);

    function stake(uint256 amount) external;

    function withdraw(uint256 amount) external;

    function getReward(uint256 rewardsTokenID) external;

    function compound() external;

    function exit() external;

    function earned(address account)
        external
        view
        returns (uint256 DPXEarned, uint256 RDPXEarned);

    function stakingToken() external view returns (address);

    function rewardsTokenDPX() external view returns (address);

    function whitelistedContracts(address) external view returns (bool);
}

File 6 of 21 : IUniswapV2Router01.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.2;

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

    function WETH() external pure returns (address);

    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 removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint256 amountA, uint256 amountB);

    function removeLiquidityETHWithPermit(
        address token,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) 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 swapTokensForExactTokens(
        uint256 amountOut,
        uint256 amountInMax,
        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 swapTokensForExactETH(
        uint256 amountOut,
        uint256 amountInMax,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

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

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

    function quote(
        uint256 amountA,
        uint256 reserveA,
        uint256 reserveB
    ) external pure returns (uint256 amountB);

    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);
}

File 7 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 9 of 21 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * 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, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

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

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @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 virtual override 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 override onlyRole(getRoleAdmin(role)) {
        _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 override onlyRole(getRoleAdmin(role)) {
        _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 revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        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}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    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 {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 11 of 21 : JonesAsset.sol
// SPDX-License-Identifier: GPL-3.0
/*                            ******@@@@@@@@@**@*                               
                        ***@@@@@@@@@@@@@@@@@@@@@@**                             
                     *@@@@@@**@@@@@@@@@@@@@@@@@*@@@*                            
                  *@@@@@@@@@@@@@@@@@@@*@@@@@@@@@@@*@**                          
                 *@@@@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@@@*                         
                **@@@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@@@@@**                       
                **@@@@@@@@@@@@@@@*@@@@@@@@@@@@@@@@@@@@@@@*                      
                **@@@@@@@@@@@@@@@@*************************                    
                **@@@@@@@@***********************************                   
                 *@@@***********************&@@@@@@@@@@@@@@@****,    ******@@@@*
           *********************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@************* 
      ***@@@@@@@@@@@@@@@*****@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@****@@*********      
   **@@@@@**********************@@@@*****************#@@@@**********            
  *@@******************************************************                     
 *@************************************                                         
 @*******************************                                               
 *@*************************                                                    
   ********************* 
   
    /$$$$$                                               /$$$$$$$   /$$$$$$   /$$$$$$ 
   |__  $$                                              | $$__  $$ /$$__  $$ /$$__  $$
      | $$  /$$$$$$  /$$$$$$$   /$$$$$$   /$$$$$$$      | $$  \ $$| $$  \ $$| $$  \ $$
      | $$ /$$__  $$| $$__  $$ /$$__  $$ /$$_____/      | $$  | $$| $$$$$$$$| $$  | $$
 /$$  | $$| $$  \ $$| $$  \ $$| $$$$$$$$|  $$$$$$       | $$  | $$| $$__  $$| $$  | $$
| $$  | $$| $$  | $$| $$  | $$| $$_____/ \____  $$      | $$  | $$| $$  | $$| $$  | $$
|  $$$$$$/|  $$$$$$/| $$  | $$|  $$$$$$$ /$$$$$$$/      | $$$$$$$/| $$  | $$|  $$$$$$/
 \______/  \______/ |__/  |__/ \_______/|_______/       |_______/ |__/  |__/ \______/                                      
*/

pragma solidity ^0.8.2;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC20Burnable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

/// @title Jones Asset Token (jAsset)
/// @author Jones DAO
/// @notice Token used in Jones DAO's vaults for claiming back rewards.

contract JonesAsset is ERC20, ERC20Burnable, AccessControl {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    /// @param _multisigAddr address of the multisig wallet
    /// @param _name the name of the token
    /// @param _symbol the symbol of the token
    constructor(
        address _multisigAddr,
        string memory _name,
        string memory _symbol
    ) ERC20(_name, _symbol) {
        require(_multisigAddr != address(0), "Invalid multisig address");
        _grantRole(DEFAULT_ADMIN_ROLE, _multisigAddr);
    }

    /// Mints jAsset to address.
    /// @param _to The address to send jAsset to.
    /// @param _amount The amount of jAsset to be minted.
    function mint(address _to, uint256 _amount) public onlyRole(MINTER_ROLE) {
        _mint(_to, _amount);
    }

    /// Allows address to mint new jAsset.
    /// @dev The address should be set to the JonesAssetVault contract.
    /// @param _minterContract The address that will be set as the minter.
    function giveMinterRole(address _minterContract)
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _grantRole(MINTER_ROLE, _minterContract);
    }

    /// @notice Revokes address's token minting rights.
    /// @param _minterContract The address that will no longer be able to mint jAsset.
    function revokeMinterRole(address _minterContract)
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        _revokeRole(MINTER_ROLE, _minterContract);
    }
}

File 12 of 21 : IVault.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;

interface IVault {
    // ============================= View functions ================================

    /**
     * The amount of `shares` that the Vault would exchange for the amount of `assets` provided, in an ideal scenario where all the conditions are met.
     *
     * Does not show any variations depending on the caller.
     * Does not reflect slippage or other on-chain conditions, when performing the actual exchange.
     * Does not revert unless due to integer overflow caused by an unreasonably large input.
     * This calculation does not reflect the “per-user” price-per-share, and instead reflects the “average-user’s” price-per-share, meaning what the average user can expect to see when exchanging to and from.
     *
     * @param assets Amount of assets to convert.
     * @return shares Amount of shares calculated for the amount of given assets, rounded down towards 0. Does not include any fees that are charged against assets in the Vault.
     */
    function convertToShares(uint256 assets)
        external
        view
        returns (uint256 shares);

    /**
     * The amount of `assets` that the Vault would exchange for the amount of `shares` provided, in an ideal scenario where all the conditions are met.
     *
     * Does not show any variations depending on the caller.
     * Does not reflect slippage or other on-chain conditions, when performing the actual exchange.
     * Does not revert unless due to integer overflow caused by an unreasonably large input.
     * This calculation does not reflect the “per-user” price-per-share, and instead reflects the “average-user’s” price-per-share, meaning what the average user can expect to see when exchanging to and from.
     *
     * @return assets Amount of assets calculated for the given amount of shares, rounded down towards 0. Does not include fees that are charged against assets in the Vault.
     */
    function convertToAssets(uint256 shares)
        external
        view
        returns (uint256 assets);

    /**
     * Maximum amount of the underlying asset that can be deposited into the Vault for the receiver, through a deposit call.
     * Returns the maximum amount of assets deposit would allow to be deposited for receiver and not cause a revert, which should be higher than the actual maximum that would be accepted (it should underestimate if necessary). This assumes that the user has infinite assets, i.e. does not rely on balanceOf of asset.
     *
     * Does not revert.
     * This is akin to `vaultCap` in legacy vaults.
     *
     * The `receiver` parameter is added for ERC-4626 parity and is not relevant to our use case
     * since we are not going to have user specific limits for deposits. Either deposits are limited
     * to everyone or no one.
     *
     * @return maxAssets Max assets that can be deposited for receiver. Returns 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. Returns 0 if deposits are entirely disabled (even temporarily).
     */
    function maxDeposit(address receiver)
        external
        view
        returns (uint256 maxAssets);

    /**
     * Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions.
     *
     * Returns as close to and no more than the exact amount of Vault shares that would be minted in a deposit call in the same transaction. I.e. deposit will return the same or more shares as previewDeposit if called in the same transaction.
     * Does not account for deposit limits like those returned from maxDeposit and always acts as though the deposit would be accepted, regardless if the user has enough tokens approved, etc.
     * Does not revert due to vault specific user/global limits. May revert due to other conditions that would also cause deposit to revert.
     *
     * Any unfavorable discrepancy between convertToShares and previewDeposit will be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by depositing.
     *
     * @return shares exact amount of shares that would be minted in a deposit call. That includes deposit fees. Integrators should be aware of the existence of deposit fees.
     */
    function previewDeposit(uint256 assets)
        external
        view
        returns (uint256 shares);

    /**
     * @return The current vault State
     */
    function state() external view returns (State);

    /**
     * The address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
     */
    function asset() external view returns (address);

    /**
     * The address of the underlying shares token used used to represent tokenized vault.
     */
    function share() external view returns (address);

    /**
     * Total amount of the underlying asset that is managed by this vault.
     *
     * This includes any compounding that occurs from yield.
     * It must be inclusive of any fees that are charged against assets in the Vault.
     * Must not revert.
     *
     * @return totalManagedAssets amount of underlying asset managed by vault.
     */
    function totalAssets() external view returns (uint256 totalManagedAssets);

    /**
     * Maximum amount of shares that can be minted from the Vault for the `receiver`, through a `mint` call.
     *
     * Returns `2 ** 256 - 1` if there is no limit on the maximum amount of shares that may be minted.
     */
    function maxMint(address receiver)
        external
        view
        returns (uint256 maxShares);

    /**
     * Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given current on-chain conditions.
     * MUST NOT revert due to vault specific user/global limits. MAY revert due to other conditions that would also cause mint to revert.
     * note: Any unfavorable discrepancy between `convertToAssets` and `previewMint` should be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by minting.
     *
     * Does not account for mint limits like those returned from maxMint and always acts as though the mint would be accepted, regardless if the user has enough tokens approved, etc.
     */
    function previewMint(uint256 shares) external view returns (uint256 assets);

    /**
     * Maximum amount of the underlying asset that can be withdrawn from the `owner` balance in the Vault, through a `withdraw` call.
     *
     * Factors in both global and user-specific limits, like if withdrawals are entirely disabled (even temporarily) it must return 0.
     * Does not revert.
     *
     * @return maxAssets The maximum amount of assets that could be transferred from `owner` through `withdraw` and not cause a revert, which must not be higher than the actual maximum that would be accepted (it should underestimate if necessary).
     */
    function maxWithdraw(address owner)
        external
        view
        returns (uint256 maxAssets);

    /**
     * Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, given current on-chain conditions.
     *
     * Does not revert due to vault specific user/global limits. May revert due to other conditions that would also cause withdraw to revert.
     * Any unfavorable discrepancy between convertToShares and previewWithdraw should be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by depositing.
     *
     * @return shares Shares available to withdraw for specified assets. This includes of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     */
    function previewWithdraw(uint256 assets)
        external
        view
        returns (uint256 shares);

    /**
     * Maximum amount of Vault shares that can be redeemed from the `owner` balance in the Vault, through a `redeem` call.
     *
     * @return maxShares Max shares that can be redeemed. Factors in both global and user-specific limits, like if redemption is entirely disabled (even temporarily) it will return 0.
     */
    function maxRedeem(address owner) external view returns (uint256 maxShares);

    /**
     * Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, given current on-chain conditions.
     * Does not account for redemption limits like those returned from maxRedeem and should always act as though the redemption would be accepted, regardless if the user has enough shares, etc.
     *
     * Does not revert due to vault specific user/global limits. May revert due to other conditions that would also cause redeem to revert.
     *
     * @return assets Amount of assets redeemable for given shares. Includes of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     */
    function previewRedeem(uint256 shares)
        external
        view
        returns (uint256 assets);

    // ============================= User functions ================================

    /**
     * @dev Mints `shares` Vault shares to `receiver` by depositing `amount` of underlying tokens. This should only be called outside the management window.
     *
     * Reverts if all of assets cannot be deposited (ex due to deposit limit, slippage, approvals, etc).
     *
     * Emits a {Deposit} event
     */
    function deposit(uint256 assets, address receiver)
        external
        returns (uint256 shares);

    /**
     * Mints exactly `shares` Vault shares to `receiver` by depositing `amount` of underlying tokens.
     *
     * Reverts if all of shares cannot be minted (ex. due to deposit limit being reached, slippage, etc).
     *
     * Emits a {Deposit} event
     */
    function mint(uint256 shares, address receiver)
        external
        returns (uint256 assets);

    /**
     * Burns `shares` from `owner` and sends exactly `assets` of underlying tokens to `receiver`. Only available outside of management window.
     *
     * Reverts if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner not having enough shares, etc).
     * Any pre-requesting methods before withdrawal should be performed separately.
     *
     * Emits a {Withdraw} event
     */
    function withdraw(
        uint256 assets,
        address receiver,
        address owner
    ) external returns (uint256 shares);

    /**
     * Burns exactly `shares` from `owner` and sends `assets` of underlying tokens to `receiver`. Only available outside of management window.
     *
     * Reverts if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner not having enough shares, etc).
     * Any pre-requesting methods before withdrawal should be performed separately.
     *
     * Emits a {Withdraw} event
     */
    function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) external returns (uint256 assets);

    // ============================= Strategy functions ================================

    /**
     * Sends the required amount of Asset from this vault to the calling strategy.
     * @dev can only be called by whitelisted strategies (KEEPER role)
     * @dev reverts if management window is closed.
     * @param assets the amount of tokens to pull
     */
    function pull(uint256 assets) external;

    /**
     * Deposits funds from Strategy (both profits and principal amounts).
     * @dev can only be called by whitelisted strategies (KEEPER role)
     * @dev reverts if management window is closed.
     * @param assets the amount of Assets being deposited from the strategy.
     */
    function depositStrategyFunds(uint256 assets) external;

    // ============================= Admin functions ================================

    /**
     * Sets the max deposit `amount` for vault. Akin to setting vault cap in v2 vaults.
     * Since we will not be limiting deposits per user there is no need to add `receiver` input
     * in the argument.
     */
    function setVaultCap(uint256 amount) external;

    /**
     * Adds a strategy to the whitelist.
     * @dev can only be called by governor (GOVERNOR role)
     * @param _address of the strategy to whitelist
     */
    function whitelistStrategy(address _address) external;

    /**
     * Removes a strategy from the whitelist.
     * @dev can only be called by governor (GOVERNOR role)
     * @param _address of the strategy to remove from whitelist
     */
    function removeStrategyFromWhitelist(address _address) external;

    /**
     * @notice Adds a contract to the whitelist.
     * @dev By default only EOA cann interact with the vault.
     * @dev Whitelisted contracts will be able to interact with the vault too.
     * @param contractAddress The address of the contract to whitelist.
     */
    function addContractAddressToWhitelist(address contractAddress) external;

    /**
     * @notice Used to check wheter a contract address is whitelisted to use the vault
     * @param _contractAddress The address of the contract to check
     * @return `true` if the contract is whitelisted, `false` otherwise
     */
    function whitelistedContract(address _contractAddress)
        external
        view
        returns (bool);

    /**
     * @notice Removes a contract from the whitelist.
     * @dev Removed contracts wont be able to interact with the vault.
     * @param contractAddress The address of the contract to whitelist.
     */
    function removeContractAddressFromWhitelist(address contractAddress)
        external;

    /**
     * Migrate vault to new vault contract.
     * @dev acts as emergency withdrawal if needed.
     * @dev can only be called by governor (GOVERNOR role)
     * @param _to New vault contract address.
     * @param _tokens Addresses of tokens to be migrated.
     *
     */
    function migrate(address _to, address[] memory _tokens) external;

    /**
     * Deposits and withdrawals close, assets are under vault control.
     * @dev can only be called by governor (GOVERNOR role)
     */
    function openManagementWindow() external;

    /**
     * Open vault for deposits and claims.
     * @dev can only be called by governor (GOVERNOR role)
     */
    function closeManagementWindow() external;

    /**
     * Open vault for deposits and claims, sets the snapshot of assets balance manually
     * @dev can only be called by governor (GOVERNOR role)
     * @dev can only be called on `State.INITIAL`
     * @param _snapshotAssetBalance Overrides the value of the snapshotted asset balance
     * @param _snapshotShareSupply Overrides the value of the snapshotted share supply
     */
    function initialRun(
        uint256 _snapshotAssetBalance,
        uint256 _snapshotShareSupply
    ) external;

    /**
     * Enable/diable charging performance & management fees
     * @dev can only be called by GOVERNOR role
     * @param _status `true` if the vault should charge fees, `false` otherwise
     */
    function setChargeFees(bool _status) external;

    /**
     * Updated the fee distributor address
     * @dev can only be called by GOVERNOR role
     * @param _feeDistributor The address of the new fee distributor
     */
    function setFeeDistributor(address _feeDistributor) external;

    // ============================= Enums =================================

    /**
     * Enum to represent the current state of the vault
     * INITIAL = Right after deployment, can move to `UNMANAGED` by calling `initialRun`
     * UNMANAGED = Users are able to interact with the vault, can move to `MANAGED` by calling `openManagementWindow`
     * MANAGED = Strategies will be able to borrow & repay, can move to `UNMANAGED` by calling `closeManagementWindow`
     */
    enum State {
        INITIAL,
        UNMANAGED,
        MANAGED
    }

    // ============================= Events ================================

    /**
     * `caller` has exchanged `assets` for `shares`, and transferred those `shares` to `owner`.
     * Emitted when tokens are deposited into the Vault via the `mint` and `deposit` methods.
     */
    event Deposit(
        address indexed caller,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /**
     * `caller` has exchanged `shares`, owned by `owner`, for `assets`, and transferred those `assets` to `receiver`.
     * Will be emitted when shares are withdrawn from the Vault in `ERC4626.redeem` or `ERC4626.withdraw` methods.
     */
    event Withdraw(
        address indexed caller,
        address indexed receiver,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /**
     * emitted when vault balance snapshot is taken
     * @param _timestamp snapshot timestamp (indexed)
     * @param _vaultBalance vault balance value
     * @param _jonesAssetSupply jDPX total supply value
     */
    event Snapshot(
        uint256 indexed _timestamp,
        uint256 _vaultBalance,
        uint256 _jonesAssetSupply
    );

    /**
     * emitted when asset management window is opened
     * @param _timestamp snapshot timestamp (indexed)
     * @param _assetBalance new vault balance value
     * @param _shareSupply share token total supply at this time
     */
    event EpochStarted(
        uint256 indexed _timestamp,
        uint256 _assetBalance,
        uint256 _shareSupply
    );

    /** emitted when claim and deposit windows are open
     * @param _timestamp snapshot timestamp (indexed)
     * @param _assetBalance new vault balance value
     * @param _shareSupply share token total supply at this time
     */
    event EpochEnded(
        uint256 indexed _timestamp,
        uint256 _assetBalance,
        uint256 _shareSupply
    );

    // ============================= Errors ================================
    error MSG_SENDER_NOT_WHITELISTED_USER();
    error DEPOSIT_ASSET_AMOUNT_EXCEEDS_MAX_DEPOSIT();
    error MINT_SHARE_AMOUNT_EXCEEDS_MAX_MINT();
    error ZERO_SHARES_AVAILABLE_WHEN_DEPOSITING();
    error INVALID_STATE(State _expected, State _actual);
    error INVALID_ASSETS_AMOUNT();
    error INVALID_SHARES_AMOUNT();
    error CONTRACT_ADDRESS_MAKING_PROHIBITED_FUNCTION_CALL();
    error INVALID_ADDRESS();
    error INVALID_SNAPSHOT_VALUE();
}

File 13 of 21 : FixedPointMath.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;

// Solmate functions
library FixedPointMath {
    // Source: https://github.com/Rari-Capital/solmate/blob/main/src/utils/FixedPointMathLib.sol
    function mulDivDown(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(
                and(
                    iszero(iszero(denominator)),
                    or(iszero(x), eq(div(z, x), y))
                )
            ) {
                revert(0, 0)
            }

            // Divide z by the denominator.
            z := div(z, denominator)
        }
    }

    // Source: https://github.com/Rari-Capital/solmate/blob/main/src/utils/FixedPointMathLib.sol
    function mulDivUp(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(
                and(
                    iszero(iszero(denominator)),
                    or(iszero(x), eq(div(z, x), y))
                )
            ) {
                revert(0, 0)
            }

            // First, divide z - 1 by the denominator and add 1.
            // We allow z - 1 to underflow if z is 0, because we multiply the
            // end result by 0 if z is zero, ensuring we return 0 if z is zero.
            z := mul(iszero(iszero(z)), add(div(sub(z, 1), denominator), 1))
        }
    }
}

File 14 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 15 of 21 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @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 {AccessControl-_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) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 17 of 21 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 18 of 21 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 19 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 20 of 21 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

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

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

        return true;
    }

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

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

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

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

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

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

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

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

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

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

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

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

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

File 21 of 21 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

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

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {
    "contracts/VaultsV2/library/DopexFarmWrapper.sol": {
      "DopexFarmWrapper": "0x315e79536b0bd3617293ba4f68ef5772b7d8d0f3"
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"address","name":"_share","type":"address"},{"internalType":"address","name":"_governor","type":"address"},{"internalType":"address","name":"_feeDistributor","type":"address"},{"internalType":"uint256","name":"_vaultCap","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ADDRESS_CANNOT_BE_ZERO_ADDRESS","type":"error"},{"inputs":[],"name":"CONTRACT_ADDRESS_MAKING_PROHIBITED_FUNCTION_CALL","type":"error"},{"inputs":[],"name":"DEPOSIT_ASSET_AMOUNT_EXCEEDS_MAX_DEPOSIT","type":"error"},{"inputs":[],"name":"INVALID_ADDRESS","type":"error"},{"inputs":[],"name":"INVALID_ASSETS_AMOUNT","type":"error"},{"inputs":[],"name":"INVALID_SHARES_AMOUNT","type":"error"},{"inputs":[],"name":"INVALID_SNAPSHOT_VALUE","type":"error"},{"inputs":[{"internalType":"enum IVault.State","name":"_expected","type":"uint8"},{"internalType":"enum IVault.State","name":"_actual","type":"uint8"}],"name":"INVALID_STATE","type":"error"},{"inputs":[],"name":"MINT_SHARE_AMOUNT_EXCEEDS_MAX_MINT","type":"error"},{"inputs":[],"name":"MSG_SENDER_NOT_WHITELISTED_USER","type":"error"},{"inputs":[],"name":"VAULT_STILL_HAS_REWARDS","type":"error"},{"inputs":[],"name":"ZERO_SHARES_AVAILABLE_WHEN_DEPOSITING","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_assetBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_shareSupply","type":"uint256"}],"name":"EpochEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_assetBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_shareSupply","type":"uint256"}],"name":"EpochStarted","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":true,"internalType":"uint256","name":"_timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_vaultBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_jonesAssetSupply","type":"uint256"}],"name":"Snapshot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_governor","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_governor","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"_claimRewards","type":"bool"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOVERNOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"KEEPER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STRATEGIES","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contractAddress","type":"address"}],"name":"addContractAddressToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chargeFees","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeManagementWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"}],"name":"depositStrategyFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeDistributor","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":"address","name":"_to","type":"address"}],"name":"grantKeeperRole","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"_snapshotAssetBalance","type":"uint256"},{"internalType":"uint256","name":"_snapshotSharesSupply","type":"uint256"}],"name":"initialRun","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"address[]","name":"_tokens","type":"address[]"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"openManagementWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"}],"name":"pull","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contractAddress","type":"address"}],"name":"removeContractAddressFromWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategyAddress","type":"address"}],"name":"removeStrategyFromWhitelist","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":"address","name":"_from","type":"address"}],"name":"revokeKeeperRole","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":[],"name":"rewardsTolerance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minOutputAmount","type":"uint256"}],"name":"sellRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setChargeFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeDistributor","type":"address"}],"name":"setFeeDistributor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setVaultCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"share","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"snapshotAssetBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"snapshotSharesSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum IVault.State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_claimRewards","type":"bool"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstakeAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newRewardsTolerance","type":"uint256"}],"name":"updateRewardsTolerance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vaultCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_strategyAddress","type":"address"}],"name":"whitelistStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

60c06040526000600760006101000a81548160ff021916908360028111156200002d576200002c62000aeb565b5b02179055503480156200003f57600080fd5b50604051620060fb380380620060fb833981810160405281019062000065919062000bbf565b848484848460018081905550600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415620000d9576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141562000141576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415620001a9576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000211576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508373ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505081600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060048190555060016002819055506001600381905550620003037f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5584620008da60201b60201c565b505050505073c6d714170fe766691670f12c2b45c1f34405aab6600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550731b02da8cb0d097eb8d57a175b88c7d8b47997506600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507332eb7902d4134bf98a28b963d26de779af92a212600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600367ffffffffffffffff81111562000425576200042462000c47565b5b604051908082528060200260200182016040528015620004545781602001602082028036833780820191505090505b50600c90805190602001906200046c92919062000a3d565b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600c600081548110620004a857620004a762000c76565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200055e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000584919062000ca5565b600c6001815481106200059c576200059b62000c76565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550608051600c600281548110620005ff57620005fe62000c76565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620006b5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006db919062000d15565b600a620006e9919062000eca565b6008819055508473ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016200076e92919062000f3d565b6020604051808303816000875af11580156200078e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620007b4919062000fa7565b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016200085692919062000f3d565b6020604051808303816000875af115801562000876573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200089c919062000fa7565b50620008cf7ffc8737ab85eb45125971625a9ebdb75cc78e01d5c1fa80c4c6e5203f47bc4fab84620008da60201b60201c565b505050505062000fd9565b620008ec8282620009cb60201b60201c565b620009c757600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200096c62000a3560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b82805482825590600052602060002090810192821562000ab9579160200282015b8281111562000ab85782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019062000a5e565b5b50905062000ac8919062000acc565b5090565b5b8082111562000ae757600081600090555060010162000acd565b5090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000b4c8262000b1f565b9050919050565b62000b5e8162000b3f565b811462000b6a57600080fd5b50565b60008151905062000b7e8162000b53565b92915050565b6000819050919050565b62000b998162000b84565b811462000ba557600080fd5b50565b60008151905062000bb98162000b8e565b92915050565b600080600080600060a0868803121562000bde5762000bdd62000b1a565b5b600062000bee8882890162000b6d565b955050602062000c018882890162000b6d565b945050604062000c148882890162000b6d565b935050606062000c278882890162000b6d565b925050608062000c3a8882890162000ba8565b9150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121562000cbe5762000cbd62000b1a565b5b600062000cce8482850162000b6d565b91505092915050565b600060ff82169050919050565b62000cef8162000cd7565b811462000cfb57600080fd5b50565b60008151905062000d0f8162000ce4565b92915050565b60006020828403121562000d2e5762000d2d62000b1a565b5b600062000d3e8482850162000cfe565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b600185111562000dd55780860481111562000dad5762000dac62000d47565b5b600185161562000dbd5780820291505b808102905062000dcd8562000d76565b945062000d8d565b94509492505050565b60008262000df0576001905062000ec3565b8162000e00576000905062000ec3565b816001811462000e19576002811462000e245762000e5a565b600191505062000ec3565b60ff84111562000e395762000e3862000d47565b5b8360020a91508482111562000e535762000e5262000d47565b5b5062000ec3565b5060208310610133831016604e8410600b841016171562000e945782820a90508381111562000e8e5762000e8d62000d47565b5b62000ec3565b62000ea3848484600162000d83565b9250905081840481111562000ebd5762000ebc62000d47565b5b81810290505b9392505050565b600062000ed78262000b84565b915062000ee48362000cd7565b925062000f137fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848462000dde565b905092915050565b62000f268162000b3f565b82525050565b62000f378162000b84565b82525050565b600060408201905062000f54600083018562000f1b565b62000f63602083018462000f2c565b9392505050565b60008115159050919050565b62000f818162000f6a565b811462000f8d57600080fd5b50565b60008151905062000fa18162000f76565b92915050565b60006020828403121562000fc05762000fbf62000b1a565b5b600062000fd08482850162000f90565b91505092915050565b60805160a05161507e6200107d60003960008181611d61015281816121b00152818161227901528181612ef6015281816130030152613a3e01526000818161111e015281816113e40152818161177201528181612415015281816124ee015281816127d301528181612eaf0152818161311301528181613369015281816134cb0152818161389101528181613977015281816139f40152613ad3015261507e6000f3fe608060405234801561001057600080fd5b50600436106103785760003560e01c806391d14854116101d3578063c15fc68811610104578063ce96cb77116100a2578063e8b025e01161007c578063e8b025e014610a55578063e8ddb9a614610a71578063ef8b30f714610a8d578063f0f5907d14610abd57610378565b8063ce96cb77146109d9578063d547741f14610a09578063d905777e14610a2557610378565b8063c6460a8c116100de578063c6460a8c14610953578063c6e6f59214610971578063cc1f071a146109a1578063ccfc2e8d146109bd57610378565b8063c15fc688146108e7578063c19d93fb14610905578063c63d75b61461092357610378565b8063a8d5fd6511610171578063b3d7f6b91161014b578063b3d7f6b914610839578063b460af9414610869578063b4fd689914610899578063ba087652146108b757610378565b8063a8d5fd65146107e3578063ab5d26e714610801578063ae7742561461081d57610378565b8063a217fddf116101ad578063a217fddf14610771578063a49b27801461078f578063a694fc3a146107ab578063a6c008ee146107c757610378565b806391d14854146106f557806394bf804d146107255780639ebea88c1461075557610378565b80633c1bda09116102ad5780636dc0ae221161024b5780637d495eaf116102255780637d495eaf14610695578063862a179e146106b15780638dcb4061146106cf5780638f5b3091146106d957610378565b80636dc0ae22146106295780636e553f65146106475780636fd2869f1461067757610378565b806346b49dec1161028757806346b49dec146105b75780634cdad506146105c15780634d0392a8146105f157806352e84f441461060d57610378565b80633c1bda091461054d578063402d267d1461056b5780634106d2741461059b57610378565b8063248a9ca31161031a5780632f2ff15d116102f45780632f2ff15d146104ed57806335322f371461050957806336568abe1461051357806338d52e0f1461052f57610378565b8063248a9ca31461046f57806328836fd71461049f5780632d706e40146104cf57610378565b806307a2d13a1161035657806307a2d13a146103e75780630a28a477146104175780630d43e8ad146104475780631f9920e21461046557610378565b806301e1d1141461037d57806301ffc9a71461039b578063047701e4146103cb575b600080fd5b610385610ad9565b6040516103929190613d80565b60405180910390f35b6103b560048036038101906103b09190613e07565b610bd6565b6040516103c29190613e4f565b60405180910390f35b6103e560048036038101906103e09190614021565b610c50565b005b61040160048036038101906103fc91906140a9565b610e1e565b60405161040e9190613d80565b60405180910390f35b610431600480360381019061042c91906140a9565b610e54565b60405161043e9190613d80565b60405180910390f35b61044f610e8a565b60405161045c91906140e5565b60405180910390f35b61046d610eb0565b005b61048960048036038101906104849190614136565b610f60565b6040516104969190614172565b60405180910390f35b6104b960048036038101906104b4919061418d565b610f7f565b6040516104c69190613e4f565b60405180910390f35b6104d7610f9f565b6040516104e49190613d80565b60405180910390f35b610507600480360381019061050291906141ba565b610fa5565b005b610511610fc6565b005b61052d600480360381019061052891906141ba565b611099565b005b61053761111c565b60405161054491906140e5565b60405180910390f35b610555611140565b6040516105629190613d80565b60405180910390f35b6105856004803603810190610580919061418d565b611146565b6040516105929190613d80565b60405180910390f35b6105b560048036038101906105b0919061418d565b6111ed565b005b6105bf6112ac565b005b6105db60048036038101906105d691906140a9565b61135c565b6040516105e89190613d80565b60405180910390f35b61060b600480360381019061060691906140a9565b61136e565b005b610627600480360381019061062291906140a9565b61142c565b005b6106316115bc565b60405161063e9190614172565b60405180910390f35b610661600480360381019061065c91906141fa565b6115e0565b60405161066e9190613d80565b60405180910390f35b61067f6116e4565b60405161068c9190613d80565b60405180910390f35b6106af60048036038101906106aa91906140a9565b6116ea565b005b6106b961171f565b6040516106c69190614172565b60405180910390f35b6106d7611743565b005b6106f360048036038101906106ee919061418d565b611812565b005b61070f600480360381019061070a91906141ba565b61186a565b60405161071c9190613e4f565b60405180910390f35b61073f600480360381019061073a91906141fa565b6118d4565b60405161074c9190613d80565b60405180910390f35b61076f600480360381019061076a9190614266565b61199d565b005b610779611ad3565b6040516107869190614172565b60405180910390f35b6107a960048036038101906107a491906142a6565b611ada565b005b6107c560048036038101906107c091906140a9565b611bd0565b005b6107e160048036038101906107dc919061418d565b611cd9565b005b6107eb611d5f565b6040516107f891906140e5565b60405180910390f35b61081b600480360381019061081691906142e6565b611d83565b005b6108376004803603810190610832919061418d565b611dcb565b005b610853600480360381019061084e91906140a9565b611e23565b6040516108609190613d80565b60405180910390f35b610883600480360381019061087e9190614313565b611e59565b6040516108909190613d80565b60405180910390f35b6108a1611f12565b6040516108ae9190613d80565b60405180910390f35b6108d160048036038101906108cc9190614313565b611f18565b6040516108de9190613d80565b60405180910390f35b6108ef611fd1565b6040516108fc9190613e4f565b60405180910390f35b61090d611fe4565b60405161091a91906143dd565b60405180910390f35b61093d6004803603810190610938919061418d565b611ff7565b60405161094a9190613d80565b60405180910390f35b61095b612021565b6040516109689190614172565b60405180910390f35b61098b600480360381019061098691906140a9565b612045565b6040516109989190613d80565b60405180910390f35b6109bb60048036038101906109b6919061418d565b61207b565b005b6109d760048036038101906109d2919061418d565b6120d3565b005b6109f360048036038101906109ee919061418d565b6121a9565b604051610a009190613d80565b60405180910390f35b610a236004803603810190610a1e91906141ba565b612254565b005b610a3f6004803603810190610a3a919061418d565b612275565b604051610a4c9190613d80565b60405180910390f35b610a6f6004803603810190610a6a919061418d565b612318565b005b610a8b6004803603810190610a8691906140a9565b61239e565b005b610aa76004803603810190610aa291906140a9565b61245e565b604051610ab49190613d80565b60405180910390f35b610ad76004803603810190610ad291906140a9565b612470565b005b6000600280811115610aee57610aed614366565b5b600760009054906101000a900460ff166002811115610b1057610b0f614366565b5b14610bc857600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b7091906140e5565b602060405180830381865afa158015610b8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb1919061440d565b610bb96124a5565b610bc39190614469565b610bd1565b610bd06124a5565b5b905090565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610c495750610c488261258c565b5b9050919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55610c7a816125f6565b60005b8251811015610dc1576000838281518110610c9b57610c9a6144bf565b5b6020026020010151905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ce091906140e5565b602060405180830381865afa158015610cfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d21919061440d565b90506000811115610dac578173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb87836040518363ffffffff1660e01b8152600401610d679291906144ee565b6020604051808303816000875af1158015610d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610daa919061452c565b505b50508080610db990614559565b915050610c7d565b5060004790506000811115610e18578373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610e16573d6000803e3d6000fd5b505b50505050565b600080600254905060008114610e4a57610e45600354828561260a9092919063ffffffff16565b610e4c565b825b915050919050565b600080600254905060008114610e8057610e7b81600354856126329092919063ffffffff16565b610e82565b825b915050919050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55610eda816125f6565b610ee46002612664565b610eec6126ef565b6001600760006101000a81548160ff02191690836002811115610f1257610f11614366565b5b0217905550427f469dcd0c8170c8faf3678737ed5cc64107d6d30846f97438a0feefacbed00ec2600354600254604051610f4d9291906145a2565b60405180910390a2610f5d6127cf565b50565b6000806000838152602001908152602001600020600101549050919050565b60066020528060005260406000206000915054906101000a900460ff1681565b60035481565b610fae82610f60565b610fb7816125f6565b610fc1838361292f565b505050565b7ffc8737ab85eb45125971625a9ebdb75cc78e01d5c1fa80c4c6e5203f47bc4fab610ff0816125f6565b611096600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161104e91906140e5565b602060405180830381865afa15801561106b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108f919061440d565b600161199d565b50565b6110a1612a0f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461110e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111059061464e565b60405180910390fd5b6111188282612a17565b5050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60045481565b600080600281111561115b5761115a614366565b5b600760009054906101000a900460ff16600281111561117d5761117c614366565b5b14806111bb575060028081111561119757611196614366565b5b600760009054906101000a900460ff1660028111156111b9576111b8614366565b5b145b156111c957600090506111e8565b6004546111d4610ad9565b106111e257600090506111e8565b60045490505b919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611217816125f6565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561127e576040517f9cfbf00600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6112a87ffc8737ab85eb45125971625a9ebdb75cc78e01d5c1fa80c4c6e5203f47bc4fab8361292f565b5050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556112d6816125f6565b6112e06001612664565b6112e8612af8565b6002600760006101000a81548160ff0219169083600281111561130e5761130d614366565b5b0217905550427f29db3deb62ef2036e5eb93aad68d2362aec0711af592cb365566603bd88651d46003546002546040516113499291906145a2565b60405180910390a2611359612cea565b50565b600061136782610e1e565b9050919050565b7f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc891611398816125f6565b6113a26002612664565b60008214156113dd576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61142833837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16612cec9092919063ffffffff16565b5050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611456816125f6565b6114606002612664565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016114bd91906140e5565b602060405180830381865afa1580156114da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fe919061440d565b905060008111156115b757600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338ed17398285600c30426040518663ffffffff1660e01b815260040161156d959493929190614792565b6000604051808303816000875af115801561158c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906115b591906148af565b505b505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5581565b600060026001541415611628576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161f90614944565b60405180910390fd5b6002600181905550611638612d72565b6116426001612664565b600083141561167d576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61168683612e2b565b61168f8361245e565b905060008114156116cc576040517f596231e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116d7828483612ea7565b6001808190555092915050565b60025481565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611714816125f6565b816008819055505050565b7ffc8737ab85eb45125971625a9ebdb75cc78e01d5c1fa80c4c6e5203f47bc4fab81565b7ffc8737ab85eb45125971625a9ebdb75cc78e01d5c1fa80c4c6e5203f47bc4fab61176d816125f6565b61180f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016117c991906140e5565b602060405180830381865afa1580156117e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180a919061440d565b611bd0565b50565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561183c816125f6565b6118667f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc89183612a17565b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60006002600154141561191c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191390614944565b60405180910390fd5b600260018190555061192c612d72565b6119366001612664565b6000831415611971576040517f48bb68ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61197a83611e23565b905061198581612e2b565b611990828285612ea7565b6001808190555092915050565b7ffc8737ab85eb45125971625a9ebdb75cc78e01d5c1fa80c4c6e5203f47bc4fab6119c7816125f6565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673315e79536b0bd3617293ba4f68ef5772b7d8d0f363d287b353909185856040518463ffffffff1660e01b8152600401611a3c939291906149e1565b602060405180830381865af4158015611a59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7d919061452c565b503373ffffffffffffffffffffffffffffffffffffffff167f2dad9020fc3cab73927d1f0192936d8dcbceac42333d75509d99c2c941339ccf8484604051611ac6929190614a18565b60405180910390a2505050565b6000801b81565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611b04816125f6565b611b0e6000612664565b6000831480611b1d5750600082145b15611b54576040517f3f39992a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600381905550816002819055506001600760006101000a81548160ff02191690836002811115611b8857611b87614366565b5b0217905550427f469dcd0c8170c8faf3678737ed5cc64107d6d30846f97438a0feefacbed00ec2600354600254604051611bc39291906145a2565b60405180910390a2505050565b7ffc8737ab85eb45125971625a9ebdb75cc78e01d5c1fa80c4c6e5203f47bc4fab611bfa816125f6565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a694fc3a836040518263ffffffff1660e01b8152600401611c559190613d80565b600060405180830381600087803b158015611c6f57600080fd5b505af1158015611c83573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a83604051611ccd9190613d80565b60405180910390a25050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611d03816125f6565b6001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611dad816125f6565b81600560006101000a81548160ff0219169083151502179055505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611df5816125f6565b611e1f7f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc8918361292f565b5050565b600080600254905060008114611e4f57611e4a60035482856126329092919063ffffffff16565b611e51565b825b915050919050565b600060026001541415611ea1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9890614944565b60405180910390fd5b6002600181905550611eb36001612664565b6000841415611eee576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ef784610e54565b9050611f04838583612ff7565b600180819055509392505050565b60085481565b600060026001541415611f60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5790614944565b60405180910390fd5b6002600181905550611f726001612664565b611f7b8461135c565b90506000811415611fb8576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611fc3838286612ff7565b600180819055509392505050565b600560009054906101000a900460ff1681565b600760009054906101000a900460ff1681565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9050919050565b7f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc89181565b6000806002549050600081146120715761206c816003548561260a9092919063ffffffff16565b612073565b825b915050919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556120a5816125f6565b6120cf7ffc8737ab85eb45125971625a9ebdb75cc78e01d5c1fa80c4c6e5203f47bc4fab83612a17565b5050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556120fd816125f6565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612164576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600061224d7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b815260040161220791906140e5565b602060405180830381865afa158015612224573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612248919061440d565b610e1e565b9050919050565b61225d82610f60565b612266816125f6565b6122708383612a17565b505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016122d091906140e5565b602060405180830381865afa1580156122ed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612311919061440d565b9050919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55612342816125f6565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b7f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc8916123c8816125f6565b6123d26002612664565b600082141561240d576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61245a3330847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661315c909392919063ffffffff16565b5050565b600061246982612045565b9050919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561249a816125f6565b816004819055505050565b60006002808111156124ba576124b9614366565b5b600760009054906101000a900460ff1660028111156124dc576124db614366565b5b14156124ec576003549050612589565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161254591906140e5565b602060405180830381865afa158015612562573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612586919061440d565b90505b90565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61260781612602612a0f565b6131e5565b50565b6000828402905082848204148415178215151661262657600080fd5b81810490509392505050565b6000828402905082848204148415178215151661264e57600080fd5b6001826001830304018115150290509392505050565b80600281111561267757612676614366565b5b600760009054906101000a900460ff16600281111561269957612698614366565b5b146126ec5780600760009054906101000a900460ff166040517f1f1939910000000000000000000000000000000000000000000000000000000081526004016126e3929190614a41565b60405180910390fd5b50565b600854600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161274d91906140e5565b602060405180830381865afa15801561276a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061278e919061440d565b106127c5576040517f48fa67b100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127cd613282565b565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161282a91906140e5565b602060405180830381865afa158015612847573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286b919061440d565b9050600081111561292c57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673315e79536b0bd3617293ba4f68ef5772b7d8d0f363516cc1b19091306040518363ffffffff1660e01b81526004016128e9929190614a79565b602060405180830381865af4158015612906573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061292a919061452c565b505b50565b612939828261186a565b612a0b57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506129b0612a0f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b612a21828261186a565b15612af457600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612a99612a0f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612b5591906140e5565b602060405180830381865afa158015612b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b96919061440d565b1115612c5257600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673315e79536b0bd3617293ba4f68ef5772b7d8d0f3630f975fae9091306040518363ffffffff1660e01b8152600401612c0f929190614a79565b602060405180830381865af4158015612c2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c50919061452c565b505b612c5a613294565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631c4b774b60026040518263ffffffff1660e01b8152600401612cb69190614add565b600060405180830381600087803b158015612cd057600080fd5b505af1158015612ce4573d6000803e3d6000fd5b50505050565b565b612d6d8363a9059cbb60e01b8484604051602401612d0b9291906144ee565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061329e565b505050565b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612e2957600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612e28576040517f4911a61b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6004541015612ea45760045481612e61610ad9565b612e6b9190614469565b1115612ea3576040517f0de991a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50565b612ef43330847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661315c909392919063ffffffff16565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166340c10f1984836040518363ffffffff1660e01b8152600401612f4f9291906144ee565b600060405180830381600087803b158015612f6957600080fd5b505af1158015612f7d573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78484604051612fe09291906145a2565b60405180910390a3612ff28282613365565b505050565b61300182826134c7565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166379cc679033836040518363ffffffff1660e01b815260040161305c9291906144ee565b600060405180830381600087803b15801561307657600080fd5b505af115801561308a573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db85856040516131049291906145a2565b60405180910390a461315783837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16612cec9092919063ffffffff16565b505050565b6131df846323b872dd60e01b85858560405160240161317d93929190614af8565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061329e565b50505050565b6131ef828261186a565b61327e576132148173ffffffffffffffffffffffffffffffffffffffff16601461363c565b6132228360001c602061363c565b604051602001613233929190614c41565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132759190614cb4565b60405180910390fd5b5050565b61328a613878565b613292613a3c565b565b61329c613a3c565b565b6000613300826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613bb19092919063ffffffff16565b90506000815111156133605780806020019051810190613320919061452c565b61335f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161335690614d48565b60405180910390fd5b5b505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016133c091906140e5565b602060405180830381865afa1580156133dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613401919061440d565b905060008111156134c257600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673315e79536b0bd3617293ba4f68ef5772b7d8d0f363516cc1b19091306040518363ffffffff1660e01b815260040161347f929190614a79565b602060405180830381865af415801561349c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134c0919061452c565b505b505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161352291906140e5565b602060405180830381865afa15801561353f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613563919061440d565b905080831115613637576000818461357b9190614d68565b9050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673315e79536b0bd3617293ba4f68ef5772b7d8d0f363d287b35390918360006040518463ffffffff1660e01b81526004016135f3939291906149e1565b602060405180830381865af4158015613610573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613634919061452c565b50505b505050565b60606000600283600261364f9190614d9c565b6136599190614469565b67ffffffffffffffff81111561367257613671613ede565b5b6040519080825280601f01601f1916602001820160405280156136a45781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106136dc576136db6144bf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106137405761373f6144bf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026137809190614d9c565b61378a9190614469565b90505b600181111561382a577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106137cc576137cb6144bf565b5b1a60f81b8282815181106137e3576137e26144bf565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061382390614df6565b905061378d565b506000841461386e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161386590614e6c565b60405180910390fd5b8091505092915050565b600560009054906101000a900460ff1615613a3a5760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016138e891906140e5565b602060405180830381865afa158015613905573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613929919061440d565b90506003548111156139bc576139bb600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660056003548461396b9190614d68565b6139759190614ebb565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16612cec9092919063ffffffff16565b5b613a38600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff166102586003546139f29190614ebb565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16612cec9092919063ffffffff16565b505b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613aa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613acb919061440d565b6002819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401613b2a91906140e5565b602060405180830381865afa158015613b47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b6b919061440d565b600381905550427f4721c31db00d4c86f3effcb9b553c869ce768e138eaf7a09cea387ffb5d9da33600354600254604051613ba79291906145a2565b60405180910390a2565b6060613bc08484600085613bc9565b90509392505050565b606082471015613c0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613c0590614f5e565b60405180910390fd5b613c1785613cdd565b613c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613c4d90614fca565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613c7f9190615031565b60006040518083038185875af1925050503d8060008114613cbc576040519150601f19603f3d011682016040523d82523d6000602084013e613cc1565b606091505b5091509150613cd1828286613d00565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315613d1057829050613d60565b600083511115613d235782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d579190614cb4565b60405180910390fd5b9392505050565b6000819050919050565b613d7a81613d67565b82525050565b6000602082019050613d956000830184613d71565b92915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613de481613daf565b8114613def57600080fd5b50565b600081359050613e0181613ddb565b92915050565b600060208284031215613e1d57613e1c613da5565b5b6000613e2b84828501613df2565b91505092915050565b60008115159050919050565b613e4981613e34565b82525050565b6000602082019050613e646000830184613e40565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613e9582613e6a565b9050919050565b613ea581613e8a565b8114613eb057600080fd5b50565b600081359050613ec281613e9c565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613f1682613ecd565b810181811067ffffffffffffffff82111715613f3557613f34613ede565b5b80604052505050565b6000613f48613d9b565b9050613f548282613f0d565b919050565b600067ffffffffffffffff821115613f7457613f73613ede565b5b602082029050602081019050919050565b600080fd5b6000613f9d613f9884613f59565b613f3e565b90508083825260208201905060208402830185811115613fc057613fbf613f85565b5b835b81811015613fe95780613fd58882613eb3565b845260208401935050602081019050613fc2565b5050509392505050565b600082601f83011261400857614007613ec8565b5b8135614018848260208601613f8a565b91505092915050565b6000806040838503121561403857614037613da5565b5b600061404685828601613eb3565b925050602083013567ffffffffffffffff81111561406757614066613daa565b5b61407385828601613ff3565b9150509250929050565b61408681613d67565b811461409157600080fd5b50565b6000813590506140a38161407d565b92915050565b6000602082840312156140bf576140be613da5565b5b60006140cd84828501614094565b91505092915050565b6140df81613e8a565b82525050565b60006020820190506140fa60008301846140d6565b92915050565b6000819050919050565b61411381614100565b811461411e57600080fd5b50565b6000813590506141308161410a565b92915050565b60006020828403121561414c5761414b613da5565b5b600061415a84828501614121565b91505092915050565b61416c81614100565b82525050565b60006020820190506141876000830184614163565b92915050565b6000602082840312156141a3576141a2613da5565b5b60006141b184828501613eb3565b91505092915050565b600080604083850312156141d1576141d0613da5565b5b60006141df85828601614121565b92505060206141f085828601613eb3565b9150509250929050565b6000806040838503121561421157614210613da5565b5b600061421f85828601614094565b925050602061423085828601613eb3565b9150509250929050565b61424381613e34565b811461424e57600080fd5b50565b6000813590506142608161423a565b92915050565b6000806040838503121561427d5761427c613da5565b5b600061428b85828601614094565b925050602061429c85828601614251565b9150509250929050565b600080604083850312156142bd576142bc613da5565b5b60006142cb85828601614094565b92505060206142dc85828601614094565b9150509250929050565b6000602082840312156142fc576142fb613da5565b5b600061430a84828501614251565b91505092915050565b60008060006060848603121561432c5761432b613da5565b5b600061433a86828701614094565b935050602061434b86828701613eb3565b925050604061435c86828701613eb3565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600381106143a6576143a5614366565b5b50565b60008190506143b782614395565b919050565b60006143c7826143a9565b9050919050565b6143d7816143bc565b82525050565b60006020820190506143f260008301846143ce565b92915050565b6000815190506144078161407d565b92915050565b60006020828403121561442357614422613da5565b5b6000614431848285016143f8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061447482613d67565b915061447f83613d67565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156144b4576144b361443a565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060408201905061450360008301856140d6565b6145106020830184613d71565b9392505050565b6000815190506145268161423a565b92915050565b60006020828403121561454257614541613da5565b5b600061455084828501614517565b91505092915050565b600061456482613d67565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156145975761459661443a565b5b600182019050919050565b60006040820190506145b76000830185613d71565b6145c46020830184613d71565b9392505050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000614638602f836145cb565b9150614643826145dc565b604082019050919050565b600060208201905081810360008301526146678161462b565b9050919050565b600081549050919050565b600082825260208201905092915050565b60008190508160005260206000209050919050565b6146a881613e8a565b82525050565b60006146ba838361469f565b60208301905092915050565b60008160001c9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000614706614701836146c6565b6146d3565b9050919050565b600061471982546146f3565b9050919050565b6000600182019050919050565b60006147388261466e565b6147428185614679565b935061474d8361468a565b8060005b83811015614785576147628261470d565b61476c88826146ae565b975061477783614720565b925050600181019050614751565b5085935050505092915050565b600060a0820190506147a76000830188613d71565b6147b46020830187613d71565b81810360408301526147c6818661472d565b90506147d560608301856140d6565b6147e26080830184613d71565b9695505050505050565b600067ffffffffffffffff82111561480757614806613ede565b5b602082029050602081019050919050565b600061482b614826846147ec565b613f3e565b9050808382526020820190506020840283018581111561484e5761484d613f85565b5b835b81811015614877578061486388826143f8565b845260208401935050602081019050614850565b5050509392505050565b600082601f83011261489657614895613ec8565b5b81516148a6848260208601614818565b91505092915050565b6000602082840312156148c5576148c4613da5565b5b600082015167ffffffffffffffff8111156148e3576148e2613daa565b5b6148ef84828501614881565b91505092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061492e601f836145cb565b9150614939826148f8565b602082019050919050565b6000602082019050818103600083015261495d81614921565b9050919050565b6000819050919050565b600061498961498461497f84613e6a565b614964565b613e6a565b9050919050565b600061499b8261496e565b9050919050565b60006149ad82614990565b9050919050565b6149bd816149a2565b82525050565b6149cc81613d67565b82525050565b6149db81613e34565b82525050565b60006060820190506149f660008301866149b4565b614a0360208301856149c3565b614a1060408301846149d2565b949350505050565b6000604082019050614a2d6000830185613d71565b614a3a6020830184613e40565b9392505050565b6000604082019050614a5660008301856143ce565b614a6360208301846143ce565b9392505050565b614a7381613e8a565b82525050565b6000604082019050614a8e60008301856149b4565b614a9b6020830184614a6a565b9392505050565b6000819050919050565b6000614ac7614ac2614abd84614aa2565b614964565b613d67565b9050919050565b614ad781614aac565b82525050565b6000602082019050614af26000830184614ace565b92915050565b6000606082019050614b0d60008301866140d6565b614b1a60208301856140d6565b614b276040830184613d71565b949350505050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000614b70601783614b2f565b9150614b7b82614b3a565b601782019050919050565b600081519050919050565b60005b83811015614baf578082015181840152602081019050614b94565b83811115614bbe576000848401525b50505050565b6000614bcf82614b86565b614bd98185614b2f565b9350614be9818560208601614b91565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000614c2b601183614b2f565b9150614c3682614bf5565b601182019050919050565b6000614c4c82614b63565b9150614c588285614bc4565b9150614c6382614c1e565b9150614c6f8284614bc4565b91508190509392505050565b6000614c8682614b86565b614c9081856145cb565b9350614ca0818560208601614b91565b614ca981613ecd565b840191505092915050565b60006020820190508181036000830152614cce8184614c7b565b905092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614d32602a836145cb565b9150614d3d82614cd6565b604082019050919050565b60006020820190508181036000830152614d6181614d25565b9050919050565b6000614d7382613d67565b9150614d7e83613d67565b925082821015614d9157614d9061443a565b5b828203905092915050565b6000614da782613d67565b9150614db283613d67565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614deb57614dea61443a565b5b828202905092915050565b6000614e0182613d67565b91506000821415614e1557614e1461443a565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000614e566020836145cb565b9150614e6182614e20565b602082019050919050565b60006020820190508181036000830152614e8581614e49565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614ec682613d67565b9150614ed183613d67565b925082614ee157614ee0614e8c565b5b828204905092915050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000614f486026836145cb565b9150614f5382614eec565b604082019050919050565b60006020820190508181036000830152614f7781614f3b565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000614fb4601d836145cb565b9150614fbf82614f7e565b602082019050919050565b60006020820190508181036000830152614fe381614fa7565b9050919050565b600081519050919050565b600081905092915050565b600061500b82614fea565b6150158185614ff5565b9350615025818560208601614b91565b80840191505092915050565b600061503d8284615000565b91508190509291505056fea2646970667358221220f6a16dcef81b6d115a526c05c908fe2379a99fe05c1fdaa70642c9a48681733864736f6c634300080a00330000000000000000000000006c2c06790b3e3e3c38e12ee22f8183b37a13ee55000000000000000000000000f018865b26ffab9cd1735dcca549d95b0cb9ea19000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d90774000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d907740000000000000000000000000000000000000000000000b4aeaab10258f40000

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

0000000000000000000000006c2c06790b3e3e3c38e12ee22f8183b37a13ee55000000000000000000000000f018865b26ffab9cd1735dcca549d95b0cb9ea19000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d90774000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d907740000000000000000000000000000000000000000000000b4aeaab10258f40000

-----Decoded View---------------
Arg [0] : _asset (address): 0x6c2c06790b3e3e3c38e12ee22f8183b37a13ee55
Arg [1] : _share (address): 0xf018865b26ffab9cd1735dcca549d95b0cb9ea19
Arg [2] : _governor (address): 0xdd0556ddcfe7cdab3540e7f09cb366f498d90774
Arg [3] : _feeDistributor (address): 0xdd0556ddcfe7cdab3540e7f09cb366f498d90774
Arg [4] : _vaultCap (uint256): 3333000000000000000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000006c2c06790b3e3e3c38e12ee22f8183b37a13ee55
Arg [1] : 000000000000000000000000f018865b26ffab9cd1735dcca549d95b0cb9ea19
Arg [2] : 000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d90774
Arg [3] : 000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d90774
Arg [4] : 0000000000000000000000000000000000000000000000b4aeaab10258f40000


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