foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.12k stars 1.68k forks source link

How to command for proveWithdrawalTransaction, finalizeWithdrawalTransaction with Op-stack #8480

Closed nidz-the-fact closed 1 month ago

nidz-the-fact commented 1 month ago

Component

Other (please describe)

Describe the feature you would like

How to command for proveWithdrawalTransaction, finalizeWithdrawalTransaction with Op-stack

# initiate withdrawal
cast send --value 1234567890 0x4200000000000000000000000000000000000016 "initiateWithdrawal(address _target, uint256 _gasLimit, bytes memory _data)" $TEST_ADDRESS 50000 0x --private-key=$TEST_PRIVATE_KEY --rpc-url=$L2_RPC_URL
// this will return a successful tx and its L2 block number

# check if the L2 block is included in L1 and it is finalized
cast call $OUTPUT_ORALCE_ADDRESS "latestBlockNumber()" --rpc-url $L1_RPC_URL

L2 (Op-stack): I have use withdrawn # initiate withdrawal L1: Need to proveWithdrawalTransaction, finalizeWithdrawalTransaction The args information inside is quite verbose. Can I use command command to do the interact?

Thanks you. foundry

Additional context

This is an example argument. proveWithdrawalTransaction, finalizeWithdrawalTransaction

image Thanks you. foundry

zerosnacks commented 1 month ago

Hi @nidz-the-fact, yes you can use cast or Forge script for this but you have to be mindful of correctly formatting all the arguments.

Arguments between (..) indicate a struct. It may be easier to copy the struct from the source code to strongly type your interactions.