common

package
v0.1.0-preview.7.rc Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// L1 and L2 config names
	L1 = "l1"
	L2 = "l2"

	// ContractsDir is the subdirectory name for contract components
	ContractsDir = "contracts"

	// Makefile is the name of the makefile used for root level operations
	Makefile = "Makefile"

	// ContractsMakefile is the name of the makefile used for contract level operations
	ContractsMakefile = "Makefile"

	// GlobalConfigFile is the name of the global YAML used to store global config details (eg, user_id)
	GlobalConfigFile = "config.yaml"

	// Filename for devkit project config
	BaseConfig = "config.yaml"

	// Filename for zeus config
	ZeusConfig = ".zeus"

	// Docker open timeout
	DockerOpenTimeoutSeconds = 10

	// Docker open retry interval in milliseconds
	DockerOpenRetryIntervalMilliseconds = 500

	// CrossChainRegistryOwnerAddress is the address of the owner of the cross chain registry
	CrossChainRegistryOwnerAddress = "0xb094Ba769b4976Dc37fC689A76675f31bc4923b0"

	// Curve type constants/enums for KeyRegistrar
	CURVE_TYPE_KEY_REGISTRAR_UNKNOWN = 0
	CURVE_TYPE_KEY_REGISTRAR_ECDSA   = 1
	CURVE_TYPE_KEY_REGISTRAR_BN254   = 2

	// These are fallback EigenLayer deployment addresses when not specified in context (assumes seploia)
	ALLOCATION_MANAGER_ADDRESS     = "0x42583067658071247ec8CE0A516A58f682002d07"
	DELEGATION_MANAGER_ADDRESS     = "0xD4A7E1Bd8015057293f0D0A557088c286942e84b"
	STRATEGY_MANAGER_ADDRESS       = "0x2E3D6c0744b10eb0A4e6F679F71554a39Ec47a5D"
	KEY_REGISTRAR_ADDRESS          = "0xA4dB30D08d8bbcA00D40600bee9F029984dB162a"
	CROSS_CHAIN_REGISTRY_ADDRESS   = "0x287381B1570d9048c4B4C7EC94d21dDb8Aa1352a"
	BN254_TABLE_CALCULATOR_ADDRESS = "0xa19E3B00cf4aC46B5e6dc0Bbb0Fb0c86D0D65603"
	ECDSA_TABLE_CALCULATOR_ADDRESS = "0xaCB5DE6aa94a1908E6FA577C2ade65065333B450"
	MULTICHAIN_PROXY_ADMIN         = "0xC5dc0d145a21FDAD791Df8eDC7EbCB5330A3FdB5"
	EIGEN_CONTRACT_ADDRESS         = "0x3B78576F7D6837500bA3De27A60c7f594934027E"
	RELEASE_MANAGER_ADDRESS        = "0xd9Cb89F1993292dEC2F973934bC63B0f2A702776"
)

Project structure constants

View Source
const DefaultConfigWithContextConfigPath = "config"

Variables

View Source
var GlobalFlags = []cli.Flag{
	&cli.BoolFlag{
		Name:    "verbose",
		Aliases: []string{"v"},
		Usage:   "Enable verbose logging",
	},
	&cli.BoolFlag{
		Name:  "enable-telemetry",
		Usage: "Enable telemetry collection on first run without prompting",
	},
	&cli.BoolFlag{
		Name:  "disable-telemetry",
		Usage: "Disable telemetry collection on first run without prompting",
	},
}

GlobalFlags defines flags that apply to the entire application (global flags).

Functions

func CallTemplateScript

func CallTemplateScript(cmdCtx context.Context, logger iface.Logger, dir string, scriptPath string, expect ResponseExpectation, params ...[]byte) (map[string]interface{}, error)

func CleanYAML

func CleanYAML(v interface{}) interface{}

Normalizes YAML-parsed structures

func CloneNode

func CloneNode(n *yaml.Node) *yaml.Node

CloneNode performs a deep copy of a *yaml.Node, including its content and comments

func CompareVersions added in v0.0.9

func CompareVersions(v1, v2 string) (bool, error)

CompareVersions returns true if v1 > v2

func DeepMerge

func DeepMerge(dst, src *yaml.Node) *yaml.Node

DeepMerge merges two *yaml.Node trees recursively

- If both nodes are MappingNodes, their keys are merged:

  • Matching keys: recurse if both values are maps, else src replaces dst
  • New keys in src are appended to dst

- For non-mapping nodes, src replaces dst - All merged values are deep-cloned to avoid shared references

func EnsureDockerIsRunning

func EnsureDockerIsRunning(cCtx *cli.Context) error

