Boost _ Folks Finance 34183 - [Smart Contract - Insight] rebalanceUp could be used to lower the user
Description
Impact
Recomendation
function executeRebalanceUp(
mapping(bytes32 => LoanManagerState.UserLoan) storage userLoans,
mapping(uint8 => IHubPool) storage pools,
DataTypes.ExecuteRebalanceParams memory params
) external {
LoanManagerState.UserLoan storage userLoan = userLoans[params.loanId];
// user cannot rebalance borrow which they don't have or is not stable
// borrow present iff loan type created and pool added so no need to check this
if (!userLoan.hasStableBorrowIn(params.poolId)) {
revert NoStableBorrowInLoanForPool(params.loanId, params.poolId);
}
// pool pre-checks and update interest indexes
IHubPool pool = pools[params.poolId];
// @note update index + checks threshold
DataTypes.BorrowPoolParams memory borrowPoolParams = pool.preparePoolForRebalanceUp();
+ if (borrowPoolParams.stableInterestRate < userLoan.stableInterestRate) {
+ revert RateLowerThanPoolRate
+ }
// rebalance the user loan borrow
LoanManagerState.UserLoanBorrow storage loanBorrow = userLoan.borrows[params.poolId];
}Proof of concept
Proof Of Concept
PreviousBoost _ Folks Finance 34179 - [Smart Contract - High] Incorrect Updates to pooldepositDatatotalAmounNextBoost _ Folks Finance 34188 - [Smart Contract - Insight] BridgeRouterHub can add address adapter
Last updated
Was this helpful?