Summary
open creates a vault and withdraw takes funds out, but nothing removes the entry
(contracts/rent_vault/src/lib.rs). An owner who is finished with a target can drain the balance to
zero and still leaves a DataKey::Vault entry behind, which they keep paying rent on and which
open will refuse to replace.
Acceptance Criteria
Tech Stack
Rust (edition 2021, toolchain 1.93.0 pinned in rust-toolchain.toml), soroban-sdk 27.0.4,
target wasm32v1-none. Build with stellar contract build, never cargo build. Tests are
#[cfg(test)] modules on Env::default(); run them with cargo test --all.
Summary
opencreates a vault andwithdrawtakes funds out, but nothing removes the entry(
contracts/rent_vault/src/lib.rs). An owner who is finished with a target can drain the balance tozero and still leaves a
DataKey::Vaultentry behind, which they keep paying rent on and whichopenwill refuse to replace.Acceptance Criteria
close_vault(env, target)exists, authorized by the vault owner.2xxrange, so funds cannot be stranded.
get_vaultreturnsNoneandopensucceeds for the same target.#[contractevent]is emitted.who is not the owner.
Tech Stack
Rust (edition 2021, toolchain 1.93.0 pinned in
rust-toolchain.toml),soroban-sdk27.0.4,target
wasm32v1-none. Build withstellar contract build, nevercargo build. Tests are#[cfg(test)]modules onEnv::default(); run them withcargo test --all.