opcm

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultStartingAnchorRoot = StartingAnchorRoot{
	Root:          common.Hash{0xde, 0xad},
	L2BlockNumber: common.Big0,
}
View Source
var PermissionedGameStartingAnchorRoot = []byte{
	0xde, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}

PermissionedGameStartingAnchorRoot is a root of bytes32(hex"dead") for the permissioned game at block 0, and no root for the permissionless game.

Functions

func EncodeStartingAnchorRoot added in v1.11.0

func EncodeStartingAnchorRoot(root StartingAnchorRoot) ([]byte, error)

func InsertPreinstalls added in v1.13.1

func InsertPreinstalls(host *script.Host) error

InsertPreinstalls inserts preinstalls in the given host. This is part of the L2Genesis already, but is isolated to be reused for L1 dev genesis.

func NewDeployImplementationsForgeCaller added in v1.14.0

func NewDeployImplementationsForgeCaller(client *forge.Client) forge.ScriptCaller[DeployImplementationsInput, DeployImplementationsOutput]

func NewDeployOPChainForgeCaller added in v1.14.0

func NewDeployOPChainForgeCaller(client *forge.Client) forge.ScriptCaller[DeployOPChainInput, DeployOPChainOutput]

func NewDeploySuperchainForgeCaller added in v1.14.0

func NewDeploySuperchainForgeCaller(client *forge.Client) forge.ScriptCaller[DeploySuperchainInput, DeploySuperchainOutput]

func RunScriptSingle added in v1.11.0

func RunScriptSingle[I any, O any](
	host *script.Host,
	input I,
	scriptFile string,
	contractName string,
) (O, error)

func RunScriptVoid added in v1.11.0

func RunScriptVoid[I any](
	host *script.Host,
	input I,
	scriptFile string,
	contractName string,
) error

func SetDisputeGameImpl added in v1.11.0

func SetDisputeGameImpl(
	h *script.Host,
	input SetDisputeGameImplInput,
) error

Types

type AddGameTypeInput added in v1.13.3

type AddGameTypeInput struct {
	L1ProxyAdminOwner       common.Address `abi:"prank"`
	OPCMImpl                common.Address `abi:"opcmImpl"`
	SystemConfigProxy       common.Address
	DelayedWETHProxy        common.Address
	DisputeGameType         uint32
	DisputeAbsolutePrestate common.Hash
	DisputeMaxGameDepth     *big.Int
	DisputeSplitDepth       *big.Int
	DisputeClockExtension   uint64
	DisputeMaxClockDuration uint64
	InitialBond             *big.Int
	VM                      common.Address `abi:"vm"`
	Permissioned            bool
	SaltMixer               string
}

func (AddGameTypeInput) MarshalJSON added in v1.13.3

func (a AddGameTypeInput) MarshalJSON() ([]byte, error)

func (*AddGameTypeInput) UnmarshalJSON added in v1.13.3

func (a *AddGameTypeInput) UnmarshalJSON(b []byte) error

type AddGameTypeOutput added in v1.13.3

type AddGameTypeOutput struct {
	DelayedWETHProxy      common.Address `json:"delayedWETHProxy"`
	FaultDisputeGameProxy common.Address `json:"faultDisputeGameProxy"`
}

type AddGameTypeScript added in v1.13.3

func NewAddGameTypeScript added in v1.13.3

func NewAddGameTypeScript(host *script.Host) (AddGameTypeScript, error)

type Contract

type Contract struct {
	// contains filtered or unexported fields
}

func NewContract

func NewContract(addr common.Address, client *ethclient.Client) *Contract

func (*Contract) GenericAddressGetter

func (c *Contract) GenericAddressGetter(ctx context.Context, functionName string) (common.Address, error)

func (*Contract) GetAddressByNameViaAddressManager

func (c *Contract) GetAddressByNameViaAddressManager(ctx context.Context, name string) (common.Address, error)

Used to call getAddress(string) on legacy AddressManager contract

func (*Contract) ProtocolVersions

func (c *Contract) ProtocolVersions(ctx context.Context) (common.Address, error)

func (*Contract) SuperchainConfig

func (c *Contract) SuperchainConfig(ctx context.Context) (common.Address, error)

