Skip to content

docs(minipay+fee-abstraction): add USDT 6-decimal warning and USDT celocli transfer example#2186

Closed
samuelchimmy wants to merge 3 commits into
celo-org:mainfrom
samuelchimmy:samuelchimmy/usdt-decimal-note
Closed

docs(minipay+fee-abstraction): add USDT 6-decimal warning and USDT celocli transfer example#2186
samuelchimmy wants to merge 3 commits into
celo-org:mainfrom
samuelchimmy:samuelchimmy/usdt-decimal-note

Conversation

@samuelchimmy

Copy link
Copy Markdown

What changed

build-on-celo/build-on-minipay/code-library.mdx

  • Added a <Warning> callout before the Request an ERC20 token transfer section explicitly stating that USDT and USDC use 6 decimals on Celo, not 18
  • Updated the inline address comment in requestTransfer to include the decimal count next to each token address (USDm: 18, USDC: 6, USDT: 6)
  • Corrected the parseUnits comment from "USDm (18), USDC (6)" — which omitted USDT entirely — to "USDm uses 18 decimals; USDC and USDT use 6 decimals"

build-on-celo/fee-abstraction/using-fee-abstraction.mdx

  • The CLI section showed a USDC example only. Added an equivalent USDT celocli transfer:erc20 example using the correct USDT mainnet token address (0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e) and its fee adapter address (0x0e2a3e05bc9a16f5292a6170456a710cb89c6f72)
  • Clarified that --value for both USDC and USDT is in units of 10^6

Why

The requestTransfer snippet listed USDT in the address comment but gave no decimal count for it, while explicitly noting USDC (6). A developer building a USDT transfer and following this example without noticing the omission would likely pass 18 as tokenDecimals, sending 1,000,000,000,000× the intended amount. The <Warning> and inline comment make the 6-decimal requirement impossible to miss.

The fee-abstraction CLI section documented USDC usage but left USDT as table-only — no runnable example. The USDT adapter address is already in the table above; adding the celocli example makes it consistent.

How to verify

  1. In code-library.mdx: search for requestTransfer — confirm the <Warning> block appears above the code fence and the inline comment now reads (6 decimals) next to USDT
  2. In using-fee-abstraction.mdx: search for 48065fbbe — confirm a complete celocli command appears using it as --erc20Address and 0e2a3e05 as --gasCurrency
  3. Token addresses can be verified at celoscan.io/address/0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e and celoscan.io/address/0x0e2a3e05bc9a16f5292a6170456a710cb89c6f72

@samuelchimmy samuelchimmy requested a review from a team as a code owner May 23, 2026 20:42
@GigaHierz

Copy link
Copy Markdown
Contributor

Thanks for this fix, @samuelchimmy! Because our CI can't run on PRs from external forks, I've recreated your changes verbatim on an org-owned branch so they can be merged: #2196. Full credit to you in the new PR description.

Closing this in favor of #2196.

@GigaHierz GigaHierz closed this Jun 16, 2026
viral-sangani pushed a commit that referenced this pull request Jun 16, 2026
…locli transfer example (#2196)

- code-library.mdx: add a Warning that USDT/USDC use 6 decimals (not 18),
  annotate each mainnet token address with its decimal count, and correct the
  parseUnits comment to cover USDT.
- using-fee-abstraction.mdx: add a runnable USDT celocli transfer:erc20 example
  using the USDT token and adapter addresses, and clarify --value is in 10^6 units.

Recreates external contribution #2186 on an org branch.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants