ethutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupCreationByteCode

func CleanupCreationByteCode(bytecode string) string

func ConfirmContractDeployed

func ConfirmContractDeployed(
	ctx context.Context,
	client bind.DeployBackend,
	tx *ethTypes.Transaction,
	address common.Address,
) error

func EtherToWei

func EtherToWei(eth *big.Float) *big.Int

func GetByteCodeHash

func GetByteCodeHash(byteCode []byte) (*string, error)

func GetGoBindings

func GetGoBindings(
	abi string,
	pkgName string,
	creationHexByteCode string,
) (*string, error)

func GetNextNonce

func GetNextNonce(
	ethClient *ethclient.Client,
	privateKey *ecdsa.PrivateKey,
) (uint64, error)

func GetTransactOpts

func GetTransactOpts(
	ethClient *ethclient.Client,
	privateKey *ecdsa.PrivateKey,
) (*bind.TransactOpts, error)

func GetTransactOptsWithNonce

func GetTransactOptsWithNonce(
	ethClient *ethclient.Client,
	privateKey *ecdsa.PrivateKey,
	nonce uint64,
) (*bind.TransactOpts, error)

func PullAndStoreSmartContractImmutableData

func PullAndStoreSmartContractImmutableData(
	hexAddress string,
	ethNetwork types.ETHNetwork,
	name string,
	dir string,
	ethereumClientManager *EthereumClientManager,
) error

func TimestampNonce

func TimestampNonce() uint64

func TokenFromFullTokens

func TokenFromFullTokens(amount *big.Float, decimals uint8) *big.Int

func TokenToFullTokens

func TokenToFullTokens(amount *big.Int, decimals uint8) *big.Float

func TransferEth

func TransferEth(
	ethClient *ethclient.Client,
	fromPrivateKey *ecdsa.PrivateKey,
	toAddress common.Address,
	amount *big.Int,
) error

func TransferEthNoWait

func TransferEthNoWait(
	ethClient *ethclient.Client,
	fromPrivateKey *ecdsa.PrivateKey,
	toAddress common.Address,
	amount *big.Int,
) (*ethTypes.Transaction, error)

func TransferEthNoWaitWithNonce

func TransferEthNoWaitWithNonce(
	ethClient *ethclient.Client,
	fromPrivateKey *ecdsa.PrivateKey,
	toAddress common.Address,
	amount *big.Int,
	nonce uint64,
) (*ethTypes.Transaction, error)

func VegaPubKeyToByte32

func VegaPubKeyToByte32(pubKey string) (byte32PubKey [32]byte, err error)

func VegaTokenFromFullTokens

func VegaTokenFromFullTokens(amount *big.Float) *big.Int

func VegaTokenToFullTokens

func VegaTokenToFullTokens(amount *big.Int) *big.Float

func WaitForTransaction

func WaitForTransaction(
	ethClient *ethclient.Client,
	tx *types.Transaction,
	timeout time.Duration,
) error

func WeiToEther

func WeiToEther(wei *big.Int) *big.Float

Types

type EthereumClientManager

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

func NewEthereumClientManager

func NewEthereumClientManager(
	serviceSecrets secrets.ServiceSecretStore,
) *EthereumClientManager

func (*EthereumClientManager) GetEthClient

func (m *EthereumClientManager) GetEthClient(ethNetwork types.ETHNetwork) (*ethclient.Client, error)

func (*EthereumClientManager) GetEthereumURL

func (m *EthereumClientManager) GetEthereumURL(ethNetwork types.ETHNetwork) (string, error)

func (*EthereumClientManager) GetEtherscanClient

func (m *EthereumClientManager) GetEtherscanClient(ethNetwork types.ETHNetwork) (*etherscan.EtherscanClient, error)

type SmartContractImmutableData

type SmartContractImmutableData struct {
	SourceCode          map[string]string
	Name                string
	ByteCode            []byte
	ByteCodeHash        string
	CreationHexByteCode string
	ABI                 string
	GoBindings          string
	DownloadURL         string
}

func PullSmartContractImmutableData

func PullSmartContractImmutableData(
	ethClient *ethclient.Client,
	etherscanClient *etherscan.EtherscanClient,
	name string,
	hexAddress string,
) (*SmartContractImmutableData, error)

type TransactionData

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

func GetNextTransactionData

func GetNextTransactionData(ethClient *ethclient.Client) (*TransactionData, error)

Get post London Fork transaction data

Jump to

Keyboard shortcuts

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