diff --git a/contracts/vault/src/lib.rs b/contracts/vault/src/lib.rs index f7937917..45f15a70 100644 --- a/contracts/vault/src/lib.rs +++ b/contracts/vault/src/lib.rs @@ -1,5 +1,18 @@ -//! # Callora Vault Contract deposit/withdraw/deduct/distribute with pause circuit-breaker. #![no_std] +/// # Callora Vault Contract deposit/withdraw/deduct/distribute with pause circuit-breaker. +/// +/// ## Pause Circuit Breaker +/// +/// When the vault is paused: +/// - Deposits are blocked (require_not_paused check) +/// - Single deducts are blocked (require_not_paused check) +/// - Batch deducts are blocked (require_not_paused check) +/// - Owner withdrawals are ALLOWED (for recovery/emergency access) +/// - Owner withdrawals to specific addresses are ALLOWED (for recovery/emergency access) +/// - Admin/owner configuration functions remain available +/// +/// This design allows the vault owner to recover funds while preventing new deposits +/// and deductions during emergency situations or contract upgrades. use soroban_sdk::{contract, contractimpl, contracttype, token, Address, Env, String, Symbol, Vec}; #[contracttype] diff --git a/contracts/vault/src/test.rs b/contracts/vault/src/test.rs index 51332f47..375e5041 100644 --- a/contracts/vault/src/test.rs +++ b/contracts/vault/src/test.rs @@ -255,7 +255,7 @@ fn owner_can_deposit() { client.init(&owner, &usdc, &None, &None, &None, &None, &None); usdc_admin.mint(&owner, &500); - usdc_client.approve(&owner, &vault_address, &500, &1000); + usdc_client.approve(&owner, &vault_address, &300, &1000); let new_balance = client.deposit(&owner, &200); assert_eq!(new_balance, 200);