feat(cli): add support for withdraws and claiming withdraws on erc20 tokens #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Important
Merge after #162
We want to add an interface on the cli for the withdraw of erc20 tokens
Description
token_l1
andtoken_l2
in theCommand
enum for bothWithdraw
andClaimWithdraw
commands. These parameters allow specifying ERC20 token addresses on L1 and L2, respectively, with validation to ensuretoken_l2
is required whentoken_l1
is provided.ClaimWithdraw
command logic to handle ERC20 claims using the newclaim_erc20withdraw
function whentoken_l1
is specified. Otherwise, it defaults to the existingclaim_withdraw
function.Withdraw
command logic to support ERC20 withdrawals using thewithdraw_erc20
function whentoken_l1
is specified. Otherwise, it defaults to the existingwithdraw
function.How to test
ethrex
repository. You can use the testtest_erc20_roundtrip
. Comment the parts of the withdrawalsrex l2 withdraw <AMOUNT> <PRIVATE_KEY> --token-l1 <TOKEN_L1_ADDRESS> --token-l2 <TOKEN_L2_ADDRESS>
WITHDRAW_TX_HASH
rex l2 claim-withdraw <AMOUNT> <WITHDRAW_TX_HASH> <PRIVATE_KEY> <BRIDGE_ADDRESS> --token-l1 <TOKEN_L1_ADDRESS> --token-l2 <TOKEN_L2_ADDRESS>
rex l2 balance <ADDRESS> --token <L2_TOKEN_ADDRESS>
for L2rex balance <ADDRESS> --token <L1_TOKEN_ADDRESS>
for L1Note
verifying the batches is needed for claiming the withdraws
On
ethrex
runmake init-prover
oncrates/l2
Closes #158
Closes #156