type DeployAlphabetVMInput added in v1.11.0

type DeployAlphabetVMInput struct {
	AbsolutePrestate common.Hash
	PreimageOracle   common.Address
}

type DeployAlphabetVMOutput added in v1.11.0

type DeployAlphabetVMOutput struct {
	AlphabetVM common.Address
}

type DeployAlphabetVMScript added in v1.13.1

func NewDeployAlphabetVMScript added in v1.13.1

func NewDeployAlphabetVMScript(host *script.Host) (DeployAlphabetVMScript, error)

NewDeployAlphabetVMScript loads and validates the DeployAlphabetVM2 script contract

type DeployAltDAInput

type DeployAltDAInput struct {
	Salt                     common.Hash
	ProxyAdmin               common.Address
	ChallengeContractOwner   common.Address
	ChallengeWindow          *big.Int
	ResolveWindow            *big.Int
	BondSize                 *big.Int
	ResolverRefundPercentage *big.Int
}

type DeployAltDAOutput

type DeployAltDAOutput struct {
	DataAvailabilityChallengeProxy common.Address
	DataAvailabilityChallengeImpl  common.Address
}

type DeployAltDAScript

func NewDeployAltDAScript added in v1.13.1

func NewDeployAltDAScript(host *script.Host) (DeployAltDAScript, error)

NewDeployAltDAScript loads and validates the DeployAltDA script contract

type DeployAsteriscInput added in v1.11.0

type DeployAsteriscInput struct {
	PreimageOracle common.Address
}

type DeployAsteriscOutput added in v1.11.0

type DeployAsteriscOutput struct {
	AsteriscSingleton common.Address
}

type DeployAsteriscScript added in v1.13.1

func NewDeployAsteriscScript added in v1.13.1

func NewDeployAsteriscScript(host *script.Host) (DeployAsteriscScript, error)

NewDeployAsteriscScript loads and validates the DeployAsterisc script contract

type DeployDisputeGameInput

type DeployDisputeGameInput struct {
	Release                  string
	UseV2                    bool
	GameKind                 string
	GameType                 uint32
	AbsolutePrestate         common.Hash
	MaxGameDepth             *big.Int
	SplitDepth               *big.Int
	ClockExtension           uint64
	MaxClockDuration         uint64
	DelayedWethProxy         common.Address
	AnchorStateRegistryProxy common.Address
	VmAddress                common.Address
	L2ChainId                *big.Int
	Proposer                 common.Address
	Challenger               common.Address
}

type DeployDisputeGameOutput

type DeployDisputeGameOutput struct {
	DisputeGameImpl common.Address
}

type DeployDisputeGameScript

func NewDeployDisputeGameScript added in v1.13.1

func NewDeployDisputeGameScript(host *script.Host) (DeployDisputeGameScript, error)

NewDeployDisputeGameScript loads and validates the DeployDisputeGame2 script contract

type DeployImplementationsInput

type DeployImplementationsInput struct {
	WithdrawalDelaySeconds          *big.Int
	MinProposalSizeBytes            *big.Int
	ChallengePeriodSeconds          *big.Int
	ProofMaturityDelaySeconds       *big.Int
	DisputeGameFinalityDelaySeconds *big.Int
	MipsVersion                     *big.Int
	DevFeatureBitmap                common.Hash
	FaultGameV2MaxGameDepth         *big.Int
	FaultGameV2SplitDepth           *big.Int
	FaultGameV2ClockExtension       *big.Int
	FaultGameV2MaxClockDuration     *big.Int
	SuperchainConfigProxy           common.Address
	ProtocolVersionsProxy           common.Address
	SuperchainProxyAdmin            common.Address
	L1ProxyAdminOwner               common.Address
	Challenger                      common.Address
}

type DeployImplementationsOutput

type DeployImplementationsOutput struct {
	Opcm                             common.Address `json:"opcmAddress"`
	OpcmContractsContainer           common.Address `json:"opcmContractsContainerAddress"`
	OpcmGameTypeAdder                common.Address `json:"opcmGameTypeAdderAddress"`
	OpcmDeployer                     common.Address `json:"opcmDeployerAddress"`
	OpcmUpgrader                     common.Address `json:"opcmUpgraderAddress"`
	OpcmInteropMigrator              common.Address `json:"opcmInteropMigratorAddress"`
	OpcmStandardValidator            common.Address `json:"opcmStandardValidatorAddress"`
	DelayedWETHImpl                  common.Address `json:"delayedWETHImplAddress"`
	OptimismPortalImpl               common.Address `json:"optimismPortalImplAddress"`
	OptimismPortalInteropImpl        common.Address `json:"optimismPortalInteropImplAddress"`
	ETHLockboxImpl                   common.Address `json:"ethLockboxImplAddress" abi:"ethLockboxImpl"`
	PreimageOracleSingleton          common.Address `json:"preimageOracleSingletonAddress"`
	MipsSingleton                    common.Address `json:"mipsSingletonAddress"`
	SystemConfigImpl                 common.Address `json:"systemConfigImplAddress"`
	L1CrossDomainMessengerImpl       common.Address `json:"l1CrossDomainMessengerImplAddress"`
	L1ERC721BridgeImpl               common.Address `json:"l1ERC721BridgeImplAddress"`
	L1StandardBridgeImpl             common.Address `json:"l1StandardBridgeImplAddress"`
	OptimismMintableERC20FactoryImpl common.Address `json:"optimismMintableERC20FactoryImplAddress"`
	DisputeGameFactoryImpl           common.Address `json:"disputeGameFactoryImplAddress"`
	AnchorStateRegistryImpl          common.Address `json:"anchorStateRegistryImplAddress"`
	SuperchainConfigImpl             common.Address `json:"superchainConfigImplAddress"`
	ProtocolVersionsImpl             common.Address `json:"protocolVersionsImplAddress"`
	FaultDisputeGameV2Impl           common.Address `json:"faultDisputeGameV2ImplAddress"`
	PermissionedDisputeGameV2Impl    common.Address `json:"permissionedDisputeGameV2ImplAddress"`
	SuperFaultDisputeGameImpl        common.Address `json:"superFaultDisputeGameImplAddress"`
	SuperPermissionedDisputeGameImpl common.Address `json:"superPermissionedDisputeGameImplAddress"`
}

type DeployImplementationsScript

func NewDeployImplementationsScript added in v1.13.1

func NewDeployImplementationsScript(host *script.Host) (DeployImplementationsScript, error)

NewDeployImplementationsScript loads and validates the DeployImplementations script contract

type DeployMIPS2Input added in v1.13.1

type DeployMIPS2Input struct {
	PreimageOracle common.Address
	MipsVersion    *big.Int
}

type DeployMIPS2Output added in v1.13.1

type DeployMIPS2Output struct {
	MipsSingleton common.Address
}

type DeployMIPSInput

type DeployMIPSInput struct {
	MipsVersion    uint64
	PreimageOracle common.Address
}

type DeployMIPSOutput

type DeployMIPSOutput struct {
	MipsSingleton common.Address
}

func DeployMIPS

func DeployMIPS(
	host *script.Host,
	input DeployMIPSInput,
) (DeployMIPSOutput, error)

type DeployMIPSScript

func NewDeployMIPSScript added in v1.13.1

func NewDeployMIPSScript(host *script.Host) (DeployMIPSScript, error)

NewDeployMIPSScript loads and validates the DeployMIPS2 script contract

type DeployOPChainInput added in v1.11.0

type DeployOPChainInput struct {
	OpChainProxyAdminOwner common.Address
	SystemConfigOwner      common.Address
	Batcher                common.Address
	UnsafeBlockSigner      common.Address
	Proposer               common.Address
	Challenger             common.Address

	BasefeeScalar     uint32
	BlobBaseFeeScalar uint32
	L2ChainId         *big.Int
	Opcm              common.Address
	SaltMixer         string
	GasLimit          uint64

	DisputeGameType              uint32
	DisputeAbsolutePrestate      common.Hash
	DisputeMaxGameDepth          *big.Int
	DisputeSplitDepth            *big.Int
	DisputeClockExtension        uint64
	DisputeMaxClockDuration      uint64
	AllowCustomDisputeParameters bool

	OperatorFeeScalar   uint32
	OperatorFeeConstant uint64
}

type DeployOPChainOutput

type DeployOPChainOutput struct {
	OpChainProxyAdmin                 common.Address
	AddressManager                    common.Address
	L1ERC721BridgeProxy               common.Address
	SystemConfigProxy                 common.Address
	OptimismMintableERC20FactoryProxy common.Address
	L1StandardBridgeProxy             common.Address
	L1CrossDomainMessengerProxy       common.Address
	// Fault proof contracts below.
	OptimismPortalProxy                common.Address
	EthLockboxProxy                    common.Address `evm:"ethLockboxProxy"`
	DisputeGameFactoryProxy            common.Address
	AnchorStateRegistryProxy           common.Address
	FaultDisputeGame                   common.Address
	PermissionedDisputeGame            common.Address
	DelayedWETHPermissionedGameProxy   common.Address
	DelayedWETHPermissionlessGameProxy common.Address
}

type DeployOPChainScript

func NewDeployOPChainScript added in v1.14.0

func NewDeployOPChainScript(host *script.Host) (DeployOPChainScript, error)

NewDeployOPChainScript loads and validates the DeployOPChain script contract

type DeploySuperchainInput

type DeploySuperchainInput struct {
	Guardian                   common.Address         `toml:"guardian"`
	ProtocolVersionsOwner      common.Address         `toml:"protocolVersionsOwner"`
	SuperchainProxyAdminOwner  common.Address         `toml:"superchainProxyAdminOwner"`
	Paused                     bool                   `toml:"paused"`
	RecommendedProtocolVersion params.ProtocolVersion `toml:"recommendedProtocolVersion"`
	RequiredProtocolVersion    params.ProtocolVersion `toml:"requiredProtocolVersion"`
}

type DeploySuperchainOutput

type DeploySuperchainOutput struct {
	ProtocolVersionsImpl  common.Address `json:"protocolVersionsImplAddress"`
	ProtocolVersionsProxy common.Address `json:"protocolVersionsProxyAddress"`
	SuperchainConfigImpl  common.Address `json:"superchainConfigImplAddress"`
	SuperchainConfigProxy common.Address `json:"superchainConfigProxyAddress"`
	SuperchainProxyAdmin  common.Address `json:"proxyAdminAddress"`
}

type DeploySuperchainScript

func NewDeploySuperchainScript added in v1.13.1

func NewDeploySuperchainScript(host *script.Host) (DeploySuperchainScript, error)

NewDeploySuperchainScript loads and validates the DeploySuperchain script contract

type L2GenesisInput

type L2GenesisInput struct {
	L1ChainID                                *big.Int
	L2ChainID                                *big.Int
	L1CrossDomainMessengerProxy              common.Address
	L1StandardBridgeProxy                    common.Address
	L1ERC721BridgeProxy                      common.Address
	OpChainProxyAdminOwner                   common.Address
	SequencerFeeVaultRecipient               common.Address
	SequencerFeeVaultMinimumWithdrawalAmount *big.Int
	SequencerFeeVaultWithdrawalNetwork       *big.Int
	BaseFeeVaultRecipient                    common.Address
	BaseFeeVaultMinimumWithdrawalAmount      *big.Int
	BaseFeeVaultWithdrawalNetwork            *big.Int
	L1FeeVaultRecipient                      common.Address
	L1FeeVaultMinimumWithdrawalAmount        *big.Int
	L1FeeVaultWithdrawalNetwork              *big.Int
	OperatorFeeVaultRecipient                common.Address
	OperatorFeeVaultMinimumWithdrawalAmount  *big.Int
	OperatorFeeVaultWithdrawalNetwork        *big.Int
	GovernanceTokenOwner                     common.Address
	Fork                                     *big.Int
	DeployCrossL2Inbox                       bool
	EnableGovernance                         bool
	FundDevAccounts                          bool
	UseRevenueShare                          bool
	ChainFeesRecipient                       common.Address
	L1FeesDepositor                          common.Address
}

type L2GenesisScript

func NewL2GenesisScript added in v1.13.3

func NewL2GenesisScript(host *script.Host) (L2GenesisScript, error)

type PreinstallsScript added in v1.13.1

type PreinstallsScript struct {
	SetPreinstalls func() error
}

type ReadImplementationAddressesInput added in v1.10.0

