Commit b49833fe authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #5208 from ethereum-optimism/sc/sdk-default-bridges

fix(sdk): automatically create std/ETH bridges
parents 3d915fa9 67b4d669
---
'@eth-optimism/sdk': patch
---
Have SDK automatically create Standard and ETH bridges when L1StandardBridge is provided.
...@@ -165,19 +165,19 @@ export const getBridgeAdapters = ( ...@@ -165,19 +165,19 @@ export const getBridgeAdapters = (
} }
): BridgeAdapters => { ): BridgeAdapters => {
const adapterData: BridgeAdapterData = { const adapterData: BridgeAdapterData = {
...(CONTRACT_ADDRESSES[l2ChainId] ...(CONTRACT_ADDRESSES[l2ChainId] || opts?.contracts?.l1?.L1StandardBridge
? { ? {
Standard: { Standard: {
Adapter: StandardBridgeAdapter, Adapter: StandardBridgeAdapter,
l1Bridge: l1Bridge:
opts.contracts?.l1?.L1StandardBridge || opts?.contracts?.l1?.L1StandardBridge ||
CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge, CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge,
l2Bridge: predeploys.L2StandardBridge, l2Bridge: predeploys.L2StandardBridge,
}, },
ETH: { ETH: {
Adapter: ETHBridgeAdapter, Adapter: ETHBridgeAdapter,
l1Bridge: l1Bridge:
opts.contracts?.l1?.L1StandardBridge || opts?.contracts?.l1?.L1StandardBridge ||
CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge, CONTRACT_ADDRESSES[l2ChainId].l1.L1StandardBridge,
l2Bridge: predeploys.L2StandardBridge, l2Bridge: predeploys.L2StandardBridge,
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment