Skip to content

fix: widen TokenType.chain_id from uint8_t to uint32_t#240

Open
BitHighlander wants to merge 2 commits into
developfrom
fix/token-chain-id
Open

fix: widen TokenType.chain_id from uint8_t to uint32_t#240
BitHighlander wants to merge 2 commits into
developfrom
fix/token-chain-id

Conversation

@BitHighlander

Copy link
Copy Markdown
Owner

Summary

TokenType.chain_id was uint8_t, silently truncating chain IDs above 255. Base (8453), Arbitrum (42161), Avalanche C-Chain (43114), and others all overflow a byte — tokenByChainAddress would either match wrong tokens or return UnknownToken for valid ERC-20 transfers on these chains.

Widen chain_id to uint32_t in the struct and both lookup functions.

Test plan

  • CI green
  • USDC transfer on Base (chain_id 8453) shows correct token info

chain_id was uint8_t, silently truncating chain IDs above 255.
Base (8453), Arbitrum (42161), Avalanche (43114) and others all
overflow a byte, causing tokenByChainAddress to match the wrong
tokens or return UnknownToken for valid ERC-20 transfers.

Widen chain_id to uint32_t in TokenType struct and both lookup
functions (tokenByChainAddress, tokenByTicker).
deps/device-protocol → 8ef74da (feat(ripple): memo + THORChain routing)
deps/python-keepkey  → bf870e6 (7.14.2: XRP memo + EVM depositWithExpiry + msg-signing)
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