From 49ec8d3aa12e580776df62750ca5ae72f3c4e96f Mon Sep 17 00:00:00 2001 From: kasperpawlowski Date: Mon, 8 Jul 2024 14:54:21 +0100 Subject: [PATCH] change checkAccountStatus function mutability --- src/EVault/EVault.sol | 2 +- src/EVault/IEVault.sol | 2 +- src/EVault/modules/RiskManager.sol | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/EVault/EVault.sol b/src/EVault/EVault.sol index d1149c27..68ddc527 100644 --- a/src/EVault/EVault.sol +++ b/src/EVault/EVault.sol @@ -151,7 +151,7 @@ contract EVault is Dispatch { function disableController() public virtual override use(MODULE_RISKMANAGER) {} - function checkAccountStatus(address account, address[] calldata collaterals) public virtual override returns (bytes4) { return super.checkAccountStatus(account, collaterals); } + function checkAccountStatus(address account, address[] calldata collaterals) public view virtual override returns (bytes4) { return super.checkAccountStatus(account, collaterals); } function checkVaultStatus() public virtual override returns (bytes4) { return super.checkVaultStatus(); } diff --git a/src/EVault/IEVault.sol b/src/EVault/IEVault.sol index 9ed1f988..63682847 100644 --- a/src/EVault/IEVault.sol +++ b/src/EVault/IEVault.sol @@ -325,7 +325,7 @@ interface IRiskManager is IEVCVault { /// @return magicValue Must return the bytes4 magic value 0xb168c58f (which is a selector of this function) when /// account status is valid, or revert otherwise. /// @dev Only callable by EVC during status checks - function checkAccountStatus(address account, address[] calldata collaterals) external returns (bytes4); + function checkAccountStatus(address account, address[] calldata collaterals) external view returns (bytes4); /// @notice Checks the status of the vault and reverts if caps are exceeded /// @return magicValue Must return the bytes4 magic value 0x4b3d1223 (which is a selector of this function) when diff --git a/src/EVault/modules/RiskManager.sol b/src/EVault/modules/RiskManager.sol index 20b269b8..b893e796 100644 --- a/src/EVault/modules/RiskManager.sol +++ b/src/EVault/modules/RiskManager.sol @@ -68,6 +68,7 @@ abstract contract RiskManagerModule is IRiskManager, LiquidityUtils { /// `disableController`), but they don't change the vault's storage. function checkAccountStatus(address account, address[] calldata collaterals) public + view virtual reentrantOK onlyEVCChecks