Skip to content

Commit

Permalink
rename IRM for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
dglowinski committed Mar 24, 2024
1 parent 2a9f5e5 commit e881a21
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/EVault/EVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand Down
2 changes: 1 addition & 1 deletion src/EVault/IEVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/EVault/modules/Governance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -262,7 +262,7 @@ abstract contract GovernanceModule is IGovernance, Base, BalanceUtils, BorrowUti

logMarketStatus(marketCache, newInterestRate);

emit GovSetIRM(newModel);
emit GovSetInterestRateModel(newModel);
}

/// @inheritdoc IGovernance
Expand Down
6 changes: 3 additions & 3 deletions test/unit/evault/EVaultTestBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions test/unit/evault/modules/Governance/interestRates.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
Expand All @@ -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());

Expand Down

0 comments on commit e881a21

Please sign in to comment.