EnsureDockerIsRunning checks if Docker is running and attempts to launch Docker Desktop if not.

func FindProjectRoot

func FindProjectRoot() (string, error)

FindProjectRoot searches upward from current directory to find config/config.yaml

func GetChildByKey

func GetChildByKey(node *yaml.Node, path string) *yaml.Node

GetChildByKey returns the value node associated with the given key from a MappingNode

func GetEffectiveTelemetryPreference

func GetEffectiveTelemetryPreference() (bool, error)

GetEffectiveTelemetryPreference returns the effective telemetry preference Project setting takes precedence over global setting

func GetEigenLayerAddresses

func GetEigenLayerAddresses(contextName string, cfg *ConfigWithContextConfig) (allocationManager, delegationManager, strategyManager, keyRegistrar, crossChainRegistry, bn254TableCalculator, ecdsaTableCalculator, releaseManager string)

GetEigenLayerAddresses returns EigenLayer L1 addresses from the context config Falls back to constants if not found in context

func GetForkUrlDefault

func GetForkUrlDefault(contextName string, cfg *ConfigWithContextConfig, chainName string) (string, error)

func GetGlobalConfigDir

func GetGlobalConfigDir() (string, error)

GetGlobalConfigDir returns the XDG-compliant directory where global devkit config should be stored

func GetGlobalConfigPath

func GetGlobalConfigPath() (string, error)

GetGlobalConfigPath returns the full path to the global config file

func GetGlobalTelemetryPreference

func GetGlobalTelemetryPreference() (*bool, error)

GetGlobalTelemetryPreference returns the global telemetry preference

func GetLogger

func GetLogger(verbose bool) (iface.Logger, iface.ProgressTracker)

Get logger for the env we're in

func GetLoggerFromCLIContext

func GetLoggerFromCLIContext(cCtx *cli.Context) (iface.Logger, iface.ProgressTracker)

GetLoggerFromCLIContext creates a logger based on the CLI context It checks the verbose flag and returns the appropriate logger

func GetProjectUUID

func GetProjectUUID() string

GetProjectUUID returns the project UUID from config.yaml or empty string if not found

func GetZeusAddresses

func GetZeusAddresses(ctx context.Context, logger iface.Logger) (*L1ZeusAddressData, *L2ZeusAddressData, error)

GetZeusAddresses runs the zeus env show commands and extracts core EigenLayer addresses.

func HandleFirstRunTelemetryPrompt

func HandleFirstRunTelemetryPrompt(logger iface.Logger) (bool, bool, error)

HandleFirstRunTelemetryPrompt checks if this is a first run and prompts for telemetry Returns the telemetry preference (true/false) and whether this was a first run

func HandleFirstRunTelemetryPromptWithOptions

func HandleFirstRunTelemetryPromptWithOptions(logger iface.Logger, opts TelemetryPromptOptions) (bool, bool, error)

HandleFirstRunTelemetryPromptWithOptions handles first run with configurable options

func ImpersonateAccount added in v0.0.9

func ImpersonateAccount(client *rpc.Client, address common.Address) error

ImpersonateAccount enables impersonation of an account on Anvil

func InterfaceToNode

func InterfaceToNode(v interface{}) (*yaml.Node, error)

InterfaceToNode converts a Go value (typically map[string]interface{}) into a *yaml.Node

func IsFirstRun

func IsFirstRun() (bool, error)

IsFirstRun checks if this is the user's first time running devkit

func IsSemver added in v0.0.9

func IsSemver(s string) bool

IsSemver checks if a version string is valid

func IsTelemetryEnabled

func IsTelemetryEnabled() bool

IsTelemetryEnabled returns whether telemetry is enabled for the project It checks both global and project-level preferences, with project taking precedence

func IsValidABI

func IsValidABI(v interface{}) error

func IsVerboseEnabled

func IsVerboseEnabled(cCtx *cli.Context, cfg *ConfigWithContextConfig) bool

IsVerboseEnabled checks if either the CLI --verbose flag is set, or config.yaml has log level = "debug"

func ListYaml

func ListYaml(filePath string, logger iface.Logger) error

ListYaml prints the contents of a YAML file to stdout, preserving order and comments. It rejects non-.yaml/.yml extensions and surfaces precise errors.

func LoadBaseConfig

func LoadBaseConfig() (map[string]interface{}, error)

func LoadConfig

func LoadConfig() (string, *yaml.Node, *yaml.Node, error)

func LoadContext added in v0.0.9

func LoadContext(contextName string) (string, *yaml.Node, *yaml.Node, string, error)

