manage

package
v1.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	L1ProxyAdminOwnerFlag = &cli.StringFlag{
		Name:    "l1-proxy-admin-owner-address",
		Usage:   "Address to use for as the proxy admin owner. Not compatible with the --workdir flag.",
		EnvVars: deployer.PrefixEnvVar("PROXY_ADMIN_OWNER"),
	}
	OPCMImplFlag = &cli.StringFlag{
		Name:    "opcm-impl-address",
		Usage:   "Address of the OPCM implementation contract. Not compatible with the --workdir flag.",
		EnvVars: deployer.PrefixEnvVar("OPCM_IMPL_ADDRESS"),
	}
	SystemConfigProxyFlag = &cli.StringFlag{
		Name:    "system-config-proxy-address",
		Usage:   "Address of the SystemConfig proxy contract. Not compatible with the --workdir flag.",
		EnvVars: deployer.PrefixEnvVar("SYSTEM_CONFIG_PROXY_ADDRESS"),
	}
	OPChainProxyAdminFlag = &cli.StringFlag{
		Name:    "op-chain-proxy-admin-address",
		Usage:   "Address of the OP Chain's proxy admin on L1. Not compatible with the --workdir flag.",
		EnvVars: deployer.PrefixEnvVar("OP_CHAIN_PROXY_ADMIN_ADDRESS"),
	}
	DelayedWETHProxyFlag = &cli.StringFlag{
		Name: "delayed-weth-proxy-address",
		Usage: "Address of the DelayedWETHProxy contract to include as part of this game type. If not specified, " +
			"one will be deployed for you by the OPCM.",
		EnvVars: deployer.PrefixEnvVar("DELAYED_WETH_PROXY_ADDRESS"),
	}
	DisputeGameTypeFlag = &cli.Uint64Flag{
		Name:    "dispute-game-type",
		Usage:   "Numeric type identifier for the dispute game.",
		EnvVars: deployer.PrefixEnvVar("DISPUTE_GAME_TYPE"),
		Value:   uint64(standard.DisputeGameType),
	}
	DisputeAbsolutePrestateFlag = &cli.StringFlag{
		Name:    "dispute-absolute-prestate",
		Usage:   "The absolute prestate hash for the dispute game. Defaults to the standard value.",
		EnvVars: deployer.PrefixEnvVar("DISPUTE_ABSOLUTE_PRESTATE"),
		Value:   standard.DisputeAbsolutePrestate.Hex(),
	}
	InitialBondFlag = &cli.StringFlag{
		Name:    "initial-bond",
		Usage:   "Initial bond amount required for the dispute game (value as string, in wei). Defaults to 1 ETH.",
		EnvVars: deployer.PrefixEnvVar("INITIAL_BOND"),
		Value:   "1000000000000000000",
	}
	VMFlag = &cli.StringFlag{
		Name:    "vm-address",
		Usage:   "Address of the VM contract used by the dispute game.",
		EnvVars: deployer.PrefixEnvVar("VM_ADDRESS"),
	}
	StartingAnchorRootFlag = &cli.StringFlag{
		Name:    "starting-anchor-root",
		Usage:   "Starting anchor root.",
		EnvVars: deployer.PrefixEnvVar("STARTING_ANCHOR_ROOT"),
	}
	StartingAnchorL2SequenceNumberFlag = &cli.Uint64Flag{
		Name:    "starting-anchor-l2-sequence-number",
		Usage:   "Starting anchor L2 sequence number.",
		EnvVars: deployer.PrefixEnvVar("STARTING_ANCHOR_L2_SEQUENCE_NUMBER"),
	}
	SaltMixerFlag = &cli.StringFlag{
		Name:    "salt-mixer",
		Usage:   "String value for the salt mixer, used in CREATE2 address calculation. Default to keccak256(\"op-stack-contract-impls-salt-v0\").",
		EnvVars: deployer.PrefixEnvVar("SALT_MIXER"),
		Value:   "89fca2352a158519d2daabf7e53686272e828ddbff9487204546d918490b2ecf",
	}
	WorkdirFlag = &cli.StringFlag{
		Name:    "workdir",
		Usage:   "Path to a working directory containing a state file. Addresses will be retrieved from the state file, and cannot be specified on the command line.",
		EnvVars: deployer.PrefixEnvVar("WORKDIR"),
	}
	L2ChainIDFlag = &cli.StringFlag{
		Name:    "l2-chain-id",
		Usage:   "Chain ID of the L2 network to retrieve from state. Must be specified when --workdir is set.",
		EnvVars: deployer.PrefixEnvVar("CHAIN_ID"),
	}
	MigrateStartingRespectedGameTypeFlag = &cli.Uint64Flag{
		Name:    "starting-respected-game-type",
		Usage:   "Starting respected game type for migration. Defaults to 9 (SUPER_CANNON_KONA). 4 (SUPER_CANNON) is rejected.",
		EnvVars: deployer.PrefixEnvVar("STARTING_RESPECTED_GAME_TYPE"),
		Value:   uint64(migrateStartingRespectedGameTypeDefault),
	}
	MigrateDisputeGameEnabledFlag = &cli.BoolFlag{
		Name:    "dispute-game-enabled",
		Usage:   "Whether the dispute game should be enabled. Used for migration.",
		EnvVars: deployer.PrefixEnvVar("DISPUTE_GAME_ENABLED"),
		Value:   true,
	}
)

