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
b6c5679d
Commit
b6c5679d
authored
Apr 05, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Add local network with non-live test option
parent
9c4eeaaa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
5 deletions
+94
-5
local.ts
packages/contracts-bedrock/deploy-config/local.ts
+49
-0
mainnet.ts
packages/contracts-bedrock/deploy-config/mainnet.ts
+1
-1
020-SystemDictatorSteps-1.ts
...ges/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
+7
-2
021-SystemDictatorSteps-2.ts
...ges/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
+7
-2
hardhat.config.ts
packages/contracts-bedrock/hardhat.config.ts
+8
-0
deploy-utils.ts
packages/contracts-bedrock/src/deploy-utils.ts
+22
-0
No files found.
packages/contracts-bedrock/deploy-config/local.ts
0 → 100644
View file @
b6c5679d
import
{
DeployConfig
}
from
'
../src/deploy-config
'
const
config
:
DeployConfig
=
{
finalSystemOwner
:
'
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
'
,
controller
:
'
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
'
,
portalGuardian
:
'
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
'
,
proxyAdminOwner
:
'
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
'
,
l1StartingBlockTag
:
'
0x126e52a0cc0ae18948f567ee9443f4a8f0db67c437706e35baee424eb314a0d0
'
,
l1ChainID
:
1
,
l2ChainID
:
10
,
l2BlockTime
:
2
,
maxSequencerDrift
:
600
,
sequencerWindowSize
:
3600
,
channelTimeout
:
300
,
p2pSequencerAddress
:
'
0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
'
,
batchInboxAddress
:
'
0xff00000000000000000000000000000000000010
'
,
batchSenderAddress
:
'
0x70997970C51812dc3A010C7d01b50e0d17dc79C8
'
,
l2OutputOracleSubmissionInterval
:
20
,
l2OutputOracleStartingTimestamp
:
1679069195
,
l2OutputOracleStartingBlockNumber
:
79149704
,
l2OutputOracleProposer
:
'
0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
'
,
l2OutputOracleChallenger
:
'
0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
'
,
finalizationPeriodSeconds
:
2
,
baseFeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
l1FeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
sequencerFeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
governanceTokenName
:
'
Optimism
'
,
governanceTokenSymbol
:
'
OP
'
,
governanceTokenOwner
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
l2GenesisBlockGasLimit
:
'
0x17D7840
'
,
l2GenesisBlockCoinbase
:
'
0x4200000000000000000000000000000000000011
'
,
l2GenesisBlockBaseFeePerGas
:
'
0x3b9aca00
'
,
gasPriceOracleOverhead
:
2100
,
gasPriceOracleScalar
:
1000000
,
eip1559Denominator
:
50
,
eip1559Elasticity
:
10
,
l2GenesisRegolithTimeOffset
:
'
0x0
'
,
}
export
default
config
packages/contracts-bedrock/deploy-config/mainnet.ts
View file @
b6c5679d
...
...
@@ -7,6 +7,7 @@ const config: DeployConfig = {
finalSystemOwner
:
'
0x9BA6e03D8B90dE867373Db8cF1A58d2F7F006b3A
'
,
controller
:
'
0x78339d822c23d943e4a2d4c3dd5408f66e6d662d
'
,
portalGuardian
:
'
0x78339d822c23d943e4a2d4c3dd5408f66e6d662d
'
,
proxyAdminOwner
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
l1StartingBlockTag
:
'
0x126e52a0cc0ae18948f567ee9443f4a8f0db67c437706e35baee424eb314a0d0
'
,
...
...
@@ -28,7 +29,6 @@ const config: DeployConfig = {
l2OutputOracleChallenger
:
'
0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
'
,
finalizationPeriodSeconds
:
2
,
proxyAdminOwner
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
baseFeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
l1FeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
sequencerFeeVaultRecipient
:
'
0x90F79bf6EB2c4f870365E785982E1f101E93b906
'
,
...
...
packages/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
View file @
b6c5679d
...
...
@@ -13,6 +13,7 @@ import {
getDeploymentAddress
,
doOwnershipTransfer
,
doPhase
,
liveDeployer
,
}
from
'
../src/deploy-utils
'
const
uint128Max
=
ethers
.
BigNumber
.
from
(
'
0xffffffffffffffffffffffffffffffff
'
)
...
...
@@ -66,8 +67,12 @@ const deployFn: DeployFunction = async (hre) => {
])
// If we have the key for the controller then we don't need to wait for external txns.
const
isLiveDeployer
=
deployer
.
toLowerCase
()
===
hre
.
deployConfig
.
controller
.
toLowerCase
()
// Set the DISABLE_LIVE_DEPLOYER=true in the env to ensure the script will pause to simulate scenarios
// where the controller is not the deployer.
const
isLiveDeployer
=
await
liveDeployer
({
hre
,
disabled
:
process
.
env
.
DISABLE_LIVE_DEPLOYER
,
})
// Transfer ownership of the ProxyAdmin to the SystemDictator.
if
((
await
ProxyAdmin
.
owner
())
!==
SystemDictator
.
address
)
{
...
...
packages/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
View file @
b6c5679d
...
...
@@ -15,6 +15,7 @@ import {
doStep
,
printTenderlySimulationLink
,
printCastCommand
,
liveDeployer
,
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
...
...
@@ -82,8 +83,12 @@ const deployFn: DeployFunction = async (hre) => {
])
// If we have the key for the controller then we don't need to wait for external txns.
const
isLiveDeployer
=
deployer
.
toLowerCase
()
===
hre
.
deployConfig
.
controller
.
toLowerCase
()
// Set the DISABLE_LIVE_DEPLOYER=true in the env to ensure the script will pause to simulate scenarios
// where the controller is not the deployer.
const
isLiveDeployer
=
await
liveDeployer
({
hre
,
disabled
:
process
.
env
.
DISABLE_LIVE_DEPLOYER
,
})
// Step 3 clears out some state from the AddressManager.
await
doStep
({
...
...
packages/contracts-bedrock/hardhat.config.ts
View file @
b6c5679d
...
...
@@ -22,6 +22,14 @@ const config: HardhatUserConfig = {
hardhat
:
{
live
:
false
,
},
local
:
{
live
:
false
,
url
:
'
http://localhost:8545
'
,
saveDeployments
:
false
,
accounts
:
[
'
ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
'
,
],
},
// NOTE: The 'mainnet' network is currently being used for mainnet rehearsals.
mainnet
:
{
url
:
process
.
env
.
L1_RPC
||
'
https://mainnet-l1-rehearsal.optimism.io
'
,
...
...
packages/contracts-bedrock/src/deploy-utils.ts
View file @
b6c5679d
...
...
@@ -355,6 +355,28 @@ export const doOwnershipTransfer = async (opts: {
}
}
/**
* Check if the script should submit the transaction or wait for the deployer to do it manually.
*
* @param hre HardhatRuntimeEnvironment.
* @param ovveride Allow m
* @returns True if the current step is the target step.
*/
export
const
liveDeployer
=
async
(
opts
:
{
hre
:
HardhatRuntimeEnvironment
disabled
:
string
|
undefined
}):
Promise
<
boolean
>
=>
{
let
ret
:
boolean
if
(
!!
opts
.
disabled
)
{
ret
=
false
}
const
{
deployer
}
=
await
opts
.
hre
.
getNamedAccounts
()
ret
=
deployer
.
toLowerCase
()
===
opts
.
hre
.
deployConfig
.
controller
.
toLowerCase
()
console
.
log
(
'
Setting live deployer to
'
,
ret
)
return
ret
}
/**
* Mini helper for checking if the current step is a target step.
*
...
...
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