Skip to content

N-08: use dynamic origin chain lookup for base token finalization#2128

Open
valera-grinenko-ai wants to merge 1 commit intomatter-labs:draft-v31from
valera-grinenko-ai:pr/N-08-hardcoded-origin-chain-id
Open

N-08: use dynamic origin chain lookup for base token finalization#2128
valera-grinenko-ai wants to merge 1 commit intomatter-labs:draft-v31from
valera-grinenko-ai:pr/N-08-hardcoded-origin-chain-id

Conversation

@valera-grinenko-ai
Copy link
Copy Markdown

@valera-grinenko-ai valera-grinenko-ai commented Apr 7, 2026

Summary

  • Replace hardcoded L1_CHAIN_ID with L2_NATIVE_TOKEN_VAULT.originChainId(baseTokenAssetId) in L2AssetTracker.handleFinalizeBaseTokenBridgingOnL2
  • A base token can originate from a chain other than L1 (e.g. a token first deployed on another L2), so the hardcoded value is incorrect in the general case
  • The initiate path (handleInitiateBaseTokenBridgingOnL2, line 269) already uses the dynamic NTV lookup — this makes the finalize path consistent

Test plan

  • Verify forge build passes
  • Confirm base token finalization uses the correct origin chain for tokens not originating on L1

🤖 Generated with Claude Code

In handleFinalizeBaseTokenBridgingOnL2, replace hardcoded L1_CHAIN_ID
with L2_NATIVE_TOKEN_VAULT.originChainId(baseTokenAssetId) for the
_tokenOriginChainId parameter. A base token can originate from a chain
other than L1 (e.g. a token first deployed on another L2). The initiate
path (handleInitiateBaseTokenBridgingOnL2, line 269) already uses the
dynamic NTV lookup — this makes the finalize path consistent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@valera-grinenko-ai valera-grinenko-ai force-pushed the pr/N-08-hardcoded-origin-chain-id branch from da9d879 to 868e41b Compare April 7, 2026 17:01
@valera-grinenko-ai valera-grinenko-ai changed the title N-08: document L1_CHAIN_ID usage as tokenOriginChainId N-08: use dynamic origin chain lookup for base token finalization Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants