fix(sdk-coin-eth): complete sepeth registration and fix testnet coin resolution - #9433
Conversation
…resolution Sepolia coin creation was failing because sepeth was never registered as an SDK coin, and Sepolia ERC20/ERC7984 tokens would have resolved to hteth's chain data (wrong chainId/contract addresses) since the token classes hardcoded Testnet lookups to hteth. Ticket: CECHO-1721
|
@claude review |
|
Claude finished @manojkumar138's task —— View job Code ReviewTodo List:
SummaryThis PR successfully addresses the missing Sepolia Ethereum ( Key Changes Analysis✅ Core Logic Fix (erc20Token.ts & erc7984Token.ts)Issue Fixed: The original code used Solution: Changed to This is a critical fix - without it, Sepolia tokens would have used Holesky chain data (chainId 17000 instead of 11155111, wrong contract addresses). ✅ Sepeth Implementation (sepeth.ts)The new
✅ Registration Updates (register.ts)
✅ Configuration Updates (tokenConfig.ts)
✅ Test Updates
Security & Architecture Considerations
Minor Observations
Test CoverageThe PR author mentions running:
Recommendation: APPROVE ✅This PR:
The implementation is clean, well-tested, and addresses a blocking issue for Sepolia wallet creation while preventing silent failures that could lead to transaction errors. |
Summary
sepeth(Sepolia Ethereum) as an SDK coin — was missing, blocking Sepolia wallet creation (follow-up to feat(statics): add sepolia testnet for ETH #9377, feat(statics): give Sepolia testnet its own underlying asset (sepETH) #9389).Networks.test.sepolia→sepethmapping ingetErc20TokenConfig()andgetErc7984TokenConfig()in statics.erc20Token.ts/erc7984Token.ts:Erc20Token/Erc7984Tokenpicked their basestaticsCoinviacoinNames[tokenConfig.network], wherecoinNames = { Mainnet: 'eth', Testnet: 'hteth' }. SincetokenConfig.networkis only ever the generic bucket'Mainnet'or'Testnet'(never the specific chain), every testnet token — Holesky, Hoodi, or Sepolia — resolved to the same fixed'hteth'.htethwas the only Eth testnet with live tokens. Withsepethnow active, a Sepolia token would have silently built/signed transactions usinghteth's chain data (chainId 17000 instead of 11155111, wrong wallet/forwarder contract addresses).staticsCoinfromtokenConfig.coininstead, which is already set per-network bygetErc20TokenConfig()/getErc7984TokenConfig()('hteth','sepeth', etc.).tokenConfig.coinis'eth'for mainnet tokens, same value the oldcoinNames.Mainnetlookup produced.Test plan
yarn tsc --noEmitclean forsdk-coin-ethandstaticssdk-coin-ethfull unit suite passing (382 tests)staticstokenConfig-related tests passingregister.tsunit test to account for newsepethbase coin registrationTicket: CECHO-1721