Documentation
¶
Index ¶
- Constants
- Variables
- func Apply(ctx context.Context, cfg ApplyConfig) error
- func ApplyCLI() func(cliCtx *cli.Context) error
- func ApplyPipeline(ctx context.Context, opts ApplyPipelineOpts) error
- func ChainIDFromRPC(ctx context.Context, rpcURL string) (*big.Int, error)
- func CreateCacheDir(cacheDir string) error
- func EnableDevFeature(bitmap, flag common.Hash) common.Hash
- func Init(cfg InitConfig) error
- func InitCLI() func(ctx *cli.Context) error
- func IsDevFeatureEnabled(bitmap, flag common.Hash) bool
- func PrefixEnvVar(name string) []string
- type ApplyConfig
- type ApplyPipelineOpts
- type DeploymentTarget
- type InitConfig
Constants ¶
View Source
const ( EnvVarPrefix = flags.EnvVarPrefix L1RPCURLFlagName = flags.L1RPCURLFlagName CacheDirFlagName = flags.CacheDirFlagName L1ChainIDFlagName = flags.L1ChainIDFlagName ArtifactsLocatorFlagName = flags.ArtifactsLocatorFlagName L2ChainIDsFlagName = flags.L2ChainIDsFlagName WorkdirFlagName = flags.WorkdirFlagName OutdirFlagName = flags.OutdirFlagName PrivateKeyFlagName = flags.PrivateKeyFlagName IntentTypeFlagName = flags.IntentTypeFlagName VerifierAPIKeyFlagName = flags.VerifierAPIKeyFlagName EtherscanAPIKeyFlagName = flags.EtherscanAPIKeyFlagName // Deprecated: use VerifierAPIKeyFlagName InputFileFlagName = flags.InputFileFlagName ContractNameFlagName = flags.ContractNameFlagName VerifierTypeFlagName = flags.VerifierTypeFlagName VerifierUrlFlagName = flags.VerifierUrlFlagName )
Variables ¶
View Source
var ( Uint256Type = opcm.MustType("uint256") BytesType = opcm.MustType("bytes") AddressType = opcm.MustType("address") Bytes32Type = opcm.MustType("bytes32") )
Primitive ABI types primarily used with `abi.Arguments` to pack/unpack values when calling contract methods.
View Source
var ( SepoliaChainID uint64 = 11155111 DefaultL1ProxyAdminOwnerSepolia common.Address = common.HexToAddress("0x1Eb2fFc903729a0F03966B917003800b145F56E2") DefaultSystemConfigProxySepolia common.Address = common.HexToAddress("0x034edD2A225f7f429A63E0f1D2084B9E0A93b538") )
Constants for Sepolia chain.
View Source
var ( // OptimismPortalInteropDevFlag enables the OptimismPortalInterop contract. OptimismPortalInteropDevFlag = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000001") // CannonKonaDevFlag enables Kona as the default cannon prover. CannonKonaDevFlag = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000010") // DeployV2DisputeGamesDevFlag enables deployment of V2 dispute game contracts. DeployV2DisputeGamesDevFlag = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000100") // OPCMV2DevFlag enables the OPContractsManagerV2 contract. OPCMV2DevFlag = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000010000") )
Development feature flag constants that mirror the solidity DevFeatures library. These use a 32 byte bitmap for easy integration between op-deployer and contracts.
View Source
var ( L1RPCURLFlag = &cli.StringFlag{ Name: L1RPCURLFlagName, Usage: "RPC URL for the L1 chain. Must be set for live chains. " + "Must be blank for chains deploying to local allocs files.", EnvVars: []string{ "L1_RPC_URL", }, } ArtifactsLocatorFlag = &cli.StringFlag{ Name: ArtifactsLocatorFlagName, Usage: "Locator for artifacts.", EnvVars: PrefixEnvVar("ARTIFACTS_LOCATOR"), Value: artifacts.EmbeddedLocatorString, } CacheDirFlag = &cli.StringFlag{ Name: CacheDirFlagName, Usage: "Cache directory. " + "If set, the deployer will attempt to cache downloaded artifacts in the specified directory.", EnvVars: PrefixEnvVar("CACHE_DIR"), Value: flags.DefaultCacheDir(), } L1ChainIDFlag = &cli.Uint64Flag{ Name: L1ChainIDFlagName, Usage: "Chain ID of the L1 chain.", EnvVars: PrefixEnvVar("L1_CHAIN_ID"), Value: 11155111, } L2ChainIDsFlag = &cli.StringFlag{ Name: L2ChainIDsFlagName, Usage: "Comma-separated list of L2 chain IDs to deploy.", EnvVars: PrefixEnvVar("L2_CHAIN_IDS"), } WorkdirFlag = &cli.StringFlag{ Name: WorkdirFlagName, Usage: "Directory storing intent and stage. Defaults to the current directory.", EnvVars: PrefixEnvVar("WORKDIR"), Value: cwd(), Aliases: []string{ OutdirFlagName, }, } PrivateKeyFlag = &cli.StringFlag{ Name: PrivateKeyFlagName, Usage: "Private key of the deployer account.", EnvVars: PrefixEnvVar("PRIVATE_KEY"), } DeploymentTargetFlag = &cli.StringFlag{ Name: "deployment-target", Usage: fmt.Sprintf("Where to deploy L1 contracts. Options: %s, %s, %s, %s", DeploymentTargetLive, DeploymentTargetGenesis, DeploymentTargetCalldata, DeploymentTargetNoop), EnvVars: PrefixEnvVar("DEPLOYMENT_TARGET"), Value: string(DeploymentTargetLive), } OpProgramSvcUrlFlag = &cli.StringFlag{ Name: "op-program-svc-url", Usage: "URL of the OP Program SVC", EnvVars: PrefixEnvVar("OP_PROGRAM_SVC_URL"), } IntentTypeFlag = &cli.StringFlag{ Name: IntentTypeFlagName, Usage: fmt.Sprintf("Intent config type to use. Options: %s (default), %s, %s", state.IntentTypeStandard, state.IntentTypeCustom, state.IntentTypeStandardOverrides), EnvVars: PrefixEnvVar("INTENT_TYPE"), Value: string(state.IntentTypeStandard), Aliases: []string{ "intent-config-type", }, } VerifierAPIKeyFlag = &cli.StringFlag{ Name: VerifierAPIKeyFlagName, Usage: "API key for contract verifier (etherscan, blockscout, etc.)", EnvVars: append(PrefixEnvVar("VERIFIER_API_KEY"), PrefixEnvVar("ETHERSCAN_API_KEY")...), Aliases: []string{EtherscanAPIKeyFlagName}, } InputFileFlag = &cli.StringFlag{ Name: InputFileFlagName, Usage: "filepath of input file for command", EnvVars: PrefixEnvVar("INPUT_FILE"), } ContractNameFlag = &cli.StringFlag{ Name: ContractNameFlagName, Usage: "(optional) contract name matching a field within the input file", EnvVars: PrefixEnvVar("CONTRACT_NAME"), } VerifierFlag = &cli.StringFlag{ Name: VerifierTypeFlagName, Usage: "contract verifier type(s) to use. Comma-separated for multiple verifiers. Options: etherscan (default), blockscout, custom. Example: etherscan,blockscout", EnvVars: PrefixEnvVar("VERIFIER_TYPE"), Value: "etherscan", } VerifierUrlFlag = &cli.StringFlag{ Name: VerifierUrlFlagName, Usage: "verifier URL (optional for blockscout, required for custom, ignored for etherscan)", EnvVars: PrefixEnvVar("VERIFIER_URL"), } AutoVerifyFlag = &cli.BoolFlag{ Name: "verify", Usage: "automatically verify contracts after deployment", EnvVars: PrefixEnvVar("VERIFY"), Value: false, } )
View Source
var ApplyFlags = []cli.Flag{ L1RPCURLFlag, WorkdirFlag, PrivateKeyFlag, DeploymentTargetFlag, OpProgramSvcUrlFlag, AutoVerifyFlag, VerifierAPIKeyFlag, VerifierFlag, VerifierUrlFlag, }
View Source
var GlobalFlags = append([]cli.Flag{CacheDirFlag}, oplog.CLIFlags(EnvVarPrefix)...)
View Source
var InitFlags = []cli.Flag{ L1ChainIDFlag, L2ChainIDsFlag, WorkdirFlag, IntentTypeFlag, }
View Source
var UpgradeFlags = []cli.Flag{ L1RPCURLFlag, PrivateKeyFlag, DeploymentTargetFlag, }
View Source
var VerifyFlags = []cli.Flag{ L1RPCURLFlag, ArtifactsLocatorFlag, VerifierAPIKeyFlag, InputFileFlag, ContractNameFlag, VerifierFlag, VerifierUrlFlag, }
Functions ¶
func ApplyPipeline ¶
func ApplyPipeline( ctx context.Context, opts ApplyPipelineOpts, ) error
func ChainIDFromRPC ¶ added in v1.16.3
func CreateCacheDir ¶ added in v1.14.1
func EnableDevFeature ¶ added in v1.16.1
EnableDevFeature enables a specific development feature in a feature bitmap
func Init ¶
func Init(cfg InitConfig) error
func IsDevFeatureEnabled ¶ added in v1.14.0
IsDevFeatureEnabled checks if a specific development feature is enabled in a feature bitmap. It performs a bitwise AND operation between the bitmap and the feature flag to determine if the feature is enabled. This follows the same pattern as the solidity DevFeatures library.
func PrefixEnvVar ¶
Types ¶
type ApplyConfig ¶
type ApplyConfig struct {
L1RPCUrl string
Workdir string
PrivateKey string
DeploymentTarget DeploymentTarget
Logger log.Logger
CacheDir string
PreStateBuilder pipeline.PreStateBuilder
// contains filtered or unexported fields
}
func (*ApplyConfig) Check ¶
func (a *ApplyConfig) Check() error
type ApplyPipelineOpts ¶ added in v1.10.0
type ApplyPipelineOpts struct {
L1RPCUrl string
DeploymentTarget DeploymentTarget
DeployerPrivateKey *ecdsa.PrivateKey
Intent *state.Intent
State *state.State
Logger log.Logger
StateWriter pipeline.StateWriter
CacheDir string
PreStateBuilder pipeline.PreStateBuilder
}
type DeploymentTarget ¶ added in v1.11.0
type DeploymentTarget string
const ( DeploymentTargetLive DeploymentTarget = "live" DeploymentTargetGenesis DeploymentTarget = "genesis" DeploymentTargetCalldata DeploymentTarget = "calldata" DeploymentTargetNoop DeploymentTarget = "noop" )
func NewDeploymentTarget ¶ added in v1.11.0
func NewDeploymentTarget(s string) (DeploymentTarget, error)
type InitConfig ¶
type InitConfig struct {
IntentType state.IntentType
L1ChainID uint64
Outdir string
L2ChainIDs []common.Hash
}
func (*InitConfig) Check ¶
func (c *InitConfig) Check() error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd/mktar
command
|
|
|
integration_test
|
|
|
v3_0_0
Package v3_0_0 implements the upgrade to v3.0.0 (U14).
|
Package v3_0_0 implements the upgrade to v3.0.0 (U14). |
|
v4_0_0
Package v4_0_0 implements the upgrade to v4.0.0 (U16).
|
Package v4_0_0 implements the upgrade to v4.0.0 (U16). |
|
v4_1_0
Package v4_1_0 implements the upgrade to v4.1.0 (U16a).
|
Package v4_1_0 implements the upgrade to v4.1.0 (U16a). |
|
v5_0_0
Package v5_0_0 implements the upgrade to v5.0.0 (U17).
|
Package v5_0_0 implements the upgrade to v5.0.0 (U17). |
Click to show internal directories.
Click to hide internal directories.