Functions

func AddGameTypeOPCMV2CLI

func AddGameTypeOPCMV2CLI(cliCtx *cli.Context) error

AddGameTypeOPCMV2CLI is the CLI command for adding a new game type to the chain using the OPContractsManager V2. This command is an alias for the upgrade command with the default upgrader.

func MigrateCLI

func MigrateCLI(cliCtx *cli.Context) error

MigrateCLI is the main function for the migrate command. It validates required flags and runs the migration.

Types

type DisputeGameConfig

type DisputeGameConfig struct {
	Enabled  bool     `json:"enabled"`
	InitBond *big.Int `json:"initBond"`
	GameType uint32   `json:"gameType"`
	GameArgs []byte   `json:"gameArgs"`
}

DisputeGameConfig defines the configuration for a specific dispute game type. Corresponds to IOPContractsManagerMigrator.DisputeGameConfig

type InteropMigrationInput

type InteropMigrationInput struct {
	Prank          common.Address  `json:"prank"`
	Opcm           common.Address  `json:"opcm"`
	MigrateInputV2 *MigrateInputV2 `json:"migrateInputV2,omitempty"`
}

InteropMigrationInput represents the struct that is read from the config file.

func (*InteropMigrationInput) EncodedMigrateInputV2

func (i *InteropMigrationInput) EncodedMigrateInputV2() ([]byte, error)

type InteropMigrationOutput

type InteropMigrationOutput struct {
	DisputeGameFactory common.Address `json:"disputeGameFactory"`
}

InteropMigrationOutput contains the output of the interop migration script.

func (*InteropMigrationOutput) CheckOutput

func (output *InteropMigrationOutput) CheckOutput(input common.Address) error

type MigrateInputV2

type MigrateInputV2 struct {
	ChainSystemConfigs        []common.Address    `json:"chainSystemConfigs"`
	DisputeGameConfigs        []DisputeGameConfig `json:"disputeGameConfigs"`
	StartingAnchorRoot        Proposal            `json:"startingAnchorRoot"`
	StartingRespectedGameType uint32              `json:"startingRespectedGameType"`
}

MigrateInputV2 represents the migrate input format for OPCM v2 (>= 7.0.0). Corresponds to IOPContractsManagerMigrator.MigrateInput

type Proposal

type Proposal struct {
	Root             common.Hash `json:"root"`
	L2SequenceNumber *big.Int    `json:"l2SequenceNumber"`
}

Proposal represents an L2 output root proposal used as the starting anchor for dispute games.

type ScriptInput

type ScriptInput struct {
	Prank        common.Address `evm:"prank"`
	Opcm         common.Address `evm:"opcm"`
	MigrateInput []byte         `evm:"migrateInput"`
}

ScriptInput represents the input struct that is actually passed to the script. It contains the prank address, OPCM address, and ABI-encoded migrate input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL