docs: reframe Token Contracts as Fee Currencies, split stablecoin address list - #2232
Conversation
palango
left a comment
There was a problem hiding this comment.
The reframing is right. "Token Contracts" was always mislabelled, since it has only ever been the celocli network:whitelist output, and pulling the address matrix out of the Build page is a clean split. The new feeCurrency column fixes a real footgun too: copy USDC's token address into feeCurrency and your transaction fails. I checked all 34 addresses survive the move, and the counts in the new intro (7 USD-pegged, 26 regional, plus G$) match the rows.
Two things block merge for me.
1. scripts/data/stablecoins.json isn't in the PR
scripts/.gitignore line 1 is *.json, which matches at any depth, so the file never got staged:
$ git check-ignore -v scripts/data/stablecoins.json
scripts/.gitignore:1:*.json scripts/data/stablecoins.json
git ls-tree -r <branch> scripts/ lists only .gitignore, README.md and update_contracts.py, and calling load_stablecoin_data() on a checkout of the branch gives:
FileNotFoundError: [Errno 2] No such file or directory: 'scripts/data/stablecoins.json'
The annoying part is what it does on the way down. At scripts/update_contracts.py:411-414 the output file is opened "w", so it's already truncated and the header already written by the time load_stablecoin_data() raises. Next generator run, stablecoin-contracts.mdx becomes a bare header and the address table is gone.
So: narrow the ignore (add !data/) and commit the file. And while you're in there, move load_stablecoin_data() above the open(...) so a missing input can't truncate the page it failed to build.
Side effect worth naming: scripts/README.md:11 documents a file that isn't there, and neither the third-party addresses nor the Sepolia overrides can be reviewed here.
2. The Fee Currencies page describes a column it doesn't have
tooling/contracts/token-contracts.mdx:16 tells readers to "Pass the feeCurrency address ... and use the token address when transferring the token itself." The committed tables are still | Token | Symbol | Token Address |.
I know the description says this fills in on the next real generator run. But nothing triggers one. .github/workflows/docs-validation.yml only runs mintlify broken-links, and nothing under .github/ mentions update_contracts, so unless someone remembers to run it by hand the page ships pointing at a column readers can't find. Regenerate with real celocli before merge, or hold that paragraph back.
Worth addressing
Sepolia carries BRLm, EURm and USDm twice at different addresses. EURm is both 0x6B172e33... and 0xA99dC247.... allowlisted_stablecoins keeps whichever lands last in the CSV and prints a warning (update_contracts.py:223-236), which is reasonable, but the reader gets nothing: two EURm rows on Fee Currencies, one on Stablecoin Contracts, no hint which deployment is live. The warning tells you to pin it in scripts/data/stablecoins.json, except the override map only covers Sepolia. If mainnet ever picks up a duplicate there's no lever at all.
build-on-celo/build-with-local-stablecoin.mdx:54 says "every Mento stablecoin plus USDC, USD₮ and USA₮ is on the allowlist ... See [Fee Currencies]", and the mainnet table it links to has no USA₮ row. using-fee-abstraction.mdx:46 does list a USA₮ adapter, so I assume the allowlist page is just stale rather than the claim being wrong. Either way, that sentence walks the reader into the contradiction.
Last one, and this is more a nit than a finding: name.startswith("Mento ") at update_contracts.py:230 fails silently. If those token names change upstream, every Mento stablecoin drops off the page and the only symptom is a shorter table. An explicit set of expected symbols that warns on a miss would at least be loud about it.
Minor
- Title is now "Fee Currencies" while the URL and
idstaytoken-contracts. Fine for link stability, but the next person here will wonder. A comment in the generator would cover it, or rename with a redirect at some point. - The
/token-addressesredirect fix and repointing MetaMask/Coinbase at the address page are both correct. Those wanted token addresses, not fee currencies. FIAT_BACKED_SYMBOLS(update_contracts.py:24) is an odd name given Mento stablecoins are fiat-referenced too.NON_MENTO_STABLECOIN_SYMBOLSis what the comment beside it already says.
CI's green, but broken-links only checks links, so none of this would have surfaced there.
The "Token Contracts" page is autogenerated from `celocli network:whitelist`, so it lists the tokens allowlisted to pay gas — not a token directory. Retitle it to "Fee Currencies" and say so on the page. The generator was also dropping the `Whitelisted Address` column, which is the value passed as `feeCurrency` and the adapter address for non-18-decimal tokens; emit it alongside the token address. Split the stablecoin page along the same lines: `build-with-local-stablecoin` keeps the ecosystem overview in Build, and the address matrix moves to a new generated `tooling/contracts/stablecoin-contracts` page. Mento stablecoins plus USDC and USD₮ are read from the fee-currency allowlist, the only source that covers Celo Sepolia; third-party issuers have no registry to read, so they are curated in `scripts/data/stablecoins.json`. Repoint the MetaMask and Coinbase Wallet links, which wanted token addresses rather than fee currencies, and relabel the fee-currency references in the specs and ContractKit pages. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…, rename page The curated stablecoin input was never committed: `scripts/.gitignore` ignores `*.json` at any depth, so `scripts/data/stablecoins.json` was silently skipped and `load_stablecoin_data()` would raise on a fresh checkout. Because the output file was already opened for write by then, the next generator run would have left `stablecoin-contracts.mdx` as a bare header with no table. Re-include `data/*.json`, commit the file, and read every input before opening any output. Source the fee-currency allowlist from `FeeCurrencyDirectory.getCurrencies()` via `cast` instead of `celocli network:whitelist`. The committed page previously described a `feeCurrency` column it did not have, and nothing in CI triggers a regeneration, so it would have shipped that way. Reading on-chain removes the `celocli` dependency for this page and lets the tables be generated here. Adapters come in two generations exposing the underlying token as `adaptedToken()` or `getAdaptedToken()`; try both, and document that. Regenerating against mainnet and Celo Sepolia also corrects the data. USA₮ and XAUt0 were missing, and the apparent duplicate Sepolia entries turn out to be the distinct legacy cUSD, cEUR and cREAL deployments rather than second copies of USDm, EURm and BRLm — so the override map that pinned them is gone. This makes the claim on the stablecoin overview page, that USA₮ is allowlisted, verifiable against the table it links to. Rename the page to `/tooling/contracts/fee-currencies` with redirects from both old paths, so the URL matches the title. Rename `FIAT_BACKED_SYMBOLS` to `NON_MENTO_STABLECOIN_SYMBOLS`, and warn when an expected Mento stablecoin is absent so a rename upstream cannot silently empty the table. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two stablecoin changes landed on main while this branch was open. cNGN, the Nigerian Naira stablecoin from the Africa Stablecoin Consortium, is now on Celo Mainnet, and vEUR was removed from the token list. Both assets are third-party issues with no on-chain registry to read, so they live in the curated half of scripts/data/stablecoins.json. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dae5ab4 to
7581037
Compare
|
Thanks — both blockers were real. Rebased onto latest 1. 2. The page described a column it didn't have. You were right that nothing would trigger a regeneration. Rather than hold the paragraph back, I switched the fee-currency source from That surfaced more than the missing column:
Silent Minor: Also picked up #2233 and #2234 in the rebase: cNGN added, vEUR removed. Verification: |
The "Token Contracts" page is autogenerated from
celocli network:whitelist, so it actually lists the tokens allowlisted to pay gas rather than a token directory — it is retitled to Fee Currencies and now says so, and the generator emits theWhitelisted Addresscolumn it was previously dropping (the value passed asfeeCurrency, and the adapter address for non-18-decimal tokens like USDC and USD₮).The stablecoin page is split along the same lines:
build-with-local-stablecoinkeeps the ecosystem overview in Build, while the address matrix moves to a new generatedtooling/contracts/stablecoin-contractspage — Mento stablecoins plus USDC, USD₮ and USA₮ are read from the fee-currency allowlist (the only source covering Celo Sepolia), and third-party issuers with no registry are curated inscripts/data/stablecoins.json.The MetaMask and Coinbase Wallet links are repointed at the address page since they wanted token addresses rather than fee currencies, and the fee-currency references in the specs, ContractKit and fee-abstraction pages are relabelled.
Verified with
npx mintlify broken-links(clean) and by running the generator withceloclimocked, which reproduces the new stablecoin page byte-for-byte; no addresses were lost in the move, and USDC's previously blank Celo Sepolia cell is now filled in. The newfeeCurrency Addresscolumn populates on the next real generator run, which needscelocliandTENDERLY_API_KEY.🤖 Generated with Claude Code