contracts

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NameAVS                = "avs"
	NameCreate3Factory     = "create3-factory"
	NameGasPump            = "gas-pump"
	NameGasStation         = "gas-station"
	NameL1Bridge           = "l1-bridge"
	NamePortal             = "portal"
	NameToken              = "token"
	NameSolverNetInbox     = "solvernet-inbox"
	NameSolverNetOutbox    = "solvernet-outbox"
	NameSolverNetMiddleman = "solvernet-middleman"
	NameSovlerNetExecutor  = "solvernet-executor"
	NameFeeOracleV2        = "fee-oracle-v2"
)

Variables

This section is empty.

Functions

func Avs added in v0.13.0

func Avs(network netconf.ID) common.Address

Avs returns the AVS contract address for the given network.

func Create3Address added in v0.13.0

func Create3Address(network netconf.ID, salt string) common.Address

Create3Address returns the Create3 address for the given network and salt.

func Create3Factory added in v0.3.0

func Create3Factory(network netconf.ID) common.Address

Create3Factory returns the Create3 factory address for the given network.

func IsDeployed added in v0.13.0

func IsDeployed(ctx context.Context, client ethclient.Client, addr common.Address) (bool, error)

func IsEmptyAddress added in v0.10.0

func IsEmptyAddress(addr common.Address) bool

func PackInitCode

func PackInitCode(abi *abi.ABI, bytecodeHex string, params ...any) ([]byte, error)

PackInitCode packs the init code for a contract deployment.

func StagingID added in v0.13.0

func StagingID(ctx context.Context) (string, error)

StagingID returns id for a staing instance (hash of block 1).

func TokenAddr added in v0.13.0

func TokenAddr(network netconf.ID) common.Address

TokenAddr returns the Omni ERC20 token contract address for the given network.

func UseStagingOmniRPC

func UseStagingOmniRPC(rpc string)

UseStagingOmniRPC overrides the default staging Omni EVM RPC URL.

Types

type Addresses

type Addresses struct {
	AVS                common.Address
	Create3Factory     common.Address
	GasPump            common.Address
	GasStation         common.Address
	L1Bridge           common.Address
	Portal             common.Address
	Token              common.Address
	SolverNetInbox     common.Address
	SolverNetOutbox    common.Address
	SolverNetMiddleman common.Address
	SolverNetExecutor  common.Address
	FeeOracleV2        common.Address
}

func GetAddresses

func GetAddresses(ctx context.Context, network netconf.ID) (Addresses, error)

GetAddresses returns the contract addresses for the given network.

type Contract added in v0.11.0

type Contract struct {
	Name               string
	Address            common.Address
	FundThresholds     *FundThresholds
	WithdrawThresholds *WithdrawThresholds
	IsDeployedOn       func(chainID uint64, network netconf.ID) bool
	Tokens             func(chainID uint64, network netconf.ID) []Token
}

Contract defines a contract to monitor.

func ToFund

func ToFund(ctx context.Context, network netconf.ID) ([]Contract, error)

ToFund returns all fundable contracts for the given network.

func ToMonitor added in v0.11.0

func ToMonitor(ctx context.Context, network netconf.ID) ([]Contract, error)

ToMonitor returns all contracts for the given network relevant to the monitor.

type FundThresholds

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

FundThresholds defines the thresholds for funding a contract.

func (FundThresholds) MinBalance

func (t FundThresholds) MinBalance() *big.Int

MinBalance returns the minimum balance required for funding a contract.

func (FundThresholds) TargetBalance

func (t FundThresholds) TargetBalance() *big.Int

TargetBalance returns the target balance to fund a contract to.

type Salts

type Salts struct {
	AVS                string
	GasPump            string
	GasStation         string
	L1Bridge           string
	Portal             string
	Token              string
	SolverNetInbox     string
	SolverNetOutbox    string
	SolverNetMiddleman string
	SolverNetExecutor  string
	FeeOracleV2        string
}

func GetSalts

func GetSalts(ctx context.Context, network netconf.ID) (Salts, error)

GetSalts returns the contract salts for the given network.

type Token added in v0.1.9

type Token struct {
	Symbol  string
	Address common.Address
}

type Versions added in v0.13.0

type Versions struct {
	Core      string
	SolverNet string
}

type WithdrawThresholds added in v0.11.0

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

WithdrawThresholds defines the thresholds for withdrawing from a contract.

func (WithdrawThresholds) MaxBalance added in v0.11.0

func (t WithdrawThresholds) MaxBalance() *big.Int

MaxBalance returns the max balance a contract can have before a withdrawal.

Jump to

Keyboard shortcuts

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