Summary
get_escrow(), release(), and refund() all use .expect("Escrow not found"), which panics with a generic message. Consider using
soroban_sdk::contracterror for typed, documented error codes instead.
Difficulty
Intermediate — estimated effort: ~1-2 days. Labels: contracts, rust, soroban, intermediate
Where to Work
- See relevant files referenced in the description above.
How to Approach This
cd contracts/escrow and make sure you can build first: cargo build --target wasm32-unknown-unknown --release.
- Read the module-level doc comment at the top of
src/lib.rs for the design context before changing behavior.
- Make your change directly in
src/lib.rs (or add a new module if it's substantial, e.g. src/errors.rs).
- Add or update tests in
src/test.rs using the Soroban Env::default() test harness — see the Soroban SDK docs for Env::register_contract and Address::generate patterns.
- Run
cargo test locally and confirm all tests pass before opening a PR.
- Run
cargo clippy -- -D warnings and cargo fmt --check and fix anything flagged.
Acceptance Criteria
Notes for Contributors
Comment on this issue before starting so it can be assigned to you and duplicate work is avoided. If the described approach doesn't quite fit once you're in the code (e.g. the file has moved, or there's a cleaner way to do it), that's fine — leave a comment explaining the deviation in your PR description rather than silently changing scope.
Summary
get_escrow(),release(), andrefund()all use.expect("Escrow not found"), which panics with a generic message. Consider usingsoroban_sdk::contracterrorfor typed, documented error codes instead.Difficulty
Intermediate — estimated effort: ~1-2 days. Labels:
contracts,rust,soroban,intermediateWhere to Work
How to Approach This
cd contracts/escrowand make sure you can build first:cargo build --target wasm32-unknown-unknown --release.src/lib.rsfor the design context before changing behavior.src/lib.rs(or add a new module if it's substantial, e.g.src/errors.rs).src/test.rsusing the SorobanEnv::default()test harness — see the Soroban SDK docs forEnv::register_contractandAddress::generatepatterns.cargo testlocally and confirm all tests pass before opening a PR.cargo clippy -- -D warningsandcargo fmt --checkand fix anything flagged.Acceptance Criteria
contracts/escrow/src/lib.rs(or the relevant module).contracts/escrow/src/test.rscovering both success and failure paths.cargo testpasses locally.cargo clippy -- -D warningsandcargo fmt --checkpass with no new warnings.///) updated to match the new behavior.contracts/escrow/README.mdupdated if this issue changes the contract's public interface or design decisions documented there.Notes for Contributors
Comment on this issue before starting so it can be assigned to you and duplicate work is avoided. If the described approach doesn't quite fit once you're in the code (e.g. the file has moved, or there's a cleaner way to do it), that's fine — leave a comment explaining the deviation in your PR description rather than silently changing scope.