func LoadContextConfig

func LoadContextConfig(ctxName string) (map[string]interface{}, error)

func LoadDefaultContext

func LoadDefaultContext() (string, *yaml.Node, *yaml.Node, string, error)

func LoadDefaultRawConfigWithContext

func LoadDefaultRawConfigWithContext() ([]byte, string, error)

func LoadDefaultRawContext

func LoadDefaultRawContext() ([]byte, string, error)

func LoadMap

func LoadMap(path string) (map[string]interface{}, error)

LoadMap loads the YAML file at path into a map[string]interface{}

func LoadRawConfigWithContext

func LoadRawConfigWithContext(contextName string) ([]byte, string, error)

func LoadRawContext

func LoadRawContext(contextName string) ([]byte, string, error)

func LoadYAML

func LoadYAML(path string) (*yaml.Node, error)

LoadYAML reads a YAML file from the given path and unmarshals it into a *yaml.Node

func LoggerFromContext

func LoggerFromContext(cCtx *cli.Context) iface.Logger

LoggerFromContext retrieves the logger from the context If no logger is found, it returns a non-verbose logger as fallback

func MapToSortedSlice

func MapToSortedSlice(keyed map[string]map[string]any) []any

MapToSortedSlice converts a keyed map back to a slice sorted by numeric id if possible.

func MarkFirstRunComplete

func MarkFirstRunComplete() error

MarkFirstRunComplete marks that the first run has been completed

func NodeToInterface

func NodeToInterface(node *yaml.Node) (interface{}, error)

NodeToInterface converts a *yaml.Node back into a Go interface{}

func Normalize

func Normalize(i interface{}) interface{}

Normalize will walk any nested map[interface{}]interface{} -> map[string]interface{}, and also recurse into []interface{}

func NormalizeToKeyedMap

func NormalizeToKeyedMap(input any, idField string) map[string]map[string]any

NormalizeToKeyedMap converts a slice or map of objects into a map keyed by the given field.

func ParseETHAmount added in v0.0.9

func ParseETHAmount(amountStr string) (*big.Int, error)

ParseETHAmount parses ETH amount strings like "5ETH", "10.5ETH", "1000000000000000000" (wei) Returns the amount in wei as *big.Int

func ParseVersion added in v0.0.9

func ParseVersion(v string) (major, minor, patch int, err error)

ParseVersion converts version string like "0.0.5" to comparable integers

func PeelBoolFromFlags

func PeelBoolFromFlags(args []string, longFlag, shortFlag string) bool

PeelBoolFromFlags reports whether a boolean CLI flag is set anywhere in args, It supports these forms:

--verbose
--verbose=true|false|1|0|yes|no|t|f
--verbose true|false|1|0|yes|no|t|f
-v
-v=true|false|1|0|yes|no|t|f
-v true|false|1|0|yes|no|t|f

The last occurrence wins. If a flag is present without an explicit value, it is treated as true.

func ProgressTrackerFromContext

func ProgressTrackerFromContext(ctx context.Context) iface.ProgressTracker

ProgressTrackerFromContext retrieves the progress tracker from the context If no tracker is found, it returns a non-verbose tracker as fallback

func RequireNonZero

func RequireNonZero(s interface{}) error

func SaveGlobalConfig

func SaveGlobalConfig(config *GlobalConfig) error

SaveGlobalConfig saves the global configuration to disk

func SaveProjectIdAndTelemetryToggle

func SaveProjectIdAndTelemetryToggle(projectDir string, projectUuid string, telemetryEnabled bool) error

SaveProjectIdAndTelemetryToggle saves project settings to config.yaml

func SaveUserId

func SaveUserId(userUuid string) error

SaveUserId saves user settings to the global config, but preserves existing UUID if present

func SetGlobalTelemetryPreference

func SetGlobalTelemetryPreference(enabled bool) error

SetGlobalTelemetryPreference sets the global telemetry preference

func SetMappingValue

func SetMappingValue(mapNode, keyNode, valNode *yaml.Node)

SetMappingValue sets mapNode[keyNode.Value] = valNode, replacing existing or appending if missing.

func SetProjectTelemetry

func SetProjectTelemetry(enabled bool) error

SetProjectTelemetry sets telemetry preference for the current project only

func StopImpersonatingAccount added in v0.0.9

func StopImpersonatingAccount(client *rpc.Client, address common.Address) error

StopImpersonatingAccount disables impersonation of an account on Anvil

func TelemetryPromptWithOptions

func TelemetryPromptWithOptions(logger iface.Logger, opts TelemetryPromptOptions) (bool, error)

