ether

package
v0.10.14 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AddressPreimagePrefix is the byte prefix of address preimages
	// in Geth's database.
	AddressPreimagePrefix = []byte("addr-preimage-")

	// ErrStopIteration will stop iterators early when returned from the
	// iterator's callback.
	ErrStopIteration = errors.New("iteration stopped")

	// MintTopic is the topic for mint events on OVM ETH.
	MintTopic = common.HexToHash("0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885")
)
View Source
var (
	// OVMETHAddress is the address of the OVM ETH predeploy.
	OVMETHAddress = common.HexToAddress("0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000")
)

Functions

func CalcAllowanceStorageKey

func CalcAllowanceStorageKey(owner common.Address, spender common.Address) common.Hash

CalcAllowanceStorageKey calculates the storage key of an allowance in OVM ETH.

func CalcOVMETHStorageKey

func CalcOVMETHStorageKey(addr common.Address) common.Hash

CalcOVMETHStorageKey calculates the storage key of an OVM ETH balance.

func CalcStorageKey

func CalcStorageKey(a, b BytesBacked) common.Hash

CalcStorageKey is a helper method to calculate storage keys.

func GetOVMETHTotalSupplySlot added in v0.10.4

func GetOVMETHTotalSupplySlot() common.Hash

func IterateAddrList

func IterateAddrList(r io.Reader, cb AddressCB) error

IterateAddrList iterates over each address in an address list, calling the callback with the address.

func IterateAllowanceList

func IterateAllowanceList(r io.Reader, cb AllowanceCB) error

IterateAllowanceList iterates over each address in an allowance list, calling the callback with the owner and the spender.

func IterateDBAddresses

func IterateDBAddresses(db ethdb.Database, cb AddressCB) error

IterateDBAddresses iterates over each address in Geth's address preimage database, calling the callback with the address.

func IterateMintEvents

func IterateMintEvents(db ethdb.Database, headNum uint64, cb AddressCBWithHead) error

IterateMintEvents iterates over each mint event in the database starting from head and stopping at genesis.

func MigrateLegacyETH

func MigrateLegacyETH(db *state.StateDB, addresses []common.Address, chainID int, noCheck bool) error

func MustOpenDB

func MustOpenDB(dataDir string) ethdb.Database

MustOpenDB opens a Geth database, or panics. Note that the database must be opened with a freezer in order to properly read historical data.

func MustOpenDBWithCacheOpts

func MustOpenDBWithCacheOpts(dataDir string, cacheSize, handles int) ethdb.Database

MustOpenDBWithCacheOpts opens a Geth database or panics. Allows the caller to pass in LevelDB cache parameters.

func PreCheckBalances added in v0.10.7

func PreCheckBalances(ldb ethdb.Database, db *state.StateDB, addresses []common.Address, allowances []*migration.Allowance, chainID int, noCheck bool) ([]common.Address, error)

PreCheckBalances checks that the given list of addresses and allowances represents all storage slots in the LegacyERC20ETH contract. We don't have to filter out extra addresses like we do for withdrawals because we'll simply carry the balance of a given address to the new system, if the account is extra then it won't have any balance and nothing will happen.

func ProgressLogger

func ProgressLogger(n int, msg string) func(...any)

func ReadGenesis

func ReadGenesis(r io.Reader) (*core.Genesis, error)

ReadGenesis reads a genesis object from an io.Reader.

func ReadGenesisFromFile

func ReadGenesisFromFile(path string) (*core.Genesis, error)

ReadGenesisFromFile reads a genesis object from a file.

Types

type AddressCB

type AddressCB func(address common.Address) error

type AddressCBWithHead

type AddressCBWithHead func(address common.Address, headNum uint64) error

type AllowanceCB

type AllowanceCB func(owner, spender common.Address) error

type BytesBacked

type BytesBacked interface {
	Bytes() []byte
}

BytesBacked is a re-export of the same interface in Geth, which is unfortunately private.

Jump to

Keyboard shortcuts

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