Allows the L1_Bridge and L2_Bridge to support ETH directly.
The L1_Bridge implements this using inheritance. Either L1_ETH_Bridge or L1_ERC20_Bridge should be deployed.
The L2_Bridge uses a flag l2CanonicalTokenIsWeth. If set true, the bridge will wrap incoming ETH in WETH and unwrap outgoing WETH to distribute as ETH.
The reason for handling it in two different ways involves a few reasons but it's mostly because we already use inheritance to implement the L2 bridge for arbitrum, optimism, ect. Adding another split in the tree for eth/erc20 would mean we need two L2_Bridge contracts for each network and a complicated inheritance structure to keep the code DRY.
@shanefontaine All broken tests should be fixed by using L1_ERC20_Bridge instead of L1_Bridge and passing in false to the L2_Bridge constructor for l2CanonicalTokenIsWeth. I didn't make these changes to avoid merge conflicts.
Allows the
L1_Bridge
andL2_Bridge
to support ETH directly.The
L1_Bridge
implements this using inheritance. EitherL1_ETH_Bridge
orL1_ERC20_Bridge
should be deployed.The
L2_Bridge
uses a flagl2CanonicalTokenIsWeth
. If set true, the bridge will wrap incoming ETH in WETH and unwrap outgoing WETH to distribute as ETH.The reason for handling it in two different ways involves a few reasons but it's mostly because we already use inheritance to implement the L2 bridge for arbitrum, optimism, ect. Adding another split in the tree for eth/erc20 would mean we need two
L2_Bridge
contracts for each network and a complicated inheritance structure to keep the code DRY.@shanefontaine All broken tests should be fixed by using
L1_ERC20_Bridge
instead ofL1_Bridge
and passing infalse
to the L2_Bridge constructor forl2CanonicalTokenIsWeth
. I didn't make these changes to avoid merge conflicts.