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
Expand all
Show 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:
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
\ 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) {
{
"SuperchainConfigImpl"
,
st
.
SuperchainDeployment
.
SuperchainConfigImplAddress
},
{
"ProtocolVersionsProxy"
,
st
.
SuperchainDeployment
.
ProtocolVersionsProxyAddress
},
{
"ProtocolVersionsImpl"
,
st
.
SuperchainDeployment
.
ProtocolVersionsImplAddress
},
{
"Op
smProxy"
,
st
.
ImplementationsDeployment
.
Ops
mProxyAddress
},
{
"Op
cmProxy"
,
st
.
ImplementationsDeployment
.
Opc
mProxyAddress
},
{
"DelayedWETHImpl"
,
st
.
ImplementationsDeployment
.
DelayedWETHImplAddress
},
{
"OptimismPortalImpl"
,
st
.
ImplementationsDeployment
.
OptimismPortalImplAddress
},
{
"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
(
"fmt"
...
...
@@ -16,7 +16,7 @@ type DeployImplementationsInput struct {
ChallengePeriodSeconds
*
big
.
Int
ProofMaturityDelaySeconds
*
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
SuperchainConfigProxy
common
.
Address
ProtocolVersionsProxy
common
.
Address
...
...
@@ -31,8 +31,8 @@ func (input *DeployImplementationsInput) InputSet() bool {
}
type
DeployImplementationsOutput
struct
{
Op
s
mProxy
common
.
Address
Op
s
mImpl
common
.
Address
Op
c
mProxy
common
.
Address
Op
c
mImpl
common
.
Address
DelayedWETHImpl
common
.
Address
OptimismPortalImpl
common
.
Address
PreimageOracleSingleton
common
.
Address
...
...
@@ -84,12 +84,12 @@ func DeployImplementations(
}
defer
cleanupDeploy
()
op
smContract
:=
"OPStack
Manager"
op
cmContract
:=
"OPContracts
Manager"
if
input
.
UseInterop
{
op
smContract
=
"OPStack
ManagerInterop"
op
cmContract
=
"OPContracts
ManagerInterop"
}
if
err
:=
host
.
RememberOnLabel
(
"OP
StackManager"
,
opsmContract
+
".sol"
,
ops
mContract
);
err
!=
nil
{
return
output
,
fmt
.
Errorf
(
"failed to link OP
Stack
Manager label: %w"
,
err
)
if
err
:=
host
.
RememberOnLabel
(
"OP
ContractsManager"
,
opcmContract
+
".sol"
,
opc
mContract
);
err
!=
nil
{
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
...
...
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
(
"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
(
"fmt"
...
...
@@ -26,7 +26,7 @@ type DeployOPChainInput struct {
BasefeeScalar
uint32
BlobBaseFeeScalar
uint32
L2ChainId
*
big
.
Int
Op
s
mProxy
common
.
Address
Op
c
mProxy
common
.
Address
}
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"
...
...
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
(
"fmt"
...
...
op-chain-ops/deployer/pipeline/implementations.go
View file @
b55f4d73
...
...
@@ -5,7 +5,7 @@ import (
"fmt"
"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/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
...
...
@@ -22,7 +22,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
lgr
.
Info
(
"deploying implementations"
)
var
dump
*
foundry
.
ForgeAllocs
var
dio
op
s
m
.
DeployImplementationsOutput
var
dio
op
c
m
.
DeployImplementationsOutput
var
err
error
err
=
CallScriptBroadcast
(
ctx
,
...
...
@@ -37,9 +37,9 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
Handler
:
func
(
host
*
script
.
Host
)
error
{
host
.
SetEnvVar
(
"IMPL_SALT"
,
st
.
Create2Salt
.
Hex
()[
2
:
])
host
.
ImportState
(
st
.
SuperchainDeployment
.
StateDump
)
dio
,
err
=
op
s
m
.
DeployImplementations
(
dio
,
err
=
op
c
m
.
DeployImplementations
(
host
,
op
s
m
.
DeployImplementationsInput
{
op
c
m
.
DeployImplementationsInput
{
Salt
:
st
.
Create2Salt
,
WithdrawalDelaySeconds
:
big
.
NewInt
(
604800
),
MinProposalSizeBytes
:
big
.
NewInt
(
126000
),
...
...
@@ -50,7 +50,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
SuperchainConfigProxy
:
st
.
SuperchainDeployment
.
SuperchainConfigProxyAddress
,
ProtocolVersionsProxy
:
st
.
SuperchainDeployment
.
ProtocolVersionsProxyAddress
,
SuperchainProxyAdmin
:
st
.
SuperchainDeployment
.
ProxyAdminAddress
,
StandardVersionsToml
:
op
s
m
.
StandardVersionsData
,
StandardVersionsToml
:
op
c
m
.
StandardVersionsData
,
UseInterop
:
false
,
},
)
...
...
@@ -70,7 +70,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
}
st
.
ImplementationsDeployment
=
&
state
.
ImplementationsDeployment
{
Op
smProxyAddress
:
dio
.
Ops
mProxy
,
Op
cmProxyAddress
:
dio
.
Opc
mProxy
,
DelayedWETHImplAddress
:
dio
.
DelayedWETHImpl
,
OptimismPortalImplAddress
:
dio
.
OptimismPortalImpl
,
PreimageOracleSingletonAddress
:
dio
.
PreimageOracleSingleton
,
...
...
op-chain-ops/deployer/pipeline/l2genesis.go
View file @
b55f4d73
...
...
@@ -8,7 +8,7 @@ import (
"fmt"
"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/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
...
...
@@ -47,8 +47,8 @@ func GenerateL2Genesis(ctx context.Context, env *Env, artifactsFS foundry.StatDi
Client
:
env
.
L1Client
,
Broadcaster
:
DiscardBroadcaster
,
Handler
:
func
(
host
*
script
.
Host
)
error
{
err
:=
op
sm
.
L2Genesis
(
host
,
&
ops
m
.
L2GenesisInput
{
L1Deployments
:
op
s
m
.
L1Deployments
{
err
:=
op
cm
.
L2Genesis
(
host
,
&
opc
m
.
L2GenesisInput
{
L1Deployments
:
op
c
m
.
L1Deployments
{
L1CrossDomainMessengerProxy
:
thisChainState
.
L1CrossDomainMessengerProxyAddress
,
L1StandardBridgeProxy
:
thisChainState
.
L1StandardBridgeProxyAddress
,
L1ERC721BridgeProxy
:
thisChainState
.
L1ERC721BridgeProxyAddress
,
...
...
op-chain-ops/deployer/pipeline/opchain.go
View file @
b55f4d73
...
...
@@ -5,7 +5,7 @@ import (
"fmt"
"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/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
...
...
@@ -27,7 +27,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
return
fmt
.
Errorf
(
"failed to get chain intent: %w"
,
err
)
}
var
dco
op
s
m
.
DeployOPChainOutput
var
dco
op
c
m
.
DeployOPChainOutput
err
=
CallScriptBroadcast
(
ctx
,
CallScriptBroadcastOpts
{
...
...
@@ -40,9 +40,9 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
Broadcaster
:
KeyedBroadcaster
,
Handler
:
func
(
host
*
script
.
Host
)
error
{
host
.
ImportState
(
st
.
ImplementationsDeployment
.
StateDump
)
dco
,
err
=
op
s
m
.
DeployOPChain
(
dco
,
err
=
op
c
m
.
DeployOPChain
(
host
,
op
s
m
.
DeployOPChainInput
{
op
c
m
.
DeployOPChainInput
{
OpChainProxyAdminOwner
:
thisIntent
.
Roles
.
ProxyAdminOwner
,
SystemConfigOwner
:
thisIntent
.
Roles
.
SystemConfigOwner
,
Batcher
:
thisIntent
.
Roles
.
Batcher
,
...
...
@@ -52,7 +52,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
BasefeeScalar
:
1368
,
BlobBaseFeeScalar
:
801949
,
L2ChainId
:
chainID
.
Big
(),
Op
smProxy
:
st
.
ImplementationsDeployment
.
Ops
mProxyAddress
,
Op
cmProxy
:
st
.
ImplementationsDeployment
.
Opc
mProxyAddress
,
},
)
return
err
...
...
op-chain-ops/deployer/pipeline/superchain.go
View file @
b55f4d73
...
...
@@ -7,7 +7,7 @@ import (
"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/foundry"
"github.com/ethereum-optimism/optimism/op-node/rollup"
...
...
@@ -24,7 +24,7 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
lgr
.
Info
(
"deploying superchain"
)
var
dump
*
foundry
.
ForgeAllocs
var
dso
op
s
m
.
DeploySuperchainOutput
var
dso
op
c
m
.
DeploySuperchainOutput
var
err
error
err
=
CallScriptBroadcast
(
ctx
,
...
...
@@ -37,9 +37,9 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
Client
:
env
.
L1Client
,
Broadcaster
:
KeyedBroadcaster
,
Handler
:
func
(
host
*
script
.
Host
)
error
{
dso
,
err
=
op
s
m
.
DeploySuperchain
(
dso
,
err
=
op
c
m
.
DeploySuperchain
(
host
,
op
s
m
.
DeploySuperchainInput
{
op
c
m
.
DeploySuperchainInput
{
ProxyAdminOwner
:
intent
.
SuperchainRoles
.
ProxyAdminOwner
,
ProtocolVersionsOwner
:
intent
.
SuperchainRoles
.
ProtocolVersionsOwner
,
Guardian
:
intent
.
SuperchainRoles
.
Guardian
,
...
...
op-chain-ops/deployer/state/state.go
View file @
b55f4d73
...
...
@@ -65,7 +65,7 @@ type SuperchainDeployment struct {
}
type
ImplementationsDeployment
struct
{
Op
smProxyAddress
common
.
Address
`json:"ops
mProxyAddress"`
Op
cmProxyAddress
common
.
Address
`json:"opc
mProxyAddress"`
DelayedWETHImplAddress
common
.
Address
`json:"delayedWETHImplAddress"`
OptimismPortalImplAddress
common
.
Address
`json:"optimismPortalImplAddress"`
PreimageOracleSingletonAddress
common
.
Address
`json:"preimageOracleSingletonAddress"`
...
...
op-chain-ops/interopgen/configs.go
View file @
b55f4d73
...
...
@@ -33,7 +33,7 @@ type SuperFaultProofConfig struct {
DisputeGameFinalityDelaySeconds
*
big
.
Int
}
type
OP
S
MImplementationsConfig
struct
{
type
OP
C
MImplementationsConfig
struct
{
Release
string
FaultProof
SuperFaultProofConfig
...
...
@@ -51,7 +51,7 @@ type SuperchainConfig struct {
Paused
bool
Implementations
OP
S
MImplementationsConfig
Implementations
OP
C
MImplementationsConfig
genesis
.
SuperchainL1DeployConfig
}
...
...
op-chain-ops/interopgen/deploy.go
View file @
b55f4d73
...
...
@@ -5,13 +5,12 @@ import (
"fmt"
"math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"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/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/beacondeposit"
...
...
@@ -149,7 +148,7 @@ func prepareInitialL1(l1Host *script.Host, cfg *L1Config) (*L1Deployment, error)
func
deploySuperchainToL1
(
l1Host
*
script
.
Host
,
superCfg
*
SuperchainConfig
)
(
*
SuperchainDeployment
,
error
)
{
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
,
ProtocolVersionsOwner
:
superCfg
.
ProtocolVersionsOwner
,
Guardian
:
superCfg
.
SuperchainConfigGuardian
,
...
...
@@ -161,7 +160,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
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
,
MinProposalSizeBytes
:
superCfg
.
Implementations
.
FaultProof
.
MinProposalSizeBytes
,
ChallengePeriodSeconds
:
superCfg
.
Implementations
.
FaultProof
.
ChallengePeriodSeconds
,
...
...
@@ -172,7 +171,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
ProtocolVersionsProxy
:
superDeployment
.
ProtocolVersionsProxy
,
SuperchainProxyAdmin
:
superDeployment
.
SuperchainProxyAdmin
,
UseInterop
:
superCfg
.
Implementations
.
UseInterop
,
StandardVersionsToml
:
op
s
m
.
StandardVersionsData
,
StandardVersionsToml
:
op
c
m
.
StandardVersionsData
,
})
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to deploy Implementations contracts: %w"
,
err
)
...
...
@@ -197,7 +196,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
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
,
SystemConfigOwner
:
cfg
.
SystemConfigOwner
,
Batcher
:
cfg
.
BatchSenderAddress
,
...
...
@@ -207,7 +206,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
BasefeeScalar
:
cfg
.
GasPriceOracleBaseFeeScalar
,
BlobBaseFeeScalar
:
cfg
.
GasPriceOracleBlobBaseFeeScalar
,
L2ChainId
:
new
(
big
.
Int
)
.
SetUint64
(
cfg
.
L2ChainID
),
Op
smProxy
:
superDeployment
.
Ops
mProxy
,
Op
cmProxy
:
superDeployment
.
Opc
mProxy
,
})
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to deploy L2 OP chain: %w"
,
err
)
...
...
@@ -220,8 +219,8 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
}
func
genesisL2
(
l2Host
*
script
.
Host
,
cfg
*
L2Config
,
deployment
*
L2Deployment
)
error
{
if
err
:=
op
sm
.
L2Genesis
(
l2Host
,
&
ops
m
.
L2GenesisInput
{
L1Deployments
:
op
s
m
.
L1Deployments
{
if
err
:=
op
cm
.
L2Genesis
(
l2Host
,
&
opc
m
.
L2GenesisInput
{
L1Deployments
:
op
c
m
.
L1Deployments
{
L1CrossDomainMessengerProxy
:
deployment
.
L1CrossDomainMessengerProxy
,
L1StandardBridgeProxy
:
deployment
.
L1StandardBridgeProxy
,
L1ERC721BridgeProxy
:
deployment
.
L1ERC721BridgeProxy
,
...
...
op-chain-ops/interopgen/deployments.go
View file @
b55f4d73
...
...
@@ -9,8 +9,8 @@ type L1Deployment struct {
}
type
Implementations
struct
{
Op
smProxy
common
.
Address
`json:"OPS
MProxy"`
Op
smImpl
common
.
Address
`json:"OPS
MImpl"`
Op
cmProxy
common
.
Address
`json:"OPC
MProxy"`
Op
cmImpl
common
.
Address
`json:"OPC
MImpl"`
DelayedWETHImpl
common
.
Address
`json:"DelayedWETHImpl"`
OptimismPortalImpl
common
.
Address
`json:"OptimismPortalImpl"`
PreimageOracleSingleton
common
.
Address
`json:"PreimageOracleSingleton"`
...
...
op-chain-ops/interopgen/recipe.go
View file @
b55f4d73
...
...
@@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"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/genesis"
)
...
...
@@ -67,7 +67,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
ProxyAdminOwner
:
superchainProxyAdmin
,
ProtocolVersionsOwner
:
superchainProtocolVersionsOwner
,
Deployer
:
superchainDeployer
,
Implementations
:
OP
S
MImplementationsConfig
{
Implementations
:
OP
C
MImplementationsConfig
{
Release
:
"dev"
,
FaultProof
:
SuperFaultProofConfig
{
WithdrawalDelaySeconds
:
big
.
NewInt
(
604800
),
...
...
@@ -77,7 +77,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
DisputeGameFinalityDelaySeconds
:
big
.
NewInt
(
6
),
},
UseInterop
:
true
,
StandardVersionsToml
:
op
s
m
.
StandardVersionsData
,
StandardVersionsToml
:
op
c
m
.
StandardVersionsData
,
},
SuperchainL1DeployConfig
:
genesis
.
SuperchainL1DeployConfig
{
RequiredProtocolVersion
:
params
.
OPStackSupport
,
...
...
packages/contracts-bedrock/scripts/DeployImplementations.s.sol
View file @
b55f4d73
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/scripts/DeployOPChain.s.sol
View file @
b55f4d73
...
...
@@ -26,7 +26,7 @@ import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol";
import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.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 { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...
...
@@ -46,7 +46,7 @@ contract DeployOPChainInput is BaseDeployIO {
uint32 internal _basefeeScalar;
uint32 internal _blobBaseFeeScalar;
uint256 internal _l2ChainId;
OP
StackManager internal _ops
mProxy;
OP
ContractsManager internal _opc
mProxy;
function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployOPChainInput: cannot set zero address");
...
...
@@ -56,7 +56,7 @@ contract DeployOPChainInput is BaseDeployIO {
else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr;
else if (_sel == this.proposer.selector) _proposer = _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");
}
...
...
@@ -129,7 +129,7 @@ contract DeployOPChainInput is BaseDeployIO {
// anchor root and deploy a new permissioned dispute game contract anyway.
//
// 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 =
new AnchorStateRegistry.StartingAnchorRoot[](1);
defaultStartingAnchorRoots[0] = AnchorStateRegistry.StartingAnchorRoot({
...
...
@@ -139,10 +139,10 @@ contract DeployOPChainInput is BaseDeployIO {
return abi.encode(defaultStartingAnchorRoots);
}
// TODO: Check that op
s
m is proxied and it has an implementation.
function op
smProxy() public view returns (OPStack
Manager) {
require(address(_op
s
mProxy) != address(0), "DeployOPChainInput: not set");
return _op
s
mProxy;
// TODO: Check that op
c
m is proxied and it has an implementation.
function op
cmProxy() public view returns (OPContracts
Manager) {
require(address(_op
c
mProxy) != address(0), "DeployOPChainInput: not set");
return _op
c
mProxy;
}
}
...
...
@@ -309,8 +309,8 @@ contract DeployOPChainOutput is BaseDeployIO {
require(GameType.unwrap(game.gameType()) == GameType.unwrap(GameTypes.PERMISSIONED_CANNON), "DPG-10");
require(Claim.unwrap(game.absolutePrestate()) == bytes32(hex"dead"), "DPG-20");
OP
StackManager opsm = _doi.ops
mProxy();
(address mips,) = op
sm.implementations(ops
m.latestRelease(), "MIPS");
OP
ContractsManager opcm = _doi.opc
mProxy();
(address mips,) = op
cm.implementations(opc
m.latestRelease(), "MIPS");
require(game.vm() == IBigStepper(mips), "DPG-30");
require(address(game.weth()) == address(delayedWETHPermissionedGameProxy()), "DPG-40");
...
...
@@ -368,7 +368,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(systemConfig.startBlock() == block.number, "SYSCON-140");
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");
...
...
@@ -393,7 +393,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(messenger.PORTAL()) == address(optimismPortalProxy()), "L1xDM-30");
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)));
require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60");
...
...
@@ -409,7 +409,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.messenger()) == address(messenger), "L1SB-20");
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-30");
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 {
...
...
@@ -431,12 +431,12 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.MESSENGER()) == address(l1CrossDomainMessengerProxy()), "L721B-30");
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 {
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.systemConfig()) == address(systemConfigProxy()), "PORTAL-20");
...
...
@@ -470,9 +470,9 @@ contract DeployOPChain is Script {
// -------- Core Deployment Methods --------
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(),
systemConfigOwner: _doi.systemConfigOwner(),
batcher: _doi.batcher(),
...
...
@@ -480,7 +480,7 @@ contract DeployOPChain is Script {
proposer: _doi.proposer(),
challenger: _doi.challenger()
});
OP
StackManager.DeployInput memory deployInput = OPStack
Manager.DeployInput({
OP
ContractsManager.DeployInput memory deployInput = OPContracts
Manager.DeployInput({
roles: roles,
basefeeScalar: _doi.basefeeScalar(),
blobBasefeeScalar: _doi.blobBaseFeeScalar(),
...
...
@@ -489,7 +489,7 @@ contract DeployOPChain is Script {
});
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.addressManager), "addressManager");
...
...
packages/contracts-bedrock/scripts/DeploySuperchain.s.sol
View file @
b55f4d73
...
...
@@ -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
// 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.
//
// 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 @@
"initCodeHash"
:
"0x433fac9de52d8ce8fc3471b78ef6cc9cff1019f480c9ad91b6e09ab8738a8edb"
,
"sourceCodeHash"
:
"0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
},
"src/L1/OP
Stack
Manager.sol"
:
{
"src/L1/OP
Contracts
Manager.sol"
:
{
"initCodeHash"
:
"0x92c72b75206e756742df25d67d295e4479e65db1473948b8f53cb4ca642025d5"
,
"sourceCodeHash"
:
"0x
3cbd30c68cad0dd18d49165bd21d94422b7403174f91a733e2398539dadf8656
"
"sourceCodeHash"
:
"0x
5e04124ee67298d2f1245139baf7de79dee421d2c031c6e5abe0cd3b1bdbdb32
"
},
"src/L1/OptimismPortal.sol"
:
{
"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 @@
"type"
:
"address"
}
],
"internalType"
:
"struct OP
Stack
Manager.Blueprints"
,
"internalType"
:
"struct OP
Contracts
Manager.Blueprints"
,
"name"
:
""
,
"type"
:
"tuple"
}
...
...
@@ -126,7 +126,7 @@
"type"
:
"address"
}
],
"internalType"
:
"struct OP
Stack
Manager.Roles"
,
"internalType"
:
"struct OP
Contracts
Manager.Roles"
,
"name"
:
"roles"
,
"type"
:
"tuple"
},
...
...
@@ -151,7 +151,7 @@
"type"
:
"bytes"
}
],
"internalType"
:
"struct OP
Stack
Manager.DeployInput"
,
"internalType"
:
"struct OP
Contracts
Manager.DeployInput"
,
"name"
:
"_input"
,
"type"
:
"tuple"
}
...
...
@@ -236,7 +236,7 @@
"type"
:
"address"
}
],
"internalType"
:
"struct OP
Stack
Manager.DeployOutput"
,
"internalType"
:
"struct OP
Contracts
Manager.DeployOutput"
,
"name"
:
""
,
"type"
:
"tuple"
}
...
...
@@ -320,7 +320,7 @@
"type"
:
"address"
}
],
"internalType"
:
"struct OP
Stack
Manager.Blueprints"
,
"internalType"
:
"struct OP
Contracts
Manager.Blueprints"
,
"name"
:
"blueprints"
,
"type"
:
"tuple"
},
...
...
@@ -344,12 +344,12 @@
"type"
:
"bytes4"
}
],
"internalType"
:
"struct OP
Stack
Manager.Implementation"
,
"internalType"
:
"struct OP
Contracts
Manager.Implementation"
,
"name"
:
"info"
,
"type"
:
"tuple"
}
],
"internalType"
:
"struct OP
Stack
Manager.ImplementationSetter[]"
,
"internalType"
:
"struct OP
Contracts
Manager.ImplementationSetter[]"
,
"name"
:
"setters"
,
"type"
:
"tuple[]"
},
...
...
@@ -364,7 +364,7 @@
"type"
:
"bool"
}
],
"internalType"
:
"struct OP
Stack
Manager.InitializerInputs"
,
"internalType"
:
"struct OP
Contracts
Manager.InitializerInputs"
,
"name"
:
"_initializerInputs"
,
"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 @@
"type"
:
"address"
}
],
"internalType"
:
"struct OP
Stack
Manager.Blueprints"
,
"internalType"
:
"struct OP
Contracts
Manager.Blueprints"
,
"name"
:
""
,
"type"
:
"tuple"
}
...
...
@@ -126,7 +126,7 @@
"type"
:
"address"
}
],
"internalType"
:
"struct OP
Stack
Manager.Roles"
,
"internalType"
:
"struct OP
Contracts
Manager.Roles"
,
"name"
:
"roles"
,
"type"
:
"tuple"
},
...
...
@@ -151,7 +151,7 @@
"type"
:
"bytes"
}
],
"internalType"
:
"struct OP
Stack
Manager.DeployInput"
,
"internalType"
:
"struct OP
Contracts
Manager.DeployInput"
,
"name"
:
"_input"
,
"type"
:
"tuple"
}
...
...
@@ -236,7 +236,7 @@
"type"
:
"address"
}
],
"internalType"
:
"struct OP
Stack
Manager.DeployOutput"
,
"internalType"
:
"struct OP
Contracts
Manager.DeployOutput"
,
"name"
:
""
,
"type"
:
"tuple"
}
...
...
@@ -320,7 +320,7 @@
"type"
:
"address"
}
],
"internalType"
:
"struct OP
Stack
Manager.Blueprints"
,
"internalType"
:
"struct OP
Contracts
Manager.Blueprints"
,
"name"
:
"blueprints"
,
"type"
:
"tuple"
},
...
...
@@ -344,12 +344,12 @@
"type"
:
"bytes4"
}
],
"internalType"
:
"struct OP
Stack
Manager.Implementation"
,
"internalType"
:
"struct OP
Contracts
Manager.Implementation"
,
"name"
:
"info"
,
"type"
:
"tuple"
}
],
"internalType"
:
"struct OP
Stack
Manager.ImplementationSetter[]"
,
"internalType"
:
"struct OP
Contracts
Manager.ImplementationSetter[]"
,
"name"
:
"setters"
,
"type"
:
"tuple[]"
},
...
...
@@ -364,7 +364,7 @@
"type"
:
"bool"
}
],
"internalType"
:
"struct OP
Stack
Manager.InitializerInputs"
,
"internalType"
:
"struct OP
Contracts
Manager.InitializerInputs"
,
"name"
:
"_initializerInputs"
,
"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 @@
"label"
:
"implementations"
,
"offset"
:
0
,
"slot"
:
"2"
,
"type"
:
"mapping(string => mapping(string => struct OP
Stack
Manager.Implementation))"
"type"
:
"mapping(string => mapping(string => struct OP
Contracts
Manager.Implementation))"
},
{
"bytes"
:
"32"
,
...
...
@@ -39,7 +39,7 @@
"label"
:
"blueprint"
,
"offset"
:
0
,
"slot"
:
"4"
,
"type"
:
"struct OP
Stack
Manager.Blueprints"
"type"
:
"struct OP
Contracts
Manager.Blueprints"
},
{
"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 @@
"label"
:
"implementations"
,
"offset"
:
0
,
"slot"
:
"2"
,
"type"
:
"mapping(string => mapping(string => struct OP
Stack
Manager.Implementation))"
"type"
:
"mapping(string => mapping(string => struct OP
Contracts
Manager.Implementation))"
},
{
"bytes"
:
"32"
,
...
...
@@ -39,7 +39,7 @@
"label"
:
"blueprint"
,
"offset"
:
0
,
"slot"
:
"4"
,
"type"
:
"struct OP
Stack
Manager.Blueprints"
"type"
:
"struct OP
Contracts
Manager.Blueprints"
},
{
"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";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
/// @custom:proxied true
contract OP
Stack
Manager is ISemver, Initializable {
contract OP
Contracts
Manager is ISemver, Initializable {
// -------- Structs --------
/// @notice Represents the roles that can be set when deploying a standard OP Stack chain.
...
...
@@ -113,7 +113,7 @@ contract OPStackManager is ISemver, Initializable {
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.
struct InitializerInputs {
Blueprints blueprints;
...
...
@@ -133,7 +133,7 @@ contract OPStackManager is ISemver, Initializable {
/// @notice Address of the ProtocolVersions contract shared by all chains.
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;
/// @notice Maps a release version to a contract name to it's implementation data.
...
...
@@ -181,7 +181,7 @@ contract OPStackManager is ISemver, Initializable {
// -------- 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) {
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
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 { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol";
...
...
@@ -9,12 +9,12 @@ import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol";
/// @custom:proxied true
contract OP
StackManagerInterop is OPStack
Manager {
contract OP
ContractsManagerInterop is OPContracts
Manager {
constructor(
SuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions
)
OP
Stack
Manager(_superchainConfig, _protocolVersions)
OP
Contracts
Manager(_superchainConfig, _protocolVersions)
{ }
// 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";
import { SuperchainConfig } from "src/L1/SuperchainConfig.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 { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...
...
@@ -106,11 +106,11 @@ contract DeployImplementationsOutput_Test is Test {
function test_set_succeeds() public {
Proxy proxy = new Proxy(address(0));
address op
smImpl = address(makeAddr("ops
mImpl"));
address op
cmImpl = address(makeAddr("opc
mImpl"));
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")));
DelayedWETH delayedWETHImpl = DelayedWETH(payable(makeAddr("delayedWETHImpl")));
PreimageOracle preimageOracleSingleton = PreimageOracle(makeAddr("preimageOracleSingleton"));
...
...
@@ -124,8 +124,8 @@ contract DeployImplementationsOutput_Test is Test {
OptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryImpl"));
DisputeGameFactory disputeGameFactoryImpl = DisputeGameFactory(makeAddr("disputeGameFactoryImpl"));
vm.etch(address(op
smProxy), address(ops
mProxy).code);
vm.etch(address(op
s
mImpl), hex"01");
vm.etch(address(op
cmProxy), address(opc
mProxy).code);
vm.etch(address(op
c
mImpl), hex"01");
vm.etch(address(optimismPortalImpl), hex"01");
vm.etch(address(delayedWETHImpl), hex"01");
vm.etch(address(preimageOracleSingleton), hex"01");
...
...
@@ -136,7 +136,7 @@ contract DeployImplementationsOutput_Test is Test {
vm.etch(address(l1StandardBridgeImpl), hex"01");
vm.etch(address(optimismMintableERC20FactoryImpl), 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.delayedWETHImpl.selector, address(delayedWETHImpl));
dio.set(dio.preimageOracleSingleton.selector, address(preimageOracleSingleton));
...
...
@@ -148,7 +148,7 @@ contract DeployImplementationsOutput_Test is Test {
dio.set(dio.optimismMintableERC20FactoryImpl.selector, address(optimismMintableERC20FactoryImpl));
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(delayedWETHImpl), address(dio.delayedWETHImpl()), "200");
assertEq(address(preimageOracleSingleton), address(dio.preimageOracleSingleton()), "300");
...
...
@@ -413,7 +413,7 @@ contract DeployImplementations_Test is Test {
string memory release = string(bytes.concat(hash(_seed, 5)));
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);
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
import { SuperchainConfig } from "src/L1/SuperchainConfig.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 { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...
...
@@ -46,7 +46,7 @@ contract DeployOPChainInput_Test is Test {
uint32 basefeeScalar = 100;
uint32 blobBaseFeeScalar = 200;
uint256 l2ChainId = 300;
OP
StackManager opsm = OPStackManager(makeAddr("ops
m"));
OP
ContractsManager opcm = OPContractsManager(makeAddr("opc
m"));
function setUp() public {
doi = new DeployOPChainInput();
...
...
@@ -62,7 +62,7 @@ contract DeployOPChainInput_Test is Test {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
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.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "200");
assertEq(systemConfigOwner, doi.systemConfigOwner(), "300");
...
...
@@ -73,7 +73,7 @@ contract DeployOPChainInput_Test is Test {
assertEq(basefeeScalar, doi.basefeeScalar(), "800");
assertEq(blobBaseFeeScalar, doi.blobBaseFeeScalar(), "900");
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 {
...
...
@@ -328,7 +328,7 @@ contract DeployOPChain_TestBase is Test {
ProtocolVersions protocolVersionsProxy;
// 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 systemConfigOwner = makeAddr("defaultSystemConfigOwner");
address batcher = makeAddr("defaultBatcher");
...
...
@@ -339,7 +339,7 @@ contract DeployOPChain_TestBase is Test {
uint32 blobBaseFeeScalar = 200;
uint256 l2ChainId = 300;
AnchorStateRegistry.StartingAnchorRoot[] startingAnchorRoots;
OP
StackManager opsm = OPStack
Manager(address(0));
OP
ContractsManager opcm = OPContracts
Manager(address(0));
function setUp() public virtual {
// Set defaults for reference types
...
...
@@ -401,8 +401,8 @@ contract DeployOPChain_TestBase is Test {
deployOPChain = new DeployOPChain();
(doi, doo) = deployOPChain.etchIOContracts();
// Set the OP
StackManager address as input to
DeployOPChain.
op
sm = dio.ops
mProxy();
// Set the OP
ContractsManager input for
DeployOPChain.
op
cm = dio.opc
mProxy();
}
// See the function of the same name in the `DeployImplementations_Test` contract of
...
...
@@ -456,11 +456,11 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
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);
// 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.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "100");
...
...
@@ -486,7 +486,7 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
// assertEq(address(doo.faultDisputeGame().proposer()), proposer, "2700");
// 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.
// 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";
import { DeployOPChainInput } from "scripts/DeployOPChain.s.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 { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
// Exposes internal functions for testing.
contract OP
StackManager_Harness is OPStack
Manager {
contract OP
ContractsManager_Harness is OPContracts
Manager {
constructor(
SuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions
)
OP
Stack
Manager(_superchainConfig, _protocolVersions)
OP
Contracts
Manager(_superchainConfig, _protocolVersions)
{ }
function chainIdToBatchInboxAddress_exposed(uint256 l2ChainId) public pure returns (address) {
...
...
@@ -26,12 +26,12 @@ contract OPStackManager_Harness is OPStackManager {
}
// 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
// work OP
Stack
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
// because OP
Contracts
Manager acts as a deploy script, so we start from a clean slate here and
// work OP
Contracts
Manager's deployment into the existing test setup, instead of using the existing
// 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
// happen.
contract OP
Stack
Manager_Deploy_Test is DeployOPChain_TestBase {
contract OP
Contracts
Manager_Deploy_Test is DeployOPChain_TestBase {
using stdStorage for StdStorage;
event Deployed(uint256 indexed l2ChainId, SystemConfig indexed systemConfig);
...
...
@@ -48,14 +48,14 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
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
// to the input struct type defined in OP
Stack
Manager.sol.
function toOP
SMDeployInput(DeployOPChainInput _doi) internal view returns (OPStack
Manager.DeployInput memory) {
return OP
Stack
Manager.DeployInput({
roles: OP
Stack
Manager.Roles({
// to the input struct type defined in OP
Contracts
Manager.sol.
function toOP
CMDeployInput(DeployOPChainInput _doi) internal view returns (OPContracts
Manager.DeployInput memory) {
return OP
Contracts
Manager.DeployInput({
roles: OP
Contracts
Manager.Roles({
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
systemConfigOwner: _doi.systemConfigOwner(),
batcher: _doi.batcher(),
...
...
@@ -71,30 +71,30 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
}
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;
vm.expectRevert(OP
Stack
Manager.InvalidChainId.selector);
op
s
m.deploy(deployInput);
vm.expectRevert(OP
Contracts
Manager.InvalidChainId.selector);
op
c
m.deploy(deployInput);
}
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;
vm.expectRevert(OP
Stack
Manager.InvalidChainId.selector);
op
s
m.deploy(deployInput);
vm.expectRevert(OP
Contracts
Manager.InvalidChainId.selector);
op
c
m.deploy(deployInput);
}
function test_deploy_succeeds() public {
vm.expectEmit(true, false, true, true); // TODO precompute the system config address.
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.
contract OP
Stack
Manager_InternalMethods_Test is Test {
OP
StackManager_Harness ops
mHarness;
contract OP
Contracts
Manager_InternalMethods_Test is Test {
OP
ContractsManager_Harness opc
mHarness;
function setUp() public {
SuperchainConfig superchainConfigProxy = SuperchainConfig(makeAddr("superchainConfig"));
...
...
@@ -102,7 +102,7 @@ contract OPStackManager_InternalMethods_Test is Test {
vm.etch(address(superchainConfigProxy), hex"01");
vm.etch(address(protocolVersionsProxy), hex"01");
op
smHarness = new OPStack
Manager_Harness({
op
cmHarness = new OPContracts
Manager_Harness({
_superchainConfig: superchainConfigProxy,
_protocolVersions: protocolVersionsProxy
});
...
...
@@ -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.
uint256 chainId = 1234;
address expected = 0x0017FA14b0d73Aa6A26D6b8720c1c84b50984f5C;
address actual = op
s
mHarness.chainIdToBatchInboxAddress_exposed(chainId);
address actual = op
c
mHarness.chainIdToBatchInboxAddress_exposed(chainId);
vm.assertEq(expected, actual);
chainId = type(uint256).max;
expected = 0x00a9C584056064687E149968cBaB758a3376D22A;
actual = op
s
mHarness.chainIdToBatchInboxAddress_exposed(chainId);
actual = op
c
mHarness.chainIdToBatchInboxAddress_exposed(chainId);
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";
import { ForgeArtifacts, Abi, AbiEntry } from "scripts/libraries/ForgeArtifacts.sol";
// Contracts
import { OP
StackManager } from "src/L1/OPStack
Manager.sol";
import { OP
ContractsManager } from "src/L1/OPContracts
Manager.sol";
// Interfaces
import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
...
...
@@ -836,29 +836,29 @@ contract Specification_Test is CommonTest {
_addSpec({ _name: "WETH98", _sel: _getSel("transferFrom(address,address,uint256)") });
_addSpec({ _name: "WETH98", _sel: _getSel("withdraw(uint256)") });
// OP
Stack
Manager
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("version()") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OP
Stack
Manager", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OP
StackManager", _sel: OPStack
Manager.initialize.selector });
_addSpec({ _name: "OP
StackManager", _sel: OPStack
Manager.deploy.selector });
_addSpec({ _name: "OP
StackManager", _sel: OPStack
Manager.blueprints.selector });
_addSpec({ _name: "OP
StackManager", _sel: OPStack
Manager.chainIdToBatchInboxAddress.selector });
// OP
Stack
ManagerInterop
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("version()") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OP
Stack
ManagerInterop", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OP
StackManagerInterop", _sel: OPStack
Manager.initialize.selector });
_addSpec({ _name: "OP
StackManagerInterop", _sel: OPStack
Manager.deploy.selector });
_addSpec({ _name: "OP
StackManagerInterop", _sel: OPStack
Manager.blueprints.selector });
_addSpec({ _name: "OP
StackManagerInterop", _sel: OPStack
Manager.chainIdToBatchInboxAddress.selector });
// OP
Contracts
Manager
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("version()") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OP
Contracts
Manager", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OP
ContractsManager", _sel: OPContracts
Manager.initialize.selector });
_addSpec({ _name: "OP
ContractsManager", _sel: OPContracts
Manager.deploy.selector });
_addSpec({ _name: "OP
ContractsManager", _sel: OPContracts
Manager.blueprints.selector });
_addSpec({ _name: "OP
ContractsManager", _sel: OPContracts
Manager.chainIdToBatchInboxAddress.selector });
// OP
Contracts
ManagerInterop
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("version()") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OP
Contracts
ManagerInterop", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OP
ContractsManagerInterop", _sel: OPContracts
Manager.initialize.selector });
_addSpec({ _name: "OP
ContractsManagerInterop", _sel: OPContracts
Manager.deploy.selector });
_addSpec({ _name: "OP
ContractsManagerInterop", _sel: OPContracts
Manager.blueprints.selector });
_addSpec({ _name: "OP
ContractsManagerInterop", _sel: OPContracts
Manager.chainIdToBatchInboxAddress.selector });
// DeputyGuardianModule
_addSpec({
...
...
packages/contracts-bedrock/test/vendor/Initializable.t.sol
View file @
b55f4d73
...
...
@@ -411,8 +411,8 @@ contract Initializer_Test is Bridge_Initializer {
excludes[4] = "src/dispute/FaultDisputeGame.sol";
excludes[5] = "src/dispute/PermissionedDisputeGame.sol";
// TODO: Eventually remove this exclusion. Same reason as above dispute contracts.
excludes[6] = "src/L1/OP
Stack
Manager.sol";
excludes[7] = "src/L1/OP
Stack
ManagerInterop.sol";
excludes[6] = "src/L1/OP
Contracts
Manager.sol";
excludes[7] = "src/L1/OP
Contracts
ManagerInterop.sol";
// Get all contract names in the src directory, minus the excluded contracts.
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