Contract 8100be1db26a3d381f5f1f23917b6ea6ec712c9c41f9b962a4ca7e664dc39b64

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#28484880988199233a7e8e87c97cb12dac323cb3
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.94.0

Instances

  • CA4L77JH6BDTOOXLLMF2PI6LBRNMGFT4KAJYIIZ4UKI5WWJILYI2Y6BN
  • CASD2IT3CTDZ3V2M4MCLIWZ6CQ4WX4H5O3QTHL2IXVCUTWNYQV3HAA6M
  • CAW5MQKXBVO4YC5RIVCCYBIPMULRSNBZPSOQZ23ZTOGHK2QBN3QXQPQO
  • CAYX6QA6BXYFK7IOIPPCPBONQ3GZZHR2ETWDX5AAHRUUYFICVALYYOPT
  • CBM7B7LLGYUGKZ35AH3YZULSZLIE7S3QVDZWQ56ED2WVCDZCYAV6HBFT
  • CBQVJY3VE2CPMNAXYHQ5FGK4VMNNUXCEVDZLIZKTPFA6ZE5M4XP4RBCW
  • CBTVYE6TNHKQYN7R7V6RTRI2R3YZOI4DCMLLILDRTQJGVYZODI52QVOT
  • CBXT546WJMTXCRZSPPBVWUWGUICUQFXVFAFIJD3QXWN6M3ACTXMK5HFI
  • CCMDF2KCC6C4PU5Q2W64CIT3YLFLZ3OI7V6HNYKD637KE4TVODXJSDOM
  • CCXZRN6TE275KTVEIMKC7RPEO6QWUCAU2AQWWVQNHLESISKDQ4K3YURG
  • CDE4QFO25I2A7LEPQ3VYGP2CNRI2DF7PE5BAFRBAJ6APLPEY4XGFRNJA
  • CDEH4ZZPIQHA5EDIZX2YAQ27NBCW652CAMALOUG4SGCEFUKPID7X4JQ7
  • CDM6RWYL5G4F32CFNTRWTAJ6TZDSJJUKNQXCXCZB7CECN5ETPXGBHJAN
  • CDWWYO6LPZOG7TIRODAHSB34V5JCZNX62QOTQ26FX4OZSIUDPZ3DK25X

Interface

Deposit tokens into the pool. Returns the leaf index.

fn deposit(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    commitment: soroban_sdk::U256,
) -> u32

Check if a nullifier has been spent.

fn is_spent(env: soroban_sdk::Env, nullifier_hash: soroban_sdk::U256) -> bool

Withdraw tokens from the pool using a ZK proof.

fn withdraw(
    env: soroban_sdk::Env,
    proof: ProofData,
    root: soroban_sdk::U256,
    nullifier_hash: soroban_sdk::U256,
    recipient: soroban_sdk::Address,
    relayer: soroban_sdk::Address,
    fee: i128,
    refund: i128,
)

Initialize the Veil Pool.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    token: soroban_sdk::Address,
    verifier: soroban_sdk::Address,
    denomination: i128,
)

Get the latest Merkle root.

fn get_last_root(env: soroban_sdk::Env) -> soroban_sdk::U256

Check if a Merkle root is known.

fn is_known_root(env: soroban_sdk::Env, root: soroban_sdk::U256) -> bool

Withdraw tokens from the pool and swap to a different token via the router.

The ZK proof binds recipient as an anti-frontrun constraint. token_out and min_amount_out are user preferences — not security-critical — because funds can only go to the proof-bound recipient regardless of swap params.

fn withdraw_swap(
    env: soroban_sdk::Env,
    proof: ProofData,
    root: soroban_sdk::U256,
    nullifier_hash: soroban_sdk::U256,
    recipient: soroban_sdk::Address,
    relayer: soroban_sdk::Address,
    fee: i128,
    refund: i128,
    token_out: soroban_sdk::Address,
    min_amount_out: i128,
)

Get the next leaf index (total deposits).

fn get_next_index(env: soroban_sdk::Env) -> u32

Set the swap router contract address. Admin-only.

fn set_swap_router(env: soroban_sdk::Env, router: soroban_sdk::Address)

Get the fixed denomination amount.

fn get_denomination(env: soroban_sdk::Env) -> i128

Deposit with an encrypted note stored on-chain.

fn deposit_with_note(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    commitment: soroban_sdk::U256,
    encrypted_note: soroban_sdk::Bytes,
) -> u32

Get an encrypted note by leaf index.

fn get_encrypted_note(env: soroban_sdk::Env, leaf_index: u32) -> soroban_sdk::Bytes

Imports

WebAssembly Text (WAT) ▶