20,000 USDC
View results
Submission Details
Severity: low

ensure remove amount is smaller than pool balance before update

Summary

ensure remove amount is smaller than pool balance before update

Vulnerability Details

subtraction operation would result in revert

Impact

operation revert

Tools Used

manual

Recommendations

ensure pool balance is bigger than remove amount

function removeFromPool(bytes32 poolId, uint256 amount) external {
if (pools[poolId].lender != msg.sender) revert Unauthorized();
if (amount == 0) revert PoolConfig();
+ if(amount>pools[poolId].poolBalance) revert error();
_updatePoolBalance(poolId, pools[poolId].poolBalance - amount);
// transfer the loan tokens from the contract to the lender
IERC20(pools[poolId].loanToken).transfer(msg.sender, amount);
}

Support

FAQs

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

Give us feedback!