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
b55f4d73
Unverified
Commit
b55f4d73
authored
Sep 25, 2024
by
Blaine Malone
Committed by
GitHub
Sep 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename: OPStackManafer -> OPContractsManager (#12091)
parent
da9bc723
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
275 additions
and
266 deletions
+275
-266
Makefile
op-chain-ops/Makefile
+1
-1
apply_test.go
op-chain-ops/deployer/integration_test/apply_test.go
+1
-1
implementations.go
op-chain-ops/deployer/opcm/implementations.go
+8
-8
l2genesis.go
op-chain-ops/deployer/opcm/l2genesis.go
+1
-1
opchain.go
op-chain-ops/deployer/opcm/opchain.go
+2
-2
standard-versions.toml
op-chain-ops/deployer/opcm/standard-versions.toml
+0
-0
standard.go
op-chain-ops/deployer/opcm/standard.go
+1
-1
superchain.go
op-chain-ops/deployer/opcm/superchain.go
+1
-1
implementations.go
op-chain-ops/deployer/pipeline/implementations.go
+6
-6
l2genesis.go
op-chain-ops/deployer/pipeline/l2genesis.go
+3
-3
opchain.go
op-chain-ops/deployer/pipeline/opchain.go
+5
-5
superchain.go
op-chain-ops/deployer/pipeline/superchain.go
+4
-4
state.go
op-chain-ops/deployer/state/state.go
+1
-1
configs.go
op-chain-ops/interopgen/configs.go
+2
-2
deploy.go
op-chain-ops/interopgen/deploy.go
+8
-9
deployments.go
op-chain-ops/interopgen/deployments.go
+2
-2
recipe.go
op-chain-ops/interopgen/recipe.go
+3
-3
DeployImplementations.s.sol
...ges/contracts-bedrock/scripts/DeployImplementations.s.sol
+107
-97
DeployOPChain.s.sol
packages/contracts-bedrock/scripts/DeployOPChain.s.sol
+19
-19
DeploySuperchain.s.sol
packages/contracts-bedrock/scripts/DeploySuperchain.s.sol
+1
-1
semver-lock.json
packages/contracts-bedrock/semver-lock.json
+2
-2
OPContractsManager.json
...s/contracts-bedrock/snapshots/abi/OPContractsManager.json
+8
-8
OPContractsManagerInterop.json
...acts-bedrock/snapshots/abi/OPContractsManagerInterop.json
+8
-8
OPContractsManager.json
...s-bedrock/snapshots/storageLayout/OPContractsManager.json
+2
-2
OPContractsManagerInterop.json
...ck/snapshots/storageLayout/OPContractsManagerInterop.json
+2
-2
OPContractsManager.sol
packages/contracts-bedrock/src/L1/OPContractsManager.sol
+4
-4
OPContractsManagerInterop.sol
...es/contracts-bedrock/src/L1/OPContractsManagerInterop.sol
+3
-3
DeployImplementations.t.sol
packages/contracts-bedrock/test/DeployImplementations.t.sol
+9
-9
DeployOPChain.t.sol
packages/contracts-bedrock/test/DeployOPChain.t.sol
+11
-11
OPContractsManager.t.sol
packages/contracts-bedrock/test/L1/OPContractsManager.t.sol
+24
-24
Specs.t.sol
packages/contracts-bedrock/test/Specs.t.sol
+24
-24
Initializable.t.sol
packages/contracts-bedrock/test/vendor/Initializable.t.sol
+2
-2
No files found.
op-chain-ops/Makefile
View file @
b55f4d73
...
@@ -46,6 +46,6 @@ fuzz:
...
@@ -46,6 +46,6 @@ fuzz:
sync-standard-version
:
sync-standard-version
:
curl
-Lo
./deployer/op
s
m/standard-versions.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions.toml
curl
-Lo
./deployer/op
c
m/standard-versions.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions.toml
.PHONY
:
test fuzz op-deployer sync-standard-version
.PHONY
:
test fuzz op-deployer sync-standard-version
\ No newline at end of file
op-chain-ops/deployer/integration_test/apply_test.go
View file @
b55f4d73
...
@@ -151,7 +151,7 @@ func TestEndToEndApply(t *testing.T) {
...
@@ -151,7 +151,7 @@ func TestEndToEndApply(t *testing.T) {
{
"SuperchainConfigImpl"
,
st
.
SuperchainDeployment
.
SuperchainConfigImplAddress
},
{
"SuperchainConfigImpl"
,
st
.
SuperchainDeployment
.
SuperchainConfigImplAddress
},
{
"ProtocolVersionsProxy"
,
st
.
SuperchainDeployment
.
ProtocolVersionsProxyAddress
},
{
"ProtocolVersionsProxy"
,
st
.
SuperchainDeployment
.
ProtocolVersionsProxyAddress
},
{
"ProtocolVersionsImpl"
,
st
.
SuperchainDeployment
.
ProtocolVersionsImplAddress
},
{
"ProtocolVersionsImpl"
,
st
.
SuperchainDeployment
.
ProtocolVersionsImplAddress
},
{
"Op
smProxy"
,
st
.
ImplementationsDeployment
.
Ops
mProxyAddress
},
{
"Op
cmProxy"
,
st
.
ImplementationsDeployment
.
Opc
mProxyAddress
},
{
"DelayedWETHImpl"
,
st
.
ImplementationsDeployment
.
DelayedWETHImplAddress
},
{
"DelayedWETHImpl"
,
st
.
ImplementationsDeployment
.
DelayedWETHImplAddress
},
{
"OptimismPortalImpl"
,
st
.
ImplementationsDeployment
.
OptimismPortalImplAddress
},
{
"OptimismPortalImpl"
,
st
.
ImplementationsDeployment
.
OptimismPortalImplAddress
},
{
"PreimageOracleSingleton"
,
st
.
ImplementationsDeployment
.
PreimageOracleSingletonAddress
},
{
"PreimageOracleSingleton"
,
st
.
ImplementationsDeployment
.
PreimageOracleSingletonAddress
},
...
...
op-chain-ops/deployer/op
s
m/implementations.go
→
op-chain-ops/deployer/op
c
m/implementations.go
View file @
b55f4d73
package
op
s
m
package
op
c
m
import
(
import
(
"fmt"
"fmt"
...
@@ -16,7 +16,7 @@ type DeployImplementationsInput struct {
...
@@ -16,7 +16,7 @@ type DeployImplementationsInput struct {
ChallengePeriodSeconds
*
big
.
Int
ChallengePeriodSeconds
*
big
.
Int
ProofMaturityDelaySeconds
*
big
.
Int
ProofMaturityDelaySeconds
*
big
.
Int
DisputeGameFinalityDelaySeconds
*
big
.
Int
DisputeGameFinalityDelaySeconds
*
big
.
Int
// Release version to set OP
S
M implementations for, of the format `op-contracts/vX.Y.Z`.
// Release version to set OP
C
M implementations for, of the format `op-contracts/vX.Y.Z`.
Release
string
Release
string
SuperchainConfigProxy
common
.
Address
SuperchainConfigProxy
common
.
Address
ProtocolVersionsProxy
common
.
Address
ProtocolVersionsProxy
common
.
Address
...
@@ -31,8 +31,8 @@ func (input *DeployImplementationsInput) InputSet() bool {
...
@@ -31,8 +31,8 @@ func (input *DeployImplementationsInput) InputSet() bool {
}
}
type
DeployImplementationsOutput
struct
{
type
DeployImplementationsOutput
struct
{
Op
s
mProxy
common
.
Address
Op
c
mProxy
common
.
Address
Op
s
mImpl
common
.
Address
Op
c
mImpl
common
.
Address
DelayedWETHImpl
common
.
Address
DelayedWETHImpl
common
.
Address
OptimismPortalImpl
common
.
Address
OptimismPortalImpl
common
.
Address
PreimageOracleSingleton
common
.
Address
PreimageOracleSingleton
common
.
Address
...
@@ -84,12 +84,12 @@ func DeployImplementations(
...
@@ -84,12 +84,12 @@ func DeployImplementations(
}
}
defer
cleanupDeploy
()
defer
cleanupDeploy
()
op
smContract
:=
"OPStack
Manager"
op
cmContract
:=
"OPContracts
Manager"
if
input
.
UseInterop
{
if
input
.
UseInterop
{
op
smContract
=
"OPStack
ManagerInterop"
op
cmContract
=
"OPContracts
ManagerInterop"
}
}
if
err
:=
host
.
RememberOnLabel
(
"OP
StackManager"
,
opsmContract
+
".sol"
,
ops
mContract
);
err
!=
nil
{
if
err
:=
host
.
RememberOnLabel
(
"OP
ContractsManager"
,
opcmContract
+
".sol"
,
opc
mContract
);
err
!=
nil
{
return
output
,
fmt
.
Errorf
(
"failed to link OP
Stack
Manager label: %w"
,
err
)
return
output
,
fmt
.
Errorf
(
"failed to link OP
Contracts
Manager label: %w"
,
err
)
}
}
// So we can see in detail where the SystemConfig interop initializer fails
// So we can see in detail where the SystemConfig interop initializer fails
...
...
op-chain-ops/deployer/op
s
m/l2genesis.go
→
op-chain-ops/deployer/op
c
m/l2genesis.go
View file @
b55f4d73
package
op
s
m
package
op
c
m
import
(
import
(
"fmt"
"fmt"
...
...
op-chain-ops/deployer/op
s
m/opchain.go
→
op-chain-ops/deployer/op
c
m/opchain.go
View file @
b55f4d73
package
op
s
m
package
op
c
m
import
(
import
(
"fmt"
"fmt"
...
@@ -26,7 +26,7 @@ type DeployOPChainInput struct {
...
@@ -26,7 +26,7 @@ type DeployOPChainInput struct {
BasefeeScalar
uint32
BasefeeScalar
uint32
BlobBaseFeeScalar
uint32
BlobBaseFeeScalar
uint32
L2ChainId
*
big
.
Int
L2ChainId
*
big
.
Int
Op
s
mProxy
common
.
Address
Op
c
mProxy
common
.
Address
}
}
func
(
input
*
DeployOPChainInput
)
InputSet
()
bool
{
func
(
input
*
DeployOPChainInput
)
InputSet
()
bool
{
...
...
op-chain-ops/deployer/op
s
m/standard-versions.toml
→
op-chain-ops/deployer/op
c
m/standard-versions.toml
View file @
b55f4d73
File moved
op-chain-ops/deployer/op
s
m/standard.go
→
op-chain-ops/deployer/op
c
m/standard.go
View file @
b55f4d73
package
op
s
m
package
op
c
m
import
"embed"
import
"embed"
...
...
op-chain-ops/deployer/op
s
m/superchain.go
→
op-chain-ops/deployer/op
c
m/superchain.go
View file @
b55f4d73
package
op
s
m
package
op
c
m
import
(
import
(
"fmt"
"fmt"
...
...
op-chain-ops/deployer/pipeline/implementations.go
View file @
b55f4d73
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"fmt"
"fmt"
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
s
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
c
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
...
@@ -22,7 +22,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
...
@@ -22,7 +22,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
lgr
.
Info
(
"deploying implementations"
)
lgr
.
Info
(
"deploying implementations"
)
var
dump
*
foundry
.
ForgeAllocs
var
dump
*
foundry
.
ForgeAllocs
var
dio
op
s
m
.
DeployImplementationsOutput
var
dio
op
c
m
.
DeployImplementationsOutput
var
err
error
var
err
error
err
=
CallScriptBroadcast
(
err
=
CallScriptBroadcast
(
ctx
,
ctx
,
...
@@ -37,9 +37,9 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
...
@@ -37,9 +37,9 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
Handler
:
func
(
host
*
script
.
Host
)
error
{
Handler
:
func
(
host
*
script
.
Host
)
error
{
host
.
SetEnvVar
(
"IMPL_SALT"
,
st
.
Create2Salt
.
Hex
()[
2
:
])
host
.
SetEnvVar
(
"IMPL_SALT"
,
st
.
Create2Salt
.
Hex
()[
2
:
])
host
.
ImportState
(
st
.
SuperchainDeployment
.
StateDump
)
host
.
ImportState
(
st
.
SuperchainDeployment
.
StateDump
)
dio
,
err
=
op
s
m
.
DeployImplementations
(
dio
,
err
=
op
c
m
.
DeployImplementations
(
host
,
host
,
op
s
m
.
DeployImplementationsInput
{
op
c
m
.
DeployImplementationsInput
{
Salt
:
st
.
Create2Salt
,
Salt
:
st
.
Create2Salt
,
WithdrawalDelaySeconds
:
big
.
NewInt
(
604800
),
WithdrawalDelaySeconds
:
big
.
NewInt
(
604800
),
MinProposalSizeBytes
:
big
.
NewInt
(
126000
),
MinProposalSizeBytes
:
big
.
NewInt
(
126000
),
...
@@ -50,7 +50,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
...
@@ -50,7 +50,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
SuperchainConfigProxy
:
st
.
SuperchainDeployment
.
SuperchainConfigProxyAddress
,
SuperchainConfigProxy
:
st
.
SuperchainDeployment
.
SuperchainConfigProxyAddress
,
ProtocolVersionsProxy
:
st
.
SuperchainDeployment
.
ProtocolVersionsProxyAddress
,
ProtocolVersionsProxy
:
st
.
SuperchainDeployment
.
ProtocolVersionsProxyAddress
,
SuperchainProxyAdmin
:
st
.
SuperchainDeployment
.
ProxyAdminAddress
,
SuperchainProxyAdmin
:
st
.
SuperchainDeployment
.
ProxyAdminAddress
,
StandardVersionsToml
:
op
s
m
.
StandardVersionsData
,
StandardVersionsToml
:
op
c
m
.
StandardVersionsData
,
UseInterop
:
false
,
UseInterop
:
false
,
},
},
)
)
...
@@ -70,7 +70,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
...
@@ -70,7 +70,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
}
}
st
.
ImplementationsDeployment
=
&
state
.
ImplementationsDeployment
{
st
.
ImplementationsDeployment
=
&
state
.
ImplementationsDeployment
{
Op
smProxyAddress
:
dio
.
Ops
mProxy
,
Op
cmProxyAddress
:
dio
.
Opc
mProxy
,
DelayedWETHImplAddress
:
dio
.
DelayedWETHImpl
,
DelayedWETHImplAddress
:
dio
.
DelayedWETHImpl
,
OptimismPortalImplAddress
:
dio
.
OptimismPortalImpl
,
OptimismPortalImplAddress
:
dio
.
OptimismPortalImpl
,
PreimageOracleSingletonAddress
:
dio
.
PreimageOracleSingleton
,
PreimageOracleSingletonAddress
:
dio
.
PreimageOracleSingleton
,
...
...
op-chain-ops/deployer/pipeline/l2genesis.go
View file @
b55f4d73
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
"fmt"
"fmt"
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
s
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
c
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
...
@@ -47,8 +47,8 @@ func GenerateL2Genesis(ctx context.Context, env *Env, artifactsFS foundry.StatDi
...
@@ -47,8 +47,8 @@ func GenerateL2Genesis(ctx context.Context, env *Env, artifactsFS foundry.StatDi
Client
:
env
.
L1Client
,
Client
:
env
.
L1Client
,
Broadcaster
:
DiscardBroadcaster
,
Broadcaster
:
DiscardBroadcaster
,
Handler
:
func
(
host
*
script
.
Host
)
error
{
Handler
:
func
(
host
*
script
.
Host
)
error
{
err
:=
op
sm
.
L2Genesis
(
host
,
&
ops
m
.
L2GenesisInput
{
err
:=
op
cm
.
L2Genesis
(
host
,
&
opc
m
.
L2GenesisInput
{
L1Deployments
:
op
s
m
.
L1Deployments
{
L1Deployments
:
op
c
m
.
L1Deployments
{
L1CrossDomainMessengerProxy
:
thisChainState
.
L1CrossDomainMessengerProxyAddress
,
L1CrossDomainMessengerProxy
:
thisChainState
.
L1CrossDomainMessengerProxyAddress
,
L1StandardBridgeProxy
:
thisChainState
.
L1StandardBridgeProxyAddress
,
L1StandardBridgeProxy
:
thisChainState
.
L1StandardBridgeProxyAddress
,
L1ERC721BridgeProxy
:
thisChainState
.
L1ERC721BridgeProxyAddress
,
L1ERC721BridgeProxy
:
thisChainState
.
L1ERC721BridgeProxyAddress
,
...
...
op-chain-ops/deployer/pipeline/opchain.go
View file @
b55f4d73
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"fmt"
"fmt"
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
s
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
c
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
...
@@ -27,7 +27,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
...
@@ -27,7 +27,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
return
fmt
.
Errorf
(
"failed to get chain intent: %w"
,
err
)
return
fmt
.
Errorf
(
"failed to get chain intent: %w"
,
err
)
}
}
var
dco
op
s
m
.
DeployOPChainOutput
var
dco
op
c
m
.
DeployOPChainOutput
err
=
CallScriptBroadcast
(
err
=
CallScriptBroadcast
(
ctx
,
ctx
,
CallScriptBroadcastOpts
{
CallScriptBroadcastOpts
{
...
@@ -40,9 +40,9 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
...
@@ -40,9 +40,9 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
Broadcaster
:
KeyedBroadcaster
,
Broadcaster
:
KeyedBroadcaster
,
Handler
:
func
(
host
*
script
.
Host
)
error
{
Handler
:
func
(
host
*
script
.
Host
)
error
{
host
.
ImportState
(
st
.
ImplementationsDeployment
.
StateDump
)
host
.
ImportState
(
st
.
ImplementationsDeployment
.
StateDump
)
dco
,
err
=
op
s
m
.
DeployOPChain
(
dco
,
err
=
op
c
m
.
DeployOPChain
(
host
,
host
,
op
s
m
.
DeployOPChainInput
{
op
c
m
.
DeployOPChainInput
{
OpChainProxyAdminOwner
:
thisIntent
.
Roles
.
ProxyAdminOwner
,
OpChainProxyAdminOwner
:
thisIntent
.
Roles
.
ProxyAdminOwner
,
SystemConfigOwner
:
thisIntent
.
Roles
.
SystemConfigOwner
,
SystemConfigOwner
:
thisIntent
.
Roles
.
SystemConfigOwner
,
Batcher
:
thisIntent
.
Roles
.
Batcher
,
Batcher
:
thisIntent
.
Roles
.
Batcher
,
...
@@ -52,7 +52,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
...
@@ -52,7 +52,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
BasefeeScalar
:
1368
,
BasefeeScalar
:
1368
,
BlobBaseFeeScalar
:
801949
,
BlobBaseFeeScalar
:
801949
,
L2ChainId
:
chainID
.
Big
(),
L2ChainId
:
chainID
.
Big
(),
Op
smProxy
:
st
.
ImplementationsDeployment
.
Ops
mProxyAddress
,
Op
cmProxy
:
st
.
ImplementationsDeployment
.
Opc
mProxyAddress
,
},
},
)
)
return
err
return
err
...
...
op-chain-ops/deployer/pipeline/superchain.go
View file @
b55f4d73
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
s
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
c
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
...
@@ -24,7 +24,7 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
...
@@ -24,7 +24,7 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
lgr
.
Info
(
"deploying superchain"
)
lgr
.
Info
(
"deploying superchain"
)
var
dump
*
foundry
.
ForgeAllocs
var
dump
*
foundry
.
ForgeAllocs
var
dso
op
s
m
.
DeploySuperchainOutput
var
dso
op
c
m
.
DeploySuperchainOutput
var
err
error
var
err
error
err
=
CallScriptBroadcast
(
err
=
CallScriptBroadcast
(
ctx
,
ctx
,
...
@@ -37,9 +37,9 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
...
@@ -37,9 +37,9 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
Client
:
env
.
L1Client
,
Client
:
env
.
L1Client
,
Broadcaster
:
KeyedBroadcaster
,
Broadcaster
:
KeyedBroadcaster
,
Handler
:
func
(
host
*
script
.
Host
)
error
{
Handler
:
func
(
host
*
script
.
Host
)
error
{
dso
,
err
=
op
s
m
.
DeploySuperchain
(
dso
,
err
=
op
c
m
.
DeploySuperchain
(
host
,
host
,
op
s
m
.
DeploySuperchainInput
{
op
c
m
.
DeploySuperchainInput
{
ProxyAdminOwner
:
intent
.
SuperchainRoles
.
ProxyAdminOwner
,
ProxyAdminOwner
:
intent
.
SuperchainRoles
.
ProxyAdminOwner
,
ProtocolVersionsOwner
:
intent
.
SuperchainRoles
.
ProtocolVersionsOwner
,
ProtocolVersionsOwner
:
intent
.
SuperchainRoles
.
ProtocolVersionsOwner
,
Guardian
:
intent
.
SuperchainRoles
.
Guardian
,
Guardian
:
intent
.
SuperchainRoles
.
Guardian
,
...
...
op-chain-ops/deployer/state/state.go
View file @
b55f4d73
...
@@ -65,7 +65,7 @@ type SuperchainDeployment struct {
...
@@ -65,7 +65,7 @@ type SuperchainDeployment struct {
}
}
type
ImplementationsDeployment
struct
{
type
ImplementationsDeployment
struct
{
Op
smProxyAddress
common
.
Address
`json:"ops
mProxyAddress"`
Op
cmProxyAddress
common
.
Address
`json:"opc
mProxyAddress"`
DelayedWETHImplAddress
common
.
Address
`json:"delayedWETHImplAddress"`
DelayedWETHImplAddress
common
.
Address
`json:"delayedWETHImplAddress"`
OptimismPortalImplAddress
common
.
Address
`json:"optimismPortalImplAddress"`
OptimismPortalImplAddress
common
.
Address
`json:"optimismPortalImplAddress"`
PreimageOracleSingletonAddress
common
.
Address
`json:"preimageOracleSingletonAddress"`
PreimageOracleSingletonAddress
common
.
Address
`json:"preimageOracleSingletonAddress"`
...
...
op-chain-ops/interopgen/configs.go
View file @
b55f4d73
...
@@ -33,7 +33,7 @@ type SuperFaultProofConfig struct {
...
@@ -33,7 +33,7 @@ type SuperFaultProofConfig struct {
DisputeGameFinalityDelaySeconds
*
big
.
Int
DisputeGameFinalityDelaySeconds
*
big
.
Int
}
}
type
OP
S
MImplementationsConfig
struct
{
type
OP
C
MImplementationsConfig
struct
{
Release
string
Release
string
FaultProof
SuperFaultProofConfig
FaultProof
SuperFaultProofConfig
...
@@ -51,7 +51,7 @@ type SuperchainConfig struct {
...
@@ -51,7 +51,7 @@ type SuperchainConfig struct {
Paused
bool
Paused
bool
Implementations
OP
S
MImplementationsConfig
Implementations
OP
C
MImplementationsConfig
genesis
.
SuperchainL1DeployConfig
genesis
.
SuperchainL1DeployConfig
}
}
...
...
op-chain-ops/interopgen/deploy.go
View file @
b55f4d73
...
@@ -5,13 +5,12 @@ import (
...
@@ -5,13 +5,12 @@ import (
"fmt"
"fmt"
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opcm"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/beacondeposit"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/beacondeposit"
...
@@ -149,7 +148,7 @@ func prepareInitialL1(l1Host *script.Host, cfg *L1Config) (*L1Deployment, error)
...
@@ -149,7 +148,7 @@ func prepareInitialL1(l1Host *script.Host, cfg *L1Config) (*L1Deployment, error)
func
deploySuperchainToL1
(
l1Host
*
script
.
Host
,
superCfg
*
SuperchainConfig
)
(
*
SuperchainDeployment
,
error
)
{
func
deploySuperchainToL1
(
l1Host
*
script
.
Host
,
superCfg
*
SuperchainConfig
)
(
*
SuperchainDeployment
,
error
)
{
l1Host
.
SetTxOrigin
(
superCfg
.
Deployer
)
l1Host
.
SetTxOrigin
(
superCfg
.
Deployer
)
superDeployment
,
err
:=
op
sm
.
DeploySuperchain
(
l1Host
,
ops
m
.
DeploySuperchainInput
{
superDeployment
,
err
:=
op
cm
.
DeploySuperchain
(
l1Host
,
opc
m
.
DeploySuperchainInput
{
ProxyAdminOwner
:
superCfg
.
ProxyAdminOwner
,
ProxyAdminOwner
:
superCfg
.
ProxyAdminOwner
,
ProtocolVersionsOwner
:
superCfg
.
ProtocolVersionsOwner
,
ProtocolVersionsOwner
:
superCfg
.
ProtocolVersionsOwner
,
Guardian
:
superCfg
.
SuperchainConfigGuardian
,
Guardian
:
superCfg
.
SuperchainConfigGuardian
,
...
@@ -161,7 +160,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
...
@@ -161,7 +160,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
return
nil
,
fmt
.
Errorf
(
"failed to deploy Superchain contracts: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to deploy Superchain contracts: %w"
,
err
)
}
}
implementationsDeployment
,
err
:=
op
sm
.
DeployImplementations
(
l1Host
,
ops
m
.
DeployImplementationsInput
{
implementationsDeployment
,
err
:=
op
cm
.
DeployImplementations
(
l1Host
,
opc
m
.
DeployImplementationsInput
{
WithdrawalDelaySeconds
:
superCfg
.
Implementations
.
FaultProof
.
WithdrawalDelaySeconds
,
WithdrawalDelaySeconds
:
superCfg
.
Implementations
.
FaultProof
.
WithdrawalDelaySeconds
,
MinProposalSizeBytes
:
superCfg
.
Implementations
.
FaultProof
.
MinProposalSizeBytes
,
MinProposalSizeBytes
:
superCfg
.
Implementations
.
FaultProof
.
MinProposalSizeBytes
,
ChallengePeriodSeconds
:
superCfg
.
Implementations
.
FaultProof
.
ChallengePeriodSeconds
,
ChallengePeriodSeconds
:
superCfg
.
Implementations
.
FaultProof
.
ChallengePeriodSeconds
,
...
@@ -172,7 +171,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
...
@@ -172,7 +171,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
ProtocolVersionsProxy
:
superDeployment
.
ProtocolVersionsProxy
,
ProtocolVersionsProxy
:
superDeployment
.
ProtocolVersionsProxy
,
SuperchainProxyAdmin
:
superDeployment
.
SuperchainProxyAdmin
,
SuperchainProxyAdmin
:
superDeployment
.
SuperchainProxyAdmin
,
UseInterop
:
superCfg
.
Implementations
.
UseInterop
,
UseInterop
:
superCfg
.
Implementations
.
UseInterop
,
StandardVersionsToml
:
op
s
m
.
StandardVersionsData
,
StandardVersionsToml
:
op
c
m
.
StandardVersionsData
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to deploy Implementations contracts: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to deploy Implementations contracts: %w"
,
err
)
...
@@ -197,7 +196,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
...
@@ -197,7 +196,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
l1Host
.
SetTxOrigin
(
cfg
.
Deployer
)
l1Host
.
SetTxOrigin
(
cfg
.
Deployer
)
output
,
err
:=
op
sm
.
DeployOPChain
(
l1Host
,
ops
m
.
DeployOPChainInput
{
output
,
err
:=
op
cm
.
DeployOPChain
(
l1Host
,
opc
m
.
DeployOPChainInput
{
OpChainProxyAdminOwner
:
cfg
.
ProxyAdminOwner
,
OpChainProxyAdminOwner
:
cfg
.
ProxyAdminOwner
,
SystemConfigOwner
:
cfg
.
SystemConfigOwner
,
SystemConfigOwner
:
cfg
.
SystemConfigOwner
,
Batcher
:
cfg
.
BatchSenderAddress
,
Batcher
:
cfg
.
BatchSenderAddress
,
...
@@ -207,7 +206,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
...
@@ -207,7 +206,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
BasefeeScalar
:
cfg
.
GasPriceOracleBaseFeeScalar
,
BasefeeScalar
:
cfg
.
GasPriceOracleBaseFeeScalar
,
BlobBaseFeeScalar
:
cfg
.
GasPriceOracleBlobBaseFeeScalar
,
BlobBaseFeeScalar
:
cfg
.
GasPriceOracleBlobBaseFeeScalar
,
L2ChainId
:
new
(
big
.
Int
)
.
SetUint64
(
cfg
.
L2ChainID
),
L2ChainId
:
new
(
big
.
Int
)
.
SetUint64
(
cfg
.
L2ChainID
),
Op
smProxy
:
superDeployment
.
Ops
mProxy
,
Op
cmProxy
:
superDeployment
.
Opc
mProxy
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to deploy L2 OP chain: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to deploy L2 OP chain: %w"
,
err
)
...
@@ -220,8 +219,8 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
...
@@ -220,8 +219,8 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
}
}
func
genesisL2
(
l2Host
*
script
.
Host
,
cfg
*
L2Config
,
deployment
*
L2Deployment
)
error
{
func
genesisL2
(
l2Host
*
script
.
Host
,
cfg
*
L2Config
,
deployment
*
L2Deployment
)
error
{
if
err
:=
op
sm
.
L2Genesis
(
l2Host
,
&
ops
m
.
L2GenesisInput
{
if
err
:=
op
cm
.
L2Genesis
(
l2Host
,
&
opc
m
.
L2GenesisInput
{
L1Deployments
:
op
s
m
.
L1Deployments
{
L1Deployments
:
op
c
m
.
L1Deployments
{
L1CrossDomainMessengerProxy
:
deployment
.
L1CrossDomainMessengerProxy
,
L1CrossDomainMessengerProxy
:
deployment
.
L1CrossDomainMessengerProxy
,
L1StandardBridgeProxy
:
deployment
.
L1StandardBridgeProxy
,
L1StandardBridgeProxy
:
deployment
.
L1StandardBridgeProxy
,
L1ERC721BridgeProxy
:
deployment
.
L1ERC721BridgeProxy
,
L1ERC721BridgeProxy
:
deployment
.
L1ERC721BridgeProxy
,
...
...
op-chain-ops/interopgen/deployments.go
View file @
b55f4d73
...
@@ -9,8 +9,8 @@ type L1Deployment struct {
...
@@ -9,8 +9,8 @@ type L1Deployment struct {
}
}
type
Implementations
struct
{
type
Implementations
struct
{
Op
smProxy
common
.
Address
`json:"OPS
MProxy"`
Op
cmProxy
common
.
Address
`json:"OPC
MProxy"`
Op
smImpl
common
.
Address
`json:"OPS
MImpl"`
Op
cmImpl
common
.
Address
`json:"OPC
MImpl"`
DelayedWETHImpl
common
.
Address
`json:"DelayedWETHImpl"`
DelayedWETHImpl
common
.
Address
`json:"DelayedWETHImpl"`
OptimismPortalImpl
common
.
Address
`json:"OptimismPortalImpl"`
OptimismPortalImpl
common
.
Address
`json:"OptimismPortalImpl"`
PreimageOracleSingleton
common
.
Address
`json:"PreimageOracleSingleton"`
PreimageOracleSingleton
common
.
Address
`json:"PreimageOracleSingleton"`
...
...
op-chain-ops/interopgen/recipe.go
View file @
b55f4d73
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
s
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/op
c
m"
"github.com/ethereum-optimism/optimism/op-chain-ops/devkeys"
"github.com/ethereum-optimism/optimism/op-chain-ops/devkeys"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
)
)
...
@@ -67,7 +67,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
...
@@ -67,7 +67,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
ProxyAdminOwner
:
superchainProxyAdmin
,
ProxyAdminOwner
:
superchainProxyAdmin
,
ProtocolVersionsOwner
:
superchainProtocolVersionsOwner
,
ProtocolVersionsOwner
:
superchainProtocolVersionsOwner
,
Deployer
:
superchainDeployer
,
Deployer
:
superchainDeployer
,
Implementations
:
OP
S
MImplementationsConfig
{
Implementations
:
OP
C
MImplementationsConfig
{
Release
:
"dev"
,
Release
:
"dev"
,
FaultProof
:
SuperFaultProofConfig
{
FaultProof
:
SuperFaultProofConfig
{
WithdrawalDelaySeconds
:
big
.
NewInt
(
604800
),
WithdrawalDelaySeconds
:
big
.
NewInt
(
604800
),
...
@@ -77,7 +77,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
...
@@ -77,7 +77,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
DisputeGameFinalityDelaySeconds
:
big
.
NewInt
(
6
),
DisputeGameFinalityDelaySeconds
:
big
.
NewInt
(
6
),
},
},
UseInterop
:
true
,
UseInterop
:
true
,
StandardVersionsToml
:
op
s
m
.
StandardVersionsData
,
StandardVersionsToml
:
op
c
m
.
StandardVersionsData
,
},
},
SuperchainL1DeployConfig
:
genesis
.
SuperchainL1DeployConfig
{
SuperchainL1DeployConfig
:
genesis
.
SuperchainL1DeployConfig
{
RequiredProtocolVersion
:
params
.
OPStackSupport
,
RequiredProtocolVersion
:
params
.
OPStackSupport
,
...
...
packages/contracts-bedrock/scripts/DeployImplementations.s.sol
View file @
b55f4d73
...
@@ -28,7 +28,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol
...
@@ -28,7 +28,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { OP
StackManager } from "src/L1/OPStack
Manager.sol";
import { OP
ContractsManager } from "src/L1/OPContracts
Manager.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...
@@ -36,7 +36,7 @@ import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol";
...
@@ -36,7 +36,7 @@ import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol";
import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
import { OP
StackManagerInterop } from "src/L1/OPStack
ManagerInterop.sol";
import { OP
ContractsManagerInterop } from "src/L1/OPContracts
ManagerInterop.sol";
import { OptimismPortalInterop } from "src/L1/OptimismPortalInterop.sol";
import { OptimismPortalInterop } from "src/L1/OptimismPortalInterop.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol";
...
@@ -55,7 +55,7 @@ contract DeployImplementationsInput is BaseDeployIO {
...
@@ -55,7 +55,7 @@ contract DeployImplementationsInput is BaseDeployIO {
uint256 internal _proofMaturityDelaySeconds;
uint256 internal _proofMaturityDelaySeconds;
uint256 internal _disputeGameFinalityDelaySeconds;
uint256 internal _disputeGameFinalityDelaySeconds;
// The release version to set OP
S
M implementations for, of the format `op-contracts/vX.Y.Z`.
// The release version to set OP
C
M implementations for, of the format `op-contracts/vX.Y.Z`.
string internal _release;
string internal _release;
// Outputs from DeploySuperchain.s.sol.
// Outputs from DeploySuperchain.s.sol.
...
@@ -166,8 +166,8 @@ contract DeployImplementationsInput is BaseDeployIO {
...
@@ -166,8 +166,8 @@ contract DeployImplementationsInput is BaseDeployIO {
}
}
contract DeployImplementationsOutput is BaseDeployIO {
contract DeployImplementationsOutput is BaseDeployIO {
OP
StackManager internal _ops
mProxy;
OP
ContractsManager internal _opc
mProxy;
OP
StackManager internal _ops
mImpl;
OP
ContractsManager internal _opc
mImpl;
DelayedWETH internal _delayedWETHImpl;
DelayedWETH internal _delayedWETHImpl;
OptimismPortal2 internal _optimismPortalImpl;
OptimismPortal2 internal _optimismPortalImpl;
PreimageOracle internal _preimageOracleSingleton;
PreimageOracle internal _preimageOracleSingleton;
...
@@ -183,8 +183,8 @@ contract DeployImplementationsOutput is BaseDeployIO {
...
@@ -183,8 +183,8 @@ contract DeployImplementationsOutput is BaseDeployIO {
require(_addr != address(0), "DeployImplementationsOutput: cannot set zero address");
require(_addr != address(0), "DeployImplementationsOutput: cannot set zero address");
// forgefmt: disable-start
// forgefmt: disable-start
if (sel == this.op
smProxy.selector) _opsmProxy = OPStack
Manager(payable(_addr));
if (sel == this.op
cmProxy.selector) _opcmProxy = OPContracts
Manager(payable(_addr));
else if (sel == this.op
smImpl.selector) _opsmImpl = OPStack
Manager(payable(_addr));
else if (sel == this.op
cmImpl.selector) _opcmImpl = OPContracts
Manager(payable(_addr));
else if (sel == this.optimismPortalImpl.selector) _optimismPortalImpl = OptimismPortal2(payable(_addr));
else if (sel == this.optimismPortalImpl.selector) _optimismPortalImpl = OptimismPortal2(payable(_addr));
else if (sel == this.delayedWETHImpl.selector) _delayedWETHImpl = DelayedWETH(payable(_addr));
else if (sel == this.delayedWETHImpl.selector) _delayedWETHImpl = DelayedWETH(payable(_addr));
else if (sel == this.preimageOracleSingleton.selector) _preimageOracleSingleton = PreimageOracle(_addr);
else if (sel == this.preimageOracleSingleton.selector) _preimageOracleSingleton = PreimageOracle(_addr);
...
@@ -203,8 +203,8 @@ contract DeployImplementationsOutput is BaseDeployIO {
...
@@ -203,8 +203,8 @@ contract DeployImplementationsOutput is BaseDeployIO {
// With 12 addresses, we'd get a stack too deep error if we tried to do this inline as a
// With 12 addresses, we'd get a stack too deep error if we tried to do this inline as a
// single call to `Solarray.addresses`. So we split it into two calls.
// single call to `Solarray.addresses`. So we split it into two calls.
address[] memory addrs1 = Solarray.addresses(
address[] memory addrs1 = Solarray.addresses(
address(this.op
s
mProxy()),
address(this.op
c
mProxy()),
address(this.op
s
mImpl()),
address(this.op
c
mImpl()),
address(this.optimismPortalImpl()),
address(this.optimismPortalImpl()),
address(this.delayedWETHImpl()),
address(this.delayedWETHImpl()),
address(this.preimageOracleSingleton()),
address(this.preimageOracleSingleton()),
...
@@ -225,15 +225,15 @@ contract DeployImplementationsOutput is BaseDeployIO {
...
@@ -225,15 +225,15 @@ contract DeployImplementationsOutput is BaseDeployIO {
assertValidDeploy(_dii);
assertValidDeploy(_dii);
}
}
function op
smProxy() public returns (OPStack
Manager) {
function op
cmProxy() public returns (OPContracts
Manager) {
DeployUtils.assertValidContractAddress(address(_op
s
mProxy));
DeployUtils.assertValidContractAddress(address(_op
c
mProxy));
DeployUtils.assertImplementationSet(address(_op
s
mProxy));
DeployUtils.assertImplementationSet(address(_op
c
mProxy));
return _op
s
mProxy;
return _op
c
mProxy;
}
}
function op
smImpl() public view returns (OPStack
Manager) {
function op
cmImpl() public view returns (OPContracts
Manager) {
DeployUtils.assertValidContractAddress(address(_op
s
mImpl));
DeployUtils.assertValidContractAddress(address(_op
c
mImpl));
return _op
s
mImpl;
return _op
c
mImpl;
}
}
function optimismPortalImpl() public view returns (OptimismPortal2) {
function optimismPortalImpl() public view returns (OptimismPortal2) {
...
@@ -294,35 +294,35 @@ contract DeployImplementationsOutput is BaseDeployIO {
...
@@ -294,35 +294,35 @@ contract DeployImplementationsOutput is BaseDeployIO {
assertValidL1ERC721BridgeImpl(_dii);
assertValidL1ERC721BridgeImpl(_dii);
assertValidL1StandardBridgeImpl(_dii);
assertValidL1StandardBridgeImpl(_dii);
assertValidMipsSingleton(_dii);
assertValidMipsSingleton(_dii);
assertValidOp
s
mProxy(_dii);
assertValidOp
c
mProxy(_dii);
assertValidOp
s
mImpl(_dii);
assertValidOp
c
mImpl(_dii);
assertValidOptimismMintableERC20FactoryImpl(_dii);
assertValidOptimismMintableERC20FactoryImpl(_dii);
assertValidOptimismPortalImpl(_dii);
assertValidOptimismPortalImpl(_dii);
assertValidPreimageOracleSingleton(_dii);
assertValidPreimageOracleSingleton(_dii);
assertValidSystemConfigImpl(_dii);
assertValidSystemConfigImpl(_dii);
}
}
function assertValidOp
s
mProxy(DeployImplementationsInput _dii) internal {
function assertValidOp
c
mProxy(DeployImplementationsInput _dii) internal {
// First we check the proxy as itself.
// First we check the proxy as itself.
Proxy proxy = Proxy(payable(address(op
s
mProxy())));
Proxy proxy = Proxy(payable(address(op
c
mProxy())));
vm.prank(address(0));
vm.prank(address(0));
address admin = proxy.admin();
address admin = proxy.admin();
require(admin == address(_dii.superchainProxyAdmin()), "OP
S
MP-10");
require(admin == address(_dii.superchainProxyAdmin()), "OP
C
MP-10");
// Then we check the proxy as OP
S
M.
// Then we check the proxy as OP
C
M.
DeployUtils.assertInitialized({ _contractAddress: address(op
s
mProxy()), _slot: 0, _offset: 0 });
DeployUtils.assertInitialized({ _contractAddress: address(op
c
mProxy()), _slot: 0, _offset: 0 });
require(address(op
smProxy().superchainConfig()) == address(_dii.superchainConfigProxy()), "OPS
MP-20");
require(address(op
cmProxy().superchainConfig()) == address(_dii.superchainConfigProxy()), "OPC
MP-20");
require(address(op
smProxy().protocolVersions()) == address(_dii.protocolVersionsProxy()), "OPS
MP-30");
require(address(op
cmProxy().protocolVersions()) == address(_dii.protocolVersionsProxy()), "OPC
MP-30");
require(LibString.eq(op
smProxy().latestRelease(), _dii.release()), "OPS
MP-50"); // Initial release is latest.
require(LibString.eq(op
cmProxy().latestRelease(), _dii.release()), "OPC
MP-50"); // Initial release is latest.
}
}
function assertValidOp
s
mImpl(DeployImplementationsInput _dii) internal {
function assertValidOp
c
mImpl(DeployImplementationsInput _dii) internal {
Proxy proxy = Proxy(payable(address(op
s
mProxy())));
Proxy proxy = Proxy(payable(address(op
c
mProxy())));
vm.prank(address(0));
vm.prank(address(0));
OP
StackManager impl = OPStack
Manager(proxy.implementation());
OP
ContractsManager impl = OPContracts
Manager(proxy.implementation());
DeployUtils.assertInitialized({ _contractAddress: address(impl), _slot: 0, _offset: 0 });
DeployUtils.assertInitialized({ _contractAddress: address(impl), _slot: 0, _offset: 0 });
require(address(impl.superchainConfig()) == address(_dii.superchainConfigProxy()), "OP
S
MI-10");
require(address(impl.superchainConfig()) == address(_dii.superchainConfigProxy()), "OP
C
MI-10");
require(address(impl.protocolVersions()) == address(_dii.protocolVersionsProxy()), "OP
S
MI-20");
require(address(impl.protocolVersions()) == address(_dii.protocolVersionsProxy()), "OP
C
MI-20");
}
}
function assertValidOptimismPortalImpl(DeployImplementationsInput) internal view {
function assertValidOptimismPortalImpl(DeployImplementationsInput) internal view {
...
@@ -468,42 +468,42 @@ contract DeployImplementations is Script {
...
@@ -468,42 +468,42 @@ contract DeployImplementations is Script {
deployMipsSingleton(_dii, _dio);
deployMipsSingleton(_dii, _dio);
deployDisputeGameFactoryImpl(_dii, _dio);
deployDisputeGameFactoryImpl(_dii, _dio);
// Deploy the OP
Stack
Manager with the new implementations set.
// Deploy the OP
Contracts
Manager with the new implementations set.
deployOP
Stack
Manager(_dii, _dio);
deployOP
Contracts
Manager(_dii, _dio);
_dio.checkOutput(_dii);
_dio.checkOutput(_dii);
}
}
// -------- Deployment Steps --------
// -------- Deployment Steps --------
// --- OP
Stack
Manager ---
// --- OP
Contracts
Manager ---
function op
s
mSystemConfigSetter(
function op
c
mSystemConfigSetter(
DeployImplementationsInput,
DeployImplementationsInput,
DeployImplementationsOutput _dio
DeployImplementationsOutput _dio
)
)
internal
internal
view
view
virtual
virtual
returns (OP
Stack
Manager.ImplementationSetter memory)
returns (OP
Contracts
Manager.ImplementationSetter memory)
{
{
return OP
Stack
Manager.ImplementationSetter({
return OP
Contracts
Manager.ImplementationSetter({
name: "SystemConfig",
name: "SystemConfig",
info: OP
Stack
Manager.Implementation(address(_dio.systemConfigImpl()), SystemConfig.initialize.selector)
info: OP
Contracts
Manager.Implementation(address(_dio.systemConfigImpl()), SystemConfig.initialize.selector)
});
});
}
}
// Deploy and initialize a proxied OP
Stack
Manager.
// Deploy and initialize a proxied OP
Contracts
Manager.
function createOP
S
MContract(
function createOP
C
MContract(
DeployImplementationsInput _dii,
DeployImplementationsInput _dii,
DeployImplementationsOutput _dio,
DeployImplementationsOutput _dio,
OP
Stack
Manager.Blueprints memory _blueprints,
OP
Contracts
Manager.Blueprints memory _blueprints,
string memory _release,
string memory _release,
OP
Stack
Manager.ImplementationSetter[] memory _setters
OP
Contracts
Manager.ImplementationSetter[] memory _setters
)
)
internal
internal
virtual
virtual
returns (OP
StackManager ops
mProxy_)
returns (OP
ContractsManager opc
mProxy_)
{
{
ProxyAdmin proxyAdmin = _dii.superchainProxyAdmin();
ProxyAdmin proxyAdmin = _dii.superchainProxyAdmin();
...
@@ -511,29 +511,35 @@ contract DeployImplementations is Script {
...
@@ -511,29 +511,35 @@ contract DeployImplementations is Script {
Proxy proxy = new Proxy(address(msg.sender));
Proxy proxy = new Proxy(address(msg.sender));
deployOPContractsManagerImpl(_dii, _dio);
deployOPContractsManagerImpl(_dii, _dio);
OP
StackManager opsmImpl = _dio.ops
mImpl();
OP
ContractsManager opcmImpl = _dio.opc
mImpl();
OP
Stack
Manager.InitializerInputs memory initializerInputs =
OP
Contracts
Manager.InitializerInputs memory initializerInputs =
OP
Stack
Manager.InitializerInputs(_blueprints, _setters, _release, true);
OP
Contracts
Manager.InitializerInputs(_blueprints, _setters, _release, true);
vm.startBroadcast(msg.sender);
vm.startBroadcast(msg.sender);
proxy.upgradeToAndCall(
proxy.upgradeToAndCall(
address(op
smImpl), abi.encodeWithSelector(ops
mImpl.initialize.selector, initializerInputs)
address(op
cmImpl), abi.encodeWithSelector(opc
mImpl.initialize.selector, initializerInputs)
);
);
proxy.changeAdmin(address(proxyAdmin)); // transfer ownership of Proxy contract to the ProxyAdmin contract
proxy.changeAdmin(address(proxyAdmin)); // transfer ownership of Proxy contract to the ProxyAdmin contract
vm.stopBroadcast();
vm.stopBroadcast();
op
smProxy_ = OPStack
Manager(address(proxy));
op
cmProxy_ = OPContracts
Manager(address(proxy));
}
}
function deployOPStackManager(DeployImplementationsInput _dii, DeployImplementationsOutput _dio) public virtual {
function deployOPContractsManager(
DeployImplementationsInput _dii,
DeployImplementationsOutput _dio
)
public
virtual
{
string memory release = _dii.release();
string memory release = _dii.release();
// First we deploy the blueprints for the singletons deployed by OP
S
M.
// First we deploy the blueprints for the singletons deployed by OP
C
M.
// forgefmt: disable-start
// forgefmt: disable-start
bytes32 salt = _dii.salt();
bytes32 salt = _dii.salt();
OP
Stack
Manager.Blueprints memory blueprints;
OP
Contracts
Manager.Blueprints memory blueprints;
vm.startBroadcast(msg.sender);
vm.startBroadcast(msg.sender);
blueprints.addressManager = deployBytecode(Blueprint.blueprintDeployerBytecode(type(AddressManager).creationCode), salt);
blueprints.addressManager = deployBytecode(Blueprint.blueprintDeployerBytecode(type(AddressManager).creationCode), salt);
...
@@ -546,54 +552,56 @@ contract DeployImplementations is Script {
...
@@ -546,54 +552,56 @@ contract DeployImplementations is Script {
vm.stopBroadcast();
vm.stopBroadcast();
// forgefmt: disable-end
// forgefmt: disable-end
OP
StackManager.ImplementationSetter[] memory setters = new OPStack
Manager.ImplementationSetter[](9);
OP
ContractsManager.ImplementationSetter[] memory setters = new OPContracts
Manager.ImplementationSetter[](9);
setters[0] = OP
Stack
Manager.ImplementationSetter({
setters[0] = OP
Contracts
Manager.ImplementationSetter({
name: "L1ERC721Bridge",
name: "L1ERC721Bridge",
info: OP
Stack
Manager.Implementation(address(_dio.l1ERC721BridgeImpl()), L1ERC721Bridge.initialize.selector)
info: OP
Contracts
Manager.Implementation(address(_dio.l1ERC721BridgeImpl()), L1ERC721Bridge.initialize.selector)
});
});
setters[1] = OP
Stack
Manager.ImplementationSetter({
setters[1] = OP
Contracts
Manager.ImplementationSetter({
name: "OptimismPortal",
name: "OptimismPortal",
info: OP
Stack
Manager.Implementation(address(_dio.optimismPortalImpl()), OptimismPortal2.initialize.selector)
info: OP
Contracts
Manager.Implementation(address(_dio.optimismPortalImpl()), OptimismPortal2.initialize.selector)
});
});
setters[2] = op
s
mSystemConfigSetter(_dii, _dio);
setters[2] = op
c
mSystemConfigSetter(_dii, _dio);
setters[3] = OP
Stack
Manager.ImplementationSetter({
setters[3] = OP
Contracts
Manager.ImplementationSetter({
name: "OptimismMintableERC20Factory",
name: "OptimismMintableERC20Factory",
info: OP
Stack
Manager.Implementation(
info: OP
Contracts
Manager.Implementation(
address(_dio.optimismMintableERC20FactoryImpl()), OptimismMintableERC20Factory.initialize.selector
address(_dio.optimismMintableERC20FactoryImpl()), OptimismMintableERC20Factory.initialize.selector
)
)
});
});
setters[4] = OP
Stack
Manager.ImplementationSetter({
setters[4] = OP
Contracts
Manager.ImplementationSetter({
name: "L1CrossDomainMessenger",
name: "L1CrossDomainMessenger",
info: OP
Stack
Manager.Implementation(
info: OP
Contracts
Manager.Implementation(
address(_dio.l1CrossDomainMessengerImpl()), L1CrossDomainMessenger.initialize.selector
address(_dio.l1CrossDomainMessengerImpl()), L1CrossDomainMessenger.initialize.selector
)
)
});
});
setters[5] = OP
Stack
Manager.ImplementationSetter({
setters[5] = OP
Contracts
Manager.ImplementationSetter({
name: "L1StandardBridge",
name: "L1StandardBridge",
info: OPStackManager.Implementation(address(_dio.l1StandardBridgeImpl()), L1StandardBridge.initialize.selector)
info: OPContractsManager.Implementation(
address(_dio.l1StandardBridgeImpl()), L1StandardBridge.initialize.selector
)
});
});
setters[6] = OP
Stack
Manager.ImplementationSetter({
setters[6] = OP
Contracts
Manager.ImplementationSetter({
name: "DisputeGameFactory",
name: "DisputeGameFactory",
info: OP
Stack
Manager.Implementation(
info: OP
Contracts
Manager.Implementation(
address(_dio.disputeGameFactoryImpl()), DisputeGameFactory.initialize.selector
address(_dio.disputeGameFactoryImpl()), DisputeGameFactory.initialize.selector
)
)
});
});
setters[7] = OP
Stack
Manager.ImplementationSetter({
setters[7] = OP
Contracts
Manager.ImplementationSetter({
name: "DelayedWETH",
name: "DelayedWETH",
info: OP
Stack
Manager.Implementation(address(_dio.delayedWETHImpl()), DelayedWETH.initialize.selector)
info: OP
Contracts
Manager.Implementation(address(_dio.delayedWETHImpl()), DelayedWETH.initialize.selector)
});
});
setters[8] = OP
Stack
Manager.ImplementationSetter({
setters[8] = OP
Contracts
Manager.ImplementationSetter({
name: "MIPS",
name: "MIPS",
// MIPS is a singleton for all chains, so it doesn't need to be initialized, so the
// MIPS is a singleton for all chains, so it doesn't need to be initialized, so the
// selector is just `bytes4(0)`.
// selector is just `bytes4(0)`.
info: OP
Stack
Manager.Implementation(address(_dio.mipsSingleton()), bytes4(0))
info: OP
Contracts
Manager.Implementation(address(_dio.mipsSingleton()), bytes4(0))
});
});
// This call contains a broadcast to deploy OP
S
M which is proxied.
// This call contains a broadcast to deploy OP
C
M which is proxied.
OP
StackManager opsmProxy = createOPS
MContract(_dii, _dio, blueprints, release, setters);
OP
ContractsManager opcmProxy = createOPC
MContract(_dii, _dio, blueprints, release, setters);
vm.label(address(op
smProxy), "OPStack
Manager");
vm.label(address(op
cmProxy), "OPContracts
Manager");
_dio.set(_dio.op
smProxy.selector, address(ops
mProxy));
_dio.set(_dio.op
cmProxy.selector, address(opc
mProxy));
}
}
// --- Core Contracts ---
// --- Core Contracts ---
...
@@ -736,10 +744,10 @@ contract DeployImplementations is Script {
...
@@ -736,10 +744,10 @@ contract DeployImplementations is Script {
vm.broadcast(msg.sender);
vm.broadcast(msg.sender);
// TODO: Eventually we will want to select the correct implementation based on the release.
// TODO: Eventually we will want to select the correct implementation based on the release.
OP
StackManager impl = new OPStack
Manager(superchainConfigProxy, protocolVersionsProxy);
OP
ContractsManager impl = new OPContracts
Manager(superchainConfigProxy, protocolVersionsProxy);
vm.label(address(impl), "OP
Stack
ManagerImpl");
vm.label(address(impl), "OP
Contracts
ManagerImpl");
_dio.set(_dio.op
s
mImpl.selector, address(impl));
_dio.set(_dio.op
c
mImpl.selector, address(impl));
}
}
// --- Fault Proofs Contracts ---
// --- Fault Proofs Contracts ---
...
@@ -968,7 +976,7 @@ contract DeployImplementations is Script {
...
@@ -968,7 +976,7 @@ contract DeployImplementations is Script {
// architecture, this comment block documents how to update the deploy scripts to support new features.
// architecture, this comment block documents how to update the deploy scripts to support new features.
//
//
// Using the base scripts and contracts (DeploySuperchain, DeployImplementations, DeployOPChain, and
// Using the base scripts and contracts (DeploySuperchain, DeployImplementations, DeployOPChain, and
// the corresponding OP
Stack
Manager) deploys a standard chain. For nonstandard and in-development
// the corresponding OP
Contracts
Manager) deploys a standard chain. For nonstandard and in-development
// features we need to modify some or all of those contracts, and we do that via inheritance. Using
// features we need to modify some or all of those contracts, and we do that via inheritance. Using
// interop as an example, they've made the following changes to L1 contracts:
// interop as an example, they've made the following changes to L1 contracts:
// - `OptimismPortalInterop is OptimismPortal`: A different portal implementation is used, and
// - `OptimismPortalInterop is OptimismPortal`: A different portal implementation is used, and
...
@@ -981,32 +989,32 @@ contract DeployImplementations is Script {
...
@@ -981,32 +989,32 @@ contract DeployImplementations is Script {
// Similar to how inheritance was used to develop the new portal and system config contracts, we use
// Similar to how inheritance was used to develop the new portal and system config contracts, we use
// inheritance to modify up to all of the deployer contracts. For this interop example, what this
// inheritance to modify up to all of the deployer contracts. For this interop example, what this
// means is we need:
// means is we need:
// - An `OP
StackManagerInterop is OPStack
Manager` that knows how to encode the calldata for the
// - An `OP
ContractsManagerInterop is OPContracts
Manager` that knows how to encode the calldata for the
// new system config initializer.
// new system config initializer.
// - A `DeployImplementationsInterop is DeployImplementations` that:
// - A `DeployImplementationsInterop is DeployImplementations` that:
// - Deploys OptimismPortalInterop instead of OptimismPortal.
// - Deploys OptimismPortalInterop instead of OptimismPortal.
// - Deploys SystemConfigInterop instead of SystemConfig.
// - Deploys SystemConfigInterop instead of SystemConfig.
// - Deploys OP
StackManagerInterop instead of OPStack
Manager, which contains the updated logic
// - Deploys OP
ContractsManagerInterop instead of OPContracts
Manager, which contains the updated logic
// for encoding the SystemConfig initializer.
// for encoding the SystemConfig initializer.
// - Updates the OP
S
M release setter logic to use the updated initializer.
// - Updates the OP
C
M release setter logic to use the updated initializer.
// - A `DeployOPChainInterop is DeployOPChain` that allows the updated input parameter to be passed.
// - A `DeployOPChainInterop is DeployOPChain` that allows the updated input parameter to be passed.
//
//
// Most of the complexity in the above flow comes from the the new input for the updated SystemConfig
// Most of the complexity in the above flow comes from the the new input for the updated SystemConfig
// initializer. If all function signatures were the same, all we'd have to change is the contract
// initializer. If all function signatures were the same, all we'd have to change is the contract
// implementations that are deployed then set in the OP
S
M. For now, to simplify things until we
// implementations that are deployed then set in the OP
C
M. For now, to simplify things until we
// resolve https://github.com/ethereum-optimism/optimism/issues/11783, we just assume this new role
// resolve https://github.com/ethereum-optimism/optimism/issues/11783, we just assume this new role
// is the same as the proxy admin owner.
// is the same as the proxy admin owner.
contract DeployImplementationsInterop is DeployImplementations {
contract DeployImplementationsInterop is DeployImplementations {
function createOP
S
MContract(
function createOP
C
MContract(
DeployImplementationsInput _dii,
DeployImplementationsInput _dii,
DeployImplementationsOutput _dio,
DeployImplementationsOutput _dio,
OP
Stack
Manager.Blueprints memory _blueprints,
OP
Contracts
Manager.Blueprints memory _blueprints,
string memory _release,
string memory _release,
OP
Stack
Manager.ImplementationSetter[] memory _setters
OP
Contracts
Manager.ImplementationSetter[] memory _setters
)
)
internal
internal
override
override
returns (OP
StackManager ops
mProxy_)
returns (OP
ContractsManager opc
mProxy_)
{
{
ProxyAdmin proxyAdmin = _dii.superchainProxyAdmin();
ProxyAdmin proxyAdmin = _dii.superchainProxyAdmin();
...
@@ -1014,20 +1022,20 @@ contract DeployImplementationsInterop is DeployImplementations {
...
@@ -1014,20 +1022,20 @@ contract DeployImplementationsInterop is DeployImplementations {
Proxy proxy = new Proxy(address(msg.sender));
Proxy proxy = new Proxy(address(msg.sender));
deployOPContractsManagerImpl(_dii, _dio); // overriding function
deployOPContractsManagerImpl(_dii, _dio); // overriding function
OP
StackManager opsmImpl = _dio.ops
mImpl();
OP
ContractsManager opcmImpl = _dio.opc
mImpl();
OP
Stack
Manager.InitializerInputs memory initializerInputs =
OP
Contracts
Manager.InitializerInputs memory initializerInputs =
OP
Stack
Manager.InitializerInputs(_blueprints, _setters, _release, true);
OP
Contracts
Manager.InitializerInputs(_blueprints, _setters, _release, true);
vm.startBroadcast(msg.sender);
vm.startBroadcast(msg.sender);
proxy.upgradeToAndCall(
proxy.upgradeToAndCall(
address(op
smImpl), abi.encodeWithSelector(ops
mImpl.initialize.selector, initializerInputs)
address(op
cmImpl), abi.encodeWithSelector(opc
mImpl.initialize.selector, initializerInputs)
);
);
proxy.changeAdmin(address(proxyAdmin)); // transfer ownership of Proxy contract to the ProxyAdmin contract
proxy.changeAdmin(address(proxyAdmin)); // transfer ownership of Proxy contract to the ProxyAdmin contract
vm.stopBroadcast();
vm.stopBroadcast();
op
smProxy_ = OPStack
ManagerInterop(address(proxy));
op
cmProxy_ = OPContracts
ManagerInterop(address(proxy));
}
}
function deployOptimismPortalImpl(
function deployOptimismPortalImpl(
...
@@ -1097,24 +1105,26 @@ contract DeployImplementationsInterop is DeployImplementations {
...
@@ -1097,24 +1105,26 @@ contract DeployImplementationsInterop is DeployImplementations {
vm.broadcast(msg.sender);
vm.broadcast(msg.sender);
// TODO: Eventually we will want to select the correct implementation based on the release.
// TODO: Eventually we will want to select the correct implementation based on the release.
OP
StackManager impl = new OPStack
ManagerInterop(superchainConfigProxy, protocolVersionsProxy);
OP
ContractsManager impl = new OPContracts
ManagerInterop(superchainConfigProxy, protocolVersionsProxy);
vm.label(address(impl), "OP
Stack
ManagerImpl");
vm.label(address(impl), "OP
Contracts
ManagerImpl");
_dio.set(_dio.op
s
mImpl.selector, address(impl));
_dio.set(_dio.op
c
mImpl.selector, address(impl));
}
}
function op
s
mSystemConfigSetter(
function op
c
mSystemConfigSetter(
DeployImplementationsInput,
DeployImplementationsInput,
DeployImplementationsOutput _dio
DeployImplementationsOutput _dio
)
)
internal
internal
view
view
override
override
returns (OP
Stack
Manager.ImplementationSetter memory)
returns (OP
Contracts
Manager.ImplementationSetter memory)
{
{
return OP
Stack
Manager.ImplementationSetter({
return OP
Contracts
Manager.ImplementationSetter({
name: "SystemConfig",
name: "SystemConfig",
info: OPStackManager.Implementation(address(_dio.systemConfigImpl()), SystemConfigInterop.initialize.selector)
info: OPContractsManager.Implementation(
address(_dio.systemConfigImpl()), SystemConfigInterop.initialize.selector
)
});
});
}
}
}
}
packages/contracts-bedrock/scripts/DeployOPChain.s.sol
View file @
b55f4d73
...
@@ -26,7 +26,7 @@ import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol";
...
@@ -26,7 +26,7 @@ import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol";
import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol";
import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol";
import { Claim, GameType, GameTypes, Hash, OutputRoot } from "src/dispute/lib/Types.sol";
import { Claim, GameType, GameTypes, Hash, OutputRoot } from "src/dispute/lib/Types.sol";
import { OP
StackManager } from "src/L1/OPStack
Manager.sol";
import { OP
ContractsManager } from "src/L1/OPContracts
Manager.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...
@@ -46,7 +46,7 @@ contract DeployOPChainInput is BaseDeployIO {
...
@@ -46,7 +46,7 @@ contract DeployOPChainInput is BaseDeployIO {
uint32 internal _basefeeScalar;
uint32 internal _basefeeScalar;
uint32 internal _blobBaseFeeScalar;
uint32 internal _blobBaseFeeScalar;
uint256 internal _l2ChainId;
uint256 internal _l2ChainId;
OP
StackManager internal _ops
mProxy;
OP
ContractsManager internal _opc
mProxy;
function set(bytes4 _sel, address _addr) public {
function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployOPChainInput: cannot set zero address");
require(_addr != address(0), "DeployOPChainInput: cannot set zero address");
...
@@ -56,7 +56,7 @@ contract DeployOPChainInput is BaseDeployIO {
...
@@ -56,7 +56,7 @@ contract DeployOPChainInput is BaseDeployIO {
else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr;
else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr;
else if (_sel == this.proposer.selector) _proposer = _addr;
else if (_sel == this.proposer.selector) _proposer = _addr;
else if (_sel == this.challenger.selector) _challenger = _addr;
else if (_sel == this.challenger.selector) _challenger = _addr;
else if (_sel == this.op
smProxy.selector) _opsmProxy = OPStack
Manager(_addr);
else if (_sel == this.op
cmProxy.selector) _opcmProxy = OPContracts
Manager(_addr);
else revert("DeployOPChainInput: unknown selector");
else revert("DeployOPChainInput: unknown selector");
}
}
...
@@ -129,7 +129,7 @@ contract DeployOPChainInput is BaseDeployIO {
...
@@ -129,7 +129,7 @@ contract DeployOPChainInput is BaseDeployIO {
// anchor root and deploy a new permissioned dispute game contract anyway.
// anchor root and deploy a new permissioned dispute game contract anyway.
//
//
// You can `console.logBytes(abi.encode(defaultStartingAnchorRoots))` to get the bytes that
// You can `console.logBytes(abi.encode(defaultStartingAnchorRoots))` to get the bytes that
// are hardcoded into `op-chain-ops/deployer/op
s
m/opchain.go`
// are hardcoded into `op-chain-ops/deployer/op
c
m/opchain.go`
AnchorStateRegistry.StartingAnchorRoot[] memory defaultStartingAnchorRoots =
AnchorStateRegistry.StartingAnchorRoot[] memory defaultStartingAnchorRoots =
new AnchorStateRegistry.StartingAnchorRoot[](1);
new AnchorStateRegistry.StartingAnchorRoot[](1);
defaultStartingAnchorRoots[0] = AnchorStateRegistry.StartingAnchorRoot({
defaultStartingAnchorRoots[0] = AnchorStateRegistry.StartingAnchorRoot({
...
@@ -139,10 +139,10 @@ contract DeployOPChainInput is BaseDeployIO {
...
@@ -139,10 +139,10 @@ contract DeployOPChainInput is BaseDeployIO {
return abi.encode(defaultStartingAnchorRoots);
return abi.encode(defaultStartingAnchorRoots);
}
}
// TODO: Check that op
s
m is proxied and it has an implementation.
// TODO: Check that op
c
m is proxied and it has an implementation.
function op
smProxy() public view returns (OPStack
Manager) {
function op
cmProxy() public view returns (OPContracts
Manager) {
require(address(_op
s
mProxy) != address(0), "DeployOPChainInput: not set");
require(address(_op
c
mProxy) != address(0), "DeployOPChainInput: not set");
return _op
s
mProxy;
return _op
c
mProxy;
}
}
}
}
...
@@ -309,8 +309,8 @@ contract DeployOPChainOutput is BaseDeployIO {
...
@@ -309,8 +309,8 @@ contract DeployOPChainOutput is BaseDeployIO {
require(GameType.unwrap(game.gameType()) == GameType.unwrap(GameTypes.PERMISSIONED_CANNON), "DPG-10");
require(GameType.unwrap(game.gameType()) == GameType.unwrap(GameTypes.PERMISSIONED_CANNON), "DPG-10");
require(Claim.unwrap(game.absolutePrestate()) == bytes32(hex"dead"), "DPG-20");
require(Claim.unwrap(game.absolutePrestate()) == bytes32(hex"dead"), "DPG-20");
OP
StackManager opsm = _doi.ops
mProxy();
OP
ContractsManager opcm = _doi.opc
mProxy();
(address mips,) = op
sm.implementations(ops
m.latestRelease(), "MIPS");
(address mips,) = op
cm.implementations(opc
m.latestRelease(), "MIPS");
require(game.vm() == IBigStepper(mips), "DPG-30");
require(game.vm() == IBigStepper(mips), "DPG-30");
require(address(game.weth()) == address(delayedWETHPermissionedGameProxy()), "DPG-40");
require(address(game.weth()) == address(delayedWETHPermissionedGameProxy()), "DPG-40");
...
@@ -368,7 +368,7 @@ contract DeployOPChainOutput is BaseDeployIO {
...
@@ -368,7 +368,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(systemConfig.startBlock() == block.number, "SYSCON-140");
require(systemConfig.startBlock() == block.number, "SYSCON-140");
require(
require(
systemConfig.batchInbox() == _doi.op
s
mProxy().chainIdToBatchInboxAddress(_doi.l2ChainId()), "SYSCON-150"
systemConfig.batchInbox() == _doi.op
c
mProxy().chainIdToBatchInboxAddress(_doi.l2ChainId()), "SYSCON-150"
);
);
require(systemConfig.l1CrossDomainMessenger() == address(l1CrossDomainMessengerProxy()), "SYSCON-160");
require(systemConfig.l1CrossDomainMessenger() == address(l1CrossDomainMessengerProxy()), "SYSCON-160");
...
@@ -393,7 +393,7 @@ contract DeployOPChainOutput is BaseDeployIO {
...
@@ -393,7 +393,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(messenger.PORTAL()) == address(optimismPortalProxy()), "L1xDM-30");
require(address(messenger.PORTAL()) == address(optimismPortalProxy()), "L1xDM-30");
require(address(messenger.portal()) == address(optimismPortalProxy()), "L1xDM-40");
require(address(messenger.portal()) == address(optimismPortalProxy()), "L1xDM-40");
require(address(messenger.superchainConfig()) == address(_doi.op
s
mProxy().superchainConfig()), "L1xDM-50");
require(address(messenger.superchainConfig()) == address(_doi.op
c
mProxy().superchainConfig()), "L1xDM-50");
bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204)));
bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204)));
require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60");
require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60");
...
@@ -409,7 +409,7 @@ contract DeployOPChainOutput is BaseDeployIO {
...
@@ -409,7 +409,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.messenger()) == address(messenger), "L1SB-20");
require(address(bridge.messenger()) == address(messenger), "L1SB-20");
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-30");
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-30");
require(address(bridge.otherBridge()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-40");
require(address(bridge.otherBridge()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-40");
require(address(bridge.superchainConfig()) == address(_doi.op
s
mProxy().superchainConfig()), "L1SB-50");
require(address(bridge.superchainConfig()) == address(_doi.op
c
mProxy().superchainConfig()), "L1SB-50");
}
}
function assertValidOptimismMintableERC20Factory(DeployOPChainInput) internal view {
function assertValidOptimismMintableERC20Factory(DeployOPChainInput) internal view {
...
@@ -431,12 +431,12 @@ contract DeployOPChainOutput is BaseDeployIO {
...
@@ -431,12 +431,12 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.MESSENGER()) == address(l1CrossDomainMessengerProxy()), "L721B-30");
require(address(bridge.MESSENGER()) == address(l1CrossDomainMessengerProxy()), "L721B-30");
require(address(bridge.messenger()) == address(l1CrossDomainMessengerProxy()), "L721B-40");
require(address(bridge.messenger()) == address(l1CrossDomainMessengerProxy()), "L721B-40");
require(address(bridge.superchainConfig()) == address(_doi.op
s
mProxy().superchainConfig()), "L721B-50");
require(address(bridge.superchainConfig()) == address(_doi.op
c
mProxy().superchainConfig()), "L721B-50");
}
}
function assertValidOptimismPortal(DeployOPChainInput _doi) internal view {
function assertValidOptimismPortal(DeployOPChainInput _doi) internal view {
OptimismPortal2 portal = optimismPortalProxy();
OptimismPortal2 portal = optimismPortalProxy();
ISuperchainConfig superchainConfig = ISuperchainConfig(address(_doi.op
s
mProxy().superchainConfig()));
ISuperchainConfig superchainConfig = ISuperchainConfig(address(_doi.op
c
mProxy().superchainConfig()));
require(address(portal.disputeGameFactory()) == address(disputeGameFactoryProxy()), "PORTAL-10");
require(address(portal.disputeGameFactory()) == address(disputeGameFactoryProxy()), "PORTAL-10");
require(address(portal.systemConfig()) == address(systemConfigProxy()), "PORTAL-20");
require(address(portal.systemConfig()) == address(systemConfigProxy()), "PORTAL-20");
...
@@ -470,9 +470,9 @@ contract DeployOPChain is Script {
...
@@ -470,9 +470,9 @@ contract DeployOPChain is Script {
// -------- Core Deployment Methods --------
// -------- Core Deployment Methods --------
function run(DeployOPChainInput _doi, DeployOPChainOutput _doo) public {
function run(DeployOPChainInput _doi, DeployOPChainOutput _doo) public {
OP
StackManager opsmProxy = _doi.ops
mProxy();
OP
ContractsManager opcmProxy = _doi.opc
mProxy();
OP
StackManager.Roles memory roles = OPStack
Manager.Roles({
OP
ContractsManager.Roles memory roles = OPContracts
Manager.Roles({
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
systemConfigOwner: _doi.systemConfigOwner(),
systemConfigOwner: _doi.systemConfigOwner(),
batcher: _doi.batcher(),
batcher: _doi.batcher(),
...
@@ -480,7 +480,7 @@ contract DeployOPChain is Script {
...
@@ -480,7 +480,7 @@ contract DeployOPChain is Script {
proposer: _doi.proposer(),
proposer: _doi.proposer(),
challenger: _doi.challenger()
challenger: _doi.challenger()
});
});
OP
StackManager.DeployInput memory deployInput = OPStack
Manager.DeployInput({
OP
ContractsManager.DeployInput memory deployInput = OPContracts
Manager.DeployInput({
roles: roles,
roles: roles,
basefeeScalar: _doi.basefeeScalar(),
basefeeScalar: _doi.basefeeScalar(),
blobBasefeeScalar: _doi.blobBaseFeeScalar(),
blobBasefeeScalar: _doi.blobBaseFeeScalar(),
...
@@ -489,7 +489,7 @@ contract DeployOPChain is Script {
...
@@ -489,7 +489,7 @@ contract DeployOPChain is Script {
});
});
vm.broadcast(msg.sender);
vm.broadcast(msg.sender);
OP
StackManager.DeployOutput memory deployOutput = ops
mProxy.deploy(deployInput);
OP
ContractsManager.DeployOutput memory deployOutput = opc
mProxy.deploy(deployInput);
vm.label(address(deployOutput.opChainProxyAdmin), "opChainProxyAdmin");
vm.label(address(deployOutput.opChainProxyAdmin), "opChainProxyAdmin");
vm.label(address(deployOutput.addressManager), "addressManager");
vm.label(address(deployOutput.addressManager), "addressManager");
...
...
packages/contracts-bedrock/scripts/DeploySuperchain.s.sol
View file @
b55f4d73
...
@@ -15,7 +15,7 @@ import { BaseDeployIO } from "scripts/utils/BaseDeployIO.sol";
...
@@ -15,7 +15,7 @@ import { BaseDeployIO } from "scripts/utils/BaseDeployIO.sol";
// This comment block defines the requirements and rationale for the architecture used in this forge
// This comment block defines the requirements and rationale for the architecture used in this forge
// script, along with other scripts that are being written as new Superchain-first deploy scripts to
// script, along with other scripts that are being written as new Superchain-first deploy scripts to
// complement the OP
Stack
Manager. The script architecture is a bit different than a standard forge
// complement the OP
Contracts
Manager. The script architecture is a bit different than a standard forge
// deployment script.
// deployment script.
//
//
// There are three categories of users that are expected to interact with the scripts:
// There are three categories of users that are expected to interact with the scripts:
...
...
packages/contracts-bedrock/semver-lock.json
View file @
b55f4d73
...
@@ -31,9 +31,9 @@
...
@@ -31,9 +31,9 @@
"initCodeHash"
:
"0x433fac9de52d8ce8fc3471b78ef6cc9cff1019f480c9ad91b6e09ab8738a8edb"
,
"initCodeHash"
:
"0x433fac9de52d8ce8fc3471b78ef6cc9cff1019f480c9ad91b6e09ab8738a8edb"
,
"sourceCodeHash"
:
"0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
"sourceCodeHash"
:
"0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
},
},
"src/L1/OP
Stack
Manager.sol"
:
{
"src/L1/OP
Contracts
Manager.sol"
:
{
"initCodeHash"
:
"0x92c72b75206e756742df25d67d295e4479e65db1473948b8f53cb4ca642025d5"
,
"initCodeHash"
:
"0x92c72b75206e756742df25d67d295e4479e65db1473948b8f53cb4ca642025d5"
,
"sourceCodeHash"
:
"0x
3cbd30c68cad0dd18d49165bd21d94422b7403174f91a733e2398539dadf8656
"
"sourceCodeHash"
:
"0x
5e04124ee67298d2f1245139baf7de79dee421d2c031c6e5abe0cd3b1bdbdb32
"
},
},
"src/L1/OptimismPortal.sol"
:
{
"src/L1/OptimismPortal.sol"
:
{
"initCodeHash"
:
"0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190"
,
"initCodeHash"
:
"0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190"
,
...
...
packages/contracts-bedrock/snapshots/abi/OP
Stack
Manager.json
→
packages/contracts-bedrock/snapshots/abi/OP
Contracts
Manager.json
View file @
b55f4d73
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
"type"
:
"address"
"type"
:
"address"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.Blueprints"
,
"internalType"
:
"struct OP
Contracts
Manager.Blueprints"
,
"name"
:
""
,
"name"
:
""
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
"type"
:
"address"
"type"
:
"address"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.Roles"
,
"internalType"
:
"struct OP
Contracts
Manager.Roles"
,
"name"
:
"roles"
,
"name"
:
"roles"
,
"type"
:
"tuple"
"type"
:
"tuple"
},
},
...
@@ -151,7 +151,7 @@
...
@@ -151,7 +151,7 @@
"type"
:
"bytes"
"type"
:
"bytes"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.DeployInput"
,
"internalType"
:
"struct OP
Contracts
Manager.DeployInput"
,
"name"
:
"_input"
,
"name"
:
"_input"
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
"type"
:
"address"
"type"
:
"address"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.DeployOutput"
,
"internalType"
:
"struct OP
Contracts
Manager.DeployOutput"
,
"name"
:
""
,
"name"
:
""
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
...
@@ -320,7 +320,7 @@
...
@@ -320,7 +320,7 @@
"type"
:
"address"
"type"
:
"address"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.Blueprints"
,
"internalType"
:
"struct OP
Contracts
Manager.Blueprints"
,
"name"
:
"blueprints"
,
"name"
:
"blueprints"
,
"type"
:
"tuple"
"type"
:
"tuple"
},
},
...
@@ -344,12 +344,12 @@
...
@@ -344,12 +344,12 @@
"type"
:
"bytes4"
"type"
:
"bytes4"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.Implementation"
,
"internalType"
:
"struct OP
Contracts
Manager.Implementation"
,
"name"
:
"info"
,
"name"
:
"info"
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.ImplementationSetter[]"
,
"internalType"
:
"struct OP
Contracts
Manager.ImplementationSetter[]"
,
"name"
:
"setters"
,
"name"
:
"setters"
,
"type"
:
"tuple[]"
"type"
:
"tuple[]"
},
},
...
@@ -364,7 +364,7 @@
...
@@ -364,7 +364,7 @@
"type"
:
"bool"
"type"
:
"bool"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.InitializerInputs"
,
"internalType"
:
"struct OP
Contracts
Manager.InitializerInputs"
,
"name"
:
"_initializerInputs"
,
"name"
:
"_initializerInputs"
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
...
...
packages/contracts-bedrock/snapshots/abi/OP
Stack
ManagerInterop.json
→
packages/contracts-bedrock/snapshots/abi/OP
Contracts
ManagerInterop.json
View file @
b55f4d73
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
"type"
:
"address"
"type"
:
"address"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.Blueprints"
,
"internalType"
:
"struct OP
Contracts
Manager.Blueprints"
,
"name"
:
""
,
"name"
:
""
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
"type"
:
"address"
"type"
:
"address"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.Roles"
,
"internalType"
:
"struct OP
Contracts
Manager.Roles"
,
"name"
:
"roles"
,
"name"
:
"roles"
,
"type"
:
"tuple"
"type"
:
"tuple"
},
},
...
@@ -151,7 +151,7 @@
...
@@ -151,7 +151,7 @@
"type"
:
"bytes"
"type"
:
"bytes"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.DeployInput"
,
"internalType"
:
"struct OP
Contracts
Manager.DeployInput"
,
"name"
:
"_input"
,
"name"
:
"_input"
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
"type"
:
"address"
"type"
:
"address"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.DeployOutput"
,
"internalType"
:
"struct OP
Contracts
Manager.DeployOutput"
,
"name"
:
""
,
"name"
:
""
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
...
@@ -320,7 +320,7 @@
...
@@ -320,7 +320,7 @@
"type"
:
"address"
"type"
:
"address"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.Blueprints"
,
"internalType"
:
"struct OP
Contracts
Manager.Blueprints"
,
"name"
:
"blueprints"
,
"name"
:
"blueprints"
,
"type"
:
"tuple"
"type"
:
"tuple"
},
},
...
@@ -344,12 +344,12 @@
...
@@ -344,12 +344,12 @@
"type"
:
"bytes4"
"type"
:
"bytes4"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.Implementation"
,
"internalType"
:
"struct OP
Contracts
Manager.Implementation"
,
"name"
:
"info"
,
"name"
:
"info"
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.ImplementationSetter[]"
,
"internalType"
:
"struct OP
Contracts
Manager.ImplementationSetter[]"
,
"name"
:
"setters"
,
"name"
:
"setters"
,
"type"
:
"tuple[]"
"type"
:
"tuple[]"
},
},
...
@@ -364,7 +364,7 @@
...
@@ -364,7 +364,7 @@
"type"
:
"bool"
"type"
:
"bool"
}
}
],
],
"internalType"
:
"struct OP
Stack
Manager.InitializerInputs"
,
"internalType"
:
"struct OP
Contracts
Manager.InitializerInputs"
,
"name"
:
"_initializerInputs"
,
"name"
:
"_initializerInputs"
,
"type"
:
"tuple"
"type"
:
"tuple"
}
}
...
...
packages/contracts-bedrock/snapshots/storageLayout/OP
Stack
Manager.json
→
packages/contracts-bedrock/snapshots/storageLayout/OP
Contracts
Manager.json
View file @
b55f4d73
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
"label"
:
"implementations"
,
"label"
:
"implementations"
,
"offset"
:
0
,
"offset"
:
0
,
"slot"
:
"2"
,
"slot"
:
"2"
,
"type"
:
"mapping(string => mapping(string => struct OP
Stack
Manager.Implementation))"
"type"
:
"mapping(string => mapping(string => struct OP
Contracts
Manager.Implementation))"
},
},
{
{
"bytes"
:
"32"
,
"bytes"
:
"32"
,
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
"label"
:
"blueprint"
,
"label"
:
"blueprint"
,
"offset"
:
0
,
"offset"
:
0
,
"slot"
:
"4"
,
"slot"
:
"4"
,
"type"
:
"struct OP
Stack
Manager.Blueprints"
"type"
:
"struct OP
Contracts
Manager.Blueprints"
},
},
{
{
"bytes"
:
"1600"
,
"bytes"
:
"1600"
,
...
...
packages/contracts-bedrock/snapshots/storageLayout/OP
Stack
ManagerInterop.json
→
packages/contracts-bedrock/snapshots/storageLayout/OP
Contracts
ManagerInterop.json
View file @
b55f4d73
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
"label"
:
"implementations"
,
"label"
:
"implementations"
,
"offset"
:
0
,
"offset"
:
0
,
"slot"
:
"2"
,
"slot"
:
"2"
,
"type"
:
"mapping(string => mapping(string => struct OP
Stack
Manager.Implementation))"
"type"
:
"mapping(string => mapping(string => struct OP
Contracts
Manager.Implementation))"
},
},
{
{
"bytes"
:
"32"
,
"bytes"
:
"32"
,
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
"label"
:
"blueprint"
,
"label"
:
"blueprint"
,
"offset"
:
0
,
"offset"
:
0
,
"slot"
:
"4"
,
"slot"
:
"4"
,
"type"
:
"struct OP
Stack
Manager.Blueprints"
"type"
:
"struct OP
Contracts
Manager.Blueprints"
},
},
{
{
"bytes"
:
"1600"
,
"bytes"
:
"1600"
,
...
...
packages/contracts-bedrock/src/L1/OP
Stack
Manager.sol
→
packages/contracts-bedrock/src/L1/OP
Contracts
Manager.sol
View file @
b55f4d73
...
@@ -40,7 +40,7 @@ import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
...
@@ -40,7 +40,7 @@ import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
/// @custom:proxied true
/// @custom:proxied true
contract OP
Stack
Manager is ISemver, Initializable {
contract OP
Contracts
Manager is ISemver, Initializable {
// -------- Structs --------
// -------- Structs --------
/// @notice Represents the roles that can be set when deploying a standard OP Stack chain.
/// @notice Represents the roles that can be set when deploying a standard OP Stack chain.
...
@@ -113,7 +113,7 @@ contract OPStackManager is ISemver, Initializable {
...
@@ -113,7 +113,7 @@ contract OPStackManager is ISemver, Initializable {
address permissionedDisputeGame2;
address permissionedDisputeGame2;
}
}
/// @notice Inputs required when initializing the OP
Stack
Manager. To avoid 'StackTooDeep' errors,
/// @notice Inputs required when initializing the OP
Contracts
Manager. To avoid 'StackTooDeep' errors,
/// all necessary inputs (excluding immutables) for initialization are bundled together in this struct.
/// all necessary inputs (excluding immutables) for initialization are bundled together in this struct.
struct InitializerInputs {
struct InitializerInputs {
Blueprints blueprints;
Blueprints blueprints;
...
@@ -133,7 +133,7 @@ contract OPStackManager is ISemver, Initializable {
...
@@ -133,7 +133,7 @@ contract OPStackManager is ISemver, Initializable {
/// @notice Address of the ProtocolVersions contract shared by all chains.
/// @notice Address of the ProtocolVersions contract shared by all chains.
ProtocolVersions public immutable protocolVersions;
ProtocolVersions public immutable protocolVersions;
/// @notice The latest release of the OP
Stack
Manager, as a string of the format `op-contracts/vX.Y.Z`.
/// @notice The latest release of the OP
Contracts
Manager, as a string of the format `op-contracts/vX.Y.Z`.
string public latestRelease;
string public latestRelease;
/// @notice Maps a release version to a contract name to it's implementation data.
/// @notice Maps a release version to a contract name to it's implementation data.
...
@@ -181,7 +181,7 @@ contract OPStackManager is ISemver, Initializable {
...
@@ -181,7 +181,7 @@ contract OPStackManager is ISemver, Initializable {
// -------- Methods --------
// -------- Methods --------
/// @notice OP
S
M is proxied. Therefore the `initialize` function replaces most constructor logic for this contract.
/// @notice OP
C
M is proxied. Therefore the `initialize` function replaces most constructor logic for this contract.
constructor(SuperchainConfig _superchainConfig, ProtocolVersions _protocolVersions) {
constructor(SuperchainConfig _superchainConfig, ProtocolVersions _protocolVersions) {
assertValidContractAddress(address(_superchainConfig));
assertValidContractAddress(address(_superchainConfig));
...
...
packages/contracts-bedrock/src/L1/OP
Stack
ManagerInterop.sol
→
packages/contracts-bedrock/src/L1/OP
Contracts
ManagerInterop.sol
View file @
b55f4d73
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
pragma solidity 0.8.15;
import { OP
StackManager } from "src/L1/OPStack
Manager.sol";
import { OP
ContractsManager } from "src/L1/OPContracts
Manager.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol";
...
@@ -9,12 +9,12 @@ import { SystemConfig } from "src/L1/SystemConfig.sol";
...
@@ -9,12 +9,12 @@ import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol";
/// @custom:proxied true
/// @custom:proxied true
contract OP
StackManagerInterop is OPStack
Manager {
contract OP
ContractsManagerInterop is OPContracts
Manager {
constructor(
constructor(
SuperchainConfig _superchainConfig,
SuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions
ProtocolVersions _protocolVersions
)
)
OP
Stack
Manager(_superchainConfig, _protocolVersions)
OP
Contracts
Manager(_superchainConfig, _protocolVersions)
{ }
{ }
// The `SystemConfigInterop` contract has an extra `address _dependencyManager` argument
// The `SystemConfigInterop` contract has an extra `address _dependencyManager` argument
...
...
packages/contracts-bedrock/test/DeployImplementations.t.sol
View file @
b55f4d73
...
@@ -10,7 +10,7 @@ import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol";
...
@@ -10,7 +10,7 @@ import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { OP
StackManager } from "src/L1/OPStack
Manager.sol";
import { OP
ContractsManager } from "src/L1/OPContracts
Manager.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...
@@ -106,11 +106,11 @@ contract DeployImplementationsOutput_Test is Test {
...
@@ -106,11 +106,11 @@ contract DeployImplementationsOutput_Test is Test {
function test_set_succeeds() public {
function test_set_succeeds() public {
Proxy proxy = new Proxy(address(0));
Proxy proxy = new Proxy(address(0));
address op
smImpl = address(makeAddr("ops
mImpl"));
address op
cmImpl = address(makeAddr("opc
mImpl"));
vm.prank(address(0));
vm.prank(address(0));
proxy.upgradeTo(op
s
mImpl);
proxy.upgradeTo(op
c
mImpl);
OP
StackManager opsmProxy = OPStack
Manager(address(proxy));
OP
ContractsManager opcmProxy = OPContracts
Manager(address(proxy));
OptimismPortal2 optimismPortalImpl = OptimismPortal2(payable(makeAddr("optimismPortalImpl")));
OptimismPortal2 optimismPortalImpl = OptimismPortal2(payable(makeAddr("optimismPortalImpl")));
DelayedWETH delayedWETHImpl = DelayedWETH(payable(makeAddr("delayedWETHImpl")));
DelayedWETH delayedWETHImpl = DelayedWETH(payable(makeAddr("delayedWETHImpl")));
PreimageOracle preimageOracleSingleton = PreimageOracle(makeAddr("preimageOracleSingleton"));
PreimageOracle preimageOracleSingleton = PreimageOracle(makeAddr("preimageOracleSingleton"));
...
@@ -124,8 +124,8 @@ contract DeployImplementationsOutput_Test is Test {
...
@@ -124,8 +124,8 @@ contract DeployImplementationsOutput_Test is Test {
OptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryImpl"));
OptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryImpl"));
DisputeGameFactory disputeGameFactoryImpl = DisputeGameFactory(makeAddr("disputeGameFactoryImpl"));
DisputeGameFactory disputeGameFactoryImpl = DisputeGameFactory(makeAddr("disputeGameFactoryImpl"));
vm.etch(address(op
smProxy), address(ops
mProxy).code);
vm.etch(address(op
cmProxy), address(opc
mProxy).code);
vm.etch(address(op
s
mImpl), hex"01");
vm.etch(address(op
c
mImpl), hex"01");
vm.etch(address(optimismPortalImpl), hex"01");
vm.etch(address(optimismPortalImpl), hex"01");
vm.etch(address(delayedWETHImpl), hex"01");
vm.etch(address(delayedWETHImpl), hex"01");
vm.etch(address(preimageOracleSingleton), hex"01");
vm.etch(address(preimageOracleSingleton), hex"01");
...
@@ -136,7 +136,7 @@ contract DeployImplementationsOutput_Test is Test {
...
@@ -136,7 +136,7 @@ contract DeployImplementationsOutput_Test is Test {
vm.etch(address(l1StandardBridgeImpl), hex"01");
vm.etch(address(l1StandardBridgeImpl), hex"01");
vm.etch(address(optimismMintableERC20FactoryImpl), hex"01");
vm.etch(address(optimismMintableERC20FactoryImpl), hex"01");
vm.etch(address(disputeGameFactoryImpl), hex"01");
vm.etch(address(disputeGameFactoryImpl), hex"01");
dio.set(dio.op
smProxy.selector, address(ops
mProxy));
dio.set(dio.op
cmProxy.selector, address(opc
mProxy));
dio.set(dio.optimismPortalImpl.selector, address(optimismPortalImpl));
dio.set(dio.optimismPortalImpl.selector, address(optimismPortalImpl));
dio.set(dio.delayedWETHImpl.selector, address(delayedWETHImpl));
dio.set(dio.delayedWETHImpl.selector, address(delayedWETHImpl));
dio.set(dio.preimageOracleSingleton.selector, address(preimageOracleSingleton));
dio.set(dio.preimageOracleSingleton.selector, address(preimageOracleSingleton));
...
@@ -148,7 +148,7 @@ contract DeployImplementationsOutput_Test is Test {
...
@@ -148,7 +148,7 @@ contract DeployImplementationsOutput_Test is Test {
dio.set(dio.optimismMintableERC20FactoryImpl.selector, address(optimismMintableERC20FactoryImpl));
dio.set(dio.optimismMintableERC20FactoryImpl.selector, address(optimismMintableERC20FactoryImpl));
dio.set(dio.disputeGameFactoryImpl.selector, address(disputeGameFactoryImpl));
dio.set(dio.disputeGameFactoryImpl.selector, address(disputeGameFactoryImpl));
assertEq(address(op
smProxy), address(dio.ops
mProxy()), "50");
assertEq(address(op
cmProxy), address(dio.opc
mProxy()), "50");
assertEq(address(optimismPortalImpl), address(dio.optimismPortalImpl()), "100");
assertEq(address(optimismPortalImpl), address(dio.optimismPortalImpl()), "100");
assertEq(address(delayedWETHImpl), address(dio.delayedWETHImpl()), "200");
assertEq(address(delayedWETHImpl), address(dio.delayedWETHImpl()), "200");
assertEq(address(preimageOracleSingleton), address(dio.preimageOracleSingleton()), "300");
assertEq(address(preimageOracleSingleton), address(dio.preimageOracleSingleton()), "300");
...
@@ -413,7 +413,7 @@ contract DeployImplementations_Test is Test {
...
@@ -413,7 +413,7 @@ contract DeployImplementations_Test is Test {
string memory release = string(bytes.concat(hash(_seed, 5)));
string memory release = string(bytes.concat(hash(_seed, 5)));
protocolVersionsProxy = ProtocolVersions(address(uint160(uint256(hash(_seed, 7)))));
protocolVersionsProxy = ProtocolVersions(address(uint160(uint256(hash(_seed, 7)))));
// Must configure the ProxyAdmin contract which is used to upgrade the OP
S
M's proxy contract.
// Must configure the ProxyAdmin contract which is used to upgrade the OP
C
M's proxy contract.
ProxyAdmin superchainProxyAdmin = new ProxyAdmin(msg.sender);
ProxyAdmin superchainProxyAdmin = new ProxyAdmin(msg.sender);
superchainConfigProxy = SuperchainConfig(address(new Proxy(payable(address(superchainProxyAdmin)))));
superchainConfigProxy = SuperchainConfig(address(new Proxy(payable(address(superchainProxyAdmin)))));
...
...
packages/contracts-bedrock/test/DeployOPChain.t.sol
View file @
b55f4d73
...
@@ -23,7 +23,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol
...
@@ -23,7 +23,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions, ProtocolVersion } from "src/L1/ProtocolVersions.sol";
import { ProtocolVersions, ProtocolVersion } from "src/L1/ProtocolVersions.sol";
import { OP
StackManager } from "src/L1/OPStack
Manager.sol";
import { OP
ContractsManager } from "src/L1/OPContracts
Manager.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...
@@ -46,7 +46,7 @@ contract DeployOPChainInput_Test is Test {
...
@@ -46,7 +46,7 @@ contract DeployOPChainInput_Test is Test {
uint32 basefeeScalar = 100;
uint32 basefeeScalar = 100;
uint32 blobBaseFeeScalar = 200;
uint32 blobBaseFeeScalar = 200;
uint256 l2ChainId = 300;
uint256 l2ChainId = 300;
OP
StackManager opsm = OPStackManager(makeAddr("ops
m"));
OP
ContractsManager opcm = OPContractsManager(makeAddr("opc
m"));
function setUp() public {
function setUp() public {
doi = new DeployOPChainInput();
doi = new DeployOPChainInput();
...
@@ -62,7 +62,7 @@ contract DeployOPChainInput_Test is Test {
...
@@ -62,7 +62,7 @@ contract DeployOPChainInput_Test is Test {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.op
smProxy.selector, address(ops
m));
doi.set(doi.op
cmProxy.selector, address(opc
m));
// Compare the default inputs to the getter methods.
// Compare the default inputs to the getter methods.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "200");
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "200");
assertEq(systemConfigOwner, doi.systemConfigOwner(), "300");
assertEq(systemConfigOwner, doi.systemConfigOwner(), "300");
...
@@ -73,7 +73,7 @@ contract DeployOPChainInput_Test is Test {
...
@@ -73,7 +73,7 @@ contract DeployOPChainInput_Test is Test {
assertEq(basefeeScalar, doi.basefeeScalar(), "800");
assertEq(basefeeScalar, doi.basefeeScalar(), "800");
assertEq(blobBaseFeeScalar, doi.blobBaseFeeScalar(), "900");
assertEq(blobBaseFeeScalar, doi.blobBaseFeeScalar(), "900");
assertEq(l2ChainId, doi.l2ChainId(), "1000");
assertEq(l2ChainId, doi.l2ChainId(), "1000");
assertEq(address(op
sm), address(doi.ops
mProxy()), "1100");
assertEq(address(op
cm), address(doi.opc
mProxy()), "1100");
}
}
function test_getters_whenNotSet_revert() public {
function test_getters_whenNotSet_revert() public {
...
@@ -328,7 +328,7 @@ contract DeployOPChain_TestBase is Test {
...
@@ -328,7 +328,7 @@ contract DeployOPChain_TestBase is Test {
ProtocolVersions protocolVersionsProxy;
ProtocolVersions protocolVersionsProxy;
// Define default inputs for DeployOPChain.
// Define default inputs for DeployOPChain.
// `op
s
m` is set during `setUp` since it is an output of the previous step.
// `op
c
m` is set during `setUp` since it is an output of the previous step.
address opChainProxyAdminOwner = makeAddr("defaultOPChainProxyAdminOwner");
address opChainProxyAdminOwner = makeAddr("defaultOPChainProxyAdminOwner");
address systemConfigOwner = makeAddr("defaultSystemConfigOwner");
address systemConfigOwner = makeAddr("defaultSystemConfigOwner");
address batcher = makeAddr("defaultBatcher");
address batcher = makeAddr("defaultBatcher");
...
@@ -339,7 +339,7 @@ contract DeployOPChain_TestBase is Test {
...
@@ -339,7 +339,7 @@ contract DeployOPChain_TestBase is Test {
uint32 blobBaseFeeScalar = 200;
uint32 blobBaseFeeScalar = 200;
uint256 l2ChainId = 300;
uint256 l2ChainId = 300;
AnchorStateRegistry.StartingAnchorRoot[] startingAnchorRoots;
AnchorStateRegistry.StartingAnchorRoot[] startingAnchorRoots;
OP
StackManager opsm = OPStack
Manager(address(0));
OP
ContractsManager opcm = OPContracts
Manager(address(0));
function setUp() public virtual {
function setUp() public virtual {
// Set defaults for reference types
// Set defaults for reference types
...
@@ -401,8 +401,8 @@ contract DeployOPChain_TestBase is Test {
...
@@ -401,8 +401,8 @@ contract DeployOPChain_TestBase is Test {
deployOPChain = new DeployOPChain();
deployOPChain = new DeployOPChain();
(doi, doo) = deployOPChain.etchIOContracts();
(doi, doo) = deployOPChain.etchIOContracts();
// Set the OP
StackManager address as input to
DeployOPChain.
// Set the OP
ContractsManager input for
DeployOPChain.
op
sm = dio.ops
mProxy();
op
cm = dio.opc
mProxy();
}
}
// See the function of the same name in the `DeployImplementations_Test` contract of
// See the function of the same name in the `DeployImplementations_Test` contract of
...
@@ -456,11 +456,11 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
...
@@ -456,11 +456,11 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.op
smProxy.selector, address(ops
m)); // Not fuzzed since it must be an actual instance.
doi.set(doi.op
cmProxy.selector, address(opc
m)); // Not fuzzed since it must be an actual instance.
deployOPChain.run(doi, doo);
deployOPChain.run(doi, doo);
// TODO Add fault proof contract assertions below once OP
S
M fully supports them.
// TODO Add fault proof contract assertions below once OP
C
M fully supports them.
// Assert that individual input fields were properly set based on the inputs.
// Assert that individual input fields were properly set based on the inputs.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "100");
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "100");
...
@@ -486,7 +486,7 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
...
@@ -486,7 +486,7 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
// assertEq(address(doo.faultDisputeGame().proposer()), proposer, "2700");
// assertEq(address(doo.faultDisputeGame().proposer()), proposer, "2700");
// assertEq(address(doo.faultDisputeGame().challenger()), challenger, "2800");
// assertEq(address(doo.faultDisputeGame().challenger()), challenger, "2800");
// Most architecture assertions are handled within the OP
Stack
Manager itself and therefore
// Most architecture assertions are handled within the OP
Contracts
Manager itself and therefore
// we only assert on the things that are not visible onchain.
// we only assert on the things that are not visible onchain.
// TODO add these assertions: AddressManager, Proxy, ProxyAdmin, etc.
// TODO add these assertions: AddressManager, Proxy, ProxyAdmin, etc.
}
}
...
...
packages/contracts-bedrock/test/L1/OP
Stack
Manager.t.sol
→
packages/contracts-bedrock/test/L1/OP
Contracts
Manager.t.sol
View file @
b55f4d73
...
@@ -6,18 +6,18 @@ import { Test, stdStorage, StdStorage } from "forge-std/Test.sol";
...
@@ -6,18 +6,18 @@ import { Test, stdStorage, StdStorage } from "forge-std/Test.sol";
import { DeployOPChainInput } from "scripts/DeployOPChain.s.sol";
import { DeployOPChainInput } from "scripts/DeployOPChain.s.sol";
import { DeployOPChain_TestBase } from "test/DeployOPChain.t.sol";
import { DeployOPChain_TestBase } from "test/DeployOPChain.t.sol";
import { OP
StackManager } from "src/L1/OPStack
Manager.sol";
import { OP
ContractsManager } from "src/L1/OPContracts
Manager.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
// Exposes internal functions for testing.
// Exposes internal functions for testing.
contract OP
StackManager_Harness is OPStack
Manager {
contract OP
ContractsManager_Harness is OPContracts
Manager {
constructor(
constructor(
SuperchainConfig _superchainConfig,
SuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions
ProtocolVersions _protocolVersions
)
)
OP
Stack
Manager(_superchainConfig, _protocolVersions)
OP
Contracts
Manager(_superchainConfig, _protocolVersions)
{ }
{ }
function chainIdToBatchInboxAddress_exposed(uint256 l2ChainId) public pure returns (address) {
function chainIdToBatchInboxAddress_exposed(uint256 l2ChainId) public pure returns (address) {
...
@@ -26,12 +26,12 @@ contract OPStackManager_Harness is OPStackManager {
...
@@ -26,12 +26,12 @@ contract OPStackManager_Harness is OPStackManager {
}
}
// Unlike other test suites, we intentionally do not inherit from CommonTest or Setup. This is
// Unlike other test suites, we intentionally do not inherit from CommonTest or Setup. This is
// because OP
Stack
Manager acts as a deploy script, so we start from a clean slate here and
// because OP
Contracts
Manager acts as a deploy script, so we start from a clean slate here and
// work OP
Stack
Manager's deployment into the existing test setup, instead of using the existing
// work OP
Contracts
Manager's deployment into the existing test setup, instead of using the existing
// test setup to deploy OP
Stack
Manager. We do however inherit from DeployOPChain_TestBase so
// test setup to deploy OP
Contracts
Manager. We do however inherit from DeployOPChain_TestBase so
// we can use its setup to deploy the implementations similarly to how a real deployment would
// we can use its setup to deploy the implementations similarly to how a real deployment would
// happen.
// happen.
contract OP
Stack
Manager_Deploy_Test is DeployOPChain_TestBase {
contract OP
Contracts
Manager_Deploy_Test is DeployOPChain_TestBase {
using stdStorage for StdStorage;
using stdStorage for StdStorage;
event Deployed(uint256 indexed l2ChainId, SystemConfig indexed systemConfig);
event Deployed(uint256 indexed l2ChainId, SystemConfig indexed systemConfig);
...
@@ -48,14 +48,14 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
...
@@ -48,14 +48,14 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.op
smProxy.selector, address(ops
m));
doi.set(doi.op
cmProxy.selector, address(opc
m));
}
}
// This helper function is used to convert the input struct type defined in DeployOPChain.s.sol
// This helper function is used to convert the input struct type defined in DeployOPChain.s.sol
// to the input struct type defined in OP
Stack
Manager.sol.
// to the input struct type defined in OP
Contracts
Manager.sol.
function toOP
SMDeployInput(DeployOPChainInput _doi) internal view returns (OPStack
Manager.DeployInput memory) {
function toOP
CMDeployInput(DeployOPChainInput _doi) internal view returns (OPContracts
Manager.DeployInput memory) {
return OP
Stack
Manager.DeployInput({
return OP
Contracts
Manager.DeployInput({
roles: OP
Stack
Manager.Roles({
roles: OP
Contracts
Manager.Roles({
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
systemConfigOwner: _doi.systemConfigOwner(),
systemConfigOwner: _doi.systemConfigOwner(),
batcher: _doi.batcher(),
batcher: _doi.batcher(),
...
@@ -71,30 +71,30 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
...
@@ -71,30 +71,30 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
}
}
function test_deploy_l2ChainIdEqualsZero_reverts() public {
function test_deploy_l2ChainIdEqualsZero_reverts() public {
OP
StackManager.DeployInput memory deployInput = toOPS
MDeployInput(doi);
OP
ContractsManager.DeployInput memory deployInput = toOPC
MDeployInput(doi);
deployInput.l2ChainId = 0;
deployInput.l2ChainId = 0;
vm.expectRevert(OP
Stack
Manager.InvalidChainId.selector);
vm.expectRevert(OP
Contracts
Manager.InvalidChainId.selector);
op
s
m.deploy(deployInput);
op
c
m.deploy(deployInput);
}
}
function test_deploy_l2ChainIdEqualsCurrentChainId_reverts() public {
function test_deploy_l2ChainIdEqualsCurrentChainId_reverts() public {
OP
StackManager.DeployInput memory deployInput = toOPS
MDeployInput(doi);
OP
ContractsManager.DeployInput memory deployInput = toOPC
MDeployInput(doi);
deployInput.l2ChainId = block.chainid;
deployInput.l2ChainId = block.chainid;
vm.expectRevert(OP
Stack
Manager.InvalidChainId.selector);
vm.expectRevert(OP
Contracts
Manager.InvalidChainId.selector);
op
s
m.deploy(deployInput);
op
c
m.deploy(deployInput);
}
}
function test_deploy_succeeds() public {
function test_deploy_succeeds() public {
vm.expectEmit(true, false, true, true); // TODO precompute the system config address.
vm.expectEmit(true, false, true, true); // TODO precompute the system config address.
emit Deployed(doi.l2ChainId(), SystemConfig(address(1)));
emit Deployed(doi.l2ChainId(), SystemConfig(address(1)));
op
sm.deploy(toOPS
MDeployInput(doi));
op
cm.deploy(toOPC
MDeployInput(doi));
}
}
}
}
// These tests use the harness which exposes internal functions for testing.
// These tests use the harness which exposes internal functions for testing.
contract OP
Stack
Manager_InternalMethods_Test is Test {
contract OP
Contracts
Manager_InternalMethods_Test is Test {
OP
StackManager_Harness ops
mHarness;
OP
ContractsManager_Harness opc
mHarness;
function setUp() public {
function setUp() public {
SuperchainConfig superchainConfigProxy = SuperchainConfig(makeAddr("superchainConfig"));
SuperchainConfig superchainConfigProxy = SuperchainConfig(makeAddr("superchainConfig"));
...
@@ -102,7 +102,7 @@ contract OPStackManager_InternalMethods_Test is Test {
...
@@ -102,7 +102,7 @@ contract OPStackManager_InternalMethods_Test is Test {
vm.etch(address(superchainConfigProxy), hex"01");
vm.etch(address(superchainConfigProxy), hex"01");
vm.etch(address(protocolVersionsProxy), hex"01");
vm.etch(address(protocolVersionsProxy), hex"01");
op
smHarness = new OPStack
Manager_Harness({
op
cmHarness = new OPContracts
Manager_Harness({
_superchainConfig: superchainConfigProxy,
_superchainConfig: superchainConfigProxy,
_protocolVersions: protocolVersionsProxy
_protocolVersions: protocolVersionsProxy
});
});
...
@@ -114,12 +114,12 @@ contract OPStackManager_InternalMethods_Test is Test {
...
@@ -114,12 +114,12 @@ contract OPStackManager_InternalMethods_Test is Test {
// 2. Hash it and manually take the first 19 bytes, and prefixed it with 0x00.
// 2. Hash it and manually take the first 19 bytes, and prefixed it with 0x00.
uint256 chainId = 1234;
uint256 chainId = 1234;
address expected = 0x0017FA14b0d73Aa6A26D6b8720c1c84b50984f5C;
address expected = 0x0017FA14b0d73Aa6A26D6b8720c1c84b50984f5C;
address actual = op
s
mHarness.chainIdToBatchInboxAddress_exposed(chainId);
address actual = op
c
mHarness.chainIdToBatchInboxAddress_exposed(chainId);
vm.assertEq(expected, actual);
vm.assertEq(expected, actual);
chainId = type(uint256).max;
chainId = type(uint256).max;
expected = 0x00a9C584056064687E149968cBaB758a3376D22A;
expected = 0x00a9C584056064687E149968cBaB758a3376D22A;
actual = op
s
mHarness.chainIdToBatchInboxAddress_exposed(chainId);
actual = op
c
mHarness.chainIdToBatchInboxAddress_exposed(chainId);
vm.assertEq(expected, actual);
vm.assertEq(expected, actual);
}
}
}
}
packages/contracts-bedrock/test/Specs.t.sol
View file @
b55f4d73
...
@@ -10,7 +10,7 @@ import { Executables } from "scripts/libraries/Executables.sol";
...
@@ -10,7 +10,7 @@ import { Executables } from "scripts/libraries/Executables.sol";
import { ForgeArtifacts, Abi, AbiEntry } from "scripts/libraries/ForgeArtifacts.sol";
import { ForgeArtifacts, Abi, AbiEntry } from "scripts/libraries/ForgeArtifacts.sol";
// Contracts
// Contracts
import { OP
StackManager } from "src/L1/OPStack
Manager.sol";
import { OP
ContractsManager } from "src/L1/OPContracts
Manager.sol";
// Interfaces
// Interfaces
import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
...
@@ -836,29 +836,29 @@ contract Specification_Test is CommonTest {
...
@@ -836,29 +836,29 @@ contract Specification_Test is CommonTest {
_addSpec({ _name: "WETH98", _sel: _getSel("transferFrom(address,address,uint256)") });
_addSpec({ _name: "WETH98", _sel: _getSel("transferFrom(address,address,uint256)") });
_addSpec({ _name: "WETH98", _sel: _getSel("withdraw(uint256)") });
_addSpec({ _name: "WETH98", _sel: _getSel("withdraw(uint256)") });
// OP
Stack
Manager
// OP
Contracts
Manager
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("version()") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("version()") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OP
StackManager", _sel: OPStack
Manager.initialize.selector });
_addSpec({ _name: "OP
ContractsManager", _sel: OPContracts
Manager.initialize.selector });
_addSpec({ _name: "OP
StackManager", _sel: OPStack
Manager.deploy.selector });
_addSpec({ _name: "OP
ContractsManager", _sel: OPContracts
Manager.deploy.selector });
_addSpec({ _name: "OP
StackManager", _sel: OPStack
Manager.blueprints.selector });
_addSpec({ _name: "OP
ContractsManager", _sel: OPContracts
Manager.blueprints.selector });
_addSpec({ _name: "OP
StackManager", _sel: OPStack
Manager.chainIdToBatchInboxAddress.selector });
_addSpec({ _name: "OP
ContractsManager", _sel: OPContracts
Manager.chainIdToBatchInboxAddress.selector });
// OP
Stack
ManagerInterop
// OP
Contracts
ManagerInterop
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("version()") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("version()") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OP
StackManagerInterop", _sel: OPStack
Manager.initialize.selector });
_addSpec({ _name: "OP
ContractsManagerInterop", _sel: OPContracts
Manager.initialize.selector });
_addSpec({ _name: "OP
StackManagerInterop", _sel: OPStack
Manager.deploy.selector });
_addSpec({ _name: "OP
ContractsManagerInterop", _sel: OPContracts
Manager.deploy.selector });
_addSpec({ _name: "OP
StackManagerInterop", _sel: OPStack
Manager.blueprints.selector });
_addSpec({ _name: "OP
ContractsManagerInterop", _sel: OPContracts
Manager.blueprints.selector });
_addSpec({ _name: "OP
StackManagerInterop", _sel: OPStack
Manager.chainIdToBatchInboxAddress.selector });
_addSpec({ _name: "OP
ContractsManagerInterop", _sel: OPContracts
Manager.chainIdToBatchInboxAddress.selector });
// DeputyGuardianModule
// DeputyGuardianModule
_addSpec({
_addSpec({
...
...
packages/contracts-bedrock/test/vendor/Initializable.t.sol
View file @
b55f4d73
...
@@ -411,8 +411,8 @@ contract Initializer_Test is Bridge_Initializer {
...
@@ -411,8 +411,8 @@ contract Initializer_Test is Bridge_Initializer {
excludes[4] = "src/dispute/FaultDisputeGame.sol";
excludes[4] = "src/dispute/FaultDisputeGame.sol";
excludes[5] = "src/dispute/PermissionedDisputeGame.sol";
excludes[5] = "src/dispute/PermissionedDisputeGame.sol";
// TODO: Eventually remove this exclusion. Same reason as above dispute contracts.
// TODO: Eventually remove this exclusion. Same reason as above dispute contracts.
excludes[6] = "src/L1/OP
Stack
Manager.sol";
excludes[6] = "src/L1/OP
Contracts
Manager.sol";
excludes[7] = "src/L1/OP
Stack
ManagerInterop.sol";
excludes[7] = "src/L1/OP
Contracts
ManagerInterop.sol";
// Get all contract names in the src directory, minus the excluded contracts.
// Get all contract names in the src directory, minus the excluded contracts.
string[] memory contractNames = ForgeArtifacts.getContractNames("src/*", excludes);
string[] memory contractNames = ForgeArtifacts.getContractNames("src/*", excludes);
...
...
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