devnet

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

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 27 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 = "0x42583067658071247ec8CE0A516A58f682002d07"

These are fallback EigenLayer deployment addresses when not specified in context

View Source
const ANVIL_1_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
View Source
const ANVIL_2_KEY = "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
View Source
const BN254_TABLE_CALCULATOR_ADDRESS = "0xc2c0bc13571aC5115709C332dc7AE666606b08E8"
View Source
const B_EIGEN_TOKEN_ADDRESS = "0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27"
View Source
const CROSS_CHAIN_REGISTRY_ADDRESS = "0xe850D8A178777b483D37fD492a476e3E6004C816"
View Source
const CURVE_TYPE_KEY_REGISTRAR_BN254 = 2
View Source
const CURVE_TYPE_KEY_REGISTRAR_ECDSA = 1
View Source
const CURVE_TYPE_KEY_REGISTRAR_UNKNOWN = 0

Curve type constants for KeyRegistrar

View Source
const DEFAULT_L1_ANVIL_CHAINID = 31337
View Source
const DEFAULT_L1_ANVIL_RPCURL = "http://localhost:8545"
View Source
const DEFAULT_L1_FORK_URL = "https://rpc.sepolia.ethpandaops.io"
View Source
const DEFAULT_L2_ANVIL_CHAINID = 31338
View Source
const DEFAULT_L2_ANVIL_RPCURL = "http://localhost:9545"
View Source
const DEFAULT_L2_FORK_URL = "https://base-sepolia.gateway.tenderly.co"
View Source
const DELEGATION_MANAGER_ADDRESS = "0xD4A7E1Bd8015057293f0D0A557088c286942e84b"
View Source
const DEVNET_CONTEXT = "devnet"
View Source
const EIGEN_CONTRACT_ADDRESS = "0x3B78576F7D6837500bA3De27A60c7f594934027E"
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 KEY_REGISTRAR_ADDRESS = "0x78De554Ac8DfF368e3CAa73B3Df8AccCfD92928A"
View Source
const L1_CHAIN_ARGS = "--gas-limit 140000000 --base-fee 0 --gas-price 1000000 --no-rate-limit"
View Source
const L1_CONTAINER_NAME_PREFIX = "devkit-devnet-l1-"
View Source
const L1_CONTAINER_TYPE = "l1"
View Source
const L2_CHAIN_ARGS = "--gas-limit 140000000 --base-fee 0 --gas-price 1000000 --no-rate-limit"
View Source
const L2_CONTAINER_NAME_PREFIX = "devkit-devnet-l2-"
View Source
const L2_CONTAINER_TYPE = "l2"
View Source
const MULTICHAIN_PROXY_ADMIN = "0xC5dc0d145a21FDAD791Df8eDC7EbCB5330A3FdB5"
View Source
const RELEASE_MANAGER_ADDRESS = "0xd9Cb89F1993292dEC2F973934bC63B0f2A702776"
View Source
const STRATEGY_MANAGER_ADDRESS = "0x2E3D6c0744b10eb0A4e6F679F71554a39Ec47a5D"
View Source
const STRATEGY_TOKEN_FUNDING_AMOUNT_BY_LARGE_HOLDER_IN_ETH = 1000
View Source
const ST_ETH_TOKEN_ADDRESS = "0x00c71b0fCadE911B2feeE9912DE4Fe19eB04ca56"

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 Sepolia token holders with large balances - mapped by token address

Functions

func AdvanceBlocks added in v0.0.10

func AdvanceBlocks(ctx *cli.Context, l1RpcUrl string, numBlocks uint64) error

func AdvanceBlocksToTS added in v0.0.10

func AdvanceBlocksToTS(client *rpc.Client, name string, fromTS, toTS uint64) error

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 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 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 GetL1DevnetChainArgsOrDefault added in v0.0.10

func GetL1DevnetChainArgsOrDefault(cfg *common.ConfigWithContextConfig) string

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

func GetL1Port added in v0.0.10

func GetL1Port(basePort int) int

GetL1Port returns the L1 devnet port (default port + 0)

func GetL1RPCURL added in v0.0.10

func GetL1RPCURL(basePort int) string

GetL1RPCURL returns the L1 RPC URL for the given port

func GetL2BlockByNumber added in v0.0.10

func GetL2BlockByNumber(ctx *cli.Context, l2RpcUrl string, blockNumber uint64, logger iface.Logger) (string, error)

GetL2BlockByNumber retrieves the timestamp of a specific L2 block by its number.

func GetL2DevnetChainArgsOrDefault added in v0.0.10

func GetL2DevnetChainArgsOrDefault(cfg *common.ConfigWithContextConfig) string

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

func GetL2Port added in v0.0.10

func GetL2Port(basePort int) int

GetL2Port returns the L2 devnet port (default port + 1)

func GetL2RPCURL added in v0.0.10

func GetL2RPCURL(basePort int) string

GetL2RPCURL returns the L2 RPC URL for the given port

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 GetTimestamp added in v0.0.10

func GetTimestamp(client *rpc.Client, name string) (uint64, error)

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(cCtx *cli.Context, containerName string)

/ Stops the container and removes it

func SyncL1L2Timestamps added in v0.0.10

func SyncL1L2Timestamps(ctx *cli.Context, l1RpcUrl string, l2RpcUrl string) error

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