The getUserCollateralValue() function iterates over user.nftTokenIds without a cap, risking gas limit exceedance with many NFTs. This medium-impact, medium-likelihood issue could lock user assets or debt positions by blocking key functions like withdrawNFT() or borrow().
The function loops through all user NFTs without a limit. Example:
User deposits 1000 NFTs (10 crvUSD each, total 10,000 crvUSD).
getUserCollateralValue() exceeds the block gas limit (e.g., 30M on Ethereum).
withdrawNFT() or borrow() (8000 crvUSD) reverts, locking 10,000 crvUSD in collateral.
This blocks critical operations as NFT count grows.
Users could lose access to significant collateral (e.g., 10,000 crvUSD), a medium-impact issue. The medium likelihood reflects realistic user behavior of depositing multiple NFTs, posing a growing risk as adoption increases.
Manual Code Review: To verify iteration in getUserCollateralValue().
Cap NFT deposits per user:
LightChaser L-36 and M-02 covers it.
LightChaser L-36 and M-02 covers it.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.