Skip to content

Comprehensive contract error enum #41

Description

@ayshadogo

User Story:
As a developer integrating with the contract, I want every failure mode mapped to a specific typed error so that callers can handle conditions programmatically instead of matching on panic strings.

Acceptance Criteria:

  • #[contracterror] Error enum covering: AlreadyInitialized, NotInitialized, Unauthorized, CampaignEnded, CampaignNotActive, AssetNotAccepted, DonationTooSmall, MilestoneNotFound, MilestoneNotUnlocked, PreviousMilestoneNotReleased, CannotCancelWithFunds, RefundWindowClosed, InvalidGoalAmount, InvalidEndTime, InvalidMilestones, InsufficientContractBalance, Overflow, Reentrant, ContractFrozen
  • Every variant documented with when it's raised and whether it's recoverable (bad input, retry-able) or terminal (indicates a bug/attack)
  • Audit pass confirming no function in the contract panics with an unlabelled string where a typed error applies

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions