Skip to content

fix(statics): use erc20Token for non-ETH EVM entries in botTokens - #10088

Merged
nayandas190 merged 1 commit into
masterfrom
nayanjyotidas/cecho-2580-evm-bot-tokens-config-fix
Oct 29, 2026
Merged

nayandas190 merged 1 commit into
masterfrom
nayanjyotidas/cecho-2580-evm-bot-tokens-config-fix

Conversation

@nayandas190

@nayandas190 nayandas190 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Convert the non-ETH EVM entries in modules/statics/src/coins/botTokens.ts (okbxlayer:xdog, 85 okbxlayer:* xStock tokens, baseeth:zaru, tbaseeth:haven, tbaseeth:icbx, tflow:icbx) from AccountCtors.erc20 / AccountCtors.terc20 (Erc20Coin) to AccountCtors.erc20Token (EthLikeERC20Token).
  • Also convert the 5 baseeth:* tokens added by the AMS regen PR feat: PR from asset-metadata-service for token onboardings #10085 (baseeth:wtgxx, baseeth:flttx, baseeth:wtsix, baseeth:aerov2, baseeth:cadc) — same misconfiguration, and they make statics throw at module load once the stricter getErc20TokenConfig below lands (95 tokens total).
  • Remove the tbaseeth, baseeth, tflow, and okbxlayer workarounds from getErc20TokenConfig(coin: Erc20Coin) in modules/statics/src/tokenConfig.ts so Erc20Coin strictly only accepts Ethereum networks and fails fast in CI if misused.
  • Add a regression test in modules/statics/test/unit/tokenConfigTests.ts verifying that all SUPPORTS_ERC20 tokens in botTokens are EthLikeERC20Token instances and placed in their respective tokens.<net>.<family>.tokens bucket (rather than tokens.<net>.eth.tokens).

Issue Number

CECHO-2580

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • yarn --cwd modules/statics build and yarn --cwd modules/statics unit-test (41523 passing)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My code compiles correctly for both Node and Browser environments
  • My commits follow Conventional Commits and I have properly described any BREAKING CHANGES
  • The ticket or github issue was included in the commit message as a reference
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@linear-code

linear-code Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

CECHO-2580

CECHO-2590

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

@nayandas190
nayandas190 force-pushed the nayanjyotidas/cecho-2580-evm-bot-tokens-config-fix branch from 17f67b1 to 0e4cbd3 Compare October 29, 2026 02:14
@nayandas190
nayandas190 marked this pull request as ready for review October 29, 2026 03:33
@nayandas190
nayandas190 requested a review from a team as a code owner October 29, 2026 03:33

@claude claude Bot 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

Comment thread modules/sdk-coin-ada/src/lib/messages/cip8/utils.ts
@nayandas190
nayandas190 force-pushed the nayanjyotidas/cecho-2580-evm-bot-tokens-config-fix branch from 84934ec to d0c97bd Compare October 29, 2026 05:02
@nayandas190
nayandas190 changed the base branch from master to nayanjyotidas/cecho-2590-ada-cip8-cbor-fix October 29, 2026 05:02
Base automatically changed from nayanjyotidas/cecho-2590-ada-cip8-cbor-fix to master October 29, 2026 05:28
@BitGo BitGo deleted a comment from github-actions Bot Oct 29, 2026
@BitGo BitGo deleted a comment from github-actions Bot Oct 29, 2026
@nayandas190

Copy link
Copy Markdown
Contributor Author

@claude review

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @nayandas190's task in 29s —— View job


Review of #10088

Verdict: looks good, no blocking issues found.

What I checked

  • botTokens.ts: all 95 basechain/flow/okbxlayer entries now use AccountCtors.erc20Token(..., network, features). The argument order matches the signature in account.ts:1120, where network is the 7th parameter and features the 8th.
  • Features are passed explicitly through getTokenFeatures(...), so the EIP1559 default in erc20Token doesn't change them. Spot-checked okbxlayer:xdog and baseeth:cadc.
  • tokenConfig.ts: removing the four workaround cases makes getErc20TokenConfig throw for any non-Ethereum Erc20Coin. That is the fail-fast behavior you want, and the bot tokens no longer reach that path.
  • I couldn't compare the PR against origin/master here (no merge base in this checkout), so I reviewed the diff against the previous commit. I didn't build or run the tests. CI reports the 22.x, 24.x and 26.x unit-test jobs green.

Test (tokenConfigTests.ts)

  • The test covers the misconfiguration well. It checks the instanceof result and that the tokens land in the family bucket and not in eth.
  • Nit: the supportsErc20Families filter silently skips any token whose family isn't in the set. If a family later loses SUPPORTS_ERC20, its tokens drop out of the check with no failure. Consider asserting that the set contains baseeth, flow and okbxlayer.
  • Nit: the hard-coded .some(...) assertions cover only 5 tokens. The loop above already covers all of them, so this is fine as a spot check.

ADA commit (d1f5763)

  • An earlier automated review claimed encodeCbor returns empty bytes. Your reply explains why it doesn't: the data listener puts the stream in flowing mode, and Transform emits synchronously on write/end when the readable side isn't paused. You also showed the pushAny + read() drain truncates large values. The 64 KiB test that catches this and the green 22/24/26 jobs back that up, so I consider that concern resolved.
  • Shipping the ADA fix in this PR is reasonable because unit-test-changed pulls in dependents. Since it's unrelated to the statics change, it's worth stating in the PR description that it's a separate commit. That lets reviewers or the ADA owners split it out if they want.

Non-blocking

  • The Node 27-nightly compatibility warning is marked experimental and non-blocking. I didn't look into it.

@prajwalu142 prajwalu142 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.

looks good

@claude claude Bot 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.

I reviewed this version of the PR and didn't find any bugs. These are mainnet token definitions under a CODEOWNERS path, and they change which formatted-token bucket the tokens show up in, so a human look from the owning team would still be worthwhile.

What was reviewed:

  • Every converted botTokens entry against the erc20Token(id, name, fullName, decimals, contract, asset, network, features) signature: the network moved ahead of the features, and the trailing undefined placeholders were dropped correctly.
  • src/ no longer has any erc20/terc20 call on basechain, flow or okbxlayer networks. Nothing reaches the getErc20TokenConfig cases this PR removes, so module load won't throw.
  • Behavior change to confirm: these tokens leave tokens.<net>.eth.tokens and move to their family bucket (okbxlayer, baseeth, flow). Any consumer that looked them up under eth will no longer find them there.
Extended reasoning...

The change touches three files in @ bitgo/statics. About 95 Base, Flow and X Layer tokens in botTokens.ts switch from Erc20Coin to EthLikeERC20Token, the non-Ethereum cases are removed from getErc20TokenConfig, and a regression test is added. It touches no security-sensitive surface such as auth, crypto or input handling. The edits are mechanical and match the factory signature, and no leftover Erc20Coin on the removed networks was found. I deferred because CODEOWNERS assigns modules/statics and botTokens.ts to an owning team, and because the change affects consumers: these mainnet tokens move between formatted-token buckets. The PR has also changed scope since my earlier comment, which was on an unrelated ADA file.

@nayandas190
nayandas190 merged commit 682c160 into master Oct 29, 2026
30 checks passed
@nayandas190
nayandas190 deleted the nayanjyotidas/cecho-2580-evm-bot-tokens-config-fix branch October 29, 2026 05:41
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.

3 participants