Skip to content

Commit

Permalink
Merge pull request #6182 from ethereum-optimism/update_eco_bridge
Browse files Browse the repository at this point in the history
Update eco bridge adapter with the new bridge addresses for the ECO bridges on OP and OP Goerli
  • Loading branch information
OptimismBot authored Jun 29, 2023
2 parents 6856455 + 59abd46 commit ef6fd95
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-files-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/sdk': patch
---

Update the addresses of the bridges on optimism and optimism goerli for the ECO bridge adapter
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,14 @@ jobs:
name: anvil-l1
background: true
# atm this is goerli but we should use mainnet after bedrock is live
command: anvil --fork-url $ANVIL_L1_FORK_URL --fork-block-number 9190101
command: anvil --fork-url $ANVIL_L1_FORK_URL --fork-block-number 9256679

- run:
name: anvil-l2
background: true
# atm this is goerli but we should use mainnet after bedrock is live
command: anvil --fork-url $ANVIL_L2_FORK_URL --port 9545 --fork-block-number 10756611
command: anvil --fork-url $ANVIL_L2_FORK_URL --port 9545 --fork-block-number 11276409

- run:
name: build
command: pnpm build
Expand Down
8 changes: 4 additions & 4 deletions packages/sdk/src/adapters/eco-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class ECOBridgeAdapter extends StandardBridgeAdapter {
[
{
inputs: [],
name: 'ecoAddress',
name: 'l1Eco',
outputs: [
{
internalType: 'address',
Expand All @@ -40,7 +40,7 @@ export class ECOBridgeAdapter extends StandardBridgeAdapter {
[
{
inputs: [],
name: 'l2EcoToken',
name: 'l2Eco',
outputs: [
{
internalType: 'contract L2ECO',
Expand All @@ -56,8 +56,8 @@ export class ECOBridgeAdapter extends StandardBridgeAdapter {
)

const [remoteL1Token, remoteL2Token] = await Promise.all([
l1Bridge.ecoAddress(),
l2Bridge.l2EcoToken(),
l1Bridge.l1Eco(),
l2Bridge.l2Eco(),
])

if (!hexStringEquals(remoteL1Token, toAddress(l1Token))) {
Expand Down
9 changes: 7 additions & 2 deletions packages/sdk/src/utils/chain-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ export const BRIDGE_ADAPTER_DATA: {
l1Bridge: '0x10E6593CDda8c58a1d0f14C5164B376352a55f2F' as const,
l2Bridge: '0x467194771dAe2967Aef3ECbEDD3Bf9a310C76C65' as const,
},
ECO: {
Adapter: ECOBridgeAdapter,
l1Bridge: '0xAa029BbdC947F5205fBa0F3C11b592420B58f824' as const,
l2Bridge: '0xAa029BbdC947F5205fBa0F3C11b592420B58f824' as const,
},
},
[L2ChainID.OPTIMISM_GOERLI]: {
DAI: {
Expand All @@ -284,8 +289,8 @@ export const BRIDGE_ADAPTER_DATA: {
},
ECO: {
Adapter: ECOBridgeAdapter,
l1Bridge: '0x7a01E277B8fDb8CDB2A2258508514716359f44A0' as const,
l2Bridge: '0x7a01E277B8fDb8CDB2A2258508514716359f44A0' as const,
l1Bridge: '0x9A4464D6bFE006715382D39D183AAf66c952a3e0' as const,
l2Bridge: '0x6aA809bAeA2e4C057b3994127cB165119c6fc3B2' as const,
},
},
}
4 changes: 2 additions & 2 deletions packages/sdk/test-next/bridgeEcoToken.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import {
import { BRIDGE_ADAPTER_DATA, CrossChainMessenger, L2ChainID } from '../src'
import { l1Provider, l2Provider } from './testUtils/ethersProviders'

const ECO_WHALE: Address = '0xBd11c836279a1352ce737FbBFba36b20734B04e7'
const ECO_WHALE: Address = '0x982E148216E3Aa6B38f9D901eF578B5c06DD7502'

// we should instead use tokenlist as source of truth
const ECO_L1_TOKEN_ADDRESS: Address =
'0x3E87d4d9E69163E7590f9b39a70853cf25e5ABE3'
const ECO_L2_TOKEN_ADDRESS: Address =
'0x54bBECeA38ff36D32323f8A754683C1F5433A89f'
'0xD2f598c826429EEe7c071C02735549aCd88F2c09'

const getERC20TokenBalance = async (
publicClient: PublicClient,
Expand Down

0 comments on commit ef6fd95

Please sign in to comment.