TelemetryPromptWithOptions presents the telemetry opt-in dialog with configurable behavior

func ToStringID

func ToStringID(value any) string

ToStringID converts a value of various numeric or string types into a string ID.

func UpdateContextWithZeusAddresses

func UpdateContextWithZeusAddresses(context context.Context, logger iface.Logger, contextMap *yaml.Node, contextName string) error

UpdateContextWithZeusAddresses updates the context configuration with addresses from Zeus

func WithAppEnvironment

func WithAppEnvironment(ctx *cli.Context)

func WithLogger

func WithLogger(ctx context.Context, logger iface.Logger) context.Context

WithLogger stores the logger in the context

func WithProgressTracker

func WithProgressTracker(ctx context.Context, tracker iface.ProgressTracker) context.Context

WithProgressTracker stores the progress tracker in the context

func WithShutdown

func WithShutdown(ctx context.Context) context.Context

WithShutdown creates a new context that will be cancelled on SIGTERM/SIGINT

func WriteMap

func WriteMap(path string, m map[string]interface{}) error

WriteMap takes a map[string]interface{} and writes it back to a file

func WriteToPath

func WriteToPath(root *yaml.Node, path []string, val string) (*yaml.Node, error)

WriteToPath sets or overwrites a value in the YAML tree given a dot-delimited path.

func WriteYAML

func WriteYAML(path string, node *yaml.Node) error

WriteYAML encodes a *yaml.Node to YAML and writes it to the specified file path

func YamlToMap

func YamlToMap(b []byte) (map[string]interface{}, error)

YamlToMap unmarshals your YAML into interface{}, normalizes all maps, and returns the top‐level map[string]interface{}

Types

type AppEnvironment

type AppEnvironment struct {
	CLIVersion  string
	OS          string
	Arch        string
	ProjectUUID string
	UserUUID    string
}

func AppEnvironmentFromContext

func AppEnvironmentFromContext(ctx context.Context) (*AppEnvironment, bool)

func NewAppEnvironment

func NewAppEnvironment(os, arch, projectUuid, userUuid string) *AppEnvironment

type ArtifactConfig added in v0.0.10

type ArtifactConfig struct {
	ArtifactId string `json:"artifactId" yaml:"artifactId"`
	Component  string `json:"component" yaml:"component"`
	Digest     string `json:"digest" yaml:"digest"`
	Registry   string `json:"registry" yaml:"registry"`
	Version    string `json:"version" yaml:"version"`
}

ArtifactConfig defines the structure for release artifacts

type AvsConfig

type AvsConfig struct {
	Address          string `json:"address" yaml:"address"`
	MetadataUri      string `json:"metadata_url" yaml:"metadata_url"`
	AVSPrivateKey    string `json:"avs_private_key" yaml:"avs_private_key"`
	RegistrarAddress string `json:"registrar_address" yaml:"registrar_address"`
}

type ChainConfig

type ChainConfig struct {
	ChainID int         `json:"chain_id" yaml:"chain_id"`
	RPCURL  string      `json:"rpc_url" yaml:"rpc_url"`
	Fork    *ForkConfig `json:"fork,omitempty" yaml:"fork,omitempty"`
}

type ChainContextConfig

type ChainContextConfig struct {
	Name                  string                 `json:"name" yaml:"name"`
	Chains                map[string]ChainConfig `json:"chains" yaml:"chains"`
	Transporter           Transporter            `json:"transporter,omitempty" yaml:"transporter,omitempty"`
	DeployerPrivateKey    string                 `json:"deployer_private_key" yaml:"deployer_private_key"`
	AppDeployerPrivateKey string                 `json:"app_private_key" yaml:"app_private_key"`
	Stakers               []StakerSpec           `json:"stakers" yaml:"stakers"`
	Operators             []OperatorSpec         `json:"operators" yaml:"operators"`
	Avs                   AvsConfig              `json:"avs" yaml:"avs"`
	EigenLayer            *EigenLayerConfig      `json:"eigenlayer" yaml:"eigenlayer"`
	DeployedL1Contracts   []DeployedL1Contracts  `json:"deployed_l1_contracts" yaml:"deployed_l1_contracts"`
	DeployedL2Contracts   []DeployedL2Contracts  `json:"deployed_l2_contracts" yaml:"deployed_l2_contracts"`
	OperatorSets          []OperatorSet          `json:"operator_sets" yaml:"operator_sets"`
	OperatorRegistrations []OperatorRegistration `json:"operator_registrations" yaml:"operator_registrations"`
	Artifact              *ArtifactConfig        `json:"artifact" yaml:"artifact"`
}

type Config

