avs

package
v0.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelegateWETH

func DelegateWETH(ctx context.Context, contracts Contracts, backend *ethbackend.Backend, delegator common.Address, amount int64) error

DelegateWETH delegates WETH to the Eigen Layer strategy manager's WETH strategy.

func DeregisterOperatorFromAVS

func DeregisterOperatorFromAVS(ctx context.Context, contracts Contracts, backend *ethbackend.Backend, operator common.Address) error

func RegisterOperatorWithAVS

func RegisterOperatorWithAVS(ctx context.Context, contracts Contracts, backend *ethbackend.Backend, operator common.Address) error

func RegisterOperatorWithEigen

func RegisterOperatorWithEigen(ctx context.Context, avs Contracts, backend *ethbackend.Backend, operator common.Address, metadataURI string) (*ethtypes.Receipt, error)

RegisterOperatorWithEigen registers the operator with the eigen layer delegation manager.

func Undelegate

func Undelegate(ctx context.Context, contracts Contracts, backend *ethbackend.Backend, delegator common.Address) error

Undelegate undelegates WETH from the Eigen Layer strategy manager's WETH strategy.

Types

type Config

type Config struct {
	StrategyParams []StrategyParam `json:"strategyParams"`
	EthStakeInbox  common.Address  `json:"restakedEthInbox"`
}

func DefaultTestAVSConfig

func DefaultTestAVSConfig(eigen EigenDeployments) Config

type Contracts

type Contracts struct {
	OmniAVS           *bindings.OmniAVS
	DelegationManager *bindings.DelegationManager
	StrategyManager   *bindings.StrategyManager
	WETHStrategy      *bindings.StrategyBase
	WETHToken         *bindings.MockERC20
	AVSDirectory      *bindings.AVSDirectory

	OmniAVSAddr           common.Address
	DelegationManagerAddr common.Address
	StrategyManagerAddr   common.Address
	WETHStrategyAddr      common.Address
	WETHTokenAddr         common.Address
	AVSDirectoryAddr      common.Address
}

type Deployer

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

func NewDeployer

func NewDeployer(
	cfg Config,
	eigen EigenDeployments,
	portalAddr common.Address,
	omniChainID uint64,
) *Deployer

func (*Deployer) Contracts

func (d *Deployer) Contracts(backend *ethbackend.Backend) (Contracts, error)

Contracts returns the deployed contracts.

func (*Deployer) Deploy

func (d *Deployer) Deploy(ctx context.Context, backend *ethbackend.Backend, owner common.Address) error

func (*Deployer) ExportDeployInfo

func (d *Deployer) ExportDeployInfo(i types.DeployInfos)

ExportDeployInfo sets the contract addresses in the given DeployInfos.

type EigenDeployments

type EigenDeployments struct {
	AVSDirectory      common.Address `json:"AVSDirectory"`
	DelegationManager common.Address `json:"DelegationManager"`
	StrategyManager   common.Address `json:"StrategyManager"`
	EigenPodManager   common.Address `json:"EigenPodManager"`

	// Strategies maps token symbol to strategy address
	Strategies map[string]common.Address `json:"strategies"`
}

func LoadDeployments

func LoadDeployments(file string) (EigenDeployments, error)

type StrategyParam

type StrategyParam struct {
	Strategy   common.Address `json:"strategy"`
	Multiplier *big.Int       `json:"multiplier"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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