Contract f4b38fe7cefb4c3d71f3e7d82e8a375f32984ebc3f8c8226ab0905ce204d697f

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.3.0#a35990025247146e24cb9e1deda063f17f3e441d
rsver 1.94.0-nightly

Instances

  • CA43JGSU5EBTJZIEJ6DYT6BS4KHADZHOLPNTUKQ7R6K6YRJM5VSBYQGH
  • CA5274ABRG3DLJ63LU2M3PXQZNTSFB3PBMXHGKHEBSGK2BJGJUXBQ4JO
  • CACC6PCSX5PPNTKVMKXK6IZVJSH4FGC4T7OOQTYIGPE5DH7GV7BGGLZO
  • CADV5JCENXDDP35OMYNVGQNTT3P2LHRNJKOZG5C6CNIYNKXIMX4CDMDM
  • CAGEPBY7ZQQGSSDT2KJ66KK4RMWVKER6XO3VTXUTMMBYKJR2EJSUTCZ2
  • CAOMWSCWEK7E2KCAYD6P6OJT623KKKG6XL7VSDSAJPXUAMKIIRNB6LYN
  • CAWH3JNOIR6YO6AWQJGROTTZQ6G3VPBKAVPSPJUXOCCWEKC7W5MTIRTJ
  • CB476CSXTUM5Y5DJDG3YAX5EOYAZGPS7LUVLSGWAF4HUC36JXIO5DVGG
  • CBEVDY6XVO6EK6MRQ3XQQTG4IYH4P2UHJY3D6NTMYWFNQPZQIBS2USST
  • CBFL56NWACHUG65GF2FRK7YM7WPBLAMMYW57TZ7XRMO44JXEMWDY6YK4
  • CBJ4R5434OTPC6NIJ2N6JVAHCN6WZXZXOCU2SQSHDTMV5GBWU67VVEUM
  • CBJK3B7KWUCOBVLY2HHDVDI2KOP3J5F3MVRCBPI2KUWWAXWF7XH7RRWQ
  • CBVMFHNIUV4QDEJFEEGNUJSLXRTOV5MHAFFMSKTKPKOWMQRUUJVZPUCI
  • CBWC4XTSU7ERPJ35RWNCDYUUAW3DFFZTPVS6F4VXACMW4LFID6FKVEFY
  • CC564ZA4BUVFSTNH2AUMIAIN6E4VAMZ2F7VLO4CGASDHZKLFJPYL2JYA
  • CC75ZB5XJD2RLTBJFTZCS3SDUNU7OOUOV6CTTES22AGEBOBJAQXZQAFW
  • CC7QFWPACRRIPN2ES62TXXGSXWLYAFYIP5VBOGW6WHCUA4W5LVXOVA7Q
  • CCNAAG2JQHKCCDLR2GL34Y55HBRQXIXIAG5TYRBDT7FPUXWHK7A2EK4I
  • CCREJ34NQMVJSSEXAMDUR2FAZEZO2N4OJMVZUYLQCKOUVZJI2XIBRWVE
  • CD2GF77MGZE42K5GOG6R7U5EMLNJS6AZPVAJPS5OSBAMERUJKORP5JCP
  • CD2X4Y4OYFNGZJEE67AGLCDYKPK4XY4F6XIY6MRSBEKZFFTDWDIUHINM
  • CDR5NOUVQ5NAB4RIWBV6P2AMPM23GNBTP3UAUMZN7PO5GVWNQ2FHJASL
  • CDS6NWPBHWAX23WHBCWAOZTI2QVOXCCCSQCPB6I3MQ2SDPDOAWUQFMKM
  • CDVRSWWYXOHYWPOLUU7J75ZB6THYTQE3BGKHFMENQ5URGWBCH4CVVRP7

Interface

Read current nonce (monotonic).

fn get_nonce(env: soroban_sdk::Env) -> u64

Read the stored passkey pubkey (for debugging/verification).

fn get_passkey(env: soroban_sdk::Env) -> soroban_sdk::BytesN<65>

Constructor: Automatically called during deployment Initializes the contract with the passkey secp256r1 public key (65-byte uncompressed), the DeFindex vault contract address, and the USDC token address.

fn __constructor(
    env: soroban_sdk::Env,
    passkey_pubkey: soroban_sdk::BytesN<65>,
    vault_address: soroban_sdk::Address,
    usdc_token: soroban_sdk::Address,
)

Transfer USDC from this contract to a recipient address. Only the registered passkey can authorize.

auth_data and client_data_json come from the WebAuthn assertion. The signature is over SHA256(auth_data || SHA256(client_data_json)). The challenge inside client_data_json must equal SHA256("transfer_usdc" | amount | nonce).

fn transfer_usdc(
    env: soroban_sdk::Env,
    recipient: soroban_sdk::Address,
    amount: i128,
    signature: soroban_sdk::BytesN<64>,
    auth_data: soroban_sdk::Bytes,
    client_data_json: soroban_sdk::Bytes,
)

Get the fee rates (vault_fee, protocol_fee) in basis points.

fn get_vault_fees(env: soroban_sdk::Env) -> (u32, u32)

Deposit assets into the DeFindex vault. Only the registered passkey can authorize.

auth_data and client_data_json come from the WebAuthn assertion. The signature is over SHA256(auth_data || SHA256(client_data_json)). The challenge inside client_data_json must equal: SHA256("deposit" || amount1_le || amount2_le || ... || nonce_le)

fn deposit_to_vault(
    env: soroban_sdk::Env,
    amounts_desired: soroban_sdk::Vec,
    amounts_min: soroban_sdk::Vec,
    invest: bool,
    signature: soroban_sdk::BytesN<64>,
    auth_data: soroban_sdk::Bytes,
    client_data_json: soroban_sdk::Bytes,
) -> (soroban_sdk::Vec, i128)

Get the assets managed by the vault.

fn get_vault_assets(env: soroban_sdk::Env) -> soroban_sdk::Vec

Read the stored vault contract address.

fn get_vault_address(env: soroban_sdk::Env) -> soroban_sdk::Address

Withdraw assets from the DeFindex vault. Only the registered passkey can authorize.

auth_data and client_data_json come from the WebAuthn assertion. The signature is over SHA256(auth_data || SHA256(client_data_json)). The challenge inside client_data_json must equal: SHA256("withdraw" || withdraw_shares_le || nonce_le)

fn withdraw_from_vault(
    env: soroban_sdk::Env,
    withdraw_shares: i128,
    min_amounts_out: soroban_sdk::Vec,
    signature: soroban_sdk::BytesN<64>,
    auth_data: soroban_sdk::Bytes,
    client_data_json: soroban_sdk::Bytes,
) -> soroban_sdk::Vec

Get the asset amounts corresponding to a given number of vault shares.

fn get_vault_amounts_per_shares(
    env: soroban_sdk::Env,
    vault_shares: i128,
) -> soroban_sdk::Vec

Get the total managed funds of the vault.

fn get_vault_total_managed_funds(
    env: soroban_sdk::Env,
) -> soroban_sdk::Vec

Imports

WebAssembly Text (WAT) ▶