Contract 4e4d40ce20b2b761edfc79299229458452f576ef128d9c5798af4e6d4bf2354e

← Back to Index 📥 Download WASM

Meta

cyphras_vk mainnet sha256:1194da670701c822fcf390c82d97fd3f7e7c8773546e83def31be0681979768e
rssdkver 26.1.1#8ac18efb681a1c0b4b85a38c5a380300344e3f39
rsver 1.96.0

Instances

  • CDE6MIQAS4P3YXAH6SFFYUP5XPPVPXXAVCTO5ATEUUTJW376KUTKQK7Z

Interface

fn exit(env: soroban_sdk::Env, id: u64) -> Option

The ASP refuses a pending deposit with a public reason code. Flagging a flagged deposit replaces the reason and keeps the time of the first flag, so it cannot postpone a refund. Code 0 is reserved for a depositor's cancellation.

fn flag(env: soroban_sdk::Env, id: u64, reason: u32) -> Result<(), soroban_sdk::Error>

The guardian stops shield, transact, admit, attest, release and claim for 72 hours. The next halt is allowed 7 days after this one ends, so users always get a week to exit between halts.

fn halt(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

Inserts the commitments of every listed deposit that is eligible: pending, not flagged, attested, and past its delay. Others are skipped. IDs must be strictly ascending. Returns the admitted IDs.

fn admit(
    env: soroban_sdk::Env,
    ids: soroban_sdk::Vec,
) -> Result, soroban_sdk::Error>

Anyone moves the parts of a stranded exit whose party can receive now, judged as transact judges it, back into the exit queue, at its tail, as a new exit that release pays in turn like any other, and returns its ID. A part whose party still cannot receive stays stranded. Fails with NothingClaimable when no part can move. Refused while halted; works while paused.

fn claim(env: soroban_sdk::Env, id: u64) -> Result

The ASP asserts that every unflagged deposit with an ID up to up_to passed screening. Attestations only move forward and never past the last deposit.

fn attest(env: soroban_sdk::Env, up_to: u64) -> Result<(), soroban_sdk::Error>

The depositor takes back a deposit that is not yet admitted, flagged or not. Works while halted.

fn cancel(env: soroban_sdk::Env, id: u64) -> Result<(), soroban_sdk::Error>
fn config(env: soroban_sdk::Env) -> Config
fn limits(env: soroban_sdk::Env) -> Limits

Anyone returns a deposit flagged at least a day ago to its depositor. Works while halted.

fn refund(env: soroban_sdk::Env, id: u64) -> Result<(), soroban_sdk::Error>

The guardian ends a halt early. The cooldown then runs from now.

fn resume(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

Queues a deposit of ext.ext_amount from depositor and returns its ID. The commitments enter the tree only when the deposit is admitted.

fn shield(
    env: soroban_sdk::Env,
    proof: TxProof,
    ext: ExtData,
    depositor: soroban_sdk::Address,
) -> Result
fn status(env: soroban_sdk::Env) -> Status

The ASP clears a flag set by mistake, while the deposit is still pending.

fn unflag(env: soroban_sdk::Env, id: u64) -> Result<(), soroban_sdk::Error>
fn pending(env: soroban_sdk::Env, id: u64) -> Option

Anyone pays queued exits from the head of the exit queue, in ID order, until today's outflow window is full or max exits were handled, and returns how many were. Of an exit that does not fit, it pays what does, payout first, and the rest stays at the head for the next day, so no window goes unused. The one exception is a payout to an account that does not exist yet, which is never paid in a part below 1 XLM, the least that creates the account: with less room left, release stops and the exit waits for the next day. When the asset contract refuses a transfer, everything the exit still owes is set aside as a stranded exit for claim, so that a recipient who cannot receive never holds up the exits behind it. While the issuer keeps the vault itself from holding the asset, or the vault holds less than the next payment, it stops with the queue as it is, and fails with VaultCannotPay if it paid nothing. Refused while halted; works while paused.

fn release(env: soroban_sdk::Env, max: u32) -> Result

Anyone extends the instance, the tree entries, the listed pending deposits and the listed queued or stranded exits to the network's maximum TTL. IDs that are no longer pending, queued or stranded are skipped.

fn bump_ttl(
    env: soroban_sdk::Env,
    pending_ids: soroban_sdk::Vec,
    exit_ids: soroban_sdk::Vec,
)
fn is_spent(env: soroban_sdk::Env, nullifier: soroban_sdk::U256) -> bool
fn stranded(env: soroban_sdk::Env, id: u64) -> Option

Settles a transfer (ext_amount == 0) or an unshield (ext_amount < 0). submitter is the relayer, or the user when self-relaying. The payout and the fee are paid at once when no exit is queued and they fit what is left of today's outflow window. Otherwise the exit joins the exit queue and release pays it in turn. Fails with CannotReceive when a party it would pay cannot receive the asset now. An account must exist, except that an XLM payout of at least 1 XLM creates the recipient's account.

fn transact(
    env: soroban_sdk::Env,
    proof: TxProof,
    ext: ExtData,
    submitter: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

The guardian stops or resumes deposits and transfers. Unshields, releases and claims of exits, cancellations and refunds are never paused.

fn set_pause(
    env: soroban_sdk::Env,
    deposits: bool,
    transfers: bool,
) -> Result<(), soroban_sdk::Error>

The guardian changes the limits. A tightening, where min_deposit does not fall and no other field rises, applies at once and cancels any queued loosening; any loosening replaces the queued one and applies 7 days later through apply_limits. max_daily_outflow never decreases, so a full pool can always exit within a week.

fn set_limits(env: soroban_sdk::Env, limits: Limits) -> Result<(), soroban_sdk::Error>

Anyone applies the queued loosening once it is due.

fn apply_limits(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn current_root(env: soroban_sdk::Env) -> soroban_sdk::U256

Runs with the deployment, so the vault never exists unconfigured. domain is derived from the network and the asset contract's name rather than taken as an argument. A build with the testnet-forgeable key refuses to deploy on mainnet.

fn __constructor(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    guardian: soroban_sdk::Address,
    asp: soroban_sdk::Address,
    delay_small: u64,
    delay_large: u64,
    limits: Limits,
) -> Result<(), soroban_sdk::Error>

The guardian drops the queued loosening.

fn cancel_limits(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>
fn is_known_root(env: soroban_sdk::Env, root: soroban_sdk::U256) -> bool
fn queued_limits(env: soroban_sdk::Env) -> Option
fn next_leaf_index(env: soroban_sdk::Env) -> u64

Imports

WebAssembly Text (WAT) ▶