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
c9604177
Unverified
Commit
c9604177
authored
Oct 01, 2021
by
Kelvin Fichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: correctly set all deploy constants
parent
e4a1129c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
0 deletions
+128
-0
predeploys.spec.ts
integration-tests/test/predeploys.spec.ts
+120
-0
make-genesis.ts
packages/contracts/src/make-genesis.ts
+8
-0
No files found.
integration-tests/test/predeploys.spec.ts
0 → 100644
View file @
c9604177
import
chai
,
{
expect
}
from
'
chai
'
import
{
solidity
}
from
'
ethereum-waffle
'
chai
.
use
(
solidity
)
/* Imports: Internal */
import
{
ethers
}
from
'
ethers
'
import
{
predeploys
,
getContractInterface
}
from
'
@eth-optimism/contracts
'
/* Imports: External */
import
{
OptimismEnv
}
from
'
./shared/env
'
describe
(
'
predeploys
'
,
()
=>
{
let
env
:
OptimismEnv
before
(
async
()
=>
{
env
=
await
OptimismEnv
.
new
()
})
describe
(
'
WETH9
'
,
()
=>
{
let
weth9
:
ethers
.
Contract
before
(()
=>
{
weth9
=
new
ethers
.
Contract
(
predeploys
.
WETH9
,
getContractInterface
(
'
WETH9
'
),
env
.
l2Wallet
)
})
it
(
'
should have the correct name
'
,
async
()
=>
{
expect
(
await
weth9
.
name
()).
to
.
equal
(
'
Wrapped Ether
'
)
})
it
(
'
should have the correct symbol
'
,
async
()
=>
{
expect
(
await
weth9
.
symbol
()).
to
.
equal
(
'
WETH
'
)
})
it
(
'
should have the correct decimals
'
,
async
()
=>
{
expect
(
await
weth9
.
decimals
()).
to
.
equal
(
18
)
})
})
describe
(
'
OVM_ETH
'
,
()
=>
{
let
ovmEth
:
ethers
.
Contract
before
(()
=>
{
ovmEth
=
new
ethers
.
Contract
(
predeploys
.
OVM_ETH
,
getContractInterface
(
'
OVM_ETH
'
),
env
.
l2Wallet
)
})
it
(
'
should have the correct name
'
,
async
()
=>
{
expect
(
await
ovmEth
.
name
()).
to
.
equal
(
'
Ether
'
)
})
it
(
'
should have the correct symbol
'
,
async
()
=>
{
expect
(
await
ovmEth
.
symbol
()).
to
.
equal
(
'
ETH
'
)
})
it
(
'
should have the correct decimals
'
,
async
()
=>
{
expect
(
await
ovmEth
.
decimals
()).
to
.
equal
(
18
)
})
})
describe
(
'
L2CrossDomainMessenger
'
,
()
=>
{
let
l2CrossDomainMessenger
:
ethers
.
Contract
before
(()
=>
{
l2CrossDomainMessenger
=
new
ethers
.
Contract
(
predeploys
.
L2CrossDomainMessenger
,
getContractInterface
(
'
L2CrossDomainMessenger
'
),
env
.
l2Wallet
)
})
it
(
'
should throw when calling xDomainMessageSender
'
,
async
()
=>
{
await
expect
(
l2CrossDomainMessenger
.
xDomainMessageSender
()
).
to
.
be
.
revertedWith
(
'
xDomainMessageSender is not set
'
)
})
})
describe
(
'
L2StandardBridge
'
,
()
=>
{
let
l2StandardBridge
:
ethers
.
Contract
before
(()
=>
{
l2StandardBridge
=
new
ethers
.
Contract
(
predeploys
.
L2StandardBridge
,
getContractInterface
(
'
L2StandardBridge
'
),
env
.
l2Wallet
)
})
it
(
'
should have the correct messenger address
'
,
async
()
=>
{
expect
(
await
l2StandardBridge
.
messenger
()).
to
.
equal
(
predeploys
.
L2CrossDomainMessenger
)
})
it
(
'
should have a nonzero bridge address
'
,
async
()
=>
{
expect
(
await
l2StandardBridge
.
l1TokenBridge
()).
to
.
not
.
equal
(
ethers
.
constants
.
AddressZero
)
})
})
describe
(
'
OVM_SequencerFeeVault
'
,
()
=>
{
let
ovmSequencerFeeVault
:
ethers
.
Contract
before
(()
=>
{
ovmSequencerFeeVault
=
new
ethers
.
Contract
(
predeploys
.
OVM_SequencerFeeVault
,
getContractInterface
(
'
OVM_SequencerFeeVault
'
),
env
.
l2Wallet
)
})
it
(
'
should have a nonzero l1FeeWallet
'
,
async
()
=>
{
expect
(
await
ovmSequencerFeeVault
.
l1FeeWallet
()).
to
.
not
.
equal
(
ethers
.
constants
.
AddressZero
)
})
})
})
packages/contracts/src/make-genesis.ts
View file @
c9604177
...
...
@@ -79,8 +79,16 @@ export const makeL2GenesisFile = async (
_symbol
:
'
ETH
'
,
},
L2CrossDomainMessenger
:
{
// We default the xDomainMsgSender to this value to save gas.
// See usage of this default in the L2CrossDomainMessenger contract.
xDomainMsgSender
:
'
0x000000000000000000000000000000000000dEaD
'
,
l1CrossDomainMessenger
:
cfg
.
l1CrossDomainMessengerAddress
,
},
WETH9
:
{
name
:
'
Wrapped Ether
'
,
symbol
:
'
WETH
'
,
decimals
:
18
,
},
}
const
dump
=
{}
...
...
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