Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
8313a787
Commit
8313a787
authored
Jun 26, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdk: cleanup
parent
5cc1a7a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
package.json
packages/contracts-bedrock/package.json
+11
-4
standard-bridge.ts
packages/sdk/src/adapters/standard-bridge.ts
+8
-6
chain-constants.ts
packages/sdk/src/utils/chain-constants.ts
+3
-3
No files found.
packages/contracts-bedrock/package.json
View file @
8313a787
...
@@ -6,10 +6,17 @@
...
@@ -6,10 +6,17 @@
"types"
:
"dist/index"
,
"types"
:
"dist/index"
,
"license"
:
"MIT"
,
"license"
:
"MIT"
,
"files"
:
[
"files"
:
[
"dist/**/*.js"
,
"forge-artifacts/L2StandardBridge.sol/L2StandardBridge.json"
,
"dist/**/*.d.ts"
,
"forge-artifacts/L1StandardBridge.sol/L1StandardBridge.json"
,
"dist/types/**/*.ts"
,
"forge-artifacts/L1CrossDomainMessenger.sol/L1CrossDomainMessenger.json"
,
"artifacts/contracts/**/*.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"
,
"deployments/**/*.json"
,
"contracts/**/*.sol"
"contracts/**/*.sol"
],
],
...
...
packages/sdk/src/adapters/standard-bridge.ts
View file @
8313a787
...
@@ -13,8 +13,10 @@ import {
...
@@ -13,8 +13,10 @@ import {
BlockTag
,
BlockTag
,
}
from
'
@ethersproject/abstract-provider
'
}
from
'
@ethersproject/abstract-provider
'
import
{
predeploys
}
from
'
@eth-optimism/contracts
'
import
{
predeploys
}
from
'
@eth-optimism/contracts
'
import
{
getContractInterface
}
from
'
@eth-optimism/contracts-bedrock
'
import
{
hexStringEquals
}
from
'
@eth-optimism/core-utils
'
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
{
CrossChainMessenger
}
from
'
../cross-chain-messenger
'
import
{
import
{
...
@@ -50,12 +52,12 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
...
@@ -50,12 +52,12 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
this
.
messenger
=
opts
.
messenger
this
.
messenger
=
opts
.
messenger
this
.
l1Bridge
=
new
Contract
(
this
.
l1Bridge
=
new
Contract
(
toAddress
(
opts
.
l1Bridge
),
toAddress
(
opts
.
l1Bridge
),
getContractInterface
(
'
L1StandardBridge
'
)
,
l1StandardBridgeArtifact
.
abi
,
this
.
messenger
.
l1Provider
this
.
messenger
.
l1Provider
)
)
this
.
l2Bridge
=
new
Contract
(
this
.
l2Bridge
=
new
Contract
(
toAddress
(
opts
.
l2Bridge
),
toAddress
(
opts
.
l2Bridge
),
getContractInterface
(
'
L2StandardBridge
'
)
,
l2StandardBridgeArtifact
.
abi
,
this
.
messenger
.
l2Provider
this
.
messenger
.
l2Provider
)
)
}
}
...
@@ -157,7 +159,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
...
@@ -157,7 +159,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
try
{
try
{
const
contract
=
new
Contract
(
const
contract
=
new
Contract
(
toAddress
(
l2Token
),
toAddress
(
l2Token
),
getContractInterface
(
'
OptimismMintableERC20
'
)
,
optimismMintableERC20
.
abi
,
this
.
messenger
.
l2Provider
this
.
messenger
.
l2Provider
)
)
// Don't support ETH deposits or withdrawals via this bridge.
// Don't support ETH deposits or withdrawals via this bridge.
...
@@ -207,7 +209,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
...
@@ -207,7 +209,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
const
token
=
new
Contract
(
const
token
=
new
Contract
(
toAddress
(
l1Token
),
toAddress
(
l1Token
),
getContractInterface
(
'
OptimismMintableERC20
'
),
// Any ERC20 will do
optimismMintableERC20
.
abi
,
this
.
messenger
.
l1Provider
this
.
messenger
.
l1Provider
)
)
...
@@ -274,7 +276,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
...
@@ -274,7 +276,7 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
const
token
=
new
Contract
(
const
token
=
new
Contract
(
toAddress
(
l1Token
),
toAddress
(
l1Token
),
getContractInterface
(
'
OptimismMintableERC20
'
),
// Any ERC20 will do
optimismMintableERC20
.
abi
,
this
.
messenger
.
l1Provider
this
.
messenger
.
l1Provider
)
)
...
...
packages/sdk/src/utils/chain-constants.ts
View file @
8313a787
...
@@ -23,7 +23,7 @@ const l2OutputOracleAddresses = {
...
@@ -23,7 +23,7 @@ const l2OutputOracleAddresses = {
const
addressManagerAddresses
=
{
const
addressManagerAddresses
=
{
mainnet
:
addressManagerArtifactMainnet
.
address
,
mainnet
:
addressManagerArtifactMainnet
.
address
,
goerli
:
addressManagerArtifactGoerli
.
address
goerli
:
addressManagerArtifactGoerli
.
address
,
}
}
const
l1StandardBridgeAddresses
=
{
const
l1StandardBridgeAddresses
=
{
...
@@ -39,13 +39,13 @@ const l1CrossDomainMessengerAddresses = {
...
@@ -39,13 +39,13 @@ const l1CrossDomainMessengerAddresses = {
// legacy
// legacy
const
stateCommitmentChainAddresses
=
{
const
stateCommitmentChainAddresses
=
{
mainnet
:
'
0xBe5dAb4A2e9cd0F27300dB4aB94BeE3A233AEB19
'
,
mainnet
:
'
0xBe5dAb4A2e9cd0F27300dB4aB94BeE3A233AEB19
'
,
goerli
:
'
0x9c945aC97Baf48cB784AbBB61399beB71aF7A378
'
goerli
:
'
0x9c945aC97Baf48cB784AbBB61399beB71aF7A378
'
,
}
}
// legacy
// legacy
const
canonicalTransactionChainAddresses
=
{
const
canonicalTransactionChainAddresses
=
{
mainnet
:
'
0x5E4e65926BA27467555EB562121fac00D24E9dD2
'
,
mainnet
:
'
0x5E4e65926BA27467555EB562121fac00D24E9dD2
'
,
goerli
:
'
0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D
'
goerli
:
'
0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D
'
,
}
}
import
{
import
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment