Skip to content

[vault-contract] Improve error handling and type safety (low severity) #32

@Villarley

Description

@Villarley

Based on SECURITY_AUDIT_VAULT_CONTRACT-V1.0.0.md (findings F-11, F-12, F-13).

Severity: Low

Summary

Validate non-negative amounts, unify getter behavior, and make preview_claim return Result.

Acceptance criteria

  • Validate roi_percentage >= 0 and amount inputs in constructor (F-11)
  • Unify unwrap_or vs expect policy across getters (F-12)
  • Change preview_claim to Result<ClaimPreview, ContractError> or document assumptions (F-13)
  • Tests pass

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions