RustFund

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

Missing Error Codes for Invalid Cases

Summary


The contract lacks error codes for several invalid cases, such as invalid fund, invalid amount, invalid goal, goal not reached, and no contribution found. This makes it difficult to handle these cases gracefully.

Vulnerability Details

The ErrorCode enum does not include variants for the following cases:

  • Invalid fund

  • Invalid amount

  • Invalid goal

  • Goal not reached

  • No contribution found

Impact

The program cannot handle these cases gracefully, leading to potential confusion and incorrect behavior.

Tools Used

manual review

Recommendations

Add the following error variants to the ErrorCode enum

#[error_code]
pub enum ErrorCode {
// Existing variants...
#[msg("Invalid fund")]
InvalidFund,
#[msg("Invalid amount")]
InvalidAmount,
#[msg("Invalid goal")]
InvalidGoal,
#[msg("Goal not reached")]
GoalNotReached,
#[msg("No contribution found")]
NoContributionFound,
}
Updates

Appeal created

bube Lead Judge 3 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.