Skip to content

task: fix the fee abstraction examples (adapter vs token address, decimals, imports) #2362

Open

Description

@GigaHierz

Follow-up from #2257, which added a troubleshooting section to the fee abstraction guide but left the existing examples as they were.

What needs to be done?

Three problems in build-on-celo/fee-abstraction/using-fee-abstraction.mdx, found while checking the page against the fee currency list and the JSON-RPC behaviour on Celo mainnet. AGENTS.md section 5 says every example that stays must run.

  1. CLI USDC example uses the adapter as the token. The first celocli transfer:erc20 block passes --erc20Address 0x2F25deB3848C207fc8E0c34035B3Ba7fC157602B. That address is the USDC adapter; the USDC token is 0xcebA9300f2b948710d2653dD7B07f33A8B32118C (see Fee currency contracts). The text under the block says transfers use the token address. The USD₮ example below it is correct (token in --erc20Address, adapter in --gasCurrency).
  2. viem step 3 mixes decimals and has missing imports. parseEther("1") - transactionFee treats USDC as 18 decimals, but USDC has 6; the snippet uses encodeFunctionData, parseEther and formatEther without importing them; step 1 calls hexToBigInt on the result of estimateGas, which viem already returns as a bigint.
  3. Addresses are not labelled. Every address in the examples should carry the network name and, for tokens, the decimals (AGENTS.md section 5), for example // Celo mainnet (42220), USDC adapter.

Definition of done

  • The CLI USDC example uses the token address for --erc20Address and the adapter for --gasCurrency, and the command is run once with its output noted in the PR
  • The viem examples are self-contained (imports shown), use the token's decimals, and are run against Celo Sepolia with the command and output noted in the PR
  • Every address in both examples is labelled with network and decimals
  • mint broken-links green

Priority

medium

Size

S — hours

Refs #2257.

Activity

  1. GigaHierz commented on Oct 15, 2026

    @GigaHierz
    ContributorAuthor

    Status against the three items:

    1. CLI USDC example uses the adapter as the token: fixed in docs: use the USDC token address in the fee-currency CLI example, checksum USDT, and link the DEK page directly #2366.
    2. viem step 3 decimals, imports and the hexToBigInt call: fixed in docs(fee-abstraction): make the viem examples run and use USDC's decimals #2384.
    3. Address labels with network and decimals: done in docs(fee-abstraction): make the viem examples run and use USDC's decimals #2384.

    Open: the two definition-of-done boxes that need a funded key. The CLI transfer has not been run and the step 3 script has not sent a transaction on Celo Sepolia. Leaving this open until someone with a funded key runs both and notes the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions