Skip to content

fix(coins): correct EIP-55 checksum of USDT0 on Rootstock - #283

Merged
maxklenk merged 1 commit into
mainfrom
fix/usdt0-rootstock-checksum
Sep 25, 2026
Merged

maxklenk merged 1 commit into
mainfrom
fix/usdt0-rootstock-checksum

Conversation

@maxklenk

Copy link
Copy Markdown
Contributor

Problem

The USDT0 entry for Rootstock (ChainId.RSK, chain 30) carries an address whose mixed-case
casing is not a valid EIP-55 checksum:

0x779dED0C9e1022225F8e0630b35A9B54Be713736   <- in this repo, invalid checksum
0x779Ded0c9e1022225f8E0630b35a9b54bE713736   <- correct EIP-55

The same token on ChainId.STA (a few lines below, src/coins/coins.ts) already uses the
correct casing, so this is a one-off typo rather than an upstream address difference.

Consumers that pass the value straight through to a service comparing addresses verbatim get
a hard failure instead of a silent normalisation. Against the LI.FI API:

GET /v1/token?chain=30&token=0x779dED0C9e1022225F8e0630b35A9B54Be713736
  -> 404 Could not find token '0x779dED0C…' on chain '30'
GET /v1/token?chain=30&token=0x779Ded0c9e1022225f8E0630b35a9b54bE713736
  -> 200 USD₮0

findDefaultToken(CoinKey.USDT0, ChainId.RSK) is also what
STABLECOIN_COIN_KEYS-style resolution lands on for Rootstock, since the chain has no
canonical USDC/USDCe/BUSD/USDG/USDB/USDe entry — so every quote built against the default
Rootstock stablecoin 404s today.

Change

  • Correct the checksum of the Rootstock USDT0 address. Address bytes are unchanged; only the
    casing differs.
  • Add src/coins/coins.unit.spec.ts, an offline spec asserting every EVM token address in
    defaultCoins and wrappedTokens passes viem's isAddress(…, { strict: true }).
    All-lowercase addresses carry no checksum and stay valid, so the existing data is
    unaffected — only mis-cased addresses fail.

I audited the whole src/ tree: this was the only address of 722 with a broken checksum.

Verification

pnpm test          177 passed (2 files)
pnpm lint          clean
pnpm format:check  All matched files use the correct format.
pnpm typecheck     clean

The new spec fails before the data fix and passes after:

FAIL  src/coins/coins.unit.spec.ts > validate EVM token addresses > are valid EIP-55 addresses
+   "USDT0 on chain 30: 0x779dED0C9e1022225F8e0630b35A9B54Be713736",

Changeset: patch (data fix).

@changeset-bot

changeset-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f503760

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lifi/data-types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@maxklenk
maxklenk merged commit 91a4889 into main Sep 25, 2026
4 checks passed
@maxklenk
maxklenk deleted the fix/usdt0-rootstock-checksum branch September 25, 2026 21:14
@github-actions github-actions Bot mentioned this pull request Sep 25, 2026
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.

1 participant