BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

`Function:deposit` lack asset check, leading meaningless function operation

[L-1] Function:deposit lack asset check, leading meaningless function operation

Description

The deposit function calculates the participation fee and attempts to transfer assets from the user, but it does not explicitly check whether the user has enough token balance before proceeding:

uint256 fee = _getParticipationFee(assets);
// No check for IERC20(asset()).balanceOf(msg.sender) >= assets

Impact

  1. If the user has insufficient balance, safeTransferFrom will revert.

  2. The function may appear to succeed in the logic flow before revert, leading to misleading expectations.

  3. Lacks clear, early feedback to the user that their balance is insufficient.

Recommended mitigation

+uint256 balance = IERC20(asset()).balanceOf(msg.sender);
+if (balance < assets) {
+ revert("Insufficient balance to deposit");
+}
Updates

Appeal created

bube Lead Judge 21 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!