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
- 1Deploy the Base Mini App to a stable HTTPS origin.
- 2Register and verify the app on Base.dev.
- 3Copy the real Builder Code from Base.dev settings.
- 4Generate the ERC-8021 dataSuffix from that code with ox/erc8021.
- 5Attach dataSuffix to the Viem or Wagmi client that sends the deposit transaction.
- 6Create a small USDCtoFiat deposit and verify attribution before launching a campaign.
02
Where it belongs
| Surface | Attribution path |
|---|---|
| Base App | Base docs say registered apps can receive automatic attribution for activity inside the Base App. |
| Web app | Add dataSuffix to the transaction client so browser usage outside the Base App is attributed. |
| USDCtoFiat SDK | The SDK signs with the wallet client you pass, so the suffix belongs on that wallet-client path. |
| Contracts | No 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
| Check | Pass condition |
|---|---|
| Base.dev | Onchain transaction counts increment for the app's Builder Code. |
| Block explorer | The transaction input ends with the ERC-8021 suffix marker and decodes to the expected code. |
| USDCtoFiat result | The created deposit returns depositId and txHash, then appears in deposits(address). |
| Peerlytics | The deposit and intent lifecycle can be inspected after indexing catches up. |
Keep exploring
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.