Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing Validation for Zero Refund

Summary

If the user has no balance to refund (neither ERC20 nor Ether), the function might still execute and emit ther Refunded event. This could confuse users or off-chain systems.

Impact

  1. User Confusion:

  • Users might think they successfully refunded assets when, in reality, they had no refundable balance.

  • Thus can create a negative user experience and lead to misunderstanding.

  1. Misleading Logs:

  • The Refunded event will be emitted even when no assets are refunded. Off-chain systems or dApps relying on those logs might misinterpret them as valid refunds, causing inaccurate reporting.

  1. Inefficient Gas Usage:

  • Even if no refunds occurs, the function will still execute and emit an event, leading to unnecessary gas consumption for users.

Tools Used

Manual review

Recommendations

Add a check to ensure the user has refundable assets

Updates

Lead Judging Commences

0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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