From e881a210ecf33e335e80575aef60d0114da08aa3 Mon Sep 17 00:00:00 2001 From: dglowinski Date: Sun, 24 Mar 2024 08:59:33 +0100 Subject: [PATCH] rename IRM for consistency --- src/EVault/EVault.sol | 2 +- src/EVault/IEVault.sol | 2 +- src/EVault/modules/Governance.sol | 6 +++--- test/unit/evault/EVaultTestBase.t.sol | 6 +++--- test/unit/evault/modules/Governance/interestRates.t.sol | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/EVault/EVault.sol b/src/EVault/EVault.sol index a2e134f5..a6a7d768 100644 --- a/src/EVault/EVault.sol +++ b/src/EVault/EVault.sol @@ -216,7 +216,7 @@ contract EVault is Dispatch { function clearLTV(address collateral) public override virtual use(MODULE_GOVERNANCE) {} - function setIRM(address newModel) public override virtual use(MODULE_GOVERNANCE) {} + function setInterestRateModel(address newModel) public override virtual use(MODULE_GOVERNANCE) {} function setDisabledOps(uint32 newDisabledOps) public override virtual use(MODULE_GOVERNANCE) {} diff --git a/src/EVault/IEVault.sol b/src/EVault/IEVault.sol index 0f96e9b4..44fe9748 100644 --- a/src/EVault/IEVault.sol +++ b/src/EVault/IEVault.sol @@ -400,7 +400,7 @@ interface IGovernance { /// @notice Set a new interest rate model contract /// @param newModel Address of the contract - function setIRM(address newModel) external; + function setInterestRateModel(address newModel) external; /// @notice Set new bitmap indicating which operations should be disabled. Operations are defined in Constants.sol function setDisabledOps(uint32 newDisabledOps) external; diff --git a/src/EVault/modules/Governance.sol b/src/EVault/modules/Governance.sol index ac018aac..a4a736ba 100644 --- a/src/EVault/modules/Governance.sol +++ b/src/EVault/modules/Governance.sol @@ -28,7 +28,7 @@ abstract contract GovernanceModule is IGovernance, Base, BalanceUtils, BorrowUti event GovSetLTV( address indexed collateral, uint48 targetTimestamp, uint16 targetLTV, uint32 rampDuration, uint16 originalLTV ); - event GovSetIRM(address interestRateModel); + event GovSetInterestRateModel(address interestRateModel); event GovSetDisabledOps(uint32 newDisabledOps); event GovSetConfigFlags(uint32 newConfigFlags); event GovSetLockedOps(uint32 newLockedOps); @@ -252,7 +252,7 @@ abstract contract GovernanceModule is IGovernance, Base, BalanceUtils, BorrowUti } /// @inheritdoc IGovernance - function setIRM(address newModel) public virtual nonReentrant governorOnly { + function setInterestRateModel(address newModel) public virtual nonReentrant governorOnly { MarketCache memory marketCache = updateMarket(); marketStorage.interestRateModel = newModel; @@ -262,7 +262,7 @@ abstract contract GovernanceModule is IGovernance, Base, BalanceUtils, BorrowUti logMarketStatus(marketCache, newInterestRate); - emit GovSetIRM(newModel); + emit GovSetInterestRateModel(newModel); } /// @inheritdoc IGovernance diff --git a/test/unit/evault/EVaultTestBase.t.sol b/test/unit/evault/EVaultTestBase.t.sol index 09a80bd7..7bf5fe3f 100644 --- a/test/unit/evault/EVaultTestBase.t.sol +++ b/test/unit/evault/EVaultTestBase.t.sol @@ -106,17 +106,17 @@ contract EVaultTestBase is AssertionsCustomTypes, Test, DeployPermit2 { assetTST2 = new TestERC20("Test Token 2", "TST2", 18, false); eTST = IEVault(factory.createProxy(true, abi.encodePacked(address(assetTST), address(oracle), unitOfAccount))); - eTST.setIRM(address(new IRMTestDefault())); + eTST.setInterestRateModel(address(new IRMTestDefault())); eTST2 = IEVault(factory.createProxy(true, abi.encodePacked(address(assetTST2), address(oracle), unitOfAccount))); - eTST2.setIRM(address(new IRMTestDefault())); + eTST2.setInterestRateModel(address(new IRMTestDefault())); } uint32 internal constant SYNTH_VAULT_DISABLED_OPS = OP_MINT | OP_REDEEM | OP_SKIM | OP_LOOP | OP_DELOOP; function createSynthEVault(address asset) internal returns (IEVault) { IEVault v = IEVault(factory.createProxy(true, abi.encodePacked(address(asset), address(oracle), unitOfAccount))); - v.setIRM(address(new IRMTestDefault())); + v.setInterestRateModel(address(new IRMTestDefault())); v.setDisabledOps(SYNTH_VAULT_DISABLED_OPS); v.setLockedOps(SYNTH_VAULT_DISABLED_OPS); diff --git a/test/unit/evault/modules/Governance/interestRates.t.sol b/test/unit/evault/modules/Governance/interestRates.t.sol index e3ee5cc4..0dafbe98 100644 --- a/test/unit/evault/modules/Governance/interestRates.t.sol +++ b/test/unit/evault/modules/Governance/interestRates.t.sol @@ -45,7 +45,7 @@ contract GovernanceTest is EVaultTestBase { eTST.borrow(5e18, borrower); } - function test_Governance_setIRM_setAddressZero() public { + function test_Governance_setInterestRateModel_setAddressZero() public { assertEq(eTST.totalAssets(), 100e18); skip(1 days); @@ -57,7 +57,7 @@ contract GovernanceTest is EVaultTestBase { vm.stopPrank(); address previousIRM = eTST.interestRateModel(); - eTST.setIRM(address(0)); + eTST.setInterestRateModel(address(0)); // the previous interest accrued is recorded in the accumulator assertEq(beforePause, eTST.totalAssets()); @@ -68,7 +68,7 @@ contract GovernanceTest is EVaultTestBase { assertEq(beforePause, eTST.totalAssets()); // set the previous IRM back - eTST.setIRM(previousIRM); + eTST.setInterestRateModel(previousIRM); // no change yet assertEq(beforePause, eTST.totalAssets());