Repository navigation
fix(statics): use erc20Token for non-ETH EVM entries in botTokens - #10088
Conversation
|
|
17f67b1 to
0e4cbd3
Compare
There was a problem hiding this comment.
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.
75b9e0e to
84934ec
Compare
84934ec to
d0c97bd
Compare
|
@claude review |
|
Claude finished @nayandas190's task in 29s —— View job Review of #10088Verdict: looks good, no blocking issues found. What I checked
Test (
ADA commit (
Non-blocking
|
There was a problem hiding this comment.
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
botTokensentry against theerc20Token(id, name, fullName, decimals, contract, asset, network, features)signature: the network moved ahead of the features, and the trailingundefinedplaceholders were dropped correctly. src/no longer has anyerc20/terc20call on basechain, flow or okbxlayer networks. Nothing reaches thegetErc20TokenConfigcases this PR removes, so module load won't throw.- Behavior change to confirm: these tokens leave
tokens.<net>.eth.tokensand 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.
Description
modules/statics/src/coins/botTokens.ts(okbxlayer:xdog, 85okbxlayer:*xStock tokens,baseeth:zaru,tbaseeth:haven,tbaseeth:icbx,tflow:icbx) fromAccountCtors.erc20/AccountCtors.terc20(Erc20Coin) toAccountCtors.erc20Token(EthLikeERC20Token).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 strictergetErc20TokenConfigbelow lands (95 tokens total).tbaseeth,baseeth,tflow, andokbxlayerworkarounds fromgetErc20TokenConfig(coin: Erc20Coin)inmodules/statics/src/tokenConfig.tssoErc20Coinstrictly only accepts Ethereum networks and fails fast in CI if misused.modules/statics/test/unit/tokenConfigTests.tsverifying that allSUPPORTS_ERC20tokens inbotTokensareEthLikeERC20Tokeninstances and placed in their respectivetokens.<net>.<family>.tokensbucket (rather thantokens.<net>.eth.tokens).Issue Number
CECHO-2580
Type of change
How Has This Been Tested?
yarn --cwd modules/statics buildandyarn --cwd modules/statics unit-test(41523 passing)Checklist: