Skip to content

feat(cli,sdk): add claim-native-withdraw command#222

Draft
avilagaston9 wants to merge 1 commit intomainfrom
feat/claim-native-withdraw
Draft

feat(cli,sdk): add claim-native-withdraw command#222
avilagaston9 wants to merge 1 commit intomainfrom
feat/claim-native-withdraw

Conversation

@avilagaston9
Copy link
Copy Markdown
Contributor

Motivation

ethrex PR #6248 adds a "native rollup" mode where L2→L1 withdrawals use MPT state proofs instead of batch/merkle proofs. Rex needs a command to finalize these native rollup withdrawals by fetching the proof from L2 and submitting the claim transaction on L1.

Description

Adds rex l2 claim-native-withdraw command that:

  1. Fetches the MPT proof from L2 via ethrex_getNativeWithdrawalProof RPC (with retry logic, up to 60 attempts)
  2. Calls claimWithdrawal(address,address,uint256,uint256,uint256,bytes[],bytes[]) on the L1 NativeRollup contract

Usage:

rex l2 claim-native-withdraw <L2_TX_HASH> <PRIVATE_KEY> <NATIVE_ROLLUP_ADDRESS> [L1_RPC_URL] [RPC_URL]

Changes:

  • sdk/src/l2/withdraw.rsNativeWithdrawalProof struct, get_native_withdrawal_proof(), claim_native_withdraw()
  • cli/src/commands/l2.rsClaimNativeWithdraw command variant and handler

…als.

The native rollup mode (ethrex PR #6248) uses MPT state proofs instead
of batch/merkle proofs for L2→L1 withdrawals. This adds SDK functions
to fetch the proof via `ethrex_getNativeWithdrawalProof` RPC (with retry
logic) and submit `claimWithdrawal` on the L1 NativeRollup contract,
plus the corresponding CLI command wiring.
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