Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion contracts/vault/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion contracts/vault/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading