devnet

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Blue   = "\033[34m"
	Cyan   = "\033[36m"
	Green  = "\033[32m"
	Yellow = "\033[33m"
	Reset  = "\033[0m"
)
View Source
const ALLOCATION_DELAY_INFO_SLOT = 155

Ref https://github.com/Layr-Labs/eigenlayer-contracts/blob/c08c9e849c27910f36f3ab746f3663a18838067f/src/contracts/core/AllocationManagerStorage.sol#L63

View Source
const ALLOCATION_MANAGER_ADDRESS = "0xFdD5749e11977D60850E06bF5B13221Ad95eb6B4"

These are fallback EigenLayer deployment addresses when not specified in context

View Source
const ANVIL_1_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
View Source
const BN254_TABLE_CALCULATOR_ADDRESS = "0x033af59c1b030Cc6eEE07B150FD97668497dc74b"
View Source
const B_EIGEN_TOKEN_ADDRESS = "0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27"
View Source
const CHAIN_ARGS = "--gas-limit 140000000 --base-fee 0 --gas-price 1000000"
View Source
const CROSS_CHAIN_REGISTRY_ADDRESS = "0x0022d2014901F2AFBF5610dDFcd26afe2a65Ca6F"
View Source
const CURVE_TYPE_KEY_REGISTRAR_BN254 = 2
View Source
const DELEGATION_MANAGER_ADDRESS = "0x75dfE5B44C2E530568001400D3f704bC8AE350CC"
View Source
const DEVNET_CONTEXT = "devnet"
View Source
const FOUNDRY_IMAGE = "ghcr.io/foundry-rs/foundry:stable"

Foundry Image Date : 21 April 2025

View Source
const FUND_VALUE = "1000000000000000000"
View Source
const HOLESKY_EIGEN_CONTRACT_ADDRESS = "0x3B78576F7D6837500bA3De27A60c7f594934027E"
View Source
const KEY_REGISTRAR_ADDRESS = "0x1C84Bb62fE7791e173014A879C706445fa893BbE"
View Source
const L1 = "l1"
View Source
const MULTICHAIN_PROXY_ADMIN = "0xC5dc0d145a21FDAD791Df8eDC7EbCB5330A3FdB5"
View Source
const STRATEGY_MANAGER_ADDRESS = "0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6"
View Source
const STRATEGY_TOKEN_FUNDING_AMOUNT_BY_LARGE_HOLDER_IN_ETH = 1000
View Source
const ST_ETH_TOKEN_ADDRESS = "0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034"

Variables

View Source
var DefaultTokenHolders = map[common.Address]TokenFunding{
	common.HexToAddress(ST_ETH_TOKEN_ADDRESS): {
		TokenName:     "stETH",
		HolderAddress: common.HexToAddress("0xC8088abD2FdaF4819230EB0FdA2D9766FDF9F409"),
		Amount:        new(big.Int).Mul(big.NewInt(STRATEGY_TOKEN_FUNDING_AMOUNT_BY_LARGE_HOLDER_IN_ETH), big.NewInt(1e18)),
	},
	common.HexToAddress(B_EIGEN_TOKEN_ADDRESS): {
		TokenName:     "bEIGEN",
		HolderAddress: common.HexToAddress("0x5f8C207382426D3f7F248E6321Cf93B34e66d6b9"),
		Amount:        new(big.Int).Mul(big.NewInt(STRATEGY_TOKEN_FUNDING_AMOUNT_BY_LARGE_HOLDER_IN_ETH), big.NewInt(1e18)),
	},
}

Common holesky token holders with large balances - mapped by token address

Functions

func EnsureDockerHost

func EnsureDockerHost(inputUrl string) string

EnsureDockerHost replaces localhost/127.0.0.1 in URLs with the appropriate Docker host. Only replaces when localhost/127.0.0.1 are the actual hostname, not substrings. This ensures URLs work correctly when passed to Docker containers across platforms.

func FileExistsInRoot

func FileExistsInRoot(filename string) bool

func FundStakerWithTokens added in v0.0.9

func FundStakerWithTokens(ctx context.Context, ethClient *ethclient.Client, rpcClient *rpc.Client, stakerAddress common.Address, tokenFunding TokenFunding, tokenAddress common.Address, rpcURL string) error

FundStakerWithTokens funds staker with strategy tokens using impersonation

func FundStakersWithStrategyTokens added in v0.0.9

func FundStakersWithStrategyTokens(cfg *devkitcommon.ConfigWithContextConfig, rpcURL string, tokenAddresses []string) error

FundStakersWithStrategyTokens funds all stakers with the specified strategy tokens

func FundWalletsDevnet

func FundWalletsDevnet(cfg *devkitcommon.ConfigWithContextConfig, rpcURL string) error

FundWallets sends ETH to a list of addresses Only funds wallets with balance < 0.3 ether.

func GetDevnetBlockTimeOrDefault

func GetDevnetBlockTimeOrDefault(cfg *common.ConfigWithContextConfig, chainName string) (int, error)

func GetDevnetChainArgsOrDefault

func GetDevnetChainArgsOrDefault(cfg *common.ConfigWithContextConfig) string

GetDevnetChainArgsOrDefault extracts and formats the chain arguments for devnet. Falls back to CHAIN_ARGS constant if value is empty.

func GetDevnetChainIdOrDefault

func GetDevnetChainIdOrDefault(cfg *common.ConfigWithContextConfig, chainName string, logger iface.Logger) (int, error)

func GetDevnetChainImageOrDefault

func GetDevnetChainImageOrDefault(cfg *common.ConfigWithContextConfig) string

GetDevnetChainImageOrDefault returns the devnet chain image, falling back to FOUNDRY_IMAGE if not provided.

func GetDevnetForkUrlDefault

func GetDevnetForkUrlDefault(cfg *common.ConfigWithContextConfig, chainName string) (string, error)

func GetDevnetRPCUrlDefault added in v0.0.9

func GetDevnetRPCUrlDefault(cfg *common.ConfigWithContextConfig, chainName string) (string, error)

func GetDockerHost

func GetDockerHost() string

GetDockerHost returns the appropriate Docker host based on environment and platform. Uses DOCKERS_HOST environment variable if set, otherwise detects OS: - Linux: defaults to 172.17.0.1 (Docker containers can access host via localhost) - macOS/Windows: defaults to host.docker.internal (required for Docker Desktop)

func GetDockerPsDevnetArgs

func GetDockerPsDevnetArgs() []string

GetDockerPsDevnetArgs returns the arguments needed to list all running devkit devnet Docker containers along with their exposed ports. It filters containers by name prefix ("devkit-devnet") and formats the output to show container name and port mappings in a readable form.

func GetEigenLayerAddresses

func GetEigenLayerAddresses(cfg *common.ConfigWithContextConfig) (allocationManager, delegationManager string, strategyManager string, keyRegistrar string, crossChainRegistry string, bn254TableCalculator string)

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

func GetRPCURL

func GetRPCURL(port int) string

GetRPCURL returns the RPC URL for accessing the devnet container from the host. This should always use localhost since it's for host→container communication

func GetUnderlyingTokenAddressesFromStrategies added in v0.0.9

func GetUnderlyingTokenAddressesFromStrategies(cfg *devkitcommon.ConfigWithContextConfig, rpcURL string, logger iface.Logger) ([]string, error)

GetUnderlyingTokenAddressesFromStrategies extracts all unique underlying token addresses from strategy contracts

func IsPortAvailable

func IsPortAvailable(port int) bool

IsPortAvailable checks if a TCP port is not already bound by another service.

func StopAndRemoveContainer

func StopAndRemoveContainer(ctx *cli.Context, containerName string)

/ Stops the container and removes it

func WriteEmbeddedArtifacts

func WriteEmbeddedArtifacts() (composePath string)

WriteEmbeddedArtifacts writes the embedded docker-compose.yaml. Returns the paths to the written files.

Types

type TokenFunding added in v0.0.9

type TokenFunding struct {
	TokenName     string         `json:"token_name"`
	HolderAddress common.Address `json:"holder_address"`
	Amount        *big.Int       `json:"amount"`
}

TokenFunding represents a token transfer configuration

Jump to

Keyboard shortcuts

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