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
13 changes: 13 additions & 0 deletions backstop_vault/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,19 @@ impl BackstopVault {
(shares, queued, cooldown_until)
}

/// Returns the withdrawal cooldown expiration timestamp for `lp`.
///
/// If the LP has no cooldown set, returns 0 (cooldown expired / no deposit yet).
/// If the returned timestamp is > current ledger timestamp, the LP cannot
/// withdraw until that timestamp passes.
/// Issue #533: Surface the cooldown timestamp for off-chain tooling.
pub fn get_withdrawal_cooldown(env: Env, lp: Address) -> u64 {
env.storage()
.persistent()
.get(&DataKey::WithdrawCooldown(lp))
.unwrap_or(0)
}

// ── Private helpers ────────────────────────────────────────────────────────

fn load_total_assets(env: &Env) -> i128 {
Expand Down
22 changes: 0 additions & 22 deletions governor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
//! Stake-weighted Governor for protocol parameter changes.
//!
//! Voting power is derived from solver bond plus delegated stake recorded in
//! `solver_registry` checkpoints. Power is snapshotted at proposal creation so
//! stake acquired after the snapshot cannot influence an in-flight vote
//! (anti-flash-stake). Passed proposals are queued into the
//! `TimelockController` and executed after the timelock delay.
//!
//! ## Voting power source (v1)
//!
//! The governor maintains its own checkpoint history per account, fed by an
//! explicit `sync_power` call. `sync_power` reads the account's current bond
//! from `solver_registry` (the v1 source of truth) and appends a `Checkpoint`
//! at the current ledger. This keeps the governor self-contained (no
//! cross-contract read at vote time) while still deriving power from the
//! registry's bond data.
//!
//! Delegation (bond + delegated stake) is a documented follow-up and is out of
//! scope for v1: only the account's own bond contributes to its power.

#![no_std]

use soroban_sdk::{
contract, contracterror, contractimpl, contracttype, symbol_short, Address, BytesN, Env,
IntoVal, Symbol, Val, Vec,
Expand Down
Loading