common

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BridgeAddress = gethcommon.BytesToAddress(gethcommon.Hex2Bytes(bridgeAddr))

BridgeAddress - address of the virtual bridge

HOCContract - address of the deployed "hocus" erc20 on the L2

View Source
var HOCOwner, _ = crypto.HexToECDSA(hocOwnerKeyHex)

POCContract - address of the deployed "pocus" erc20 on the L2

View Source
var POCOwner, _ = crypto.HexToECDSA(pocOwnerKeyHex)

Functions

func AwaitReceipt

func AwaitReceipt(ctx context.Context, client *obsclient.AuthObsClient, txHash gethcommon.Hash, timeout time.Duration) error

AwaitReceipt blocks until the receipt for the transaction with the given hash has been received. Errors if the transaction is unsuccessful or times out.

func AwaitReceiptEth

func AwaitReceiptEth(ctx context.Context, client *ethclient.Client, txHash gethcommon.Hash, timeout time.Duration) (*types.Receipt, error)

func DefaultEnclaveConfig added in v0.21.0

func DefaultEnclaveConfig() *config.EnclaveConfig

DefaultEnclaveConfig returns an EnclaveConfig with default values.

func InteractWithSmartContract

func InteractWithSmartContract(client *ethclient.Client, wallet wallet.Wallet, contractAbi abi.ABI, methodName string, methodParam string, contractAddress gethcommon.Address) (*types.Receipt, error)

func PrefundWallets

func PrefundWallets(ctx context.Context, faucetWallet wallet.Wallet, faucetClient *obsclient.AuthObsClient, startingNonce uint64, wallets []wallet.Wallet, alloc *big.Int, timeout time.Duration)

PrefundWallets sends an amount `alloc` from the faucet wallet to each listed wallet. The transactions are sent with sequential nonces, starting with `startingNonce`.

func RndBtw

func RndBtw(min uint64, max uint64) uint64

func RndBtwTime

func RndBtwTime(min time.Duration, max time.Duration) time.Duration

Types

type ERC20

type ERC20 string

ERC20 - the supported ERC20 tokens. A list of made-up tokens used for testing.

const (
	HOC     ERC20 = "HOC"
	POC     ERC20 = "POC"
	HOCAddr       = "f3a8bd422097bFdd9B3519Eaeb533393a1c561aC"
)

type ERC20Mapping

type ERC20Mapping struct {
	Name ERC20

	// L1Owner   wallet.Wallet
	L1Address *gethcommon.Address

	Owner     wallet.Wallet // for now the wrapped L2 version is owned by a wallet, but this will change
	L2Address *gethcommon.Address
}

ERC20Mapping - maps an L1 Erc20 to an L2 Erc20 address

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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