Developers · Base

Prepare Builder Code attribution for USDCtoFiat deposits.

This is setup guidance, not a claim that USDCtoFiat has an issued Builder Code. Use it when your Base app is ready to attribute the onchain deposit transactions created through @usdctofiat/offramp.

01

Attribution sequence

  1. 1Deploy the Base Mini App to a stable HTTPS origin.
  2. 2Register and verify the app on Base.dev.
  3. 3Copy the real Builder Code from Base.dev settings.
  4. 4Generate the ERC-8021 dataSuffix from that code with ox/erc8021.
  5. 5Attach dataSuffix to the Viem or Wagmi client that sends the deposit transaction.
  6. 6Create a small USDCtoFiat deposit and verify attribution before launching a campaign.
02

Where it belongs

SurfaceAttribution path
Base AppBase docs say registered apps can receive automatic attribution for activity inside the Base App.
Web appAdd dataSuffix to the transaction client so browser usage outside the Base App is attributed.
USDCtoFiat SDKThe SDK signs with the wallet client you pass, so the suffix belongs on that wallet-client path.
ContractsNo contract change is needed; ERC-8021 suffix data is appended to calldata and indexed offchain.
03

Implementation notes

  • Use viem 2.45.0 or newer for the Base docs path; this app already runs a newer viem version.
  • Keep placeholder Builder Codes out of production. Wire the real value only after Base.dev issues it.
  • For Viem, add dataSuffix when the wallet client is created.
  • For Wagmi, configure dataSuffix at the client level so sends and batched calls inherit it.
  • For Privy or smart-wallet flows, use the wallet/provider path that actually submits the user operation or transaction.
04

Verification

CheckPass condition
Base.devOnchain transaction counts increment for the app's Builder Code.
Block explorerThe transaction input ends with the ERC-8021 suffix marker and decodes to the expected code.
USDCtoFiat resultThe created deposit returns depositId and txHash, then appears in deposits(address).
PeerlyticsThe deposit and intent lifecycle can be inspected after indexing catches up.

Common questions

Can I add a placeholder Builder Code now?

No. Keep the integration ready, but do not ship placeholder attribution. Register on Base.dev, get the real code, then add it to the wallet-client path.

Does @usdctofiat/offramp need a separate Builder Code option?

Not for the normal app path. The SDK uses the Viem WalletClient you pass, so attribution should be attached to that client or the wallet/provider layer that sends the transaction.

Does ERC-8021 change the ZKP2P contracts?

No. Base docs describe Builder Codes as calldata suffix attribution. The contracts execute normally; attribution is read by offchain indexers after the transaction lands.