File size: 85,598 Bytes
f998fcd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
  "language": "Solidity",
  "settings": {
    "evmVersion": "istanbul",
    "libraries": {},
    "metadata": {
      "bytecodeHash": "ipfs",
      "useLiteralContent": true
    },
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "remappings": [],
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    }
  },
  "sources": {
    "@openzeppelin/contracts/access/AccessControl.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n    struct RoleData {\n        mapping(address => bool) members;\n        bytes32 adminRole;\n    }\n\n    mapping(bytes32 => RoleData) private _roles;\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with a standardized message including the required role.\n     *\n     * The format of the revert reason is given by the following regular expression:\n     *\n     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n     *\n     * _Available since v4.1._\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role, _msgSender());\n        _;\n    }\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) public view override returns (bool) {\n        return _roles[role].members[account];\n    }\n\n    /**\n     * @dev Revert with a standard message if `account` is missing `role`.\n     *\n     * The format of the revert reason is given by the following regular expression:\n     *\n     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n     */\n    function _checkRole(bytes32 role, address account) internal view {\n        if (!hasRole(role, account)) {\n            revert(\n                string(\n                    abi.encodePacked(\n                        \"AccessControl: account \",\n                        Strings.toHexString(uint160(account), 20),\n                        \" is missing role \",\n                        Strings.toHexString(uint256(role), 32)\n                    )\n                )\n            );\n        }\n    }\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {\n        return _roles[role].adminRole;\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been revoked `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) public virtual override {\n        require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n        _revokeRole(role, account);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event. Note that unlike {grantRole}, this function doesn't perform any\n     * checks on the calling account.\n     *\n     * [WARNING]\n     * ====\n     * This function should only be called from the constructor when setting\n     * up the initial roles for the system.\n     *\n     * Using this function in any other way is effectively circumventing the admin\n     * system imposed by {AccessControl}.\n     * ====\n     *\n     * NOTE: This function is deprecated in favor of {_grantRole}.\n     */\n    function _setupRole(bytes32 role, address account) internal virtual {\n        _grantRole(role, account);\n    }\n\n    /**\n     * @dev Sets `adminRole` as ``role``'s admin role.\n     *\n     * Emits a {RoleAdminChanged} event.\n     */\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        _roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * Internal function without access restriction.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual {\n        if (!hasRole(role, account)) {\n            _roles[role].members[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n        }\n    }\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * Internal function without access restriction.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual {\n        if (hasRole(role, account)) {\n            _roles[role].members[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n        }\n    }\n}\n"
    },
    "@openzeppelin/contracts/access/AccessControlEnumerable.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControlEnumerable.sol\";\nimport \"./AccessControl.sol\";\nimport \"../utils/structs/EnumerableSet.sol\";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n    using EnumerableSet for EnumerableSet.AddressSet;\n\n    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev Returns one of the accounts that have `role`. `index` must be a\n     * value between 0 and {getRoleMemberCount}, non-inclusive.\n     *\n     * Role bearers are not sorted in any particular way, and their ordering may\n     * change at any point.\n     *\n     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n     * you perform all queries on the same block. See the following\n     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n     * for more information.\n     */\n    function getRoleMember(bytes32 role, uint256 index) public view override returns (address) {\n        return _roleMembers[role].at(index);\n    }\n\n    /**\n     * @dev Returns the number of accounts that have `role`. Can be used\n     * together with {getRoleMember} to enumerate all bearers of a role.\n     */\n    function getRoleMemberCount(bytes32 role) public view override returns (uint256) {\n        return _roleMembers[role].length();\n    }\n\n    /**\n     * @dev Overload {_grantRole} to track enumerable memberships\n     */\n    function _grantRole(bytes32 role, address account) internal virtual override {\n        super._grantRole(role, account);\n        _roleMembers[role].add(account);\n    }\n\n    /**\n     * @dev Overload {_revokeRole} to track enumerable memberships\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual override {\n        super._revokeRole(role, account);\n        _roleMembers[role].remove(account);\n    }\n}\n"
    },
    "@openzeppelin/contracts/access/IAccessControl.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {AccessControl-_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) external;\n}\n"
    },
    "@openzeppelin/contracts/access/IAccessControlEnumerable.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n    /**\n     * @dev Returns one of the accounts that have `role`. `index` must be a\n     * value between 0 and {getRoleMemberCount}, non-inclusive.\n     *\n     * Role bearers are not sorted in any particular way, and their ordering may\n     * change at any point.\n     *\n     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n     * you perform all queries on the same block. See the following\n     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n     * for more information.\n     */\n    function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n    /**\n     * @dev Returns the number of accounts that have `role`. Can be used\n     * together with {getRoleMember} to enumerate all bearers of a role.\n     */\n    function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n"
    },
    "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `recipient`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address sender,\n        address recipient,\n        uint256 amount\n    ) external returns (bool);\n\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
    },
    "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    function safeTransfer(\n        IERC20 token,\n        address to,\n        uint256 value\n    ) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    function safeTransferFrom(\n        IERC20 token,\n        address from,\n        address to,\n        uint256 value\n    ) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    function safeIncreaseAllowance(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        uint256 newAllowance = token.allowance(address(this), spender) + value;\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    function safeDecreaseAllowance(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            uint256 newAllowance = oldAllowance - value;\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        if (returndata.length > 0) {\n            // Return data is optional\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n        }\n    }\n}\n"
    },
    "@openzeppelin/contracts/token/ERC721/IERC721.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n    /**\n     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n     */\n    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n     */\n    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n    /**\n     * @dev Returns the number of tokens in ``owner``'s account.\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId) external view returns (address owner);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n     * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Transfers `tokenId` token from `from` to `to`.\n     *\n     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n     * The approval is cleared when the token is transferred.\n     *\n     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n     *\n     * Requirements:\n     *\n     * - The caller must own the token or be an approved operator.\n     * - `tokenId` must exist.\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address to, uint256 tokenId) external;\n\n    /**\n     * @dev Returns the account approved for `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function getApproved(uint256 tokenId) external view returns (address operator);\n\n    /**\n     * @dev Approve or remove `operator` as an operator for the caller.\n     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n     *\n     * Requirements:\n     *\n     * - The `operator` cannot be the caller.\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function setApprovalForAll(address operator, bool _approved) external;\n\n    /**\n     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n     *\n     * See {setApprovalForAll}\n     */\n    function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes calldata data\n    ) external;\n}\n"
    },
    "@openzeppelin/contracts/utils/Address.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize, which returns 0 for contracts in\n        // construction, since the code is only stored at the end of the\n        // constructor execution.\n\n        uint256 size;\n        assembly {\n            size := extcodesize(account)\n        }\n        return size > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(isContract(target), \"Address: delegate call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length > 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/Context.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/Strings.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        // Inspired by OraclizeAPI's implementation - MIT licence\n        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n        if (value == 0) {\n            return \"0\";\n        }\n        uint256 temp = value;\n        uint256 digits;\n        while (temp != 0) {\n            digits++;\n            temp /= 10;\n        }\n        bytes memory buffer = new bytes(digits);\n        while (value != 0) {\n            digits -= 1;\n            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n            value /= 10;\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        if (value == 0) {\n            return \"0x00\";\n        }\n        uint256 temp = value;\n        uint256 length = 0;\n        while (temp != 0) {\n            length++;\n            temp >>= 8;\n        }\n        return toHexString(value, length);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _HEX_SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Trees proofs.\n *\n * The proofs can be generated using the JavaScript library\n * https://github.com/miguelmota/merkletreejs[merkletreejs].\n * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.\n *\n * See `test/utils/cryptography/MerkleProof.test.js` for some examples.\n */\nlibrary MerkleProof {\n    /**\n     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n     * defined by `root`. For this, a `proof` must be provided, containing\n     * sibling hashes on the branch from the leaf to the root of the tree. Each\n     * pair of leaves and each pair of pre-images are assumed to be sorted.\n     */\n    function verify(\n        bytes32[] memory proof,\n        bytes32 root,\n        bytes32 leaf\n    ) internal pure returns (bool) {\n        return processProof(proof, leaf) == root;\n    }\n\n    /**\n     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up\n     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n     * hash matches the root of the tree. When processing the proof, the pairs\n     * of leafs & pre-images are assumed to be sorted.\n     *\n     * _Available since v4.4._\n     */\n    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\n        bytes32 computedHash = leaf;\n        for (uint256 i = 0; i < proof.length; i++) {\n            bytes32 proofElement = proof[i];\n            if (computedHash <= proofElement) {\n                // Hash(current computed hash + current element of the proof)\n                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));\n            } else {\n                // Hash(current element of the proof + current computed hash)\n                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));\n            }\n        }\n        return computedHash;\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/introspection/ERC165.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/introspection/IERC165.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
    },
    "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (utils/structs/EnumerableSet.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n    // To implement this library for multiple types with as little code\n    // repetition as possible, we write it in terms of a generic Set type with\n    // bytes32 values.\n    // The Set implementation uses private functions, and user-facing\n    // implementations (such as AddressSet) are just wrappers around the\n    // underlying Set.\n    // This means that we can only create new EnumerableSets for types that fit\n    // in bytes32.\n\n    struct Set {\n        // Storage of set values\n        bytes32[] _values;\n        // Position of the value in the `values` array, plus 1 because index 0\n        // means a value is not in the set.\n        mapping(bytes32 => uint256) _indexes;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function _add(Set storage set, bytes32 value) private returns (bool) {\n        if (!_contains(set, value)) {\n            set._values.push(value);\n            // The value is stored at length-1, but we add 1 to all indexes\n            // and use 0 as a sentinel value\n            set._indexes[value] = set._values.length;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function _remove(Set storage set, bytes32 value) private returns (bool) {\n        // We read and store the value's index to prevent multiple reads from the same storage slot\n        uint256 valueIndex = set._indexes[value];\n\n        if (valueIndex != 0) {\n            // Equivalent to contains(set, value)\n            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n            // the array, and then remove the last element (sometimes called as 'swap and pop').\n            // This modifies the order of the array, as noted in {at}.\n\n            uint256 toDeleteIndex = valueIndex - 1;\n            uint256 lastIndex = set._values.length - 1;\n\n            if (lastIndex != toDeleteIndex) {\n                bytes32 lastvalue = set._values[lastIndex];\n\n                // Move the last value to the index where the value to delete is\n                set._values[toDeleteIndex] = lastvalue;\n                // Update the index for the moved value\n                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex\n            }\n\n            // Delete the slot where the moved value was stored\n            set._values.pop();\n\n            // Delete the index for the deleted slot\n            delete set._indexes[value];\n\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function _contains(Set storage set, bytes32 value) private view returns (bool) {\n        return set._indexes[value] != 0;\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function _length(Set storage set) private view returns (uint256) {\n        return set._values.length;\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function _at(Set storage set, uint256 index) private view returns (bytes32) {\n        return set._values[index];\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function _values(Set storage set) private view returns (bytes32[] memory) {\n        return set._values;\n    }\n\n    // Bytes32Set\n\n    struct Bytes32Set {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _add(set._inner, value);\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n        return _remove(set._inner, value);\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n        return _contains(set._inner, value);\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(Bytes32Set storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n        return _at(set._inner, index);\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n        return _values(set._inner);\n    }\n\n    // AddressSet\n\n    struct AddressSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(AddressSet storage set, address value) internal returns (bool) {\n        return _add(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(AddressSet storage set, address value) internal returns (bool) {\n        return _remove(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(AddressSet storage set, address value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(uint256(uint160(value))));\n    }\n\n    /**\n     * @dev Returns the number of values in the set. O(1).\n     */\n    function length(AddressSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(AddressSet storage set, uint256 index) internal view returns (address) {\n        return address(uint160(uint256(_at(set._inner, index))));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(AddressSet storage set) internal view returns (address[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        address[] memory result;\n\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n\n    // UintSet\n\n    struct UintSet {\n        Set _inner;\n    }\n\n    /**\n     * @dev Add a value to a set. O(1).\n     *\n     * Returns true if the value was added to the set, that is if it was not\n     * already present.\n     */\n    function add(UintSet storage set, uint256 value) internal returns (bool) {\n        return _add(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Removes a value from a set. O(1).\n     *\n     * Returns true if the value was removed from the set, that is if it was\n     * present.\n     */\n    function remove(UintSet storage set, uint256 value) internal returns (bool) {\n        return _remove(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns true if the value is in the set. O(1).\n     */\n    function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n        return _contains(set._inner, bytes32(value));\n    }\n\n    /**\n     * @dev Returns the number of values on the set. O(1).\n     */\n    function length(UintSet storage set) internal view returns (uint256) {\n        return _length(set._inner);\n    }\n\n    /**\n     * @dev Returns the value stored at position `index` in the set. O(1).\n     *\n     * Note that there are no guarantees on the ordering of values inside the\n     * array, and it may change when more values are added or removed.\n     *\n     * Requirements:\n     *\n     * - `index` must be strictly less than {length}.\n     */\n    function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n        return uint256(_at(set._inner, index));\n    }\n\n    /**\n     * @dev Return the entire set in an array\n     *\n     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n     * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n     */\n    function values(UintSet storage set) internal view returns (uint256[] memory) {\n        bytes32[] memory store = _values(set._inner);\n        uint256[] memory result;\n\n        assembly {\n            result := store\n        }\n\n        return result;\n    }\n}\n"
    },
    "contracts/interfaces/IProtocolGovernance.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"./utils/IDefaultAccessControl.sol\";\nimport \"./IUnitPricesGovernance.sol\";\n\ninterface IProtocolGovernance is IDefaultAccessControl, IUnitPricesGovernance {\n    /// @notice CommonLibrary protocol params.\n    /// @param maxTokensPerVault Max different token addresses that could be managed by the vault\n    /// @param governanceDelay The delay (in secs) that must pass before setting new pending params to commiting them\n    /// @param protocolTreasury The address that collects protocolFees, if protocolFee is not zero\n    /// @param forceAllowMask If a permission bit is set in this mask it forces all addresses to have this permission as true\n    /// @param withdrawLimit Withdraw limit (in unit prices, i.e. usd)\n    struct Params {\n        uint256 maxTokensPerVault;\n        uint256 governanceDelay;\n        address protocolTreasury;\n        uint256 forceAllowMask;\n        uint256 withdrawLimit;\n    }\n\n    // -------------------  EXTERNAL, VIEW  -------------------\n\n    /// @notice Timestamp after which staged granted permissions for the given address can be committed.\n    /// @param target The given address\n    /// @return Zero if there are no staged permission grants, timestamp otherwise\n    function stagedPermissionGrantsTimestamps(address target) external view returns (uint256);\n\n    /// @notice Staged granted permission bitmask for the given address.\n    /// @param target The given address\n    /// @return Bitmask\n    function stagedPermissionGrantsMasks(address target) external view returns (uint256);\n\n    /// @notice Permission bitmask for the given address.\n    /// @param target The given address\n    /// @return Bitmask\n    function permissionMasks(address target) external view returns (uint256);\n\n    /// @notice Timestamp after which staged pending protocol parameters can be committed\n    /// @return Zero if there are no staged parameters, timestamp otherwise.\n    function stagedParamsTimestamp() external view returns (uint256);\n\n    /// @notice Staged pending protocol parameters.\n    function stagedParams() external view returns (Params memory);\n\n    /// @notice Current protocol parameters.\n    function params() external view returns (Params memory);\n\n    /// @notice Addresses for which non-zero permissions are set.\n    function permissionAddresses() external view returns (address[] memory);\n\n    /// @notice Permission addresses staged for commit.\n    function stagedPermissionGrantsAddresses() external view returns (address[] memory);\n\n    /// @notice Return all addresses where rawPermissionMask bit for permissionId is set to 1.\n    /// @param permissionId Id of the permission to check.\n    /// @return A list of dirty addresses.\n    function addressesByPermission(uint8 permissionId) external view returns (address[] memory);\n\n    /// @notice Checks if address has permission or given permission is force allowed for any address.\n    /// @param addr Address to check\n    /// @param permissionId Permission to check\n    function hasPermission(address addr, uint8 permissionId) external view returns (bool);\n\n    /// @notice Checks if address has all permissions.\n    /// @param target Address to check\n    /// @param permissionIds A list of permissions to check\n    function hasAllPermissions(address target, uint8[] calldata permissionIds) external view returns (bool);\n\n    /// @notice Max different ERC20 token addresses that could be managed by the protocol.\n    function maxTokensPerVault() external view returns (uint256);\n\n    /// @notice The delay for committing any governance params.\n    function governanceDelay() external view returns (uint256);\n\n    /// @notice The address of the protocol treasury.\n    function protocolTreasury() external view returns (address);\n\n    /// @notice Permissions mask which defines if ordinary permission should be reverted.\n    /// This bitmask is xored with ordinary mask.\n    function forceAllowMask() external view returns (uint256);\n\n    /// @notice Withdraw limit per token per block.\n    /// @param token Address of the token\n    /// @return Withdraw limit per token per block\n    function withdrawLimit(address token) external view returns (uint256);\n\n    /// @notice Addresses that has staged validators.\n    function stagedValidatorsAddresses() external view returns (address[] memory);\n\n    /// @notice Timestamp after which staged granted permissions for the given address can be committed.\n    /// @param target The given address\n    /// @return Zero if there are no staged permission grants, timestamp otherwise\n    function stagedValidatorsTimestamps(address target) external view returns (uint256);\n\n    /// @notice Staged validator for the given address.\n    /// @param target The given address\n    /// @return Validator\n    function stagedValidators(address target) external view returns (address);\n\n    /// @notice Addresses that has validators.\n    function validatorsAddresses() external view returns (address[] memory);\n\n    /// @notice Address that has validators.\n    /// @param i The number of address\n    /// @return Validator address\n    function validatorsAddress(uint256 i) external view returns (address);\n\n    /// @notice Validator for the given address.\n    /// @param target The given address\n    /// @return Validator\n    function validators(address target) external view returns (address);\n\n    // -------------------  EXTERNAL, MUTATING, GOVERNANCE, IMMEDIATE  -------------------\n\n    /// @notice Rollback all staged validators.\n    function rollbackStagedValidators() external;\n\n    /// @notice Revoke validator instantly from the given address.\n    /// @param target The given address\n    function revokeValidator(address target) external;\n\n    /// @notice Stages a new validator for the given address\n    /// @param target The given address\n    /// @param validator The validator for the given address\n    function stageValidator(address target, address validator) external;\n\n    /// @notice Commits validator for the given address.\n    /// @dev Reverts if governance delay has not passed yet.\n    /// @param target The given address.\n    function commitValidator(address target) external;\n\n    /// @notice Commites all staged validators for which governance delay passed\n    /// @return Addresses for which validators were committed\n    function commitAllValidatorsSurpassedDelay() external returns (address[] memory);\n\n    /// @notice Rollback all staged granted permission grant.\n    function rollbackStagedPermissionGrants() external;\n\n    /// @notice Commits permission grants for the given address.\n    /// @dev Reverts if governance delay has not passed yet.\n    /// @param target The given address.\n    function commitPermissionGrants(address target) external;\n\n    /// @notice Commites all staged permission grants for which governance delay passed.\n    /// @return An array of addresses for which permission grants were committed.\n    function commitAllPermissionGrantsSurpassedDelay() external returns (address[] memory);\n\n    /// @notice Revoke permission instantly from the given address.\n    /// @param target The given address.\n    /// @param permissionIds A list of permission ids to revoke.\n    function revokePermissions(address target, uint8[] memory permissionIds) external;\n\n    /// @notice Commits staged protocol params.\n    /// Reverts if governance delay has not passed yet.\n    function commitParams() external;\n\n    // -------------------  EXTERNAL, MUTATING, GOVERNANCE, DELAY  -------------------\n\n    /// @notice Sets new pending params that could have been committed after governance delay expires.\n    /// @param newParams New protocol parameters to set.\n    function stageParams(Params memory newParams) external;\n\n    /// @notice Stage granted permissions that could have been committed after governance delay expires.\n    /// Resets commit delay and permissions if there are already staged permissions for this address.\n    /// @param target Target address\n    /// @param permissionIds A list of permission ids to grant\n    function stagePermissionGrants(address target, uint8[] memory permissionIds) external;\n}\n"
    },
    "contracts/interfaces/IUnitPricesGovernance.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"./utils/IDefaultAccessControl.sol\";\n\ninterface IUnitPricesGovernance is IDefaultAccessControl, IERC165 {\n    // -------------------  EXTERNAL, VIEW  -------------------\n\n    /// @notice Estimated amount of token worth 1 USD staged for commit.\n    /// @param token Address of the token\n    /// @return The amount of token\n    function stagedUnitPrices(address token) external view returns (uint256);\n\n    /// @notice Timestamp after which staged unit prices for the given token can be committed.\n    /// @param token Address of the token\n    /// @return Timestamp\n    function stagedUnitPricesTimestamps(address token) external view returns (uint256);\n\n    /// @notice Estimated amount of token worth 1 USD.\n    /// @param token Address of the token\n    /// @return The amount of token\n    function unitPrices(address token) external view returns (uint256);\n\n    // -------------------  EXTERNAL, MUTATING  -------------------\n\n    /// @notice Stage estimated amount of token worth 1 USD staged for commit.\n    /// @param token Address of the token\n    /// @param value The amount of token\n    function stageUnitPrice(address token, uint256 value) external;\n\n    /// @notice Reset staged value\n    /// @param token Address of the token\n    function rollbackUnitPrice(address token) external;\n\n    /// @notice Commit staged unit price\n    /// @param token Address of the token\n    function commitUnitPrice(address token) external;\n}\n"
    },
    "contracts/interfaces/IVaultRegistry.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity =0.8.9;\n\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\nimport \"./IProtocolGovernance.sol\";\n\ninterface IVaultRegistry is IERC721 {\n    /// @notice Get Vault for the giver NFT ID.\n    /// @param nftId NFT ID\n    /// @return vault Address of the Vault contract\n    function vaultForNft(uint256 nftId) external view returns (address vault);\n\n    /// @notice Get NFT ID for given Vault contract address.\n    /// @param vault Address of the Vault contract\n    /// @return nftId NFT ID\n    function nftForVault(address vault) external view returns (uint256 nftId);\n\n    /// @notice Checks if the nft is locked for all transfers\n    /// @param nft NFT to check for lock\n    /// @return `true` if locked, false otherwise\n    function isLocked(uint256 nft) external view returns (bool);\n\n    /// @notice Register new Vault and mint NFT.\n    /// @param vault address of the vault\n    /// @param owner owner of the NFT\n    /// @return nft Nft minted for the given Vault\n    function registerVault(address vault, address owner) external returns (uint256 nft);\n\n    /// @notice Number of Vaults registered.\n    function vaultsCount() external view returns (uint256);\n\n    /// @notice All Vaults registered.\n    function vaults() external view returns (address[] memory);\n\n    /// @notice Address of the ProtocolGovernance.\n    function protocolGovernance() external view returns (IProtocolGovernance);\n\n    /// @notice Address of the staged ProtocolGovernance.\n    function stagedProtocolGovernance() external view returns (IProtocolGovernance);\n\n    /// @notice Minimal timestamp when staged ProtocolGovernance can be applied.\n    function stagedProtocolGovernanceTimestamp() external view returns (uint256);\n\n    /// @notice Stage new ProtocolGovernance.\n    /// @param newProtocolGovernance new ProtocolGovernance\n    function stageProtocolGovernance(IProtocolGovernance newProtocolGovernance) external;\n\n    /// @notice Commit new ProtocolGovernance.\n    function commitStagedProtocolGovernance() external;\n\n    /// @notice Lock NFT for transfers\n    /// @dev Use this method when vault structure is set up and should become immutable. Can be called by owner.\n    /// @param nft - NFT to lock\n    function lockNft(uint256 nft) external;\n}\n"
    },
    "contracts/interfaces/oracles/IOracle.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\ninterface IOracle {\n    /// @notice Oracle price for tokens as a Q64.96 value.\n    /// @notice Returns pricing information based on the indexes of non-zero bits in safetyIndicesSet.\n    /// @notice It is possible that not all indices will have their respective prices returned.\n    /// @dev The price is token1 / token0 i.e. how many weis of token1 required for 1 wei of token0.\n    /// The safety indexes are:\n    ///\n    /// 1 - unsafe, this is typically a spot price that can be easily manipulated,\n    ///\n    /// 2 - 4 - more or less safe, this is typically a uniV3 oracle, where the safety is defined by the timespan of the average price\n    ///\n    /// 5 - safe - this is typically a chailink oracle\n    /// @param token0 Reference to token0\n    /// @param token1 Reference to token1\n    /// @param safetyIndicesSet Bitmask of safety indices that are allowed for the return prices. For set of safety indexes = { 1 }, safetyIndicesSet = 0x2\n    /// @return pricesX96 Prices that satisfy safetyIndex and tokens\n    /// @return safetyIndices Safety indices for those prices\n    function priceX96(\n        address token0,\n        address token1,\n        uint256 safetyIndicesSet\n    ) external view returns (uint256[] memory pricesX96, uint256[] memory safetyIndices);\n}\n"
    },
    "contracts/interfaces/utils/IDefaultAccessControl.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"@openzeppelin/contracts/access/IAccessControlEnumerable.sol\";\n\ninterface IDefaultAccessControl is IAccessControlEnumerable {\n    /// @notice Checks that the address is contract admin.\n    /// @param who Address to check\n    /// @return `true` if who is admin, `false` otherwise\n    function isAdmin(address who) external view returns (bool);\n\n    /// @notice Checks that the address is contract admin.\n    /// @param who Address to check\n    /// @return `true` if who is operator, `false` otherwise\n    function isOperator(address who) external view returns (bool);\n}\n"
    },
    "contracts/interfaces/utils/IERC20RootVaultHelper.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"../oracles/IOracle.sol\";\n\ninterface IERC20RootVaultHelper {\n    function getTvlToken0(\n        uint256[] calldata tvls,\n        address[] calldata tokens,\n        IOracle oracle\n    ) external view returns (uint256 tvl0);\n}\n"
    },
    "contracts/interfaces/vaults/IAggregateVault.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"./IVault.sol\";\nimport \"./IVaultRoot.sol\";\n\ninterface IAggregateVault is IVault, IVaultRoot {}\n"
    },
    "contracts/interfaces/vaults/IERC20RootVault.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"./IAggregateVault.sol\";\nimport \"../utils/IERC20RootVaultHelper.sol\";\n\ninterface IERC20RootVault is IAggregateVault, IERC20 {\n    /// @notice Initialized a new contract.\n    /// @dev Can only be initialized by vault governance\n    /// @param nft_ NFT of the vault in the VaultRegistry\n    /// @param vaultTokens_ ERC20 tokens that will be managed by this Vault\n    /// @param strategy_ The address that will have approvals for subvaultNfts\n    /// @param subvaultNfts_ The NFTs of the subvaults that will be aggregated by this ERC20RootVault\n    function initialize(\n        uint256 nft_,\n        address[] memory vaultTokens_,\n        address strategy_,\n        uint256[] memory subvaultNfts_,\n        IERC20RootVaultHelper helper_\n    ) external;\n\n    /// @notice The timestamp of last charging of fees\n    function lastFeeCharge() external view returns (uint64);\n\n    /// @notice The timestamp of last updating totalWithdrawnAmounts array\n    function totalWithdrawnAmountsTimestamp() external view returns (uint64);\n\n    /// @notice Returns value from totalWithdrawnAmounts array by _index\n    /// @param _index The index at which the value will be returned\n    function totalWithdrawnAmounts(uint256 _index) external view returns (uint256);\n\n    /// @notice LP parameter that controls the charge in performance fees\n    function lpPriceHighWaterMarkD18() external view returns (uint256);\n\n    /// @notice List of addresses of depositors from which interaction with private vaults is allowed\n    function depositorsAllowlist() external view returns (address[] memory);\n\n    /// @notice Add new depositors in the depositorsAllowlist\n    /// @param depositors Array of new depositors\n    /// @dev The action can be done only by user with admins, owners or by approved rights\n    function addDepositorsToAllowlist(address[] calldata depositors) external;\n\n    /// @notice Remove depositors from the depositorsAllowlist\n    /// @param depositors Array of depositors for remove\n    /// @dev The action can be done only by user with admins, owners or by approved rights\n    function removeDepositorsFromAllowlist(address[] calldata depositors) external;\n\n    /// @notice The function of depositing the amount of tokens in exchange\n    /// @param tokenAmounts Array of amounts of tokens for deposit\n    /// @param minLpTokens Minimal value of LP tokens\n    /// @param vaultOptions Options of vaults\n    /// @return actualTokenAmounts Arrays of actual token amounts after deposit\n    function deposit(\n        uint256[] memory tokenAmounts,\n        uint256 minLpTokens,\n        bytes memory vaultOptions\n    ) external returns (uint256[] memory actualTokenAmounts);\n\n    /// @notice The function of withdrawing the amount of tokens in exchange\n    /// @param to Address to which the withdrawal will be sent\n    /// @param lpTokenAmount LP token amount, that requested for withdraw\n    /// @param minTokenAmounts Array of minmal remining wtoken amounts after withdrawal\n    /// @param vaultsOptions Options of vaults\n    /// @return actualTokenAmounts Arrays of actual token amounts after withdrawal\n    function withdraw(\n        address to,\n        uint256 lpTokenAmount,\n        uint256[] memory minTokenAmounts,\n        bytes[] memory vaultsOptions\n    ) external returns (uint256[] memory actualTokenAmounts);\n}\n"
    },
    "contracts/interfaces/vaults/IVault.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"./IVaultGovernance.sol\";\n\ninterface IVault is IERC165 {\n    /// @notice Checks if the vault is initialized\n\n    function initialized() external view returns (bool);\n\n    /// @notice VaultRegistry NFT for this vault\n    function nft() external view returns (uint256);\n\n    /// @notice Address of the Vault Governance for this contract.\n    function vaultGovernance() external view returns (IVaultGovernance);\n\n    /// @notice ERC20 tokens under Vault management.\n    function vaultTokens() external view returns (address[] memory);\n\n    /// @notice Checks if a token is vault token\n    /// @param token Address of the token to check\n    /// @return `true` if this token is managed by Vault\n    function isVaultToken(address token) external view returns (bool);\n\n    /// @notice Total value locked for this contract.\n    /// @dev Generally it is the underlying token value of this contract in some\n    /// other DeFi protocol. For example, for USDC Yearn Vault this would be total USDC balance that could be withdrawn for Yearn to this contract.\n    /// The tvl itself is estimated in some range. Sometimes the range is exact, sometimes it's not\n    /// @return minTokenAmounts Lower bound for total available balances estimation (nth tokenAmount corresponds to nth token in vaultTokens)\n    /// @return maxTokenAmounts Upper bound for total available balances estimation (nth tokenAmount corresponds to nth token in vaultTokens)\n    function tvl() external view returns (uint256[] memory minTokenAmounts, uint256[] memory maxTokenAmounts);\n\n    /// @notice Existential amounts for each token\n    function pullExistentials() external view returns (uint256[] memory);\n}\n"
    },
    "contracts/interfaces/vaults/IVaultGovernance.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"../IProtocolGovernance.sol\";\nimport \"../IVaultRegistry.sol\";\nimport \"./IVault.sol\";\n\ninterface IVaultGovernance {\n    /// @notice Internal references of the contract.\n    /// @param protocolGovernance Reference to Protocol Governance\n    /// @param registry Reference to Vault Registry\n    struct InternalParams {\n        IProtocolGovernance protocolGovernance;\n        IVaultRegistry registry;\n        IVault singleton;\n    }\n\n    // -------------------  EXTERNAL, VIEW  -------------------\n\n    /// @notice Timestamp in unix time seconds after which staged Delayed Strategy Params could be committed.\n    /// @param nft Nft of the vault\n    function delayedStrategyParamsTimestamp(uint256 nft) external view returns (uint256);\n\n    /// @notice Timestamp in unix time seconds after which staged Delayed Protocol Params could be committed.\n    function delayedProtocolParamsTimestamp() external view returns (uint256);\n\n    /// @notice Timestamp in unix time seconds after which staged Delayed Protocol Params Per Vault could be committed.\n    /// @param nft Nft of the vault\n    function delayedProtocolPerVaultParamsTimestamp(uint256 nft) external view returns (uint256);\n\n    /// @notice Timestamp in unix time seconds after which staged Internal Params could be committed.\n    function internalParamsTimestamp() external view returns (uint256);\n\n    /// @notice Internal Params of the contract.\n    function internalParams() external view returns (InternalParams memory);\n\n    /// @notice Staged new Internal Params.\n    /// @dev The Internal Params could be committed after internalParamsTimestamp\n    function stagedInternalParams() external view returns (InternalParams memory);\n\n    // -------------------  EXTERNAL, MUTATING  -------------------\n\n    /// @notice Stage new Internal Params.\n    /// @param newParams New Internal Params\n    function stageInternalParams(InternalParams memory newParams) external;\n\n    /// @notice Commit staged Internal Params.\n    function commitInternalParams() external;\n}\n"
    },
    "contracts/interfaces/vaults/IVaultRoot.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\ninterface IVaultRoot {\n    /// @notice Checks if subvault is present\n    /// @param nft_ index of subvault for check\n    /// @return `true` if subvault present, `false` otherwise\n    function hasSubvault(uint256 nft_) external view returns (bool);\n\n    /// @notice Get subvault by index\n    /// @param index Index of subvault\n    /// @return address Address of the contract\n    function subvaultAt(uint256 index) external view returns (address);\n\n    /// @notice Get index of subvault by nft\n    /// @param nft_ Nft for getting subvault\n    /// @return index Index of subvault\n    function subvaultOneBasedIndex(uint256 nft_) external view returns (uint256);\n\n    /// @notice Get all subvalutNfts in the current Vault\n    /// @return subvaultNfts Subvaults of NTFs\n    function subvaultNfts() external view returns (uint256[] memory);\n}\n"
    },
    "contracts/libraries/ExceptionsLibrary.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\n/// @notice Exceptions stores project`s smart-contracts exceptions\nlibrary ExceptionsLibrary {\n    string constant ADDRESS_ZERO = \"AZ\";\n    string constant VALUE_ZERO = \"VZ\";\n    string constant EMPTY_LIST = \"EMPL\";\n    string constant NOT_FOUND = \"NF\";\n    string constant INIT = \"INIT\";\n    string constant DUPLICATE = \"DUP\";\n    string constant NULL = \"NULL\";\n    string constant TIMESTAMP = \"TS\";\n    string constant FORBIDDEN = \"FRB\";\n    string constant ALLOWLIST = \"ALL\";\n    string constant LIMIT_OVERFLOW = \"LIMO\";\n    string constant LIMIT_UNDERFLOW = \"LIMU\";\n    string constant INVALID_VALUE = \"INV\";\n    string constant INVARIANT = \"INVA\";\n    string constant INVALID_TARGET = \"INVTR\";\n    string constant INVALID_TOKEN = \"INVTO\";\n    string constant INVALID_INTERFACE = \"INVI\";\n    string constant INVALID_SELECTOR = \"INVS\";\n    string constant INVALID_STATE = \"INVST\";\n    string constant INVALID_LENGTH = \"INVL\";\n    string constant LOCK = \"LCKD\";\n    string constant DISABLED = \"DIS\";\n}\n"
    },
    "contracts/utils/DefaultAccessControl.sol": {
      "content": "// SPDX-License-Identifier: BSL-1.1\npragma solidity 0.8.9;\n\nimport \"@openzeppelin/contracts/access/AccessControlEnumerable.sol\";\nimport \"../interfaces/utils/IDefaultAccessControl.sol\";\nimport \"../libraries/ExceptionsLibrary.sol\";\n\n/// @notice This is a default access control with 3 roles:\n///\n/// - ADMIN: allowed to do anything\n/// - ADMIN_DELEGATE: allowed to do anything except assigning ADMIN and ADMIN_DELEGATE roles\n/// - OPERATOR: low-privileged role, generally keeper or some other bot\ncontract DefaultAccessControl is IDefaultAccessControl, AccessControlEnumerable {\n    bytes32 public constant OPERATOR = keccak256(\"operator\");\n    bytes32 public constant ADMIN_ROLE = keccak256(\"admin\");\n    bytes32 public constant ADMIN_DELEGATE_ROLE = keccak256(\"admin_delegate\");\n\n    /// @notice Creates a new contract.\n    /// @param admin Admin of the contract\n    constructor(address admin) {\n        require(admin != address(0), ExceptionsLibrary.ADDRESS_ZERO);\n\n        _setupRole(OPERATOR, admin);\n        _setupRole(ADMIN_ROLE, admin);\n\n        _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);\n        _setRoleAdmin(ADMIN_DELEGATE_ROLE, ADMIN_ROLE);\n        _setRoleAdmin(OPERATOR, ADMIN_DELEGATE_ROLE);\n    }\n\n    // -------------------------  EXTERNAL, VIEW  ------------------------------\n\n    /// @notice Checks if the address is ADMIN or ADMIN_DELEGATE.\n    /// @param sender Adddress to check\n    /// @return `true` if sender is an admin, `false` otherwise\n    function isAdmin(address sender) public view returns (bool) {\n        return hasRole(ADMIN_ROLE, sender) || hasRole(ADMIN_DELEGATE_ROLE, sender);\n    }\n\n    /// @notice Checks if the address is OPERATOR.\n    /// @param sender Adddress to check\n    /// @return `true` if sender is an admin, `false` otherwise\n    function isOperator(address sender) public view returns (bool) {\n        return hasRole(OPERATOR, sender);\n    }\n\n    // -------------------------  INTERNAL, VIEW  ------------------------------\n\n    function _requireAdmin() internal view {\n        require(isAdmin(msg.sender), ExceptionsLibrary.FORBIDDEN);\n    }\n\n    function _requireAtLeastOperator() internal view {\n        require(isAdmin(msg.sender) || isOperator(msg.sender), ExceptionsLibrary.FORBIDDEN);\n    }\n}\n"
    },
    "contracts/utils/WhiteList.sol": {
      "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.9;\n\nimport \"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"../libraries/ExceptionsLibrary.sol\";\nimport \"../interfaces/vaults/IERC20RootVault.sol\";\nimport \"./DefaultAccessControl.sol\";\n\ncontract WhiteList is DefaultAccessControl {\n    using SafeERC20 for IERC20;\n\n    bytes32 public root;\n\n    constructor(address admin) DefaultAccessControl(admin) {}\n\n    // -------------------  EXTERNAL, MUTATING  -------------------\n\n    function deposit(\n        IERC20RootVault vault,\n        uint256[] calldata tokenAmounts,\n        uint256 minLpTokens,\n        bytes calldata vaultOptions,\n        bytes32[] calldata proof\n    ) external returns (uint256[] memory actualTokenAmounts) {\n        bytes32 leaf = keccak256(abi.encodePacked(msg.sender));\n        require(MerkleProof.verify(proof, root, leaf), ExceptionsLibrary.FORBIDDEN);\n\n        address[] memory tokens = vault.vaultTokens();\n        for (uint256 i = 0; i < tokens.length; ++i) {\n            IERC20(tokens[i]).safeTransferFrom(msg.sender, address(this), tokenAmounts[i]);\n            IERC20(tokens[i]).approve(address(vault), tokenAmounts[i]);\n        }\n\n        actualTokenAmounts = vault.deposit(tokenAmounts, minLpTokens, vaultOptions);\n        for (uint256 i = 0; i < tokens.length; ++i) {\n            IERC20(tokens[i]).safeTransfer(msg.sender, IERC20(tokens[i]).balanceOf(address(this)));\n        }\n\n        uint256 lpTokenMinted = vault.balanceOf(address(this));\n        vault.transfer(msg.sender, lpTokenMinted);\n\n        emit Deposit(msg.sender, tokens, actualTokenAmounts, lpTokenMinted);\n    }\n\n    function updateRoot(bytes32 root_) external {\n        _requireAdmin();\n        root = root_;\n    }\n\n    /// @notice Emitted when liquidity is deposited\n    /// @param from The source address for the liquidity\n    /// @param tokens ERC20 tokens deposited\n    /// @param actualTokenAmounts Token amounts deposited\n    /// @param lpTokenMinted LP tokens received by the liquidity provider\n    event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);\n}\n"
    }
  }
}