type Config struct {
	Version string      `json:"version" yaml:"version"`
	Config  ConfigBlock `json:"config" yaml:"config"`
}

func LoadBaseConfigYaml

func LoadBaseConfigYaml() (*Config, error)

type ConfigBlock

type ConfigBlock struct {
	Project ProjectConfig `json:"project" yaml:"project"`
}

type ConfigWithContextConfig

type ConfigWithContextConfig struct {
	Config  ConfigBlock                   `json:"config" yaml:"config"`
	Context map[string]ChainContextConfig `json:"context" yaml:"context"`
}

func LoadConfigWithContextConfig

func LoadConfigWithContextConfig(contextName string) (*ConfigWithContextConfig, string, error)

func LoadDefaultConfigWithContextConfig

func LoadDefaultConfigWithContextConfig() (*ConfigWithContextConfig, string, error)

type ContextConfig

type ContextConfig struct {
	Version string             `json:"version" yaml:"version"`
	Context ChainContextConfig `json:"context" yaml:"context"`
}

type ContractCaller

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

ContractCaller provides a high-level interface for interacting with contracts

func NewContractCaller

func NewContractCaller(privateKeyHex string, chainID *big.Int, client *ethclient.Client, allocationManagerAddr, delegationManagerAddr, strategyManagerAddr, keyRegistrarAddr, crossChainRegistryAddr, releaseManagerAddr, certVerifierAddr common.Address, logger iface.Logger) (*ContractCaller, error)

func (*ContractCaller) ConfigureOpSetCurveType added in v0.0.9

func (cc *ContractCaller) ConfigureOpSetCurveType(ctx context.Context, avsAddress common.Address, opSetId uint32, curveType uint8) error

func (*ContractCaller) CreateApprovalSignature added in v0.0.9

func (cc *ContractCaller) CreateApprovalSignature(ctx context.Context, stakerAddress common.Address, operatorAddress common.Address, approverAddress common.Address, approverPrivateKey string, approverSalt [32]byte, expiry *big.Int) (DelegationManager.ISignatureUtilsMixinTypesSignatureWithExpiry, error)

func (*ContractCaller) CreateGenerationReservation added in v0.0.9

func (cc *ContractCaller) CreateGenerationReservation(ctx context.Context, opSetId uint32, operatorTableCalculator common.Address, avsAddress common.Address) error

func (*ContractCaller) CreateOperatorSets

func (cc *ContractCaller) CreateOperatorSets(ctx context.Context, avsAddress common.Address, createSetParams []allocationmanager.IAllocationManagerTypesCreateSetParams) error

func (*ContractCaller) DelegateToOperator added in v0.0.9

func (cc *ContractCaller) DelegateToOperator(ctx context.Context, operatorAddress common.Address, signature DelegationManager.ISignatureUtilsMixinTypesSignatureWithExpiry, approverSalt [32]byte) error

func (*ContractCaller) DepositIntoStrategy added in v0.0.9

func (cc *ContractCaller) DepositIntoStrategy(ctx context.Context, strategyAddress common.Address, amount *big.Int) error

func (*ContractCaller) EncodeBN254KeyData added in v0.0.9

func (cc *ContractCaller) EncodeBN254KeyData(pubKey *bn254.PublicKey) ([]byte, error)

func (*ContractCaller) GetBN254OperatorSetOwner

func (cc *ContractCaller) GetBN254OperatorSetOwner(
	ctx context.Context,
	avsAddress common.Address,
	operatorSetId uint32,
) (common.Address, error)

func (*ContractCaller) GetECDSAOperatorSetOwner

func (cc *ContractCaller) GetECDSAOperatorSetOwner(
	ctx context.Context,
	avsAddress common.Address,
	operatorSetId uint32,
) (common.Address, error)

func (*ContractCaller) GetOperatorRegistrationMessageHash added in v0.0.9

func (cc *ContractCaller) GetOperatorRegistrationMessageHash(
	ctx context.Context,
	operatorAddress common.Address,
	avsAddress common.Address,
	operatorSetId uint32,
	keyData []byte,
) ([32]byte, error)

func (*ContractCaller) GetRegistry added in v0.0.9

func (cc *ContractCaller) GetRegistry() *contracts.ContractRegistry

GetRegistry returns the contract registry for external access

func (*ContractCaller) GetReleaseMetadataUri

func (cc *ContractCaller) GetReleaseMetadataUri(avsAddress common.Address, operatorSetId uint32) (string, error)

func (*ContractCaller) ModifyAllocations added in v0.0.9

func (cc *ContractCaller) ModifyAllocations(ctx context.Context, operatorAddress common.Address, operatorPrivateKey string, strategies []common.Address, newMagnitudes []uint64, avsAddress common.Address, opSetId uint32, logger iface.Logger) error

func (*ContractCaller) PackUint256Pair

func (cc *ContractCaller) PackUint256Pair(x, y *big.Int) ([]byte, error)

abi.encode(uint256 x, uint256 y)

func (*ContractCaller) PublishRelease added in v0.0.10

func (cc *ContractCaller) PublishRelease(ctx context.Context, avsAddress common.Address, artifacts []releasemanager.IReleaseManagerTypesArtifact, operatorSetId uint32, upgradeByTime uint32) error

func (*ContractCaller) RegisterAsOperator

func (cc *ContractCaller) RegisterAsOperator(ctx context.Context, operatorAddress common.Address, allocationDelay uint32, metadataURI string) error

func (*ContractCaller) RegisterForOperatorSets

func (cc *ContractCaller) RegisterForOperatorSets(ctx context.Context, operatorAddress, avsAddress common.Address, operatorSetIDs []uint32, payload []byte) error

func (*ContractCaller) RegisterKeyInKeyRegistrar added in v0.0.9

func (cc *ContractCaller) RegisterKeyInKeyRegistrar(
	ctx context.Context,
	operatorAddress common.Address,
	avsAddress common.Address,
	opSetId uint32,
	keyData []byte,
	signature []byte,
) error

func (*ContractCaller) RegisterStrategiesFromConfig added in v0.0.9

func (cc *ContractCaller) RegisterStrategiesFromConfig(cfg *OperatorSpec) error

RegisterStrategiesFromConfig registers all strategy contracts found in the configuration

func (*ContractCaller) RegisterTokensFromStrategies added in v0.0.9

func (cc *ContractCaller) RegisterTokensFromStrategies(cfg *OperatorSpec) error

RegisterTokensFromStrategies registers all underlying token contracts from strategies

func (*ContractCaller) SendAndWaitForTransaction

func (cc *ContractCaller) SendAndWaitForTransaction(
	ctx context.Context,
	txDescription string,
	fn func() (*types.Transaction, error),
) error

func (*ContractCaller) SetAVSRegistrar

func (cc *ContractCaller) SetAVSRegistrar(ctx context.Context, avsAddress, registrarAddress common.Address) error

SetAVSRegistrar sets the registrar address for an AVS

func (*ContractCaller) SetReleaseMetadata

func (cc *ContractCaller) SetReleaseMetadata(
	ctx context.Context,
	metadataUri string,
	avsAddress common.Address,
	operatorSetId uint32,
) error

func (*ContractCaller) UpdateAVSMetadata

func (cc *ContractCaller) UpdateAVSMetadata(ctx context.Context, avsAddress common.Address, metadataURI string) error

func (*ContractCaller) WhitelistChainIdInCrossRegistry added in v0.0.9

func (cc *ContractCaller) WhitelistChainIdInCrossRegistry(ctx context.Context, operatorTableUpdater common.Address, chainId uint64) error

type CurveType added in v0.0.10

type CurveType string

CurveType represents the cryptographic curve type for operator sets

const (
	UnknownCurve CurveType = "UNKNOWN"
	BN254Curve   CurveType = "BN254"
	ECDSACurve   CurveType = "ECDSA"
)

type DeployedL1Contracts added in v0.0.10

type DeployedL1Contracts struct {
	Name    string `json:"name" yaml:"name"`
	Address string `json:"address" yaml:"address"`
	Abi     string `json:"abi" yaml:"abi"`
}

type DeployedL2Contracts added in v0.0.10

type DeployedL2Contracts struct {
	Name    string `json:"name" yaml:"name"`
	Address string `json:"address" yaml:"address"`
	Abi     string `json:"abi" yaml:"abi"`
}

type EigenLayerConfig

type EigenLayerConfig struct {
	L1 EigenLayerL1Config `json:"l1" yaml:"l1"`
	L2 EigenLayerL2Config `json:"l2" yaml:"l2"`
}

type EigenLayerL1Config added in v0.0.9

