Skip to content

Vault: explicit panic! removal sweep — replace any remaining string panics with VaultError #448

Description

@greatest0fallt1me

Description

We migrated most panics to VaultError but a few sites still call panic!("...") (notably in the withdraw_to path and some metadata setters). Sweep contracts/vault/src/lib.rs for any remaining panic! invocations and replace with the appropriate VaultError variant, adding new ones if needed.

Requirements and Context

  • Inventory every panic! and unwrap site under contracts/vault/src/lib.rs
  • Replace with typed errors; add VaultError variants where none fit
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b audit/vault-panic-sweep
  2. Implement changes
    • contracts/vault/src/lib.rs
    • contracts/vault/src/test.rs (assert new codes)
  3. Test and commit
    • cargo test -p callora-vault
    • Cover edge cases: every replaced path tested
    • Include test output and notes in the PR

Example commit message

audit(vault): replace remaining string panics with VaultError variants

Acceptance Criteria

  • Zero panic!( in production paths under contracts/vault/src/lib.rs
  • New VaultError variants documented inline
  • WASM size delta recorded

Guidelines

  • .rs only under contracts/.../src/, NatSpec-style /// doc comments, 95% coverage
  • Use real Soroban SDK idioms; no unwrap() in production paths
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaign taskOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveStellar Wave Program issueauditSecurity audit/reviewenhancementNew feature or improvementrustRust implementationsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions