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
56d31558
Unverified
Commit
56d31558
authored
Dec 07, 2022
by
Matthew Slipper
Committed by
GitHub
Dec 07, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4293 from ethereum-optimism/sc/ctb-require-fso-controller
feat(ctb): make owner and controller required
parents
20c0474e
a4b294e6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
102 deletions
+31
-102
devnetL1.json
packages/contracts-bedrock/deploy-config/devnetL1.json
+1
-0
goerli-forked.json
packages/contracts-bedrock/deploy-config/goerli-forked.json
+1
-0
hardhat.json
packages/contracts-bedrock/deploy-config/hardhat.json
+1
-0
017-SystemConfigImpl.ts
packages/contracts-bedrock/deploy/017-SystemConfigImpl.ts
+6
-21
019-SystemDictatorInit.ts
packages/contracts-bedrock/deploy/019-SystemDictatorInit.ts
+8
-40
020-SystemDictatorSteps.ts
packages/contracts-bedrock/deploy/020-SystemDictatorSteps.ts
+14
-39
deploy-config.ts
packages/contracts-bedrock/src/deploy-config.ts
+0
-2
No files found.
packages/contracts-bedrock/deploy-config/devnetL1.json
View file @
56d31558
...
...
@@ -21,6 +21,7 @@
"sequencerFeeVaultRecipient"
:
"0xfabb0ac9d68b0b445fb7357272ff202c5651694a"
,
"proxyAdminOwner"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"finalSystemOwner"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"controller"
:
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
,
"finalizationPeriodSeconds"
:
2
,
"deploymentWaitConfirmations"
:
1
,
"fundDevAccounts"
:
true
,
...
...
packages/contracts-bedrock/deploy-config/goerli-forked.json
View file @
56d31558
{
"finalSystemOwner"
:
"0x62790eFcB3a5f3A5D398F95B47930A9Addd83807"
,
"controller"
:
"0x62790eFcB3a5f3A5D398F95B47930A9Addd83807"
,
"l1StartingBlockTag"
:
"0xcbcbf93fa6ef953a491466311fce85846252a808aa3cc6a8fd432afc5ea4487b"
,
"l1ChainID"
:
5
,
...
...
packages/contracts-bedrock/deploy-config/hardhat.json
View file @
56d31558
{
"finalSystemOwner"
:
"0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc"
,
"controller"
:
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
,
"l1StartingBlockTag"
:
"earliest"
,
"l1ChainID"
:
900
,
...
...
packages/contracts-bedrock/deploy/017-SystemConfigImpl.ts
View file @
56d31558
import
{
ethers
}
from
'
ethers
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
{
assertContractVariable
,
deploy
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
let
finalOwner
=
hre
.
deployConfig
.
finalSystemOwner
if
(
finalOwner
===
ethers
.
constants
.
AddressZero
)
{
if
(
hre
.
network
.
config
.
live
===
false
)
{
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!! A proxy admin owner address was not provided.`
)
console
.
log
(
`WARNING!!! Make sure you are ONLY doing this on a test network.`
)
finalOwner
=
deployer
}
else
{
throw
new
Error
(
`must specify the finalSystemOwner on live networks`
)
}
}
const
batcherHash
=
hre
.
ethers
.
utils
.
hexZeroPad
(
hre
.
deployConfig
.
batchSenderAddress
,
32
...
...
@@ -32,14 +13,18 @@ const deployFn: DeployFunction = async (hre) => {
hre
,
name
:
'
SystemConfig
'
,
args
:
[
final
Owner
,
hre
.
deployConfig
.
finalSystem
Owner
,
hre
.
deployConfig
.
gasPriceOracleOverhead
,
hre
.
deployConfig
.
gasPriceOracleScalar
,
batcherHash
,
hre
.
deployConfig
.
l2GenesisBlockGasLimit
,
],
postDeployAction
:
async
(
contract
)
=>
{
await
assertContractVariable
(
contract
,
'
owner
'
,
finalOwner
)
await
assertContractVariable
(
contract
,
'
owner
'
,
hre
.
deployConfig
.
finalSystemOwner
)
await
assertContractVariable
(
contract
,
'
overhead
'
,
...
...
packages/contracts-bedrock/deploy/019-SystemDictatorInit.ts
View file @
56d31558
...
...
@@ -14,40 +14,6 @@ import {
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
let
controller
=
hre
.
deployConfig
.
controller
if
(
controller
===
ethers
.
constants
.
AddressZero
)
{
if
(
hre
.
network
.
config
.
live
===
false
)
{
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!! A controller address was not provided.`
)
console
.
log
(
`WARNING!!! Make sure you are ONLY doing this on a test network.`
)
controller
=
deployer
}
else
{
throw
new
Error
(
`controller address MUST NOT be the deployer on live networks`
)
}
}
let
finalOwner
=
hre
.
deployConfig
.
finalSystemOwner
if
(
finalOwner
===
ethers
.
constants
.
AddressZero
)
{
if
(
hre
.
network
.
config
.
live
===
false
)
{
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!! A proxy admin owner address was not provided.`
)
console
.
log
(
`WARNING!!! Make sure you are ONLY doing this on a test network.`
)
finalOwner
=
deployer
}
else
{
throw
new
Error
(
`must specify the finalSystemOwner on live networks`
)
}
}
// Load the contracts we need to interact with.
const
[
SystemDictator
,
...
...
@@ -77,8 +43,8 @@ const deployFn: DeployFunction = async (hre) => {
const
config
=
{
globalConfig
:
{
proxyAdmin
:
await
getDeploymentAddress
(
hre
,
'
ProxyAdmin
'
),
controller
,
finalOwner
,
controller
:
hre
.
deployConfig
.
controller
,
finalOwner
:
hre
.
deployConfig
.
finalSystemOwner
,
addressManager
:
await
getDeploymentAddress
(
hre
,
'
Lib_AddressManager
'
),
},
proxyAddressConfig
:
{
...
...
@@ -125,7 +91,7 @@ const deployFn: DeployFunction = async (hre) => {
systemConfigImpl
:
await
getDeploymentAddress
(
hre
,
'
SystemConfig
'
),
},
systemConfigConfig
:
{
owner
:
final
Owner
,
owner
:
hre
.
deployConfig
.
finalSystem
Owner
,
overhead
:
hre
.
deployConfig
.
gasPriceOracleOverhead
,
scalar
:
hre
.
deployConfig
.
gasPriceOracleDecimals
,
batcherHash
:
hre
.
ethers
.
utils
.
hexZeroPad
(
...
...
@@ -197,12 +163,14 @@ const deployFn: DeployFunction = async (hre) => {
if
(
(
await
SystemDictatorProxy
.
callStatic
.
admin
({
from
:
ethers
.
constants
.
AddressZero
,
}))
!==
controller
}))
!==
hre
.
deployConfig
.
controller
)
{
console
.
log
(
'
Transferring ownership of the SystemDictator proxy...
'
)
// Transfer ownership to the controller address.
await
SystemDictatorProxyWithSigner
.
transferOwnership
(
controller
)
await
SystemDictatorProxyWithSigner
.
transferOwnership
(
hre
.
deployConfig
.
controller
)
// Wait for the transaction to execute properly.
await
awaitCondition
(
...
...
@@ -210,7 +178,7 @@ const deployFn: DeployFunction = async (hre) => {
return
(
(
await
SystemDictatorProxy
.
callStatic
.
admin
({
from
:
ethers
.
constants
.
AddressZero
,
}))
===
controller
}))
===
hre
.
deployConfig
.
controller
)
},
30000
,
...
...
packages/contracts-bedrock/deploy/020-SystemDictatorSteps.ts
View file @
56d31558
...
...
@@ -16,43 +16,6 @@ import {
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
let
isLiveDeployer
=
false
let
controller
=
hre
.
deployConfig
.
controller
if
(
controller
===
ethers
.
constants
.
AddressZero
)
{
if
(
hre
.
network
.
config
.
live
===
false
)
{
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!! A controller address was not provided.`
)
console
.
log
(
`WARNING!!! Make sure you are ONLY doing this on a test network.`
)
console
.
log
(
'
using a live deployer
'
)
isLiveDeployer
=
true
controller
=
deployer
}
else
{
throw
new
Error
(
`controller address MUST NOT be the deployer on live networks`
)
}
}
let
finalOwner
=
hre
.
deployConfig
.
finalSystemOwner
if
(
finalOwner
===
ethers
.
constants
.
AddressZero
)
{
if
(
hre
.
network
.
config
.
live
===
false
)
{
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!! A proxy admin owner address was not provided.`
)
console
.
log
(
`WARNING!!! Make sure you are ONLY doing this on a test network.`
)
finalOwner
=
deployer
}
else
{
throw
new
Error
(
`must specify the finalSystemOwner on live networks`
)
}
}
// Set up required contract references.
const
[
SystemDictator
,
...
...
@@ -128,6 +91,10 @@ 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
()
// Transfer ownership of the ProxyAdmin to the SystemDictator.
if
((
await
ProxyAdmin
.
owner
())
!==
SystemDictator
.
address
)
{
console
.
log
(
`Setting ProxyAdmin owner to MSD`
)
...
...
@@ -570,8 +537,16 @@ const deployFn: DeployFunction = async (hre) => {
1000
)
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
owner
'
,
finalOwner
)
await
assertContractVariable
(
ProxyAdmin
,
'
owner
'
,
finalOwner
)
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
owner
'
,
hre
.
deployConfig
.
finalSystemOwner
)
await
assertContractVariable
(
ProxyAdmin
,
'
owner
'
,
hre
.
deployConfig
.
finalSystemOwner
)
}
}
...
...
packages/contracts-bedrock/src/deploy-config.ts
View file @
56d31558
...
...
@@ -165,11 +165,9 @@ export const deployConfigSpec: {
},
finalSystemOwner
:
{
type
:
'
address
'
,
default
:
ethers
.
constants
.
AddressZero
,
},
controller
:
{
type
:
'
address
'
,
default
:
ethers
.
constants
.
AddressZero
,
},
l1StartingBlockTag
:
{
type
:
'
string
'
,
...
...
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