{"file_path":"contracts/IToken.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.28;\n\nimport {IIToken} from \"./interfaces/IIToken.sol\";\nimport {ITToken} from \"./interfaces/ITToken.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {BaseUpgradeable} from \"./BaseUpgradeable.sol\";\nimport {ERC4626UpgradeableMultiAsset, IERC4626MultiAsset} from \"./vaults/ERC4626UpgradeableMultiAsset.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {AccessControlUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {ERC165Checker} from \"@openzeppelin/contracts/utils/introspection/ERC165Checker.sol\";\n\n/**\n * @notice  Index Token for a collection of TTokens and other ITokens\n * @dev     If other ERC4626 vaults are used, they must all be able to be priced in terms of the underlying asset of the iToken.\n */\n\ncontract IToken is ERC4626UpgradeableMultiAsset, BaseUpgradeable, IIToken {\n    using SafeERC20 for IERC20;\n    using Math for uint256;\n\n    /// @notice Config for IToken\n    ITokenParams public config;\n\n    function initialize(\n        string memory _name,\n        string memory _symbol,\n        IERC20 _baseAsset,\n        address[] calldata _depositAssets,\n        ITokenParams calldata _config\n    ) public onlyProxy initializer checkAssetList(_depositAssets) {\n        __ERC20_init(_name, _symbol);\n        __ERC4626MultiAsset_init(_baseAsset, _depositAssets);\n        __BaseUpgradable_init();\n\n        _checkITokenConfig(_config);\n        config = _config;\n    }\n\n    /// @notice modifier to check that the ratio of each asset is within the allowed deviation\n    modifier checkRatio() {\n        if (!config.enforcedRatio) {\n            // if ratio is not enforced, skip check\n            _;\n            return;\n        }\n\n        uint256 assetsLength = config.assetRatiosBps.length;\n\n        // state before operation\n        (, , uint256[] memory depositAssetValuesBefore, uint256 totalValueBefore) = totalDepositAssets();\n        uint256[] memory ratiosBefore = new uint256[](assetsLength);\n\n        // get ratio before in basis points\n        for (uint256 i = 0; i < assetsLength; i++) {\n            ratiosBefore[i] = depositAssetValuesBefore[i].mulDiv(10000, totalValueBefore + 1);\n        }\n\n        _; // execute operation\n\n        // state after operation\n        (, , uint256[] memory depositAssetValuesAfter, uint256 totalValueAfter) = totalDepositAssets();\n\n        // go through each asset and check ratio\n        for (uint256 i = 0; i < assetsLength; i++) {\n            uint256 currentRatioBps = depositAssetValuesAfter[i].mulDiv(10000, totalValueAfter + 1);\n            uint256 targetRatioBps = uint256(config.assetRatiosBps[i]);\n\n            // check if within target\n            bool outsideTarget = currentRatioBps > targetRatioBps + config.maxDeviationBps || currentRatioBps < targetRatioBps - config.maxDeviationBps;\n\n            if (outsideTarget) {\n                // only allowed if moved in the right direction from a previous bad state\n                bool movedInRightDirection = false;\n\n                if (currentRatioBps > ratiosBefore[i]) {\n                    // ratio increased\n                    // check that the ratio before was less than target and it didn't move too high\n                    movedInRightDirection = ratiosBefore[i] < targetRatioBps && currentRatioBps <= targetRatioBps + config.maxDeviationBps;\n                } else if (currentRatioBps < ratiosBefore[i]) {\n                    // ratio decreased\n                    // check that the ratio before was too high and it didn't move too low\n                    movedInRightDirection = ratiosBefore[i] > targetRatioBps && currentRatioBps >= targetRatioBps - config.maxDeviationBps;\n                }\n                // if same, then it didn't move, so not in the right direction\n                if (!movedInRightDirection) {\n                    revert ErrorBadAssetRatio();\n                }\n            }\n        }\n    }\n\n    /// @notice ensure that all assets are TTokens or ITokens and can be priced in terms of the underlying assest of this vault\n    modifier checkAssetList(address[] calldata assetList) {\n        // allow for initialize to be setup before checking list so \"asset()\" is set\n        _;\n        for (uint256 i = 0; i < assetList.length; i++) {\n            address depositAsset = assetList[i];\n            if (depositAsset == address(0) || depositAsset == address(this)) {\n                revert ErrorInvalidDepositAsset(depositAsset);\n            }\n            if (ERC165Checker.supportsInterface(depositAsset, type(IIToken).interfaceId)) {\n                // if IToken, ensure underlying asset is the same\n                if (IIToken(depositAsset).asset() != asset()) {\n                    revert ErrorInvalidDepositAsset(depositAsset);\n                }\n            } else if (ERC165Checker.supportsInterface(depositAsset, type(ITToken).interfaceId)) {\n                // if TToken, ensure escrow asset is the same as this contract's asset (since sharesToEscrowAssets will be called for conversion)\n                ITToken.TTokenParams memory tTokenParams = ITToken(depositAsset).getTTokenParams();\n                if (tTokenParams.escrowAsset != asset()) {\n                    revert ErrorInvalidDepositAsset(depositAsset);\n                }\n            } else {\n                // doesn't support either interface\n                revert ErrorInvalidDepositAsset(depositAsset);\n            }\n        }\n    }\n\n    /// @notice makes sure at least min shares are left in contract after function\n    modifier checkMinShares() {\n        _;\n        uint256 _totalSupply = totalSupply();\n        if (_totalSupply > 0 && _totalSupply < config.minShares) revert ErrorMinShares();\n    }\n\n    constructor() {}\n\n    /**\n     * @dev override ERC4626MultiAsset deposit function to check for ratio\n     * @dev not overriding mint, since users would be blocked if asset prices change internal ratio\n     */\n    function deposit(\n        address[] calldata depositAssets,\n        uint256[] calldata assetAmounts,\n        address receiver\n    ) public override(ERC4626UpgradeableMultiAsset, IERC4626MultiAsset) checkRatio returns (uint256) {\n        return super.deposit(depositAssets, assetAmounts, receiver);\n    }\n\n    /**\n     * @dev override ERC4626MultiAsset _deposit to check for minShares\n     */\n    function _deposit(address caller, address receiver, address[] memory assets, uint256[] memory amounts, uint256 shares) internal override checkMinShares {\n        super._deposit(caller, receiver, assets, amounts, shares);\n    }\n\n    /**\n     * @dev override ERC4626MultiAsset withdraw function to check for ratio\n     * @dev not overriding redeem, since users would be blocked if asset prices change internal ratio\n     */\n    function withdraw(\n        address[] calldata withdrawAssets,\n        uint256[] calldata withdrawAmounts,\n        address receiver,\n        address _owner\n    ) public override(ERC4626UpgradeableMultiAsset, IERC4626MultiAsset) checkRatio returns (uint256 shares) {\n        return super.withdraw(withdrawAssets, withdrawAmounts, receiver, _owner);\n    }\n\n    /**\n     * @dev override ERC4626MultiAsset _withdraw to check for minShares\n     */\n    function _withdraw(address caller, address receiver, address _owner, address[] memory assets, uint256[] memory amounts, uint256 shares) internal override checkMinShares {\n        super._withdraw(caller, receiver, _owner, assets, amounts, shares);\n    }\n\n    /// @dev override _update to check for pause status\n    function _update(address _from, address _to, uint256 _value) internal override whenNotPaused {\n        super._update(_from, _to, _value);\n    }\n\n    /**\n     * @dev Updates the ERC4626MultiAssetStorage for deposit assets and updates ITokenParams config\n     * @dev only callable by owner\n     * @dev ensures that the NAV of the vault is at least the same after the change\n     */\n    function updateDepositAssets(address[] calldata newAssets, ITokenParams calldata newConfig) external onlyRole(DEFAULT_ADMIN_ROLE) checkAssetList(newAssets) {\n        _updateDepositAssets(newAssets);\n        _setConfig(newConfig);\n    }\n\n    function _updateDepositAssets(address[] calldata newAssets) internal override {\n        // get total value before update\n        uint256 totalValueBefore = totalUnderlyingAssets();\n        super._updateDepositAssets(newAssets);\n        // get total value after update\n        uint256 totalValueAfter = totalUnderlyingAssets();\n\n        if (totalValueAfter < totalValueBefore) {\n            revert ErrorDepositAssetsValueWentDown();\n        }\n    }\n\n    /** @dev See {IIToken-getConfig} */\n    function getConfig() external view returns (ITokenParams memory) {\n        return config;\n    }\n\n    /** @dev See {IIToken-setConfig} */\n    function setConfig(ITokenParams calldata params) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        _setConfig(params);\n    }\n\n    /**\n     * @dev Internal function to set the IToken configuration, checks the config first\n     */\n    function _setConfig(ITokenParams calldata params) internal {\n        _checkITokenConfig(params);\n        config = params;\n    }\n\n    /** @dev See {IIToken-getAssetRatio} */\n    function getAssetRatio(address _asset) external view returns (uint32) {\n        if (!(isSupportedDepositAsset(_asset) && config.enforcedRatio)) {\n            return 0;\n        }\n        // get all deposit assets to find index\n        address[] memory depositAssets = depositAssetsList();\n\n        // set index to -1 to indicate not found\n        int8 index = -1;\n\n        for (uint8 i = 0; i < depositAssets.length; i++) {\n            if (depositAssets[i] == _asset) {\n                index = int8(i);\n                break;\n            }\n        }\n        if (index == -1) {\n            revert ErrorAssetNotFound(_asset);\n        }\n        return config.assetRatiosBps[uint8(index)];\n    }\n\n    /**\n     * @dev Internal function to check the IToken configuration\n     */\n    function _checkITokenConfig(ITokenParams calldata params) internal view {\n        // check minshares is not zero\n        if (params.minShares == 0) {\n            revert ErrorMinShares();\n        }\n        // if there is no enforced ratio, other config does not apply\n        if (!params.enforcedRatio) {\n            return;\n        }\n        // depositAssets and assetRatios must have the same length\n        address[] memory depositAssets = depositAssetsList();\n        if (depositAssets.length != params.assetRatiosBps.length) {\n            revert ErrorArrayMismatch();\n        }\n        // ratios must add to 100\n        uint32 totalRatio = 0;\n        for (uint256 i = 0; i < params.assetRatiosBps.length; i++) {\n            totalRatio += params.assetRatiosBps[i];\n        }\n        if (totalRatio != 10000) {\n            revert ErrorRatiosNot100();\n        }\n        return;\n    }\n\n    /// @notice converts a deposit asset to the underlying asset of the vault\n    /// @dev deposit asset token is either TToken or IToken with underlying the same as this contract\n    function _convertDepositAssetToUnderlying(address depositAsset, uint256 amount) internal view override returns (uint256) {\n        if (ERC165Checker.supportsInterface(depositAsset, type(IIToken).interfaceId)) {\n            // if IToken, convert to underlying asset\n            return IIToken(depositAsset).convertToAssets(amount);\n        }\n        if (ERC165Checker.supportsInterface(depositAsset, type(ITToken).interfaceId)) {\n            // if TToken, convert to escrow asset\n            return ITToken(depositAsset).sharesToEscrowAssets(amount);\n        }\n        // revert since deposit asset is not a valid TToken or IToken\n        revert ErrorInvalidDepositAsset(depositAsset);\n    }\n\n    /// @notice supports interface for IIToken and IERC165\n    function supportsInterface(bytes4 interfaceId) public view override(AccessControlUpgradeable, IERC165) returns (bool) {\n        return interfaceId == type(IIToken).interfaceId || super.supportsInterface(interfaceId);\n    }\n\n    /** @dev See {IIToken-rescueAsset} */\n    function rescueAsset(IERC20 rescuedAsset, address to) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        if (isSupportedDepositAsset(address(rescuedAsset))) {\n            // if the asset is a deposit asset, it cannot be rescued\n            revert ErrorAssetCannotBeRescued(address(rescuedAsset));\n        }\n        // transfer to the specified address\n        SafeERC20.safeTransfer(rescuedAsset, to, rescuedAsset.balanceOf(address(this)));\n    }\n}\n","deployed_bytecode":"0x608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146123535750806306fdde031461229157806307a2d13a14612270578063095ea7b3146121c357806318160ddd146121985780631962ab121461213757806320df43591461210e57806323b872dd146120d6578063248a9ca3146120b85780632f2ff15d14612087578063313ce5671461203757806336568abe14611ff157806338d52e0f14611fbb5780633bb7b9e7146116435780633f4ba83a146115ca57806343998bdd146112b15780634626caa8146115ae57806349ced04d1461155f5780634cdad506146111525780634f1ef286146113c85780634fb9bbba146113ad57806352d1902d14611343578063547edab0146113135780635c975abb146112e35780635f298277146112b65780636417d15c146112b15780636bb410411461128057806370a08231146102a95780637567057a1461123c578063760168701461120d57806379502c55146111d35780638456cb591461115757806388053d2f1461115257806391d14854146110f857806394bf804d14610f2357806395d89b4114610e3057806398c601aa14610dca578063a217fddf14610dae578063a9059cbb14610d7d578063a91fc98d14610a3c578063abc226bd146109f8578063ad3cb1cc146109b9578063b2f32cb0146108e9578063b3d7f6b9146108cd578063ba087652146106a2578063c1df58b514610627578063c3f909d414610389578063c63d75b614610365578063ce96cb771461030c578063d547741f146102d4578063d905777e146102a95763dd62ed3e1461025b57600080fd5b346102a45760403660031901126102a457610274612409565b61028561027f61241f565b91612c09565b9060018060a01b03166000526020526020604060002054604051908152f35b600080fd5b346102a45760203660031901126102a45760206102cc6102c7612409565b612c42565b604051908152f35b346102a45760403660031901126102a45761030a6004356102f361241f565b9061030561030082612864565b6135b1565b613877565b005b346102a45760203660031901126102a4576001600160a01b0361032d612409565b166000526000805160206148cf83398151915260205261035160406000205461303b565b9061036160405192839283612618565b0390f35b346102a45760203660031901126102a45761037e612409565b5060206102cc613005565b346102a45760003660031901126102a457600060606040516103aa816124d0565b81815282602082015282604082015201526040516103c7816124d0565b604051808160206032549283815201603260005260008051602061496f833981519152926000905b8060078301106105a057610445945491818110610589575b818110610570575b818110610556575b81811061053c575b818110610522575b818110610508575b8181106104ee575b106104e0575b5003826124eb565b815260335490602081019060ff83161515825263ffffffff604082019360081c16835260345460608201908152604051926020845260a08401925192608060208601528351809152602060c0860194019060005b8181106104c457505050839463ffffffff915115156040860152511660608401525160808301520390f35b825163ffffffff16865260209586019590920191600101610499565b60e01c81526020018561043d565b92602060019163ffffffff8560c01c168152019301610437565b92602060019163ffffffff8560a01c16815201930161042f565b92602060019163ffffffff8560801c168152019301610427565b92602060019163ffffffff8560601c16815201930161041f565b92602060019163ffffffff8560401c168152019301610417565b92602060019163ffffffff85831c16815201930161040f565b92602060019163ffffffff85168152019301610407565b916008919350610100600191865463ffffffff8116825263ffffffff8160201c16602083015263ffffffff8160401c16604083015263ffffffff8160601c16606083015263ffffffff8160801c16608083015263ffffffff8160a01c1660a083015263ffffffff8160c01c1660c083015260e01c60e08201520194019201849293916103ef565b346102a45760803660031901126102a4576004356001600160401b0381116102a45761065790369060040161257c565b906024356001600160401b0381116102a45761067790369060040161257c565b61067f612435565b606435929091906001600160a01b03841684036102a4576020956102cc95612e44565b346102a45760603660031901126102a4576004356106be61241f565b906106c7612435565b916106d183612c42565b8083116108a957506106e28261303b565b936001600160a01b038116908433839003610897575b9050156108865780156108705761070d613e25565b6000908082526000805160206148cf83398151915260205260408220548581106108555785908284526000805160206148cf8339815191526020520360408320558460008051602061490f833981519152540360008051602061490f83398151915255818160008051602061498f8339815191526020604051898152a3815b83518110156107c7576001906107c16001600160a01b036107ad838861274c565b5116876107ba848c61274c565b519161417b565b0161078c565b5060405186946001600160a01b03169033907fd27e5ec3786ce482fa46ef9a1d7f00baf52db125828c887b2b55c503a2eaaf5590806108088a8a8a84614657565b0390a460008051602061490f833981519152548015159081610849575b5061083a575061036160405192839283612618565b63c86055b960e01b8152600490fd5b90506034541184610825565b60649350859163391434e360e21b8452600452602452604452fd5b634b637e8f60e11b600052600060045260246000fd5b63f83c702760e01b60005260046000fd5b6108a29133906133b2565b85846106f8565b82846398f9d22d60e01b60005260018060a01b031660045260245260445260646000fd5b346102a45760203660031901126102a457610351600435613172565b346102a45760403660031901126102a457610902612409565b61090a61241f565b9061091361355e565b6001600160a01b0381169161092783612aad565b6109a4576020602493604051948580926370a0823160e01b82523060048301525afa91821561099857600092610962575b61030a935061417b565b91506020833d602011610990575b8161097d602093836124eb565b810103126102a45761030a925191610958565b3d9150610970565b6040513d6000823e3d90fd5b826314184af760e31b60005260045260246000fd5b346102a45760003660031901126102a45761036160408051906109dc81836124eb565b60058252640352e302e360dc1b602083015251918291826123c0565b346102a45760403660031901126102a457610a11612409565b60243580151581036102a457610a2561355e565b15610a335761030a906136a7565b61030a906137e1565b346102a45760403660031901126102a4576004356001600160401b0381116102a457610a6c90369060040161257c565b906024356001600160401b0381116102a457608060031982360301126102a457610a9461355e565b610a9c6129f3565b610aa684846146d2565b6001600160401b038411610d6757600160401b8411610d675760008051602061494f833981519152548460008051602061494f83398151915255808510610d1f575b508260008051602061494f83398151915260005260206000209060005b868110610d04575050507f5406aca7037463fc14870cd3bcb6210f9f2b0395c172b5cef9f939c49aad93bf60405180610b3f878783614613565b0390a1610b4a6129f3565b10610cf357610b5b90600401613c35565b60005b828110610b6757005b610b7a610b75828585612885565b612895565b6001600160a01b0381169081158015610cea575b610cd557610b9b81613976565b15610c4457506040516338d52e0f60e01b8152602081600481855afa90811561099857600091610c08575b506000805160206149cf833981519152546001600160a01b03908116911603610bf457506001905b01610b5e565b630e93be7560e31b60005260045260246000fd5b906020823d8211610c3c575b81610c21602093836124eb565b81010312610c395750610c33906128a9565b85610bc6565b80fd5b3d9150610c14565b610c4d906139b4565b15610bf45760405163ab3225a560e01b815260c081600481855afa90811561099857600091610ca7575b50606001516000805160206149cf833981519152546001600160a01b03918216911603610bf45750600190610bee565b610cc8915060c03d8111610cce575b610cc081836124eb565b8101906128bd565b85610c77565b503d610cb6565b50630e93be7560e31b60005260045260246000fd5b50308214610b8e565b630e3f792d60e11b60005260046000fd5b6001906020610d1284612895565b9301928185015501610b05565b60008051602061494f833981519152600052610d61907f8c1c4c7f716a9177025811e74abdc502020e2432e8019a686f47a8591d8d2df7908101908601612989565b84610ae8565b634e487b7160e01b600052604160045260246000fd5b346102a45760403660031901126102a457610da3610d99612409565b6024359033613457565b602060405160018152f35b346102a45760003660031901126102a457602060405160008152f35b346102a45760603660031901126102a4576004356001600160401b0381116102a457610dfa90369060040161257c565b90602435906001600160401b0382116102a457602092610e216102cc93369060040161257c565b91610e2a612435565b93612c77565b346102a45760003660031901126102a45760405160006000805160206148ef83398151915254610e5f81612659565b8084529060018116908115610eff5750600114610e93575b61036183610e87818503826124eb565b604051918291826123c0565b6000805160206148ef83398151915260009081527f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa939250905b808210610ee557509091508101602001610e87610e77565b919260018160209254838588010152019101909291610ecd565b60ff191660208086019190915291151560051b84019091019150610e879050610e77565b346102a45760403660031901126102a457600435610f3f61241f565b610f47613005565b80831180156110f0575b6110cc5750610f5f82613172565b9260005b8251811015610fce57600190610fc86001600160a01b03610f84838761274c565b5116610f90838961274c565b5190604051916323b872dd60e01b6020840152336024840152306044840152606483015260648252610fc36084836124eb565b614677565b01610f63565b5090918115610886576001600160a01b031680156110b657610fee613e25565b6110078260008051602061490f83398151915254612776565b60008051602061490f833981519152556000918183526000805160206148cf83398151915260205260408320818154019055818360008051602061498f8339815191526020604051858152a37fcca721777a6ecfefca61eb6abe93dd4f6bc3798df0cf7aacedffc26fbd7521c0604051806110853394898984614657565b0390a360008051602061490f833981519152548015159081610849575061083a575061036160405192839283612618565b63ec442f0560e01b600052600060045260246000fd5b919063c16c995760e01b60005260018060a01b031660045260245260445260646000fd5b508015610f51565b346102a45760403660031901126102a45761111161241f565b6004356000526000805160206149af83398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b61263d565b346102a45760003660031901126102a457611170613510565b611178613e25565b611180613e25565b600160ff196000805160206149ef8339815191525416176000805160206149ef833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b346102a45760003660031901126102a457606060335460345463ffffffff6040519260ff81161515845260081c1660208301526040820152f35b346102a45760403660031901126102a457611226612409565b5061122f61241f565b5060206040516000198152f35b346102a45760203660031901126102a4576004356001600160401b0381116102a457608060031982360301126102a45761030a9061127861355e565b600401613c35565b346102a45760203660031901126102a45760206112a361129e612409565b612b34565b63ffffffff60405191168152f35b6125fc565b346102a45760203660031901126102a45760206112d96112d4612409565b612aad565b6040519015158152f35b346102a45760003660031901126102a457602060ff6000805160206149ef83398151915254166040519015158152f35b346102a45760003660031901126102a45761036161132f612693565b60405191829160208352602083019061245f565b346102a45760003660031901126102a4577f000000000000000000000000325478a069b0dbbdfbee909fa3741f84259ba5196001600160a01b0316300361139c57602060405160008051602061492f8339815191528152f35b63703e46dd60e11b60005260046000fd5b346102a45760003660031901126102a45760206102cc6129f3565b60403660031901126102a4576113dc612409565b6024356001600160401b0381116102a457366023820112156102a45761140c903690602481600401359101612527565b611414613917565b61141c61355e565b6040516352d1902d60e01b81526001600160a01b0383169290602081600481875afa6000918161152b575b506114615783634c9c8ce360e01b60005260045260246000fd5b8060008051602061492f8339815191528592036115175750813b156115035760008051602061492f83398151915280546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28151156114e95760008083602061030a95519101845af46114e361475b565b9161480d565b5050346114f257005b63b398979f60e01b60005260046000fd5b634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d602011611557575b81611547602093836124eb565b810103126102a457519085611447565b3d915061153a565b346102a45760203660031901126102a457611578612409565b60018060a01b03166000526000805160206148cf83398151915260205260206102cc6115a860406000205461303b565b9061326f565b346102a45760206102cc6115c1366125ac565b92919091613b91565b346102a45760003660031901126102a4576115e3613510565b6115eb613ac6565b6115f3613ac6565b60ff196000805160206149ef83398151915254166000805160206149ef833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b346102a45760a03660031901126102a4576004356001600160401b0381116102a45761167390369060040161255e565b6024356001600160401b0381116102a45761169290369060040161255e565b61169a612435565b6064356001600160401b0381116102a4576116b990369060040161257c565b919092608435916001600160401b0383116102a4578260040191608060031985360301126102a4576116e9613917565b600080516020614a0f833981519152549660ff8860401c1615976001600160401b03811680159081611fb3575b6001149081611fa9575b159081611fa0575b50611f8f5767ffffffffffffffff198116600117600080516020614a0f8339815191525588611f62575b5061175b6145e5565b6117636145e5565b8051906001600160401b038211610d6757819061178e60008051602061488f83398151915254612659565b601f8111611f06575b50602090601f8311600114611e8457600092611e79575b50508160011b916000199060031b1c19161760008051602061488f833981519152555b8051906001600160401b038211610d675781906117fc6000805160206148ef83398151915254612659565b601f8111611e12575b50602090601f8311600114611d9057600092611d85575b50508160011b916000199060031b1c1916176000805160206148ef833981519152555b6118476145e5565b61184f6145e5565b61185984866146d2565b6118628161478b565b9015611d7c57905b6000805160206149cf83398151915280546001600160a81b03191660a09390931b60ff60a01b16929092176001600160a01b039091161790556001600160401b038311610d6757600160401b8311610d675760008051602061494f833981519152548360008051602061494f83398151915255808410611d34575b508360008051602061494f83398151915260005260206000209060005b858110611d195750505061197c907f5406aca7037463fc14870cd3bcb6210f9f2b0395c172b5cef9f939c49aad93bf60405180611940878983614613565b0390a161194b6145e5565b6119536145e5565b61195b6145e5565b6119636145e5565b61196c336135fb565b50611976816139f2565b80612954565b906001600160401b038211610d6757600160401b8211610d675760325482603255808310611c93575b509060326000528060031c9060005b828110611c3557506007198116900380611bd1575b505050806119f06119de6024606494016129b1565b60ff8019603354169115151617603355565b6119fc604482016129a0565b64ffffffff006033549160081b169064ffffffff00191617603355013560345560005b818110611a865783611a2d57005b68ff000000000000000019600080516020614a0f8339815191525416600080516020614a0f833981519152557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b611a94610b75828486612885565b6001600160a01b0381169081158015611bc8575b610cd557611ab581613976565b15611b4757506040516338d52e0f60e01b8152602081600481855afa90811561099857600091611b0e575b506000805160206149cf833981519152546001600160a01b03908116911603610bf457506001905b01611a1f565b906020823d8211611b3f575b81611b27602093836124eb565b81010312610c395750611b39906128a9565b86611ae0565b3d9150611b1a565b611b50906139b4565b15610bf45760405163ab3225a560e01b815260c081600481855afa90811561099857600091611baa575b50606001516000805160206149cf833981519152546001600160a01b03918216911603610bf45750600190611b08565b611bc2915060c03d8111610cce57610cc081836124eb565b86611b7a565b50308214611aa8565b9160009260005b818110611bfc5750505060008051602061496f8339815191520155606485806119c9565b9091936020611c2b600192611c10886129a0565b908560021b63ffffffff809160031b9316831b921b19161790565b9501929101611bd8565b6000805b60088110611c5c575060008051602061496f8339815191528201556001016119b4565b94906020611c8a600192611c6f856129a0565b908960021b63ffffffff809160031b9316831b921b19161790565b92019501611c39565b611cd890600780850160031c91601c8660021b1680611cde575b500160031c60008051602061496f833981519152019060008051602061496f83398151915201612989565b866119a5565b7f11df491316f14931039edfd4f8964c9a443b862f02d4c7611d18c2bc4e6ff6968401908154906000199060200360031b1c1690558a611cad565b6001906020611d2784612895565b9301928185015501611902565b60008051602061494f833981519152600052611d76907f8c1c4c7f716a9177025811e74abdc502020e2432e8019a686f47a8591d8d2df7908101908501612989565b856118e5565b5060129061186a565b01519050888061181c565b6000805160206148ef83398151915260009081528281209350601f198516905b818110611dfa5750908460019594939210611de1575b505050811b016000805160206148ef8339815191525561183f565b015160001960f88460031b161c19169055888080611dc6565b92936020600181928786015181550195019301611db0565b6000805160206148ef833981519152600052611e69907f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa601f850160051c81019160208610611e6f575b601f0160051c0190612989565b89611805565b9091508190611e5c565b0151905089806117ae565b60008051602061488f83398151915260009081528281209350601f198516905b818110611eee5750908460019594939210611ed5575b505050811b0160008051602061488f833981519152556117d1565b015160001960f88460031b161c19169055898080611eba565b92936020600181928786015181550195019301611ea4565b60008051602061488f833981519152600052611f5c907f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0601f850160051c81019160208610611e6f57601f0160051c0190612989565b8a611797565b68ffffffffffffffffff19166801000000000000000117600080516020614a0f8339815191525588611752565b63f92ee8a960e01b60005260046000fd5b9050158a611728565b303b159150611720565b8a9150611716565b346102a45760003660031901126102a4576000805160206149cf833981519152546040516001600160a01b039091168152602090f35b346102a45760403660031901126102a45761200a61241f565b336001600160a01b038216036120265761030a90600435613877565b63334bd91960e11b60005260046000fd5b346102a45760003660031901126102a45760ff6000805160206149cf8339815191525460a01c1660ff811161207157602090604051908152f35b634e487b7160e01b600052601160045260246000fd5b346102a45760403660031901126102a45761030a6004356120a661241f565b906120b361030082612864565b61373f565b346102a45760203660031901126102a45760206102cc600435612864565b346102a45760603660031901126102a457610da36120f2612409565b6120fa61241f565b604435916121098333836133b2565b613457565b346102a45760003660031901126102a45760206040516000805160206148af8339815191528152f35b346102a45760003660031901126102a45761217261218061218e612159612783565b939294909160405196879660808852608088019061245f565b90868203602088015261249c565b90848203604086015261249c565b9060608301520390f35b346102a45760003660031901126102a457602060008051602061490f83398151915254604051908152f35b346102a45760403660031901126102a4576121dc612409565b60243590331561225a576001600160a01b0316908115612244576121ff33612c09565b82600052602052806040600020556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b634a1406b160e11b600052600060045260246000fd5b63e602df0560e01b600052600060045260246000fd5b346102a45760203660031901126102a45760206102cc6115a860043561303b565b346102a45760003660031901126102a457604051600060008051602061488f833981519152546122c081612659565b8084529060018116908115610eff57506001146122e75761036183610e87818503826124eb565b60008051602061488f83398151915260009081527f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0939250905b80821061233957509091508101602001610e87610e77565b919260018160209254838588010152019101909291612321565b346102a45760203660031901126102a4576004359063ffffffff60e01b82168092036102a4576020916363637ce960e11b8114908115612395575b5015158152f35b637965db0b60e01b8114915081156123af575b508361238e565b6301ffc9a760e01b149050836123a8565b91909160208152825180602083015260005b8181106123f3575060409293506000838284010152601f8019910116010190565b80602080928701015160408286010152016123d2565b600435906001600160a01b03821682036102a457565b602435906001600160a01b03821682036102a457565b604435906001600160a01b03821682036102a457565b35906001600160a01b03821682036102a457565b906020808351928381520192019060005b81811061247d5750505090565b82516001600160a01b0316845260209384019390920191600101612470565b906020808351928381520192019060005b8181106124ba5750505090565b82518452602093840193909201916001016124ad565b608081019081106001600160401b03821117610d6757604052565b90601f801991011681019081106001600160401b03821117610d6757604052565b6001600160401b038111610d6757601f01601f191660200190565b9291926125338261250c565b9161254160405193846124eb565b8294818452818301116102a4578281602093846000960137010152565b9080601f830112156102a45781602061257993359101612527565b90565b9181601f840112156102a4578235916001600160401b0383116102a4576020808501948460051b0101116102a457565b60406003198201126102a4576004356001600160401b0381116102a457816125d69160040161257c565b92909291602435906001600160401b0382116102a4576125f89160040161257c565b9091565b346102a45760206102cc61260f366125ac565b92919091613be6565b909161262f6125799360408452604084019061245f565b91602081840391015261249c565b346102a45760203660031901126102a45761035160043561303b565b90600182811c92168015612689575b602083101461267357565b634e487b7160e01b600052602260045260246000fd5b91607f1691612668565b6040519060008051602061494f83398151915254808352826020810160008051602061494f83398151915260005260206000209260005b8181106126e15750506126df925003836124eb565b565b84546001600160a01b03168352600194850194879450602090930192016126ca565b6001600160401b038111610d675760051b60200190565b9061272482612703565b61273160405191826124eb565b8281528092612742601f1991612703565b0190602036910137565b80518210156127605760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b9190820180921161207157565b61278b612693565b90612796825161271a565b6127a0835161271a565b906000936000945b815186101561285d576001600160a01b036127c3878461274c565b516040516370a0823160e01b81523060048201529116602082602481845afa91821561099857600092612828575b509161280e82600194612820946128088c8a61274c565b526132cc565b908161281a8a8961274c565b52612776565b9501946127a8565b90916020823d8211612855575b81612842602093836124eb565b81010312610c395750519061280e6127f1565b3d9150612835565b9094509092565b6000526000805160206149af83398151915260205260016040600020015490565b91908110156127605760051b0190565b356001600160a01b03811681036102a45790565b51906001600160a01b03821682036102a457565b908160c09103126102a45760006040519160c083018381106001600160401b038211176129405760405260a0906128f3816128a9565b84526020810151602085015260408101516040850152612915606082016128a9565b6060850152612926608082016128a9565b60808501520151908115158203610c39575060a082015290565b634e487b7160e01b83526041600452602483fd5b903590601e19813603018212156102a457018035906001600160401b0382116102a457602001918160051b360383136102a457565b818110612994575050565b60008155600101612989565b3563ffffffff811681036102a45790565b3580151581036102a45790565b60008051602061494f833981519152548110156127605760008051602061494f83398151915260005260206000200190600090565b60008060008051602061494f833981519152545b808210612a1357505090565b9091612a1e836129be565b90546040516370a0823160e01b81523060048201529160031b1c6001600160a01b0316602082602481845afa91821561099857600092612a78575b5091612a6a612a70926001946132cc565b90612776565b920190612a07565b90916020823d8211612aa5575b81612a92602093836124eb565b81010312610c3957505190612a6a612a59565b3d9150612a85565b60008051602061494f833981519152549060005b828110612ad057505050600090565b612ad9816129be565b905460039190911b1c6001600160a01b0390811690831614612afd57600101612ac1565b505050600190565b90603254821015612760576032600052600382901c60008051602061496f833981519152019160021b601c1690565b612b3d81612aad565b80612bfd575b15612bf757612b50612693565b9060001960005b835160ff821690811015612bee576001600160a01b03612b77828761274c565b51166001600160a01b03851614612b9c575060ff1660ff811461207157600101612b57565b60000b935050505b6000198260000b14612bcd5750612bc263ffffffff9160ff16612b05565b90549060031b1c1690565b6305fe563f60e31b60009081526001600160a01b0391909116600452602490fd5b50509150612ba4565b50600090565b5060ff60335416612b43565b6001600160a01b031660009081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020526040902090565b6001600160a01b031660009081526000805160206148cf833981519152602052604090205490565b9190820391821161207157565b9390949260ff6033541615612e375760325492612c92612783565b999250979050612ca18661271a565b9760005b878110612e02575050612cbb9596979850613fae565b92612cc4612783565b60335460081c63ffffffff169350915060005b858110612ce657505050505050565b612cf0818361274c565b516001840180851161207157612d0591613e4f565b63ffffffff612d1383612b05565b90549060031b1c1690612d268683612776565b81118015612df0575b612d3e575b5050600101612cd7565b6000612d4a848961274c565b51821115612d9e57508582612d5f858a61274c565b51109283612d89575b5050505b15612d78573880612d34565b632e657be160e01b60005260046000fd5b612d94929350612776565b1015388581612d68565b9190612daa848961274c565b518110612db9575b5050612d6c565b9091508582612dc8858a61274c565b51119283612ddb575b5050503880612db2565b612de6929350612c6a565b1115388581612dd1565b50612dfb8683612c6a565b8110612d2f565b612e0c818361274c565b519060018c0191828d1161207157600192612e2691613e4f565b612e30828d61274c565b5201612ca5565b9190929461257994613fae565b9491929593909560ff6033541615612ff65760325493612e62612783565b9a9250989050612e718761271a565b9860005b888110612fc1575050612e8b96979899506141b6565b92612e94612783565b60335460081c63ffffffff169350915060005b858110612eb657505050505050565b612ec0818361274c565b516001840180851161207157612ed591613e4f565b63ffffffff612ee383612b05565b90549060031b1c1690612ef68683612776565b81118015612faf575b612f0e575b5050600101612ea7565b6000612f1a848961274c565b51821115612f5d57508582612f2f858a61274c565b51109283612f48575b5050505b15612d78573880612f04565b612f53929350612776565b1015388581612f38565b9190612f69848961274c565b518110612f78575b5050612f3c565b9091508582612f87858a61274c565b51119283612f9a575b5050503880612f71565b612fa5929350612c6a565b1115388581612f90565b50612fba8683612c6a565b8110612eff565b612fcb818361274c565b519060018d01808e1161207157612fef82612fe98f93600196613e4f565b9261274c565b5201612e75565b919395612579959391936141b6565b60008051602061490f8339815191525415801561302c575b6130275760001990565b600090565b506130356129f3565b1561301d565b90613044612783565b949183518015801561316a575b61315b575061305e6129f3565b91600183018093116120715760008051602061490f8339815191525492600194858501809511612071578594613096926000926144c0565b966130a1865161271a565b976000945b6130b5575b5050505050509190565b86518510156131565785809583158015613144575b8015613132575b156130eb5760006130e2828d61274c565b525b01946130a6565b613122600061310681876130ff868b61274c565b51886144c0565b613110848a61274c565b5161311b858a61274c565b51916144c0565b61312c828d61274c565b526130e4565b5061313d818661274c565b51156130d1565b5061314f818761274c565b51156130ca565b6130ab565b9250505061257991935061271a565b508315613051565b9061317b612783565b9491835180158015613267575b61315b57506131956129f3565b91600183018093116120715760008051602061490f83398151915254926001948585018095116120715785946131cc9286926144c0565b966131d7865161271a565b976000945b6131ea575050505050509190565b86518510156131565785809583158015613255575b8015613243575b15613220576000613217828d61274c565b525b01946131dc565b6132338261310681876130ff868b61274c565b61323d828d61274c565b52613219565b5061324e818661274c565b5115613206565b50613260818761274c565b51156131ff565b508315613188565b9081518151036132c557600091825b81518410156132be576001906132b690612a6a6001600160a01b036132a3888761274c565b51166132af888861274c565b51906132cc565b93019261327e565b9250505090565b5050600090565b906132d682613976565b613375576132e3826139b4565b6133095750630e93be7560e31b60009081526001600160a01b0391909116600452602490fd5b604051631df6366360e01b8152600481019190915290602090829060249082906001600160a01b03165afa90811561099857600091613346575090565b90506020813d60201161336d575b81613361602093836124eb565b810103126102a4575190565b3d9150613354565b6040516303d1689d60e11b8152600481019190915290602090829060249082906001600160a01b03165afa90811561099857600091613346575090565b91906133bd83612c09565b60018060a01b0382166000526020526040600020549260001984106133e3575b50505050565b828410613432576001600160a01b0381161561225a576001600160a01b038216156122445761341190612c09565b9060018060a01b0316600052602052604060002091039055388080806133dd565b508290637dc7a0d960e11b60005260018060a01b031660045260245260445260646000fd5b6001600160a01b0316908115610870576001600160a01b03169182156110b65761347f613e25565b60008281526000805160206148cf83398151915260205260408120548281106134f657916040828260008051602061498f8339815191529587602096526000805160206148cf833981519152865203828220558681526000805160206148cf833981519152845220818154019055604051908152a3565b916064928463391434e360e21b8452600452602452604452fd5b33600090815260008051602061486f833981519152602052604090205460ff161561353757565b63e2517d3f60e01b600052336004526000805160206148af83398151915260245260446000fd5b3360009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff161561359757565b63e2517d3f60e01b60005233600452600060245260446000fd5b60008181526000805160206149af8339815191526020908152604080832033845290915290205460ff16156135e35750565b63e2517d3f60e01b6000523360045260245260446000fd5b6001600160a01b03811660009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff16612bf7576001600160a01b031660008181527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d60205260408120805460ff191660011790553391907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4600190565b6001600160a01b038116600090815260008051602061486f833981519152602052604090205460ff16612bf7576001600160a01b0316600081815260008051602061486f83398151915260205260408120805460ff191660011790553391906000805160206148af833981519152907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b60008181526000805160206149af833981519152602090815260408083206001600160a01b038616845290915290205460ff166132c55760008181526000805160206149af833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b6001600160a01b038116600090815260008051602061486f833981519152602052604090205460ff1615612bf7576001600160a01b0316600081815260008051602061486f83398151915260205260408120805460ff191690553391906000805160206148af833981519152907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60008181526000805160206149af833981519152602090815260408083206001600160a01b038616845290915290205460ff16156132c55760008181526000805160206149af833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b6001600160a01b037f000000000000000000000000325478a069b0dbbdfbee909fa3741f84259ba51916308114908115613953575b5061139c57565b60008051602061492f833981519152546001600160a01b0316141590503861394c565b61397f81614520565b90816139a2575b8161398f575090565b61257991506363637ce960e11b906145b1565b90506139ad8161457f565b1590613986565b6139bd81614520565b90816139e0575b816139cd575090565b61257991506365345e5b60e11b906145b1565b90506139eb8161457f565b15906139c4565b606081013515613ab557613a08602082016129b1565b15613ab257613a15612693565b51613a208280612954565b91905003613aa157600090815b613a378280612954565b9050831015613a7c5763ffffffff80613a62613a5d86613a578780612954565b90612885565b6129a0565b1691160163ffffffff811161207157600190920191613a2d565b612710925063ffffffff91501603613a9057565b632a8cecd760e21b60005260046000fd5b635f65482f60e01b60005260046000fd5b50565b63c86055b960e01b60005260046000fd5b60ff6000805160206149ef833981519152541615613ae057565b638dfc202b60e01b60005260046000fd5b929190613afd81612703565b93613b0b60405195866124eb565b602085838152019160051b81019283116102a457905b828210613b2d57505050565b60208091613b3a8461244b565b815201910190613b21565b929190613b5181612703565b93613b5f60405195866124eb565b602085838152019160051b81019283116102a457905b828210613b8157505050565b8135815260209182019101613b75565b91613ba5613bad94936115a8933691613af1565b923691613b45565b60008051602061490f8339815191525460019081810180911161207157613bd26129f3565b9082820180921161207157612579936144c0565b91613ba5613bfa94936115a8933691613af1565b60008051602061490f83398151915254906001820180921161207157613c1e6129f3565b6001810180911161207157612579926000926144c0565b90613c3f826139f2565b613c498280612954565b92906001600160401b038411610d6757600160401b8411610d675760325484603255808510613da0575b509260326000528060031c60005b818110613d42575060071982169091039081613cdc575b50506060919250613cae6119de602083016129b1565b613cba604082016129a0565b64ffffffff006033549160081b169064ffffffff001916176033550135603455565b60009485925b808710613d09575050606093945060008051602061496f8339815191520155829138613c98565b90926020613d37600192613d1c876129a0565b908a60021b63ffffffff809160031b9316831b921b19161790565b940196019590613ce2565b6000805b60088110613d69575060008051602061496f833981519152820155600101613c81565b96906020613d97600192613d7c856129a0565b908b60021b63ffffffff809160031b9316831b921b19161790565b92019701613d46565b613de490600780870160031c91601c8860021b1680613dea57500160031c60008051602061496f833981519152019060008051602061496f83398151915201612989565b38613c73565b7f11df491316f14931039edfd4f8964c9a443b862f02d4c7611d18c2bc4e6ff6968401908154906000199060200360031b1c16905538611cad565b60ff6000805160206149ef8339815191525416613e3e57565b63d93c066560e01b60005260046000fd5b600019612710820991612710820291828085109403938085039414613ee85783821115613ecf57612710829109816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b50634e487b71600052156003026011186020526024601cfd5b5080925015613ef5570490565b634e487b7160e01b600052601260045260246000fd5b90916000198383099280830292838086109503948086039514613fa05784831115613f875790829109816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b82634e487b71600052156003026011186020526024601cfd5b505080925015613ef5570490565b9291909282840361416a5760005b848110614101575090613ba582613fd8858488613fe097613be6565b953691613af1565b9160005b8251811015614017576001906140116001600160a01b03614005838761274c565b5116610f90838861274c565b01613fe4565b50928315610886576001600160a01b03169081156110b657614037613e25565b6140508460008051602061490f83398151915254612776565b60008051602061490f833981519152557fcca721777a6ecfefca61eb6abe93dd4f6bc3798df0cf7aacedffc26fbd7521c0846000948486526000805160206148cf83398151915260205260408620828154019055848660008051602061498f8339815191526020604051868152a36140cf604051928392339684614657565b0390a360008051602061490f8339815191525480151590816140f5575b5061083a575090565b905060345411386140ec565b6141126112d4610b75838886612885565b1561413b5780614128610b756001938886612885565b50614134818686612885565b5001613fbc565b610b75908561414993612885565b6345eff3cd60e11b60009081526001600160a01b0391909116600452602490fd5b632fd811f360e01b60005260046000fd5b60405163a9059cbb60e01b60208201526001600160a01b0390921660248301526044808301939093529181526126df91610fc36064836124eb565b909493959183860361416a576141cc86836146d2565b60005b8681106143bc57506141e384828885613b91565b9160018060a01b03861696876000526000805160206148cf83398151915260205260406000205480851180156143b4575b61439857506142319291614229913691613af1565b943691613b45565b9381863303614386575b90501561088657841561087057614250613e25565b60008581526000805160206148cf833981519152602052604081205482811061436c5782908783526000805160206148cf8339815191526020520360408220558160008051602061490f833981519152540360008051602061490f83398151915255808660008051602061498f8339815191526020604051868152a3805b8451811015614302576001906142fc6001600160a01b036142ef838961274c565b51168a6107ba848b61274c565b016142ce565b50939195817fd27e5ec3786ce482fa46ef9a1d7f00baf52db125828c887b2b55c503a2eaaf55919694929661434760405192839260018060a01b031696339684614657565b0390a460008051602061490f8339815191525480151590816140f5575061083a575090565b916064928763391434e360e21b8452600452602452604452fd5b6143919133906133b2565b388161423b565b84896398f9d22d60e01b60005260045260245260445260646000fd5b508015614214565b6143cd6112d4610b75838a87612885565b156144b257602460206001600160a01b036143ec610b75858c89612885565b16604051928380926370a0823160e01b82523060048301525afa90811561099857600091614481575b5080614422838886612885565b351161443157506001016141cf565b60849261444e8388614448610b758c978e8b612885565b93612885565b604051631ea032c960e31b81526001600160a01b0394851660048201529390911660248401523560448301526064820152fd5b906020823d82116144aa575b8161449a602093836124eb565b81010312610c3957505138614415565b3d915061448d565b610b75614149918885612885565b92916144cd818386613f0b565b92600481101561450a5760018091161491826144f3575b50506125799250151590612776565b9080925015613ef5576125799309151538806144e4565b634e487b7160e01b600052602160045260246000fd5b6000602091604051838101906301ffc9a760e01b82526301ffc9a760e01b6024820152602481526145526044826124eb565b5191617530fa6000513d82614573575b508161456c575090565b9050151590565b60201115915038614562565b6000602091604051838101906301ffc9a760e01b825263ffffffff60e01b6024820152602481526145526044826124eb565b600090602092604051848101916301ffc9a760e01b835263ffffffff60e01b166024820152602481526145526044826124eb565b60ff600080516020614a0f8339815191525460401c161561460257565b631afcd79f60e31b60005260046000fd5b602080825281018390526040019160005b8181106146315750505090565b909192602080600192838060a01b036146498861244b565b168152019401929101614624565b9392916146729061217260409360608852606088019061245f565b930152565b906000602091828151910182855af115610998576000513d6146c957506001600160a01b0381163b155b6146a85750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156146a1565b919060005b6000198201828111612071578110156147555760018101808211612071575b82811061470657506001016146d7565b614714610b75838588612885565b6001600160a01b0361472a610b7584878a612885565b6001600160a01b03909216911614614744576001016146f6565b6304c6b69d60e31b60005260046000fd5b50509050565b3d15614786573d9061476c8261250c565b9161477a60405193846124eb565b82523d6000602084013e565b606090565b60008091604051602081019063313ce56760e01b8252600481526147b06024826124eb565b51916001600160a01b03165afa6147c561475b565b9080614801575b6147da575b50600090600090565b602081519181808201938492010103126102a4575160ff81116147d1579060ff6001921690565b506020815110156147cc565b90614833575080511561482257805190602001fd5b63d6bda27560e01b60005260046000fd5b81511580614865575b614844575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561483c56fe762c7c328dd70a077c65c77b60e4c38eed3d2f6aa056d4d0fa114aeff8234b5652c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03bf233dd2aafeb4d50879c4aa5c81e96d92f6e6945c906a58f9f2d1c1631b4b2652c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0452c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e0111df491316f14931039edfd4f8964c9a443b862f02d4c7611d18c2bc4e6ff697ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268000773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a2646970667358221220704c39cbf0af673ca8f60de05b966e9667513c0588eb303c0f024b73d7b5bdbd64736f6c634300081c0033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"paris","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"remappings":[":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",":@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",":ds-test/=lib/solidity-http/lib/solidity-stringutils/lib/ds-test/src/",":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",":eth-gas-reporter/=node_modules/eth-gas-reporter/",":forge-std/=lib/forge-std/src/",":halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",":hardhat/=node_modules/hardhat/",":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",":openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",":openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",":solidity-http/=lib/solidity-http/src/",":solidity-stringutils/=lib/solidity-http/lib/solidity-stringutils/"],"viaIR":true},"optimization_runs":200,"sourcify_repo_url":"https://repo.sourcify.dev/contracts/full_match/1/0x325478a069b0DbBdfbEe909FA3741F84259Ba519/","decoded_constructor_args":null,"compiler_version":"0.8.28+commit.7893614a","is_verified_via_verifier_alliance":false,"verified_at":"2025-08-01T21:49:43.335593Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60a0806040523460295730608052614a64908161002f823960805181818161135601526139210152f35b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146123535750806306fdde031461229157806307a2d13a14612270578063095ea7b3146121c357806318160ddd146121985780631962ab121461213757806320df43591461210e57806323b872dd146120d6578063248a9ca3146120b85780632f2ff15d14612087578063313ce5671461203757806336568abe14611ff157806338d52e0f14611fbb5780633bb7b9e7146116435780633f4ba83a146115ca57806343998bdd146112b15780634626caa8146115ae57806349ced04d1461155f5780634cdad506146111525780634f1ef286146113c85780634fb9bbba146113ad57806352d1902d14611343578063547edab0146113135780635c975abb146112e35780635f298277146112b65780636417d15c146112b15780636bb410411461128057806370a08231146102a95780637567057a1461123c578063760168701461120d57806379502c55146111d35780638456cb591461115757806388053d2f1461115257806391d14854146110f857806394bf804d14610f2357806395d89b4114610e3057806398c601aa14610dca578063a217fddf14610dae578063a9059cbb14610d7d578063a91fc98d14610a3c578063abc226bd146109f8578063ad3cb1cc146109b9578063b2f32cb0146108e9578063b3d7f6b9146108cd578063ba087652146106a2578063c1df58b514610627578063c3f909d414610389578063c63d75b614610365578063ce96cb771461030c578063d547741f146102d4578063d905777e146102a95763dd62ed3e1461025b57600080fd5b346102a45760403660031901126102a457610274612409565b61028561027f61241f565b91612c09565b9060018060a01b03166000526020526020604060002054604051908152f35b600080fd5b346102a45760203660031901126102a45760206102cc6102c7612409565b612c42565b604051908152f35b346102a45760403660031901126102a45761030a6004356102f361241f565b9061030561030082612864565b6135b1565b613877565b005b346102a45760203660031901126102a4576001600160a01b0361032d612409565b166000526000805160206148cf83398151915260205261035160406000205461303b565b9061036160405192839283612618565b0390f35b346102a45760203660031901126102a45761037e612409565b5060206102cc613005565b346102a45760003660031901126102a457600060606040516103aa816124d0565b81815282602082015282604082015201526040516103c7816124d0565b604051808160206032549283815201603260005260008051602061496f833981519152926000905b8060078301106105a057610445945491818110610589575b818110610570575b818110610556575b81811061053c575b818110610522575b818110610508575b8181106104ee575b106104e0575b5003826124eb565b815260335490602081019060ff83161515825263ffffffff604082019360081c16835260345460608201908152604051926020845260a08401925192608060208601528351809152602060c0860194019060005b8181106104c457505050839463ffffffff915115156040860152511660608401525160808301520390f35b825163ffffffff16865260209586019590920191600101610499565b60e01c81526020018561043d565b92602060019163ffffffff8560c01c168152019301610437565b92602060019163ffffffff8560a01c16815201930161042f565b92602060019163ffffffff8560801c168152019301610427565b92602060019163ffffffff8560601c16815201930161041f565b92602060019163ffffffff8560401c168152019301610417565b92602060019163ffffffff85831c16815201930161040f565b92602060019163ffffffff85168152019301610407565b916008919350610100600191865463ffffffff8116825263ffffffff8160201c16602083015263ffffffff8160401c16604083015263ffffffff8160601c16606083015263ffffffff8160801c16608083015263ffffffff8160a01c1660a083015263ffffffff8160c01c1660c083015260e01c60e08201520194019201849293916103ef565b346102a45760803660031901126102a4576004356001600160401b0381116102a45761065790369060040161257c565b906024356001600160401b0381116102a45761067790369060040161257c565b61067f612435565b606435929091906001600160a01b03841684036102a4576020956102cc95612e44565b346102a45760603660031901126102a4576004356106be61241f565b906106c7612435565b916106d183612c42565b8083116108a957506106e28261303b565b936001600160a01b038116908433839003610897575b9050156108865780156108705761070d613e25565b6000908082526000805160206148cf83398151915260205260408220548581106108555785908284526000805160206148cf8339815191526020520360408320558460008051602061490f833981519152540360008051602061490f83398151915255818160008051602061498f8339815191526020604051898152a3815b83518110156107c7576001906107c16001600160a01b036107ad838861274c565b5116876107ba848c61274c565b519161417b565b0161078c565b5060405186946001600160a01b03169033907fd27e5ec3786ce482fa46ef9a1d7f00baf52db125828c887b2b55c503a2eaaf5590806108088a8a8a84614657565b0390a460008051602061490f833981519152548015159081610849575b5061083a575061036160405192839283612618565b63c86055b960e01b8152600490fd5b90506034541184610825565b60649350859163391434e360e21b8452600452602452604452fd5b634b637e8f60e11b600052600060045260246000fd5b63f83c702760e01b60005260046000fd5b6108a29133906133b2565b85846106f8565b82846398f9d22d60e01b60005260018060a01b031660045260245260445260646000fd5b346102a45760203660031901126102a457610351600435613172565b346102a45760403660031901126102a457610902612409565b61090a61241f565b9061091361355e565b6001600160a01b0381169161092783612aad565b6109a4576020602493604051948580926370a0823160e01b82523060048301525afa91821561099857600092610962575b61030a935061417b565b91506020833d602011610990575b8161097d602093836124eb565b810103126102a45761030a925191610958565b3d9150610970565b6040513d6000823e3d90fd5b826314184af760e31b60005260045260246000fd5b346102a45760003660031901126102a45761036160408051906109dc81836124eb565b60058252640352e302e360dc1b602083015251918291826123c0565b346102a45760403660031901126102a457610a11612409565b60243580151581036102a457610a2561355e565b15610a335761030a906136a7565b61030a906137e1565b346102a45760403660031901126102a4576004356001600160401b0381116102a457610a6c90369060040161257c565b906024356001600160401b0381116102a457608060031982360301126102a457610a9461355e565b610a9c6129f3565b610aa684846146d2565b6001600160401b038411610d6757600160401b8411610d675760008051602061494f833981519152548460008051602061494f83398151915255808510610d1f575b508260008051602061494f83398151915260005260206000209060005b868110610d04575050507f5406aca7037463fc14870cd3bcb6210f9f2b0395c172b5cef9f939c49aad93bf60405180610b3f878783614613565b0390a1610b4a6129f3565b10610cf357610b5b90600401613c35565b60005b828110610b6757005b610b7a610b75828585612885565b612895565b6001600160a01b0381169081158015610cea575b610cd557610b9b81613976565b15610c4457506040516338d52e0f60e01b8152602081600481855afa90811561099857600091610c08575b506000805160206149cf833981519152546001600160a01b03908116911603610bf457506001905b01610b5e565b630e93be7560e31b60005260045260246000fd5b906020823d8211610c3c575b81610c21602093836124eb565b81010312610c395750610c33906128a9565b85610bc6565b80fd5b3d9150610c14565b610c4d906139b4565b15610bf45760405163ab3225a560e01b815260c081600481855afa90811561099857600091610ca7575b50606001516000805160206149cf833981519152546001600160a01b03918216911603610bf45750600190610bee565b610cc8915060c03d8111610cce575b610cc081836124eb565b8101906128bd565b85610c77565b503d610cb6565b50630e93be7560e31b60005260045260246000fd5b50308214610b8e565b630e3f792d60e11b60005260046000fd5b6001906020610d1284612895565b9301928185015501610b05565b60008051602061494f833981519152600052610d61907f8c1c4c7f716a9177025811e74abdc502020e2432e8019a686f47a8591d8d2df7908101908601612989565b84610ae8565b634e487b7160e01b600052604160045260246000fd5b346102a45760403660031901126102a457610da3610d99612409565b6024359033613457565b602060405160018152f35b346102a45760003660031901126102a457602060405160008152f35b346102a45760603660031901126102a4576004356001600160401b0381116102a457610dfa90369060040161257c565b90602435906001600160401b0382116102a457602092610e216102cc93369060040161257c565b91610e2a612435565b93612c77565b346102a45760003660031901126102a45760405160006000805160206148ef83398151915254610e5f81612659565b8084529060018116908115610eff5750600114610e93575b61036183610e87818503826124eb565b604051918291826123c0565b6000805160206148ef83398151915260009081527f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa939250905b808210610ee557509091508101602001610e87610e77565b919260018160209254838588010152019101909291610ecd565b60ff191660208086019190915291151560051b84019091019150610e879050610e77565b346102a45760403660031901126102a457600435610f3f61241f565b610f47613005565b80831180156110f0575b6110cc5750610f5f82613172565b9260005b8251811015610fce57600190610fc86001600160a01b03610f84838761274c565b5116610f90838961274c565b5190604051916323b872dd60e01b6020840152336024840152306044840152606483015260648252610fc36084836124eb565b614677565b01610f63565b5090918115610886576001600160a01b031680156110b657610fee613e25565b6110078260008051602061490f83398151915254612776565b60008051602061490f833981519152556000918183526000805160206148cf83398151915260205260408320818154019055818360008051602061498f8339815191526020604051858152a37fcca721777a6ecfefca61eb6abe93dd4f6bc3798df0cf7aacedffc26fbd7521c0604051806110853394898984614657565b0390a360008051602061490f833981519152548015159081610849575061083a575061036160405192839283612618565b63ec442f0560e01b600052600060045260246000fd5b919063c16c995760e01b60005260018060a01b031660045260245260445260646000fd5b508015610f51565b346102a45760403660031901126102a45761111161241f565b6004356000526000805160206149af83398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b61263d565b346102a45760003660031901126102a457611170613510565b611178613e25565b611180613e25565b600160ff196000805160206149ef8339815191525416176000805160206149ef833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b346102a45760003660031901126102a457606060335460345463ffffffff6040519260ff81161515845260081c1660208301526040820152f35b346102a45760403660031901126102a457611226612409565b5061122f61241f565b5060206040516000198152f35b346102a45760203660031901126102a4576004356001600160401b0381116102a457608060031982360301126102a45761030a9061127861355e565b600401613c35565b346102a45760203660031901126102a45760206112a361129e612409565b612b34565b63ffffffff60405191168152f35b6125fc565b346102a45760203660031901126102a45760206112d96112d4612409565b612aad565b6040519015158152f35b346102a45760003660031901126102a457602060ff6000805160206149ef83398151915254166040519015158152f35b346102a45760003660031901126102a45761036161132f612693565b60405191829160208352602083019061245f565b346102a45760003660031901126102a4577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361139c57602060405160008051602061492f8339815191528152f35b63703e46dd60e11b60005260046000fd5b346102a45760003660031901126102a45760206102cc6129f3565b60403660031901126102a4576113dc612409565b6024356001600160401b0381116102a457366023820112156102a45761140c903690602481600401359101612527565b611414613917565b61141c61355e565b6040516352d1902d60e01b81526001600160a01b0383169290602081600481875afa6000918161152b575b506114615783634c9c8ce360e01b60005260045260246000fd5b8060008051602061492f8339815191528592036115175750813b156115035760008051602061492f83398151915280546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28151156114e95760008083602061030a95519101845af46114e361475b565b9161480d565b5050346114f257005b63b398979f60e01b60005260046000fd5b634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d602011611557575b81611547602093836124eb565b810103126102a457519085611447565b3d915061153a565b346102a45760203660031901126102a457611578612409565b60018060a01b03166000526000805160206148cf83398151915260205260206102cc6115a860406000205461303b565b9061326f565b346102a45760206102cc6115c1366125ac565b92919091613b91565b346102a45760003660031901126102a4576115e3613510565b6115eb613ac6565b6115f3613ac6565b60ff196000805160206149ef83398151915254166000805160206149ef833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b346102a45760a03660031901126102a4576004356001600160401b0381116102a45761167390369060040161255e565b6024356001600160401b0381116102a45761169290369060040161255e565b61169a612435565b6064356001600160401b0381116102a4576116b990369060040161257c565b919092608435916001600160401b0383116102a4578260040191608060031985360301126102a4576116e9613917565b600080516020614a0f833981519152549660ff8860401c1615976001600160401b03811680159081611fb3575b6001149081611fa9575b159081611fa0575b50611f8f5767ffffffffffffffff198116600117600080516020614a0f8339815191525588611f62575b5061175b6145e5565b6117636145e5565b8051906001600160401b038211610d6757819061178e60008051602061488f83398151915254612659565b601f8111611f06575b50602090601f8311600114611e8457600092611e79575b50508160011b916000199060031b1c19161760008051602061488f833981519152555b8051906001600160401b038211610d675781906117fc6000805160206148ef83398151915254612659565b601f8111611e12575b50602090601f8311600114611d9057600092611d85575b50508160011b916000199060031b1c1916176000805160206148ef833981519152555b6118476145e5565b61184f6145e5565b61185984866146d2565b6118628161478b565b9015611d7c57905b6000805160206149cf83398151915280546001600160a81b03191660a09390931b60ff60a01b16929092176001600160a01b039091161790556001600160401b038311610d6757600160401b8311610d675760008051602061494f833981519152548360008051602061494f83398151915255808410611d34575b508360008051602061494f83398151915260005260206000209060005b858110611d195750505061197c907f5406aca7037463fc14870cd3bcb6210f9f2b0395c172b5cef9f939c49aad93bf60405180611940878983614613565b0390a161194b6145e5565b6119536145e5565b61195b6145e5565b6119636145e5565b61196c336135fb565b50611976816139f2565b80612954565b906001600160401b038211610d6757600160401b8211610d675760325482603255808310611c93575b509060326000528060031c9060005b828110611c3557506007198116900380611bd1575b505050806119f06119de6024606494016129b1565b60ff8019603354169115151617603355565b6119fc604482016129a0565b64ffffffff006033549160081b169064ffffffff00191617603355013560345560005b818110611a865783611a2d57005b68ff000000000000000019600080516020614a0f8339815191525416600080516020614a0f833981519152557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b611a94610b75828486612885565b6001600160a01b0381169081158015611bc8575b610cd557611ab581613976565b15611b4757506040516338d52e0f60e01b8152602081600481855afa90811561099857600091611b0e575b506000805160206149cf833981519152546001600160a01b03908116911603610bf457506001905b01611a1f565b906020823d8211611b3f575b81611b27602093836124eb565b81010312610c395750611b39906128a9565b86611ae0565b3d9150611b1a565b611b50906139b4565b15610bf45760405163ab3225a560e01b815260c081600481855afa90811561099857600091611baa575b50606001516000805160206149cf833981519152546001600160a01b03918216911603610bf45750600190611b08565b611bc2915060c03d8111610cce57610cc081836124eb565b86611b7a565b50308214611aa8565b9160009260005b818110611bfc5750505060008051602061496f8339815191520155606485806119c9565b9091936020611c2b600192611c10886129a0565b908560021b63ffffffff809160031b9316831b921b19161790565b9501929101611bd8565b6000805b60088110611c5c575060008051602061496f8339815191528201556001016119b4565b94906020611c8a600192611c6f856129a0565b908960021b63ffffffff809160031b9316831b921b19161790565b92019501611c39565b611cd890600780850160031c91601c8660021b1680611cde575b500160031c60008051602061496f833981519152019060008051602061496f83398151915201612989565b866119a5565b7f11df491316f14931039edfd4f8964c9a443b862f02d4c7611d18c2bc4e6ff6968401908154906000199060200360031b1c1690558a611cad565b6001906020611d2784612895565b9301928185015501611902565b60008051602061494f833981519152600052611d76907f8c1c4c7f716a9177025811e74abdc502020e2432e8019a686f47a8591d8d2df7908101908501612989565b856118e5565b5060129061186a565b01519050888061181c565b6000805160206148ef83398151915260009081528281209350601f198516905b818110611dfa5750908460019594939210611de1575b505050811b016000805160206148ef8339815191525561183f565b015160001960f88460031b161c19169055888080611dc6565b92936020600181928786015181550195019301611db0565b6000805160206148ef833981519152600052611e69907f46a2803e59a4de4e7a4c574b1243f25977ac4c77d5a1a4a609b5394cebb4a2aa601f850160051c81019160208610611e6f575b601f0160051c0190612989565b89611805565b9091508190611e5c565b0151905089806117ae565b60008051602061488f83398151915260009081528281209350601f198516905b818110611eee5750908460019594939210611ed5575b505050811b0160008051602061488f833981519152556117d1565b015160001960f88460031b161c19169055898080611eba565b92936020600181928786015181550195019301611ea4565b60008051602061488f833981519152600052611f5c907f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0601f850160051c81019160208610611e6f57601f0160051c0190612989565b8a611797565b68ffffffffffffffffff19166801000000000000000117600080516020614a0f8339815191525588611752565b63f92ee8a960e01b60005260046000fd5b9050158a611728565b303b159150611720565b8a9150611716565b346102a45760003660031901126102a4576000805160206149cf833981519152546040516001600160a01b039091168152602090f35b346102a45760403660031901126102a45761200a61241f565b336001600160a01b038216036120265761030a90600435613877565b63334bd91960e11b60005260046000fd5b346102a45760003660031901126102a45760ff6000805160206149cf8339815191525460a01c1660ff811161207157602090604051908152f35b634e487b7160e01b600052601160045260246000fd5b346102a45760403660031901126102a45761030a6004356120a661241f565b906120b361030082612864565b61373f565b346102a45760203660031901126102a45760206102cc600435612864565b346102a45760603660031901126102a457610da36120f2612409565b6120fa61241f565b604435916121098333836133b2565b613457565b346102a45760003660031901126102a45760206040516000805160206148af8339815191528152f35b346102a45760003660031901126102a45761217261218061218e612159612783565b939294909160405196879660808852608088019061245f565b90868203602088015261249c565b90848203604086015261249c565b9060608301520390f35b346102a45760003660031901126102a457602060008051602061490f83398151915254604051908152f35b346102a45760403660031901126102a4576121dc612409565b60243590331561225a576001600160a01b0316908115612244576121ff33612c09565b82600052602052806040600020556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b634a1406b160e11b600052600060045260246000fd5b63e602df0560e01b600052600060045260246000fd5b346102a45760203660031901126102a45760206102cc6115a860043561303b565b346102a45760003660031901126102a457604051600060008051602061488f833981519152546122c081612659565b8084529060018116908115610eff57506001146122e75761036183610e87818503826124eb565b60008051602061488f83398151915260009081527f2ae08a8e29253f69ac5d979a101956ab8f8d9d7ded63fa7a83b16fc47648eab0939250905b80821061233957509091508101602001610e87610e77565b919260018160209254838588010152019101909291612321565b346102a45760203660031901126102a4576004359063ffffffff60e01b82168092036102a4576020916363637ce960e11b8114908115612395575b5015158152f35b637965db0b60e01b8114915081156123af575b508361238e565b6301ffc9a760e01b149050836123a8565b91909160208152825180602083015260005b8181106123f3575060409293506000838284010152601f8019910116010190565b80602080928701015160408286010152016123d2565b600435906001600160a01b03821682036102a457565b602435906001600160a01b03821682036102a457565b604435906001600160a01b03821682036102a457565b35906001600160a01b03821682036102a457565b906020808351928381520192019060005b81811061247d5750505090565b82516001600160a01b0316845260209384019390920191600101612470565b906020808351928381520192019060005b8181106124ba5750505090565b82518452602093840193909201916001016124ad565b608081019081106001600160401b03821117610d6757604052565b90601f801991011681019081106001600160401b03821117610d6757604052565b6001600160401b038111610d6757601f01601f191660200190565b9291926125338261250c565b9161254160405193846124eb565b8294818452818301116102a4578281602093846000960137010152565b9080601f830112156102a45781602061257993359101612527565b90565b9181601f840112156102a4578235916001600160401b0383116102a4576020808501948460051b0101116102a457565b60406003198201126102a4576004356001600160401b0381116102a457816125d69160040161257c565b92909291602435906001600160401b0382116102a4576125f89160040161257c565b9091565b346102a45760206102cc61260f366125ac565b92919091613be6565b909161262f6125799360408452604084019061245f565b91602081840391015261249c565b346102a45760203660031901126102a45761035160043561303b565b90600182811c92168015612689575b602083101461267357565b634e487b7160e01b600052602260045260246000fd5b91607f1691612668565b6040519060008051602061494f83398151915254808352826020810160008051602061494f83398151915260005260206000209260005b8181106126e15750506126df925003836124eb565b565b84546001600160a01b03168352600194850194879450602090930192016126ca565b6001600160401b038111610d675760051b60200190565b9061272482612703565b61273160405191826124eb565b8281528092612742601f1991612703565b0190602036910137565b80518210156127605760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b9190820180921161207157565b61278b612693565b90612796825161271a565b6127a0835161271a565b906000936000945b815186101561285d576001600160a01b036127c3878461274c565b516040516370a0823160e01b81523060048201529116602082602481845afa91821561099857600092612828575b509161280e82600194612820946128088c8a61274c565b526132cc565b908161281a8a8961274c565b52612776565b9501946127a8565b90916020823d8211612855575b81612842602093836124eb565b81010312610c395750519061280e6127f1565b3d9150612835565b9094509092565b6000526000805160206149af83398151915260205260016040600020015490565b91908110156127605760051b0190565b356001600160a01b03811681036102a45790565b51906001600160a01b03821682036102a457565b908160c09103126102a45760006040519160c083018381106001600160401b038211176129405760405260a0906128f3816128a9565b84526020810151602085015260408101516040850152612915606082016128a9565b6060850152612926608082016128a9565b60808501520151908115158203610c39575060a082015290565b634e487b7160e01b83526041600452602483fd5b903590601e19813603018212156102a457018035906001600160401b0382116102a457602001918160051b360383136102a457565b818110612994575050565b60008155600101612989565b3563ffffffff811681036102a45790565b3580151581036102a45790565b60008051602061494f833981519152548110156127605760008051602061494f83398151915260005260206000200190600090565b60008060008051602061494f833981519152545b808210612a1357505090565b9091612a1e836129be565b90546040516370a0823160e01b81523060048201529160031b1c6001600160a01b0316602082602481845afa91821561099857600092612a78575b5091612a6a612a70926001946132cc565b90612776565b920190612a07565b90916020823d8211612aa5575b81612a92602093836124eb565b81010312610c3957505190612a6a612a59565b3d9150612a85565b60008051602061494f833981519152549060005b828110612ad057505050600090565b612ad9816129be565b905460039190911b1c6001600160a01b0390811690831614612afd57600101612ac1565b505050600190565b90603254821015612760576032600052600382901c60008051602061496f833981519152019160021b601c1690565b612b3d81612aad565b80612bfd575b15612bf757612b50612693565b9060001960005b835160ff821690811015612bee576001600160a01b03612b77828761274c565b51166001600160a01b03851614612b9c575060ff1660ff811461207157600101612b57565b60000b935050505b6000198260000b14612bcd5750612bc263ffffffff9160ff16612b05565b90549060031b1c1690565b6305fe563f60e31b60009081526001600160a01b0391909116600452602490fd5b50509150612ba4565b50600090565b5060ff60335416612b43565b6001600160a01b031660009081527f52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace016020526040902090565b6001600160a01b031660009081526000805160206148cf833981519152602052604090205490565b9190820391821161207157565b9390949260ff6033541615612e375760325492612c92612783565b999250979050612ca18661271a565b9760005b878110612e02575050612cbb9596979850613fae565b92612cc4612783565b60335460081c63ffffffff169350915060005b858110612ce657505050505050565b612cf0818361274c565b516001840180851161207157612d0591613e4f565b63ffffffff612d1383612b05565b90549060031b1c1690612d268683612776565b81118015612df0575b612d3e575b5050600101612cd7565b6000612d4a848961274c565b51821115612d9e57508582612d5f858a61274c565b51109283612d89575b5050505b15612d78573880612d34565b632e657be160e01b60005260046000fd5b612d94929350612776565b1015388581612d68565b9190612daa848961274c565b518110612db9575b5050612d6c565b9091508582612dc8858a61274c565b51119283612ddb575b5050503880612db2565b612de6929350612c6a565b1115388581612dd1565b50612dfb8683612c6a565b8110612d2f565b612e0c818361274c565b519060018c0191828d1161207157600192612e2691613e4f565b612e30828d61274c565b5201612ca5565b9190929461257994613fae565b9491929593909560ff6033541615612ff65760325493612e62612783565b9a9250989050612e718761271a565b9860005b888110612fc1575050612e8b96979899506141b6565b92612e94612783565b60335460081c63ffffffff169350915060005b858110612eb657505050505050565b612ec0818361274c565b516001840180851161207157612ed591613e4f565b63ffffffff612ee383612b05565b90549060031b1c1690612ef68683612776565b81118015612faf575b612f0e575b5050600101612ea7565b6000612f1a848961274c565b51821115612f5d57508582612f2f858a61274c565b51109283612f48575b5050505b15612d78573880612f04565b612f53929350612776565b1015388581612f38565b9190612f69848961274c565b518110612f78575b5050612f3c565b9091508582612f87858a61274c565b51119283612f9a575b5050503880612f71565b612fa5929350612c6a565b1115388581612f90565b50612fba8683612c6a565b8110612eff565b612fcb818361274c565b519060018d01808e1161207157612fef82612fe98f93600196613e4f565b9261274c565b5201612e75565b919395612579959391936141b6565b60008051602061490f8339815191525415801561302c575b6130275760001990565b600090565b506130356129f3565b1561301d565b90613044612783565b949183518015801561316a575b61315b575061305e6129f3565b91600183018093116120715760008051602061490f8339815191525492600194858501809511612071578594613096926000926144c0565b966130a1865161271a565b976000945b6130b5575b5050505050509190565b86518510156131565785809583158015613144575b8015613132575b156130eb5760006130e2828d61274c565b525b01946130a6565b613122600061310681876130ff868b61274c565b51886144c0565b613110848a61274c565b5161311b858a61274c565b51916144c0565b61312c828d61274c565b526130e4565b5061313d818661274c565b51156130d1565b5061314f818761274c565b51156130ca565b6130ab565b9250505061257991935061271a565b508315613051565b9061317b612783565b9491835180158015613267575b61315b57506131956129f3565b91600183018093116120715760008051602061490f83398151915254926001948585018095116120715785946131cc9286926144c0565b966131d7865161271a565b976000945b6131ea575050505050509190565b86518510156131565785809583158015613255575b8015613243575b15613220576000613217828d61274c565b525b01946131dc565b6132338261310681876130ff868b61274c565b61323d828d61274c565b52613219565b5061324e818661274c565b5115613206565b50613260818761274c565b51156131ff565b508315613188565b9081518151036132c557600091825b81518410156132be576001906132b690612a6a6001600160a01b036132a3888761274c565b51166132af888861274c565b51906132cc565b93019261327e565b9250505090565b5050600090565b906132d682613976565b613375576132e3826139b4565b6133095750630e93be7560e31b60009081526001600160a01b0391909116600452602490fd5b604051631df6366360e01b8152600481019190915290602090829060249082906001600160a01b03165afa90811561099857600091613346575090565b90506020813d60201161336d575b81613361602093836124eb565b810103126102a4575190565b3d9150613354565b6040516303d1689d60e11b8152600481019190915290602090829060249082906001600160a01b03165afa90811561099857600091613346575090565b91906133bd83612c09565b60018060a01b0382166000526020526040600020549260001984106133e3575b50505050565b828410613432576001600160a01b0381161561225a576001600160a01b038216156122445761341190612c09565b9060018060a01b0316600052602052604060002091039055388080806133dd565b508290637dc7a0d960e11b60005260018060a01b031660045260245260445260646000fd5b6001600160a01b0316908115610870576001600160a01b03169182156110b65761347f613e25565b60008281526000805160206148cf83398151915260205260408120548281106134f657916040828260008051602061498f8339815191529587602096526000805160206148cf833981519152865203828220558681526000805160206148cf833981519152845220818154019055604051908152a3565b916064928463391434e360e21b8452600452602452604452fd5b33600090815260008051602061486f833981519152602052604090205460ff161561353757565b63e2517d3f60e01b600052336004526000805160206148af83398151915260245260446000fd5b3360009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff161561359757565b63e2517d3f60e01b60005233600452600060245260446000fd5b60008181526000805160206149af8339815191526020908152604080832033845290915290205460ff16156135e35750565b63e2517d3f60e01b6000523360045260245260446000fd5b6001600160a01b03811660009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff16612bf7576001600160a01b031660008181527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d60205260408120805460ff191660011790553391907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4600190565b6001600160a01b038116600090815260008051602061486f833981519152602052604090205460ff16612bf7576001600160a01b0316600081815260008051602061486f83398151915260205260408120805460ff191660011790553391906000805160206148af833981519152907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b60008181526000805160206149af833981519152602090815260408083206001600160a01b038616845290915290205460ff166132c55760008181526000805160206149af833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b6001600160a01b038116600090815260008051602061486f833981519152602052604090205460ff1615612bf7576001600160a01b0316600081815260008051602061486f83398151915260205260408120805460ff191690553391906000805160206148af833981519152907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60008181526000805160206149af833981519152602090815260408083206001600160a01b038616845290915290205460ff16156132c55760008181526000805160206149af833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115613953575b5061139c57565b60008051602061492f833981519152546001600160a01b0316141590503861394c565b61397f81614520565b90816139a2575b8161398f575090565b61257991506363637ce960e11b906145b1565b90506139ad8161457f565b1590613986565b6139bd81614520565b90816139e0575b816139cd575090565b61257991506365345e5b60e11b906145b1565b90506139eb8161457f565b15906139c4565b606081013515613ab557613a08602082016129b1565b15613ab257613a15612693565b51613a208280612954565b91905003613aa157600090815b613a378280612954565b9050831015613a7c5763ffffffff80613a62613a5d86613a578780612954565b90612885565b6129a0565b1691160163ffffffff811161207157600190920191613a2d565b612710925063ffffffff91501603613a9057565b632a8cecd760e21b60005260046000fd5b635f65482f60e01b60005260046000fd5b50565b63c86055b960e01b60005260046000fd5b60ff6000805160206149ef833981519152541615613ae057565b638dfc202b60e01b60005260046000fd5b929190613afd81612703565b93613b0b60405195866124eb565b602085838152019160051b81019283116102a457905b828210613b2d57505050565b60208091613b3a8461244b565b815201910190613b21565b929190613b5181612703565b93613b5f60405195866124eb565b602085838152019160051b81019283116102a457905b828210613b8157505050565b8135815260209182019101613b75565b91613ba5613bad94936115a8933691613af1565b923691613b45565b60008051602061490f8339815191525460019081810180911161207157613bd26129f3565b9082820180921161207157612579936144c0565b91613ba5613bfa94936115a8933691613af1565b60008051602061490f83398151915254906001820180921161207157613c1e6129f3565b6001810180911161207157612579926000926144c0565b90613c3f826139f2565b613c498280612954565b92906001600160401b038411610d6757600160401b8411610d675760325484603255808510613da0575b509260326000528060031c60005b818110613d42575060071982169091039081613cdc575b50506060919250613cae6119de602083016129b1565b613cba604082016129a0565b64ffffffff006033549160081b169064ffffffff001916176033550135603455565b60009485925b808710613d09575050606093945060008051602061496f8339815191520155829138613c98565b90926020613d37600192613d1c876129a0565b908a60021b63ffffffff809160031b9316831b921b19161790565b940196019590613ce2565b6000805b60088110613d69575060008051602061496f833981519152820155600101613c81565b96906020613d97600192613d7c856129a0565b908b60021b63ffffffff809160031b9316831b921b19161790565b92019701613d46565b613de490600780870160031c91601c8860021b1680613dea57500160031c60008051602061496f833981519152019060008051602061496f83398151915201612989565b38613c73565b7f11df491316f14931039edfd4f8964c9a443b862f02d4c7611d18c2bc4e6ff6968401908154906000199060200360031b1c16905538611cad565b60ff6000805160206149ef8339815191525416613e3e57565b63d93c066560e01b60005260046000fd5b600019612710820991612710820291828085109403938085039414613ee85783821115613ecf57612710829109816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b50634e487b71600052156003026011186020526024601cfd5b5080925015613ef5570490565b634e487b7160e01b600052601260045260246000fd5b90916000198383099280830292838086109503948086039514613fa05784831115613f875790829109816000038216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b82634e487b71600052156003026011186020526024601cfd5b505080925015613ef5570490565b9291909282840361416a5760005b848110614101575090613ba582613fd8858488613fe097613be6565b953691613af1565b9160005b8251811015614017576001906140116001600160a01b03614005838761274c565b5116610f90838861274c565b01613fe4565b50928315610886576001600160a01b03169081156110b657614037613e25565b6140508460008051602061490f83398151915254612776565b60008051602061490f833981519152557fcca721777a6ecfefca61eb6abe93dd4f6bc3798df0cf7aacedffc26fbd7521c0846000948486526000805160206148cf83398151915260205260408620828154019055848660008051602061498f8339815191526020604051868152a36140cf604051928392339684614657565b0390a360008051602061490f8339815191525480151590816140f5575b5061083a575090565b905060345411386140ec565b6141126112d4610b75838886612885565b1561413b5780614128610b756001938886612885565b50614134818686612885565b5001613fbc565b610b75908561414993612885565b6345eff3cd60e11b60009081526001600160a01b0391909116600452602490fd5b632fd811f360e01b60005260046000fd5b60405163a9059cbb60e01b60208201526001600160a01b0390921660248301526044808301939093529181526126df91610fc36064836124eb565b909493959183860361416a576141cc86836146d2565b60005b8681106143bc57506141e384828885613b91565b9160018060a01b03861696876000526000805160206148cf83398151915260205260406000205480851180156143b4575b61439857506142319291614229913691613af1565b943691613b45565b9381863303614386575b90501561088657841561087057614250613e25565b60008581526000805160206148cf833981519152602052604081205482811061436c5782908783526000805160206148cf8339815191526020520360408220558160008051602061490f833981519152540360008051602061490f83398151915255808660008051602061498f8339815191526020604051868152a3805b8451811015614302576001906142fc6001600160a01b036142ef838961274c565b51168a6107ba848b61274c565b016142ce565b50939195817fd27e5ec3786ce482fa46ef9a1d7f00baf52db125828c887b2b55c503a2eaaf55919694929661434760405192839260018060a01b031696339684614657565b0390a460008051602061490f8339815191525480151590816140f5575061083a575090565b916064928763391434e360e21b8452600452602452604452fd5b6143919133906133b2565b388161423b565b84896398f9d22d60e01b60005260045260245260445260646000fd5b508015614214565b6143cd6112d4610b75838a87612885565b156144b257602460206001600160a01b036143ec610b75858c89612885565b16604051928380926370a0823160e01b82523060048301525afa90811561099857600091614481575b5080614422838886612885565b351161443157506001016141cf565b60849261444e8388614448610b758c978e8b612885565b93612885565b604051631ea032c960e31b81526001600160a01b0394851660048201529390911660248401523560448301526064820152fd5b906020823d82116144aa575b8161449a602093836124eb565b81010312610c3957505138614415565b3d915061448d565b610b75614149918885612885565b92916144cd818386613f0b565b92600481101561450a5760018091161491826144f3575b50506125799250151590612776565b9080925015613ef5576125799309151538806144e4565b634e487b7160e01b600052602160045260246000fd5b6000602091604051838101906301ffc9a760e01b82526301ffc9a760e01b6024820152602481526145526044826124eb565b5191617530fa6000513d82614573575b508161456c575090565b9050151590565b60201115915038614562565b6000602091604051838101906301ffc9a760e01b825263ffffffff60e01b6024820152602481526145526044826124eb565b600090602092604051848101916301ffc9a760e01b835263ffffffff60e01b166024820152602481526145526044826124eb565b60ff600080516020614a0f8339815191525460401c161561460257565b631afcd79f60e31b60005260046000fd5b602080825281018390526040019160005b8181106146315750505090565b909192602080600192838060a01b036146498861244b565b168152019401929101614624565b9392916146729061217260409360608852606088019061245f565b930152565b906000602091828151910182855af115610998576000513d6146c957506001600160a01b0381163b155b6146a85750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156146a1565b919060005b6000198201828111612071578110156147555760018101808211612071575b82811061470657506001016146d7565b614714610b75838588612885565b6001600160a01b0361472a610b7584878a612885565b6001600160a01b03909216911614614744576001016146f6565b6304c6b69d60e31b60005260046000fd5b50509050565b3d15614786573d9061476c8261250c565b9161477a60405193846124eb565b82523d6000602084013e565b606090565b60008091604051602081019063313ce56760e01b8252600481526147b06024826124eb565b51916001600160a01b03165afa6147c561475b565b9080614801575b6147da575b50600090600090565b602081519181808201938492010103126102a4575160ff81116147d1579060ff6001921690565b506020815110156147cc565b90614833575080511561482257805190602001fd5b63d6bda27560e01b60005260046000fd5b81511580614865575b614844575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561483c56fe762c7c328dd70a077c65c77b60e4c38eed3d2f6aa056d4d0fa114aeff8234b5652c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace03bf233dd2aafeb4d50879c4aa5c81e96d92f6e6945c906a58f9f2d1c1631b4b2652c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0052c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace0452c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace02360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e0111df491316f14931039edfd4f8964c9a443b862f02d4c7611d18c2bc4e6ff697ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268000773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a2646970667358221220704c39cbf0af673ca8f60de05b966e9667513c0588eb303c0f024b73d7b5bdbd64736f6c634300081c0033","name":"IToken","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":true,"additional_sources":[{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the symbol of the token.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the decimals places of the token.\n     */\n    function decimals() external view returns (uint8);\n}\n"},{"file_path":"contracts/interfaces/IIToken.sol","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.28;\n\nimport {IERC4626MultiAsset} from \"./IERC4626MultiAsset.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IIToken is IERC165, IERC4626MultiAsset {\n    /// @notice Array Mismatch\n    error ErrorArrayMismatch();\n    /// @notice Ratios not 100\n    error ErrorRatiosNot100();\n    /// @notice contract is left with bad asset ratio\n    error ErrorBadAssetRatio();\n    /// @notice Asset not in config\n    error ErrorAssetNotFound(address asset);\n    /// @notice DepositAssets updated but value went down\n    error ErrorDepositAssetsValueWentDown();\n    /// @notice DepositAsset list is invalid\n    error ErrorInvalidDepositAsset(address asset);\n    /// @notice Asset cannot be rescued since it is a deposit asset\n    error ErrorAssetCannotBeRescued(address asset);\n    /// @notice Not enough shares left in contract\n    error ErrorMinShares();\n\n    struct ITokenParams {\n        uint32[] assetRatiosBps;\n        bool enforcedRatio;\n        uint32 maxDeviationBps;\n        uint256 minShares;\n    }\n\n    /// @notice returns the config of the iToken\n    function getConfig() external view returns (ITokenParams memory);\n\n    /// @notice sets the config of the iToken, only DEFAULT_ADMIN_ROLE\n    function setConfig(ITokenParams calldata params) external;\n\n    /// @notice returns the ratio of the vault this specific asset value is supposed to be\n    function getAssetRatio(address asset) external view returns (uint32);\n\n    /// @notice updates the depositAssets of the vault (must come with new config since list is different)\n    function updateDepositAssets(address[] calldata newAssets, ITokenParams calldata newConfig) external;\n\n    /// @notice rescues asset that is not in the depositAssets list, only DEFAULT_ADMIN_ROLE\n    function rescueAsset(IERC20 rescuedAsset, address to) external;\n}\n"},{"file_path":"contracts/BaseUpgradeable.sol","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.28;\n\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {AccessControlUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\nimport {PausableUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\";\n\n/**\n * @dev Base upgradeable contract with:\n * - UUPS upgradeability\n * - Access control with roles\n * - Pausable functionality\n */\n\nabstract contract BaseUpgradeable is UUPSUpgradeable, AccessControlUpgradeable, PausableUpgradeable {\n    uint256[50] private __gap;\n\n    /// @notice Emergency role for pausing contract\n    bytes32 public constant EMERGENCY_ROLE = keccak256(\"EMERGENCY_ROLE\");\n\n    function __BaseUpgradable_init() internal onlyInitializing {\n        __UUPSUpgradeable_init();\n        __AccessControl_init();\n        __Pausable_init();\n\n        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     */\n    function _authorizeUpgrade(address) internal override onlyRole(DEFAULT_ADMIN_ROLE) {}\n\n    /**\n     * @notice Function to set the emergency role address and its status.\n     * @dev Can only be called by the DEFAULT_ADMIN_ROLE, emergency role used for pausing\n     */\n    function setEmergencyRole(address _emergencyRole, bool _status) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        if (_status) {\n            _grantRole(EMERGENCY_ROLE, _emergencyRole);\n        } else {\n            _revokeRole(EMERGENCY_ROLE, _emergencyRole);\n        }\n    }\n\n    /** @dev See {ITToken-pause} */\n    function pause() external onlyRole(EMERGENCY_ROLE) whenNotPaused {\n        _pause();\n    }\n\n    /** @dev See {ITToken-unpause} */\n    function unpause() external onlyRole(EMERGENCY_ROLE) whenPaused {\n        _unpause();\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Utils.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.22;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev The `implementation` of the proxy is invalid.\n     */\n    error ERC1967InvalidImplementation(address implementation);\n\n    /**\n     * @dev The `admin` of the proxy is invalid.\n     */\n    error ERC1967InvalidAdmin(address admin);\n\n    /**\n     * @dev The `beacon` of the proxy is invalid.\n     */\n    error ERC1967InvalidBeacon(address beacon);\n\n    /**\n     * @dev An upgrade function sees `msg.value > 0` that may be lost.\n     */\n    error ERC1967NonPayable();\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function getImplementation() internal view returns (address) {\n        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (newImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(newImplementation);\n        }\n        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n        _setImplementation(newImplementation);\n        emit IERC1967.Upgraded(newImplementation);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(newImplementation, data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     *\n     * TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using\n     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n     */\n    function getAdmin() internal view returns (address) {\n        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the ERC-1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967InvalidAdmin(address(0));\n        }\n        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {IERC1967-AdminChanged} event.\n     */\n    function changeAdmin(address newAdmin) internal {\n        emit IERC1967.AdminChanged(getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function getBeacon() internal view returns (address) {\n        return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the ERC-1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (newBeacon.code.length == 0) {\n            revert ERC1967InvalidBeacon(newBeacon);\n        }\n\n        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n        address beaconImplementation = IBeacon(newBeacon).implementation();\n        if (beaconImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(beaconImplementation);\n        }\n    }\n\n    /**\n     * @dev Change the beacon and trigger a setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-BeaconUpgraded} event.\n     *\n     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n     * efficiency.\n     */\n    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n        _setBeacon(newBeacon);\n        emit IERC1967.BeaconUpgraded(newBeacon);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n     * if an upgrade doesn't perform an initialization call.\n     */\n    function _checkNonPayable() private {\n        if (msg.value > 0) {\n            revert ERC1967NonPayable();\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\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    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) 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 a `value` amount of tokens as the allowance of `spender` over the\n     * 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 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` 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(address from, address to, uint256 value) external returns (bool);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.22;\n\nimport {IERC1822Proxiable} from \"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address private immutable __self = address(this);\n\n    /**\n     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n     * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n     * during an upgrade.\n     */\n    string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n    /**\n     * @dev The call is from an unauthorized context.\n     */\n    error UUPSUnauthorizedCallContext();\n\n    /**\n     * @dev The storage `slot` is unsupported as a UUID.\n     */\n    error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        _checkProxy();\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        _checkNotDelegated();\n        _;\n    }\n\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n        return ERC1967Utils.IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data);\n    }\n\n    /**\n     * @dev Reverts if the execution is not performed via delegatecall or the execution\n     * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n     */\n    function _checkProxy() internal view virtual {\n        if (\n            address(this) == __self || // Must be called through delegatecall\n            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n        ) {\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Reverts if the execution is performed via delegatecall.\n     * See {notDelegated}.\n     */\n    function _checkNotDelegated() internal view virtual {\n        if (address(this) != __self) {\n            // Must not be called through delegatecall\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n     *\n     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n     * is expected to be the implementation slot in ERC-1967.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n                revert UUPSUnsupportedProxiableUUID(slot);\n            }\n            ERC1967Utils.upgradeToAndCall(newImplementation, data);\n        } catch {\n            // The implementation is not UUPS\n            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {ContextUpgradeable} from \"../../utils/ContextUpgradeable.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20, IERC20Metadata, IERC20Errors {\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC20\n    struct ERC20Storage {\n        mapping(address account => uint256) _balances;\n\n        mapping(address account => mapping(address spender => uint256)) _allowances;\n\n        uint256 _totalSupply;\n\n        string _name;\n        string _symbol;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC20\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC20StorageLocation = 0x52c63247e1f47db19d5ce0460030c497f067ca4cebf71ba98eeadabe20bace00;\n\n    function _getERC20Storage() private pure returns (ERC20Storage storage $) {\n        assembly {\n            $.slot := ERC20StorageLocation\n        }\n    }\n\n    /**\n     * @dev Sets the values for {name} and {symbol}.\n     *\n     * Both values are immutable: they can only be set once during construction.\n     */\n    function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n        __ERC20_init_unchained(name_, symbol_);\n    }\n\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n        ERC20Storage storage $ = _getERC20Storage();\n        $._name = name_;\n        $._symbol = symbol_;\n    }\n\n    /**\n     * @dev Returns the name of the token.\n     */\n    function name() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev Returns the symbol of the token, usually a shorter version of the\n     * name.\n     */\n    function symbol() public view virtual returns (string memory) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._symbol;\n    }\n\n    /**\n     * @dev Returns the number of decimals used to get its user representation.\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\n     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n     *\n     * Tokens usually opt for a value of 18, imitating the relationship between\n     * Ether and Wei. This is the default value returned by this function, unless\n     * it's overridden.\n     *\n     * NOTE: This information is only used for _display_ purposes: it in\n     * no way affects any of the arithmetic of the contract, including\n     * {IERC20-balanceOf} and {IERC20-transfer}.\n     */\n    function decimals() public view virtual returns (uint8) {\n        return 18;\n    }\n\n    /**\n     * @dev See {IERC20-totalSupply}.\n     */\n    function totalSupply() public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._totalSupply;\n    }\n\n    /**\n     * @dev See {IERC20-balanceOf}.\n     */\n    function balanceOf(address account) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._balances[account];\n    }\n\n    /**\n     * @dev See {IERC20-transfer}.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - the caller must have a balance of at least `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-allowance}.\n     */\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        ERC20Storage storage $ = _getERC20Storage();\n        return $._allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n     * `transferFrom`. This is semantically equivalent to an infinite approval.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     */\n    function approve(address spender, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Skips emitting an {Approval} event indicating an allowance update. This is not\n     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n     *\n     * NOTE: Does not update the allowance if the current allowance\n     * is the maximum `uint256`.\n     *\n     * Requirements:\n     *\n     * - `from` and `to` cannot be the zero address.\n     * - `from` must have a balance of at least `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to`.\n     *\n     * This internal function is equivalent to {transfer}, and can be used to\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\n     *\n     * Emits a {Transfer} event.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            $._totalSupply += value;\n        } else {\n            uint256 fromBalance = $._balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                $._balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                $._totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                $._balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.\n     *\n     * This internal function is equivalent to `approve`, and can be used to\n     * e.g. set automatic allowances for certain subsystems, etc.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `owner` cannot be the zero address.\n     * - `spender` cannot be the zero address.\n     *\n     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     *\n     * ```solidity\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        ERC20Storage storage $ = _getERC20Storage();\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        $._allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance < type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},{"file_path":"contracts/interfaces/IERC4626Whitelisted.sol","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.28;\n\nimport {IERC4626} from \"@openzeppelin/contracts/interfaces/IERC4626.sol\";\nimport {ITheoWhitelist} from \"./ITheoWhitelist.sol\";\n\ninterface IERC4626Whitelisted is IERC4626 {\n    /// @notice Transfer status update\n    event TransferStatusUpdate(TransferStatus status);\n\n    /**\n     * @dev Attempted to transfer tokens when the transfer status is CLOSED\n     */\n    error UnauthorizedTransferClosed();\n\n    /**\n     * @dev Atempted to set the whitelist contract to an invalid address\n     */\n    error InvalidWhitelistAddress(address whitelistAddress);\n\n    /**\n     *   @notice Status of the Token\n     * - OPEN: Token is open for all transfers\n     * - CLOSED: Token is closed all transfers\n     * - ONLY_WHITELISTED: Token is open for transfers, but only for whitelisted users\n     */\n    enum TransferStatus {\n        OPEN,\n        CLOSED,\n        ONLY_WHITELISTED\n    }\n\n    /// @notice returns the current transfer status of the token\n    function transferStatus() external view returns (TransferStatus);\n\n    /// @notice sets the transfer status of the token\n    function setTransferStatus(TransferStatus status) external;\n\n    /// @notice returns if an account can transfer tokens\n    function canTransfer(address account) external view returns (bool);\n\n    /// @notice returns address of the Whitelist contract\n    function whitelistContract() external view returns (ITheoWhitelist);\n\n    /// @notice sets the Whitelist contract address\n    function setWhitelistContract(ITheoWhitelist whitelistContract) external;\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @title IERC1363\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\n *\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\n */\ninterface IERC1363 is IERC20, IERC165 {\n    /*\n     * Note: the ERC-165 identifier for this interface is 0xb0202a11.\n     * 0xb0202a11 ===\n     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\n     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^\n     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\n     */\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n     * @param from The address which you want to send tokens from.\n     * @param to The address which you want to transfer to.\n     * @param value The amount of tokens to be transferred.\n     * @param data Additional data with no specified format, sent in call to `to`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n     * @param spender The address which will spend the funds.\n     * @param value The amount of tokens to be spent.\n     * @param data Additional data with no specified format, sent in call to `spender`.\n     * @return A boolean value indicating whether the operation succeeded unless throwing.\n     */\n    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"},{"file_path":"contracts/interfaces/IERC4626MultiAsset.sol","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.28;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\n/**\n * @notice  Interface for a multi-asset ERC4626 vault.\n * @dev     This interface extends the standard IERC4626 to support multiple asset types.\n */\ninterface IERC4626MultiAsset is IERC20, IERC20Metadata {\n    event Deposit(address indexed sender, address indexed owner, address[] depositAssets, uint256[] depositAssetAmounts, uint256 shares);\n    event Withdraw(address indexed sender, address indexed receiver, address indexed owner, address[] withdrawalAssets, uint256[] withdrawAssetAmounts, uint256 shares);\n    event UpdateDepositAssets(address[] assets);\n\n    /**\n     * @dev Returns the address of the underlying token used for the Vault for accounting.\n     *\n     * - MUST be an ERC-20 token contract.\n     * - MUST NOT revert.\n     */\n    function asset() external view returns (address underlyingAsset);\n\n    /**\n     * @dev Returns the list of assets that the Vault supports for deposits and withdrawals.\n     *\n     * - MUST return an empty array if the Vault does not support any assets.\n     * - MUST NOT return the underlying asset of the Vault.\n     * - MUST NOT revert.\n     */\n    function depositAssetsList() external view returns (address[] memory assets);\n\n    /**\n     * @dev Returns if an asset is supported to be deposited into the Vault.\n     *\n     * - MUST return true if the asset is supported for deposits.\n     * - MUST return false if the asset is not supported for deposits.\n     * - MUST NOT revert.\n     */\n    function isSupportedDepositAsset(address asset) external view returns (bool);\n\n    /**\n     * @dev Returns the total amount of the underlying asset that is “managed” by Vault.\n     *\n     * - SHOULD include any compounding that occurs from yield from any of the assets supported.\n     * - MUST be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT revert.\n     */\n    function totalUnderlyingAssets() external view returns (uint256 totalManagedAssets);\n\n    /**\n     * @dev Returns the total amount of the deposit assets that are “managed” by Vault and their values in terms of the base underlying asset.\n     *\n     * - SHOULD include any compounding that occurs from yield from any of the assets supported.\n     * - MUST be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT revert.\n     */\n    function totalDepositAssets() external view returns (address[] memory depositAssets, uint256[] memory amounts, uint256[] memory values, uint256 totalUnderlyingValue);\n\n    /**\n     * @dev Returns the total amount of the underlying asset that the user owns\n     *\n     * - SHOULD include any compounding that occurs from yield from any of the assets supported.\n     * - MUST be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT revert.\n     */\n    function userTotalUnderlyingAssets(address user) external view returns (uint256 totalUnderlyingAssets);\n\n    /**\n     * @dev Returns the amount of shares that the Vault would exchange for the amount of types of assets provided, in an ideal\n     * scenario where all the conditions are met.\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToShares(address[] calldata depositAssets, uint256[] calldata assetAmounts) external view returns (uint256 shares);\n\n    /**\n     * @dev Returns the amount of underlying assets that the Vault shares provided are worth\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToAssets(uint256 shares) external view returns (uint256 underlyingAssetAmount);\n\n    /**\n     * @dev Returns the amounts and types of deposit assets that the Vault would exchange for the amount of shares provided, in an ideal\n     * scenario where all the conditions are met.\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToDepositAssets(uint256 shares) external view returns (address[] memory depositAssets, uint256[] memory assetAmounts);\n\n    /**\n     * @dev Returns the maximum amount of the supported asset that can be deposited into the Vault for the receiver,\n     * through a deposit call.\n     *\n     * - MUST return a limited value if receiver is subject to some deposit limit.\n     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\n     * - MUST NOT revert.\n     */\n    function maxDeposit(address depositAsset, address receiver) external view returns (uint256 maxAssets);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\n     * current on-chain conditions.\n     *\n     * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\n     *   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\n     *   in the same transaction.\n     * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\n     *   deposit would be accepted, regardless if the user has enough tokens approved, etc.\n     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n     */\n    function previewDeposit(address[] calldata depositAssets, uint256[] calldata assetAmounts) external view returns (uint256 shares);\n\n    /**\n     * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\n     *\n     * - MUST emit the Deposit event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   deposit execution, and are accounted for during deposit.\n     * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\n     *   approving enough underlying tokens to the Vault contract, etc).\n     *\n     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n     */\n    function deposit(address[] calldata depositAssets, uint256[] calldata assetAmounts, address receiver) external returns (uint256 shares);\n\n    /**\n     * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\n     * - MUST return a limited value if receiver is subject to some mint limit.\n     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\n     * - MUST NOT revert.\n     */\n    function maxMint(address receiver) external view returns (uint256 maxShares);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\n     * current on-chain conditions.\n     *\n     * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\n     *   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\n     *   same transaction.\n     * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\n     *   would be accepted, regardless if the user has enough tokens approved, etc.\n     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by minting.\n     */\n    function previewMint(uint256 shares) external view returns (address[] memory depositAssets, uint256[] memory assetAmounts);\n\n    /**\n     * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\n     *\n     * - MUST emit the Deposit event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\n     *   execution, and are accounted for during mint.\n     * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\n     *   approving enough underlying tokens to the Vault contract, etc).\n     *\n     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n     */\n    function mint(uint256 shares, address receiver) external returns (address[] memory depositAssets, uint256[] memory assetAmounts);\n\n    /**\n     * @dev Returns the maximum amount of the deposit assets that can be withdrawn from the owner balance in the\n     * Vault, through a withdraw call if all assets are withdrawn.\n     *\n     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n     * - MUST NOT revert.\n     */\n    function maxWithdraw(address owner) external view returns (address[] memory maxDepositAssets, uint256[] memory maxAssetAmounts);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\n     * given current on-chain conditions.\n     *\n     * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\n     *   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\n     *   called\n     *   in the same transaction.\n     * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\n     *   the withdrawal would be accepted, regardless if the user has enough shares, etc.\n     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n     */\n    function previewWithdraw(address[] calldata withdrawAssets, uint256[] calldata withdrawAmounts) external view returns (uint256 shares);\n\n    /**\n     * @dev Burns shares from owner and sends exactly withdrawal assets to receiver.\n     *\n     * - MUST emit the Withdraw event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   withdraw execution, and are accounted for during withdraw.\n     * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\n     *   not having enough shares, etc).\n     *\n     * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n     * Those methods should be performed separately.\n     */\n    function withdraw(address[] calldata withdrawAssets, uint256[] calldata withdrawAmounts, address receiver, address owner) external returns (uint256 shares);\n\n    /**\n     * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\n     * through a redeem call.\n     *\n     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n     * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\n     * - MUST NOT revert.\n     */\n    function maxRedeem(address owner) external view returns (uint256 maxShares);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their redemption at the current block,\n     * given current on-chain conditions.\n     *\n     * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\n     *   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\n     *   same transaction.\n     * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\n     *   redemption would be accepted, regardless if the user has enough shares, etc.\n     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\n     */\n    function previewRedeem(uint256 shares) external view returns (address[] memory depositAssets, uint256[] memory assetAmounts);\n\n    /**\n     * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\n     *\n     * - MUST emit the Withdraw event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   redeem execution, and are accounted for during redeem.\n     * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\n     *   not having enough shares, etc).\n     *\n     * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n     * Those methods should be performed separately.\n     */\n    function redeem(uint256 shares, address receiver, address owner) external returns (address[] memory depositAssets, uint256[] memory assetAmounts);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Return the 512-bit addition of two uint256.\n     *\n     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n     */\n    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        assembly (\"memory-safe\") {\n            low := add(a, b)\n            high := lt(low, a)\n        }\n    }\n\n    /**\n     * @dev Return the 512-bit multiplication of two uint256.\n     *\n     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n     */\n    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n        // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n        // variables such that product = high * 2²⁵⁶ + low.\n        assembly (\"memory-safe\") {\n            let mm := mulmod(a, b, not(0))\n            low := mul(a, b)\n            high := sub(sub(mm, low), lt(mm, low))\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a + b;\n            success = c >= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a - b;\n            success = c <= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a * b;\n            assembly (\"memory-safe\") {\n                // Only true when the multiplication doesn't overflow\n                // (c / a == b) || (a == 0)\n                success := or(eq(div(c, a), b), iszero(a))\n            }\n            // equivalent to: success ? c : 0\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `DIV` opcode returns zero when the denominator is 0.\n                result := div(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `MOD` opcode returns zero when the denominator is 0.\n                result := mod(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryAdd(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n     */\n    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n        (, uint256 result) = trySub(a, b);\n        return result;\n    }\n\n    /**\n     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryMul(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n\n        // The following calculation ensures accurate ceiling division without overflow.\n        // Since a is non-zero, (a - 1) / b will not overflow.\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\n        // when a = type(uint256).max and b = 1.\n        unchecked {\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n        }\n    }\n\n    /**\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     *\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (high == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return low / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= high) {\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [high low].\n            uint256 remainder;\n            assembly (\"memory-safe\") {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                high := sub(high, gt(remainder, low))\n                low := sub(low, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly (\"memory-safe\") {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [high low] by twos.\n                low := div(low, twos)\n\n                // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from high into low.\n            low |= high * twos;\n\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n            // is no longer required.\n            result = low * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n    }\n\n    /**\n     * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n            if (high >= 1 << n) {\n                Panic.panic(Panic.UNDER_OVERFLOW);\n            }\n            return (high << (256 - n)) | (low >> n);\n        }\n    }\n\n    /**\n     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n    }\n\n    /**\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n     *\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n     *\n     * If the input value is not inversible, 0 is returned.\n     *\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n     */\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n        unchecked {\n            if (n == 0) return 0;\n\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n            // ax + ny = 1\n            // ax = 1 + (-y)n\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n            // If the remainder is 0 the gcd is n right away.\n            uint256 remainder = a % n;\n            uint256 gcd = n;\n\n            // Therefore the initial coefficients are:\n            // ax + ny = gcd(a, n) = n\n            // 0a + 1n = n\n            int256 x = 0;\n            int256 y = 1;\n\n            while (remainder != 0) {\n                uint256 quotient = gcd / remainder;\n\n                (gcd, remainder) = (\n                    // The old remainder is the next gcd to try.\n                    remainder,\n                    // Compute the next remainder.\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n                    // where gcd is at most n (capped to type(uint256).max)\n                    gcd - remainder * quotient\n                );\n\n                (x, y) = (\n                    // Increment the coefficient of a.\n                    y,\n                    // Decrement the coefficient of n.\n                    // Can overflow, but the result is casted to uint256 so that the\n                    // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n                    x - y * int256(quotient)\n                );\n            }\n\n            if (gcd != 1) return 0; // No inverse exists.\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n        }\n    }\n\n    /**\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n     *\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n     *\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n     */\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n        unchecked {\n            return Math.modExp(a, p - 2, p);\n        }\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n     *\n     * Requirements:\n     * - modulus can't be zero\n     * - underlying staticcall to precompile must succeed\n     *\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n     * interpreted as 0.\n     */\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n        (bool success, uint256 result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n     * to operate modulo 0 or if the underlying precompile reverted.\n     *\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n     * of a revert, but the result may be incorrectly interpreted as 0.\n     */\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n        if (m == 0) return (false, 0);\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            // | Offset    | Content    | Content (Hex)                                                      |\n            // |-----------|------------|--------------------------------------------------------------------|\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n            mstore(ptr, 0x20)\n            mstore(add(ptr, 0x20), 0x20)\n            mstore(add(ptr, 0x40), 0x20)\n            mstore(add(ptr, 0x60), b)\n            mstore(add(ptr, 0x80), e)\n            mstore(add(ptr, 0xa0), m)\n\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\n            // so we can use the memory scratch space located at offset 0.\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n            result := mload(0x00)\n        }\n    }\n\n    /**\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\n     */\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n        (bool success, bytes memory result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n     */\n    function tryModExp(\n        bytes memory b,\n        bytes memory e,\n        bytes memory m\n    ) internal view returns (bool success, bytes memory result) {\n        if (_zeroBytes(m)) return (false, new bytes(0));\n\n        uint256 mLen = m.length;\n\n        // Encode call args in result and move the free memory pointer\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n        assembly (\"memory-safe\") {\n            let dataPtr := add(result, 0x20)\n            // Write result on top of args to avoid allocating extra memory.\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n            // Overwrite the length.\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n            mstore(result, mLen)\n            // Set the memory pointer after the returned data.\n            mstore(0x40, add(dataPtr, mLen))\n        }\n    }\n\n    /**\n     * @dev Returns whether the provided byte array is zero.\n     */\n    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n        for (uint256 i = 0; i < byteArray.length; ++i) {\n            if (byteArray[i] != 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n     * using integer operations.\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        unchecked {\n            // Take care of easy edge cases when a == 0 or a == 1\n            if (a <= 1) {\n                return a;\n            }\n\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\n            //\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n            // bigger than any uint256.\n            //\n            // By noticing that\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n            // to the msb function.\n            uint256 aa = a;\n            uint256 xn = 1;\n\n            if (aa >= (1 << 128)) {\n                aa >>= 128;\n                xn <<= 64;\n            }\n            if (aa >= (1 << 64)) {\n                aa >>= 64;\n                xn <<= 32;\n            }\n            if (aa >= (1 << 32)) {\n                aa >>= 32;\n                xn <<= 16;\n            }\n            if (aa >= (1 << 16)) {\n                aa >>= 16;\n                xn <<= 8;\n            }\n            if (aa >= (1 << 8)) {\n                aa >>= 8;\n                xn <<= 4;\n            }\n            if (aa >= (1 << 4)) {\n                aa >>= 4;\n                xn <<= 2;\n            }\n            if (aa >= (1 << 2)) {\n                xn <<= 1;\n            }\n\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n            //\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n            // This is going to be our x_0 (and ε_0)\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n            // From here, Newton's method give us:\n            // x_{n+1} = (x_n + a / x_n) / 2\n            //\n            // One should note that:\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n            //              = ((x_n² + a) / (2 * x_n))² - a\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n            //              = (x_n² - a)² / (2 * x_n)²\n            //              = ((x_n² - a) / (2 * x_n))²\n            //              ≥ 0\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n            //\n            // This gives us the proof of quadratic convergence of the sequence:\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\n            //         = | ε_n² / (2 * x_n) |\n            //         = ε_n² / | (2 * x_n) |\n            //\n            // For the first iteration, we have a special case where x_0 is known:\n            // ε_1 = ε_0² / | (2 * x_0) |\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\n            //     ≤ 2**(e-3) / 3\n            //     ≤ 2**(e-3-log2(3))\n            //     ≤ 2**(e-4.5)\n            //\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\n            //         ≤ 2**(2*e-2*k) / 2**e\n            //         ≤ 2**(e-2*k)\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\n\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n            // sqrt(a) or sqrt(a) + 1.\n            return xn - SafeCast.toUint(xn > a / xn);\n        }\n    }\n\n    /**\n     * @dev Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // If upper 8 bits of 16-bit half set, add 8 to result\n        r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n        // If upper 4 bits of 8-bit half set, add 4 to result\n        r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n        // Shifts value right by the current result and use it as an index into this lookup table:\n        //\n        // | x (4 bits) |  index  | table[index] = MSB position |\n        // |------------|---------|-----------------------------|\n        // |    0000    |    0    |        table[0] = 0         |\n        // |    0001    |    1    |        table[1] = 0         |\n        // |    0010    |    2    |        table[2] = 1         |\n        // |    0011    |    3    |        table[3] = 1         |\n        // |    0100    |    4    |        table[4] = 2         |\n        // |    0101    |    5    |        table[5] = 2         |\n        // |    0110    |    6    |        table[6] = 2         |\n        // |    0111    |    7    |        table[7] = 2         |\n        // |    1000    |    8    |        table[8] = 3         |\n        // |    1001    |    9    |        table[9] = 3         |\n        // |    1010    |   10    |        table[10] = 3        |\n        // |    1011    |   11    |        table[11] = 3        |\n        // |    1100    |   12    |        table[12] = 3        |\n        // |    1101    |   13    |        table[13] = 3        |\n        // |    1110    |   14    |        table[14] = 3        |\n        // |    1111    |   15    |        table[15] = 3        |\n        //\n        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n        assembly (\"memory-safe\") {\n            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Errors.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\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 ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\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    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n */\ninterface IERC1967 {\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC1363} from \"../../../interfaces/IERC1363.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 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    /**\n     * @dev An operation with an ERC-20 token failed.\n     */\n    error SafeERC20FailedOperation(address token);\n\n    /**\n     * @dev Indicates a failed `decreaseAllowance` request.\n     */\n    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n     */\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n    }\n\n    /**\n     * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.\n     */\n    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {\n        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));\n    }\n\n    /**\n     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.\n     */\n    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {\n        return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n    }\n\n    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     *\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        forceApprove(token, spender, oldAllowance + value);\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n     * value, non-reverting calls are assumed to be successful.\n     *\n     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n     * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n     */\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n        unchecked {\n            uint256 currentAllowance = token.allowance(address(this), spender);\n            if (currentAllowance < requestedDecrease) {\n                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n            }\n            forceApprove(token, spender, currentAllowance - requestedDecrease);\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n     * to be set to zero before setting it to a non-zero value, such as USDT.\n     *\n     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\n     * only sets the \"standard\" allowance. Any temporary allowance will remain active, in addition to the value being\n     * set here.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            safeTransfer(token, to, value);\n        } else if (!token.transferAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function transferFromAndCallRelaxed(\n        IERC1363 token,\n        address from,\n        address to,\n        uint256 value,\n        bytes memory data\n    ) internal {\n        if (to.code.length == 0) {\n            safeTransferFrom(token, from, to, value);\n        } else if (!token.transferFromAndCall(from, to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\n        }\n    }\n\n    /**\n     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n     * targeting contracts.\n     *\n     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n     * once without retrying, and relies on the returned value to be true.\n     *\n     * Reverts if the returned value is other than `true`.\n     */\n    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n        if (to.code.length == 0) {\n            forceApprove(token, to, value);\n        } else if (!token.approveAndCall(to, value, data)) {\n            revert SafeERC20FailedOperation(address(token));\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     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            // bubble errors\n            if iszero(success) {\n                let ptr := mload(0x40)\n                returndatacopy(ptr, 0, returndatasize())\n                revert(ptr, returndatasize())\n            }\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n\n        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\n            revert SafeERC20FailedOperation(address(token));\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     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n        bool success;\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n            returnSize := returndatasize()\n            returnValue := mload(0)\n        }\n        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/IAccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC-165 detection.\n */\ninterface IAccessControl {\n    /**\n     * @dev The `account` is missing a role.\n     */\n    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n    /**\n     * @dev The caller of a function is not the expected one.\n     *\n     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n     */\n    error AccessControlBadConfirmation();\n\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 to signal this.\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. This account bears the admin role (for the granted role).\n     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.\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 `callerConfirmation`.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Panic.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n"},{"file_path":"contracts/interfaces/ITheoWhitelist.sol","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.28;\n\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface ITheoWhitelist is IAccessControl, IERC165 {\n    /// @notice Account whitelisted\n    event GrantWhitelist(address account);\n\n    /// @notice Account whitelist revoked\n    event RevokeWhitelist(address account);\n\n    /// @notice Account blacklisted\n    event GrantBlacklist(address account);\n\n    /// @notice Account blacklist revoked\n    event RevokeBlacklist(address account);\n\n    /**\n     * @dev Attempted to transfer tokens to an account that is not whitelisted.\n     */\n    error TheoWhitelistNotWhitelisted(address account);\n\n    /**\n     * @dev Attempted to transfer tokens to an account that is blacklisted.\n     */\n    error TheoWhitelistBlacklisted(address account);\n\n    /**\n     * @dev Attempted to renounce a role\n     */\n    error TheoWhitelistRenounceRoleNotAllowed();\n\n    /// @notice returns if an account is whitelisted\n    function isWhitelisted(address account) external view returns (bool);\n\n    /// @notice reverts if not whitelisted\n    function onlyWhitelisted(address account) external view;\n\n    /// @notice returns if an account is blacklisted\n    function isBlacklisted(address account) external view returns (bool);\n\n    /// @notice reverts if blacklisted\n    function onlyNotBlacklisted(address account) external view;\n\n    /// @notice sets address that can manage the whitelist/blacklist\n    function setWhitelistManager(address whitelistManager, bool status) external;\n\n    /// @notice callable by whitelist manager to whitelist a user\n    function grantWhitelist(address account) external;\n\n    /// @notice callable by whitelist manager to revoke a user's whitelist status\n    function revokeWhitelist(address account) external;\n\n    /// @notice callable by whitelist manager to blacklist a user\n    function grantBlacklist(address account) external;\n\n    /// @notice callable by whitelist manager to revoke a user's blacklist status\n    function revokeBlacklist(address account) external;\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {ERC165Upgradeable} from \"../utils/introspection/ERC165Upgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.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 * ```solidity\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 * ```solidity\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. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {\n    struct RoleData {\n        mapping(address account => bool) hasRole;\n        bytes32 adminRole;\n    }\n\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl\n    struct AccessControlStorage {\n        mapping(bytes32 role => RoleData) _roles;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.AccessControl\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;\n\n    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {\n        assembly {\n            $.slot := AccessControlStorageLocation\n        }\n    }\n\n    /**\n     * @dev Modifier that checks that an account has a specific role. Reverts\n     * with an {AccessControlUnauthorizedAccount} error including the required role.\n     */\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role);\n        _;\n    }\n\n    function __AccessControl_init() internal onlyInitializing {\n    }\n\n    function __AccessControl_init_unchained() internal onlyInitializing {\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 virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        return $._roles[role].hasRole[account];\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n     */\n    function _checkRole(bytes32 role) internal view virtual {\n        _checkRole(role, _msgSender());\n    }\n\n    /**\n     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n     * is missing `role`.\n     */\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!hasRole(role, account)) {\n            revert AccessControlUnauthorizedAccount(account, role);\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 virtual returns (bytes32) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\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     * May emit a {RoleGranted} event.\n     */\n    function grantRole(bytes32 role, address account) public virtual 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     * May emit a {RoleRevoked} event.\n     */\n    function revokeRole(bytes32 role, address account) public virtual 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 `callerConfirmation`.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n        if (callerConfirmation != _msgSender()) {\n            revert AccessControlBadConfirmation();\n        }\n\n        _revokeRole(role, callerConfirmation);\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        AccessControlStorage storage $ = _getAccessControlStorage();\n        bytes32 previousAdminRole = getRoleAdmin(role);\n        $._roles[role].adminRole = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /**\n     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleGranted} event.\n     */\n    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        if (!hasRole(role, account)) {\n            $._roles[role].hasRole[account] = true;\n            emit RoleGranted(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * @dev Attempts to revoke `role` from `account` and returns a boolean indicating if `role` was revoked.\n     *\n     * Internal function without access restriction.\n     *\n     * May emit a {RoleRevoked} event.\n     */\n    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n        AccessControlStorage storage $ = _getAccessControlStorage();\n        if (hasRole(role, account)) {\n            $._roles[role].hasRole[account] = false;\n            emit RoleRevoked(role, account, _msgSender());\n            return true;\n        } else {\n            return false;\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165Checker.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165Checker.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Library used to query support of an interface declared via {IERC165}.\n *\n * Note that these functions return the actual result of the query: they do not\n * `revert` if an interface is not supported. It is up to the caller to decide\n * what to do in these cases.\n */\nlibrary ERC165Checker {\n    // As per the ERC-165 spec, no interface should ever match 0xffffffff\n    bytes4 private constant INTERFACE_ID_INVALID = 0xffffffff;\n\n    /**\n     * @dev Returns true if `account` supports the {IERC165} interface.\n     */\n    function supportsERC165(address account) internal view returns (bool) {\n        // Any contract that implements ERC-165 must explicitly indicate support of\n        // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid\n        return\n            supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) &&\n            !supportsERC165InterfaceUnchecked(account, INTERFACE_ID_INVALID);\n    }\n\n    /**\n     * @dev Returns true if `account` supports the interface defined by\n     * `interfaceId`. Support for {IERC165} itself is queried automatically.\n     *\n     * See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {\n        // query support of both ERC-165 as per the spec and support of _interfaceId\n        return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);\n    }\n\n    /**\n     * @dev Returns a boolean array where each value corresponds to the\n     * interfaces passed in and whether they're supported or not. This allows\n     * you to batch check interfaces for a contract where your expectation\n     * is that some interfaces may not be supported.\n     *\n     * See {IERC165-supportsInterface}.\n     */\n    function getSupportedInterfaces(\n        address account,\n        bytes4[] memory interfaceIds\n    ) internal view returns (bool[] memory) {\n        // an array of booleans corresponding to interfaceIds and whether they're supported or not\n        bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);\n\n        // query support of ERC-165 itself\n        if (supportsERC165(account)) {\n            // query support of each interface in interfaceIds\n            for (uint256 i = 0; i < interfaceIds.length; i++) {\n                interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);\n            }\n        }\n\n        return interfaceIdsSupported;\n    }\n\n    /**\n     * @dev Returns true if `account` supports all the interfaces defined in\n     * `interfaceIds`. Support for {IERC165} itself is queried automatically.\n     *\n     * Batch-querying can lead to gas savings by skipping repeated checks for\n     * {IERC165} support.\n     *\n     * See {IERC165-supportsInterface}.\n     */\n    function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {\n        // query support of ERC-165 itself\n        if (!supportsERC165(account)) {\n            return false;\n        }\n\n        // query support of each interface in interfaceIds\n        for (uint256 i = 0; i < interfaceIds.length; i++) {\n            if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {\n                return false;\n            }\n        }\n\n        // all interfaces supported\n        return true;\n    }\n\n    /**\n     * @notice Query if a contract implements an interface, does not check ERC-165 support\n     * @param account The address of the contract to query for support of an interface\n     * @param interfaceId The interface identifier, as specified in ERC-165\n     * @return true if the contract at account indicates support of the interface with\n     * identifier interfaceId, false otherwise\n     * @dev Assumes that account contains a contract that supports ERC-165, otherwise\n     * the behavior of this method is undefined. This precondition can be checked\n     * with {supportsERC165}.\n     *\n     * Some precompiled contracts will falsely indicate support for a given interface, so caution\n     * should be exercised when using this function.\n     *\n     * Interface identification is specified in ERC-165.\n     */\n    function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {\n        // prepare call\n        bytes memory encodedParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));\n\n        // perform static call\n        bool success;\n        uint256 returnSize;\n        uint256 returnValue;\n        assembly (\"memory-safe\") {\n            success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)\n            returnSize := returndatasize()\n            returnValue := mload(0x00)\n        }\n\n        return success && returnSize >= 0x20 && returnValue > 0;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\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[ERC 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"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 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 */\nabstract contract ERC165Upgradeable is Initializable, IERC165 {\n    function __ERC165_init() internal onlyInitializing {\n    }\n\n    function __ERC165_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n        return interfaceId == type(IERC165).interfaceId;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable\n    struct PausableStorage {\n        bool _paused;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Pausable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n    function _getPausableStorage() private pure returns (PausableStorage storage $) {\n        assembly {\n            $.slot := PausableStorageLocation\n        }\n    }\n\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    /**\n     * @dev The operation failed because the contract is paused.\n     */\n    error EnforcedPause();\n\n    /**\n     * @dev The operation failed because the contract is not paused.\n     */\n    error ExpectedPause();\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    function __Pausable_init() internal onlyInitializing {\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        PausableStorage storage $ = _getPausableStorage();\n        return $._paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        if (paused()) {\n            revert EnforcedPause();\n        }\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        if (!paused()) {\n            revert ExpectedPause();\n        }\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC4626.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/IERC4626.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"../token/ERC20/extensions/IERC20Metadata.sol\";\n\n/**\n * @dev Interface of the ERC-4626 \"Tokenized Vault Standard\", as defined in\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\n */\ninterface IERC4626 is IERC20, IERC20Metadata {\n    event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\n\n    event Withdraw(\n        address indexed sender,\n        address indexed receiver,\n        address indexed owner,\n        uint256 assets,\n        uint256 shares\n    );\n\n    /**\n     * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\n     *\n     * - MUST be an ERC-20 token contract.\n     * - MUST NOT revert.\n     */\n    function asset() external view returns (address assetTokenAddress);\n\n    /**\n     * @dev Returns the total amount of the underlying asset that is “managed” by Vault.\n     *\n     * - SHOULD include any compounding that occurs from yield.\n     * - MUST be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT revert.\n     */\n    function totalAssets() external view returns (uint256 totalManagedAssets);\n\n    /**\n     * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\n     * scenario where all the conditions are met.\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToShares(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\n     * scenario where all the conditions are met.\n     *\n     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\n     * - MUST NOT show any variations depending on the caller.\n     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\n     * - MUST NOT revert.\n     *\n     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the\n     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and\n     * from.\n     */\n    function convertToAssets(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\n     * through a deposit call.\n     *\n     * - MUST return a limited value if receiver is subject to some deposit limit.\n     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\n     * - MUST NOT revert.\n     */\n    function maxDeposit(address receiver) external view returns (uint256 maxAssets);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\n     * current on-chain conditions.\n     *\n     * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\n     *   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\n     *   in the same transaction.\n     * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\n     *   deposit would be accepted, regardless if the user has enough tokens approved, etc.\n     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n     */\n    function previewDeposit(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\n     *\n     * - MUST emit the Deposit event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   deposit execution, and are accounted for during deposit.\n     * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\n     *   approving enough underlying tokens to the Vault contract, etc).\n     *\n     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n     */\n    function deposit(uint256 assets, address receiver) external returns (uint256 shares);\n\n    /**\n     * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\n     * - MUST return a limited value if receiver is subject to some mint limit.\n     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\n     * - MUST NOT revert.\n     */\n    function maxMint(address receiver) external view returns (uint256 maxShares);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\n     * current on-chain conditions.\n     *\n     * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\n     *   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\n     *   same transaction.\n     * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\n     *   would be accepted, regardless if the user has enough tokens approved, etc.\n     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by minting.\n     */\n    function previewMint(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\n     *\n     * - MUST emit the Deposit event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\n     *   execution, and are accounted for during mint.\n     * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\n     *   approving enough underlying tokens to the Vault contract, etc).\n     *\n     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.\n     */\n    function mint(uint256 shares, address receiver) external returns (uint256 assets);\n\n    /**\n     * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\n     * Vault, through a withdraw call.\n     *\n     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n     * - MUST NOT revert.\n     */\n    function maxWithdraw(address owner) external view returns (uint256 maxAssets);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\n     * given current on-chain conditions.\n     *\n     * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\n     *   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\n     *   called\n     *   in the same transaction.\n     * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\n     *   the withdrawal would be accepted, regardless if the user has enough shares, etc.\n     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by depositing.\n     */\n    function previewWithdraw(uint256 assets) external view returns (uint256 shares);\n\n    /**\n     * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\n     *\n     * - MUST emit the Withdraw event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   withdraw execution, and are accounted for during withdraw.\n     * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\n     *   not having enough shares, etc).\n     *\n     * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n     * Those methods should be performed separately.\n     */\n    function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\n\n    /**\n     * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\n     * through a redeem call.\n     *\n     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\n     * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\n     * - MUST NOT revert.\n     */\n    function maxRedeem(address owner) external view returns (uint256 maxShares);\n\n    /**\n     * @dev Allows an on-chain or off-chain user to simulate the effects of their redemption at the current block,\n     * given current on-chain conditions.\n     *\n     * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\n     *   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\n     *   same transaction.\n     * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\n     *   redemption would be accepted, regardless if the user has enough shares, etc.\n     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\n     * - MUST NOT revert.\n     *\n     * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\n     * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\n     */\n    function previewRedeem(uint256 shares) external view returns (uint256 assets);\n\n    /**\n     * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\n     *\n     * - MUST emit the Withdraw event.\n     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\n     *   redeem execution, and are accounted for during redeem.\n     * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\n     *   not having enough shares, etc).\n     *\n     * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\n     * Those methods should be performed separately.\n     */\n    function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct Int256Slot {\n        int256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n     */\n    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n}\n"},{"file_path":"contracts/interfaces/ITToken.sol","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.28;\n\nimport {IERC4626} from \"@openzeppelin/contracts/interfaces/IERC4626.sol\";\nimport {IERC4626Whitelisted} from \"./IERC4626Whitelisted.sol\";\nimport {ITheoWhitelist} from \"./ITheoWhitelist.sol\";\nimport {IERC165} from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\ninterface ITToken is IERC165, IERC4626Whitelisted {\n    /// @notice Escrow begin\n    event EscrowBegin(address indexed owner, uint256 shares, uint256 underlyingAmount, address escrowAsset, uint256 escrowAmount, uint256 escrowEnd);\n    /// @notice Escrow end\n    event EscrowEnd(address indexed owner, uint256 shares, uint256 underlyingAmount, address escrowAsset, uint256 escrowAmount);\n    /// @notice Optimistic deposit\n    event DepositOptimistic(address indexed caller, address indexed receiver, uint256 assets, uint256 shares);\n    /// @notice Complete Pending\n    event CompletePending(address indexed caller, uint256 amount);\n    /// @notice Emergency seizure\n    event Seize(address indexed from, address indexed to, uint256 shares, string reason);\n\n    /// @notice Zero address error\n    error ErrorZeroAddress();\n    /// @notice Operation only allowed if escrow is off\n    error EscrowNotDisabled();\n    /// @notice Operation only allowed if escrow is on\n    error EscrowNotEnabled();\n    /// @notice Escrow not complete\n    error EscrowIncomplete();\n    /// @notice Cannot change escrow asset\n    error InvalidEscrowAsset();\n    /// @notice Cannot change underlying asset\n    error InvalidUnderlyingAsset();\n    /// @notice Max escrow duration exceeded\n    error MaxEscrowDurationExceeded(uint256 duration, uint256 max);\n    /// @notice Too much asset withdrawn\n    error MinSharesError();\n    /// @notice Optimistic deposits turned off\n    error OptimisticDepositNotAllowed();\n    /// @notice Zero value passed in\n    error ZeroAssetsOrShares();\n    /// @notice Attempted to seize from non blacklisted address\n    error SeizeNotAllowed(address from);\n\n    /**\n     * @notice Parameters for the TToken\n     * @param asset Underlying asset that the TToken represents\n     * @param minShares Minimum shares to prevent donation attack\n     * @param escrowDuration Duration for which assets are escrowed before they can be withdrawn\n     * @param escrowAsset Asset to receive after escrow period, usually the same as the underlying asset\n     * @param underlyingAssetReceiver Address that receives the underlying asset after escrow if escrow asset is different\n     * @param allowPending Whether to allow pending deposits (optimistic)\n     */\n    struct TTokenParams {\n        address asset;\n        uint256 minShares;\n        uint256 escrowDuration;\n        address escrowAsset;\n        address underlyingAssetReceiver;\n        bool allowPending;\n    }\n\n    /**\n     * @notice Escrow struct for withdrawals\n     * @param escrowEnd Timestamp when the escrow period ends\n     * @param underlyingAmount Amount of underlying asset that is escrowed\n     * @param escrowAsset Asset that is escrowed, usually the same as the underlying asset\n     * @param escrowAmount Amount of escrowed asset, usually the same as the underlying amount\n     */\n    struct UserEscrow {\n        uint256 escrowEnd;\n        uint256 shares;\n        uint256 underlyingAmount;\n        address escrowAsset;\n        uint256 escrowAmount;\n    }\n\n    /// @notice Stats fo make escrow easier to track\n    struct EscrowStats {\n        uint256 totalShares;\n        uint256 totalUnderlying;\n        uint256 totalEscrowAsset;\n    }\n\n    /// @notice initializer\n    function initialize(string memory name, string memory symbol, TTokenParams memory tTokenParams, ITheoWhitelist _whitelistContract) external;\n\n    /// @notice deposit optomistic, can only be called if allowPending is true and caller is Minter\n    function depositOptimistic(uint256 assets, address receiver) external returns (uint256 shares);\n\n    /// @notice mint optimistic, can only be called if allowPending is true and caller is Minter\n    function mintOptimistic(uint256 shares, address receiver) external returns (uint256 assets);\n\n    /// @notice Completes the pending deposits, can only be called if caller is Minter\n    function completePending(uint256 amount) external;\n\n    /// @notice Returns the current status of the TToken params\n    function getTTokenParams() external view returns (TTokenParams memory);\n\n    /// @notice ERC4626 override for total assets, including pending assets\n    function totalAssets() external view override(IERC4626) returns (uint256);\n\n    /// @notice Returns total pending assets this contrect expects to be completed by the Minter\n    function totalAssetsPending() external view returns (uint256);\n\n    /// @notice IERC4626 override, does not include pending assets\n    function maxWithdraw(address owner) external view override(IERC4626) returns (uint256 assets);\n\n    /// @notice IERC4626 override, does not include pending assets\n    function maxRedeem(address owner) external view override(IERC4626) returns (uint256 shares);\n\n    /// @notice Returns the underlying amount, escrow asset and escrow amount for the given shares\n    function previewBeginEscrow(uint256 shares) external view returns (uint256 underlyingAmount, address escrowAsset, uint256 escrowAssetAmount);\n\n    /// @notice converts shares to escrow asset\n    function sharesToEscrowAssets(uint256 shares) external view returns (uint256 escrowAssetAmount);\n\n    /// @notice returns user escrow details\n    function getUserEscrow(address account) external view returns (UserEscrow memory);\n\n    /// @notice returns the total escrow stats for the TToken\n    function getEscrowStats() external view returns (EscrowStats memory);\n\n    /// @notice begins the escrow process for the given shares and owner, transfers shares to the contract and sends assets to the escrow contract\n    function beginEscrow(uint256 shares, address owner) external returns (address escrowAsset, uint256 escrowAssetAmount);\n\n    /// @notice ends the escrow process for the given owner, transfers escrow assets from the escrow contract to the user\n    function endEscrow(address owner) external;\n\n    /// @notice setter for TTokenParams\n    function setTTokenParams(TTokenParams calldata tTokenParams) external;\n\n    /// @notice sets Minter address and status, can only be called by the DEFAULT_ADMIN_ROLE\n    function setMinter(address minter, bool status) external;\n\n    /// @notice seizes shares from one address to another, can only be called by the DEFAULT_ADMIN_ROLE\n    /// @dev The 'to' address must be whitelisted, and the 'from' address must be blacklisted\n    function seize(address from, address to, uint256 shares, string memory reason) external;\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20Metadata} from \"../token/ERC20/extensions/IERC20Metadata.sol\";\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert Errors.InsufficientBalance(address(this).balance, amount);\n        }\n\n        (bool success, bytes memory returndata) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            _revert(returndata);\n        }\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 or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {Errors.FailedCall} error.\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    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\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    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert Errors.InsufficientBalance(address(this).balance, value);\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n     * of an unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {Errors.FailedCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n     */\n    function _revert(bytes memory returndata) private pure {\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            assembly (\"memory-safe\") {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n"},{"file_path":"contracts/vaults/ERC4626UpgradeableMultiAsset.sol","source_code":"// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.28;\n\nimport {ERC20Upgradeable} from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\nimport {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {IERC4626MultiAsset} from \"../interfaces/IERC4626MultiAsset.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\nabstract contract ERC4626UpgradeableMultiAsset is Initializable, ERC20Upgradeable, IERC4626MultiAsset {\n    using Math for uint256;\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.ERC4626\n    struct ERC4626MultiAssetStorage {\n        IERC20 _underlyingAsset;\n        uint8 _underlyingDecimals;\n        address[] _depositAssets;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.ERC4626\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant ERC4626StorageLocation = 0x0773e532dfede91f04b12a73d3d2acd361424f41f76b4fb79f090161e36b4e00;\n\n    function _getERC4626MultiAssetStorage() private pure returns (ERC4626MultiAssetStorage storage $) {\n        assembly {\n            $.slot := ERC4626StorageLocation\n        }\n    }\n\n    /**\n     * @dev Attempted to pass in asset and amount arrays of different sizes.\n     */\n    error ERC4626MultiAssetArrayMismatch();\n\n    /**\n     * @dev Attemped to pass in a deposit address that is not supported by this vault.\n     */\n    error ERC4626MultiAssetUnsupportedDepositAsset(address depositAsset);\n\n    /**\n     * @dev Attempted to deposit more assets than the max amount for `receiver`.\n     */\n    error ERC4626MultiAssetExceededMaxDeposit(address receiver, uint256 assets, uint256 max);\n\n    /**\n     * @dev Attempted to mint more shares than the max amount for `receiver`.\n     */\n    error ERC4626MultiAssetExceededMaxMint(address receiver, uint256 shares, uint256 max);\n\n    /**\n     * @dev Attempted to withdraw more assets than the max amount for `receiver`.\n     */\n    error ERC4626MultiAssetExceededMaxWithdraw(address owner, address asset, uint256 assets, uint256 max);\n\n    /**\n     * @dev Attempted to redeem more shares than the max amount for `receiver`.\n     */\n    error ERC4626MultiAssetExceededMaxRedeem(address owner, uint256 shares, uint256 max);\n\n    /**\n     * @dev Attempted to pass in an array of assets that contains duplicates.\n     */\n    error ERC4626MultiAssetArrayContainsDuplicates();\n\n    /**\n     * @dev Attempted to mint or burn zero shares for assets\n     */\n    error ERC4626MultiAssetZeroSharesForAssets();\n\n    /**\n     * @dev Set the underlying asset contract. This must be an ERC20-compatible contract (ERC-20 or ERC-777).\n     */\n    function __ERC4626MultiAsset_init(IERC20 underlyingAsset_, address[] calldata depositAssets_) internal onlyInitializing {\n        ___ERC4626MultiAsset_init_unchained(underlyingAsset_, depositAssets_);\n    }\n\n    function ___ERC4626MultiAsset_init_unchained(IERC20 underlyingAsset_, address[] calldata depositAssets_) internal onlyInitializing {\n        // check for duplicates in depositAssets\n        _checkArrayDuplicates(depositAssets_);\n        ERC4626MultiAssetStorage storage $ = _getERC4626MultiAssetStorage();\n        (bool success, uint8 assetDecimals) = _tryGetAssetDecimals(underlyingAsset_);\n        $._underlyingDecimals = success ? assetDecimals : 18;\n        $._underlyingAsset = underlyingAsset_;\n        $._depositAssets = depositAssets_;\n        emit UpdateDepositAssets(depositAssets_);\n    }\n\n    /**\n     * @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.\n     */\n    function _tryGetAssetDecimals(IERC20 asset_) private view returns (bool ok, uint8 assetDecimals) {\n        (bool success, bytes memory encodedDecimals) = address(asset_).staticcall(abi.encodeCall(IERC20Metadata.decimals, ()));\n        if (success && encodedDecimals.length >= 32) {\n            uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));\n            if (returnedDecimals <= type(uint8).max) {\n                return (true, uint8(returnedDecimals));\n            }\n        }\n        return (false, 0);\n    }\n\n    /**\n     * @dev Updates the depositAsset list in storage\n     * @dev Only use this call with sufficient safeguards\n     * ex:\n     * - Only owner\n     * - Total value of Net assets stays the same\n     */\n    function _updateDepositAssets(address[] calldata newAssets) internal virtual {\n        // check for duplicates in newAssets\n        _checkArrayDuplicates(newAssets);\n        ERC4626MultiAssetStorage storage $ = _getERC4626MultiAssetStorage();\n        $._depositAssets = newAssets;\n        emit UpdateDepositAssets(newAssets);\n    }\n\n    /**\n     * @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This\n     * \"original\" value is cached during construction of the vault contract. If this read operation fails (e.g., the\n     * asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.\n     *\n     * See {IERC20Metadata-decimals}.\n     */\n    function decimals() public view virtual override(IERC20Metadata, ERC20Upgradeable) returns (uint8) {\n        ERC4626MultiAssetStorage storage $ = _getERC4626MultiAssetStorage();\n        return $._underlyingDecimals + _decimalsOffset();\n    }\n\n    /** @dev See {IERC4626MultiAsset-asset}. */\n    function asset() public view virtual returns (address) {\n        ERC4626MultiAssetStorage storage $ = _getERC4626MultiAssetStorage();\n        return address($._underlyingAsset);\n    }\n\n    /** @dev See {IERC4626MultiAsset-depositAssetsList}. */\n    function depositAssetsList() public view virtual returns (address[] memory) {\n        ERC4626MultiAssetStorage storage $ = _getERC4626MultiAssetStorage();\n        return $._depositAssets;\n    }\n\n    /** @dev See {IERC4626MultiAsset-isSupportedDepositAsset}. */\n    function isSupportedDepositAsset(address depositAsset) public view virtual returns (bool) {\n        ERC4626MultiAssetStorage storage $ = _getERC4626MultiAssetStorage();\n        for (uint256 i = 0; i < $._depositAssets.length; i++) {\n            if ($._depositAssets[i] == depositAsset) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /** @dev See {IERC4626MultiAsset-totalUnderlyingAssets}. */\n    function totalUnderlyingAssets() public view virtual returns (uint256) {\n        ERC4626MultiAssetStorage storage $ = _getERC4626MultiAssetStorage();\n        uint256 totalUnderlying = 0;\n        for (uint256 i = 0; i < $._depositAssets.length; i++) {\n            address assetAddress = $._depositAssets[i];\n            IERC20 assetContract = IERC20(assetAddress);\n            totalUnderlying += _convertDepositAssetToUnderlying(assetAddress, assetContract.balanceOf(address(this)));\n        }\n        return totalUnderlying;\n    }\n\n    /** @dev See {IERC4626MultiAsset-totalDepositAssets}. */\n    function totalDepositAssets() public view virtual returns (address[] memory, uint256[] memory, uint256[] memory, uint256) {\n        ERC4626MultiAssetStorage storage $ = _getERC4626MultiAssetStorage();\n        address[] memory depositAssets = $._depositAssets;\n        uint256[] memory amounts = new uint256[](depositAssets.length);\n        uint256[] memory values = new uint256[](depositAssets.length);\n        uint256 totalUnderlyingValue = 0;\n\n        for (uint256 i = 0; i < depositAssets.length; i++) {\n            address assetAddress = depositAssets[i];\n            IERC20 assetContract = IERC20(assetAddress);\n            uint256 assetBalance = assetContract.balanceOf(address(this));\n            amounts[i] = assetBalance;\n            uint256 underlyingValue = _convertDepositAssetToUnderlying(assetAddress, assetBalance);\n            values[i] = underlyingValue;\n            totalUnderlyingValue += underlyingValue;\n        }\n        return (depositAssets, amounts, values, totalUnderlyingValue);\n    }\n\n    /** @dev See {IERC4626MultiAsset-userTotalUnderlyingAssets}. */\n    function userTotalUnderlyingAssets(address user) public view virtual returns (uint256) {\n        (address[] memory assets, uint256[] memory amounts) = _convertToAssets(balanceOf(user), Math.Rounding.Floor);\n        return _getAssetListValue(assets, amounts);\n    }\n\n    /** @dev See {IERC4626MultiAsset-convertToShares}. */\n    function convertToShares(address[] calldata depositAssets, uint256[] calldata assetAmounts) public view virtual returns (uint256) {\n        return _convertToShares(depositAssets, assetAmounts, Math.Rounding.Floor);\n    }\n\n    /** @dev See {IERC4626MultiAsset-convertToDepositAssets}. */\n    function convertToDepositAssets(uint256 shares) public view virtual returns (address[] memory, uint256[] memory) {\n        return _convertToAssets(shares, Math.Rounding.Floor);\n    }\n\n    /** @dev See {IERC4626MultiAsset-convertToAssets}. */\n    function convertToAssets(uint256 shares) public view virtual returns (uint256) {\n        // convert to deposit assets, then get total value in underlying asset terms\n        (address[] memory assets, uint256[] memory amounts) = _convertToAssets(shares, Math.Rounding.Floor);\n        return _getAssetListValue(assets, amounts);\n    }\n\n    /** @dev See {IERC4626MultiAsset-maxDeposit}. */\n    function maxDeposit(address, address) public view virtual returns (uint256) {\n        return type(uint256).max;\n    }\n\n    /** @dev See {IERC4626MultiAsset-maxMint}. */\n    function maxMint(address) public view virtual returns (uint256) {\n        // If no shares exist, mint cannot be called first\n        // If no underlying value, mint cannot be called either\n        if (totalSupply() == 0 || totalUnderlyingAssets() == 0) {\n            return 0;\n        }\n        return type(uint256).max;\n    }\n\n    /** @dev See {IERC4626MultiAsset-maxWithdraw}. */\n    function maxWithdraw(address owner) public view virtual returns (address[] memory, uint256[] memory) {\n        return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);\n    }\n\n    /** @dev See {IERC4626MultiAsset-maxRedeem}. */\n    function maxRedeem(address owner) public view virtual returns (uint256) {\n        return balanceOf(owner);\n    }\n\n    /** @dev See {IERC4626MultiAsset-previewDeposit}. */\n    function previewDeposit(address[] calldata depositAssets, uint256[] calldata assetAmounts) public view virtual returns (uint256) {\n        return _convertToShares(depositAssets, assetAmounts, Math.Rounding.Floor);\n    }\n\n    /** @dev See {IERC4626MultiAsset-previewMint}. */\n    function previewMint(uint256 shares) public view virtual returns (address[] memory, uint256[] memory) {\n        return _convertToAssets(shares, Math.Rounding.Ceil);\n    }\n\n    /** @dev See {IERC4626MultiAsset-previewWithdraw}. */\n    function previewWithdraw(address[] calldata withdrawAssets, uint256[] calldata assetAmounts) public view virtual returns (uint256) {\n        return _convertToShares(withdrawAssets, assetAmounts, Math.Rounding.Ceil);\n    }\n\n    /** @dev See {IERC4626MultiAsset-previewRedeem}. */\n    function previewRedeem(uint256 shares) public view virtual returns (address[] memory, uint256[] memory) {\n        return _convertToAssets(shares, Math.Rounding.Floor);\n    }\n\n    /** @dev See {IERC4626MultiAsset-deposit} */\n    function deposit(address[] calldata depositAssets, uint256[] calldata assetAmounts, address receiver) public virtual returns (uint256) {\n        if (depositAssets.length != assetAmounts.length) {\n            revert ERC4626MultiAssetArrayMismatch();\n        }\n        for (uint i = 0; i < depositAssets.length; i++) {\n            if (!isSupportedDepositAsset(depositAssets[i])) {\n                revert ERC4626MultiAssetUnsupportedDepositAsset(depositAssets[i]);\n            }\n            uint256 maxAssets = maxDeposit(depositAssets[i], receiver);\n            if (assetAmounts[i] > maxAssets) {\n                revert ERC4626MultiAssetExceededMaxDeposit(receiver, assetAmounts[i], maxAssets);\n            }\n        }\n        // convert assets to shares\n        uint256 shares = previewDeposit(depositAssets, assetAmounts);\n        _deposit(_msgSender(), receiver, depositAssets, assetAmounts, shares);\n\n        return shares;\n    }\n\n    /** @dev See {IERC4626MultiAsset-mint} */\n    function mint(uint256 shares, address receiver) public virtual returns (address[] memory, uint256[] memory) {\n        uint256 maxShares = maxMint(receiver);\n        if (shares > maxShares || maxShares == 0) {\n            revert ERC4626MultiAssetExceededMaxMint(receiver, shares, maxShares);\n        }\n        // convert shares to assets\n        (address[] memory assets, uint256[] memory amounts) = previewMint(shares);\n        _deposit(_msgSender(), receiver, assets, amounts, shares);\n\n        return (assets, amounts);\n    }\n\n    /** @dev See {IERC4626MultiAsset-withdraw} */\n    function withdraw(address[] calldata withdrawAssets, uint256[] calldata assetAmounts, address receiver, address owner) public virtual returns (uint256) {\n        if (withdrawAssets.length != assetAmounts.length) {\n            revert ERC4626MultiAssetArrayMismatch();\n        }\n        _checkArrayDuplicates(withdrawAssets);\n\n        for (uint i = 0; i < withdrawAssets.length; i++) {\n            if (!isSupportedDepositAsset(withdrawAssets[i])) {\n                revert ERC4626MultiAssetUnsupportedDepositAsset(withdrawAssets[i]);\n            }\n            uint256 maxAssets = IERC20(withdrawAssets[i]).balanceOf(address(this));\n            if (assetAmounts[i] > maxAssets) {\n                revert ERC4626MultiAssetExceededMaxWithdraw(owner, withdrawAssets[i], assetAmounts[i], maxAssets);\n            }\n        }\n\n        // convert assets to shares\n        uint256 shares = previewWithdraw(withdrawAssets, assetAmounts);\n\n        // final check that user has shares\n        uint256 maxShares = maxRedeem(owner);\n        if (shares > maxShares || maxShares == 0) {\n            revert ERC4626MultiAssetExceededMaxRedeem(owner, shares, maxShares);\n        }\n\n        _withdraw(_msgSender(), receiver, owner, withdrawAssets, assetAmounts, shares);\n\n        return shares;\n    }\n\n    /** @dev See {IERC4626MultiAsset-redeem} */\n    function redeem(uint256 shares, address receiver, address owner) public virtual returns (address[] memory, uint256[] memory) {\n        uint256 maxShares = maxRedeem(owner);\n        if (shares > maxShares) {\n            revert ERC4626MultiAssetExceededMaxRedeem(owner, shares, maxShares);\n        }\n\n        // convert shares to assets\n        (address[] memory assets, uint256[] memory amounts) = previewRedeem(shares);\n        _withdraw(_msgSender(), receiver, owner, assets, amounts, shares);\n\n        return (assets, amounts);\n    }\n\n    /**\n     * @dev Internal conversion function (from assets to shares) with support for rounding direction.\n     */\n    function _convertToShares(address[] calldata assets, uint256[] calldata assetAmounts, Math.Rounding rounding) internal view virtual returns (uint256) {\n        // get total value of assets in terms of the vault's asset\n        uint256 totalValue = _getAssetListValue(assets, assetAmounts);\n        return totalValue.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalUnderlyingAssets() + 1, rounding);\n    }\n\n    /**\n     * @dev Internal conversion function (from shares to assets) with support for rounding direction.\n     * This function converts shares to their equivalent value and then distributes that value\n     * proportionally across assets based on current vault composition.\n     */\n    function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (address[] memory, uint256[] memory) {\n        (address[] memory assets, uint256[] memory vaultBalances, uint256[] memory assetValues, uint256 totalVaultValue) = totalDepositAssets();\n        if (assets.length == 0 || shares == 0) {\n            return (assets, new uint256[](assets.length));\n        }\n\n        // convert shares to total value in underlying asset terms\n        uint256 totalShareValue = shares.mulDiv(totalUnderlyingAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);\n\n        // distribute total value proportianlly based on current valut composition\n        uint256[] memory amounts = new uint256[](assets.length);\n        for (uint i = 0; i < assets.length; i++) {\n            if (totalVaultValue == 0 || vaultBalances[i] == 0 || assetValues[i] == 0) {\n                amounts[i] = 0;\n            } else {\n                uint256 assetValueFromShares = totalShareValue.mulDiv(assetValues[i], totalVaultValue, rounding);\n                amounts[i] = assetValueFromShares.mulDiv(vaultBalances[i], assetValues[i], rounding);\n            }\n        }\n        return (assets, amounts);\n    }\n\n    /**\n     * @dev Deposit/mint common workflow\n     */\n    function _deposit(address caller, address receiver, address[] memory assets, uint256[] memory amounts, uint256 shares) internal virtual {\n        for (uint256 i = 0; i < assets.length; i++) {\n            SafeERC20.safeTransferFrom(IERC20(assets[i]), caller, address(this), amounts[i]);\n        }\n        if (shares == 0) {\n            revert ERC4626MultiAssetZeroSharesForAssets();\n        }\n        _mint(receiver, shares);\n\n        emit Deposit(caller, receiver, assets, amounts, shares);\n    }\n\n    /**\n     * @dev Redeem workflow\n     */\n    function _withdraw(address caller, address receiver, address owner, address[] memory assets, uint256[] memory amounts, uint256 shares) internal virtual {\n        if (caller != owner) {\n            _spendAllowance(owner, caller, shares);\n        }\n        if (shares == 0) {\n            revert ERC4626MultiAssetZeroSharesForAssets();\n        }\n        _burn(owner, shares);\n        for (uint256 i = 0; i < assets.length; i++) {\n            SafeERC20.safeTransfer(IERC20(assets[i]), receiver, amounts[i]);\n        }\n        emit Withdraw(caller, receiver, owner, assets, amounts, shares);\n    }\n\n    /**\n     * @dev Internal function to calculate the total value of a list of assets in terms of the vault's asset.\n     */\n    function _getAssetListValue(address[] memory assets, uint256[] memory amounts) internal view virtual returns (uint256) {\n        if (assets.length != amounts.length) {\n            return 0;\n        }\n        uint256 totalValue = 0;\n        for (uint256 i = 0; i < assets.length; i++) {\n            address assetAddress = assets[i];\n            uint256 amount = amounts[i];\n            totalValue += _convertDepositAssetToUnderlying(assetAddress, amount);\n        }\n        return totalValue;\n    }\n\n    /**\n     * @notice Internal function to convert an asset to the vault's underlying asset\n     * @dev implementation contract MUST override this function\n     */\n    function _convertDepositAssetToUnderlying(address depositAsset, uint256 amount) internal view virtual returns (uint256);\n\n    /**\n     * @dev Internal function to check for duplicates in an array of addresses.\n     */\n    function _checkArrayDuplicates(address[] calldata addressArray) internal pure {\n        for (uint i = 0; i < addressArray.length - 1; i++) {\n            for (uint j = i + 1; j < addressArray.length; j++) {\n                if (addressArray[i] == addressArray[j]) {\n                    revert ERC4626MultiAssetArrayContainsDuplicates();\n                }\n            }\n        }\n    }\n\n    function _decimalsOffset() internal view virtual returns (uint8) {\n        return 0;\n    }\n}\n"},{"file_path":"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reinitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n     *\n     * NOTE: Consider following the ERC-7201 formula to derive storage locations.\n     */\n    function _initializableStorageSlot() internal pure virtual returns (bytes32) {\n        return INITIALIZABLE_STORAGE;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        bytes32 slot = _initializableStorageSlot();\n        assembly {\n            $.slot := slot\n        }\n    }\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"ERC4626MultiAssetArrayContainsDuplicates","type":"error"},{"inputs":[],"name":"ERC4626MultiAssetArrayMismatch","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626MultiAssetExceededMaxDeposit","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626MultiAssetExceededMaxMint","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626MultiAssetExceededMaxRedeem","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626MultiAssetExceededMaxWithdraw","type":"error"},{"inputs":[{"internalType":"address","name":"depositAsset","type":"address"}],"name":"ERC4626MultiAssetUnsupportedDepositAsset","type":"error"},{"inputs":[],"name":"ERC4626MultiAssetZeroSharesForAssets","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ErrorArrayMismatch","type":"error"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"ErrorAssetCannotBeRescued","type":"error"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"ErrorAssetNotFound","type":"error"},{"inputs":[],"name":"ErrorBadAssetRatio","type":"error"},{"inputs":[],"name":"ErrorDepositAssetsValueWentDown","type":"error"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"ErrorInvalidDepositAsset","type":"error"},{"inputs":[],"name":"ErrorMinShares","type":"error"},{"inputs":[],"name":"ErrorRatiosNot100","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address[]","name":"depositAssets","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"depositAssetAmounts","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"assets","type":"address[]"}],"name":"UpdateDepositAssets","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address[]","name":"withdrawalAssets","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"withdrawAssetAmounts","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EMERGENCY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"bool","name":"enforcedRatio","type":"bool"},{"internalType":"uint32","name":"maxDeviationBps","type":"uint32"},{"internalType":"uint256","name":"minShares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToDepositAssets","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"depositAssets","type":"address[]"},{"internalType":"uint256[]","name":"assetAmounts","type":"uint256[]"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"depositAssets","type":"address[]"},{"internalType":"uint256[]","name":"assetAmounts","type":"uint256[]"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositAssetsList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"getAssetRatio","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getConfig","outputs":[{"components":[{"internalType":"uint32[]","name":"assetRatiosBps","type":"uint32[]"},{"internalType":"bool","name":"enforcedRatio","type":"bool"},{"internalType":"uint32","name":"maxDeviationBps","type":"uint32"},{"internalType":"uint256","name":"minShares","type":"uint256"}],"internalType":"struct IIToken.ITokenParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"contract IERC20","name":"_baseAsset","type":"address"},{"internalType":"address[]","name":"_depositAssets","type":"address[]"},{"components":[{"internalType":"uint32[]","name":"assetRatiosBps","type":"uint32[]"},{"internalType":"bool","name":"enforcedRatio","type":"bool"},{"internalType":"uint32","name":"maxDeviationBps","type":"uint32"},{"internalType":"uint256","name":"minShares","type":"uint256"}],"internalType":"struct IIToken.ITokenParams","name":"_config","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositAsset","type":"address"}],"name":"isSupportedDepositAsset","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"depositAssets","type":"address[]"},{"internalType":"uint256[]","name":"assetAmounts","type":"uint256[]"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"withdrawAssets","type":"address[]"},{"internalType":"uint256[]","name":"assetAmounts","type":"uint256[]"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"rescuedAsset","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"rescueAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32[]","name":"assetRatiosBps","type":"uint32[]"},{"internalType":"bool","name":"enforcedRatio","type":"bool"},{"internalType":"uint32","name":"maxDeviationBps","type":"uint32"},{"internalType":"uint256","name":"minShares","type":"uint256"}],"internalType":"struct IIToken.ITokenParams","name":"params","type":"tuple"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_emergencyRole","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setEmergencyRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDepositAssets","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUnderlyingAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"newAssets","type":"address[]"},{"components":[{"internalType":"uint32[]","name":"assetRatiosBps","type":"uint32[]"},{"internalType":"bool","name":"enforcedRatio","type":"bool"},{"internalType":"uint32","name":"maxDeviationBps","type":"uint32"},{"internalType":"uint256","name":"minShares","type":"uint256"}],"internalType":"struct IIToken.ITokenParams","name":"newConfig","type":"tuple"}],"name":"updateDepositAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userTotalUnderlyingAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"withdrawAssets","type":"address[]"},{"internalType":"uint256[]","name":"withdrawAmounts","type":"uint256[]"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}