Skip to content

Commit

Permalink
sdk: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Jun 26, 2023
1 parent 3740d59 commit 779a4eb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
15 changes: 11 additions & 4 deletions packages/contracts-bedrock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
"types": "dist/index",
"license": "MIT",
"files": [
"dist/**/*.js",
"dist/**/*.d.ts",
"dist/types/**/*.ts",
"artifacts/contracts/**/*.json",
"forge-artifacts/L2StandardBridge.sol/L2StandardBridge.json",
"forge-artifacts/L1StandardBridge.sol/L1StandardBridge.json",
"forge-artifacts/L1CrossDomainMessenger.sol/L1CrossDomainMessenger.json",
"forge-artifacts/L2CrossDomainMessenger.sol/L2CrossDomainMessenger.json",
"forge-artifacts/OptimismPortal.sol/OptimismPortal.json",
"forge-artifacts/SystemConfig.sol/SystemConfig.json",
"forge-artifacts/SequencerFeeVault.sol/SequencerFeeVault.json",
"forge-artifacts/Proxy.sol/Proxy.json",
"forge-artifacts/ProxyAdmin.sol/ProxyAdmin.json",
"forge-artifacts/L2OutputOracle.sol/L2OutputOracle.json",
"forge-artifacts/OptimismMintableERC20.sol/OptimismMintableERC20.json",
"deployments/**/*.json",
"contracts/**/*.sol"
],
Expand Down
14 changes: 8 additions & 6 deletions packages/sdk/src/adapters/standard-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import {
BlockTag,
} from '@ethersproject/abstract-provider'
import { predeploys } from '@eth-optimism/contracts'
import { getContractInterface } from '@eth-optimism/contracts-bedrock'
import { hexStringEquals } from '@eth-optimism/core-utils'
import l1StandardBridgeArtifact from '@eth-optimism/contracts-bedrock/forge-artifacts/L1StandardBridge.sol/L1StandardBridge.json'
import l2StandardBridgeArtifact from '@eth-optimism/contracts-bedrock/forge-artifacts/L2StandardBridge.sol/L2StandardBridge.json'
import optimismMintableERC20 from '@eth-optimism/contracts-bedrock/forge-artifacts/OptimismMintableERC20.sol/OptimismMintableERC20.json'

import { CrossChainMessenger } from '../cross-chain-messenger'
import {
Expand Down Expand Up @@ -50,12 +52,12 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
this.messenger = opts.messenger
this.l1Bridge = new Contract(
toAddress(opts.l1Bridge),
getContractInterface('L1StandardBridge'),
l1StandardBridgeArtifact.abi,
this.messenger.l1Provider
)
this.l2Bridge = new Contract(
toAddress(opts.l2Bridge),
getContractInterface('L2StandardBridge'),
l2StandardBridgeArtifact.abi,
this.messenger.l2Provider
)
}
Expand Down Expand Up @@ -157,7 +159,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
try {
const contract = new Contract(
toAddress(l2Token),
getContractInterface('OptimismMintableERC20'),
optimismMintableERC20.abi,
this.messenger.l2Provider
)
// Don't support ETH deposits or withdrawals via this bridge.
Expand Down Expand Up @@ -207,7 +209,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {

const token = new Contract(
toAddress(l1Token),
getContractInterface('OptimismMintableERC20'), // Any ERC20 will do
optimismMintableERC20.abi,
this.messenger.l1Provider
)

Expand Down Expand Up @@ -274,7 +276,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {

const token = new Contract(
toAddress(l1Token),
getContractInterface('OptimismMintableERC20'), // Any ERC20 will do
optimismMintableERC20.abi,
this.messenger.l1Provider
)

Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/src/utils/chain-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const l2OutputOracleAddresses = {

const addressManagerAddresses = {
mainnet: addressManagerArtifactMainnet.address,
goerli: addressManagerArtifactGoerli.address
goerli: addressManagerArtifactGoerli.address,
}

const l1StandardBridgeAddresses = {
Expand All @@ -39,13 +39,13 @@ const l1CrossDomainMessengerAddresses = {
// legacy
const stateCommitmentChainAddresses = {
mainnet: '0xBe5dAb4A2e9cd0F27300dB4aB94BeE3A233AEB19',
goerli: '0x9c945aC97Baf48cB784AbBB61399beB71aF7A378'
goerli: '0x9c945aC97Baf48cB784AbBB61399beB71aF7A378',
}

// legacy
const canonicalTransactionChainAddresses = {
mainnet: '0x5E4e65926BA27467555EB562121fac00D24E9dD2',
goerli: '0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D'
goerli: '0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D',
}

import {
Expand Down

0 comments on commit 779a4eb

Please sign in to comment.