20,000 USDC
View results
Submission Details
Severity: gas
Valid

`setPool()` should check if `p.minLoanSize` < p.poolBalance

Summary

setPool() should check if p.minLoanSize < p.poolBalance. If p.minLoanSize > p.poolBalance,it will cause borrower can not borrow the fund. Because when borrowing , borrow() function will check if (debt < pool.minLoanSize) and if (debt > pool.poolBalance)

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L242

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L134

Impact

It will cause pool useless

Tools Used

manual

Recommendations

check if p.minLoanSize < p.poolBalance

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.