ETH Price: $2,373.52 (+5.52%)
Gas: 42 Gwei

Contract

0x6C97A35D7c57C48463281a5Ec9620a4613BE62BF
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multi Chain

Multichain Addresses

1 address found via
Transaction Hash
Method
Block
From
To
Value
Set Strategy Par...164121922023-01-15 12:26:11326 days 14 hrs ago1673785571IN
0x6C97A3...13BE62BF
0 ETH0.0020656618.13435087
Commit Delayed S...164121922023-01-15 12:26:11326 days 14 hrs ago1673785571IN
0x6C97A3...13BE62BF
0 ETH0.0028855918.13435087
Stage Delayed St...164121912023-01-15 12:25:59326 days 14 hrs ago1673785559IN
0x6C97A3...13BE62BF
0 ETH0.0030938717.54024029
Create Vault164121912023-01-15 12:25:59326 days 14 hrs ago1673785559IN
0x6C97A3...13BE62BF
0 ETH0.0147398317.54024029
Set Strategy Par...164121652023-01-15 12:20:47326 days 14 hrs ago1673785247IN
0x6C97A3...13BE62BF
0 ETH0.0020079217.62742835
Commit Delayed S...164121652023-01-15 12:20:47326 days 14 hrs ago1673785247IN
0x6C97A3...13BE62BF
0 ETH0.0028049217.62742835
Stage Delayed St...164121642023-01-15 12:20:35326 days 14 hrs ago1673785235IN
0x6C97A3...13BE62BF
0 ETH0.0029461516.70278455
Create Vault164121642023-01-15 12:20:35326 days 14 hrs ago1673785235IN
0x6C97A3...13BE62BF
0 ETH0.0141566716.70278455
Set Strategy Par...162508752022-12-24 0:00:47349 days 3 hrs ago1671840047IN
0x6C97A3...13BE62BF
0 ETH0.0005972910.32041614
Set Strategy Par...162200032022-12-19 16:41:47353 days 10 hrs ago1671468107IN
0x6C97A3...13BE62BF
0 ETH0.0025970122.79901521
Commit Delayed S...162200022022-12-19 16:41:35353 days 10 hrs ago1671468095IN
0x6C97A3...13BE62BF
0 ETH0.0036186722.74139206
Stage Delayed St...162200012022-12-19 16:41:23353 days 10 hrs ago1671468083IN
0x6C97A3...13BE62BF
0 ETH0.0038470521.81033308
Create Vault162200002022-12-19 16:41:11353 days 10 hrs ago1671468071IN
0x6C97A3...13BE62BF
0 ETH0.0192300322.8835332
0x60a06040162076162022-12-17 23:11:47355 days 4 hrs ago1671318707IN
 Create: ERC20RootVaultGovernance
0 ETH0.0601095119.78983841

Latest 3 internal transactions

Advanced mode:
Parent Txn Hash Block From To Value
164121912023-01-15 12:25:59326 days 14 hrs ago1673785559
0x6C97A3...13BE62BF
 Contract Creation0 ETH
164121642023-01-15 12:20:35326 days 14 hrs ago1673785235
0x6C97A3...13BE62BF
 Contract Creation0 ETH
162200002022-12-19 16:41:11353 days 10 hrs ago1671468071
0x6C97A3...13BE62BF
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC20RootVaultGovernance

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 29 of 30 : ERC20RootVaultGovernance.sol
// SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;

import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20Vault.sol";
import "../interfaces/vaults/IIntegrationVault.sol";
import "../libraries/CommonLibrary.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../utils/ContractMeta.sol";
import "./VaultGovernance.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";

