Skip to content

fix(statics): correct addressCoin for non-ETH L2 OFC tokens#9271

Merged
ArunBala-Bitgo merged 1 commit into
masterfrom
cecho-1687-fix-addresscoin-for-non-eth-ofc-tokens
Jul 16, 2026
Merged

fix(statics): correct addressCoin for non-ETH L2 OFC tokens#9271
ArunBala-Bitgo merged 1 commit into
masterfrom
cecho-1687-fix-addresscoin-for-non-eth-ofc-tokens

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Pass addressCoin explicitly for 13 OFC tokens that were inheriting the wrong default ('eth'/'teth') from ofcerc20()/tofcerc20():
    • ofcmantle:usdt, ofcmantle:usdc, ofcmantle:usde, ofcmantle:usdt0, ofcmantle:ausd, ofcmantle:usd1'mantle'
    • ofctmantle:bgerch, ofctmantle:usd1, ofctmantle:stgusd1'tmantle'
    • ofcmegaeth:mega, ofcmegaeth:weth'megaeth'
    • ofctmegaeth:tmt'tmegaeth'
    • ofcseievm:wsei'seievm'
  • Add regression test in ofcCoinParity.ts asserting the correct addressCoin for each affected token

Why

  • ofcerc20() defaults addressCoin to 'eth'. Tokens on separate L2 chains (Mantle, MegaEth, SeiEVM) were omitting the argument and inheriting 'eth' instead of their respective chain coin.
  • This caused wallet-platform to treat these tokens as ETH mainnet tokens, returning ETH addresses when listing addresses for these tokens on a Go Account wallet (e.g. GET /api/v2/ofc/wallet/:walletId/addresses?token=ofcmegaeth:mega returned ETH addresses instead of MegaEth addresses). Confirmed reproduced for ofcmegaeth:mega.

Test plan

  • TypeScript type-check passes (tsc --noEmit)
  • All 2730 OFC tests pass (ofcCoinParity.ts, ofcTokenNaming.ts)
  • New regression test added verifying addressCoin value for all 13 affected tokens

Ticket: CECHO-1687

@linear-code

linear-code Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

CECHO-1687

@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the cecho-1687-fix-addresscoin-for-non-eth-ofc-tokens branch from de189a1 to 905ba62 Compare July 16, 2026 07:43
@shivabitgo
shivabitgo marked this pull request as ready for review July 16, 2026 09:32
@shivabitgo
shivabitgo requested a review from a team as a code owner July 16, 2026 09:32
Comment thread modules/statics/test/unit/ofcCoinParity.ts Outdated
Several OFC tokens on non-ETH L2 chains (mantle, tmantle, megaeth,
tmegaeth, seievm) were registered via ofcerc20()/tofcerc20() without
explicitly passing addressCoin, so they inherited the default of
'eth'/'teth'. This caused wallet-platform to return ETH addresses
instead of the correct chain addresses when listing addresses for
these tokens on a Go Account wallet.

Pass addressCoin explicitly for all 13 affected tokens:
- ofcmantle: usdt, usdc, usde, usdt0, ausd, usd1 → 'mantle'
- ofctmantle: bgerch, usd1, stgusd1 → 'tmantle'
- ofcmegaeth: mega, weth → 'megaeth'
- ofctmegaeth: tmt → 'tmegaeth'
- ofcseievm: wsei → 'seievm'

Also adds a regression test in ofcCoinParity.ts that asserts the
correct addressCoin value for each affected token.

Ticket: CECHO-1687
Session-Id: 8dce005c-d7ec-476e-a149-7810984c8663
Task-Id: 407369e3-531d-4ba2-9a6a-ced6a51639eb
@ArunBala-Bitgo
ArunBala-Bitgo force-pushed the cecho-1687-fix-addresscoin-for-non-eth-ofc-tokens branch from 905ba62 to ec2d1ed Compare July 16, 2026 09:54
@manojkumar138
manojkumar138 requested a review from Copilot July 16, 2026 10:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes incorrect addressCoin metadata for a set of OFC ERC20 tokens on non-Ethereum EVM chains (Mantle, MegaEth, SeiEVM) that were previously inheriting the ofcerc20() / tofcerc20() default (eth / teth), which led downstream systems to return the wrong address type for those tokens.

Changes:

  • Explicitly sets addressCoin for 13 affected OFC tokens across Mantle, Mantle testnet, MegaEth, MegaEth testnet, and SeiEVM.
  • Adds a unit test to validate addressCoin consistency for OFC token naming patterns.
  • Fixes a testnet Hoodeth token name to use the ofct... prefix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
modules/statics/src/coins/ofcErc20Coins.ts Passes explicit addressCoin for the affected OFC tokens so address derivation maps to the correct chain coin instead of defaulting to eth/teth.
modules/statics/test/unit/ofcCoinParity.ts Adds a regression test that validates addressCoin points to a real coin and matches the ofc{chain}:{token} naming convention.
modules/statics/src/coins/ofcHoodethTokens.ts Corrects a tofcerc20 token name to use the ofcthoodeth:* prefix (testnet).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@manojkumar138 manojkumar138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@shubham-damkondwar shubham-damkondwar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ArunBala-Bitgo
ArunBala-Bitgo merged commit 56b208c into master Jul 16, 2026
25 checks passed
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.

5 participants