Mitigation Audit _ Folks Finance 35089 - [Smart Contract - Insight] Malicious actor can control inte
Description
Brief/Intro
Vulnerability Details
function prepareForBorrow(
HubPoolState.PoolData storage pool,
uint256 amount,
DataTypes.PriceFeed memory priceFeed,
uint256 maxStableRate
) external returns (DataTypes.BorrowPoolParams memory borrowPoolParams) {
// ...
uint256 totalDebt = pool.variableBorrowData.totalAmount + pool.stableBorrowData.totalAmount;
@> if (amount > MathUtils.calcAvailableLiquidity(totalDebt, pool.depositData.totalAmount)) revert InsufficientLiquidity();
if (isStable && !pool.isStableBorrowSupported()) revert StableBorrowNotSupported();
if (pool.isBorrowCapReached(priceFeed, amount)) revert BorrowCapReached();
if (isStable && pool.isStableBorrowCapExceeded(amount)) revert StableBorrowPercentageCapExceeded();
if (isStable && stableBorrowInterestRate > maxStableRate)
revert MaxStableRateExceeded(stableBorrowInterestRate, maxStableRate);
// ...
}Impact Details
References
Proof of concept
Proof of Concept
PreviousMitigation Audit _ Folks Finance 34942 - [Smart Contract - Insight] In function function getTwapPricNextPuffer Finance
Last updated
Was this helpful?