Skip to content

docs(l2): add quick handsOn on bridging assets between L1 and L2 #2589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 30, 2025

Conversation

tomip01
Copy link
Contributor

@tomip01 tomip01 commented Apr 25, 2025

Motivation

This PR tries to show some basic walkthrough on moving assets between the two chains in the docs

Description

  • Add an example of how to deposit and how to withdraw funds in L2 and L1.
  • Explain the deposit functions from the CommonBridge contract in the L1

Closes #2524

Copy link

Lines of code report

Total lines added: 0
Total lines removed: 3
Total lines changed: 3

Detailed view
+----------------------------------------------------+-------+------+
| File                                               | Lines | Diff |
+----------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/engine/fork_choice.rs | 387   | -3   |
+----------------------------------------------------+-------+------+

@tomip01 tomip01 changed the title add basic deposit path docs(l2): add quick handsOn on bridging assets between L1 and L2 Apr 25, 2025
@tomip01 tomip01 self-assigned this Apr 25, 2025
@tomip01 tomip01 added docs Improvements or additions to documentation L2 Rollup client labels Apr 25, 2025
@tomip01 tomip01 marked this pull request as ready for review April 25, 2025 14:00
@tomip01 tomip01 requested a review from a team as a code owner April 25, 2025 14:00
1. Prerequisites:
- An L1 account with sufficient ETH balance
- The address of the deployed CommonBridge contract
- An Ethereum utility tool like [Rex](https://github.com/lambdaclass/rex)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😉

Copy link
Contributor

@ilitteri ilitteri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Found some typos.
  • Suggested better Rex commands.
  • We are missing a section explaining how to claim the withdrawn funds.

@ilitteri ilitteri requested a review from MauroToscano April 25, 2025 15:25
tomip01 and others added 8 commits April 25, 2025 12:44
Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>
Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>
Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>
@tomip01 tomip01 requested a review from ilitteri April 25, 2025 17:59
@ilitteri ilitteri requested a review from jrchatruc April 25, 2025 22:23
Comment on lines 79 to 85
2. Make the Withdraw:

Using Rex we simply use the `rex l2 withdraw` command.
```Shell
# Format: rex l2 withdraw <AMOUNT> <PRIVATE_KEY> [RPC_URL]
rex l2 withdraw 5000 0xbcdf20249abf0ed6d944c0288fad489e33f66b3960d9e6229c1cd214ed3bbe31
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment saying that if successful, the tx_hash will be printed in the format: Withdrawal sent: 0x7d01..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
0e45603


1. Prerequisites:
- An L1 account with sufficient ETH balance
- The address of the deployed CommonBridge contract
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When developing locally, the value of this address is always the same. Let's put it here for reference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 5e728a7


3. Claim the Withdraw:

After making the withdraw it has to be claimed in the L1. This is done with the L1 CommonBridge contract. We can use the Rex command `rex l2 claim-withdraw`. Here we have to use the tx hash obtained in the previous step. Also, it is necessary to wait for the block that includes the withdraw to be committed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have to use the tx hash obtained in the previous step. Also, it is necessary to wait for the block that includes the withdraw to be committed.

Here we have to use the tx hash obtained in the previous step. Also, it is necessary to wait for the block that includes the withdraw to be verified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 54adfb5

Copy link
Member

@jrchatruc jrchatruc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments

@tomip01 tomip01 requested a review from jrchatruc April 29, 2025 16:12
@jrchatruc jrchatruc added this pull request to the merge queue Apr 30, 2025
Merged via the queue into main with commit 6f4ce05 Apr 30, 2025
12 checks passed
@jrchatruc jrchatruc deleted the docs/bridge-assets branch April 30, 2025 14:35
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
…bdaclass#2589)

**Motivation**

This PR tries to show some basic walkthrough on moving assets between
the two chains in the docs

**Description**

* Add an example of how to deposit and how to withdraw funds in L2 and
L1.
* Explain the deposit functions from the CommonBridge contract in the L1

Closes lambdaclass#2524

---------

Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>
Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation L2 Rollup client
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Missing how to bridge assets in L2 in the README
4 participants