Skip to content

[#475] Builder Code (ERC-8021) attribution #479

@realproject7

Description

@realproject7

Parent: #475

Summary

Set up Builder Code attribution so all onchain transactions from PlotLink include the builder code suffix, earning Base builder rewards.

Context

From Dropcast issues #286, #288, #290:

  • Do NOT manually append builder code to calldata — modern wallets wrap transactions internally
  • Use EIP-5792 dataSuffix capability on wallet_sendCalls
  • Fallback to direct sendTransaction with manual append only if wallet lacks EIP-5792

Steps

1. Register Builder Code

  • OPERATOR: Register at base.dev to get a builder code (e.g., bc_xxxxxxxx)
  • Add NEXT_PUBLIC_BUILDER_CODE to env vars

2. Create builder-code helper

Reference: ~/Projects/dropcast/lib/builder-code.ts

import { Attribution } from '@base/attribution';
const BUILDER_CODE = process.env.NEXT_PUBLIC_BUILDER_CODE ?? '';
export const DATA_SUFFIX = BUILDER_CODE ? Attribution.toDataSuffix({ codes: [BUILDER_CODE] }) : null;

3. Integrate with wagmi

Reference: ~/Projects/dropcast/lib/wagmi.ts

  • Configure wagmi to use dataSuffix capability when available
  • Primary: wallet_sendCalls with capabilities.dataSuffix
  • Fallback: direct sendTransaction with manual append

4. Apply to all transaction paths

  • TradingWidget: buy (ETH/USDC/HUNT/PLOT) and sell
  • Create storyline
  • Chain plot
  • Donate
  • Claim royalties

5. Verify attribution

  • After a test tx, check via Base Attribution Checker that the builder code is detected

Dependencies

  • @base/attribution npm package

Acceptance Criteria

  • Builder code registered (operator gate)
  • DATA_SUFFIX generated from builder code
  • All tx paths include builder code attribution
  • Verified via Attribution Checker on at least one tx
  • Fallback works for wallets without EIP-5792

Branch

task/475-builder-code in plotlink repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions