Contract 9c3cc53ffe7ed6c25e9b1e3bea4f1d2b63c6953fd4b63f6acca9a01b1593c49c

← Back to Index 📥 Download WASM

Meta

rssdkver 23.2.1#ab415a33cc1f6bdce20ac4a12f0ddbe41a648949
rsver 1.91.1

Instances

  • CAH4JMTODJG7EJO24Q25UPUZF4L7THLQ65K7B2CSLBHJPA3KMDTAEZ6K
  • CAR3XQR6N4ZEFT4KSZIZICN5ETWV5RSFDX6OK3QIRNZTH34XGN7W5Z5R
  • CAVIWVCFJRY3PL5ZCDN2RDKA4RSJGFNCHG23W3HOO7A5EZVHCV2HPMPI
  • CBWMKDJKTYM2WARSLZH25RKK4YNCMPZNLZ6JDHW67CYI4NYBZGTTX4QS
  • CCCGYRTZ2YPLXOQZWHFGHR5XWX27OADCOFYPQNUWVI5WWHX7ENQEXVUL

Interface

Initialize the contract with the passkey secp256r1 public key (65-byte uncompressed) and the USDC token contract address.

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

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>

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,
)

Read the stored USDC token contract address.

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

Imports

WebAssembly Text (WAT) ▶