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
5f625e02
Unverified
Commit
5f625e02
authored
Oct 09, 2024
by
Matt Solomon
Committed by
GitHub
Oct 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add op-deployer inspect command (#12375)
* feat: add op-deployer inspect command * lint * chore: clarify arg
parent
5a03aa19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
2 deletions
+131
-2
flags.go
op-chain-ops/deployer/inspect/flags.go
+10
-2
l1.go
op-chain-ops/deployer/inspect/l1.go
+121
-0
No files found.
op-chain-ops/deployer/inspect/flags.go
View file @
5f625e02
...
...
@@ -28,11 +28,19 @@ var Flags = []cli.Flag{
}
var
Commands
=
[]
*
cli
.
Command
{
{
Name
:
"l1"
,
Usage
:
"outputs all L1 contract addresses for an L2 chain"
,
Args
:
true
,
ArgsUsage
:
"<l2-chain-id>"
,
Action
:
L1CLI
,
Flags
:
Flags
,
},
{
Name
:
"genesis"
,
Usage
:
"outputs the genesis for an L2 chain"
,
Args
:
true
,
ArgsUsage
:
"<chain-id>"
,
ArgsUsage
:
"<
l2-
chain-id>"
,
Action
:
GenesisCLI
,
Flags
:
Flags
,
},
...
...
@@ -40,7 +48,7 @@ var Commands = []*cli.Command{
Name
:
"rollup"
,
Usage
:
"outputs the rollup config for an L2 chain"
,
Args
:
true
,
ArgsUsage
:
"<chain-id>"
,
ArgsUsage
:
"<
l2-
chain-id>"
,
Action
:
RollupCLI
,
Flags
:
Flags
,
},
...
...
op-chain-ops/deployer/inspect/l1.go
0 → 100644
View file @
5f625e02
package
inspect
import
(
"fmt"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/pipeline"
"github.com/ethereum-optimism/optimism/op-service/ioutil"
"github.com/ethereum-optimism/optimism/op-service/jsonutil"
"github.com/ethereum/go-ethereum/common"
"github.com/urfave/cli/v2"
)
type
L1Contracts
struct
{
SuperchainDeployment
SuperchainDeployment
`json:"superchainDeployment"`
OpChainDeployment
OpChainDeployment
`json:"opChainDeployment"`
ImplementationsDeployment
ImplementationsDeployment
`json:"implementationsDeployment"`
}
type
SuperchainDeployment
struct
{
ProxyAdminAddress
common
.
Address
`json:"proxyAdminAddress"`
SuperchainConfigProxyAddress
common
.
Address
`json:"superchainConfigProxyAddress"`
SuperchainConfigImplAddress
common
.
Address
`json:"superchainConfigImplAddress"`
ProtocolVersionsProxyAddress
common
.
Address
`json:"protocolVersionsProxyAddress"`
ProtocolVersionsImplAddress
common
.
Address
`json:"protocolVersionsImplAddress"`
}
type
OpChainDeployment
struct
{
ProxyAdminAddress
common
.
Address
`json:"proxyAdminAddress"`
AddressManagerAddress
common
.
Address
`json:"addressManagerAddress"`
L1ERC721BridgeProxyAddress
common
.
Address
`json:"l1ERC721BridgeProxyAddress"`
SystemConfigProxyAddress
common
.
Address
`json:"systemConfigProxyAddress"`
OptimismMintableERC20FactoryProxyAddress
common
.
Address
`json:"optimismMintableERC20FactoryProxyAddress"`
L1StandardBridgeProxyAddress
common
.
Address
`json:"l1StandardBridgeProxyAddress"`
L1CrossDomainMessengerProxyAddress
common
.
Address
`json:"l1CrossDomainMessengerProxyAddress"`
OptimismPortalProxyAddress
common
.
Address
`json:"optimismPortalProxyAddress"`
DisputeGameFactoryProxyAddress
common
.
Address
`json:"disputeGameFactoryProxyAddress"`
AnchorStateRegistryProxyAddress
common
.
Address
`json:"anchorStateRegistryProxyAddress"`
AnchorStateRegistryImplAddress
common
.
Address
`json:"anchorStateRegistryImplAddress"`
// FaultDisputeGameAddress common.Address `json:"faultDisputeGameAddress"`
PermissionedDisputeGameAddress
common
.
Address
`json:"permissionedDisputeGameAddress"`
DelayedWETHPermissionedGameProxyAddress
common
.
Address
`json:"delayedWETHPermissionedGameProxyAddress"`
// DelayedWETHPermissionlessGameProxyAddress common.Address `json:"delayedWETHPermissionlessGameProxyAddress"`
}
type
ImplementationsDeployment
struct
{
OpcmProxyAddress
common
.
Address
`json:"opcmProxyAddress"`
DelayedWETHImplAddress
common
.
Address
`json:"delayedWETHImplAddress"`
OptimismPortalImplAddress
common
.
Address
`json:"optimismPortalImplAddress"`
PreimageOracleSingletonAddress
common
.
Address
`json:"preimageOracleSingletonAddress"`
MipsSingletonAddress
common
.
Address
`json:"mipsSingletonAddress"`
SystemConfigImplAddress
common
.
Address
`json:"systemConfigImplAddress"`
L1CrossDomainMessengerImplAddress
common
.
Address
`json:"l1CrossDomainMessengerImplAddress"`
L1ERC721BridgeImplAddress
common
.
Address
`json:"l1ERC721BridgeImplAddress"`
L1StandardBridgeImplAddress
common
.
Address
`json:"l1StandardBridgeImplAddress"`
OptimismMintableERC20FactoryImplAddress
common
.
Address
`json:"optimismMintableERC20FactoryImplAddress"`
DisputeGameFactoryImplAddress
common
.
Address
`json:"disputeGameFactoryImplAddress"`
}
func
L1CLI
(
cliCtx
*
cli
.
Context
)
error
{
cfg
,
err
:=
readConfig
(
cliCtx
)
if
err
!=
nil
{
return
err
}
env
:=
&
pipeline
.
Env
{
Workdir
:
cfg
.
Workdir
}
globalState
,
err
:=
env
.
ReadState
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to read intent: %w"
,
err
)
}
chainState
,
err
:=
globalState
.
Chain
(
cfg
.
ChainID
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to get chain state for ID %s: %w"
,
cfg
.
ChainID
.
String
(),
err
)
}
l1Contracts
:=
L1Contracts
{
SuperchainDeployment
:
SuperchainDeployment
{
ProxyAdminAddress
:
globalState
.
SuperchainDeployment
.
ProxyAdminAddress
,
SuperchainConfigProxyAddress
:
globalState
.
SuperchainDeployment
.
SuperchainConfigProxyAddress
,
SuperchainConfigImplAddress
:
globalState
.
SuperchainDeployment
.
SuperchainConfigImplAddress
,
ProtocolVersionsProxyAddress
:
globalState
.
SuperchainDeployment
.
ProtocolVersionsProxyAddress
,
ProtocolVersionsImplAddress
:
globalState
.
SuperchainDeployment
.
ProtocolVersionsImplAddress
,
},
OpChainDeployment
:
OpChainDeployment
{
ProxyAdminAddress
:
chainState
.
ProxyAdminAddress
,
AddressManagerAddress
:
chainState
.
AddressManagerAddress
,
L1ERC721BridgeProxyAddress
:
chainState
.
L1ERC721BridgeProxyAddress
,
SystemConfigProxyAddress
:
chainState
.
SystemConfigProxyAddress
,
OptimismMintableERC20FactoryProxyAddress
:
chainState
.
OptimismMintableERC20FactoryProxyAddress
,
L1StandardBridgeProxyAddress
:
chainState
.
L1StandardBridgeProxyAddress
,
L1CrossDomainMessengerProxyAddress
:
chainState
.
L1CrossDomainMessengerProxyAddress
,
OptimismPortalProxyAddress
:
chainState
.
OptimismPortalProxyAddress
,
DisputeGameFactoryProxyAddress
:
chainState
.
DisputeGameFactoryProxyAddress
,
AnchorStateRegistryProxyAddress
:
chainState
.
AnchorStateRegistryProxyAddress
,
AnchorStateRegistryImplAddress
:
chainState
.
AnchorStateRegistryImplAddress
,
// FaultDisputeGameAddress: chainState.FaultDisputeGameAddress,
PermissionedDisputeGameAddress
:
chainState
.
PermissionedDisputeGameAddress
,
DelayedWETHPermissionedGameProxyAddress
:
chainState
.
DelayedWETHPermissionedGameProxyAddress
,
// DelayedWETHPermissionlessGameProxyAddress: chainState.DelayedWETHPermissionlessGameProxyAddress,
},
ImplementationsDeployment
:
ImplementationsDeployment
{
OpcmProxyAddress
:
globalState
.
ImplementationsDeployment
.
OpcmProxyAddress
,
DelayedWETHImplAddress
:
globalState
.
ImplementationsDeployment
.
DelayedWETHImplAddress
,
OptimismPortalImplAddress
:
globalState
.
ImplementationsDeployment
.
OptimismPortalImplAddress
,
PreimageOracleSingletonAddress
:
globalState
.
ImplementationsDeployment
.
PreimageOracleSingletonAddress
,
MipsSingletonAddress
:
globalState
.
ImplementationsDeployment
.
MipsSingletonAddress
,
SystemConfigImplAddress
:
globalState
.
ImplementationsDeployment
.
SystemConfigImplAddress
,
L1CrossDomainMessengerImplAddress
:
globalState
.
ImplementationsDeployment
.
L1CrossDomainMessengerImplAddress
,
L1ERC721BridgeImplAddress
:
globalState
.
ImplementationsDeployment
.
L1ERC721BridgeImplAddress
,
L1StandardBridgeImplAddress
:
globalState
.
ImplementationsDeployment
.
L1StandardBridgeImplAddress
,
OptimismMintableERC20FactoryImplAddress
:
globalState
.
ImplementationsDeployment
.
OptimismMintableERC20FactoryImplAddress
,
DisputeGameFactoryImplAddress
:
globalState
.
ImplementationsDeployment
.
DisputeGameFactoryImplAddress
,
},
}
if
err
:=
jsonutil
.
WriteJSON
(
l1Contracts
,
ioutil
.
ToStdOutOrFileOrNoop
(
cfg
.
Outfile
,
0
o666
));
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to write L1 contract addresses: %w"
,
err
)
}
return
nil
}
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