You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
different cTokens use different InterestRateModels
in Legacy, getBorrowRate returns 2 uint256 values
in JumpRateModel, getBorrowRate returns 1 uint256
/**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amount of reserves the market has
* @return error code (0 = no error), The borrow rate per block (as a percentage, and scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint,uint);
vs
/**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amnount of reserves the market has
* @return The borrow rate per block (as a percentage, and scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);
therefore, we need separate token adapters depending on which InterestRateModel a cToken uses. we should modify the LibCompound and add another function account for this.
we should also check the codehash of the InterestRateModel to be sure it hasn't changed without us noticing (and revert the call with InvalidState if it has)
No description provided.
The text was updated successfully, but these errors were encountered: