opcm

package
v1.16.13 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 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

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

func InsertPreinstalls

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 MustType

func MustType(t string) abi.Type

func RunScriptSingle

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

func RunScriptVoid

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

func SetDisputeGameImpl

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) GenericStringGetter

func (c *Contract) GenericStringGetter(ctx context.Context, functionName string) (string, 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) OPCMStandardValidator

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

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

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

type DeployAlphabetVMOutput

type DeployAlphabetVMOutput struct {
	AlphabetVM common.Address
}

func DeployAlphabetVMViaForge

func DeployAlphabetVMViaForge(env *ForgeEnv, input DeployAlphabetVMInput) (DeployAlphabetVMOutput, error)

DeployAlphabetVMViaForge deploys Alphabet VM contracts using Forge

type DeployAlphabetVMScript

func NewDeployAlphabetVMScript

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
}

func DeployAltDAViaForge

func DeployAltDAViaForge(env *ForgeEnv, input DeployAltDAInput) (DeployAltDAOutput, error)

DeployAltDAViaForge deploys AltDA contracts using Forge

type DeployAltDAScript

func NewDeployAltDAScript

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

NewDeployAltDAScript loads and validates the DeployAltDA script contract

type DeployDisputeGameInput

type DeployDisputeGameInput struct {
	Release                  string
	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
}

func DeployDisputeGameViaForge

func DeployDisputeGameViaForge(env *ForgeEnv, input DeployDisputeGameInput) (DeployDisputeGameOutput, error)

DeployDisputeGameViaForge deploys dispute game contracts using Forge

type DeployDisputeGameScript

func NewDeployDisputeGameScript

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"`
	OpcmUtils                        common.Address `json:"opcmUtilsAddress"`
	OpcmMigrator                     common.Address `json:"opcmMigratorAddress"`
	OpcmV2                           common.Address `json:"opcmV2Address"`
	OpcmContainer                    common.Address `json:"opcmContainerAddress"`
	DelayedWETHImpl                  common.Address `json:"delayedWETHImplAddress"`
	OptimismPortalImpl               common.Address `json:"optimismPortalImplAddress"`
	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"`
	FaultDisputeGameImpl             common.Address `json:"faultDisputeGameImplAddress"`
	PermissionedDisputeGameImpl      common.Address `json:"permissionedDisputeGameImplAddress"`
	SuperFaultDisputeGameImpl        common.Address `json:"superFaultDisputeGameImplAddress"`
	SuperPermissionedDisputeGameImpl common.Address `json:"superPermissionedDisputeGameImplAddress"`
	StorageSetterImpl                common.Address `json:"storageSetterImplAddress"`
}

func DeployImplementationsViaForge

func DeployImplementationsViaForge(env *ForgeEnv, input DeployImplementationsInput) (DeployImplementationsOutput, error)

DeployImplementationsViaForge deploys implementation contracts using Forge

type DeployImplementationsScript

func NewDeployImplementationsScript

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

NewDeployImplementationsScript loads and validates the DeployImplementations script contract

type DeployMIPSInput

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

type DeployMIPSOutput

type DeployMIPSOutput struct {
	MipsSingleton common.Address
}

func DeployMIPS

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

func DeployMIPSViaForge

func DeployMIPSViaForge(env *ForgeEnv, input DeployMIPSInput) (DeployMIPSOutput, error)

DeployMIPSViaForge deploys MIPS contracts using Forge

type DeployMIPSScript

func NewDeployMIPSScript

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

NewDeployMIPSScript loads and validates the DeployMIPS script contract

type DeployOPChainInput

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
	SuperchainConfig    common.Address

	UseCustomGasToken bool
}

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
}

func DeployOPChainViaForge

func DeployOPChainViaForge(env *ForgeEnv, input DeployOPChainInput) (DeployOPChainOutput, error)

DeployOPChainViaForge deploys OP Chain contracts using Forge

type DeployOPChainScript

func NewDeployOPChainScript

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"`
}

func DeploySuperchainViaForge

func DeploySuperchainViaForge(env *ForgeEnv, input DeploySuperchainInput) (DeploySuperchainOutput, error)

DeploySuperchainViaForge deploys superchain contracts using Forge

type DeploySuperchainScript

func NewDeploySuperchainScript

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

NewDeploySuperchainScript loads and validates the DeploySuperchain script contract

type ForgeEnv

type ForgeEnv struct {
	Client     *forge.Client
	Context    context.Context
	L1RPCUrl   string
	PrivateKey string
}

ForgeEnv contains the forge-related configuration needed to run forge scripts

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
	EnableGovernance                         bool
	FundDevAccounts                          bool
	UseRevenueShare                          bool
	ChainFeesRecipient                       common.Address
	L1FeesDepositor                          common.Address
	UseCustomGasToken                        bool
	UseInterop                               bool
	GasPayingTokenName                       string
	GasPayingTokenSymbol                     string
	NativeAssetLiquidityAmount               *big.Int
	LiquidityControllerOwner                 common.Address
	DevFeatureBitmap                         common.Hash
}

type L2GenesisScript

func NewL2GenesisScript

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

type PreinstallsScript

type PreinstallsScript struct {
	SetPreinstalls func() error
}

type ReadImplementationAddressesInput

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

type ReadImplementationAddressesOutput

type ReadImplementationAddressesOutput struct {
	DelayedWETH                  common.Address
	OptimismPortal               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
	FaultDisputeGame             common.Address
	PermissionedDisputeGame      common.Address
	SuperFaultDisputeGame        common.Address
	SuperPermissionedDisputeGame common.Address
	OpcmDeployer                 common.Address
	OpcmUpgrader                 common.Address
	OpcmGameTypeAdder            common.Address
	OpcmStandardValidator        common.Address
	OpcmInteropMigrator          common.Address
}

func ReadImplementationAddressesViaForge

func ReadImplementationAddressesViaForge(env *ForgeEnv, input ReadImplementationAddressesInput) (ReadImplementationAddressesOutput, error)

ReadImplementationAddressesViaForge reads implementation addresses using Forge

type ReadImplementationAddressesScript

func NewReadImplementationAddressesScript

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

NewReadImplementationAddressesScript loads and validates the ReadImplementationAddresses script contract

type ReadSuperchainDeploymentInput

type ReadSuperchainDeploymentInput struct {
	SuperchainConfigProxy common.Address
}

type ReadSuperchainDeploymentOutput

type ReadSuperchainDeploymentOutput struct {
	SuperchainConfigImpl      common.Address `abi:"superchainConfigImpl"`
	SuperchainConfigProxy     common.Address `abi:"superchainConfigProxy"`
	SuperchainProxyAdmin      common.Address `abi:"superchainProxyAdmin"`
	Guardian                  common.Address `abi:"guardian"`
	SuperchainProxyAdminOwner common.Address `abi:"superchainProxyAdminOwner"`
}

func ReadSuperchainDeploymentViaForge

func ReadSuperchainDeploymentViaForge(env *ForgeEnv, input ReadSuperchainDeploymentInput) (ReadSuperchainDeploymentOutput, error)

ReadSuperchainDeploymentViaForge reads superchain deployment addresses using Forge

type Scripts

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

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

func NewScripts

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

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

type SingleScript

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

type StartingAnchorRoot

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

type VoidScript

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