Quickstarts
Bridge Tokens Both Ways
NEXT WALKTHROUGH: Go deeper — Your Cross-Chain Address →
STEP 1 OF 3
ALL QUICKSTARTS →
TWO SCENARIOS · ONE PER DIRECTION
bridge
L1
→
L2
0.00001 ETH in · etherDelta +
PASS
bridgeL2
L2
→
L1
0.00001 ETH out · etherDelta −
PASS
Going out, the L1 manager keeps the ETH and credits the rollup: the entry's etherDelta is positive. Coming back, a negative etherDelta lowers that credit and the L1 escrow pays the receiver. bridgeL2 runs on its own chains, so its script first seeds that escrow with an anvil cheat. Locally, the scenario script plays composer: it posts the entries a composer would. The forge test then runs Bridge.sol's ERC-20 round trip.

WHAT THIS PROVESETH crosses in both directions on local anvil chains, and an ERC-20 makes the lock, mint, burn and release round trip through the Bridge.sol test fixture.

WHAT IT DOESN'TReal proving, a live node, or a production bridge: Bridge.sol is a test fixture. The scenarios use an accept-all proof system with the script playing composer, and the token test uses a mock proof system.

DAPP DEVELOPERS

Bridge Tokens Both Ways

Run one ETH scenario per direction, L1 to L2 and L2 to L1, each on its own pair of chains, then run the test that sends an ERC-20 through Bridge.sol and back.

Then read how Bridge.sol does the same for ERC-20s: lock and mint going out, burn and release coming back. Bridge.sol is a test fixture, not a production bridge.

Try it on mainnet: the Bridge & Calls tab on mainnet.eez.dev ↗

WHAT YOU'LL LEARN
  • 01 · RUN IT.Both ETH directions and the token round trip pass from a fresh pinned clone.
  • 02 · LOCK AND MINT.The wrapped copy is minted only through the proxy for the counterpart bridge.
  • 03 · BURN AND RELEASE.Burning the copy releases the original it stands for.

Verified against eez-core-protocol Git commit 9a1f815; interfaces may move.

UP NEXTGo deeper — Your Cross-Chain Address