From 28014bd6ca20adee63cf398a2a492e1865ef57ac Mon Sep 17 00:00:00 2001 From: MerlinEgalite Date: Thu, 10 Aug 2023 18:19:48 +0200 Subject: [PATCH] refactor: borrow rate naming --- src/Blue.sol | 6 +++--- src/interfaces/IIrm.sol | 2 +- src/mocks/IrmMock.sol | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Blue.sol b/src/Blue.sol index 5f811bddf..85e4eacea 100644 --- a/src/Blue.sol +++ b/src/Blue.sol @@ -410,8 +410,8 @@ contract Blue is IBlue { uint256 marketTotalBorrow = totalBorrow[id]; if (marketTotalBorrow != 0) { - uint256 prevBorrowRate = IIrm(market.irm).prevBorrowRate(market); - uint256 accruedInterests = marketTotalBorrow.wMulDown(prevBorrowRate.wTaylorCompounded(elapsed)); + uint256 borrowRate = IIrm(market.irm).borrowRate(market); + uint256 accruedInterests = marketTotalBorrow.wMulDown(borrowRate.wTaylorCompounded(elapsed)); totalBorrow[id] = marketTotalBorrow + accruedInterests; totalSupply[id] += accruedInterests; @@ -424,7 +424,7 @@ contract Blue is IBlue { totalSupplyShares[id] += feeShares; } - emit EventsLib.AccrueInterests(id, prevBorrowRate, accruedInterests, feeShares); + emit EventsLib.AccrueInterests(id, borrowRate, accruedInterests, feeShares); } lastUpdate[id] = block.timestamp; diff --git a/src/interfaces/IIrm.sol b/src/interfaces/IIrm.sol index 3b4b4dddd..12bc6c82d 100644 --- a/src/interfaces/IIrm.sol +++ b/src/interfaces/IIrm.sol @@ -9,5 +9,5 @@ import {Market} from "./IBlue.sol"; /// @notice Interface that IRMs used by Blue must implement. interface IIrm { /// @notice Returns the borrow rate of a `market`. - function prevBorrowRate(Market memory market) external returns (uint256); + function borrowRate(Market memory market) external returns (uint256); } diff --git a/src/mocks/IrmMock.sol b/src/mocks/IrmMock.sol index ab51b32c0..9ab5a07f3 100644 --- a/src/mocks/IrmMock.sol +++ b/src/mocks/IrmMock.sol @@ -17,7 +17,7 @@ contract IrmMock is IIrm { BLUE = blue; } - function prevBorrowRate(Market memory market) external view returns (uint256) { + function borrowRate(Market memory market) external view returns (uint256) { Id id = market.id(); uint256 utilization = BLUE.totalBorrow(id).wDivDown(BLUE.totalSupply(id));