type EigenLayerL1Config struct {
	AllocationManager    string `json:"allocation_manager" yaml:"allocation_manager"`
	DelegationManager    string `json:"delegation_manager" yaml:"delegation_manager"`
	StrategyManager      string `json:"strategy_manager" yaml:"strategy_manager"`
	BN254TableCalculator string `json:"bn254_table_calculator" yaml:"bn254_table_calculator"`
	ECDSATableCalculator string `json:"ecdsa_table_calculator" yaml:"ecdsa_table_calculator"`
	CrossChainRegistry   string `json:"cross_chain_registry" yaml:"cross_chain_registry"`
	KeyRegistrar         string `json:"key_registrar" yaml:"key_registrar"`
	ReleaseManager       string `json:"release_manager" yaml:"release_manager"`
	OperatorTableUpdater string `json:"operator_table_updater" yaml:"operator_table_updater"`
	TaskMailbox          string `json:"task_mailbox" yaml:"task_mailbox"`
	PermissionController string `json:"permission_controller" yaml:"permission_controller"`
}

type EigenLayerL2Config added in v0.0.9

type EigenLayerL2Config struct {
	BN254CertificateVerifier string `json:"bn254_certificate_verifier" yaml:"bn254_certificate_verifier"`
	ECDSACertificateVerifier string `json:"ecdsa_certificate_verifier" yaml:"ecdsa_certificate_verifier"`
	OperatorTableUpdater     string `json:"operator_table_updater" yaml:"operator_table_updater"`
	TaskMailbox              string `json:"task_mailbox" yaml:"task_mailbox"`
}

type ForkConfig

type ForkConfig struct {
	Url       string `json:"url" yaml:"url"`
	Block     int    `json:"block" yaml:"block"`
	BlockTime int    `json:"block_time" yaml:"block_time"`
}

type GlobalConfig

type GlobalConfig struct {
	// FirstRun tracks if this is the user's first time running devkit
	FirstRun bool `yaml:"first_run"`
	// TelemetryEnabled stores the user's global telemetry preference
	TelemetryEnabled *bool `yaml:"telemetry_enabled,omitempty"`
	// The users uuid to identify user across projects
	UserUUID string `yaml:"user_uuid"`
}

GlobalConfig contains user-level configuration that persists across all devkit usage

func LoadGlobalConfig

func LoadGlobalConfig() (*GlobalConfig, error)

LoadGlobalConfig loads the global configuration, creating defaults if needed

type HandlerFunc

type HandlerFunc func(node *yaml.Node, last bool, val string) (*yaml.Node, error)

HandlerFunc defines operations on a YAML node

type L1ZeusAddressData added in v0.0.10

type L1ZeusAddressData struct {
	AllocationManager    string `json:"allocationManager"`
	DelegationManager    string `json:"delegationManager"`
	StrategyManager      string `json:"strategyManager"`
	CrossChainRegistry   string `json:"crossChainRegistry"`
	KeyRegistrar         string `json:"keyRegistrar"`
	ReleaseManager       string `json:"releaseManager"`
	OperatorTableUpdater string `json:"operatorTableUpdater"`
	TaskMailbox          string `json:"taskMailbox"`
	PermissionController string `json:"permissionController"`
}

L1ZeusAddressData represents the addresses returned by zeus list command

type L2ZeusAddressData added in v0.0.10

type L2ZeusAddressData struct {
	OperatorTableUpdater     string `json:"operatorTableUpdater"`
	ECDSACertificateVerifier string `json:"ecdsaCertificateVerifier"`
	BN254CertificateVerifier string `json:"bn254CertificateVerifier"`
	TaskMailbox              string `json:"taskMailbox"`
}

type OperatorAllocation added in v0.0.9

type OperatorAllocation struct {
	StrategyAddress        string                  `json:"strategy_address" yaml:"strategy_address"`
	Name                   string                  `json:"name" yaml:"name"`
	OperatorSetAllocations []OperatorSetAllocation `json:"operator_set_allocations" yaml:"operator_set_allocations"`
}

OperatorAllocation defines strategy allocation for an operator

type OperatorKeystores

type OperatorKeystores struct {
	AVSAddress            string `json:"avs,omitempty" yaml:"avs,omitempty"`
	OperatorSet           uint64 `json:"operatorSet,omitempty" yaml:"operatorSet,omitempty"`
	ECDSAKeystorePath     string `json:"ecdsa_keystore_path,omitempty" yaml:"ecdsa_keystore_path,omitempty"`
	ECDSAKeystorePassword string `json:"ecdsa_keystore_password,omitempty" yaml:"ecdsa_keystore_password,omitempty"`
	BlsKeystorePath       string `json:"bls_keystore_path" yaml:"bls_keystore_path"`
	BlsKeystorePassword   string `json:"bls_keystore_password" yaml:"bls_keystore_password"`
}

OperatorKeystore defines keystore data available to an operator

type OperatorRegistration

type OperatorRegistration struct {
	Address       string `json:"address" yaml:"address"`
	OperatorSetID uint64 `json:"operator_set_id" yaml:"operator_set_id"`
	Payload       string `json:"payload" yaml:"payload"`
}