type ReadImplementationAddressesInput struct {
	AddressManager                    common.Address
	L1ERC721BridgeProxy               common.Address
	SystemConfigProxy                 common.Address
	OptimismMintableERC20FactoryProxy common.Address
	L1StandardBridgeProxy             common.Address
	OptimismPortalProxy               common.Address
	DisputeGameFactoryProxy           common.Address
	DelayedWETHPermissionedGameProxy  common.Address
	Opcm                              common.Address
}

type ReadImplementationAddressesOutput added in v1.10.0

type ReadImplementationAddressesOutput struct {
	DelayedWETH                  common.Address
	OptimismPortal               common.Address
	OptimismPortalInterop        common.Address
	EthLockbox                   common.Address `evm:"ethLockbox"`
	SystemConfig                 common.Address
	AnchorStateRegistry          common.Address
	L1CrossDomainMessenger       common.Address
	L1ERC721Bridge               common.Address
	L1StandardBridge             common.Address
	OptimismMintableERC20Factory common.Address
	DisputeGameFactory           common.Address
	MipsSingleton                common.Address
	PreimageOracleSingleton      common.Address
	FaultDisputeGameV2           common.Address
	PermissionedDisputeGameV2    common.Address
	SuperFaultDisputeGame        common.Address
	SuperPermissionedDisputeGame common.Address
	OpcmDeployer                 common.Address
	OpcmUpgrader                 common.Address
	OpcmGameTypeAdder            common.Address
	OpcmStandardValidator        common.Address
	OpcmInteropMigrator          common.Address
}

type ReadImplementationAddressesScript added in v1.10.0

func NewReadImplementationAddressesScript added in v1.14.0

func NewReadImplementationAddressesScript(host *script.Host) (ReadImplementationAddressesScript, error)

NewReadImplementationAddressesScript loads and validates the ReadImplementationAddresses script contract

type ReadSuperchainDeploymentInput added in v1.13.3

type ReadSuperchainDeploymentInput struct {
	OPCMAddress common.Address `abi:"opcmAddress"`
}

type ReadSuperchainDeploymentOutput added in v1.13.3

type ReadSuperchainDeploymentOutput struct {
	ProtocolVersionsImpl  common.Address
	ProtocolVersionsProxy common.Address
	SuperchainConfigImpl  common.Address
	SuperchainConfigProxy common.Address
	SuperchainProxyAdmin  common.Address

	Guardian                   common.Address
	ProtocolVersionsOwner      common.Address
	SuperchainProxyAdminOwner  common.Address
	RecommendedProtocolVersion [32]byte
	RequiredProtocolVersion    [32]byte
}

type ReadSuperchainDeploymentScript added in v1.13.3

func NewReadSuperchainDeploymentScript added in v1.13.3

func NewReadSuperchainDeploymentScript(host *script.Host) (ReadSuperchainDeploymentScript, error)

type Scripts added in v1.13.3

type Scripts struct {
	DeployAlphabetVM      DeployAlphabetVMScript
	DeployAltDA           DeployAltDAScript
	DeployAsterisc        DeployAsteriscScript
	DeployDisputeGame     DeployDisputeGameScript
	DeployImplementations DeployImplementationsScript
	DeployMIPS            DeployMIPSScript
	DeploySuperchain      DeploySuperchainScript
	DeployOPChain         DeployOPChainScript
}

Scripts contains all the deployment scripts for ease of passing them around

func NewScripts added in v1.13.3

func NewScripts(host *script.Host) (*Scripts, error)

NewScripts collects all the deployment scripts, raising exceptions if any of them are not found or if the Go types don't match the ABI

type SetDisputeGameImplInput added in v1.11.0

type SetDisputeGameImplInput struct {
	Factory             common.Address
	Impl                common.Address
	AnchorStateRegistry common.Address
	GameType            uint32
	GameArgs            []byte
	UseV2               bool
}

type SingleScript added in v1.11.0

type SingleScript struct {
	Run func(input, output common.Address) error
}

type StartingAnchorRoot added in v1.11.0

type StartingAnchorRoot struct {
	Root          common.Hash
	L2BlockNumber *big.Int
}

type VoidScript added in v1.11.0

type VoidScript struct {
	Run func(common.Address) error
}

Jump to

Keyboard shortcuts

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