Encode the Attribution Suffix
Attribution is an ERC-8021 calldata suffix: the marker0x8021 followed by your builder code encoded as UTF-8 hex. Construct it once and reuse it across all transactions.
With wagmi
wagmi’swriteContract accepts a dataSuffix parameter that it appends to the ABI-encoded calldata before submitting to the wallet. Pass the attribution string there — the suffix is preserved even when the underlying EIP-1193 provider re-encodes the transaction.
Check and request token approval
Request a deposit
pendingDeposit balance using the API to confirm the request landed.
Request a withdrawal
For withdrawals, the spender is the provisioner and the token being approved is the vault share token (VAULT_ADDRESS), not the asset or numeraire token.
With a Privy Wallet (Embedded)
Embedded wallets expose asendTransaction function that accepts raw transaction parameters including a data field. Encode the full calldata manually and append the attribution suffix before sending — attribution is baked into the bytes and cannot be stripped by the provider.
Check and request token approval
sendTransaction here refers to Privy’s transaction function — either useSendTransaction from @privy-io/react-auth or the equivalent method on the embedded wallet object.
Request a deposit
pendingDeposit balance using the API to confirm the request landed.
Request a withdrawal
For withdrawals, the spender is the provisioner and the token being approved is the vault share token (VAULT_ADDRESS), not the asset or numeraire token. Read the user’s share balance from the vault.
What’s Next
Attribution with SDK
How the SDK handles attribution automatically and how to monitor attributed volume.
Deposit Your First Dollar
SDK-based deposit and withdrawal flow using the Gauntlet SDK.