/// @notice Governance that manages all Lp Issuers params and can deploy a new LpIssuer Vault.
contract ERC20RootVaultGovernance is ContractMeta, IERC20RootVaultGovernance, VaultGovernance {
    /// @inheritdoc IERC20RootVaultGovernance
    uint256 public constant MAX_PROTOCOL_FEE = 5 * 10**7; // 5%
    /// @inheritdoc IERC20RootVaultGovernance
    uint256 public constant MAX_MANAGEMENT_FEE = 10 * 10**7; // 10%
    /// @inheritdoc IERC20RootVaultGovernance
    uint256 public constant MAX_PERFORMANCE_FEE = 50 * 10**7; // 50%

    IERC20RootVaultHelper public immutable helper;

    /// @notice Creates a new contract.
    /// @param internalParams_ Initial Internal Params
    /// @param delayedProtocolParams_ Initial Protocol Params
    constructor(
        InternalParams memory internalParams_,
        DelayedProtocolParams memory delayedProtocolParams_,
        IERC20RootVaultHelper helper_
    ) VaultGovernance(internalParams_) {
        require(address(delayedProtocolParams_.oracle) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        require(address(helper_) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        helper = helper_;
        _delayedProtocolParams = abi.encode(delayedProtocolParams_);
    }

    // -------------------  EXTERNAL, VIEW  -------------------

    /// @inheritdoc IERC20RootVaultGovernance
    function delayedProtocolParams() public view returns (DelayedProtocolParams memory) {
        // params are initialized in constructor, so cannot be 0
        return abi.decode(_delayedProtocolParams, (DelayedProtocolParams));
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function stagedDelayedProtocolParams() external view returns (DelayedProtocolParams memory) {
        if (_stagedDelayedProtocolParams.length == 0) {
            return DelayedProtocolParams({managementFeeChargeDelay: 0, oracle: IOracle(address(0))});
        }
        return abi.decode(_stagedDelayedProtocolParams, (DelayedProtocolParams));
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function delayedProtocolPerVaultParams(uint256 nft) external view returns (DelayedProtocolPerVaultParams memory) {
        if (_delayedProtocolPerVaultParams[nft].length == 0) {
            return DelayedProtocolPerVaultParams({protocolFee: 0});
        }
        return abi.decode(_delayedProtocolPerVaultParams[nft], (DelayedProtocolPerVaultParams));
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function stagedDelayedProtocolPerVaultParams(uint256 nft)
        external
        view
        returns (DelayedProtocolPerVaultParams memory)
    {
        if (_stagedDelayedProtocolPerVaultParams[nft].length == 0) {
            return DelayedProtocolPerVaultParams({protocolFee: 0});
        }
        return abi.decode(_stagedDelayedProtocolPerVaultParams[nft], (DelayedProtocolPerVaultParams));
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function stagedDelayedStrategyParams(uint256 nft) external view returns (DelayedStrategyParams memory) {
        if (_stagedDelayedStrategyParams[nft].length == 0) {
            return
                DelayedStrategyParams({
                    strategyTreasury: address(0),
                    strategyPerformanceTreasury: address(0),
                    privateVault: false,
                    managementFee: 0,
                    performanceFee: 0,
                    depositCallbackAddress: address(0),
                    withdrawCallbackAddress: address(0)
                });
        }
        return abi.decode(_stagedDelayedStrategyParams[nft], (DelayedStrategyParams));
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function operatorParams() external view returns (OperatorParams memory) {
        if (_operatorParams.length == 0) {
            return OperatorParams({disableDeposit: false});
        }
        return abi.decode(_operatorParams, (OperatorParams));
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function delayedStrategyParams(uint256 nft) external view returns (DelayedStrategyParams memory) {
        if (_delayedStrategyParams[nft].length == 0) {
            return
                DelayedStrategyParams({
                    strategyTreasury: address(0),
                    strategyPerformanceTreasury: address(0),
                    privateVault: false,
                    managementFee: 0,
                    performanceFee: 0,
                    depositCallbackAddress: address(0),
                    withdrawCallbackAddress: address(0)
                });
        }
        return abi.decode(_delayedStrategyParams[nft], (DelayedStrategyParams));
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function strategyParams(uint256 nft) external view returns (StrategyParams memory) {
        if (_strategyParams[nft].length == 0) {
            return StrategyParams({tokenLimitPerAddress: 0, tokenLimit: 0});
        }
        return abi.decode(_strategyParams[nft], (StrategyParams));
    }

    // @inheritdoc IERC165
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return super.supportsInterface(interfaceId) || type(IERC20RootVaultGovernance).interfaceId == interfaceId;
    }

    // -------------------  EXTERNAL, MUTATING  -------------------

    /// @inheritdoc IERC20RootVaultGovernance
    function stageDelayedStrategyParams(uint256 nft, DelayedStrategyParams calldata params) external {
        require(params.managementFee <= MAX_MANAGEMENT_FEE, ExceptionsLibrary.LIMIT_OVERFLOW);
        require(params.performanceFee <= MAX_PERFORMANCE_FEE, ExceptionsLibrary.LIMIT_OVERFLOW);
        _stageDelayedStrategyParams(nft, abi.encode(params));
        emit StageDelayedStrategyParams(tx.origin, msg.sender, nft, params, _delayedStrategyParamsTimestamp[nft]);
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function commitDelayedStrategyParams(uint256 nft) external {
        _commitDelayedStrategyParams(nft);
        emit CommitDelayedStrategyParams(
            tx.origin,
            msg.sender,
            nft,
            abi.decode(_delayedStrategyParams[nft], (DelayedStrategyParams))
        );
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function stageDelayedProtocolPerVaultParams(uint256 nft, DelayedProtocolPerVaultParams calldata params) external {
        require(params.protocolFee <= MAX_PROTOCOL_FEE, ExceptionsLibrary.LIMIT_OVERFLOW);
        _stageDelayedProtocolPerVaultParams(nft, abi.encode(params));
        emit StageDelayedProtocolPerVaultParams(
            tx.origin,
            msg.sender,
            nft,
            params,
            _delayedStrategyParamsTimestamp[nft]
        );
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function commitDelayedProtocolPerVaultParams(uint256 nft) external {
        _commitDelayedProtocolPerVaultParams(nft);
        emit CommitDelayedProtocolPerVaultParams(
            tx.origin,
            msg.sender,
            nft,
            abi.decode(_delayedProtocolPerVaultParams[nft], (DelayedProtocolPerVaultParams))
        );
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function setStrategyParams(uint256 nft, StrategyParams calldata params) external {
        _setStrategyParams(nft, abi.encode(params));
        emit SetStrategyParams(tx.origin, msg.sender, nft, params);
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function setOperatorParams(OperatorParams calldata params) external {
        _setOperatorParams(abi.encode(params));
        emit SetOperatorParams(tx.origin, msg.sender, params);
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function stageDelayedProtocolParams(DelayedProtocolParams calldata params) external {
        require(address(params.oracle) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        _stageDelayedProtocolParams(abi.encode(params));
        emit StageDelayedProtocolParams(tx.origin, msg.sender, params, _delayedProtocolParamsTimestamp);
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function commitDelayedProtocolParams() external {
        _commitDelayedProtocolParams();
        emit CommitDelayedProtocolParams(
            tx.origin,
            msg.sender,
            abi.decode(_delayedProtocolParams, (DelayedProtocolParams))
        );
    }

    /// @inheritdoc IERC20RootVaultGovernance
    function createVault(
        address[] memory vaultTokens_,
        address strategy_,
        uint256[] memory subvaultNfts_,
        address owner_
    ) external returns (IERC20RootVault vault, uint256 nft) {
        address vaddr;
        IVaultRegistry registry = _internalParams.registry;
        (vaddr, nft) = _createVault(owner_);
        vault = IERC20RootVault(vaddr);
        require(subvaultNfts_.length > 0, ExceptionsLibrary.EMPTY_LIST);
        for (uint256 i = 0; i < subvaultNfts_.length; i++) {
            uint256 subvaultNft = subvaultNfts_[i];
            require(subvaultNft > 0, ExceptionsLibrary.VALUE_ZERO);
            address subvault = registry.vaultForNft(subvaultNft);
            require(subvault != address(0), ExceptionsLibrary.ADDRESS_ZERO);
            require(
                IIntegrationVault(subvault).supportsInterface(type(IIntegrationVault).interfaceId),
                ExceptionsLibrary.INVALID_INTERFACE
            );
            address[] memory subvaultTokens = IIntegrationVault(subvault).vaultTokens();
            if (i == 0) {
                // The zero-vault must have the same tokens as ERC20RootVault
                require(vaultTokens_.length == subvaultTokens.length, ExceptionsLibrary.INVALID_LENGTH);
                require(
                    IERC165(subvault).supportsInterface(type(IERC20Vault).interfaceId),
                    ExceptionsLibrary.INVALID_INTERFACE
                );
            }
            uint256 subvaultTokenId = 0;
            for (
                uint256 tokenId = 0;
                tokenId < vaultTokens_.length && subvaultTokenId < subvaultTokens.length;
                ++tokenId
            ) {
                if (subvaultTokens[subvaultTokenId] == vaultTokens_[tokenId]) {
                    subvaultTokenId++;
                }
            }
            require(subvaultTokenId == subvaultTokens.length, ExceptionsLibrary.INVALID_TOKEN);

            // RootVault is not yet initialized so we cannot use safeTransferFrom here
            registry.transferFrom(msg.sender, vaddr, subvaultNfts_[i]);
        }
        vault.initialize(nft, vaultTokens_, strategy_, subvaultNfts_, helper);
    }

    // -------------------  INTERNAL, VIEW  -------------------

    function _contractName() internal pure override returns (bytes32) {
        return bytes32("ERC20RootVaultGovernance");
    }

    function _contractVersion() internal pure override returns (bytes32) {
        return bytes32("1.0.0");
    }

    // --------------------------  EVENTS  --------------------------

    /// @notice Emitted when new DelayedProtocolPerVaultParams are staged for commit
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param nft VaultRegistry NFT of the vault
    /// @param params New params that were staged for commit
    /// @param when When the params could be committed
    event StageDelayedProtocolPerVaultParams(
        address indexed origin,
        address indexed sender,
        uint256 indexed nft,
        DelayedProtocolPerVaultParams params,
        uint256 when
    );

    /// @notice Emitted when new DelayedProtocolPerVaultParams are committed
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param nft VaultRegistry NFT of the vault
    /// @param params New params that are committed
    event CommitDelayedProtocolPerVaultParams(
        address indexed origin,
        address indexed sender,
        uint256 indexed nft,
        DelayedProtocolPerVaultParams params
    );

    /// @notice Emitted when new DelayedStrategyParams are staged for commit
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param nft VaultRegistry NFT of the vault
    /// @param params New params that were staged for commit
    /// @param when When the params could be committed
    event StageDelayedStrategyParams(
        address indexed origin,
        address indexed sender,
        uint256 indexed nft,
        DelayedStrategyParams params,
        uint256 when
    );

    /// @notice Emitted when new DelayedStrategyParams are committed
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param nft VaultRegistry NFT of the vault
    /// @param params New params that are committed
    event CommitDelayedStrategyParams(
        address indexed origin,
        address indexed sender,
        uint256 indexed nft,
        DelayedStrategyParams params
    );

    /// @notice Emitted when new StrategyParams are set.
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param nft VaultRegistry NFT of the vault
    /// @param params New params that are set
    event SetStrategyParams(address indexed origin, address indexed sender, uint256 indexed nft, StrategyParams params);

    /// @notice Emitted when new OperatorParams are set.
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param params New params that are set
    event SetOperatorParams(address indexed origin, address indexed sender, OperatorParams params);

    /// @notice Emitted when new DelayedProtocolParams are staged for commit
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param params New params that were staged for commit
    /// @param when When the params could be committed
    event StageDelayedProtocolParams(
        address indexed origin,
        address indexed sender,
        DelayedProtocolParams params,
        uint256 when
    );

    /// @notice Emitted when new DelayedProtocolParams are committed
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param params New params that are committed
    event CommitDelayedProtocolParams(address indexed origin, address indexed sender, DelayedProtocolParams params);
}

File 2 of 30 : 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 3 of 30 : IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

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

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

File 4 of 30 : Clones.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/Clones.sol)

pragma solidity ^0.8.0;

/**
 * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
 * deploying minimal proxy contracts, also known as "clones".
 *
 * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
 * > a minimal bytecode implementation that delegates all calls to a known, fixed address.
 *
 * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
 * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
 * deterministic method.
 *
 * _Available since v3.4._
 */
library Clones {
    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create opcode, which should never revert.
     */
    function clone(address implementation) internal returns (address instance) {
        /// @solidity memory-safe-assembly
        assembly {
            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
            // of the `implementation` address with the bytecode before the address.
            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
            instance := create(0, 0x09, 0x37)
        }
        require(instance != address(0), "ERC1167: create failed");
    }

    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create2 opcode and a `salt` to deterministically deploy
     * the clone. Using the same `implementation` and `salt` multiple time will revert, since
     * the clones cannot be deployed twice at the same address.
     */
    function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
        /// @solidity memory-safe-assembly
        assembly {
            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
            // of the `implementation` address with the bytecode before the address.
            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
            instance := create2(0, 0x09, 0x37, salt)
        }
        require(instance != address(0), "ERC1167: create2 failed");
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(
        address implementation,
        bytes32 salt,
        address deployer
    ) internal pure returns (address predicted) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(add(ptr, 0x38), deployer)
            mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
            mstore(add(ptr, 0x14), implementation)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
            mstore(add(ptr, 0x58), salt)
            mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
            predicted := keccak256(add(ptr, 0x43), 0x55)
        }
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(address implementation, bytes32 salt)
        internal
        view
        returns (address predicted)
    {
        return predictDeterministicAddress(implementation, salt, address(this));
    }
}

File 5 of 30 : 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 6 of 30 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 7 of 30 : 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 8 of 30 : 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 9 of 30 : IProtocolGovernance.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./utils/IDefaultAccessControl.sol";
import "./IUnitPricesGovernance.sol";

interface IProtocolGovernance is IDefaultAccessControl, IUnitPricesGovernance {
    /// @notice CommonLibrary protocol params.
    /// @param maxTokensPerVault Max different token addresses that could be managed by the vault
    /// @param governanceDelay The delay (in secs) that must pass before setting new pending params to commiting them
    /// @param protocolTreasury The address that collects protocolFees, if protocolFee is not zero
    /// @param forceAllowMask If a permission bit is set in this mask it forces all addresses to have this permission as true
    /// @param withdrawLimit Withdraw limit (in unit prices, i.e. usd)
    struct Params {
        uint256 maxTokensPerVault;
        uint256 governanceDelay;
        address protocolTreasury;
        uint256 forceAllowMask;
        uint256 withdrawLimit;
    }

    // -------------------  EXTERNAL, VIEW  -------------------

    /// @notice Timestamp after which staged granted permissions for the given address can be committed.
    /// @param target The given address
    /// @return Zero if there are no staged permission grants, timestamp otherwise
    function stagedPermissionGrantsTimestamps(address target) external view returns (uint256);

    /// @notice Staged granted permission bitmask for the given address.
    /// @param target The given address
    /// @return Bitmask
    function stagedPermissionGrantsMasks(address target) external view returns (uint256);

    /// @notice Permission bitmask for the given address.
    /// @param target The given address
    /// @return Bitmask
    function permissionMasks(address target) external view returns (uint256);

    /// @notice Timestamp after which staged pending protocol parameters can be committed
    /// @return Zero if there are no staged parameters, timestamp otherwise.
    function stagedParamsTimestamp() external view returns (uint256);

    /// @notice Staged pending protocol parameters.
    function stagedParams() external view returns (Params memory);

    /// @notice Current protocol parameters.
    function params() external view returns (Params memory);

    /// @notice Addresses for which non-zero permissions are set.
    function permissionAddresses() external view returns (address[] memory);

    /// @notice Permission addresses staged for commit.
    function stagedPermissionGrantsAddresses() external view returns (address[] memory);

    /// @notice Return all addresses where rawPermissionMask bit for permissionId is set to 1.
    /// @param permissionId Id of the permission to check.
    /// @return A list of dirty addresses.
    function addressesByPermission(uint8 permissionId) external view returns (address[] memory);

    /// @notice Checks if address has permission or given permission is force allowed for any address.
    /// @param addr Address to check
    /// @param permissionId Permission to check
    function hasPermission(address addr, uint8 permissionId) external view returns (bool);

    /// @notice Checks if address has all permissions.
    /// @param target Address to check
    /// @param permissionIds A list of permissions to check
    function hasAllPermissions(address target, uint8[] calldata permissionIds) external view returns (bool);

    /// @notice Max different ERC20 token addresses that could be managed by the protocol.
    function maxTokensPerVault() external view returns (uint256);

    /// @notice The delay for committing any governance params.
    function governanceDelay() external view returns (uint256);

    /// @notice The address of the protocol treasury.
    function protocolTreasury() external view returns (address);

    /// @notice Permissions mask which defines if ordinary permission should be reverted.
    /// This bitmask is xored with ordinary mask.
    function forceAllowMask() external view returns (uint256);

    /// @notice Withdraw limit per token per block.
    /// @param token Address of the token
    /// @return Withdraw limit per token per block
    function withdrawLimit(address token) external view returns (uint256);

    /// @notice Addresses that has staged validators.
    function stagedValidatorsAddresses() external view returns (address[] memory);

    /// @notice Timestamp after which staged granted permissions for the given address can be committed.
    /// @param target The given address
    /// @return Zero if there are no staged permission grants, timestamp otherwise
    function stagedValidatorsTimestamps(address target) external view returns (uint256);

    /// @notice Staged validator for the given address.
    /// @param target The given address
    /// @return Validator
    function stagedValidators(address target) external view returns (address);

    /// @notice Addresses that has validators.
    function validatorsAddresses() external view returns (address[] memory);

    /// @notice Address that has validators.
    /// @param i The number of address
    /// @return Validator address
    function validatorsAddress(uint256 i) external view returns (address);

    /// @notice Validator for the given address.
    /// @param target The given address
    /// @return Validator
    function validators(address target) external view returns (address);

    // -------------------  EXTERNAL, MUTATING, GOVERNANCE, IMMEDIATE  -------------------

    /// @notice Rollback all staged validators.
    function rollbackStagedValidators() external;

    /// @notice Revoke validator instantly from the given address.
    /// @param target The given address
    function revokeValidator(address target) external;

    /// @notice Stages a new validator for the given address
    /// @param target The given address
    /// @param validator The validator for the given address
    function stageValidator(address target, address validator) external;

    /// @notice Commits validator for the given address.
    /// @dev Reverts if governance delay has not passed yet.
    /// @param target The given address.
    function commitValidator(address target) external;

    /// @notice Commites all staged validators for which governance delay passed
    /// @return Addresses for which validators were committed
    function commitAllValidatorsSurpassedDelay() external returns (address[] memory);

    /// @notice Rollback all staged granted permission grant.
    function rollbackStagedPermissionGrants() external;

    /// @notice Commits permission grants for the given address.
    /// @dev Reverts if governance delay has not passed yet.
    /// @param target The given address.
    function commitPermissionGrants(address target) external;

    /// @notice Commites all staged permission grants for which governance delay passed.
    /// @return An array of addresses for which permission grants were committed.
    function commitAllPermissionGrantsSurpassedDelay() external returns (address[] memory);

    /// @notice Revoke permission instantly from the given address.
    /// @param target The given address.
    /// @param permissionIds A list of permission ids to revoke.
    function revokePermissions(address target, uint8[] memory permissionIds) external;

    /// @notice Commits staged protocol params.
    /// Reverts if governance delay has not passed yet.
    function commitParams() external;

    // -------------------  EXTERNAL, MUTATING, GOVERNANCE, DELAY  -------------------

    /// @notice Sets new pending params that could have been committed after governance delay expires.
    /// @param newParams New protocol parameters to set.
    function stageParams(Params memory newParams) external;

    /// @notice Stage granted permissions that could have been committed after governance delay expires.
    /// Resets commit delay and permissions if there are already staged permissions for this address.
    /// @param target Target address
    /// @param permissionIds A list of permission ids to grant
    function stagePermissionGrants(address target, uint8[] memory permissionIds) external;
}

File 10 of 30 : IUnitPricesGovernance.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "./utils/IDefaultAccessControl.sol";

interface IUnitPricesGovernance is IDefaultAccessControl, IERC165 {
    // -------------------  EXTERNAL, VIEW  -------------------

    /// @notice Estimated amount of token worth 1 USD staged for commit.
    /// @param token Address of the token
    /// @return The amount of token
    function stagedUnitPrices(address token) external view returns (uint256);

    /// @notice Timestamp after which staged unit prices for the given token can be committed.
    /// @param token Address of the token
    /// @return Timestamp
    function stagedUnitPricesTimestamps(address token) external view returns (uint256);

    /// @notice Estimated amount of token worth 1 USD.
    /// @param token Address of the token
    /// @return The amount of token
    function unitPrices(address token) external view returns (uint256);

    // -------------------  EXTERNAL, MUTATING  -------------------

    /// @notice Stage estimated amount of token worth 1 USD staged for commit.
    /// @param token Address of the token
    /// @param value The amount of token
    function stageUnitPrice(address token, uint256 value) external;

    /// @notice Reset staged value
    /// @param token Address of the token
    function rollbackUnitPrice(address token) external;

    /// @notice Commit staged unit price
    /// @param token Address of the token
    function commitUnitPrice(address token) external;
}

File 11 of 30 : IVaultRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.9;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./IProtocolGovernance.sol";

interface IVaultRegistry is IERC721 {
    /// @notice Get Vault for the giver NFT ID.
    /// @param nftId NFT ID
    /// @return vault Address of the Vault contract
    function vaultForNft(uint256 nftId) external view returns (address vault);

    /// @notice Get NFT ID for given Vault contract address.
    /// @param vault Address of the Vault contract
    /// @return nftId NFT ID
    function nftForVault(address vault) external view returns (uint256 nftId);

    /// @notice Checks if the nft is locked for all transfers
    /// @param nft NFT to check for lock
    /// @return `true` if locked, false otherwise
    function isLocked(uint256 nft) external view returns (bool);

    /// @notice Register new Vault and mint NFT.
    /// @param vault address of the vault
    /// @param owner owner of the NFT
    /// @return nft Nft minted for the given Vault
    function registerVault(address vault, address owner) external returns (uint256 nft);

    /// @notice Number of Vaults registered.
    function vaultsCount() external view returns (uint256);

    /// @notice All Vaults registered.
    function vaults() external view returns (address[] memory);

    /// @notice Address of the ProtocolGovernance.
    function protocolGovernance() external view returns (IProtocolGovernance);

    /// @notice Address of the staged ProtocolGovernance.
    function stagedProtocolGovernance() external view returns (IProtocolGovernance);

    /// @notice Minimal timestamp when staged ProtocolGovernance can be applied.
    function stagedProtocolGovernanceTimestamp() external view returns (uint256);

    /// @notice Stage new ProtocolGovernance.
    /// @param newProtocolGovernance new ProtocolGovernance
    function stageProtocolGovernance(IProtocolGovernance newProtocolGovernance) external;

    /// @notice Commit new ProtocolGovernance.
    function commitStagedProtocolGovernance() external;

    /// @notice Lock NFT for transfers
    /// @dev Use this method when vault structure is set up and should become immutable. Can be called by owner.
    /// @param nft - NFT to lock
    function lockNft(uint256 nft) external;
}

File 12 of 30 : IERC1271.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IERC1271 {
    /// @notice Verifies offchain signature.
    /// @dev Should return whether the signature provided is valid for the provided hash
    ///
    /// MUST return the bytes4 magic value 0x1626ba7e when function passes.
    ///
    /// MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)
    ///
    /// MUST allow external calls
    /// @param _hash Hash of the data to be signed
    /// @param _signature Signature byte array associated with _hash
    /// @return magicValue 0x1626ba7e if valid, 0xffffffff otherwise
    function isValidSignature(bytes32 _hash, bytes memory _signature) external view returns (bytes4 magicValue);
}

File 13 of 30 : IOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IOracle {
    /// @notice Oracle price for tokens as a Q64.96 value.
    /// @notice Returns pricing information based on the indexes of non-zero bits in safetyIndicesSet.
    /// @notice It is possible that not all indices will have their respective prices returned.
    /// @dev The price is token1 / token0 i.e. how many weis of token1 required for 1 wei of token0.
    /// The safety indexes are:
    ///
    /// 1 - unsafe, this is typically a spot price that can be easily manipulated,
    ///
    /// 2 - 4 - more or less safe, this is typically a uniV3 oracle, where the safety is defined by the timespan of the average price
    ///
    /// 5 - safe - this is typically a chailink oracle
    /// @param token0 Reference to token0
    /// @param token1 Reference to token1
    /// @param safetyIndicesSet Bitmask of safety indices that are allowed for the return prices. For set of safety indexes = { 1 }, safetyIndicesSet = 0x2
    /// @return pricesX96 Prices that satisfy safetyIndex and tokens
    /// @return safetyIndices Safety indices for those prices
    function priceX96(
        address token0,
        address token1,
        uint256 safetyIndicesSet
    ) external view returns (uint256[] memory pricesX96, uint256[] memory safetyIndices);
}

File 14 of 30 : IContractMeta.sol
// SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;

interface IContractMeta {
    function contractName() external view returns (string memory);
    function contractNameBytes() external view returns (bytes32);

    function contractVersion() external view returns (string memory);
    function contractVersionBytes() external view returns (bytes32);
}

File 15 of 30 : IDefaultAccessControl.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts/access/IAccessControlEnumerable.sol";

interface IDefaultAccessControl is IAccessControlEnumerable {
    /// @notice Checks that the address is contract admin.
    /// @param who Address to check
    /// @return `true` if who is admin, `false` otherwise
    function isAdmin(address who) external view returns (bool);

    /// @notice Checks that the address is contract admin.
    /// @param who Address to check
    /// @return `true` if who is operator, `false` otherwise
    function isOperator(address who) external view returns (bool);
}

File 16 of 30 : IERC20RootVaultHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../oracles/IOracle.sol";

interface IERC20RootVaultHelper {
    function getTvlToken0(
        uint256[] calldata tvls,
        address[] calldata tokens,
        IOracle oracle
    ) external view returns (uint256 tvl0);
}

File 17 of 30 : IAggregateVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./IVault.sol";
import "./IVaultRoot.sol";

interface IAggregateVault is IVault, IVaultRoot {}

File 18 of 30 : IERC20RootVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

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

interface IERC20RootVault is IAggregateVault, IERC20 {
    /// @notice Initialized a new contract.
    /// @dev Can only be initialized by vault governance
    /// @param nft_ NFT of the vault in the VaultRegistry
    /// @param vaultTokens_ ERC20 tokens that will be managed by this Vault
    /// @param strategy_ The address that will have approvals for subvaultNfts
    /// @param subvaultNfts_ The NFTs of the subvaults that will be aggregated by this ERC20RootVault
    function initialize(
        uint256 nft_,
        address[] memory vaultTokens_,
        address strategy_,
        uint256[] memory subvaultNfts_,
        IERC20RootVaultHelper helper_
    ) external;

    /// @notice The timestamp of last charging of fees
    function lastFeeCharge() external view returns (uint64);

    /// @notice The timestamp of last updating totalWithdrawnAmounts array
    function totalWithdrawnAmountsTimestamp() external view returns (uint64);

    /// @notice Returns value from totalWithdrawnAmounts array by _index
    /// @param _index The index at which the value will be returned
    function totalWithdrawnAmounts(uint256 _index) external view returns (uint256);

    /// @notice LP parameter that controls the charge in performance fees
    function lpPriceHighWaterMarkD18() external view returns (uint256);

    /// @notice List of addresses of depositors from which interaction with private vaults is allowed
    function depositorsAllowlist() external view returns (address[] memory);

    /// @notice Add new depositors in the depositorsAllowlist
    /// @param depositors Array of new depositors
    /// @dev The action can be done only by user with admins, owners or by approved rights
    function addDepositorsToAllowlist(address[] calldata depositors) external;

    /// @notice Remove depositors from the depositorsAllowlist
    /// @param depositors Array of depositors for remove
    /// @dev The action can be done only by user with admins, owners or by approved rights
    function removeDepositorsFromAllowlist(address[] calldata depositors) external;

    /// @notice The function of depositing the amount of tokens in exchange
    /// @param tokenAmounts Array of amounts of tokens for deposit
    /// @param minLpTokens Minimal value of LP tokens
    /// @param vaultOptions Options of vaults
    /// @return actualTokenAmounts Arrays of actual token amounts after deposit
    function deposit(
        uint256[] memory tokenAmounts,
        uint256 minLpTokens,
        bytes memory vaultOptions
    ) external returns (uint256[] memory actualTokenAmounts);

    /// @notice The function of withdrawing the amount of tokens in exchange
    /// @param to Address to which the withdrawal will be sent
    /// @param lpTokenAmount LP token amount, that requested for withdraw
    /// @param minTokenAmounts Array of minmal remining wtoken amounts after withdrawal
    /// @param vaultsOptions Options of vaults
    /// @return actualTokenAmounts Arrays of actual token amounts after withdrawal
    function withdraw(
        address to,
        uint256 lpTokenAmount,
        uint256[] memory minTokenAmounts,
        bytes[] memory vaultsOptions
    ) external returns (uint256[] memory actualTokenAmounts);
}

File 19 of 30 : IERC20RootVaultGovernance.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../oracles/IOracle.sol";
import "./IERC20RootVault.sol";
import "./IVaultGovernance.sol";
import "../utils/IERC20RootVaultHelper.sol";

interface IERC20RootVaultGovernance is IVaultGovernance {
    /// @notice Params that could be changed by Strategy or Protocol Governance with Protocol Governance delay.
    /// @param strategyTreasury Reference to address that will collect strategy management fees
    /// @param strategyPerformanceTreasury Reference to address that will collect strategy performance fees
    /// @param privateVault If true, only whitlisted depositors can deposit into the vault
    /// @param managementFee Management fee for Strategist denominated in 10 ** 9
    /// @param performanceFee Performance fee for Strategist denominated in 10 ** 9
    /// @param depositCallbackAddress Address of callback function after deposit
    /// @param withdrawCallbackAddress Address of callback function after withdraw
    struct DelayedStrategyParams {
        address strategyTreasury;
        address strategyPerformanceTreasury;
        bool privateVault;
        uint256 managementFee;
        uint256 performanceFee;
        address depositCallbackAddress;
        address withdrawCallbackAddress;
    }

    /// @notice Params that could be changed by Protocol Governance with Protocol Governance delay.
    /// @param managementFeeChargeDelay The minimal interval between management fee charges
    /// @param oracle Oracle for getting token prices
    struct DelayedProtocolParams {
        uint256 managementFeeChargeDelay;
        IOracle oracle;
    }

    /// @notice Params that could be changed by Strategy or Protocol Governance.
    /// @param tokenLimitPerAddress Max LP token limit per address
    /// @param tokenLimit Max LP token for the vault
    struct StrategyParams {
        uint256 tokenLimitPerAddress;
        uint256 tokenLimit;
    }

    /// @notice Params that could be changed by Protocol Governance with Protocol Governance delay.
    /// @param protocolFee Management fee for Protocol denominated in 10 ** 9
    struct DelayedProtocolPerVaultParams {
        uint256 protocolFee;
    }

    /// @notice Params that could be changed by Operator role of Protocol Governance.
    /// @param disableDeposit Disable deposit for all ERC20 vaults
    struct OperatorParams {
        bool disableDeposit;
    }

    /// @notice Number of maximum protocol fee
    function MAX_PROTOCOL_FEE() external view returns (uint256);

    /// @notice Number of maximum management fee
    function MAX_MANAGEMENT_FEE() external view returns (uint256);

    /// @notice Number of maximum performance fee
    function MAX_PERFORMANCE_FEE() external view returns (uint256);

    /// @notice Delayed Protocol Params, i.e. Params that could be changed by Protocol Governance with Protocol Governance delay.
    function delayedProtocolParams() external view returns (DelayedProtocolParams memory);

    /// @notice Delayed Protocol Params staged for commit after delay.
    function stagedDelayedProtocolParams() external view returns (DelayedProtocolParams memory);

    /// @notice Delayed Protocol Per Vault Params, i.e. Params that could be changed by Protocol Governance with Protocol Governance delay.
    /// @param nft VaultRegistry NFT of the vault
    function delayedProtocolPerVaultParams(uint256 nft) external view returns (DelayedProtocolPerVaultParams memory);

    /// @notice Delayed Protocol Per Vault Params staged for commit after delay.
    /// @param nft VaultRegistry NFT of the vault
    function stagedDelayedProtocolPerVaultParams(uint256 nft)
        external
        view
        returns (DelayedProtocolPerVaultParams memory);

    /// @notice Strategy Params.
    /// @param nft VaultRegistry NFT of the vault
    function strategyParams(uint256 nft) external view returns (StrategyParams memory);

    /// @notice Operator Params.
    function operatorParams() external view returns (OperatorParams memory);

    /// @notice Delayed Strategy Params
    /// @param nft VaultRegistry NFT of the vault
    function delayedStrategyParams(uint256 nft) external view returns (DelayedStrategyParams memory);

    /// @notice Delayed Strategy Params staged for commit after delay.
    /// @param nft VaultRegistry NFT of the vault
    function stagedDelayedStrategyParams(uint256 nft) external view returns (DelayedStrategyParams memory);

    /// @notice Set Strategy params, i.e. Params that could be changed by Strategy or Protocol Governance immediately.
    /// @param nft Nft of the vault
    /// @param params New params
    function setStrategyParams(uint256 nft, StrategyParams calldata params) external;

    /// @notice Set Operator params, i.e. Params that could be changed by Operator or Protocol Governance immediately.
    /// @param params New params
    function setOperatorParams(OperatorParams calldata params) external;

    /// @notice Stage Delayed Protocol Per Vault Params, i.e. Params that could be changed by Protocol Governance with Protocol Governance delay.
    /// @param nft VaultRegistry NFT of the vault
    /// @param params New params
    function stageDelayedProtocolPerVaultParams(uint256 nft, DelayedProtocolPerVaultParams calldata params) external;

    /// @notice Commit Delayed Protocol Per Vault Params, i.e. Params that could be changed by Protocol Governance with Protocol Governance delay.
    /// @dev Can only be called after delayedProtocolPerVaultParamsTimestamp
    /// @param nft VaultRegistry NFT of the vault
    function commitDelayedProtocolPerVaultParams(uint256 nft) external;

    /// @notice Stage Delayed Strategy Params, i.e. Params that could be changed by Strategy or Protocol Governance with Protocol Governance delay.
    /// @param nft VaultRegistry NFT of the vault
    /// @param params New params
    function stageDelayedStrategyParams(uint256 nft, DelayedStrategyParams calldata params) external;

    /// @notice Commit Delayed Strategy Params, i.e. Params that could be changed by Strategy or Protocol Governance with Protocol Governance delay.
    /// @dev Can only be called after delayedStrategyParamsTimestamp
    /// @param nft VaultRegistry NFT of the vault
    function commitDelayedStrategyParams(uint256 nft) external;

    /// @notice Stage Delayed Protocol Params, i.e. Params that could be changed by Protocol Governance with Protocol Governance delay.
    /// @dev Can only be called after delayedProtocolParamsTimestamp.
    /// @param params New params
    function stageDelayedProtocolParams(DelayedProtocolParams calldata params) external;

    /// @notice Commit Delayed Protocol Params, i.e. Params that could be changed by Protocol Governance with Protocol Governance delay.
    function commitDelayedProtocolParams() external;

    /// @notice Deploys a new vault.
    /// @param vaultTokens_ ERC20 tokens that will be managed by this Vault
    /// @param strategy_ The address that will have approvals for subvaultNfts
    /// @param subvaultNfts_ The NFTs of the subvaults that will be aggregated by this ERC20RootVault
    /// @param owner_ Owner of the vault NFT
    function createVault(
        address[] memory vaultTokens_,
        address strategy_,
        uint256[] memory subvaultNfts_,
        address owner_
    ) external returns (IERC20RootVault vault, uint256 nft);
}

File 20 of 30 : IERC20Vault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./IIntegrationVault.sol";

interface IERC20Vault is IIntegrationVault {
    /// @notice Initialized a new contract.
    /// @dev Can only be initialized by vault governance
    /// @param nft_ NFT of the vault in the VaultRegistry
    /// @param vaultTokens_ ERC20 tokens that will be managed by this Vault
    function initialize(uint256 nft_, address[] memory vaultTokens_) external;
}

File 21 of 30 : IIntegrationVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../external/erc/IERC1271.sol";
import "./IVault.sol";

interface IIntegrationVault is IVault, IERC1271 {
    /// @notice Pushes tokens on the vault balance to the underlying protocol. For example, for Yearn this operation will take USDC from
    /// the contract balance and convert it to yUSDC.
    /// @dev Tokens **must** be a subset of Vault Tokens. However, the convention is that if tokenAmount == 0 it is the same as token is missing.
    ///
    /// Also notice that this operation doesn't guarantee that tokenAmounts will be invested in full.
    /// @param tokens Tokens to push
    /// @param tokenAmounts Amounts of tokens to push
    /// @param options Additional options that could be needed for some vaults. E.g. for Uniswap this could be `deadline` param. For the exact bytes structure see concrete vault descriptions
    /// @return actualTokenAmounts The amounts actually invested. It could be less than tokenAmounts (but not higher)
    function push(
        address[] memory tokens,
        uint256[] memory tokenAmounts,
        bytes memory options
    ) external returns (uint256[] memory actualTokenAmounts);

    /// @notice The same as `push` method above but transfers tokens to vault balance prior to calling push.
    /// After the `push` it returns all the leftover tokens back (`push` method doesn't guarantee that tokenAmounts will be invested in full).
    /// @param tokens Tokens to push
    /// @param tokenAmounts Amounts of tokens to push
    /// @param options Additional options that could be needed for some vaults. E.g. for Uniswap this could be `deadline` param. For the exact bytes structure see concrete vault descriptions
    /// @return actualTokenAmounts The amounts actually invested. It could be less than tokenAmounts (but not higher)
    function transferAndPush(
        address from,
        address[] memory tokens,
        uint256[] memory tokenAmounts,
        bytes memory options
    ) external returns (uint256[] memory actualTokenAmounts);

    /// @notice Pulls tokens from the underlying protocol to the `to` address.
    /// @dev Can only be called but Vault Owner or Strategy. Vault owner is the owner of NFT for this vault in VaultManager.
    /// Strategy is approved address for the vault NFT.
    /// When called by vault owner this method just pulls the tokens from the protocol to the `to` address
    /// When called by strategy on vault other than zero vault it pulls the tokens to zero vault (required `to` == zero vault)
    /// When called by strategy on zero vault it pulls the tokens to zero vault, pushes tokens on the `to` vault, and reclaims everything that's left.
    /// Thus any vault other than zero vault cannot have any tokens on it
    ///
    /// Tokens **must** be a subset of Vault Tokens. However, the convention is that if tokenAmount == 0 it is the same as token is missing.
    ///
    /// Pull is fulfilled on the best effort basis, i.e. if the tokenAmounts overflows available funds it withdraws all the funds.
    /// @param to Address to receive the tokens
    /// @param tokens Tokens to pull
    /// @param tokenAmounts Amounts of tokens to pull
    /// @param options Additional options that could be needed for some vaults. E.g. for Uniswap this could be `deadline` param. For the exact bytes structure see concrete vault descriptions
    /// @return actualTokenAmounts The amounts actually withdrawn. It could be less than tokenAmounts (but not higher)
    function pull(
        address to,
        address[] memory tokens,
        uint256[] memory tokenAmounts,
        bytes memory options
    ) external returns (uint256[] memory actualTokenAmounts);

    /// @notice Claim ERC20 tokens from vault balance to zero vault.
    /// @dev Cannot be called from zero vault.
    /// @param tokens Tokens to claim
    /// @return actualTokenAmounts Amounts reclaimed
    function reclaimTokens(address[] memory tokens) external returns (uint256[] memory actualTokenAmounts);

    /// @notice Execute one of whitelisted calls.
    /// @dev Can only be called by Vault Owner or Strategy. Vault owner is the owner of NFT for this vault in VaultManager.
    /// Strategy is approved address for the vault NFT.
    ///
    /// Since this method allows sending arbitrary transactions, the destinations of the calls
    /// are whitelisted by Protocol Governance.
    /// @param to Address of the reward pool
    /// @param selector Selector of the call
    /// @param data Abi encoded parameters to `to::selector`
    /// @return result Result of execution of the call
    function externalCall(
        address to,
        bytes4 selector,
        bytes memory data
    ) external payable returns (bytes memory result);
}

File 22 of 30 : IVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./IVaultGovernance.sol";

interface IVault is IERC165 {
    /// @notice Checks if the vault is initialized

    function initialized() external view returns (bool);

    /// @notice VaultRegistry NFT for this vault
    function nft() external view returns (uint256);

    /// @notice Address of the Vault Governance for this contract.
    function vaultGovernance() external view returns (IVaultGovernance);

    /// @notice ERC20 tokens under Vault management.
    function vaultTokens() external view returns (address[] memory);

    /// @notice Checks if a token is vault token
    /// @param token Address of the token to check
    /// @return `true` if this token is managed by Vault
    function isVaultToken(address token) external view returns (bool);

    /// @notice Total value locked for this contract.
    /// @dev Generally it is the underlying token value of this contract in some
    /// other DeFi protocol. For example, for USDC Yearn Vault this would be total USDC balance that could be withdrawn for Yearn to this contract.
    /// The tvl itself is estimated in some range. Sometimes the range is exact, sometimes it's not
    /// @return minTokenAmounts Lower bound for total available balances estimation (nth tokenAmount corresponds to nth token in vaultTokens)
    /// @return maxTokenAmounts Upper bound for total available balances estimation (nth tokenAmount corresponds to nth token in vaultTokens)
    function tvl() external view returns (uint256[] memory minTokenAmounts, uint256[] memory maxTokenAmounts);

    /// @notice Existential amounts for each token
    function pullExistentials() external view returns (uint256[] memory);
}

File 23 of 30 : IVaultGovernance.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../IProtocolGovernance.sol";
import "../IVaultRegistry.sol";
import "./IVault.sol";

interface IVaultGovernance {
    /// @notice Internal references of the contract.
    /// @param protocolGovernance Reference to Protocol Governance
    /// @param registry Reference to Vault Registry
    struct InternalParams {
        IProtocolGovernance protocolGovernance;
        IVaultRegistry registry;
        IVault singleton;
    }

    // -------------------  EXTERNAL, VIEW  -------------------

    /// @notice Timestamp in unix time seconds after which staged Delayed Strategy Params could be committed.
    /// @param nft Nft of the vault
    function delayedStrategyParamsTimestamp(uint256 nft) external view returns (uint256);

    /// @notice Timestamp in unix time seconds after which staged Delayed Protocol Params could be committed.
    function delayedProtocolParamsTimestamp() external view returns (uint256);

    /// @notice Timestamp in unix time seconds after which staged Delayed Protocol Params Per Vault could be committed.
    /// @param nft Nft of the vault
    function delayedProtocolPerVaultParamsTimestamp(uint256 nft) external view returns (uint256);

    /// @notice Timestamp in unix time seconds after which staged Internal Params could be committed.
    function internalParamsTimestamp() external view returns (uint256);

    /// @notice Internal Params of the contract.
    function internalParams() external view returns (InternalParams memory);

    /// @notice Staged new Internal Params.
    /// @dev The Internal Params could be committed after internalParamsTimestamp
    function stagedInternalParams() external view returns (InternalParams memory);

    // -------------------  EXTERNAL, MUTATING  -------------------

    /// @notice Stage new Internal Params.
    /// @param newParams New Internal Params
    function stageInternalParams(InternalParams memory newParams) external;

    /// @notice Commit staged Internal Params.
    function commitInternalParams() external;
}

File 24 of 30 : IVaultRoot.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IVaultRoot {
    /// @notice Checks if subvault is present
    /// @param nft_ index of subvault for check
    /// @return `true` if subvault present, `false` otherwise
    function hasSubvault(uint256 nft_) external view returns (bool);

    /// @notice Get subvault by index
    /// @param index Index of subvault
    /// @return address Address of the contract
    function subvaultAt(uint256 index) external view returns (address);

    /// @notice Get index of subvault by nft
    /// @param nft_ Nft for getting subvault
    /// @return index Index of subvault
    function subvaultOneBasedIndex(uint256 nft_) external view returns (uint256);

    /// @notice Get all subvalutNfts in the current Vault
    /// @return subvaultNfts Subvaults of NTFs
    function subvaultNfts() external view returns (uint256[] memory);
}

File 25 of 30 : CommonLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./external/FullMath.sol";
import "./ExceptionsLibrary.sol";

/// @notice CommonLibrary shared utilities
library CommonLibrary {
    uint256 constant DENOMINATOR = 10**9;
    uint256 constant D18 = 10**18;
    uint256 constant YEAR = 365 * 24 * 3600;
    uint256 constant Q128 = 2**128;
    uint256 constant Q96 = 2**96;
    uint256 constant Q48 = 2**48;
    uint256 constant Q160 = 2**160;
    uint256 constant UNI_FEE_DENOMINATOR = 10**6;

    /// @notice Sort uint256 using bubble sort. The sorting is done in-place.
    /// @param arr Array of uint256
    function sortUint(uint256[] memory arr) internal pure {
        uint256 l = arr.length;
        for (uint256 i = 0; i < l; ++i) {
            for (uint256 j = i + 1; j < l; ++j) {
                if (arr[i] > arr[j]) {
                    uint256 temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }
    }

    /// @notice Checks if array of addresses is sorted and all adresses are unique
    /// @param tokens A set of addresses to check
    /// @return `true` if all addresses are sorted and unique, `false` otherwise
    function isSortedAndUnique(address[] memory tokens) internal pure returns (bool) {
        if (tokens.length < 2) {
            return true;
        }
        for (uint256 i = 0; i < tokens.length - 1; ++i) {
            if (tokens[i] >= tokens[i + 1]) {
                return false;
            }
        }
        return true;
    }

    /// @notice Projects tokenAmounts onto subset or superset of tokens
    /// @dev
    /// Requires both sets of tokens to be sorted. When tokens are not sorted, it's undefined behavior.
    /// If there is a token in tokensToProject that is not part of tokens and corresponding tokenAmountsToProject > 0, reverts.
    /// Zero token amount is eqiuvalent to missing token
    function projectTokenAmounts(
        address[] memory tokens,
        address[] memory tokensToProject,
        uint256[] memory tokenAmountsToProject
    ) internal pure returns (uint256[] memory) {
        uint256[] memory res = new uint256[](tokens.length);
        uint256 t = 0;
        uint256 tp = 0;
        while ((t < tokens.length) && (tp < tokensToProject.length)) {
            if (tokens[t] < tokensToProject[tp]) {
                res[t] = 0;
                t++;
            } else if (tokens[t] > tokensToProject[tp]) {
                if (tokenAmountsToProject[tp] == 0) {
                    tp++;
                } else {
                    revert("TPS");
                }
            } else {
                res[t] = tokenAmountsToProject[tp];
                t++;
                tp++;
            }
        }
        while (t < tokens.length) {
            res[t] = 0;
            t++;
        }
        return res;
    }

    /// @notice Calculated sqrt of uint in X96 format
    /// @param xX96 input number in X96 format
    /// @return sqrt of xX96 in X96 format
    function sqrtX96(uint256 xX96) internal pure returns (uint256) {
        uint256 sqX96 = sqrt(xX96);
        return sqX96 << 48;
    }

    /// @notice Calculated sqrt of uint
    /// @param x input number
    /// @return sqrt of x
    function sqrt(uint256 x) internal pure returns (uint256) {
        if (x == 0) return 0;
        uint256 xx = x;
        uint256 r = 1;
        if (xx >= 0x100000000000000000000000000000000) {
            xx >>= 128;
            r <<= 64;
        }
        if (xx >= 0x10000000000000000) {
            xx >>= 64;
            r <<= 32;
        }
        if (xx >= 0x100000000) {
            xx >>= 32;
            r <<= 16;
        }
        if (xx >= 0x10000) {
            xx >>= 16;
            r <<= 8;
        }
        if (xx >= 0x100) {
            xx >>= 8;
            r <<= 4;
        }
        if (xx >= 0x10) {
            xx >>= 4;
            r <<= 2;
        }
        if (xx >= 0x8) {
            r <<= 1;
        }
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        r = (r + x / r) >> 1;
        uint256 r1 = x / r;
        return (r < r1 ? r : r1);
    }

    /// @notice Recovers signer address from signed message hash
    /// @param _ethSignedMessageHash signed message
    /// @param _signature contatenated ECDSA r, s, v (65 bytes)
    /// @return Recovered address if the signature is valid, address(0) otherwise
    function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) internal pure returns (address) {
        (bytes32 r, bytes32 s, uint8 v) = splitSignature(_signature);

        return ecrecover(_ethSignedMessageHash, v, r, s);
    }

    /// @notice Get ECDSA r, s, v from signature
    /// @param sig signature (65 bytes)
    /// @return r ECDSA r
    /// @return s ECDSA s
    /// @return v ECDSA v
    function splitSignature(bytes memory sig)
        internal
        pure
        returns (
            bytes32 r,
            bytes32 s,
            uint8 v
        )
    {
        require(sig.length == 65, ExceptionsLibrary.INVALID_LENGTH);

        assembly {
            r := mload(add(sig, 32))
            s := mload(add(sig, 64))
            v := byte(0, mload(add(sig, 96)))
        }
    }
}

File 26 of 30 : ExceptionsLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/// @notice Exceptions stores project`s smart-contracts exceptions
library ExceptionsLibrary {
    string constant ADDRESS_ZERO = "AZ";
    string constant VALUE_ZERO = "VZ";
    string constant EMPTY_LIST = "EMPL";
    string constant NOT_FOUND = "NF";
    string constant INIT = "INIT";
    string constant DUPLICATE = "DUP";
    string constant NULL = "NULL";
    string constant TIMESTAMP = "TS";
    string constant FORBIDDEN = "FRB";
    string constant ALLOWLIST = "ALL";
    string constant LIMIT_OVERFLOW = "LIMO";
    string constant LIMIT_UNDERFLOW = "LIMU";
    string constant INVALID_VALUE = "INV";
    string constant INVARIANT = "INVA";
    string constant INVALID_TARGET = "INVTR";
    string constant INVALID_TOKEN = "INVTO";
    string constant INVALID_INTERFACE = "INVI";
    string constant INVALID_SELECTOR = "INVS";
    string constant INVALID_STATE = "INVST";
    string constant INVALID_LENGTH = "INVL";
    string constant LOCK = "LCKD";
    string constant DISABLED = "DIS";
}

File 27 of 30 : PermissionIdsLibrary.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/// @notice Stores permission ids for addresses
library PermissionIdsLibrary {
    // The msg.sender is allowed to register vault
    uint8 constant REGISTER_VAULT = 0;
    // The msg.sender is allowed to create vaults
    uint8 constant CREATE_VAULT = 1;
    // The token is allowed to be transfered by vault
    uint8 constant ERC20_TRANSFER = 2;
    // The token is allowed to be added to vault
    uint8 constant ERC20_VAULT_TOKEN = 3;
    // Trusted protocols that are allowed to be approved of vault ERC20 tokens by any strategy
    uint8 constant ERC20_APPROVE = 4;
    // Trusted protocols that are allowed to be approved of vault ERC20 tokens by trusted strategy
    uint8 constant ERC20_APPROVE_RESTRICTED = 5;
    // Strategy allowed using restricted API
    uint8 constant TRUSTED_STRATEGY = 6;
}

File 28 of 30 : FullMath.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.9;

/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
library FullMath {
    /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
    function mulDiv(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        // diff: original lib works under 0.7.6 with overflows enabled
        unchecked {
            // 512-bit multiply [prod1 prod0] = a * b
            // Compute the product mod 2**256 and mod 2**256 - 1
            // then use the Chinese Remainder Theorem to reconstruct
            // the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2**256 + prod0
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(a, b, not(0))
                prod0 := mul(a, b)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division
            if (prod1 == 0) {
                require(denominator > 0);
                assembly {
                    result := div(prod0, denominator)
                }
                return result;
            }

            // Make sure the result is less than 2**256.
            // Also prevents denominator == 0
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0]
            // Compute remainder using mulmod
            uint256 remainder;
            assembly {
                remainder := mulmod(a, b, denominator)
            }
            // Subtract 256 bit number from 512 bit number
            assembly {
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator
            // Compute largest power of two divisor of denominator.
            // Always >= 1.
            // diff: original uint256 twos = -denominator & denominator;
            uint256 twos = uint256(-int256(denominator)) & denominator;
            // Divide denominator by power of two
            assembly {
                denominator := div(denominator, twos)
            }

            // Divide [prod1 prod0] by the factors of two
            assembly {
                prod0 := div(prod0, twos)
            }
            // Shift in bits from prod1 into prod0. For this we need
            // to flip `twos` such that it is 2**256 / twos.
            // If twos is zero, then it becomes one
            assembly {
                twos := add(div(sub(0, twos), twos), 1)
            }
            prod0 |= prod1 * twos;

            // Invert denominator mod 2**256
            // Now that denominator is an odd number, it has an inverse
            // modulo 2**256 such that denominator * inv = 1 mod 2**256.
            // Compute the inverse by starting with a seed that is correct
            // correct for four bits. That is, denominator * inv = 1 mod 2**4
            uint256 inv = (3 * denominator) ^ 2;
            // Now use Newton-Raphson iteration to improve the precision.
            // Thanks to Hensel's lifting lemma, this also works in modular
            // arithmetic, doubling the correct bits in each step.
            inv *= 2 - denominator * inv; // inverse mod 2**8
            inv *= 2 - denominator * inv; // inverse mod 2**16
            inv *= 2 - denominator * inv; // inverse mod 2**32
            inv *= 2 - denominator * inv; // inverse mod 2**64
            inv *= 2 - denominator * inv; // inverse mod 2**128
            inv *= 2 - denominator * inv; // inverse mod 2**256

            // Because the division is now exact we can divide by multiplying
            // with the modular inverse of denominator. This will give us the
            // correct result modulo 2**256. Since the precoditions guarantee
            // that the outcome is less than 2**256, this is the final result.
            // We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inv;
            return result;
        }
    }

    /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    function mulDivRoundingUp(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        // diff: original lib works under 0.7.6 with overflows enabled
        unchecked {
            result = mulDiv(a, b, denominator);
            if (mulmod(a, b, denominator) > 0) {
                require(result < type(uint256).max);
                result++;
            }
        }
    }
}

File 29 of 30 : ContractMeta.sol
// SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;

import "../interfaces/utils/IContractMeta.sol";

abstract contract ContractMeta is IContractMeta {
    // -------------------  EXTERNAL, VIEW  -------------------

    function contractName() external pure returns (string memory) {
        return _bytes32ToString(_contractName());
    }

    function contractNameBytes() external pure returns (bytes32) {
        return _contractName();
    }

    function contractVersion() external pure returns (string memory) {
        return _bytes32ToString(_contractVersion());
    }

    function contractVersionBytes() external pure returns (bytes32) {
        return _contractVersion();
    }

    // -------------------  INTERNAL, VIEW  -------------------

    function _contractName() internal pure virtual returns (bytes32);

    function _contractVersion() internal pure virtual returns (bytes32);

    function _bytes32ToString(bytes32 b) internal pure returns (string memory s) {
        s = new string(32);
        uint256 len = 32;
        for (uint256 i = 0; i < 32; ++i) {
            if (uint8(b[i]) == 0) {
                len = i;
                break;
            }
        }
        assembly {
            mstore(s, len)
            mstore(add(s, 0x20), b)
        }
    }
}

File 30 of 30 : VaultGovernance.sol
// SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;

import "@openzeppelin/contracts/proxy/Clones.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "../interfaces/IProtocolGovernance.sol";
import "../interfaces/vaults/IVaultGovernance.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../libraries/PermissionIdsLibrary.sol";

/// @notice Internal contract for managing different params.
/// @dev The contract should be overriden by the concrete VaultGovernance,
/// define different params structs and use abi.decode / abi.encode to serialize
/// to bytes in this contract. It also should emit events on params change.
abstract contract VaultGovernance is IVaultGovernance, ERC165 {
    InternalParams internal _internalParams;
    InternalParams private _stagedInternalParams;
    uint256 internal _internalParamsTimestamp;

    mapping(uint256 => bytes) internal _delayedStrategyParams;
    mapping(uint256 => bytes) internal _stagedDelayedStrategyParams;
    mapping(uint256 => uint256) internal _delayedStrategyParamsTimestamp;

    mapping(uint256 => bytes) internal _delayedProtocolPerVaultParams;
    mapping(uint256 => bytes) internal _stagedDelayedProtocolPerVaultParams;
    mapping(uint256 => uint256) internal _delayedProtocolPerVaultParamsTimestamp;

    bytes internal _delayedProtocolParams;
    bytes internal _stagedDelayedProtocolParams;
    uint256 internal _delayedProtocolParamsTimestamp;

    mapping(uint256 => bytes) internal _strategyParams;
    bytes internal _protocolParams;
    bytes internal _operatorParams;

    /// @notice Creates a new contract.
    /// @param internalParams_ Initial Internal Params
    constructor(InternalParams memory internalParams_) {
        require(address(internalParams_.protocolGovernance) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        require(address(internalParams_.registry) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        require(address(internalParams_.singleton) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        _internalParams = internalParams_;
    }

    // -------------------  EXTERNAL, VIEW  -------------------

    /// @inheritdoc IVaultGovernance
    function delayedStrategyParamsTimestamp(uint256 nft) external view returns (uint256) {
        return _delayedStrategyParamsTimestamp[nft];
    }

    /// @inheritdoc IVaultGovernance
    function delayedProtocolPerVaultParamsTimestamp(uint256 nft) external view returns (uint256) {
        return _delayedProtocolPerVaultParamsTimestamp[nft];
    }

    /// @inheritdoc IVaultGovernance
    function delayedProtocolParamsTimestamp() external view returns (uint256) {
        return _delayedProtocolParamsTimestamp;
    }

    /// @inheritdoc IVaultGovernance
    function internalParamsTimestamp() external view returns (uint256) {
        return _internalParamsTimestamp;
    }

    /// @inheritdoc IVaultGovernance
    function internalParams() external view returns (InternalParams memory) {
        return _internalParams;
    }

    /// @inheritdoc IVaultGovernance
    function stagedInternalParams() external view returns (InternalParams memory) {
        return _stagedInternalParams;
    }

    function supportsInterface(bytes4 interfaceID) public view virtual override(ERC165) returns (bool) {
        return super.supportsInterface(interfaceID) || interfaceID == type(IVaultGovernance).interfaceId;
    }

    // -------------------  EXTERNAL, MUTATING  -------------------

    /// @inheritdoc IVaultGovernance
    function stageInternalParams(InternalParams memory newParams) external {
        _requireProtocolAdmin();
        require(address(newParams.protocolGovernance) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        require(address(newParams.registry) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        require(address(newParams.singleton) != address(0), ExceptionsLibrary.ADDRESS_ZERO);
        _stagedInternalParams = newParams;
        _internalParamsTimestamp = block.timestamp + _internalParams.protocolGovernance.governanceDelay();
        emit StagedInternalParams(tx.origin, msg.sender, newParams, _internalParamsTimestamp);
    }

    /// @inheritdoc IVaultGovernance
    function commitInternalParams() external {
        _requireProtocolAdmin();
        require(_internalParamsTimestamp != 0, ExceptionsLibrary.NULL);
        require(block.timestamp >= _internalParamsTimestamp, ExceptionsLibrary.TIMESTAMP);
        _internalParams = _stagedInternalParams;
        delete _internalParamsTimestamp;
        delete _stagedInternalParams;
        emit CommitedInternalParams(tx.origin, msg.sender, _internalParams);
    }

    // -------------------  INTERNAL, VIEW  -------------------

    function _requireAtLeastStrategy(uint256 nft) internal view {
        require(
            (_internalParams.protocolGovernance.isAdmin(msg.sender) ||
                _internalParams.registry.getApproved(nft) == msg.sender ||
                (_internalParams.registry.ownerOf(nft) == msg.sender)),
            ExceptionsLibrary.FORBIDDEN
        );
    }

    function _requireProtocolAdmin() internal view {
        require(_internalParams.protocolGovernance.isAdmin(msg.sender), ExceptionsLibrary.FORBIDDEN);
    }

    function _requireAtLeastOperator() internal view {
        IProtocolGovernance governance = _internalParams.protocolGovernance;
        require(governance.isAdmin(msg.sender) || governance.isOperator(msg.sender), ExceptionsLibrary.FORBIDDEN);
    }

    // -------------------  INTERNAL, MUTATING  -------------------

    function _createVault(address owner) internal returns (address vault, uint256 nft) {
        IProtocolGovernance protocolGovernance = IProtocolGovernance(_internalParams.protocolGovernance);
        require(
            protocolGovernance.hasPermission(msg.sender, PermissionIdsLibrary.CREATE_VAULT),
            ExceptionsLibrary.FORBIDDEN
        );
        IVaultRegistry vaultRegistry = _internalParams.registry;
        nft = vaultRegistry.vaultsCount() + 1;
        vault = Clones.cloneDeterministic(address(_internalParams.singleton), bytes32(nft));
        vaultRegistry.registerVault(address(vault), owner);
    }

    /// @notice Set Delayed Strategy Params
    /// @param nft Nft of the vault
    /// @param params New params
    function _stageDelayedStrategyParams(uint256 nft, bytes memory params) internal {
        _requireAtLeastStrategy(nft);
        _stagedDelayedStrategyParams[nft] = params;
        uint256 delayFactor = _delayedStrategyParams[nft].length == 0 ? 0 : 1;
        _delayedStrategyParamsTimestamp[nft] =
            block.timestamp +
            _internalParams.protocolGovernance.governanceDelay() *
            delayFactor;
    }

    /// @notice Commit Delayed Strategy Params
    function _commitDelayedStrategyParams(uint256 nft) internal {
        _requireAtLeastStrategy(nft);
        uint256 thisDelayedStrategyParamsTimestamp = _delayedStrategyParamsTimestamp[nft];
        require(thisDelayedStrategyParamsTimestamp != 0, ExceptionsLibrary.NULL);
        require(block.timestamp >= thisDelayedStrategyParamsTimestamp, ExceptionsLibrary.TIMESTAMP);
        _delayedStrategyParams[nft] = _stagedDelayedStrategyParams[nft];
        delete _stagedDelayedStrategyParams[nft];
        delete _delayedStrategyParamsTimestamp[nft];
    }

    /// @notice Set Delayed Protocol Per Vault Params
    /// @param nft Nft of the vault
    /// @param params New params
    function _stageDelayedProtocolPerVaultParams(uint256 nft, bytes memory params) internal {
        _requireProtocolAdmin();
        _stagedDelayedProtocolPerVaultParams[nft] = params;
        uint256 delayFactor = _delayedProtocolPerVaultParams[nft].length == 0 ? 0 : 1;
        _delayedProtocolPerVaultParamsTimestamp[nft] =
            block.timestamp +
            _internalParams.protocolGovernance.governanceDelay() *
            delayFactor;
    }

    /// @notice Commit Delayed Protocol Per Vault Params
    function _commitDelayedProtocolPerVaultParams(uint256 nft) internal {
        _requireProtocolAdmin();
        uint256 thisDelayedProtocolPerVaultParamsTimestamp = _delayedProtocolPerVaultParamsTimestamp[nft];
        require(thisDelayedProtocolPerVaultParamsTimestamp != 0, ExceptionsLibrary.NULL);
        require(block.timestamp >= thisDelayedProtocolPerVaultParamsTimestamp, ExceptionsLibrary.TIMESTAMP);
        _delayedProtocolPerVaultParams[nft] = _stagedDelayedProtocolPerVaultParams[nft];
        delete _stagedDelayedProtocolPerVaultParams[nft];
        delete _delayedProtocolPerVaultParamsTimestamp[nft];
    }

    /// @notice Set Delayed Protocol Params
    /// @param params New params
    function _stageDelayedProtocolParams(bytes memory params) internal {
        _requireProtocolAdmin();
        uint256 delayFactor = _delayedProtocolParams.length == 0 ? 0 : 1;
        _stagedDelayedProtocolParams = params;
        _delayedProtocolParamsTimestamp =
            block.timestamp +
            _internalParams.protocolGovernance.governanceDelay() *
            delayFactor;
    }

    /// @notice Commit Delayed Protocol Params
    function _commitDelayedProtocolParams() internal {
        _requireProtocolAdmin();
        require(_delayedProtocolParamsTimestamp != 0, ExceptionsLibrary.NULL);
        require(block.timestamp >= _delayedProtocolParamsTimestamp, ExceptionsLibrary.TIMESTAMP);
        _delayedProtocolParams = _stagedDelayedProtocolParams;
        delete _stagedDelayedProtocolParams;
        delete _delayedProtocolParamsTimestamp;
    }

    /// @notice Set immediate strategy params
    /// @dev Should require nft > 0
    /// @param nft Nft of the vault
    /// @param params New params
    function _setStrategyParams(uint256 nft, bytes memory params) internal {
        _requireAtLeastStrategy(nft);
        _strategyParams[nft] = params;
    }

    /// @notice Set immediate operator params
    /// @param params New params
    function _setOperatorParams(bytes memory params) internal {
        _requireAtLeastOperator();
        _operatorParams = params;
    }

    /// @notice Set immediate protocol params
    /// @param params New params
    function _setProtocolParams(bytes memory params) internal {
        _requireProtocolAdmin();
        _protocolParams = params;
    }

    // --------------------------  EVENTS  --------------------------

    /// @notice Emitted when InternalParams are staged for commit
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param params New params that were staged for commit
    /// @param when When the params could be committed
    event StagedInternalParams(address indexed origin, address indexed sender, InternalParams params, uint256 when);

    /// @notice Emitted when InternalParams are staged for commit
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param params New params that were staged for commit
    event CommitedInternalParams(address indexed origin, address indexed sender, InternalParams params);

    /// @notice Emitted when New Vault is deployed
    /// @param origin Origin of the transaction (tx.origin)
    /// @param sender Sender of the call (msg.sender)
    /// @param vaultTokens Vault tokens for this vault
    /// @param options Options for deploy. The details of the options structure are specified in subcontracts
    /// @param owner Owner of the VaultRegistry NFT for this vault
    /// @param vaultAddress Address of the new Vault
    /// @param vaultNft VaultRegistry NFT for the new Vault
    event DeployedVault(
        address indexed origin,
        address indexed sender,
        address[] vaultTokens,
        bytes options,
        address owner,
        address vaultAddress,
        uint256 vaultNft
    );
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@solmate/=lib/solmate/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200,
    "details": {
      "yul": true,
      "yulDetails": {
        "stackAllocation": true
      }
    }
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"contract IProtocolGovernance","name":"protocolGovernance","type":"address"},{"internalType":"contract IVaultRegistry","name":"registry","type":"address"},{"internalType":"contract IVault","name":"singleton","type":"address"}],"internalType":"struct IVaultGovernance.InternalParams","name":"internalParams_","type":"tuple"},{"components":[{"internalType":"uint256","name":"managementFeeChargeDelay","type":"uint256"},{"internalType":"contract IOracle","name":"oracle","type":"address"}],"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolParams","name":"delayedProtocolParams_","type":"tuple"},{"internalType":"contract IERC20RootVaultHelper","name":"helper_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"uint256","name":"managementFeeChargeDelay","type":"uint256"},{"internalType":"contract IOracle","name":"oracle","type":"address"}],"indexed":false,"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolParams","name":"params","type":"tuple"}],"name":"CommitDelayedProtocolParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"nft","type":"uint256"},{"components":[{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"indexed":false,"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolPerVaultParams","name":"params","type":"tuple"}],"name":"CommitDelayedProtocolPerVaultParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"nft","type":"uint256"},{"components":[{"internalType":"address","name":"strategyTreasury","type":"address"},{"internalType":"address","name":"strategyPerformanceTreasury","type":"address"},{"internalType":"bool","name":"privateVault","type":"bool"},{"internalType":"uint256","name":"managementFee","type":"uint256"},{"internalType":"uint256","name":"performanceFee","type":"uint256"},{"internalType":"address","name":"depositCallbackAddress","type":"address"},{"internalType":"address","name":"withdrawCallbackAddress","type":"address"}],"indexed":false,"internalType":"struct IERC20RootVaultGovernance.DelayedStrategyParams","name":"params","type":"tuple"}],"name":"CommitDelayedStrategyParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"contract IProtocolGovernance","name":"protocolGovernance","type":"address"},{"internalType":"contract IVaultRegistry","name":"registry","type":"address"},{"internalType":"contract IVault","name":"singleton","type":"address"}],"indexed":false,"internalType":"struct IVaultGovernance.InternalParams","name":"params","type":"tuple"}],"name":"CommitedInternalParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address[]","name":"vaultTokens","type":"address[]"},{"indexed":false,"internalType":"bytes","name":"options","type":"bytes"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"vaultAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"vaultNft","type":"uint256"}],"name":"DeployedVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"bool","name":"disableDeposit","type":"bool"}],"indexed":false,"internalType":"struct IERC20RootVaultGovernance.OperatorParams","name":"params","type":"tuple"}],"name":"SetOperatorParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"nft","type":"uint256"},{"components":[{"internalType":"uint256","name":"tokenLimitPerAddress","type":"uint256"},{"internalType":"uint256","name":"tokenLimit","type":"uint256"}],"indexed":false,"internalType":"struct IERC20RootVaultGovernance.StrategyParams","name":"params","type":"tuple"}],"name":"SetStrategyParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"uint256","name":"managementFeeChargeDelay","type":"uint256"},{"internalType":"contract IOracle","name":"oracle","type":"address"}],"indexed":false,"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolParams","name":"params","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"when","type":"uint256"}],"name":"StageDelayedProtocolParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"nft","type":"uint256"},{"components":[{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"indexed":false,"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolPerVaultParams","name":"params","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"when","type":"uint256"}],"name":"StageDelayedProtocolPerVaultParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"nft","type":"uint256"},{"components":[{"internalType":"address","name":"strategyTreasury","type":"address"},{"internalType":"address","name":"strategyPerformanceTreasury","type":"address"},{"internalType":"bool","name":"privateVault","type":"bool"},{"internalType":"uint256","name":"managementFee","type":"uint256"},{"internalType":"uint256","name":"performanceFee","type":"uint256"},{"internalType":"address","name":"depositCallbackAddress","type":"address"},{"internalType":"address","name":"withdrawCallbackAddress","type":"address"}],"indexed":false,"internalType":"struct IERC20RootVaultGovernance.DelayedStrategyParams","name":"params","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"when","type":"uint256"}],"name":"StageDelayedStrategyParams","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"origin","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"contract IProtocolGovernance","name":"protocolGovernance","type":"address"},{"internalType":"contract IVaultRegistry","name":"registry","type":"address"},{"internalType":"contract IVault","name":"singleton","type":"address"}],"indexed":false,"internalType":"struct IVaultGovernance.InternalParams","name":"params","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"when","type":"uint256"}],"name":"StagedInternalParams","type":"event"},{"inputs":[],"name":"MAX_MANAGEMENT_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PERFORMANCE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PROTOCOL_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"commitDelayedProtocolParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"commitDelayedProtocolPerVaultParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"commitDelayedStrategyParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"commitInternalParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractNameBytes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractVersionBytes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address[]","name":"vaultTokens_","type":"address[]"},{"internalType":"address","name":"strategy_","type":"address"},{"internalType":"uint256[]","name":"subvaultNfts_","type":"uint256[]"},{"internalType":"address","name":"owner_","type":"address"}],"name":"createVault","outputs":[{"internalType":"contract IERC20RootVault","name":"vault","type":"address"},{"internalType":"uint256","name":"nft","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delayedProtocolParams","outputs":[{"components":[{"internalType":"uint256","name":"managementFeeChargeDelay","type":"uint256"},{"internalType":"contract IOracle","name":"oracle","type":"address"}],"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delayedProtocolParamsTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"delayedProtocolPerVaultParams","outputs":[{"components":[{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolPerVaultParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"delayedProtocolPerVaultParamsTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"delayedStrategyParams","outputs":[{"components":[{"internalType":"address","name":"strategyTreasury","type":"address"},{"internalType":"address","name":"strategyPerformanceTreasury","type":"address"},{"internalType":"bool","name":"privateVault","type":"bool"},{"internalType":"uint256","name":"managementFee","type":"uint256"},{"internalType":"uint256","name":"performanceFee","type":"uint256"},{"internalType":"address","name":"depositCallbackAddress","type":"address"},{"internalType":"address","name":"withdrawCallbackAddress","type":"address"}],"internalType":"struct IERC20RootVaultGovernance.DelayedStrategyParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"delayedStrategyParamsTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"helper","outputs":[{"internalType":"contract IERC20RootVaultHelper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"internalParams","outputs":[{"components":[{"internalType":"contract IProtocolGovernance","name":"protocolGovernance","type":"address"},{"internalType":"contract IVaultRegistry","name":"registry","type":"address"},{"internalType":"contract IVault","name":"singleton","type":"address"}],"internalType":"struct IVaultGovernance.InternalParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"internalParamsTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorParams","outputs":[{"components":[{"internalType":"bool","name":"disableDeposit","type":"bool"}],"internalType":"struct IERC20RootVaultGovernance.OperatorParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"disableDeposit","type":"bool"}],"internalType":"struct IERC20RootVaultGovernance.OperatorParams","name":"params","type":"tuple"}],"name":"setOperatorParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"},{"components":[{"internalType":"uint256","name":"tokenLimitPerAddress","type":"uint256"},{"internalType":"uint256","name":"tokenLimit","type":"uint256"}],"internalType":"struct IERC20RootVaultGovernance.StrategyParams","name":"params","type":"tuple"}],"name":"setStrategyParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"managementFeeChargeDelay","type":"uint256"},{"internalType":"contract IOracle","name":"oracle","type":"address"}],"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolParams","name":"params","type":"tuple"}],"name":"stageDelayedProtocolParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"},{"components":[{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolPerVaultParams","name":"params","type":"tuple"}],"name":"stageDelayedProtocolPerVaultParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"},{"components":[{"internalType":"address","name":"strategyTreasury","type":"address"},{"internalType":"address","name":"strategyPerformanceTreasury","type":"address"},{"internalType":"bool","name":"privateVault","type":"bool"},{"internalType":"uint256","name":"managementFee","type":"uint256"},{"internalType":"uint256","name":"performanceFee","type":"uint256"},{"internalType":"address","name":"depositCallbackAddress","type":"address"},{"internalType":"address","name":"withdrawCallbackAddress","type":"address"}],"internalType":"struct IERC20RootVaultGovernance.DelayedStrategyParams","name":"params","type":"tuple"}],"name":"stageDelayedStrategyParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IProtocolGovernance","name":"protocolGovernance","type":"address"},{"internalType":"contract IVaultRegistry","name":"registry","type":"address"},{"internalType":"contract IVault","name":"singleton","type":"address"}],"internalType":"struct IVaultGovernance.InternalParams","name":"newParams","type":"tuple"}],"name":"stageInternalParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stagedDelayedProtocolParams","outputs":[{"components":[{"internalType":"uint256","name":"managementFeeChargeDelay","type":"uint256"},{"internalType":"contract IOracle","name":"oracle","type":"address"}],"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"stagedDelayedProtocolPerVaultParams","outputs":[{"components":[{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"internalType":"struct IERC20RootVaultGovernance.DelayedProtocolPerVaultParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"stagedDelayedStrategyParams","outputs":[{"components":[{"internalType":"address","name":"strategyTreasury","type":"address"},{"internalType":"address","name":"strategyPerformanceTreasury","type":"address"},{"internalType":"bool","name":"privateVault","type":"bool"},{"internalType":"uint256","name":"managementFee","type":"uint256"},{"internalType":"uint256","name":"performanceFee","type":"uint256"},{"internalType":"address","name":"depositCallbackAddress","type":"address"},{"internalType":"address","name":"withdrawCallbackAddress","type":"address"}],"internalType":"struct IERC20RootVaultGovernance.DelayedStrategyParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stagedInternalParams","outputs":[{"components":[{"internalType":"contract IProtocolGovernance","name":"protocolGovernance","type":"address"},{"internalType":"contract IVaultRegistry","name":"registry","type":"address"},{"internalType":"contract IVault","name":"singleton","type":"address"}],"internalType":"struct IVaultGovernance.InternalParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nft","type":"uint256"}],"name":"strategyParams","outputs":[{"components":[{"internalType":"uint256","name":"tokenLimitPerAddress","type":"uint256"},{"internalType":"uint256","name":"tokenLimit","type":"uint256"}],"internalType":"struct IERC20RootVaultGovernance.StrategyParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60a06040523480156200001157600080fd5b506040516200381f3803806200381f833981016040819052620000349162000379565b825160408051808201909152600281526120ad60f11b602082015284916001600160a01b0316620000835760405162461bcd60e51b81526004016200007a91906200043a565b60405180910390fd5b5060006001600160a01b031681602001516001600160a01b031614156040518060400160405280600281526020016120ad60f11b81525090620000db5760405162461bcd60e51b81526004016200007a91906200043a565b506040808201518151808301909252600282526120ad60f11b60208301526001600160a01b0316620001225760405162461bcd60e51b81526004016200007a91906200043a565b508051600080546001600160a01b03199081166001600160a01b0393841617909155602080840151600180548416918516919091179055604093840151600280549093169084161782558581015184518086019095529184526120ad60f11b9084015216620001a65760405162461bcd60e51b81526004016200007a91906200043a565b5060408051808201909152600281526120ad60f11b60208201526001600160a01b038216620001ea5760405162461bcd60e51b81526004016200007a91906200043a565b506001600160a01b038181166080526040805184516020808301919091528086015190931681830152815180820383018152606090910190915280516200023692600d92019062000240565b50505050620004cf565b8280546200024e9062000492565b90600052602060002090601f016020900481019282620002725760008555620002bd565b82601f106200028d57805160ff1916838001178555620002bd565b82800160010185558215620002bd579182015b82811115620002bd578251825591602001919060010190620002a0565b50620002cb929150620002cf565b5090565b5b80821115620002cb5760008155600101620002d0565b604051606081016001600160401b03811182821017156200031757634e487b7160e01b600052604160045260246000fd5b60405290565b604080519081016001600160401b03811182821017156200031757634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146200036457600080fd5b50565b805162000374816200034e565b919050565b600080600083850360c08112156200039057600080fd5b60608112156200039f57600080fd5b620003a9620002e6565b8551620003b6816200034e565b81526020860151620003c8816200034e565b60208201526040860151620003dd816200034e565b604082810191909152909450605f1982011215620003fa57600080fd5b50620004056200031d565b6060850151815260808501516200041c816200034e565b602082015291506200043160a0850162000367565b90509250925092565b600060208083528351808285015260005b8181101562000469578581018301518582016040015282016200044b565b818111156200047c576000604083870101525b50601f01601f1916929092016040019392505050565b600181811c90821680620004a757607f821691505b60208210811415620004c957634e487b7160e01b600052602260045260246000fd5b50919050565b60805161332d620004f2600039600081816103480152611abe015261332d6000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80638860d2481161011a578063c2cbdc67116100ad578063db2030aa1161007c578063db2030aa14610532578063dbb1c35f1461054b578063e4af6e791461055e578063ee2d59f414610566578063f699a6071461057957600080fd5b8063c2cbdc67146104e3578063c8e8a7661461050f578063d34cc38014610522578063d4a07d341461052a57600080fd5b8063a0a8e460116100e9578063a0a8e460146104b2578063afd2c7e9146104ba578063b8ca3b83146104cd578063bdca9165146104d857600080fd5b80638860d2481461046a5780638e207dda1461047d57806398347a5d1461049f5780639908840c146104a757600080fd5b80633d8c08b91161019d57806363b0e66a1161016c57806363b0e66a146103435780636707acee1461038257806375d0c0dc146103a25780637ac46fbb146103b757806386c6be3e1461041757600080fd5b80633d8c08b9146102dd578063511ce798146102f057806359331d781461031057806359f3dae71461032357600080fd5b80630e3e80ac116101d95780630e3e80ac1461027357806312466b68146102945780631c7f4c73146102c2578063221cc263146102ca57600080fd5b806301ffc9a71461020b57806306a4623914610233578063099465381461024b5780630bdedd5614610260575b600080fd5b61021e6102193660046128f5565b6105ab565b60405190151581526020015b60405180910390f35b640312e302e360dc1b5b60405190815260200161022a565b61025e6102593660046129ce565b6105dc565b005b61025e61026e366004612a40565b6107ce565b774552433230526f6f745661756c74476f7665726e616e636560401b61023d565b6102a76102a2366004612a40565b6108c1565b6040805182518152602092830151928101929092520161022a565b60065461023d565b61025e6102d8366004612a59565b6109b9565b61025e6102eb366004612aaa565b610abe565b61023d6102fe366004612a40565b6000908152600c602052604090205490565b61025e61031e366004612ad8565b610b75565b610336610331366004612a40565b610c2e565b60405161022a9190612b05565b61036a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161022a565b61023d610390366004612a40565b60009081526009602052604090205490565b6103aa610d70565b60405161022a9190612b60565b61040a604080516060810182526000808252602082018190529181019190915250604080516060810182526000546001600160a01b03908116825260015481166020830152600254169181019190915290565b60405161022a9190612bb5565b61040a604080516060810182526000808252602082018190529181019190915250604080516060810182526003546001600160a01b03908116825260045481166020830152600554169181019190915290565b610336610478366004612a40565b610d96565b61049061048b366004612a40565b610e47565b6040519051815260200161022a565b61025e610f35565b61023d6305f5e10081565b6103aa61103a565b61025e6104c8366004612be5565b61104d565b61023d6302faf08081565b61023d631dcd650081565b6104eb6110c8565b60408051825181526020928301516001600160a01b0316928101929092520161022a565b61025e61051d366004612c09565b6111a7565b6104eb611203565b61025e611224565b61053a611349565b60405190511515815260200161022a565b610490610559366004612a40565b61141e565b600f5461023d565b61025e610574366004612a40565b61147b565b61058c610587366004612cc4565b611565565b604080516001600160a01b03909316835260208301919091520161022a565b60006105b682611b23565b806105d157506306a2c33360e41b6001600160e01b03198316145b92915050565b905090565b6105e4611b59565b805160408051808201909152600281526120ad60f11b6020820152906001600160a01b031661062f5760405162461bcd60e51b81526004016106269190612b60565b60405180910390fd5b5060006001600160a01b031681602001516001600160a01b031614156040518060400160405280600281526020016120ad60f11b815250906106845760405162461bcd60e51b81526004016106269190612b60565b506040808201518151808301909252600282526120ad60f11b60208301526001600160a01b03166106c85760405162461bcd60e51b81526004016106269190612b60565b508051600380546001600160a01b03199081166001600160a01b03938416179091556020808401516004805484169185169190911781556040808601516005805490951690861617909355600054835163bba3293960e01b8152935194169363bba3293993808301939290829003018186803b15801561074757600080fd5b505afa15801561075b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077f9190612daa565b6107899042612dd9565b6006819055604051339132917f0887cab3184f7c02b16978ab31f8acee05979f59fc3da6abe5bf71105ec3179d916107c391869190612df1565b60405180910390a350565b6107d781611c11565b600081815260076020526040902080548291339132917fece5c2f5548f6b356ee66c404a736c4a1393d2d7f339f1b11325ccf9ed7da3bb9161081890612e2e565b80601f016020809104026020016040519081016040528092919081815260200182805461084490612e2e565b80156108915780601f1061086657610100808354040283529160200191610891565b820191906000526020600020905b81548152906001019060200180831161087457829003601f168201915b50505050508060200190518101906108a99190612e7c565b6040516108b69190612b05565b60405180910390a450565b6040805180820190915260008082526020820152600082815260106020526040902080546108ee90612e2e565b1515905061090f575050604080518082019091526000808252602082015290565b6000828152601060205260409020805461092890612e2e565b80601f016020809104026020016040519081016040528092919081815260200182805461095490612e2e565b80156109a15780601f10610976576101008083540402835291602001916109a1565b820191906000526020600020905b81548152906001019060200180831161098457829003601f168201915b50505050508060200190518101906105d19190612f28565b6040805180820190915260048152634c494d4f60e01b60208201526305f5e100606083013511156109fd5760405162461bcd60e51b81526004016106269190612b60565b506040805180820190915260048152634c494d4f60e01b6020820152631dcd650060808301351115610a425760405162461bcd60e51b81526004016106269190612b60565b50610a6c8282604051602001610a589190612fe9565b604051602081830303815290604052611d02565b600082815260096020526040908190205490518391339132917f92bc1d5a0a50d53c2c8b67ee363258770588cb71b912dc79c9193e57a3559cef91610ab2918791612ff7565b60405180910390a45050565b6000610ad06040830160208401613013565b6001600160a01b031614156040518060400160405280600281526020016120ad60f11b81525090610b145760405162461bcd60e51b81526004016106269190612b60565b50610b3d81604051602001610b299190613058565b604051602081830303815290604052611e0e565b600f54604051339132917f5893284b3bc8dc03f4a5b1fc07b4ffa5a43c8db93e0d265da78879b701c9352c916107c391869190613066565b6040805180820190915260048152634c494d4f60e01b60208201526302faf08082351115610bb65760405162461bcd60e51b81526004016106269190612b60565b50610be38282604051602001610bcf9135815260200190565b604051602081830303815290604052611ee9565b60008281526009602090815260409182902054825184358152918201528391339132917fcd7599c34365da52fcd641b487f51044152e43bf05893c1ef6d2a2259de7252a9101610ab2565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915260008281526008602052604090208054610c8090612e2e565b15159050610cc65750506040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b60008281526008602052604090208054610cdf90612e2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0b90612e2e565b8015610d585780601f10610d2d57610100808354040283529160200191610d58565b820191906000526020600020905b815481529060010190602001808311610d3b57829003601f168201915b50505050508060200190518101906105d19190612e7c565b60606105d7774552433230526f6f745661756c74476f7665726e616e636560401b611ff4565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915260008281526007602052604090208054610de890612e2e565b15159050610e2e5750506040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b60008281526007602052604090208054610cdf90612e2e565b6040805160208101909152600081526000828152600b602052604090208054610e6f90612e2e565b15159050610e8b57505060408051602081019091526000815290565b6000828152600b602052604090208054610ea490612e2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610ed090612e2e565b8015610f1d5780601f10610ef257610100808354040283529160200191610f1d565b820191906000526020600020905b815481529060010190602001808311610f0057829003601f168201915b50505050508060200190518101906105d19190613081565b610f3d612060565b336001600160a01b0316326001600160a01b03167f862320404e037e2174ac01f6e43fc8b06acda312b671b182dcbe75b50ebd8552600d8054610f7f90612e2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610fab90612e2e565b8015610ff85780601f10610fcd57610100808354040283529160200191610ff8565b820191906000526020600020905b815481529060010190602001808311610fdb57829003601f168201915b505050505080602001905181019061101091906130a5565b60408051825181526020928301516001600160a01b031692810192909252015b60405180910390a3565b60606105d7640312e302e360dc1b611ff4565b61108882826040516020016110749190813581526020918201359181019190915260400190565b604051602081830303815290604052612114565b6040805182358152602080840135908201528391339132917f0b53196f4acc3a02d05123ed8bfe722836dbafff5ca4ce33e7e974117cfb72509101610ab2565b6040805180820190915260008082526020820152600e80546110e990612e2e565b151590506111095750604080518082019091526000808252602082015290565b600e805461111690612e2e565b80601f016020809104026020016040519081016040528092919081815260200182805461114290612e2e565b801561118f5780601f106111645761010080835404028352916020019161118f565b820191906000526020600020905b81548152906001019060200180831161117257829003601f168201915b50505050508060200190518101906105d791906130a5565b6111cf816040516020016111bb91906130dd565b604051602081830303815290604052612141565b604051339032907f87b5b7afdaff1296d279be13a11697acc1b85af123290db06b274bd3823e3c8b906107c39085906130dd565b6040805180820190915260008082526020820152600d805461111690612e2e565b61122c611b59565b6006546040805180820190915260048152631395531360e21b6020820152906112685760405162461bcd60e51b81526004016106269190612b60565b5060065442101560405180604001604052806002815260200161545360f01b815250906112a85760405162461bcd60e51b81526004016106269190612b60565b5060038054600080546001600160a01b038084166001600160a01b03199283168117845560048054600180548286169087168117909155600580546002805497821697891688179055600698909855978616909855841690559290911690925560408051918252602082019390935291820152339032907fef3e4bc9725fa684957d7de03c6dcd01078ee86cf78ceef25c5f8346df69cc9990606001611030565b6040805160208101909152600081526012805461136590612e2e565b15159050611380575060408051602081019091526000815290565b6012805461138d90612e2e565b80601f01602080910402602001604051908101604052809291908181526020018280546113b990612e2e565b80156114065780601f106113db57610100808354040283529160200191611406565b820191906000526020600020905b8154815290600101906020018083116113e957829003601f168201915b50505050508060200190518101906105d791906130f6565b6040805160208101909152600081526000828152600a60205260409020805461144690612e2e565b1515905061146257505060408051602081019091526000815290565b6000828152600a602052604090208054610ea490612e2e565b61148481612160565b6000818152600a6020526040902080548291339132917f813fb1cc9255f5a8d21316ecd3e0cc533da05634409ca6b43f4db5ee1cc4cdf8916114c590612e2e565b80601f01602080910402602001604051908101604052809291908181526020018280546114f190612e2e565b801561153e5780601f106115135761010080835404028352916020019161153e565b820191906000526020600020905b81548152906001019060200180831161152157829003601f168201915b50505050508060200190518101906115569190613081565b604051905181526020016108b6565b600154600090819081906001600160a01b031661158185612250565b87516040805180820190915260048152631153541360e21b60208201529296509094508593506115c45760405162461bcd60e51b81526004016106269190612b60565b5060005b8651811015611a915760008782815181106115e5576115e5613124565b6020026020010151905060008111604051806040016040528060028152602001612b2d60f11b8152509061162c5760405162461bcd60e51b81526004016106269190612b60565b50604051639c94d85360e01b8152600481018290526000906001600160a01b03851690639c94d8539060240160206040518083038186803b15801561167057600080fd5b505afa158015611684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a8919061313a565b60408051808201909152600281526120ad60f11b60208201529091506001600160a01b0382166116eb5760405162461bcd60e51b81526004016106269190612b60565b506040516301ffc9a760e01b8152633d31d51d60e11b60048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561173257600080fd5b505afa158015611746573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176a9190613157565b60405180604001604052806004815260200163494e564960e01b815250906117a55760405162461bcd60e51b81526004016106269190612b60565b506000816001600160a01b031663697222336040518163ffffffff1660e01b815260040160006040518083038186803b1580156117e157600080fd5b505afa1580156117f5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261181d9190810190613174565b9050836119205780518c5114604051806040016040528060048152602001631253959360e21b815250906118645760405162461bcd60e51b81526004016106269190612b60565b506040516301ffc9a760e01b8152632a482de360e21b60048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b1580156118ab57600080fd5b505afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e39190613157565b60405180604001604052806004815260200163494e564960e01b8152509061191e5760405162461bcd60e51b81526004016106269190612b60565b505b6000805b8d51811080156119345750825182105b156119a3578d818151811061194b5761194b613124565b60200260200101516001600160a01b031683838151811061196e5761196e613124565b60200260200101516001600160a01b03161415611993578161198f8161320e565b9250505b61199c8161320e565b9050611924565b508151811460405180604001604052806005815260200164494e56544f60d81b815250906119e45760405162461bcd60e51b81526004016106269190612b60565b50856001600160a01b03166323b872dd33898e8981518110611a0857611a08613124565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015611a6257600080fd5b505af1158015611a76573d6000803e3d6000fd5b50505050505050508080611a899061320e565b9150506115c8565b50604051631a9caa0160e21b81526001600160a01b03851690636a72a80490611ae69086908c908c908c907f000000000000000000000000000000000000000000000000000000000000000090600401613229565b600060405180830381600087803b158015611b0057600080fd5b505af1158015611b14573d6000803e3d6000fd5b50505050505094509492505050565b60006301ffc9a760e01b6001600160e01b0319831614806105d157506001600160e01b0319821663effda0f560e01b1492915050565b600054604051630935e01b60e21b81523360048201526001600160a01b03909116906324d7806c9060240160206040518083038186803b158015611b9c57600080fd5b505afa158015611bb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd49190613157565b6040518060400160405280600381526020016223292160e91b81525090611c0e5760405162461bcd60e51b81526004016106269190612b60565b50565b611c1a81612441565b60008181526009602090815260409182902054825180840190935260048352631395531360e21b918301919091529081611c675760405162461bcd60e51b81526004016106269190612b60565b508042101560405180604001604052806002815260200161545360f01b81525090611ca55760405162461bcd60e51b81526004016106269190612b60565b50600082815260086020908152604080832060079092529091208154909190611ccd90612e2e565b611cd89291906127a7565b506000828152600860205260408120611cf091612832565b50600090815260096020526040812055565b611d0b82612441565b60008281526008602090815260409091208251611d2a9284019061286c565b5060008281526007602052604081208054611d4490612e2e565b159050611d52576001611d55565b60005b60ff169050806000800160009054906101000a90046001600160a01b03166001600160a01b031663bba329396040518163ffffffff1660e01b815260040160206040518083038186803b158015611dab57600080fd5b505afa158015611dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de39190612daa565b611ded91906132d8565b611df79042612dd9565b600093845260096020526040909320929092555050565b611e16611b59565b6000600d8054611e2590612e2e565b159050611e33576001611e36565b60005b60ff16905081600e9080519060200190611e5192919061286c565b506000546040805163bba3293960e01b8152905183926001600160a01b03169163bba32939916004808301926020929190829003018186803b158015611e9657600080fd5b505afa158015611eaa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ece9190612daa565b611ed891906132d8565b611ee29042612dd9565b600f555050565b611ef1611b59565b6000828152600b602090815260409091208251611f109284019061286c565b506000828152600a602052604081208054611f2a90612e2e565b159050611f38576001611f3b565b60005b60ff169050806000800160009054906101000a90046001600160a01b03166001600160a01b031663bba329396040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9157600080fd5b505afa158015611fa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc99190612daa565b611fd391906132d8565b611fdd9042612dd9565b6000938452600c6020526040909320929092555050565b604080516020808252818301909252606091602082018180368337019050509050602060005b60208110156120525783816020811061203557612035613124565b1a61204257809150612052565b61204b8161320e565b905061201a565b508152602081019190915290565b612068611b59565b600f546040805180820190915260048152631395531360e21b6020820152906120a45760405162461bcd60e51b81526004016106269190612b60565b50600f5442101560405180604001604052806002815260200161545360f01b815250906120e45760405162461bcd60e51b81526004016106269190612b60565b50600e600d9080546120f590612e2e565b6121009291906127a7565b5061210d600e6000612832565b6000600f55565b61211d82612441565b6000828152601060209081526040909120825161213c9284019061286c565b505050565b612149612610565b805161215c90601290602084019061286c565b5050565b612168611b59565b6000818152600c602090815260409182902054825180840190935260048352631395531360e21b9183019190915290816121b55760405162461bcd60e51b81526004016106269190612b60565b508042101560405180604001604052806002815260200161545360f01b815250906121f35760405162461bcd60e51b81526004016106269190612b60565b506000828152600b60209081526040808320600a909252909120815490919061221b90612e2e565b6122269291906127a7565b506000828152600b6020526040812061223e91612832565b506000908152600c6020526040812055565b600080546040516363e85d2d60e01b81523360048201526001602482015282916001600160a01b03169081906363e85d2d9060440160206040518083038186803b15801561229d57600080fd5b505afa1580156122b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d59190613157565b6040518060400160405280600381526020016223292160e91b8152509061230f5760405162461bcd60e51b81526004016106269190612b60565b5060015460408051631112eee760e31b815290516001600160a01b039092169182916388977738916004808301926020929190829003018186803b15801561235657600080fd5b505afa15801561236a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238e9190612daa565b612399906001612dd9565b6002549093506123b2906001600160a01b03168461270a565b6040516305c4fdf960e01b81526001600160a01b0380831660048301528781166024830152919550908216906305c4fdf990604401602060405180830381600087803b15801561240157600080fd5b505af1158015612415573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124399190612daa565b505050915091565b600054604051630935e01b60e21b81523360048201526001600160a01b03909116906324d7806c9060240160206040518083038186803b15801561248457600080fd5b505afa158015612498573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124bc9190613157565b80612549575060015460405163020604bf60e21b81526004810183905233916001600160a01b03169063081812fc9060240160206040518083038186803b15801561250657600080fd5b505afa15801561251a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253e919061313a565b6001600160a01b0316145b806125d657506001546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e9060240160206040518083038186803b15801561259357600080fd5b505afa1580156125a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cb919061313a565b6001600160a01b0316145b6040518060400160405280600381526020016223292160e91b8152509061215c5760405162461bcd60e51b81526004016106269190612b60565b600054604051630935e01b60e21b81523360048201526001600160a01b039091169081906324d7806c9060240160206040518083038186803b15801561265557600080fd5b505afa158015612669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268d9190613157565b806125d657506040516336b87bd760e11b81523360048201526001600160a01b03821690636d70f7ae9060240160206040518083038186803b1580156126d257600080fd5b505afa1580156126e6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125d69190613157565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166105d15760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610626565b8280546127b390612e2e565b90600052602060002090601f0160209004810192826127d55760008555612822565b82601f106127e65780548555612822565b8280016001018555821561282257600052602060002091601f016020900482015b82811115612822578254825591600101919060010190612807565b5061282e9291506128e0565b5090565b50805461283e90612e2e565b6000825580601f1061284e575050565b601f016020900490600052602060002090810190611c0e91906128e0565b82805461287890612e2e565b90600052602060002090601f01602090048101928261289a5760008555612822565b82601f106128b357805160ff1916838001178555612822565b82800160010185558215612822579182015b828111156128225782518255916020019190600101906128c5565b5b8082111561282e57600081556001016128e1565b60006020828403121561290757600080fd5b81356001600160e01b03198116811461291f57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561295f5761295f612926565b60405290565b6040516020810167ffffffffffffffff8111828210171561295f5761295f612926565b604051601f8201601f1916810167ffffffffffffffff811182821017156129b1576129b1612926565b604052919050565b6001600160a01b0381168114611c0e57600080fd5b6000606082840312156129e057600080fd5b6040516060810181811067ffffffffffffffff82111715612a0357612a03612926565b6040528235612a11816129b9565b81526020830135612a21816129b9565b60208201526040830135612a34816129b9565b60408201529392505050565b600060208284031215612a5257600080fd5b5035919050565b600080828403610100811215612a6e57600080fd5b8335925060e0601f1982011215612a8457600080fd5b506020830190509250929050565b600060408284031215612aa457600080fd5b50919050565b600060408284031215612abc57600080fd5b61291f8383612a92565b600060208284031215612aa457600080fd5b60008060408385031215612aeb57600080fd5b82359150612afc8460208501612ac6565b90509250929050565b81516001600160a01b039081168252602080840151821690830152604080840151151590830152606080840151908301526080808401519083015260a08381015182169083015260c092830151169181019190915260e00190565b600060208083528351808285015260005b81811015612b8d57858101830151858201604001528201612b71565b81811115612b9f576000604083870101525b50601f01601f1916929092016040019392505050565b606081016105d1828480516001600160a01b03908116835260208083015182169084015260409182015116910152565b60008060608385031215612bf857600080fd5b82359150612afc8460208501612a92565b600060208284031215612c1b57600080fd5b61291f8383612ac6565b600067ffffffffffffffff821115612c3f57612c3f612926565b5060051b60200190565b8035612c54816129b9565b919050565b600082601f830112612c6a57600080fd5b81356020612c7f612c7a83612c25565b612988565b82815260059290921b84018101918181019086841115612c9e57600080fd5b8286015b84811015612cb95780358352918301918301612ca2565b509695505050505050565b60008060008060808587031215612cda57600080fd5b843567ffffffffffffffff80821115612cf257600080fd5b818701915087601f830112612d0657600080fd5b81356020612d16612c7a83612c25565b82815260059290921b8401810191818101908b841115612d3557600080fd5b948201945b83861015612d5c578535612d4d816129b9565b82529482019490820190612d3a565b9850612d6b9050898201612c49565b965050506040870135915080821115612d8357600080fd5b50612d9087828801612c59565b925050612d9f60608601612c49565b905092959194509250565b600060208284031215612dbc57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115612dec57612dec612dc3565b500190565b60808101612e21828580516001600160a01b03908116835260208083015182169084015260409182015116910152565b8260608301529392505050565b600181811c90821680612e4257607f821691505b60208210811415612aa457634e487b7160e01b600052602260045260246000fd5b8051612c54816129b9565b8015158114611c0e57600080fd5b600060e08284031215612e8e57600080fd5b60405160e0810181811067ffffffffffffffff82111715612eb157612eb1612926565b6040528251612ebf816129b9565b81526020830151612ecf816129b9565b60208201526040830151612ee281612e6e565b80604083015250606083015160608201526080830151608082015260a0830151612f0b816129b9565b60a0820152612f1c60c08401612e63565b60c08201529392505050565b600060408284031215612f3a57600080fd5b612f4261293c565b82518152602083015160208201528091505092915050565b8035612f65816129b9565b6001600160a01b039081168352602082013590612f81826129b9565b9081166020840152604082013590612f9882612e6e565b8115156040850152606083013560608501526080830135608085015260a08301359150612fc4826129b9565b90811660a084015260c082013590612fdb826129b9565b80821660c085015250505050565b60e081016105d18284612f5a565b61010081016130068285612f5a565b8260e08301529392505050565b60006020828403121561302557600080fd5b813561291f816129b9565b803582526020810135613042816129b9565b6001600160a01b03166020929092019190915250565b604081016105d18284613030565b606081016130748285613030565b8260408301529392505050565b60006020828403121561309357600080fd5b61309b612965565b9151825250919050565b6000604082840312156130b757600080fd5b6130bf61293c565b8251815260208301516130d1816129b9565b60208201529392505050565b6020810182356130ec81612e6e565b1515909152919050565b60006020828403121561310857600080fd5b613110612965565b825161311b81612e6e565b81529392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561314c57600080fd5b815161291f816129b9565b60006020828403121561316957600080fd5b815161291f81612e6e565b6000602080838503121561318757600080fd5b825167ffffffffffffffff81111561319e57600080fd5b8301601f810185136131af57600080fd5b80516131bd612c7a82612c25565b81815260059190911b820183019083810190878311156131dc57600080fd5b928401925b828410156132035783516131f4816129b9565b825292840192908401906131e1565b979650505050505050565b600060001982141561322257613222612dc3565b5060010190565b600060a08201878352602060a08185015281885180845260c086019150828a01935060005b818110156132735784516001600160a01b03168352938301939183019160010161324e565b50506001600160a01b03881660408601528481036060860152865180825290820192508187019060005b818110156132b95782518552938301939183019160010161329d565b5050506001600160a01b03851660808501525090509695505050505050565b60008160001904831182151516156132f2576132f2612dc3565b50029056fea2646970667358221220de985acfb870c6b544ed3cdb6bb7e2ec33cda0808b9dbf5df7b3f0cffbf04d6d64736f6c63430008090033000000000000000000000000dc9c17662133fb865e7ba3198b67c53a617b2153000000000000000000000000fd23f971696576331fcf96f80a20b4d3b31ca5b20000000000000000000000008f22602d6db68b576784a560b42eff9b32bfd16e00000000000000000000000000000000000000000000000000000000000151800000000000000000000000009d992650b30c6fb7a83e7e7a430b4e015433b838000000000000000000000000acee4a703f27ea1ebcd550511aae58ad012624cc

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102065760003560e01c80638860d2481161011a578063c2cbdc67116100ad578063db2030aa1161007c578063db2030aa14610532578063dbb1c35f1461054b578063e4af6e791461055e578063ee2d59f414610566578063f699a6071461057957600080fd5b8063c2cbdc67146104e3578063c8e8a7661461050f578063d34cc38014610522578063d4a07d341461052a57600080fd5b8063a0a8e460116100e9578063a0a8e460146104b2578063afd2c7e9146104ba578063b8ca3b83146104cd578063bdca9165146104d857600080fd5b80638860d2481461046a5780638e207dda1461047d57806398347a5d1461049f5780639908840c146104a757600080fd5b80633d8c08b91161019d57806363b0e66a1161016c57806363b0e66a146103435780636707acee1461038257806375d0c0dc146103a25780637ac46fbb146103b757806386c6be3e1461041757600080fd5b80633d8c08b9146102dd578063511ce798146102f057806359331d781461031057806359f3dae71461032357600080fd5b80630e3e80ac116101d95780630e3e80ac1461027357806312466b68146102945780631c7f4c73146102c2578063221cc263146102ca57600080fd5b806301ffc9a71461020b57806306a4623914610233578063099465381461024b5780630bdedd5614610260575b600080fd5b61021e6102193660046128f5565b6105ab565b60405190151581526020015b60405180910390f35b640312e302e360dc1b5b60405190815260200161022a565b61025e6102593660046129ce565b6105dc565b005b61025e61026e366004612a40565b6107ce565b774552433230526f6f745661756c74476f7665726e616e636560401b61023d565b6102a76102a2366004612a40565b6108c1565b6040805182518152602092830151928101929092520161022a565b60065461023d565b61025e6102d8366004612a59565b6109b9565b61025e6102eb366004612aaa565b610abe565b61023d6102fe366004612a40565b6000908152600c602052604090205490565b61025e61031e366004612ad8565b610b75565b610336610331366004612a40565b610c2e565b60405161022a9190612b05565b61036a7f000000000000000000000000acee4a703f27ea1ebcd550511aae58ad012624cc81565b6040516001600160a01b03909116815260200161022a565b61023d610390366004612a40565b60009081526009602052604090205490565b6103aa610d70565b60405161022a9190612b60565b61040a604080516060810182526000808252602082018190529181019190915250604080516060810182526000546001600160a01b03908116825260015481166020830152600254169181019190915290565b60405161022a9190612bb5565b61040a604080516060810182526000808252602082018190529181019190915250604080516060810182526003546001600160a01b03908116825260045481166020830152600554169181019190915290565b610336610478366004612a40565b610d96565b61049061048b366004612a40565b610e47565b6040519051815260200161022a565b61025e610f35565b61023d6305f5e10081565b6103aa61103a565b61025e6104c8366004612be5565b61104d565b61023d6302faf08081565b61023d631dcd650081565b6104eb6110c8565b60408051825181526020928301516001600160a01b0316928101929092520161022a565b61025e61051d366004612c09565b6111a7565b6104eb611203565b61025e611224565b61053a611349565b60405190511515815260200161022a565b610490610559366004612a40565b61141e565b600f5461023d565b61025e610574366004612a40565b61147b565b61058c610587366004612cc4565b611565565b604080516001600160a01b03909316835260208301919091520161022a565b60006105b682611b23565b806105d157506306a2c33360e41b6001600160e01b03198316145b92915050565b905090565b6105e4611b59565b805160408051808201909152600281526120ad60f11b6020820152906001600160a01b031661062f5760405162461bcd60e51b81526004016106269190612b60565b60405180910390fd5b5060006001600160a01b031681602001516001600160a01b031614156040518060400160405280600281526020016120ad60f11b815250906106845760405162461bcd60e51b81526004016106269190612b60565b506040808201518151808301909252600282526120ad60f11b60208301526001600160a01b03166106c85760405162461bcd60e51b81526004016106269190612b60565b508051600380546001600160a01b03199081166001600160a01b03938416179091556020808401516004805484169185169190911781556040808601516005805490951690861617909355600054835163bba3293960e01b8152935194169363bba3293993808301939290829003018186803b15801561074757600080fd5b505afa15801561075b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077f9190612daa565b6107899042612dd9565b6006819055604051339132917f0887cab3184f7c02b16978ab31f8acee05979f59fc3da6abe5bf71105ec3179d916107c391869190612df1565b60405180910390a350565b6107d781611c11565b600081815260076020526040902080548291339132917fece5c2f5548f6b356ee66c404a736c4a1393d2d7f339f1b11325ccf9ed7da3bb9161081890612e2e565b80601f016020809104026020016040519081016040528092919081815260200182805461084490612e2e565b80156108915780601f1061086657610100808354040283529160200191610891565b820191906000526020600020905b81548152906001019060200180831161087457829003601f168201915b50505050508060200190518101906108a99190612e7c565b6040516108b69190612b05565b60405180910390a450565b6040805180820190915260008082526020820152600082815260106020526040902080546108ee90612e2e565b1515905061090f575050604080518082019091526000808252602082015290565b6000828152601060205260409020805461092890612e2e565b80601f016020809104026020016040519081016040528092919081815260200182805461095490612e2e565b80156109a15780601f10610976576101008083540402835291602001916109a1565b820191906000526020600020905b81548152906001019060200180831161098457829003601f168201915b50505050508060200190518101906105d19190612f28565b6040805180820190915260048152634c494d4f60e01b60208201526305f5e100606083013511156109fd5760405162461bcd60e51b81526004016106269190612b60565b506040805180820190915260048152634c494d4f60e01b6020820152631dcd650060808301351115610a425760405162461bcd60e51b81526004016106269190612b60565b50610a6c8282604051602001610a589190612fe9565b604051602081830303815290604052611d02565b600082815260096020526040908190205490518391339132917f92bc1d5a0a50d53c2c8b67ee363258770588cb71b912dc79c9193e57a3559cef91610ab2918791612ff7565b60405180910390a45050565b6000610ad06040830160208401613013565b6001600160a01b031614156040518060400160405280600281526020016120ad60f11b81525090610b145760405162461bcd60e51b81526004016106269190612b60565b50610b3d81604051602001610b299190613058565b604051602081830303815290604052611e0e565b600f54604051339132917f5893284b3bc8dc03f4a5b1fc07b4ffa5a43c8db93e0d265da78879b701c9352c916107c391869190613066565b6040805180820190915260048152634c494d4f60e01b60208201526302faf08082351115610bb65760405162461bcd60e51b81526004016106269190612b60565b50610be38282604051602001610bcf9135815260200190565b604051602081830303815290604052611ee9565b60008281526009602090815260409182902054825184358152918201528391339132917fcd7599c34365da52fcd641b487f51044152e43bf05893c1ef6d2a2259de7252a9101610ab2565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915260008281526008602052604090208054610c8090612e2e565b15159050610cc65750506040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b60008281526008602052604090208054610cdf90612e2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0b90612e2e565b8015610d585780601f10610d2d57610100808354040283529160200191610d58565b820191906000526020600020905b815481529060010190602001808311610d3b57829003601f168201915b50505050508060200190518101906105d19190612e7c565b60606105d7774552433230526f6f745661756c74476f7665726e616e636560401b611ff4565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915260008281526007602052604090208054610de890612e2e565b15159050610e2e5750506040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b60008281526007602052604090208054610cdf90612e2e565b6040805160208101909152600081526000828152600b602052604090208054610e6f90612e2e565b15159050610e8b57505060408051602081019091526000815290565b6000828152600b602052604090208054610ea490612e2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610ed090612e2e565b8015610f1d5780601f10610ef257610100808354040283529160200191610f1d565b820191906000526020600020905b815481529060010190602001808311610f0057829003601f168201915b50505050508060200190518101906105d19190613081565b610f3d612060565b336001600160a01b0316326001600160a01b03167f862320404e037e2174ac01f6e43fc8b06acda312b671b182dcbe75b50ebd8552600d8054610f7f90612e2e565b80601f0160208091040260200160405190810160405280929190818152602001828054610fab90612e2e565b8015610ff85780601f10610fcd57610100808354040283529160200191610ff8565b820191906000526020600020905b815481529060010190602001808311610fdb57829003601f168201915b505050505080602001905181019061101091906130a5565b60408051825181526020928301516001600160a01b031692810192909252015b60405180910390a3565b60606105d7640312e302e360dc1b611ff4565b61108882826040516020016110749190813581526020918201359181019190915260400190565b604051602081830303815290604052612114565b6040805182358152602080840135908201528391339132917f0b53196f4acc3a02d05123ed8bfe722836dbafff5ca4ce33e7e974117cfb72509101610ab2565b6040805180820190915260008082526020820152600e80546110e990612e2e565b151590506111095750604080518082019091526000808252602082015290565b600e805461111690612e2e565b80601f016020809104026020016040519081016040528092919081815260200182805461114290612e2e565b801561118f5780601f106111645761010080835404028352916020019161118f565b820191906000526020600020905b81548152906001019060200180831161117257829003601f168201915b50505050508060200190518101906105d791906130a5565b6111cf816040516020016111bb91906130dd565b604051602081830303815290604052612141565b604051339032907f87b5b7afdaff1296d279be13a11697acc1b85af123290db06b274bd3823e3c8b906107c39085906130dd565b6040805180820190915260008082526020820152600d805461111690612e2e565b61122c611b59565b6006546040805180820190915260048152631395531360e21b6020820152906112685760405162461bcd60e51b81526004016106269190612b60565b5060065442101560405180604001604052806002815260200161545360f01b815250906112a85760405162461bcd60e51b81526004016106269190612b60565b5060038054600080546001600160a01b038084166001600160a01b03199283168117845560048054600180548286169087168117909155600580546002805497821697891688179055600698909855978616909855841690559290911690925560408051918252602082019390935291820152339032907fef3e4bc9725fa684957d7de03c6dcd01078ee86cf78ceef25c5f8346df69cc9990606001611030565b6040805160208101909152600081526012805461136590612e2e565b15159050611380575060408051602081019091526000815290565b6012805461138d90612e2e565b80601f01602080910402602001604051908101604052809291908181526020018280546113b990612e2e565b80156114065780601f106113db57610100808354040283529160200191611406565b820191906000526020600020905b8154815290600101906020018083116113e957829003601f168201915b50505050508060200190518101906105d791906130f6565b6040805160208101909152600081526000828152600a60205260409020805461144690612e2e565b1515905061146257505060408051602081019091526000815290565b6000828152600a602052604090208054610ea490612e2e565b61148481612160565b6000818152600a6020526040902080548291339132917f813fb1cc9255f5a8d21316ecd3e0cc533da05634409ca6b43f4db5ee1cc4cdf8916114c590612e2e565b80601f01602080910402602001604051908101604052809291908181526020018280546114f190612e2e565b801561153e5780601f106115135761010080835404028352916020019161153e565b820191906000526020600020905b81548152906001019060200180831161152157829003601f168201915b50505050508060200190518101906115569190613081565b604051905181526020016108b6565b600154600090819081906001600160a01b031661158185612250565b87516040805180820190915260048152631153541360e21b60208201529296509094508593506115c45760405162461bcd60e51b81526004016106269190612b60565b5060005b8651811015611a915760008782815181106115e5576115e5613124565b6020026020010151905060008111604051806040016040528060028152602001612b2d60f11b8152509061162c5760405162461bcd60e51b81526004016106269190612b60565b50604051639c94d85360e01b8152600481018290526000906001600160a01b03851690639c94d8539060240160206040518083038186803b15801561167057600080fd5b505afa158015611684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a8919061313a565b60408051808201909152600281526120ad60f11b60208201529091506001600160a01b0382166116eb5760405162461bcd60e51b81526004016106269190612b60565b506040516301ffc9a760e01b8152633d31d51d60e11b60048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561173257600080fd5b505afa158015611746573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176a9190613157565b60405180604001604052806004815260200163494e564960e01b815250906117a55760405162461bcd60e51b81526004016106269190612b60565b506000816001600160a01b031663697222336040518163ffffffff1660e01b815260040160006040518083038186803b1580156117e157600080fd5b505afa1580156117f5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261181d9190810190613174565b9050836119205780518c5114604051806040016040528060048152602001631253959360e21b815250906118645760405162461bcd60e51b81526004016106269190612b60565b506040516301ffc9a760e01b8152632a482de360e21b60048201526001600160a01b038316906301ffc9a79060240160206040518083038186803b1580156118ab57600080fd5b505afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e39190613157565b60405180604001604052806004815260200163494e564960e01b8152509061191e5760405162461bcd60e51b81526004016106269190612b60565b505b6000805b8d51811080156119345750825182105b156119a3578d818151811061194b5761194b613124565b60200260200101516001600160a01b031683838151811061196e5761196e613124565b60200260200101516001600160a01b03161415611993578161198f8161320e565b9250505b61199c8161320e565b9050611924565b508151811460405180604001604052806005815260200164494e56544f60d81b815250906119e45760405162461bcd60e51b81526004016106269190612b60565b50856001600160a01b03166323b872dd33898e8981518110611a0857611a08613124565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015611a6257600080fd5b505af1158015611a76573d6000803e3d6000fd5b50505050505050508080611a899061320e565b9150506115c8565b50604051631a9caa0160e21b81526001600160a01b03851690636a72a80490611ae69086908c908c908c907f000000000000000000000000acee4a703f27ea1ebcd550511aae58ad012624cc90600401613229565b600060405180830381600087803b158015611b0057600080fd5b505af1158015611b14573d6000803e3d6000fd5b50505050505094509492505050565b60006301ffc9a760e01b6001600160e01b0319831614806105d157506001600160e01b0319821663effda0f560e01b1492915050565b600054604051630935e01b60e21b81523360048201526001600160a01b03909116906324d7806c9060240160206040518083038186803b158015611b9c57600080fd5b505afa158015611bb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd49190613157565b6040518060400160405280600381526020016223292160e91b81525090611c0e5760405162461bcd60e51b81526004016106269190612b60565b50565b611c1a81612441565b60008181526009602090815260409182902054825180840190935260048352631395531360e21b918301919091529081611c675760405162461bcd60e51b81526004016106269190612b60565b508042101560405180604001604052806002815260200161545360f01b81525090611ca55760405162461bcd60e51b81526004016106269190612b60565b50600082815260086020908152604080832060079092529091208154909190611ccd90612e2e565b611cd89291906127a7565b506000828152600860205260408120611cf091612832565b50600090815260096020526040812055565b611d0b82612441565b60008281526008602090815260409091208251611d2a9284019061286c565b5060008281526007602052604081208054611d4490612e2e565b159050611d52576001611d55565b60005b60ff169050806000800160009054906101000a90046001600160a01b03166001600160a01b031663bba329396040518163ffffffff1660e01b815260040160206040518083038186803b158015611dab57600080fd5b505afa158015611dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de39190612daa565b611ded91906132d8565b611df79042612dd9565b600093845260096020526040909320929092555050565b611e16611b59565b6000600d8054611e2590612e2e565b159050611e33576001611e36565b60005b60ff16905081600e9080519060200190611e5192919061286c565b506000546040805163bba3293960e01b8152905183926001600160a01b03169163bba32939916004808301926020929190829003018186803b158015611e9657600080fd5b505afa158015611eaa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ece9190612daa565b611ed891906132d8565b611ee29042612dd9565b600f555050565b611ef1611b59565b6000828152600b602090815260409091208251611f109284019061286c565b506000828152600a602052604081208054611f2a90612e2e565b159050611f38576001611f3b565b60005b60ff169050806000800160009054906101000a90046001600160a01b03166001600160a01b031663bba329396040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9157600080fd5b505afa158015611fa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc99190612daa565b611fd391906132d8565b611fdd9042612dd9565b6000938452600c6020526040909320929092555050565b604080516020808252818301909252606091602082018180368337019050509050602060005b60208110156120525783816020811061203557612035613124565b1a61204257809150612052565b61204b8161320e565b905061201a565b508152602081019190915290565b612068611b59565b600f546040805180820190915260048152631395531360e21b6020820152906120a45760405162461bcd60e51b81526004016106269190612b60565b50600f5442101560405180604001604052806002815260200161545360f01b815250906120e45760405162461bcd60e51b81526004016106269190612b60565b50600e600d9080546120f590612e2e565b6121009291906127a7565b5061210d600e6000612832565b6000600f55565b61211d82612441565b6000828152601060209081526040909120825161213c9284019061286c565b505050565b612149612610565b805161215c90601290602084019061286c565b5050565b612168611b59565b6000818152600c602090815260409182902054825180840190935260048352631395531360e21b9183019190915290816121b55760405162461bcd60e51b81526004016106269190612b60565b508042101560405180604001604052806002815260200161545360f01b815250906121f35760405162461bcd60e51b81526004016106269190612b60565b506000828152600b60209081526040808320600a909252909120815490919061221b90612e2e565b6122269291906127a7565b506000828152600b6020526040812061223e91612832565b506000908152600c6020526040812055565b600080546040516363e85d2d60e01b81523360048201526001602482015282916001600160a01b03169081906363e85d2d9060440160206040518083038186803b15801561229d57600080fd5b505afa1580156122b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d59190613157565b6040518060400160405280600381526020016223292160e91b8152509061230f5760405162461bcd60e51b81526004016106269190612b60565b5060015460408051631112eee760e31b815290516001600160a01b039092169182916388977738916004808301926020929190829003018186803b15801561235657600080fd5b505afa15801561236a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238e9190612daa565b612399906001612dd9565b6002549093506123b2906001600160a01b03168461270a565b6040516305c4fdf960e01b81526001600160a01b0380831660048301528781166024830152919550908216906305c4fdf990604401602060405180830381600087803b15801561240157600080fd5b505af1158015612415573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124399190612daa565b505050915091565b600054604051630935e01b60e21b81523360048201526001600160a01b03909116906324d7806c9060240160206040518083038186803b15801561248457600080fd5b505afa158015612498573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124bc9190613157565b80612549575060015460405163020604bf60e21b81526004810183905233916001600160a01b03169063081812fc9060240160206040518083038186803b15801561250657600080fd5b505afa15801561251a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253e919061313a565b6001600160a01b0316145b806125d657506001546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e9060240160206040518083038186803b15801561259357600080fd5b505afa1580156125a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cb919061313a565b6001600160a01b0316145b6040518060400160405280600381526020016223292160e91b8152509061215c5760405162461bcd60e51b81526004016106269190612b60565b600054604051630935e01b60e21b81523360048201526001600160a01b039091169081906324d7806c9060240160206040518083038186803b15801561265557600080fd5b505afa158015612669573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268d9190613157565b806125d657506040516336b87bd760e11b81523360048201526001600160a01b03821690636d70f7ae9060240160206040518083038186803b1580156126d257600080fd5b505afa1580156126e6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125d69190613157565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166105d15760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610626565b8280546127b390612e2e565b90600052602060002090601f0160209004810192826127d55760008555612822565b82601f106127e65780548555612822565b8280016001018555821561282257600052602060002091601f016020900482015b82811115612822578254825591600101919060010190612807565b5061282e9291506128e0565b5090565b50805461283e90612e2e565b6000825580601f1061284e575050565b601f016020900490600052602060002090810190611c0e91906128e0565b82805461287890612e2e565b90600052602060002090601f01602090048101928261289a5760008555612822565b82601f106128b357805160ff1916838001178555612822565b82800160010185558215612822579182015b828111156128225782518255916020019190600101906128c5565b5b8082111561282e57600081556001016128e1565b60006020828403121561290757600080fd5b81356001600160e01b03198116811461291f57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561295f5761295f612926565b60405290565b6040516020810167ffffffffffffffff8111828210171561295f5761295f612926565b604051601f8201601f1916810167ffffffffffffffff811182821017156129b1576129b1612926565b604052919050565b6001600160a01b0381168114611c0e57600080fd5b6000606082840312156129e057600080fd5b6040516060810181811067ffffffffffffffff82111715612a0357612a03612926565b6040528235612a11816129b9565b81526020830135612a21816129b9565b60208201526040830135612a34816129b9565b60408201529392505050565b600060208284031215612a5257600080fd5b5035919050565b600080828403610100811215612a6e57600080fd5b8335925060e0601f1982011215612a8457600080fd5b506020830190509250929050565b600060408284031215612aa457600080fd5b50919050565b600060408284031215612abc57600080fd5b61291f8383612a92565b600060208284031215612aa457600080fd5b60008060408385031215612aeb57600080fd5b82359150612afc8460208501612ac6565b90509250929050565b81516001600160a01b039081168252602080840151821690830152604080840151151590830152606080840151908301526080808401519083015260a08381015182169083015260c092830151169181019190915260e00190565b600060208083528351808285015260005b81811015612b8d57858101830151858201604001528201612b71565b81811115612b9f576000604083870101525b50601f01601f1916929092016040019392505050565b606081016105d1828480516001600160a01b03908116835260208083015182169084015260409182015116910152565b60008060608385031215612bf857600080fd5b82359150612afc8460208501612a92565b600060208284031215612c1b57600080fd5b61291f8383612ac6565b600067ffffffffffffffff821115612c3f57612c3f612926565b5060051b60200190565b8035612c54816129b9565b919050565b600082601f830112612c6a57600080fd5b81356020612c7f612c7a83612c25565b612988565b82815260059290921b84018101918181019086841115612c9e57600080fd5b8286015b84811015612cb95780358352918301918301612ca2565b509695505050505050565b60008060008060808587031215612cda57600080fd5b843567ffffffffffffffff80821115612cf257600080fd5b818701915087601f830112612d0657600080fd5b81356020612d16612c7a83612c25565b82815260059290921b8401810191818101908b841115612d3557600080fd5b948201945b83861015612d5c578535612d4d816129b9565b82529482019490820190612d3a565b9850612d6b9050898201612c49565b965050506040870135915080821115612d8357600080fd5b50612d9087828801612c59565b925050612d9f60608601612c49565b905092959194509250565b600060208284031215612dbc57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115612dec57612dec612dc3565b500190565b60808101612e21828580516001600160a01b03908116835260208083015182169084015260409182015116910152565b8260608301529392505050565b600181811c90821680612e4257607f821691505b60208210811415612aa457634e487b7160e01b600052602260045260246000fd5b8051612c54816129b9565b8015158114611c0e57600080fd5b600060e08284031215612e8e57600080fd5b60405160e0810181811067ffffffffffffffff82111715612eb157612eb1612926565b6040528251612ebf816129b9565b81526020830151612ecf816129b9565b60208201526040830151612ee281612e6e565b80604083015250606083015160608201526080830151608082015260a0830151612f0b816129b9565b60a0820152612f1c60c08401612e63565b60c08201529392505050565b600060408284031215612f3a57600080fd5b612f4261293c565b82518152602083015160208201528091505092915050565b8035612f65816129b9565b6001600160a01b039081168352602082013590612f81826129b9565b9081166020840152604082013590612f9882612e6e565b8115156040850152606083013560608501526080830135608085015260a08301359150612fc4826129b9565b90811660a084015260c082013590612fdb826129b9565b80821660c085015250505050565b60e081016105d18284612f5a565b61010081016130068285612f5a565b8260e08301529392505050565b60006020828403121561302557600080fd5b813561291f816129b9565b803582526020810135613042816129b9565b6001600160a01b03166020929092019190915250565b604081016105d18284613030565b606081016130748285613030565b8260408301529392505050565b60006020828403121561309357600080fd5b61309b612965565b9151825250919050565b6000604082840312156130b757600080fd5b6130bf61293c565b8251815260208301516130d1816129b9565b60208201529392505050565b6020810182356130ec81612e6e565b1515909152919050565b60006020828403121561310857600080fd5b613110612965565b825161311b81612e6e565b81529392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561314c57600080fd5b815161291f816129b9565b60006020828403121561316957600080fd5b815161291f81612e6e565b6000602080838503121561318757600080fd5b825167ffffffffffffffff81111561319e57600080fd5b8301601f810185136131af57600080fd5b80516131bd612c7a82612c25565b81815260059190911b820183019083810190878311156131dc57600080fd5b928401925b828410156132035783516131f4816129b9565b825292840192908401906131e1565b979650505050505050565b600060001982141561322257613222612dc3565b5060010190565b600060a08201878352602060a08185015281885180845260c086019150828a01935060005b818110156132735784516001600160a01b03168352938301939183019160010161324e565b50506001600160a01b03881660408601528481036060860152865180825290820192508187019060005b818110156132b95782518552938301939183019160010161329d565b5050506001600160a01b03851660808501525090509695505050505050565b60008160001904831182151516156132f2576132f2612dc3565b50029056fea2646970667358221220de985acfb870c6b544ed3cdb6bb7e2ec33cda0808b9dbf5df7b3f0cffbf04d6d64736f6c63430008090033

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

000000000000000000000000dc9c17662133fb865e7ba3198b67c53a617b2153000000000000000000000000fd23f971696576331fcf96f80a20b4d3b31ca5b20000000000000000000000008f22602d6db68b576784a560b42eff9b32bfd16e00000000000000000000000000000000000000000000000000000000000151800000000000000000000000009d992650b30c6fb7a83e7e7a430b4e015433b838000000000000000000000000acee4a703f27ea1ebcd550511aae58ad012624cc

-----Decoded View---------------
Arg [0] : internalParams_ (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [1] : delayedProtocolParams_ (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [2] : helper_ (address): 0xACEE4A703f27eA1EbCd550511aAE58ad012624CC

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000dc9c17662133fb865e7ba3198b67c53a617b2153
Arg [1] : 000000000000000000000000fd23f971696576331fcf96f80a20b4d3b31ca5b2
Arg [2] : 0000000000000000000000008f22602d6db68b576784a560b42eff9b32bfd16e
Arg [3] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [4] : 0000000000000000000000009d992650b30c6fb7a83e7e7a430b4e015433b838
Arg [5] : 000000000000000000000000acee4a703f27ea1ebcd550511aae58ad012624cc


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.