type OperatorSet

type OperatorSet struct {
	OperatorSetID uint64     `json:"operator_set_id" yaml:"operator_set_id"`
	Strategies    []Strategy `json:"strategies" yaml:"strategies"`
	CurveType     CurveType  `json:"curve_type" yaml:"curve_type"`
}

type OperatorSetAllocation added in v0.0.9

type OperatorSetAllocation struct {
	OperatorSet      string `json:"operator_set" yaml:"operator_set"`
	AllocationInWads string `json:"allocation_in_wads" yaml:"allocation_in_wads"`
}

OperatorSetAllocation defines allocation for a specific operator set

type OperatorSpec

type OperatorSpec struct {
	Address     string               `json:"address" yaml:"address"`
	ECDSAKey    string               `json:"ecdsa_key,omitempty" yaml:"ecdsa_key,omitempty"`
	Stake       string               `json:"stake,omitempty" yaml:"stake,omitempty"`
	Keystores   []OperatorKeystores  `json:"keystores,omitempty" yaml:"keystores,omitempty"`
	Allocations []OperatorAllocation `json:"allocations,omitempty" yaml:"allocations,omitempty"`
}

type ProjectConfig

type ProjectConfig struct {
	Name             string `json:"name" yaml:"name"`
	Version          string `json:"version" yaml:"version"`
	Context          string `json:"context" yaml:"context"`
	ProjectUUID      string `json:"project_uuid,omitempty" yaml:"project_uuid,omitempty"`
	TelemetryEnabled bool   `json:"telemetry_enabled" yaml:"telemetry_enabled"`
	TemplateBaseURL  string `json:"templateBaseUrl,omitempty" yaml:"templateBaseUrl,omitempty"`
	TemplateVersion  string `json:"templateVersion,omitempty" yaml:"templateVersion,omitempty"`
	TemplateLanguage string `json:"templatelanguage,omitempty" yaml:"templatelanguage,omitempty"`
}

type ProjectSettings

type ProjectSettings struct {
	ProjectUUID      string `yaml:"project_uuid"`
	TelemetryEnabled bool   `yaml:"telemetry_enabled"`
}

ProjectSettings contains the project-level configuration

func LoadProjectSettings

func LoadProjectSettings() (*ProjectSettings, error)

LoadProjectSettings loads project settings from config.yaml

type ResponseExpectation

type ResponseExpectation int
const (
	ExpectNonJSONResponse ResponseExpectation = iota
	ExpectJSONResponse
)

type StakeRootEntry added in v0.0.9

type StakeRootEntry struct {
	ChainID   uint64 `yaml:"chain_id" json:"chain_id"`
	StakeRoot string `yaml:"stake_root" json:"stake_root"`
}

type StakerDeposits added in v0.0.9

type StakerDeposits struct {
	StrategyAddress string `json:"strategy_address" yaml:"strategy_address"`
	Name            string `json:"name" yaml:"name"`
	DepositAmount   string `json:"deposit_amount" yaml:"deposit_amount"`
}

StakerDeposits defines a deposit to a strategy

type StakerSpec added in v0.0.9

type StakerSpec struct {
	StakerAddress   string           `json:"address" yaml:"address"`
	StakerECDSAKey  string           `json:"ecdsa_key" yaml:"ecdsa_key"`
	Deposits        []StakerDeposits `json:"deposits" yaml:"deposits"`
	OperatorAddress string           `json:"operator" yaml:"operator"`
}

StakerSpec defines a staker configuration with address, key, and deposits

type Strategy

type Strategy struct {
	StrategyAddress string `json:"strategy" yaml:"strategy"`
}

type TelemetryPromptOptions

type TelemetryPromptOptions struct {
	// EnableTelemetry automatically enables telemetry without prompting (for --enable-telemetry flag)
	EnableTelemetry bool
	// DisableTelemetry automatically disables telemetry without prompting (for --disable-telemetry flag)
	DisableTelemetry bool
	// SkipPromptInCI skips the prompt in CI environments (defaults to disabled)
	SkipPromptInCI bool
}

TelemetryPromptOptions controls how the telemetry prompt behaves

type Transporter added in v0.0.9

type Transporter struct {
	Schedule         string           `json:"schedule" yaml:"schedule"`
	PrivateKey       string           `json:"private_key" yaml:"private_key"`
	BlsPrivateKey    string           `json:"bls_private_key" yaml:"bls_private_key"`
	ActiveStakeRoots []StakeRootEntry `json:"active_stake_roots,omitempty" yaml:"active_stake_roots,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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