RustFund

First Flight #36
Beginner FriendlyRust
100 EXP
View results
Submission Details
Severity: low
Invalid

unnecessary storage usage and processing overhead

Summary No Check for Zero Contribution in contribute function leading to unnecessary storage usage and processing overhead

Vulnerability Details : The contribute function lacks a check to prevent zero-value contributions. This allows contributors to make contributions of zero SOL, which may not be meaningful and could clutter the contribution records.

Impact - Contributors can create contribution records without actually contributing any SOL, leading to unnecessary storage usage and processing overhead.

  • This could confuse the refund mechanism, although currently, refunds are broken due to other issues.

Recommendations

+ Add a check to ensure amount > 0 before processing the contribution.
+ if amount == 0 { return Err(ErrorCode::InvalidContributionAmount.into());}
Updates

Appeal created

bube Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

[Invalid] Lack of minimal `amount` in `contribute` function

If user contributes 0 SOL, the `contribution.amount` will be updated with 0 value. There is no impact on the protocol. Also, the new contributers should pay for account creation, therefore there is no incentive someone to create a very huge number of accounts to contribute zero amount.

Support

FAQs

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