diff --git a/README.md b/README.md index 9c417ae..0cf702d 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,7 @@ npm run upgrade-vault ## 📄 License -This project is licensed under the Business Source License 1.1 (BUSL-1.1). See the [LICENSE](LICENSE) file for details. +This project is licensed under the Business Source License 1.1 (BUSL-1.1). See the [LICENSE](https://spdx.org/licenses/BUSL-1.1.html) file for details. --- diff --git a/script/BaseScript.s.sol b/script/BaseScript.s.sol index a8a9376..ba924e1 100644 --- a/script/BaseScript.s.sol +++ b/script/BaseScript.s.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; @@ -98,11 +98,7 @@ abstract contract BaseScript is Script { return _beacon; } - function _getFactoryProxyOwner(string memory _chainId, string memory _environment) - internal - view - returns (address) - { + function _getFactoryProxyOwner(string memory _chainId, string memory _environment) internal view returns (address) { string memory _deploymentConfig = vm.readFile(_getDeploymentConfigFilePath()); string memory _proxyOwnerKey = string.concat(".", _chainId, ".", _environment, ".factoryProxyOwner"); address _proxyOwner = vm.parseJsonAddress(_deploymentConfig, _proxyOwnerKey); diff --git a/script/DeploymentScripts/DeployAccountant.s.sol b/script/DeploymentScripts/DeployAccountant.s.sol index 1ad96b7..b83841e 100644 --- a/script/DeploymentScripts/DeployAccountant.s.sol +++ b/script/DeploymentScripts/DeployAccountant.s.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; @@ -24,6 +24,7 @@ import { import {BaseScript} from "@aleph-script/BaseScript.s.sol"; import {IAccountant} from "@aleph-vault/interfaces/IAccountant.sol"; import {Accountant} from "@aleph-vault/Accountant.sol"; + /** * @author Othentic Labs LTD. * @notice Terms of Service: https://aleph.finance/terms-of-service diff --git a/script/DeploymentScripts/DeployAlephVault.s.sol b/script/DeploymentScripts/DeployAlephVault.s.sol index bfe311d..925b85d 100644 --- a/script/DeploymentScripts/DeployAlephVault.s.sol +++ b/script/DeploymentScripts/DeployAlephVault.s.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; @@ -22,6 +22,7 @@ import {BaseScript} from "@aleph-script/BaseScript.s.sol"; import {IAlephVault} from "@aleph-vault/interfaces/IAlephVault.sol"; import {IAlephVaultFactory} from "@aleph-vault/interfaces/IAlephVaultFactory.sol"; import {AuthLibrary} from "@aleph-vault/libraries/AuthLibrary.sol"; + /** * @author Othentic Labs LTD. * @notice Terms of Service: https://aleph.finance/terms-of-service @@ -82,8 +83,9 @@ contract DeployAlephVault is BaseScript { string memory _vaultName, string memory _vaultConfigId ) internal view returns (AuthLibrary.AuthSignature memory) { - bytes32 _authMessage = - keccak256(abi.encode(_vaultManager, _factory, _vaultName, _vaultConfigId, block.chainid, type(uint256).max)); + bytes32 _authMessage = keccak256( + abi.encode(_vaultManager, _factory, _vaultName, _vaultConfigId, block.chainid, type(uint256).max) + ); bytes32 _ethSignedMessage = _authMessage.toEthSignedMessageHash(); uint256 _authSignerPrivateKey = _getAuthSignerPrivateKey(); (uint8 _v, bytes32 _r, bytes32 _s) = vm.sign(_authSignerPrivateKey, _ethSignedMessage); diff --git a/script/DeploymentScripts/DeployAlephVaultBeacon.s.sol b/script/DeploymentScripts/DeployAlephVaultBeacon.s.sol index ba9ac17..ebdf4c2 100644 --- a/script/DeploymentScripts/DeployAlephVaultBeacon.s.sol +++ b/script/DeploymentScripts/DeployAlephVaultBeacon.s.sol @@ -1,24 +1,25 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; import {UpgradeableBeacon} from "lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol"; import {BaseScript} from "@aleph-script/BaseScript.s.sol"; + /** * @author Othentic Labs LTD. * @notice Terms of Service: https://aleph.finance/terms-of-service diff --git a/script/DeploymentScripts/DeployAlephVaultFactory.s.sol b/script/DeploymentScripts/DeployAlephVaultFactory.s.sol index ac7aa05..05a7231 100644 --- a/script/DeploymentScripts/DeployAlephVaultFactory.s.sol +++ b/script/DeploymentScripts/DeployAlephVaultFactory.s.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; @@ -24,6 +24,7 @@ import { import {BaseScript} from "@aleph-script/BaseScript.s.sol"; import {IAlephVaultFactory} from "@aleph-vault/interfaces/IAlephVaultFactory.sol"; import {AlephVaultFactory} from "@aleph-vault/factory/AlephVaultFactory.sol"; + /** * @author Othentic Labs LTD. * @notice Terms of Service: https://aleph.finance/terms-of-service @@ -87,7 +88,9 @@ contract DeployAlephVaultFactory is BaseScript { ), oracle: vm.parseJsonAddress(_factoryConfig, string.concat(".", _chainId, ".", _environment, ".oracle")), guardian: vm.parseJsonAddress(_factoryConfig, string.concat(".", _chainId, ".", _environment, ".guardian")), - authSigner: vm.parseJsonAddress(_factoryConfig, string.concat(".", _chainId, ".", _environment, ".authSigner")), + authSigner: vm.parseJsonAddress( + _factoryConfig, string.concat(".", _chainId, ".", _environment, ".authSigner") + ), accountant: vm.parseJsonAddress( _deploymentConfig, string.concat(".", _chainId, ".", _environment, ".accountantProxyAddress") ), @@ -98,13 +101,15 @@ contract DeployAlephVaultFactory is BaseScript { _deploymentConfig, string.concat(".", _chainId, ".", _environment, ".vaultRedeemImplementationAddress") ), alephVaultSettlementImplementation: vm.parseJsonAddress( - _deploymentConfig, string.concat(".", _chainId, ".", _environment, ".vaultSettlementImplementationAddress") + _deploymentConfig, + string.concat(".", _chainId, ".", _environment, ".vaultSettlementImplementationAddress") ), feeManagerImplementation: vm.parseJsonAddress( _deploymentConfig, string.concat(".", _chainId, ".", _environment, ".feeManagerImplementationAddress") ), migrationManagerImplementation: vm.parseJsonAddress( - _deploymentConfig, string.concat(".", _chainId, ".", _environment, ".migrationManagerImplementationAddress") + _deploymentConfig, + string.concat(".", _chainId, ".", _environment, ".migrationManagerImplementationAddress") ) }); } diff --git a/script/DeploymentScripts/DeployAlephVaultImplementation.s.sol b/script/DeploymentScripts/DeployAlephVaultImplementation.s.sol index 89a22c5..7e1b974 100644 --- a/script/DeploymentScripts/DeployAlephVaultImplementation.s.sol +++ b/script/DeploymentScripts/DeployAlephVaultImplementation.s.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; @@ -28,6 +28,7 @@ import {AlephVaultSettlement} from "@aleph-vault/modules/AlephVaultSettlement.so import {FeeManager} from "@aleph-vault/modules/FeeManager.sol"; import {MigrationManager} from "@aleph-vault/modules/MigrationManager.sol"; import {AlephVault} from "@aleph-vault/AlephVault.sol"; + /** * @author Othentic Labs LTD. * @notice Terms of Service: https://aleph.finance/terms-of-service diff --git a/script/Migrations/SetVaultFactory.sol b/script/Migrations/SetVaultFactory.sol index 9d88ba6..7292499 100644 --- a/script/Migrations/SetVaultFactory.sol +++ b/script/Migrations/SetVaultFactory.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; diff --git a/script/UpgradeScripts/UpgradeAccountant.s.sol b/script/UpgradeScripts/UpgradeAccountant.s.sol index 903a598..cec3f54 100644 --- a/script/UpgradeScripts/UpgradeAccountant.s.sol +++ b/script/UpgradeScripts/UpgradeAccountant.s.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; @@ -48,9 +48,8 @@ contract UpgradeAccountant is BaseScript { address _proxyAdmin = address(uint160(uint256(vm.load(_proxy, ADMIN_SLOT)))); - ProxyAdmin(_proxyAdmin).upgradeAndCall( - ITransparentUpgradeableProxy(payable(_proxy)), address(_accountantImpl), "" - ); + ProxyAdmin(_proxyAdmin) + .upgradeAndCall(ITransparentUpgradeableProxy(payable(_proxy)), address(_accountantImpl), ""); console.log("Accountant upgraded to", address(_accountantImpl)); _writeDeploymentConfig( diff --git a/script/UpgradeScripts/UpgradeAlephVault.s.sol b/script/UpgradeScripts/UpgradeAlephVault.s.sol index 93cf71a..ccb5af7 100644 --- a/script/UpgradeScripts/UpgradeAlephVault.s.sol +++ b/script/UpgradeScripts/UpgradeAlephVault.s.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; @@ -23,6 +23,7 @@ import {IAlephVault} from "@aleph-vault/interfaces/IAlephVault.sol"; import {IAlephVaultFactory} from "@aleph-vault/interfaces/IAlephVaultFactory.sol"; import {ModulesLibrary} from "@aleph-vault/libraries/ModulesLibrary.sol"; import {AlephVault} from "@aleph-vault/AlephVault.sol"; + /** * @author Othentic Labs LTD. * @notice Terms of Service: https://aleph.finance/terms-of-service @@ -64,18 +65,14 @@ contract UpgradeAlephVault is BaseScript { address _migrationManagerImplementation = _getModuleImplementation(_chainId, _environment, "migrationManagerImplementationAddress"); - IAlephVaultFactory(_vaultFactory).setModuleImplementation( - ModulesLibrary.ALEPH_VAULT_DEPOSIT, _vaultDepositImplementation - ); - IAlephVaultFactory(_vaultFactory).setModuleImplementation( - ModulesLibrary.ALEPH_VAULT_REDEEM, _vaultRedeemImplementation - ); - IAlephVaultFactory(_vaultFactory).setModuleImplementation( - ModulesLibrary.ALEPH_VAULT_SETTLEMENT, _vaultSettlementImplementation - ); + IAlephVaultFactory(_vaultFactory) + .setModuleImplementation(ModulesLibrary.ALEPH_VAULT_DEPOSIT, _vaultDepositImplementation); + IAlephVaultFactory(_vaultFactory) + .setModuleImplementation(ModulesLibrary.ALEPH_VAULT_REDEEM, _vaultRedeemImplementation); + IAlephVaultFactory(_vaultFactory) + .setModuleImplementation(ModulesLibrary.ALEPH_VAULT_SETTLEMENT, _vaultSettlementImplementation); IAlephVaultFactory(_vaultFactory).setModuleImplementation(ModulesLibrary.FEE_MANAGER, _feeManagerImplementation); - IAlephVaultFactory(_vaultFactory).setModuleImplementation( - ModulesLibrary.MIGRATION_MANAGER, _migrationManagerImplementation - ); + IAlephVaultFactory(_vaultFactory) + .setModuleImplementation(ModulesLibrary.MIGRATION_MANAGER, _migrationManagerImplementation); } } diff --git a/script/UpgradeScripts/UpgradeAlephVaultFactory.s.sol b/script/UpgradeScripts/UpgradeAlephVaultFactory.s.sol index b25534a..eb816c0 100644 --- a/script/UpgradeScripts/UpgradeAlephVaultFactory.s.sol +++ b/script/UpgradeScripts/UpgradeAlephVaultFactory.s.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Script, console} from "forge-std/Script.sol"; diff --git a/src/Accountant.sol b/src/Accountant.sol index 759fc9a..387b4b5 100644 --- a/src/Accountant.sol +++ b/src/Accountant.sol @@ -1,22 +1,23 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ -import {AccessControlUpgradeable} from - "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; +import { + AccessControlUpgradeable +} from "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol"; import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; @@ -88,10 +89,7 @@ contract Accountant is IAccountant, AccessControlUpgradeable { } /// @inheritdoc IAccountant - function setOperationsMultisig(address _newOperationsMultisig) - external - onlyRole(RolesLibrary.OPERATIONS_MULTISIG) - { + function setOperationsMultisig(address _newOperationsMultisig) external onlyRole(RolesLibrary.OPERATIONS_MULTISIG) { AccountantStorageData storage _sd = _getStorage(); address _oldOperationsMultisig = _sd.operationsMultisig; _sd.operationsMultisig = _newOperationsMultisig; @@ -196,8 +194,9 @@ contract Accountant is IAccountant, AccessControlUpgradeable { uint256 _managementFeesToCollect, uint256 _performanceFeesToCollect ) internal returns (uint256 _vaultFee, uint256 _alephFee) { - uint256 _alephManagementFee = - _managementFeesToCollect.mulDiv(uint256(_sd.managementFeeCut[_vault]), BPS_DENOMINATOR, Math.Rounding.Ceil); + uint256 _alephManagementFee = _managementFeesToCollect.mulDiv( + uint256(_sd.managementFeeCut[_vault]), BPS_DENOMINATOR, Math.Rounding.Ceil + ); uint256 _alephPerformanceFee = _performanceFeesToCollect.mulDiv( uint256(_sd.performanceFeeCut[_vault]), BPS_DENOMINATOR, Math.Rounding.Ceil ); diff --git a/src/AccountantStorage.sol b/src/AccountantStorage.sol index 01c29e5..cec54dc 100644 --- a/src/AccountantStorage.sol +++ b/src/AccountantStorage.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/AlephPausable.sol b/src/AlephPausable.sol index 65ed61b..742b64a 100644 --- a/src/AlephPausable.sol +++ b/src/AlephPausable.sol @@ -1,22 +1,23 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ -import {AccessControlUpgradeable} from - "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; +import { + AccessControlUpgradeable +} from "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; import {IAlephPausable} from "@aleph-vault/interfaces/IAlephPausable.sol"; import {PausableFlows} from "@aleph-vault/libraries/PausableFlows.sol"; import {RolesLibrary} from "@aleph-vault/libraries/RolesLibrary.sol"; diff --git a/src/AlephPausableStorage.sol b/src/AlephPausableStorage.sol index d11511b..0735740 100644 --- a/src/AlephPausableStorage.sol +++ b/src/AlephPausableStorage.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/AlephVault.sol b/src/AlephVault.sol index 387b3cf..1346521 100644 --- a/src/AlephVault.sol +++ b/src/AlephVault.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Time} from "openzeppelin-contracts/contracts/utils/types/Time.sol"; @@ -113,8 +113,10 @@ contract AlephVault is IAlephVault, AlephVaultBase, AlephPausable { || _initializationParams.moduleInitializationParams.alephVaultSettlementImplementation == address(0) || _initializationParams.moduleInitializationParams.feeManagerImplementation == address(0) || _initializationParams.moduleInitializationParams.migrationManagerImplementation == address(0) - || _initializationParams.userInitializationParams.shareClassParams.managementFee > MAXIMUM_MANAGEMENT_FEE - || _initializationParams.userInitializationParams.shareClassParams.performanceFee > MAXIMUM_PERFORMANCE_FEE + || _initializationParams.userInitializationParams.shareClassParams.managementFee + > MAXIMUM_MANAGEMENT_FEE + || _initializationParams.userInitializationParams.shareClassParams.performanceFee + > MAXIMUM_PERFORMANCE_FEE || _initializationParams.userInitializationParams.shareClassParams.minDepositAmount == 0 || _initializationParams.userInitializationParams.shareClassParams.minRedeemAmount == 0 ) { @@ -317,12 +319,7 @@ contract AlephVault is IAlephVault, AlephVaultBase, AlephPausable { } /// @inheritdoc IAlephVault - function totalAssetsOfClass(uint8 _classId) - external - view - onlyValidShareClass(_classId) - returns (uint256[] memory) - { + function totalAssetsOfClass(uint8 _classId) external view onlyValidShareClass(_classId) returns (uint256[] memory) { IAlephVault.ShareClass storage _shareClass = _getStorage().shareClasses[_classId]; uint32 _shareSeriesId = _shareClass.shareSeriesId; uint32 _lastConsolidatedSeriesId = _shareClass.lastConsolidatedSeriesId; @@ -463,7 +460,7 @@ contract AlephVault is IAlephVault, AlephVaultBase, AlephPausable { /// @inheritdoc IAlephVault function usersToDepositAt(uint8 _classId, uint48 _batchId) external view returns (address[] memory) { bytes32[] memory _bytesUsers = - _getStorage().shareClasses[_classId].depositRequests[_batchId].usersToDeposit._inner._values; + _getStorage().shareClasses[_classId].depositRequests[_batchId].usersToDeposit._inner._values; address[] memory _users = new address[](_bytesUsers.length); assembly { _users := _bytesUsers @@ -474,7 +471,7 @@ contract AlephVault is IAlephVault, AlephVaultBase, AlephPausable { /// @inheritdoc IAlephVault function usersToRedeemAt(uint8 _classId, uint48 _batchId) external view returns (address[] memory) { bytes32[] memory _bytesUsers = - _getStorage().shareClasses[_classId].redeemRequests[_batchId].usersToRedeem._inner._values; + _getStorage().shareClasses[_classId].redeemRequests[_batchId].usersToRedeem._inner._values; address[] memory _users = new address[](_bytesUsers.length); assembly { _users := _bytesUsers @@ -488,10 +485,12 @@ contract AlephVault is IAlephVault, AlephVaultBase, AlephPausable { uint8 _shareClasses = _sd.shareClassesId; for (uint8 _classId = 1; _classId <= _shareClasses; _classId++) { IAlephVault.ShareClass storage _shareClass = _sd.shareClasses[_classId]; - _totalFeeAmountToCollect += - _assetsPerClassOf(_shareClass, _classId, SeriesAccounting.MANAGEMENT_FEE_RECIPIENT); - _totalFeeAmountToCollect += - _assetsPerClassOf(_shareClass, _classId, SeriesAccounting.PERFORMANCE_FEE_RECIPIENT); + _totalFeeAmountToCollect += _assetsPerClassOf( + _shareClass, _classId, SeriesAccounting.MANAGEMENT_FEE_RECIPIENT + ); + _totalFeeAmountToCollect += _assetsPerClassOf( + _shareClass, _classId, SeriesAccounting.PERFORMANCE_FEE_RECIPIENT + ); } } @@ -660,11 +659,7 @@ contract AlephVault is IAlephVault, AlephVaultBase, AlephPausable { * @param _classId The ID of the share class to set the minimum deposit amount for. * @dev Only callable by the MANAGER role. */ - function setMinDepositAmount(uint8 _classId) - external - onlyValidShareClass(_classId) - onlyRole(RolesLibrary.MANAGER) - { + function setMinDepositAmount(uint8 _classId) external onlyValidShareClass(_classId) onlyRole(RolesLibrary.MANAGER) { _delegate(ModulesLibrary.ALEPH_VAULT_DEPOSIT); } diff --git a/src/AlephVaultBase.sol b/src/AlephVaultBase.sol index 87bd024..1ec74ee 100644 --- a/src/AlephVaultBase.sol +++ b/src/AlephVaultBase.sol @@ -1,23 +1,24 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol"; -import {ReentrancyGuardUpgradeable} from - "openzeppelin-contracts-upgradeable/contracts/utils/ReentrancyGuardUpgradeable.sol"; +import { + ReentrancyGuardUpgradeable +} from "openzeppelin-contracts-upgradeable/contracts/utils/ReentrancyGuardUpgradeable.sol"; import {Time} from "openzeppelin-contracts/contracts/utils/types/Time.sol"; import {IAlephVault} from "@aleph-vault/interfaces/IAlephVault.sol"; import {ERC4626Math} from "@aleph-vault/libraries/ERC4626Math.sol"; diff --git a/src/AlephVaultStorage.sol b/src/AlephVaultStorage.sol index 4e8d446..0861976 100644 --- a/src/AlephVaultStorage.sol +++ b/src/AlephVaultStorage.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAlephVault} from "@aleph-vault/interfaces/IAlephVault.sol"; diff --git a/src/factory/AlephVaultFactory.sol b/src/factory/AlephVaultFactory.sol index 199a504..29c1261 100644 --- a/src/factory/AlephVaultFactory.sol +++ b/src/factory/AlephVaultFactory.sol @@ -1,22 +1,23 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ -import {AccessControlUpgradeable} from - "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; +import { + AccessControlUpgradeable +} from "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; import {BeaconProxy} from "openzeppelin-contracts/contracts/proxy/beacon/BeaconProxy.sol"; import {Create2} from "openzeppelin-contracts/contracts/utils/Create2.sol"; import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; @@ -29,7 +30,8 @@ import {ModulesLibrary} from "@aleph-vault/libraries/ModulesLibrary.sol"; import {RolesLibrary} from "@aleph-vault/libraries/RolesLibrary.sol"; import {AlephVault} from "@aleph-vault/AlephVault.sol"; import { - AlephVaultFactoryStorage, AlephVaultFactoryStorageData + AlephVaultFactoryStorage, + AlephVaultFactoryStorageData } from "@aleph-vault/factory/AlephVaultFactoryStorage.sol"; /** @@ -200,14 +202,14 @@ contract AlephVaultFactory is IAlephVaultFactory, AccessControlUpgradeable { _sd.authSigner, _userInitializationParams.authSignature ); - IAlephVault.ModuleInitializationParams memory _moduleInitializationParams = IAlephVault - .ModuleInitializationParams({ - alephVaultDepositImplementation: _sd.moduleImplementations[ModulesLibrary.ALEPH_VAULT_DEPOSIT], - alephVaultRedeemImplementation: _sd.moduleImplementations[ModulesLibrary.ALEPH_VAULT_REDEEM], - alephVaultSettlementImplementation: _sd.moduleImplementations[ModulesLibrary.ALEPH_VAULT_SETTLEMENT], - feeManagerImplementation: _sd.moduleImplementations[ModulesLibrary.FEE_MANAGER], - migrationManagerImplementation: _sd.moduleImplementations[ModulesLibrary.MIGRATION_MANAGER] - }); + IAlephVault.ModuleInitializationParams memory _moduleInitializationParams = + IAlephVault.ModuleInitializationParams({ + alephVaultDepositImplementation: _sd.moduleImplementations[ModulesLibrary.ALEPH_VAULT_DEPOSIT], + alephVaultRedeemImplementation: _sd.moduleImplementations[ModulesLibrary.ALEPH_VAULT_REDEEM], + alephVaultSettlementImplementation: _sd.moduleImplementations[ModulesLibrary.ALEPH_VAULT_SETTLEMENT], + feeManagerImplementation: _sd.moduleImplementations[ModulesLibrary.FEE_MANAGER], + migrationManagerImplementation: _sd.moduleImplementations[ModulesLibrary.MIGRATION_MANAGER] + }); IAlephVault.InitializationParams memory _initializationParams = IAlephVault.InitializationParams({ operationsMultisig: _sd.operationsMultisig, vaultFactory: address(this), diff --git a/src/factory/AlephVaultFactoryStorage.sol b/src/factory/AlephVaultFactoryStorage.sol index a6f0038..2430b5a 100644 --- a/src/factory/AlephVaultFactoryStorage.sol +++ b/src/factory/AlephVaultFactoryStorage.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; diff --git a/src/interfaces/IAccountant.sol b/src/interfaces/IAccountant.sol index cecb88a..2993ffa 100644 --- a/src/interfaces/IAccountant.sol +++ b/src/interfaces/IAccountant.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/interfaces/IAlephPausable.sol b/src/interfaces/IAlephPausable.sol index 5116427..060deed 100644 --- a/src/interfaces/IAlephPausable.sol +++ b/src/interfaces/IAlephPausable.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/interfaces/IAlephVault.sol b/src/interfaces/IAlephVault.sol index 1ce1dc8..c5da2d0 100644 --- a/src/interfaces/IAlephVault.sol +++ b/src/interfaces/IAlephVault.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; diff --git a/src/interfaces/IAlephVaultDeposit.sol b/src/interfaces/IAlephVaultDeposit.sol index 18d9ae2..bf54d33 100644 --- a/src/interfaces/IAlephVaultDeposit.sol +++ b/src/interfaces/IAlephVaultDeposit.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {AuthLibrary} from "@aleph-vault/libraries/AuthLibrary.sol"; diff --git a/src/interfaces/IAlephVaultFactory.sol b/src/interfaces/IAlephVaultFactory.sol index 27a68ee..570aba8 100644 --- a/src/interfaces/IAlephVaultFactory.sol +++ b/src/interfaces/IAlephVaultFactory.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAlephVault} from "@aleph-vault/interfaces/IAlephVault.sol"; diff --git a/src/interfaces/IAlephVaultFull.sol b/src/interfaces/IAlephVaultFull.sol index 7fb2fc3..2205255 100644 --- a/src/interfaces/IAlephVaultFull.sol +++ b/src/interfaces/IAlephVaultFull.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAlephPausable} from "@aleph-vault/interfaces/IAlephPausable.sol"; diff --git a/src/interfaces/IAlephVaultRedeem.sol b/src/interfaces/IAlephVaultRedeem.sol index 24a98d4..f3b1433 100644 --- a/src/interfaces/IAlephVaultRedeem.sol +++ b/src/interfaces/IAlephVaultRedeem.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/interfaces/IAlephVaultSettlement.sol b/src/interfaces/IAlephVaultSettlement.sol index e9ff0c9..6074d00 100644 --- a/src/interfaces/IAlephVaultSettlement.sol +++ b/src/interfaces/IAlephVaultSettlement.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {AuthLibrary} from "@aleph-vault/libraries/AuthLibrary.sol"; diff --git a/src/interfaces/IFeeManager.sol b/src/interfaces/IFeeManager.sol index 4fc9ae9..a11134d 100644 --- a/src/interfaces/IFeeManager.sol +++ b/src/interfaces/IFeeManager.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/interfaces/IMigrationManager.sol b/src/interfaces/IMigrationManager.sol index 2c6f288..15d7c6e 100644 --- a/src/interfaces/IMigrationManager.sol +++ b/src/interfaces/IMigrationManager.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/libraries/AuthLibrary.sol b/src/libraries/AuthLibrary.sol index 58fdced..c8e475d 100644 --- a/src/libraries/AuthLibrary.sol +++ b/src/libraries/AuthLibrary.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {ECDSA} from "openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol"; @@ -90,12 +90,14 @@ library AuthLibrary { * @param _authSigner The auth signer. * @param _authSignature The auth signature. */ - function verifyDepositRequestAuthSignature(uint8 _classId, address _authSigner, AuthSignature memory _authSignature) - internal - view - { - bytes32 _hash = - keccak256(abi.encode(msg.sender, address(this), block.chainid, _classId, _authSignature.expiryBlock)); + function verifyDepositRequestAuthSignature( + uint8 _classId, + address _authSigner, + AuthSignature memory _authSignature + ) internal view { + bytes32 _hash = keccak256( + abi.encode(msg.sender, address(this), block.chainid, _classId, _authSignature.expiryBlock) + ); _verifyAuthSignature(_hash, _authSigner, _authSignature); } diff --git a/src/libraries/ERC4626Math.sol b/src/libraries/ERC4626Math.sol index 2aad251..a679805 100644 --- a/src/libraries/ERC4626Math.sol +++ b/src/libraries/ERC4626Math.sol @@ -22,11 +22,7 @@ library ERC4626Math { return convertToAssets(shares, totalAssets, totalShares, Math.Rounding.Ceil); } - function previewWithdraw(uint256 assets, uint256 totalShares, uint256 totalAssets) - internal - pure - returns (uint256) - { + function previewWithdraw(uint256 assets, uint256 totalShares, uint256 totalAssets) internal pure returns (uint256) { return convertToShares(assets, totalShares, totalAssets, Math.Rounding.Ceil); } diff --git a/src/libraries/ModulesLibrary.sol b/src/libraries/ModulesLibrary.sol index c1635c5..34a549a 100644 --- a/src/libraries/ModulesLibrary.sol +++ b/src/libraries/ModulesLibrary.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/libraries/PausableFlows.sol b/src/libraries/PausableFlows.sol index 29abb74..3e1d3e9 100644 --- a/src/libraries/PausableFlows.sol +++ b/src/libraries/PausableFlows.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/libraries/RolesLibrary.sol b/src/libraries/RolesLibrary.sol index b2d133d..4370eeb 100644 --- a/src/libraries/RolesLibrary.sol +++ b/src/libraries/RolesLibrary.sol @@ -1,18 +1,19 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; + /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ /** diff --git a/src/libraries/SeriesAccounting.sol b/src/libraries/SeriesAccounting.sol index 24f3121..5dffc04 100644 --- a/src/libraries/SeriesAccounting.sol +++ b/src/libraries/SeriesAccounting.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; @@ -222,10 +222,8 @@ library SeriesAccounting { // if user does not exist in lead series, add them in lead series (except for virtual users) if ( !_leadSeries.users.contains(_userConsolidationDetails.user) - && ( - _userConsolidationDetails.user != MANAGEMENT_FEE_RECIPIENT - && _userConsolidationDetails.user != PERFORMANCE_FEE_RECIPIENT - ) + && (_userConsolidationDetails.user != MANAGEMENT_FEE_RECIPIENT + && _userConsolidationDetails.user != PERFORMANCE_FEE_RECIPIENT) ) { _leadSeries.users.add(_userConsolidationDetails.user); } diff --git a/src/libraries/TimelockRegistry.sol b/src/libraries/TimelockRegistry.sol index a5a716d..5669d16 100644 --- a/src/libraries/TimelockRegistry.sol +++ b/src/libraries/TimelockRegistry.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Time} from "openzeppelin-contracts/contracts/utils/types/Time.sol"; diff --git a/src/modules/AlephVaultDeposit.sol b/src/modules/AlephVaultDeposit.sol index 836c42e..e572045 100644 --- a/src/modules/AlephVaultDeposit.sol +++ b/src/modules/AlephVaultDeposit.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; @@ -144,9 +144,7 @@ contract AlephVaultDeposit is IAlephVaultDeposit, AlephVaultBase { * @param _classId The id of the class. * @param _minUserBalance The new min user balance. */ - function _queueMinUserBalance(AlephVaultStorageData storage _sd, uint8 _classId, uint256 _minUserBalance) - internal - { + function _queueMinUserBalance(AlephVaultStorageData storage _sd, uint8 _classId, uint256 _minUserBalance) internal { _sd.timelocks[TimelockRegistry.MIN_USER_BALANCE.getKey(_classId)] = TimelockRegistry.Timelock({ isQueued: true, unlockTimestamp: Time.timestamp() + MIN_USER_BALANCE_TIMELOCK, @@ -226,15 +224,15 @@ contract AlephVaultDeposit is IAlephVaultDeposit, AlephVaultBase { if ( _shareClassParams.minUserBalance > 0 && _assetsPerClassOf(_shareClass, _requestDepositParams.classId, msg.sender) - + _depositRequestOf(_sd, _requestDepositParams.classId, msg.sender) + _requestDepositParams.amount - < _shareClassParams.minUserBalance + + _depositRequestOf(_sd, _requestDepositParams.classId, msg.sender) + + _requestDepositParams.amount < _shareClassParams.minUserBalance ) { revert DepositLessThanMinUserBalance(_shareClassParams.minUserBalance); } if ( _shareClassParams.maxDepositCap > 0 && _totalAssetsPerClass(_shareClass, _requestDepositParams.classId) - + _totalAmountToDeposit(_sd, _requestDepositParams.classId) + _requestDepositParams.amount + + _totalAmountToDeposit(_sd, _requestDepositParams.classId) + _requestDepositParams.amount > _shareClassParams.maxDepositCap ) { revert DepositExceedsMaxDepositCap(_shareClassParams.maxDepositCap); diff --git a/src/modules/AlephVaultRedeem.sol b/src/modules/AlephVaultRedeem.sol index 9a894d1..4d8d2ef 100644 --- a/src/modules/AlephVaultRedeem.sol +++ b/src/modules/AlephVaultRedeem.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; diff --git a/src/modules/AlephVaultSettlement.sol b/src/modules/AlephVaultSettlement.sol index 8a5936f..e96fd6a 100644 --- a/src/modules/AlephVaultSettlement.sol +++ b/src/modules/AlephVaultSettlement.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; @@ -185,8 +185,8 @@ contract AlephVaultSettlement is IAlephVaultSettlement, AlephVaultBase { _depositRequestDetails.amount, _settleDepositDetails.totalShares, _settleDepositDetails.totalAssets ); _totalSharesToMint += _depositRequestDetails.sharesToMint; - _shareClass.shareSeries[_settleDepositDetails.seriesId].sharesOf[_depositRequestDetails.user] += - _depositRequestDetails.sharesToMint; + _shareClass.shareSeries[_settleDepositDetails.seriesId] + .sharesOf[_depositRequestDetails.user] += _depositRequestDetails.sharesToMint; // add user into settlement series if they don't already exist there if (!_shareClass.shareSeries[_settleDepositDetails.seriesId].users.contains(_depositRequestDetails.user)) { _shareClass.shareSeries[_settleDepositDetails.seriesId].users.add(_depositRequestDetails.user); @@ -442,7 +442,8 @@ contract AlephVaultSettlement is IAlephVaultSettlement, AlephVaultBase { : SeriesAccounting.LEAD_SERIES_ID; // update the series total assets and shares _shareClass.shareSeries[_seriesId].totalAssets = _newTotalAssets[_i]; - _shareClass.shareSeries[_seriesId].totalShares += _accumulateFeeShares( + _shareClass.shareSeries[_seriesId] + .totalShares += _accumulateFeeShares( _newTotalAssets[_i], _shareClass.shareSeries[_seriesId].totalShares, _toBatchId, @@ -477,7 +478,7 @@ contract AlephVaultSettlement is IAlephVaultSettlement, AlephVaultBase { return 0; } (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.FEE_MANAGER] - .delegatecall( + .delegatecall( abi.encodeCall( IFeeManager.accumulateFees, (_classId, _seriesId, _toBatchId, _lastFeePaidId, _newTotalAssets, _totalShares) diff --git a/src/modules/FeeManager.sol b/src/modules/FeeManager.sol index 9c7986d..10230e6 100644 --- a/src/modules/FeeManager.sol +++ b/src/modules/FeeManager.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; @@ -91,8 +91,9 @@ contract FeeManager is IFeeManager, AlephVaultBase { uint256 _totalShares, uint256 _highWaterMark ) external pure returns (uint256 _performanceFeeShares) { - uint256 _performanceFeeAmount = - _calculatePerformanceFeeAmount(_performanceFee, _newTotalAssets, _totalShares, _highWaterMark); + uint256 _performanceFeeAmount = _calculatePerformanceFeeAmount( + _performanceFee, _newTotalAssets, _totalShares, _highWaterMark + ); return ERC4626Math.previewDeposit(_performanceFeeAmount, _totalShares, _newTotalAssets - _performanceFeeAmount); } @@ -264,12 +265,12 @@ contract FeeManager is IFeeManager, AlephVaultBase { uint256 _totalFeeSharesToMint = _feesAccumulatedParams.managementFeeSharesToMint + _feesAccumulatedParams.performanceFeeSharesToMint; // update management fee shares of the series - _shareClass.shareSeries[_seriesId].sharesOf[SeriesAccounting.MANAGEMENT_FEE_RECIPIENT] += - _feesAccumulatedParams.managementFeeSharesToMint; + _shareClass.shareSeries[_seriesId] + .sharesOf[SeriesAccounting.MANAGEMENT_FEE_RECIPIENT] += _feesAccumulatedParams.managementFeeSharesToMint; if (_feesAccumulatedParams.performanceFeeSharesToMint > 0) { // update performance fee shares of the series - _shareClass.shareSeries[_seriesId].sharesOf[SeriesAccounting.PERFORMANCE_FEE_RECIPIENT] += - _feesAccumulatedParams.performanceFeeSharesToMint; + _shareClass.shareSeries[_seriesId] + .sharesOf[SeriesAccounting.PERFORMANCE_FEE_RECIPIENT] += _feesAccumulatedParams.performanceFeeSharesToMint; // update high water mark of the series uint256 _highWaterMark = _getPricePerShare(_newTotalAssets, _totalShares + _totalFeeSharesToMint); _shareClass.shareSeries[_seriesId].highWaterMark = _highWaterMark; diff --git a/src/modules/MigrationManager.sol b/src/modules/MigrationManager.sol index 7ee51dd..2fcaad9 100644 --- a/src/modules/MigrationManager.sol +++ b/src/modules/MigrationManager.sol @@ -1,22 +1,23 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ -import {AccessControlUpgradeable} from - "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; +import { + AccessControlUpgradeable +} from "openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; import {IMigrationManager} from "@aleph-vault/interfaces/IMigrationManager.sol"; import {PausableFlows} from "@aleph-vault/libraries/PausableFlows.sol"; import {RolesLibrary} from "@aleph-vault/libraries/RolesLibrary.sol"; diff --git a/test/exposes/ExposedVault.sol b/test/exposes/ExposedVault.sol index c524c6d..3951a38 100644 --- a/test/exposes/ExposedVault.sol +++ b/test/exposes/ExposedVault.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; @@ -179,9 +179,13 @@ contract ExposedVault is AlephVault { if (_batchesElapsed == 0) { return 0; } - return IFeeManager(_getStorage().moduleImplementations[ModulesLibrary.FEE_MANAGER]).getManagementFeeShares( - _getStorage().shareClasses[1].shareClassParams.managementFee, _batchesElapsed, _newTotalAssets, _totalShares - ); + return IFeeManager(_getStorage().moduleImplementations[ModulesLibrary.FEE_MANAGER]) + .getManagementFeeShares( + _getStorage().shareClasses[1].shareClassParams.managementFee, + _batchesElapsed, + _newTotalAssets, + _totalShares + ); } function getPerformanceFeeShares(uint256 _newTotalAssets, uint256 _totalShares) external view returns (uint256) { @@ -190,9 +194,10 @@ contract ExposedVault is AlephVault { if (_highWaterMark == 0) { return 0; } - return IFeeManager(_sd.moduleImplementations[ModulesLibrary.FEE_MANAGER]).getPerformanceFeeShares( - _sd.shareClasses[1].shareClassParams.performanceFee, _newTotalAssets, _totalShares, _highWaterMark - ); + return IFeeManager(_sd.moduleImplementations[ModulesLibrary.FEE_MANAGER]) + .getPerformanceFeeShares( + _sd.shareClasses[1].shareClassParams.performanceFee, _newTotalAssets, _totalShares, _highWaterMark + ); } function managementFeeRecipient() external pure returns (address) { @@ -205,7 +210,7 @@ contract ExposedVault is AlephVault { function minDepositAmountTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.ALEPH_VAULT_DEPOSIT] - .delegatecall(abi.encodeWithSignature("MIN_DEPOSIT_AMOUNT_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("MIN_DEPOSIT_AMOUNT_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } @@ -214,7 +219,7 @@ contract ExposedVault is AlephVault { function minUserBalanceTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.ALEPH_VAULT_DEPOSIT] - .delegatecall(abi.encodeWithSignature("MIN_USER_BALANCE_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("MIN_USER_BALANCE_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } @@ -223,7 +228,7 @@ contract ExposedVault is AlephVault { function maxDepositCapTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.ALEPH_VAULT_DEPOSIT] - .delegatecall(abi.encodeWithSignature("MAX_DEPOSIT_CAP_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("MAX_DEPOSIT_CAP_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } @@ -232,7 +237,7 @@ contract ExposedVault is AlephVault { function noticePeriodTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.ALEPH_VAULT_REDEEM] - .delegatecall(abi.encodeWithSignature("NOTICE_PERIOD_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("NOTICE_PERIOD_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } @@ -241,7 +246,7 @@ contract ExposedVault is AlephVault { function lockInPeriodTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.ALEPH_VAULT_REDEEM] - .delegatecall(abi.encodeWithSignature("LOCK_IN_PERIOD_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("LOCK_IN_PERIOD_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } @@ -250,7 +255,7 @@ contract ExposedVault is AlephVault { function minRedeemAmountTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.ALEPH_VAULT_REDEEM] - .delegatecall(abi.encodeWithSignature("MIN_REDEEM_AMOUNT_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("MIN_REDEEM_AMOUNT_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } @@ -259,7 +264,7 @@ contract ExposedVault is AlephVault { function managementFeeTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.FEE_MANAGER] - .delegatecall(abi.encodeWithSignature("MANAGEMENT_FEE_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("MANAGEMENT_FEE_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } @@ -268,7 +273,7 @@ contract ExposedVault is AlephVault { function performanceFeeTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.FEE_MANAGER] - .delegatecall(abi.encodeWithSignature("PERFORMANCE_FEE_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("PERFORMANCE_FEE_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } @@ -277,7 +282,7 @@ contract ExposedVault is AlephVault { function accountantTimelock() external returns (uint48) { (bool _success, bytes memory _data) = _getStorage().moduleImplementations[ModulesLibrary.FEE_MANAGER] - .delegatecall(abi.encodeWithSignature("ACCOUNTANT_TIMELOCK()")); + .delegatecall(abi.encodeWithSignature("ACCOUNTANT_TIMELOCK()")); if (_success) { return abi.decode(_data, (uint48)); } diff --git a/test/exposes/TestToken.sol b/test/exposes/TestToken.sol index 3a66e3c..91e9753 100644 --- a/test/exposes/TestToken.sol +++ b/test/exposes/TestToken.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.8.25; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {ERC20} from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; diff --git a/test/integrations/RequestSettleDeposit.e2e.t.sol b/test/integrations/RequestSettleDeposit.e2e.t.sol index 835df28..aff8a1a 100644 --- a/test/integrations/RequestSettleDeposit.e2e.t.sol +++ b/test/integrations/RequestSettleDeposit.e2e.t.sol @@ -56,7 +56,9 @@ contract RequestSettleDepositTest is BaseTest { underlyingToken.mint(address(mockUser_1), _depositAmount); underlyingToken.approve(address(vault), _depositAmount); uint48 _requestBatchId = vault.requestDeposit( - IAlephVaultDeposit.RequestDepositParams({classId: 1, amount: _depositAmount, authSignature: authSignature_1}) + IAlephVaultDeposit.RequestDepositParams({ + classId: 1, amount: _depositAmount, authSignature: authSignature_1 + }) ); vm.stopPrank(); @@ -118,7 +120,9 @@ contract RequestSettleDepositTest is BaseTest { underlyingToken.mint(address(mockUser_1), _depositAmount); underlyingToken.approve(address(vault), _depositAmount); uint48 _requestBatchId = vault.requestDeposit( - IAlephVaultDeposit.RequestDepositParams({classId: 1, amount: _depositAmount, authSignature: authSignature_1}) + IAlephVaultDeposit.RequestDepositParams({ + classId: 1, amount: _depositAmount, authSignature: authSignature_1 + }) ); vm.stopPrank(); @@ -182,7 +186,9 @@ contract RequestSettleDepositTest is BaseTest { underlyingToken.mint(address(mockUser_1), _depositAmount); underlyingToken.approve(address(vault), _depositAmount); uint48 _requestBatchId = vault.requestDeposit( - IAlephVaultDeposit.RequestDepositParams({classId: 1, amount: _depositAmount, authSignature: authSignature_1}) + IAlephVaultDeposit.RequestDepositParams({ + classId: 1, amount: _depositAmount, authSignature: authSignature_1 + }) ); vm.stopPrank(); @@ -246,7 +252,9 @@ contract RequestSettleDepositTest is BaseTest { underlyingToken.mint(address(mockUser_1), _depositAmount); underlyingToken.approve(address(vault), _depositAmount); uint48 _requestBatchId = vault.requestDeposit( - IAlephVaultDeposit.RequestDepositParams({classId: 1, amount: _depositAmount, authSignature: authSignature_1}) + IAlephVaultDeposit.RequestDepositParams({ + classId: 1, amount: _depositAmount, authSignature: authSignature_1 + }) ); vm.stopPrank(); @@ -304,7 +312,9 @@ contract RequestSettleDepositTest is BaseTest { underlyingToken.mint(address(mockUser_1), _depositAmount); underlyingToken.approve(address(vault), _depositAmount); uint48 _requestBatchId = vault.requestDeposit( - IAlephVaultDeposit.RequestDepositParams({classId: 1, amount: _depositAmount, authSignature: authSignature_1}) + IAlephVaultDeposit.RequestDepositParams({ + classId: 1, amount: _depositAmount, authSignature: authSignature_1 + }) ); vm.stopPrank(); @@ -374,7 +384,9 @@ contract RequestSettleDepositTest is BaseTest { underlyingToken.mint(address(mockUser_1), _depositAmount); underlyingToken.approve(address(vault), _depositAmount); uint48 _requestBatchId = vault.requestDeposit( - IAlephVaultDeposit.RequestDepositParams({classId: 1, amount: _depositAmount, authSignature: authSignature_1}) + IAlephVaultDeposit.RequestDepositParams({ + classId: 1, amount: _depositAmount, authSignature: authSignature_1 + }) ); vm.stopPrank(); @@ -446,7 +458,9 @@ contract RequestSettleDepositTest is BaseTest { underlyingToken.mint(address(mockUser_1), _depositAmount); underlyingToken.approve(address(vault), _depositAmount); uint48 _requestBatchId = vault.requestDeposit( - IAlephVaultDeposit.RequestDepositParams({classId: 1, amount: _depositAmount, authSignature: authSignature_1}) + IAlephVaultDeposit.RequestDepositParams({ + classId: 1, amount: _depositAmount, authSignature: authSignature_1 + }) ); vm.stopPrank(); @@ -524,7 +538,9 @@ contract RequestSettleDepositTest is BaseTest { underlyingToken.mint(address(mockUser_1), _depositAmount); underlyingToken.approve(address(vault), _depositAmount); uint48 _requestBatchId = vault.requestDeposit( - IAlephVaultDeposit.RequestDepositParams({classId: 1, amount: _depositAmount, authSignature: authSignature_1}) + IAlephVaultDeposit.RequestDepositParams({ + classId: 1, amount: _depositAmount, authSignature: authSignature_1 + }) ); vm.stopPrank(); diff --git a/test/integrations/RequestSettleDepositRedeem.e2e.t.sol b/test/integrations/RequestSettleDepositRedeem.e2e.t.sol index 32e1a17..a003799 100644 --- a/test/integrations/RequestSettleDepositRedeem.e2e.t.sol +++ b/test/integrations/RequestSettleDepositRedeem.e2e.t.sol @@ -78,7 +78,9 @@ contract RequestSettleDepositRedeemTest is BaseTest { classId: 1, toBatchId: vault.currentBatch(), newTotalAssets: new uint256[](1), - authSignature: _getSettlementAuthSignature(AuthLibrary.SETTLE_DEPOSIT, vault.currentBatch(), new uint256[](1)) + authSignature: _getSettlementAuthSignature( + AuthLibrary.SETTLE_DEPOSIT, vault.currentBatch(), new uint256[](1) + ) }); // expected shares to mint per user @@ -124,8 +126,9 @@ contract RequestSettleDepositRedeemTest is BaseTest { uint256 _totalShares = vault.totalSharesPerSeries(1, 0); uint256 _expectedManagementShares = vault.getManagementFeeShares(_settlementParams.newTotalAssets[0], _totalShares, 2); - uint256 _expectedPerformanceShares = - vault.getPerformanceFeeShares(_settlementParams.newTotalAssets[0], _totalShares + _expectedManagementShares); + uint256 _expectedPerformanceShares = vault.getPerformanceFeeShares( + _settlementParams.newTotalAssets[0], _totalShares + _expectedManagementShares + ); _totalShares += _expectedManagementShares + _expectedPerformanceShares; // expected assets to withdraw per user diff --git a/test/invariants/RequestDeposit.fuzz.t.sol b/test/invariants/RequestDeposit.fuzz.t.sol index 928968e..ef37502 100644 --- a/test/invariants/RequestDeposit.fuzz.t.sol +++ b/test/invariants/RequestDeposit.fuzz.t.sol @@ -112,9 +112,7 @@ contract RequestDepositTest is BaseTest { // request deposit vault.requestDeposit( IAlephVaultDeposit.RequestDepositParams({ - classId: 1, - amount: _depositAmount, - authSignature: _authSignature + classId: 1, amount: _depositAmount, authSignature: _authSignature }) ); vm.stopPrank(); @@ -174,9 +172,7 @@ contract RequestDepositTest is BaseTest { // request deposit vault.requestDeposit( IAlephVaultDeposit.RequestDepositParams({ - classId: 1, - amount: _depositAmount, - authSignature: _authSignature + classId: 1, amount: _depositAmount, authSignature: _authSignature }) ); vm.stopPrank(); diff --git a/test/invariants/RequestSettleDeposit.fuzz.t.sol b/test/invariants/RequestSettleDeposit.fuzz.t.sol index 3043e35..b987814 100644 --- a/test/invariants/RequestSettleDeposit.fuzz.t.sol +++ b/test/invariants/RequestSettleDeposit.fuzz.t.sol @@ -224,9 +224,7 @@ contract RequestSettleDepositTest is BaseTest { AuthLibrary.AuthSignature memory _authSignature_1 = _getDepositAuthSignature(_firstUser, type(uint256).max); vault.requestDeposit( IAlephVaultDeposit.RequestDepositParams({ - classId: 1, - amount: _firstDepositAmount, - authSignature: _authSignature_1 + classId: 1, amount: _firstDepositAmount, authSignature: _authSignature_1 }) ); vm.stopPrank(); @@ -259,9 +257,7 @@ contract RequestSettleDepositTest is BaseTest { AuthLibrary.AuthSignature memory _authSignature = _getDepositAuthSignature(_user, type(uint256).max); vault.requestDeposit( IAlephVaultDeposit.RequestDepositParams({ - classId: 1, - amount: _depositAmount, - authSignature: _authSignature + classId: 1, amount: _depositAmount, authSignature: _authSignature }) ); vm.stopPrank(); @@ -322,9 +318,7 @@ contract RequestSettleDepositTest is BaseTest { AuthLibrary.AuthSignature memory _authSignature_1 = _getDepositAuthSignature(_firstUser, type(uint256).max); vault.requestDeposit( IAlephVaultDeposit.RequestDepositParams({ - classId: 1, - amount: _firstDepositAmount, - authSignature: _authSignature_1 + classId: 1, amount: _firstDepositAmount, authSignature: _authSignature_1 }) ); vm.stopPrank(); @@ -337,7 +331,9 @@ contract RequestSettleDepositTest is BaseTest { classId: 1, toBatchId: vault.currentBatch(), newTotalAssets: new uint256[](1), - authSignature: _getSettlementAuthSignature(AuthLibrary.SETTLE_DEPOSIT, vault.currentBatch(), new uint256[](1)) + authSignature: _getSettlementAuthSignature( + AuthLibrary.SETTLE_DEPOSIT, vault.currentBatch(), new uint256[](1) + ) }); vm.prank(oracle); vault.settleDeposit(_settlementParams); @@ -364,9 +360,7 @@ contract RequestSettleDepositTest is BaseTest { AuthLibrary.AuthSignature memory _authSignature = _getDepositAuthSignature(_user, type(uint256).max); vault.requestDeposit( IAlephVaultDeposit.RequestDepositParams({ - classId: 1, - amount: _depositAmount, - authSignature: _authSignature + classId: 1, amount: _depositAmount, authSignature: _authSignature }) ); vm.stopPrank(); @@ -393,9 +387,8 @@ contract RequestSettleDepositTest is BaseTest { _newTotalAssetsArr[0] = _newTotalAssets; _vaultSharesBefore[0] = vault.totalSharesPerSeries(1, 0); for (uint32 k = 1; k < _activeSeries; k++) { - _newTotalAssetsArr[k] = vault.totalAssetsPerSeries(1, k + _lastConsolidatedSeriesId).mulDiv( - _scalingFactor, _priceDenominator - ); + _newTotalAssetsArr[k] = vault.totalAssetsPerSeries(1, k + _lastConsolidatedSeriesId) + .mulDiv(_scalingFactor, _priceDenominator); _vaultSharesBefore[k] = vault.totalSharesPerSeries(1, k + _lastConsolidatedSeriesId); } diff --git a/test/units/deposit/AlephVaultDeposit.unit.t.sol b/test/units/deposit/AlephVaultDeposit.unit.t.sol index 419ca9f..7f07d26 100644 --- a/test/units/deposit/AlephVaultDeposit.unit.t.sol +++ b/test/units/deposit/AlephVaultDeposit.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; @@ -66,9 +66,7 @@ contract AlephVaultDepositTest is BaseTest { ); } - function test_requestDeposit_whenFlowIsUnpaused_revertsWhenDepositedTokenAmountIsLessThanMinDepositAmount() - public - { + function test_requestDeposit_whenFlowIsUnpaused_revertsWhenDepositedTokenAmountIsLessThanMinDepositAmount() public { // set min deposit amount to 100 ether vault.setMinDepositAmount(1, 100 ether); @@ -94,9 +92,7 @@ contract AlephVaultDepositTest is BaseTest { ); } - function test_requestDeposit_whenFlowIsUnpaused_revertsWhenDepositedTokenAmountIsGreaterThanMaxDepositCap() - public - { + function test_requestDeposit_whenFlowIsUnpaused_revertsWhenDepositedTokenAmountIsGreaterThanMaxDepositCap() public { // set max deposit cap to 200 ether vault.setMaxDepositCap(1, 200 ether); @@ -111,8 +107,9 @@ contract AlephVaultDepositTest is BaseTest { ); } - function test_requestDeposit_whenFlowIsUnpaused_revertsWhenDepositedTokenAmountIsGreaterThanMaxDepositCap_multipleUsers( - ) public { + function test_requestDeposit_whenFlowIsUnpaused_revertsWhenDepositedTokenAmountIsGreaterThanMaxDepositCap_multipleUsers() + public + { // set max deposit cap to 300 ether vault.setMaxDepositCap(1, 300 ether); @@ -158,9 +155,7 @@ contract AlephVaultDepositTest is BaseTest { ); } - function test_requestDeposit_whenFlowIsUnpaused_revertsGivenUserHasAlreadyMadeADepositRequestForThisBatch() - public - { + function test_requestDeposit_whenFlowIsUnpaused_revertsGivenUserHasAlreadyMadeADepositRequestForThisBatch() public { // roll the block forward to make batch available vm.warp(block.timestamp + 1 days + 1); diff --git a/test/units/deposit/AlephVaultSettlement.unit.t.sol b/test/units/deposit/AlephVaultSettlement.unit.t.sol index 306f832..8c86e88 100644 --- a/test/units/deposit/AlephVaultSettlement.unit.t.sol +++ b/test/units/deposit/AlephVaultSettlement.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAccessControl} from "openzeppelin-contracts/contracts/access/IAccessControl.sol"; @@ -50,10 +50,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { ); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 0, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 0, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -64,10 +61,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.expectRevert(IAlephVault.InvalidShareClass.selector); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 0, - toBatchId: 0, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 0, toBatchId: 0, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -82,10 +76,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.expectRevert(IAlephPausable.FlowIsCurrentlyPaused.selector); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 0, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 0, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -98,10 +89,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.expectRevert(IAlephVaultSettlement.InvalidToBatchId.selector); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 1, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 1, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -114,10 +102,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.expectRevert(IAlephVaultSettlement.NoDepositsToSettle.selector); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 0, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 0, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -132,10 +117,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.expectRevert(IAlephVaultSettlement.InvalidNewTotalAssets.selector); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](2), - authSignature: authSignature_1 + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](2), authSignature: authSignature_1 }) ); } @@ -154,16 +136,14 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.expectRevert(AuthLibrary.InvalidAuthSignature.selector); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](1), - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](1), authSignature: _authSignature }) ); } - function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenLastFeePaidIdIsLessThanCurrentBatchId_shouldCallAccumulateFees( - ) public { + function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenLastFeePaidIdIsLessThanCurrentBatchId_shouldCallAccumulateFees() + public + { // roll the block forward to make future batch available vm.warp(block.timestamp + 1 days + 1); uint48 _currentBatchId = vault.currentBatch(); @@ -179,10 +159,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.prank(oracle); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](1), - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](1), authSignature: _authSignature }) ); @@ -208,10 +185,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.prank(oracle); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](1), - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](1), authSignature: _authSignature }) ); @@ -219,8 +193,9 @@ contract AlephVaultDepositSettlementTest is BaseTest { assertEq(vault.depositSettleId(), _currentBatchId); } - function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsZero_whenNewTotalAssetsChanges_shouldUpdateTotalAssets( - ) public { + function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsZero_whenNewTotalAssetsChanges_shouldUpdateTotalAssets() + public + { // roll the block forward to make future batches available vm.warp(block.timestamp + 3 days + 1); uint48 _currentBatchId = vault.currentBatch(); @@ -239,10 +214,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.prank(oracle); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: _newTotalAssets, - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: _newTotalAssets, authSignature: _authSignature }) ); @@ -251,8 +223,9 @@ contract AlephVaultDepositSettlementTest is BaseTest { assertEq(vault.totalSharesPerSeries(1, 0), _totalShares); } - function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsGreaterThanZero_revertsGivenVaultHasInsufficientBalance( - ) public { + function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsGreaterThanZero_revertsGivenVaultHasInsufficientBalance() + public + { // roll the block forward to make future batches available vm.warp(block.timestamp + 2 days + 1); uint48 _currentBatchId = vault.currentBatch(); @@ -269,16 +242,14 @@ contract AlephVaultDepositSettlementTest is BaseTest { vm.expectRevert(abi.encodeWithSelector(IAlephVaultSettlement.InsufficientAssetsToSettle.selector, 100)); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](1), - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](1), authSignature: _authSignature }) ); } - function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsGreaterThanZero_shouldSucceed_singleBatch_settleInNewSeries( - ) public { + function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsGreaterThanZero_shouldSucceed_singleBatch_settleInNewSeries() + public + { // roll the block forward to make future batches available vm.warp(block.timestamp + 2 days + 1); @@ -315,10 +286,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { emit IAlephVaultSettlement.SettleDeposit(1, 1, 0, _currentBatchId, 300 ether, 300 ether, 300 ether); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](1), - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](1), authSignature: _authSignature }) ); vm.stopPrank(); @@ -338,8 +306,9 @@ contract AlephVaultDepositSettlementTest is BaseTest { assertEq(underlyingToken.balanceOf(address(custodian)), 300 ether); } - function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsGreaterThanZero_shouldSucceed_singleBatch_settleInLeadSeries( - ) public { + function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsGreaterThanZero_shouldSucceed_singleBatch_settleInLeadSeries() + public + { // roll the block forward to make future batches available vm.warp(block.timestamp + 2 days + 1); @@ -371,10 +340,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { emit IAlephVaultSettlement.SettleDeposit(1, 0, 0, _currentBatchId, 300 ether, 300 ether, 300 ether); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](1), - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](1), authSignature: _authSignature }) ); vm.stopPrank(); @@ -394,8 +360,9 @@ contract AlephVaultDepositSettlementTest is BaseTest { assertEq(underlyingToken.balanceOf(address(custodian)), 300 ether); } - function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsGreaterThanZero_shouldSucceed_multipleBatches( - ) public { + function test_settleDeposit_whenCallerIsOracle_whenFlowIsUnpaused_whenAmountToSettleIsGreaterThanZero_shouldSucceed_multipleBatches() + public + { // roll the block forward to make future batches available vm.warp(block.timestamp + 3 days + 1); @@ -433,10 +400,7 @@ contract AlephVaultDepositSettlementTest is BaseTest { emit IAlephVaultSettlement.SettleDeposit(1, 0, 0, _currentBatchId, 600 ether, 600 ether, 600 ether); vault.settleDeposit( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](1), - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](1), authSignature: _authSignature }) ); vm.stopPrank(); diff --git a/test/units/fee/Accountant.unit.t.sol b/test/units/fee/Accountant.unit.t.sol index 15dde8d..a7f9e75 100644 --- a/test/units/fee/Accountant.unit.t.sol +++ b/test/units/fee/Accountant.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAccessControl} from "openzeppelin-contracts/contracts/access/IAccessControl.sol"; diff --git a/test/units/fee/FeeManager.unit.t.sol b/test/units/fee/FeeManager.unit.t.sol index 0110e4b..c848d8b 100644 --- a/test/units/fee/FeeManager.unit.t.sol +++ b/test/units/fee/FeeManager.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAccessControl} from "openzeppelin-contracts/contracts/access/IAccessControl.sol"; @@ -46,8 +46,9 @@ contract FeeManagerTest is BaseTest { assertEq(vault.sharesOf(1, 0, performanceFeeRecipient), 0); } - function test_accumalateFees_whenNewTotalAssetsIsGreaterThan0_givenHighWaterMarkIsHigherThanPricePerShare_shouldAccumalateOnlyManagementFees( - ) public { + function test_accumalateFees_whenNewTotalAssetsIsGreaterThan0_givenHighWaterMarkIsHigherThanPricePerShare_shouldAccumalateOnlyManagementFees() + public + { // set up context uint48 currentBatchId = 100; uint48 lastFeePaidId = 0; @@ -95,8 +96,9 @@ contract FeeManagerTest is BaseTest { assertEq(vault.sharesOf(1, 0, performanceFeeRecipient), 0); } - function test_accumalateFees_whenNewTotalAssetsIsGreaterThan0_givenHighWaterMarkIsLowerThanPricePerShare_shouldAccumalateBothPerformanceAndManagementFees( - ) public { + function test_accumalateFees_whenNewTotalAssetsIsGreaterThan0_givenHighWaterMarkIsLowerThanPricePerShare_shouldAccumalateBothPerformanceAndManagementFees() + public + { // set up context uint48 currentBatchId = 100; uint48 lastFeePaidId = 0; diff --git a/test/units/migration/MigrationManager.unit.t.sol b/test/units/migration/MigrationManager.unit.t.sol index e4f7431..3d61214 100644 --- a/test/units/migration/MigrationManager.unit.t.sol +++ b/test/units/migration/MigrationManager.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAccessControl} from "openzeppelin-contracts/contracts/access/IAccessControl.sol"; @@ -51,8 +51,9 @@ contract MigrationManagerTest is BaseTest { vault.migrateOperationsMultisig(newOperationsMultisig); } - function test_migrateOperationsMultisig_whenNewOperationsMultisigIsAddress0_revertsWithInvalidOperationsMultisigAddress( - ) public { + function test_migrateOperationsMultisig_whenNewOperationsMultisigIsAddress0_revertsWithInvalidOperationsMultisigAddress() + public + { // migrate operations multisig vm.prank(vaultFactory); vm.expectRevert(IMigrationManager.InvalidOperationsMultisigAddress.selector); diff --git a/test/units/redeem/AlephVaultRedeem.unit.t.sol b/test/units/redeem/AlephVaultRedeem.unit.t.sol index 6509798..bd5e9a0 100644 --- a/test/units/redeem/AlephVaultRedeem.unit.t.sol +++ b/test/units/redeem/AlephVaultRedeem.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAccessControl} from "openzeppelin-contracts/contracts/access/IAccessControl.sol"; @@ -187,8 +187,9 @@ contract AlephVaultRedeemTest is BaseTest { assertEq(vault.usersToRedeemAt(1, _batchId)[0], mockUser_1); } - function test_requestRedeem_whenFlowIsUnpaused_whenUserHasSufficientSharesToRedeem_shouldSucceed_whenUserBalanceIsLessThanMinRedeemAmount( - ) public { + function test_requestRedeem_whenFlowIsUnpaused_whenUserHasSufficientSharesToRedeem_shouldSucceed_whenUserBalanceIsLessThanMinRedeemAmount() + public + { // roll the block forward to make batch available vm.warp(block.timestamp + 1 days + 1); diff --git a/test/units/redeem/AlephVaultSettlement.unit.t.sol b/test/units/redeem/AlephVaultSettlement.unit.t.sol index be19cb4..656cd8a 100644 --- a/test/units/redeem/AlephVaultSettlement.unit.t.sol +++ b/test/units/redeem/AlephVaultSettlement.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAccessControl} from "openzeppelin-contracts/contracts/access/IAccessControl.sol"; @@ -56,10 +56,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { ); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 0, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 0, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -70,10 +67,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.expectRevert(IAlephVault.InvalidShareClass.selector); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 0, - toBatchId: 0, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 0, toBatchId: 0, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -88,10 +82,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.expectRevert(IAlephPausable.FlowIsCurrentlyPaused.selector); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 0, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 0, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -102,10 +93,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.expectRevert(IAlephVaultSettlement.InvalidToBatchId.selector); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 1, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 1, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -122,10 +110,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.expectRevert(IAlephVaultSettlement.NoRedeemsToSettle.selector); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 1, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 1, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -136,10 +121,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.expectRevert(IAlephVaultSettlement.NoRedeemsToSettle.selector); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: 0, - newTotalAssets: new uint256[](1), - authSignature: authSignature_1 + classId: 1, toBatchId: 0, newTotalAssets: new uint256[](1), authSignature: authSignature_1 }) ); } @@ -154,10 +136,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.expectRevert(IAlephVaultSettlement.InvalidNewTotalAssets.selector); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](2), - authSignature: authSignature_1 + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](2), authSignature: authSignature_1 }) ); } @@ -176,10 +155,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.expectRevert(AuthLibrary.InvalidAuthSignature.selector); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: new uint256[](1), - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: new uint256[](1), authSignature: _authSignature }) ); } @@ -204,10 +180,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.prank(oracle); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: _newTotalAssets, - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: _newTotalAssets, authSignature: _authSignature }) ); @@ -235,10 +208,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.prank(oracle); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: _newTotalAssets, - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: _newTotalAssets, authSignature: _authSignature }) ); @@ -267,10 +237,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vm.expectRevert(abi.encodeWithSelector(IAlephVaultSettlement.InsufficientAssetsToSettle.selector, 100 ether)); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: _newTotalAssets, - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: _newTotalAssets, authSignature: _authSignature }) ); } @@ -325,10 +292,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { emit IAlephVaultSettlement.SettleRedeem(1, 0, _currentBatchId); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: _newTotalAssets, - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: _newTotalAssets, authSignature: _authSignature }) ); vm.stopPrank(); @@ -410,10 +374,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { emit IAlephVaultSettlement.SettleRedeem(1, 0, _currentBatchId); vault.settleRedeem( IAlephVaultSettlement.SettlementParams({ - classId: 1, - toBatchId: _currentBatchId, - newTotalAssets: _newTotalAssets, - authSignature: _authSignature + classId: 1, toBatchId: _currentBatchId, newTotalAssets: _newTotalAssets, authSignature: _authSignature }) ); vm.stopPrank(); @@ -467,9 +428,7 @@ contract AlephVaultRedeemSettlementTest is BaseTest { vault.forceRedeem(mockUser_1); } - function test_forceRedeem_whenVaultHasSufficientBalanceToSettlePendingDepositsAndWithdrawls_shouldSucceed() - public - { + function test_forceRedeem_whenVaultHasSufficientBalanceToSettlePendingDepositsAndWithdrawls_shouldSucceed() public { // roll the block forward to make future batch available vm.warp(block.timestamp + 3 days + 1); diff --git a/test/units/setUp/VaultSetUp.t.sol b/test/units/setUp/VaultSetUp.t.sol index a28f866..2fd00a6 100644 --- a/test/units/setUp/VaultSetUp.t.sol +++ b/test/units/setUp/VaultSetUp.t.sol @@ -112,8 +112,7 @@ contract VaultSetUpTest is BaseTest { vm.expectRevert(AlephVaultBase.InvalidConstructorParams.selector); new FeeManager( IFeeManager.FeeConstructorParams({ - managementFeeTimelock: 0, - performanceFeeTimelock: defaultConfigParams.performanceFeeTimelock + managementFeeTimelock: 0, performanceFeeTimelock: defaultConfigParams.performanceFeeTimelock }), defaultConfigParams.batchDuration ); @@ -123,8 +122,7 @@ contract VaultSetUpTest is BaseTest { vm.expectRevert(AlephVaultBase.InvalidConstructorParams.selector); new FeeManager( IFeeManager.FeeConstructorParams({ - managementFeeTimelock: defaultConfigParams.managementFeeTimelock, - performanceFeeTimelock: 0 + managementFeeTimelock: defaultConfigParams.managementFeeTimelock, performanceFeeTimelock: 0 }), defaultConfigParams.batchDuration ); diff --git a/test/units/setters/AlephVault/AlephVault.unit.t.sol b/test/units/setters/AlephVault/AlephVault.unit.t.sol index e233d13..a9f087d 100644 --- a/test/units/setters/AlephVault/AlephVault.unit.t.sol +++ b/test/units/setters/AlephVault/AlephVault.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {IAccessControl} from "openzeppelin-contracts/contracts/access/IAccessControl.sol"; @@ -35,7 +35,7 @@ contract AlephVault_Unit_Test is BaseTest { // create share class params IAlephVault.ShareClassParams memory _shareClassParams = - defaultInitializationParams.userInitializationParams.shareClassParams; + defaultInitializationParams.userInitializationParams.shareClassParams; // set is deposit auth enabled vm.prank(nonAuthorizedUser); @@ -50,7 +50,7 @@ contract AlephVault_Unit_Test is BaseTest { function test_createShareClass_revertsWhenManagementFeeIsGreaterThanMAXIMUM_MANAGEMENT_FEE() public { // create share class params IAlephVault.ShareClassParams memory _shareClassParams = - defaultInitializationParams.userInitializationParams.shareClassParams; + defaultInitializationParams.userInitializationParams.shareClassParams; _shareClassParams.managementFee = vault.MAXIMUM_MANAGEMENT_FEE() + 1; // create share class @@ -62,7 +62,7 @@ contract AlephVault_Unit_Test is BaseTest { function test_createShareClass_revertsWhenPerformanceFeeIsGreaterThanMAXIMUM_PERFORMANCE_FEE() public { // create share class params IAlephVault.ShareClassParams memory _shareClassParams = - defaultInitializationParams.userInitializationParams.shareClassParams; + defaultInitializationParams.userInitializationParams.shareClassParams; _shareClassParams.performanceFee = vault.MAXIMUM_PERFORMANCE_FEE() + 1; // create share class @@ -74,7 +74,7 @@ contract AlephVault_Unit_Test is BaseTest { function test_createShareClass_revertsWhenMinDepositAmountIsZero() public { // create share class params IAlephVault.ShareClassParams memory _shareClassParams = - defaultInitializationParams.userInitializationParams.shareClassParams; + defaultInitializationParams.userInitializationParams.shareClassParams; _shareClassParams.minDepositAmount = 0; // create share class @@ -86,7 +86,7 @@ contract AlephVault_Unit_Test is BaseTest { function test_createShareClass_revertsWhenMinRedeemAmountIsZero() public { // create share class params IAlephVault.ShareClassParams memory _shareClassParams = - defaultInitializationParams.userInitializationParams.shareClassParams; + defaultInitializationParams.userInitializationParams.shareClassParams; _shareClassParams.minRedeemAmount = 0; // create share class @@ -101,7 +101,7 @@ contract AlephVault_Unit_Test is BaseTest { // create share class params IAlephVault.ShareClassParams memory _shareClassParams = - defaultInitializationParams.userInitializationParams.shareClassParams; + defaultInitializationParams.userInitializationParams.shareClassParams; // create share class vm.prank(manager); diff --git a/test/units/setters/AlephVaultDeposit/AlephVaultDeposit.unit.t.sol b/test/units/setters/AlephVaultDeposit/AlephVaultDeposit.unit.t.sol index 78d0a9a..54e54de 100644 --- a/test/units/setters/AlephVaultDeposit/AlephVaultDeposit.unit.t.sol +++ b/test/units/setters/AlephVaultDeposit/AlephVaultDeposit.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Time} from "openzeppelin-contracts/contracts/utils/types/Time.sol"; diff --git a/test/units/setters/AlephVaultRedeem/AlephVaultRedeem.unit.t.sol b/test/units/setters/AlephVaultRedeem/AlephVaultRedeem.unit.t.sol index bd677b7..ee26b4a 100644 --- a/test/units/setters/AlephVaultRedeem/AlephVaultRedeem.unit.t.sol +++ b/test/units/setters/AlephVaultRedeem/AlephVaultRedeem.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Time} from "openzeppelin-contracts/contracts/utils/types/Time.sol"; diff --git a/test/units/setters/FeeManager/FeeManager.unit.t.sol b/test/units/setters/FeeManager/FeeManager.unit.t.sol index aa49fea..e8e599c 100644 --- a/test/units/setters/FeeManager/FeeManager.unit.t.sol +++ b/test/units/setters/FeeManager/FeeManager.unit.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Time} from "openzeppelin-contracts/contracts/utils/types/Time.sol"; diff --git a/test/utils/BaseTest.t.sol b/test/utils/BaseTest.t.sol index fda9bf5..41023e5 100644 --- a/test/utils/BaseTest.t.sol +++ b/test/utils/BaseTest.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Test, console} from "forge-std/Test.sol"; @@ -174,8 +174,7 @@ contract BaseTest is Test { }); defaultAccountantInitializationParams = IAccountant.InitializationParams({ - operationsMultisig: defaultInitializationParams.operationsMultisig, - alephTreasury: makeAddr("alephTreasury") + operationsMultisig: defaultInitializationParams.operationsMultisig, alephTreasury: makeAddr("alephTreasury") }); } @@ -241,8 +240,7 @@ contract BaseTest is Test { feeManagerImplementation: address( new FeeManager( IFeeManager.FeeConstructorParams({ - managementFeeTimelock: managementFeeTimelock, - performanceFeeTimelock: performanceFeeTimelock + managementFeeTimelock: managementFeeTimelock, performanceFeeTimelock: performanceFeeTimelock }), batchDuration ) diff --git a/test/utils/Mocks.t.sol b/test/utils/Mocks.t.sol index ea67fe0..acd9dc5 100644 --- a/test/utils/Mocks.t.sol +++ b/test/utils/Mocks.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; /* - ______ __ __ - / \ / | / | -/$$$$$$ |$$ | ______ ______ $$ |____ -$$ |__$$ |$$ | / \ / \ $$ \ + ______ __ __ + / \ / | / | +/$$$$$$ |$$ | ______ ______ $$ |____ +$$ |__$$ |$$ | / \ / \ $$ \ $$ $$ |$$ |/$$$$$$ |/$$$$$$ |$$$$$$$ | $$$$$$$$ |$$ |$$ $$ |$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$$$/ $$ |__$$ |$$ | $$ | $$ | $$ |$$ |$$ |$$ $$/ $$ | $$ | -$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ - $$ | - $$ | - $$/ +$$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ + $$ | + $$ | + $$/ */ import {Test} from "forge-std/Test.sol";