foundry

package
v9.0.0-...-e599657 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSignature

func AddSignature(cmd []string, signature string) []string

Add signature function to cmd, if present

func DefaultEthereumAnvilChainConfig

func DefaultEthereumAnvilChainConfig(
	name string,
) ibc.ChainConfig

func GetConfigFilePath

func GetConfigFilePath(configFile, localContractRootDir, solidityContractDir string) string

func ReadAndAppendConfigFile

func ReadAndAppendConfigFile(cmd []string, configFile, localContractRootDir, solidityContractDir string) ([]string, []byte, error)

ReadAndAppendConfigFile, returns the cmd, configFileBz

func WriteConfigFile

func WriteConfigFile(configFile string, localContractRootDir string, solidityContractDir string, configFileBz []byte) error

WriteConfigFile - if config file is present, we need to overwrite what forge changed

Types

type AnvilChain

type AnvilChain struct {
	*ethereum.EthereumChain
	// contains filtered or unexported fields
}

func NewAnvilChain

func NewAnvilChain(testName string, chainConfig ibc.ChainConfig, log *zap.Logger) *AnvilChain

func (*AnvilChain) AddKey

func (c *AnvilChain) AddKey(cmd []string, keyName string) []string

Add private-key or keystore to cmd

func (*AnvilChain) BuildWallet

func (c *AnvilChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)

func (*AnvilChain) CreateKey

func (c *AnvilChain) CreateKey(ctx context.Context, keyName string) error

func (*AnvilChain) ForgeScript

func (c *AnvilChain) ForgeScript(ctx context.Context, keyName string, opts ForgeScriptOpts) (stdout, stderr []byte, err error)

Run "forge script" see: https://book.getfoundry.sh/reference/forge/forge-script

func (*AnvilChain) GetAddress

func (c *AnvilChain) GetAddress(ctx context.Context, keyName string) ([]byte, error)

Get address of account, cast to a string to use

func (*AnvilChain) KeystoreDir

func (c *AnvilChain) KeystoreDir() string

func (*AnvilChain) MakeKeystoreDir

func (c *AnvilChain) MakeKeystoreDir(ctx context.Context) error

func (*AnvilChain) RecoverKey

func (c *AnvilChain) RecoverKey(ctx context.Context, keyName, mnemonic string) error

func (*AnvilChain) SendFunds

func (c *AnvilChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error

func (*AnvilChain) SendFundsWithNote

func (c *AnvilChain) SendFundsWithNote(ctx context.Context, keyName string, amount ibc.WalletAmount, note string) (string, error)

func (*AnvilChain) Start

func (c *AnvilChain) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error

type ForgeScriptOpts

type ForgeScriptOpts struct {
	ContractRootDir  string   // required, root directory of the contract with all local dependencies
	SolidityContract string   // required, contract script to run
	SignatureFn      string   // optional, signature function to run, empty string uses default run()
	ConfigFile       string   // optional, json config file used for sol contract
	RawOptions       []string // optional, appends additional options to command
}

cli options for the `forge script` command see: https://book.getfoundry.sh/reference/forge/forge-script

type NewWalletOutput

type NewWalletOutput struct {
	Address string `json:"address"`
	Path    string `json:"path"`
}

type NodeWallet

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

type TransactionReceipt

type TransactionReceipt struct {
	TxHash string `json:"transactionHash"`
}

Jump to

Keyboard shortcuts

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