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

Open Beginner friendly
#2,362 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
markdown
Domain
documentation

Research direction

Start with build-on-celo/fee-abstraction/using-fee-abstraction.mdx, then read AGENTS.md section 5 and the referenced Fee currency contracts. Correct the CLI and viem examples, imports, decimals, and address labels; run the examples as specified, note their output in the PR, and verify that mint broken-links is green.

Written by the indexing model from the issue text.

Description

chore priority:medium

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.

Dominant language
MDX
Stars
89
Forks
396
Avg merge
3d 5h
Merged PRs (30d)
17

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from celo-org/docs

All issues in celo-org/docs

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.