Problem
The contract currently uses assert! with string literals (e.g., "Deposit amount must be strictly positive"), which inflates the compiled WASM size and makes programmatic error handling difficult for the SDK.
Expected behavior
A #[contracterror] enum is created to define structured error codes, and standard assert! calls are replaced with Soroban's native error handling patterns.
Files to update
src/lib.rs
src/vault.rs
src/strategy.rs
Project relevance
This significantly optimizes the final WASM footprint and allows the yieldstream-sdk to catch and parse deterministic error codes for better frontend UI feedback.
Acceptance criteria
Problem
The contract currently uses
assert!with string literals (e.g.,"Deposit amount must be strictly positive"), which inflates the compiled WASM size and makes programmatic error handling difficult for the SDK.Expected behavior
A
#[contracterror]enum is created to define structured error codes, and standardassert!calls are replaced with Soroban's native error handling patterns.Files to update
src/lib.rssrc/vault.rssrc/strategy.rsProject relevance
This significantly optimizes the final WASM footprint and allows the
yieldstream-sdkto catch and parse deterministic error codes for better frontend UI feedback.Acceptance criteria
VaultErroris defined with#[contracterror]