Contract 0xF46Ce0C13577232D5F29D9Bd78a9Cab278755346 7

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x87fee597654576283b2dbaf84063b1a959c96b8d88fdc6b61937fcf7b9b025cd0x60c06040109820572022-05-01 18:20:06509 days 12 hrs agoJones DAO: Deployer IN  Create: JonesERC20VaultV30 ETH0.074800516317 ETH1.407055331
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xb3b3ca740dd0bb541fdb37d018a417279bd5ad17623a82d77e27efe13eeb3f28720369082023-03-21 6:54:28186 days 20 mins ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
0xb3b3ca740dd0bb541fdb37d018a417279bd5ad17623a82d77e27efe13eeb3f28720369082023-03-21 6:54:28186 days 20 mins ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Jones DAO: jETH Token0 ETH
0xb3b3ca740dd0bb541fdb37d018a417279bd5ad17623a82d77e27efe13eeb3f28720369082023-03-21 6:54:28186 days 20 mins ago 0xbcb55bdb669e756e982169c19c20c987c26f3c2d 0xf46ce0c13577232d5f29d9bd78a9cab2787553460 ETH
0x052c2c78b49c8e3c4894aaaac6428dd3c74478c81bf09061b99571e6ed053de8720047362023-03-21 4:41:58186 days 2 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
0x052c2c78b49c8e3c4894aaaac6428dd3c74478c81bf09061b99571e6ed053de8720047362023-03-21 4:41:58186 days 2 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Jones DAO: jETH Token0 ETH
0x052c2c78b49c8e3c4894aaaac6428dd3c74478c81bf09061b99571e6ed053de8720047362023-03-21 4:41:58186 days 2 hrs ago 0xbcb55bdb669e756e982169c19c20c987c26f3c2d 0xf46ce0c13577232d5f29d9bd78a9cab2787553460 ETH
0x8350b61be1766bef3e5b7a420123b9e1f78e6d3c0c8e056fe4a6bfe4edb0698c719713942023-03-21 2:23:45186 days 4 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
0x8350b61be1766bef3e5b7a420123b9e1f78e6d3c0c8e056fe4a6bfe4edb0698c719713942023-03-21 2:23:45186 days 4 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Jones DAO: jETH Token0 ETH
0x8350b61be1766bef3e5b7a420123b9e1f78e6d3c0c8e056fe4a6bfe4edb0698c719713942023-03-21 2:23:45186 days 4 hrs ago 0xbcb55bdb669e756e982169c19c20c987c26f3c2d 0xf46ce0c13577232d5f29d9bd78a9cab2787553460 ETH
0xd1a2831133058b79cf7abdb22c157d9416f1bb9d27e0c6a3f0df0c3482752e64718236052023-03-20 16:00:08186 days 15 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
0xd1a2831133058b79cf7abdb22c157d9416f1bb9d27e0c6a3f0df0c3482752e64718236052023-03-20 16:00:08186 days 15 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Jones DAO: jETH Token0 ETH
0xd1a2831133058b79cf7abdb22c157d9416f1bb9d27e0c6a3f0df0c3482752e64718236052023-03-20 16:00:08186 days 15 hrs ago 0xbcb55bdb669e756e982169c19c20c987c26f3c2d 0xf46ce0c13577232d5f29d9bd78a9cab2787553460 ETH
0xe886c280c61ce22d852984db12d2007c4e633117f14a5e78ac75074d4a202673717120362023-03-20 8:21:58186 days 22 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
0xe886c280c61ce22d852984db12d2007c4e633117f14a5e78ac75074d4a202673717120362023-03-20 8:21:58186 days 22 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Jones DAO: jETH Token0 ETH
0xe886c280c61ce22d852984db12d2007c4e633117f14a5e78ac75074d4a202673717120362023-03-20 8:21:58186 days 22 hrs ago 0xbcb55bdb669e756e982169c19c20c987c26f3c2d 0xf46ce0c13577232d5f29d9bd78a9cab2787553460 ETH
0xc08e871c0e255d5955be04da7a843acd5203a3f28344dadfc007253c2b6bd894715506172023-03-19 20:58:55187 days 10 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
0xc08e871c0e255d5955be04da7a843acd5203a3f28344dadfc007253c2b6bd894715506172023-03-19 20:58:55187 days 10 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Jones DAO: jETH Token0 ETH
0xc08e871c0e255d5955be04da7a843acd5203a3f28344dadfc007253c2b6bd894715506172023-03-19 20:58:55187 days 10 hrs ago 0xbcb55bdb669e756e982169c19c20c987c26f3c2d 0xf46ce0c13577232d5f29d9bd78a9cab2787553460 ETH
0xb537c415f48ae7cd0f3af2d796e8456e2d985093a402aa3bfbc6718085d94c7d714882162023-03-19 16:39:03187 days 14 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
0xb537c415f48ae7cd0f3af2d796e8456e2d985093a402aa3bfbc6718085d94c7d714882162023-03-19 16:39:03187 days 14 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Jones DAO: jETH Token0 ETH
0xb537c415f48ae7cd0f3af2d796e8456e2d985093a402aa3bfbc6718085d94c7d714882162023-03-19 16:39:03187 days 14 hrs ago 0xbcb55bdb669e756e982169c19c20c987c26f3c2d 0xf46ce0c13577232d5f29d9bd78a9cab2787553460 ETH
0x0de2572a25fee0951e8df95037f30fba97acfd54cb769f6c461a72a0c614941e712117752023-03-18 21:07:16188 days 10 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
0x0de2572a25fee0951e8df95037f30fba97acfd54cb769f6c461a72a0c614941e712117752023-03-18 21:07:16188 days 10 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Jones DAO: jETH Token0 ETH
0x0de2572a25fee0951e8df95037f30fba97acfd54cb769f6c461a72a0c614941e712117752023-03-18 21:07:16188 days 10 hrs ago 0xbcb55bdb669e756e982169c19c20c987c26f3c2d 0xf46ce0c13577232d5f29d9bd78a9cab2787553460 ETH
0x61ac65b82a2801886de4fb5f94baadcc61ef142e868b82974f0032a99fb454e8712110652023-03-18 21:04:20188 days 10 hrs ago 0xf46ce0c13577232d5f29d9bd78a9cab278755346 Wrapped Ether0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
JonesERC20VaultV3

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
No with 200 runs

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

import {JonesVaultV3} from "./JonesVaultV3.sol";

contract JonesERC20VaultV3 is JonesVaultV3 {
    constructor(
        address _asset,
        address _share,
        address _governor,
        address _feeDistributor,
        uint256 _vaultCap
    ) JonesVaultV3(_asset, _share, _governor, _feeDistributor, _vaultCap) {}

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

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

    /**
     * @inheritdoc JonesVaultV3
     */
    function _afterDeposit(uint256 assets, uint256 shares)
        internal
        virtual
        override
    {}

    /**
     * @inheritdoc JonesVaultV3
     */
    function _beforeWithdraw(uint256 assets, uint256 shares)
        internal
        virtual
        override
    {}
}

File 2 of 18 : 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 3 of 18 : 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 4 of 18 : 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 5 of 18 : 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 6 of 18 : 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 7 of 18 : 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 8 of 18 : 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 9 of 18 : 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 10 of 18 : 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 11 of 18 : 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 12 of 18 : 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 13 of 18 : 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 14 of 18 : 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 15 of 18 : 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 16 of 18 : 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 17 of 18 : 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);
    }
}

File 18 of 18 : 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);
}

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

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":"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":"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":"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":"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":"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":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","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":[],"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":[],"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"}]

60c06040526000600760006101000a81548160ff021916908360028111156200002d576200002c62000476565b5b02179055503480156200003f57600080fd5b50604051620041da380380620041da83398181016040528101906200006591906200054a565b848484848460018081905550600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415620000d9576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141562000141576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415620001a9576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141562000211576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508373ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505081600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060048190555060016002819055506001600381905550620003037f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55846200031360201b60201c565b50505050505050505050620005d2565b6200032582826200040460201b60201c565b6200040057600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620003a56200046e60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620004d782620004aa565b9050919050565b620004e981620004ca565b8114620004f557600080fd5b50565b6000815190506200050981620004de565b92915050565b6000819050919050565b62000524816200050f565b81146200053057600080fd5b50565b600081519050620005448162000519565b92915050565b600080600080600060a08688031215620005695762000568620004a5565b5b60006200057988828901620004f8565b95505060206200058c88828901620004f8565b94505060406200059f88828901620004f8565b9350506060620005b288828901620004f8565b9250506080620005c58882890162000533565b9150509295509295909350565b60805160a051613b806200065a600039600081816114dc015281816118cd015281816119960152818161211801528181612225015261266a01526000818161093c01528181610e4f0152818161105601528181611b32015281816120d101528181612335015281816124bd015281816125a30152818161262001526126ff0152613b806000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c806394bf804d1161015c578063c19d93fb116100ce578063d547741f11610087578063d547741f14610823578063d905777e1461083f578063e8b025e01461086f578063e8ddb9a61461088b578063ef8b30f7146108a7578063f0f5907d146108d75761028a565b8063c19d93fb1461073b578063c63d75b614610759578063c6460a8c14610789578063c6e6f592146107a7578063ccfc2e8d146107d7578063ce96cb77146107f35761028a565b8063ab5d26e711610120578063ab5d26e714610655578063ae77425614610671578063b3d7f6b91461068d578063b460af94146106bd578063ba087652146106ed578063c15fc6881461071d5761028a565b806394bf804d146105b1578063a217fddf146105e1578063a49b2780146105ff578063a6c008ee1461061b578063a8d5fd65146106375761028a565b806336568abe116102005780634d0392a8116101b95780634d0392a8146104dd5780636dc0ae22146104f95780636e553f65146105175780636fd2869f146105475780638f5b30911461056557806391d14854146105815761028a565b806336568abe1461041b57806338d52e0f146104375780633c1bda0914610455578063402d267d1461047357806346b49dec146104a35780634cdad506146104ad5761028a565b80630d43e8ad116102525780630d43e8ad146103595780631f9920e214610377578063248a9ca31461038157806328836fd7146103b15780632d706e40146103e15780632f2ff15d146103ff5761028a565b806301e1d1141461028f57806301ffc9a7146102ad578063047701e4146102dd57806307a2d13a146102f95780630a28a47714610329575b600080fd5b6102976108f3565b6040516102a49190612cb7565b60405180910390f35b6102c760048036038101906102c29190612d3e565b6109da565b6040516102d49190612d86565b60405180910390f35b6102f760048036038101906102f29190612f58565b610a54565b005b610313600480360381019061030e9190612fe0565b610c22565b6040516103209190612cb7565b60405180910390f35b610343600480360381019061033e9190612fe0565b610c58565b6040516103509190612cb7565b60405180910390f35b610361610c8e565b60405161036e919061301c565b60405180910390f35b61037f610cb4565b005b61039b6004803603810190610396919061306d565b610d64565b6040516103a891906130a9565b60405180910390f35b6103cb60048036038101906103c691906130c4565b610d83565b6040516103d89190612d86565b60405180910390f35b6103e9610da3565b6040516103f69190612cb7565b60405180910390f35b610419600480360381019061041491906130f1565b610da9565b005b610435600480360381019061043091906130f1565b610dca565b005b61043f610e4d565b60405161044c919061301c565b60405180910390f35b61045d610e71565b60405161046a9190612cb7565b60405180910390f35b61048d600480360381019061048891906130c4565b610e77565b60405161049a9190612cb7565b60405180910390f35b6104ab610f1e565b005b6104c760048036038101906104c29190612fe0565b610fce565b6040516104d49190612cb7565b60405180910390f35b6104f760048036038101906104f29190612fe0565b610fe0565b005b61050161109e565b60405161050e91906130a9565b60405180910390f35b610531600480360381019061052c9190613131565b6110c2565b60405161053e9190612cb7565b60405180910390f35b61054f6111c6565b60405161055c9190612cb7565b60405180910390f35b61057f600480360381019061057a91906130c4565b6111cc565b005b61059b600480360381019061059691906130f1565b611224565b6040516105a89190612d86565b60405180910390f35b6105cb60048036038101906105c69190613131565b61128e565b6040516105d89190612cb7565b60405180910390f35b6105e9611357565b6040516105f691906130a9565b60405180910390f35b61061960048036038101906106149190613171565b61135e565b005b610635600480360381019061063091906130c4565b611454565b005b61063f6114da565b60405161064c919061301c565b60405180910390f35b61066f600480360381019061066a91906131dd565b6114fe565b005b61068b600480360381019061068691906130c4565b611546565b005b6106a760048036038101906106a29190612fe0565b61159e565b6040516106b49190612cb7565b60405180910390f35b6106d760048036038101906106d2919061320a565b6115d4565b6040516106e49190612cb7565b60405180910390f35b6107076004803603810190610702919061320a565b61168d565b6040516107149190612cb7565b60405180910390f35b610725611746565b6040516107329190612d86565b60405180910390f35b610743611759565b60405161075091906132d4565b60405180910390f35b610773600480360381019061076e91906130c4565b61176c565b6040516107809190612cb7565b60405180910390f35b610791611796565b60405161079e91906130a9565b60405180910390f35b6107c160048036038101906107bc9190612fe0565b6117ba565b6040516107ce9190612cb7565b60405180910390f35b6107f160048036038101906107ec91906130c4565b6117f0565b005b61080d600480360381019061080891906130c4565b6118c6565b60405161081a9190612cb7565b60405180910390f35b61083d600480360381019061083891906130f1565b611971565b005b610859600480360381019061085491906130c4565b611992565b6040516108669190612cb7565b60405180910390f35b610889600480360381019061088491906130c4565b611a35565b005b6108a560048036038101906108a09190612fe0565b611abb565b005b6108c160048036038101906108bc9190612fe0565b611b7b565b6040516108ce9190612cb7565b60405180910390f35b6108f160048036038101906108ec9190612fe0565b611b8d565b005b60006002808111156109085761090761325d565b5b600760009054906101000a900460ff16600281111561092a5761092961325d565b5b141561093a5760035490506109d7565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610993919061301c565b602060405180830381865afa1580156109b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d49190613304565b90505b90565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610a4d5750610a4c82611bc2565b5b9050919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55610a7e81611c2c565b60005b8251811015610bc5576000838281518110610a9f57610a9e613331565b5b6020026020010151905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ae4919061301c565b602060405180830381865afa158015610b01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b259190613304565b90506000811115610bb0578173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb87836040518363ffffffff1660e01b8152600401610b6b929190613360565b6020604051808303816000875af1158015610b8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bae919061339e565b505b50508080610bbd906133fa565b915050610a81565b5060004790506000811115610c1c578373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610c1a573d6000803e3d6000fd5b505b50505050565b600080600254905060008114610c4e57610c496003548285611c409092919063ffffffff16565b610c50565b825b915050919050565b600080600254905060008114610c8457610c7f8160035485611c689092919063ffffffff16565b610c86565b825b915050919050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55610cde81611c2c565b610ce86002611c9a565b610cf0611d25565b6001600760006101000a81548160ff02191690836002811115610d1657610d1561325d565b5b0217905550427f469dcd0c8170c8faf3678737ed5cc64107d6d30846f97438a0feefacbed00ec2600354600254604051610d51929190613443565b60405180910390a2610d61611d37565b50565b6000806000838152602001908152602001600020600101549050919050565b60066020528060005260406000206000915054906101000a900460ff1681565b60035481565b610db282610d64565b610dbb81611c2c565b610dc58383611d39565b505050565b610dd2611e19565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e36906134ef565b60405180910390fd5b610e498282611e21565b5050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60045481565b6000806002811115610e8c57610e8b61325d565b5b600760009054906101000a900460ff166002811115610eae57610ead61325d565b5b1480610eec5750600280811115610ec857610ec761325d565b5b600760009054906101000a900460ff166002811115610eea57610ee961325d565b5b145b15610efa5760009050610f19565b600454610f056108f3565b10610f135760009050610f19565b60045490505b919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55610f4881611c2c565b610f526001611c9a565b610f5a611f02565b6002600760006101000a81548160ff02191690836002811115610f8057610f7f61325d565b5b0217905550427f29db3deb62ef2036e5eb93aad68d2362aec0711af592cb365566603bd88651d4600354600254604051610fbb929190613443565b60405180910390a2610fcb611f0c565b50565b6000610fd982610c22565b9050919050565b7f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc89161100a81611c2c565b6110146002611c9a565b600082141561104f576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61109a33837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611f0e9092919063ffffffff16565b5050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5581565b60006002600154141561110a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111019061355b565b60405180910390fd5b600260018190555061111a611f94565b6111246001611c9a565b600083141561115f576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111688361204d565b61117183611b7b565b905060008114156111ae576040517f596231e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111b98284836120c9565b6001808190555092915050565b60025481565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556111f681611c2c565b6112207f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc89183611e21565b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000600260015414156112d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd9061355b565b60405180910390fd5b60026001819055506112e6611f94565b6112f06001611c9a565b600083141561132b576040517f48bb68ad00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113348361159e565b905061133f8161204d565b61134a8282856120c9565b6001808190555092915050565b6000801b81565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561138881611c2c565b6113926000611c9a565b60008314806113a15750600082145b156113d8576040517f3f39992a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600381905550816002819055506001600760006101000a81548160ff0219169083600281111561140c5761140b61325d565b5b0217905550427f469dcd0c8170c8faf3678737ed5cc64107d6d30846f97438a0feefacbed00ec2600354600254604051611447929190613443565b60405180910390a2505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561147e81611c2c565b6001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561152881611c2c565b81600560006101000a81548160ff0219169083151502179055505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561157081611c2c565b61159a7f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc89183611d39565b5050565b6000806002549050600081146115ca576115c56003548285611c689092919063ffffffff16565b6115cc565b825b915050919050565b60006002600154141561161c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116139061355b565b60405180910390fd5b600260018190555061162e6001611c9a565b6000841415611669576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61167284610c58565b905061167f838583612219565b600180819055509392505050565b6000600260015414156116d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cc9061355b565b60405180910390fd5b60026001819055506116e76001611c9a565b6116f084610fce565b9050600081141561172d576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611738838286612219565b600180819055509392505050565b600560009054906101000a900460ff1681565b600760009054906101000a900460ff1681565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9050919050565b7f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc89181565b6000806002549050600081146117e6576117e18160035485611c409092919063ffffffff16565b6117e8565b825b915050919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561181a81611c2c565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611881576040517f5963709b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600061196a7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401611924919061301c565b602060405180830381865afa158015611941573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119659190613304565b610c22565b9050919050565b61197a82610d64565b61198381611c2c565b61198d8383611e21565b505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016119ed919061301c565b602060405180830381865afa158015611a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2e9190613304565b9050919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611a5f81611c2c565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b7f83f1c4c0119299dc19d4102a0df1185e4605139e61947a2f1bf0978f284fc891611ae581611c2c565b611aef6002611c9a565b6000821415611b2a576040517f92064cc900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b773330847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661237e909392919063ffffffff16565b5050565b6000611b86826117ba565b9050919050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55611bb781611c2c565b816004819055505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b611c3d81611c38611e19565b612407565b50565b60008284029050828482041484151782151516611c5c57600080fd5b81810490509392505050565b60008284029050828482041484151782151516611c8457600080fd5b6001826001830304018115150290509392505050565b806002811115611cad57611cac61325d565b5b600760009054906101000a900460ff166002811115611ccf57611cce61325d565b5b14611d225780600760009054906101000a900460ff166040517f1f193991000000000000000000000000000000000000000000000000000000008152600401611d1992919061357b565b60405180910390fd5b50565b611d2d6124a4565b611d35612668565b565b565b611d438282611224565b611e1557600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611dba611e19565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b611e2b8282611224565b15611efe57600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611ea3611e19565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b611f0a612668565b565b565b611f8f8363a9059cbb60e01b8484604051602401611f2d929190613360565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506127dd565b505050565b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461204b57600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661204a576040517f4911a61b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60045410156120c657600454816120836108f3565b61208d91906135a4565b11156120c5576040517f0de991a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50565b6121163330847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661237e909392919063ffffffff16565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166340c10f1984836040518363ffffffff1660e01b8152600401612171929190613360565b600060405180830381600087803b15801561218b57600080fd5b505af115801561219f573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78484604051612202929190613443565b60405180910390a361221482826128a4565b505050565b61222382826128a8565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166379cc679033836040518363ffffffff1660e01b815260040161227e929190613360565b600060405180830381600087803b15801561229857600080fd5b505af11580156122ac573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051612326929190613443565b60405180910390a461237983837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611f0e9092919063ffffffff16565b505050565b612401846323b872dd60e01b85858560405160240161239f939291906135fa565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506127dd565b50505050565b6124118282611224565b6124a0576124368173ffffffffffffffffffffffffffffffffffffffff1660146128ac565b6124448360001c60206128ac565b604051602001612455929190613743565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249791906137b6565b60405180910390fd5b5050565b600560009054906101000a900460ff16156126665760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612514919061301c565b602060405180830381865afa158015612531573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125559190613304565b90506003548111156125e8576125e7600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660056003548461259791906137d8565b6125a1919061383b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611f0e9092919063ffffffff16565b5b612664600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661025860035461261e919061383b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16611f0e9092919063ffffffff16565b505b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126f79190613304565b6002819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612756919061301c565b602060405180830381865afa158015612773573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127979190613304565b600381905550427f4721c31db00d4c86f3effcb9b553c869ce768e138eaf7a09cea387ffb5d9da336003546002546040516127d3929190613443565b60405180910390a2565b600061283f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612ae89092919063ffffffff16565b905060008151111561289f578080602001905181019061285f919061339e565b61289e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612895906138de565b60405180910390fd5b5b505050565b5050565b5050565b6060600060028360026128bf91906138fe565b6128c991906135a4565b67ffffffffffffffff8111156128e2576128e1612e15565b5b6040519080825280601f01601f1916602001820160405280156129145781602001600182028036833780820191505090505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061294c5761294b613331565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106129b0576129af613331565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026129f091906138fe565b6129fa91906135a4565b90505b6001811115612a9a577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110612a3c57612a3b613331565b5b1a60f81b828281518110612a5357612a52613331565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080612a9390613958565b90506129fd565b5060008414612ade576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ad5906139ce565b60405180910390fd5b8091505092915050565b6060612af78484600085612b00565b90509392505050565b606082471015612b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b3c90613a60565b60405180910390fd5b612b4e85612c14565b612b8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8490613acc565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612bb69190613b33565b60006040518083038185875af1925050503d8060008114612bf3576040519150601f19603f3d011682016040523d82523d6000602084013e612bf8565b606091505b5091509150612c08828286612c37565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315612c4757829050612c97565b600083511115612c5a5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c8e91906137b6565b60405180910390fd5b9392505050565b6000819050919050565b612cb181612c9e565b82525050565b6000602082019050612ccc6000830184612ca8565b92915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612d1b81612ce6565b8114612d2657600080fd5b50565b600081359050612d3881612d12565b92915050565b600060208284031215612d5457612d53612cdc565b5b6000612d6284828501612d29565b91505092915050565b60008115159050919050565b612d8081612d6b565b82525050565b6000602082019050612d9b6000830184612d77565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612dcc82612da1565b9050919050565b612ddc81612dc1565b8114612de757600080fd5b50565b600081359050612df981612dd3565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612e4d82612e04565b810181811067ffffffffffffffff82111715612e6c57612e6b612e15565b5b80604052505050565b6000612e7f612cd2565b9050612e8b8282612e44565b919050565b600067ffffffffffffffff821115612eab57612eaa612e15565b5b602082029050602081019050919050565b600080fd5b6000612ed4612ecf84612e90565b612e75565b90508083825260208201905060208402830185811115612ef757612ef6612ebc565b5b835b81811015612f205780612f0c8882612dea565b845260208401935050602081019050612ef9565b5050509392505050565b600082601f830112612f3f57612f3e612dff565b5b8135612f4f848260208601612ec1565b91505092915050565b60008060408385031215612f6f57612f6e612cdc565b5b6000612f7d85828601612dea565b925050602083013567ffffffffffffffff811115612f9e57612f9d612ce1565b5b612faa85828601612f2a565b9150509250929050565b612fbd81612c9e565b8114612fc857600080fd5b50565b600081359050612fda81612fb4565b92915050565b600060208284031215612ff657612ff5612cdc565b5b600061300484828501612fcb565b91505092915050565b61301681612dc1565b82525050565b6000602082019050613031600083018461300d565b92915050565b6000819050919050565b61304a81613037565b811461305557600080fd5b50565b60008135905061306781613041565b92915050565b60006020828403121561308357613082612cdc565b5b600061309184828501613058565b91505092915050565b6130a381613037565b82525050565b60006020820190506130be600083018461309a565b92915050565b6000602082840312156130da576130d9612cdc565b5b60006130e884828501612dea565b91505092915050565b6000806040838503121561310857613107612cdc565b5b600061311685828601613058565b925050602061312785828601612dea565b9150509250929050565b6000806040838503121561314857613147612cdc565b5b600061315685828601612fcb565b925050602061316785828601612dea565b9150509250929050565b6000806040838503121561318857613187612cdc565b5b600061319685828601612fcb565b92505060206131a785828601612fcb565b9150509250929050565b6131ba81612d6b565b81146131c557600080fd5b50565b6000813590506131d7816131b1565b92915050565b6000602082840312156131f3576131f2612cdc565b5b6000613201848285016131c8565b91505092915050565b60008060006060848603121561322357613222612cdc565b5b600061323186828701612fcb565b935050602061324286828701612dea565b925050604061325386828701612dea565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6003811061329d5761329c61325d565b5b50565b60008190506132ae8261328c565b919050565b60006132be826132a0565b9050919050565b6132ce816132b3565b82525050565b60006020820190506132e960008301846132c5565b92915050565b6000815190506132fe81612fb4565b92915050565b60006020828403121561331a57613319612cdc565b5b6000613328848285016132ef565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000604082019050613375600083018561300d565b6133826020830184612ca8565b9392505050565b600081519050613398816131b1565b92915050565b6000602082840312156133b4576133b3612cdc565b5b60006133c284828501613389565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061340582612c9e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613438576134376133cb565b5b600182019050919050565b60006040820190506134586000830185612ca8565b6134656020830184612ca8565b9392505050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b60006134d9602f8361346c565b91506134e48261347d565b604082019050919050565b60006020820190508181036000830152613508816134cc565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000613545601f8361346c565b91506135508261350f565b602082019050919050565b6000602082019050818103600083015261357481613538565b9050919050565b600060408201905061359060008301856132c5565b61359d60208301846132c5565b9392505050565b60006135af82612c9e565b91506135ba83612c9e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156135ef576135ee6133cb565b5b828201905092915050565b600060608201905061360f600083018661300d565b61361c602083018561300d565b6136296040830184612ca8565b949350505050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000613672601783613631565b915061367d8261363c565b601782019050919050565b600081519050919050565b60005b838110156136b1578082015181840152602081019050613696565b838111156136c0576000848401525b50505050565b60006136d182613688565b6136db8185613631565b93506136eb818560208601613693565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b600061372d601183613631565b9150613738826136f7565b601182019050919050565b600061374e82613665565b915061375a82856136c6565b915061376582613720565b915061377182846136c6565b91508190509392505050565b600061378882613688565b613792818561346c565b93506137a2818560208601613693565b6137ab81612e04565b840191505092915050565b600060208201905081810360008301526137d0818461377d565b905092915050565b60006137e382612c9e565b91506137ee83612c9e565b925082821015613801576138006133cb565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061384682612c9e565b915061385183612c9e565b9250826138615761386061380c565b5b828204905092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b60006138c8602a8361346c565b91506138d38261386c565b604082019050919050565b600060208201905081810360008301526138f7816138bb565b9050919050565b600061390982612c9e565b915061391483612c9e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561394d5761394c6133cb565b5b828202905092915050565b600061396382612c9e565b91506000821415613977576139766133cb565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006139b860208361346c565b91506139c382613982565b602082019050919050565b600060208201905081810360008301526139e7816139ab565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000613a4a60268361346c565b9150613a55826139ee565b604082019050919050565b60006020820190508181036000830152613a7981613a3d565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000613ab6601d8361346c565b9150613ac182613a80565b602082019050919050565b60006020820190508181036000830152613ae581613aa9565b9050919050565b600081519050919050565b600081905092915050565b6000613b0d82613aec565b613b178185613af7565b9350613b27818560208601613693565b80840191505092915050565b6000613b3f8284613b02565b91508190509291505056fea2646970667358221220754de9bcc343f2a878c76bbbb27185c79008487cfba3c5be986a399f775265c064736f6c634300080a003300000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000662d0f9ff837a51cf89a1fe7e0882a906dac08a3000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d90774000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d9077400000000000000000000000000000000000000000000006c6b935b8bbd400000

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

00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000662d0f9ff837a51cf89a1fe7e0882a906dac08a3000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d90774000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d9077400000000000000000000000000000000000000000000006c6b935b8bbd400000

-----Decoded View---------------
Arg [0] : _asset (address): 0x82af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [1] : _share (address): 0x662d0f9ff837a51cf89a1fe7e0882a906dac08a3
Arg [2] : _governor (address): 0xdd0556ddcfe7cdab3540e7f09cb366f498d90774
Arg [3] : _feeDistributor (address): 0xdd0556ddcfe7cdab3540e7f09cb366f498d90774
Arg [4] : _vaultCap (uint256): 2000000000000000000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [1] : 000000000000000000000000662d0f9ff837a51cf89a1fe7e0882a906dac08a3
Arg [2] : 000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d90774
Arg [3] : 000000000000000000000000dd0556ddcfe7cdab3540e7f09cb366f498d90774
Arg [4] : 00000000000000000000000000000000000000000000006c6b935b8bbd400000


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.