Skip to content

Conversation

@Stefan-Ethernal
Copy link
Contributor

@Stefan-Ethernal Stefan-Ethernal commented Feb 24, 2025

Description

Implement bridging of custom ERC20 token from L2 to L1 and vice versa.

Steps

  1. Deploy mock ERC20 token on L2 network
  2. Mint some supply to a sender account (e.g. 10 ETH value of mock ERC20 token)
  3. Approve L2 bridge as a spender (e.g. 10 ETH value of mock ERC20 token)
  4. Bridge L2 -> L1 (e.g. 1 ETH value of mock ERC20 token)
  5. Claim bridge@L1
  6. Wrapped token is deployed on L1
  7. Approve L1 bridge as spender of the L1 wrapped token (e.g. 1 ETH value of L1 wrapped token)
  8. Bridge L1 -> L2 (e.g. 1 ETH value of L1 wrapped token)
  9. Claim bridge@L2
  10. Bridge L2 -> L1 (e.g. 1 ETH value of mock ERC20 token)
  11. Claim bridge@L1
sequenceDiagram
    participant User
    participant L2_Network
    participant L2_Bridge
    participant L1_Network
    participant L1_Bridge

    User->>L2_Network: Deploy mock ERC20 token
    User->>L2_Network: Mint 10 ETH worth of mock ERC20 to sender
    User->>L2_Network: Approve L2_Bridge as spender (10 ETH)
    User->>L2_Bridge: Bridge 1 ETH worth of mock ERC20 (L2 -> L1)
    L2_Bridge->>L1_Bridge: Transfer proof & assets
    User->>L1_Bridge: Claim bridge@L1
    L1_Bridge->>L1_Network: Deploy wrapped token on L1
    User->>L1_Network: Approve L1_Bridge as spender (1 ETH wrapped token)
    User->>L1_Bridge: Bridge 1 ETH wrapped token (L1 -> L2)
    L1_Bridge->>L2_Bridge: Transfer proof & assets
    User->>L2_Bridge: Claim bridge@L2
    User->>L2_Bridge: Bridge 1 ETH mock ERC20 (L2 -> L1)
    L2_Bridge->>L1_Bridge: Transfer proof & assets
    User->>L1_Bridge: Claim bridge@L1
Loading

Fixes #206

@Stefan-Ethernal Stefan-Ethernal changed the title Feat/l2 erc20 bridging feat: bridge l2 erc20 token Feb 24, 2025
@Stefan-Ethernal Stefan-Ethernal force-pushed the feat/l2-erc20-bridging branch 5 times, most recently from 2e6fcaf to c2dcc08 Compare February 28, 2025 07:07
@Stefan-Ethernal Stefan-Ethernal changed the title feat: bridge l2 erc20 token test: bridge l2 erc20 token Feb 28, 2025
@Stefan-Ethernal Stefan-Ethernal self-assigned this Feb 28, 2025
@Stefan-Ethernal Stefan-Ethernal force-pushed the feat/new-bridge-service branch from a001d76 to 0c1cc07 Compare March 3, 2025 15:22
@Stefan-Ethernal Stefan-Ethernal force-pushed the feat/l2-erc20-bridging branch 2 times, most recently from f5fc029 to 3d72cfa Compare March 6, 2025 12:03
@Stefan-Ethernal Stefan-Ethernal force-pushed the feat/l2-erc20-bridging branch from 9720cf0 to 899324e Compare March 18, 2025 06:34
@Stefan-Ethernal Stefan-Ethernal force-pushed the feat/l2-erc20-bridging branch from 899324e to f02f070 Compare April 1, 2025 08:29
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 1, 2025

@Stefan-Ethernal Stefan-Ethernal linked an issue Apr 3, 2025 that may be closed by this pull request
@Stefan-Ethernal Stefan-Ethernal marked this pull request as ready for review April 8, 2025 05:25
Copy link
Contributor

@goran-ethernal goran-ethernal left a comment

Choose a reason for hiding this comment

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

LGTM 💯

@Stefan-Ethernal Stefan-Ethernal force-pushed the feat/new-bridge-service branch from a017e9a to 519f04a Compare April 28, 2025 15:45
Copy link
Contributor

@temaniarpit27 temaniarpit27 left a comment

Choose a reason for hiding this comment

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

@Stefan-Ethernal i think we need to migrate this PR to e2e repo and close this one

@Stefan-Ethernal
Copy link
Contributor Author

Superseded by #459 and agglayer/e2e#53.

@Stefan-Ethernal Stefan-Ethernal deleted the feat/l2-erc20-bridging branch May 15, 2025 05:46
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.

Add test case for claiming a custom ERC20 token

4 participants