Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNetworkNotFound = errors.New("network not found")
)
View Source
var ( // KnownNetworks is a list of known networks with their deposit contract addresses and deposit network IDs that // contributoor supports. KnownNetworks = []Network{ { Name: NetworkNameMainnet, ID: 1, DepositContractAddress: "0x00000000219ab540356cBB839Cbe05303d7705Fa", DepositChainID: 1, }, { Name: NetworkNameSepolia, ID: 11155111, DepositContractAddress: "0x7f02c3e3c98b133055b8b348b2ac625669ed295d", DepositChainID: 11155111, }, { Name: NetworkNameHolesky, ID: 17000, DepositContractAddress: "0x4242424242424242424242424242424242424242", DepositChainID: 17000, }, { Name: NetworkNameHoodi, ID: 560048, DepositContractAddress: "0x00000000219ab540356cBB839Cbe05303d7705Fa", DepositChainID: 560048, }, } )
Functions ¶
This section is empty.
Types ¶
type Network ¶
type Network struct {
Name NetworkName
ID uint64
DepositContractAddress string
DepositChainID uint64
}
func DeriveFromSpec ¶
DeriveFromSpec derives a network from a spec. If the deposit contract address and chain ID aren't known by contributoor, then it attempts to derive the network name from the CONFIG_NAME. If this CONFIG_NAME is one of our known networks, then we return an error. This ensures that we: - We have safety garauntees for our defined networks - We still support networks that are not in our list of known networks.
func FindByName ¶
func FindByName(name NetworkName) (*Network, error)
FindByName returns a network with the given name or an error if not found.
type NetworkName ¶
type NetworkName string
var ( NetworkNameUnknown NetworkName = "unknown" NetworkNameMainnet NetworkName = "mainnet" NetworkNameSepolia NetworkName = "sepolia" NetworkNameHolesky NetworkName = "holesky" NetworkNameHoodi NetworkName = "hoodi" )
Click to show internal directories.
Click to hide internal directories.