Documentation ¶
Index ¶
- Variables
- func CalcAllowanceStorageKey(owner common.Address, spender common.Address) common.Hash
- func CalcOVMETHStorageKey(addr common.Address) common.Hash
- func CalcStorageKey(a, b BytesBacked) common.Hash
- func GetOVMETHTotalSupplySlot() common.Hash
- func IterateAddrList(r io.Reader, cb AddressCB) error
- func IterateAllowanceList(r io.Reader, cb AllowanceCB) error
- func IterateDBAddresses(db ethdb.Database, cb AddressCB) error
- func IterateMintEvents(db ethdb.Database, headNum uint64, cb AddressCBWithHead) error
- func MigrateLegacyETH(db *state.StateDB, addresses []common.Address, chainID int, noCheck bool) error
- func MustOpenDB(dataDir string) ethdb.Database
- func MustOpenDBWithCacheOpts(dataDir string, cacheSize, handles int) ethdb.Database
- func PreCheckBalances(ldb ethdb.Database, db *state.StateDB, addresses []common.Address, ...) ([]common.Address, error)
- func ProgressLogger(n int, msg string) func(...any)
- func ReadGenesis(r io.Reader) (*core.Genesis, error)
- func ReadGenesisFromFile(path string) (*core.Genesis, error)
- type AddressCB
- type AddressCBWithHead
- type AllowanceCB
- type BytesBacked
Constants ¶
This section is empty.
Variables ¶
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") )
var ( // OVMETHAddress is the address of the OVM ETH predeploy. OVMETHAddress = common.HexToAddress("0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000") )
Functions ¶
func CalcAllowanceStorageKey ¶
CalcAllowanceStorageKey calculates the storage key of an allowance in OVM ETH.
func CalcOVMETHStorageKey ¶
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 IterateAddrList ¶
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 ¶
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 MustOpenDB ¶
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 ¶
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 ReadGenesis ¶
ReadGenesis reads a genesis object from an io.Reader.
Types ¶
type AllowanceCB ¶
type BytesBacked ¶
type BytesBacked interface {
Bytes() []byte
}
BytesBacked is a re-export of the same interface in Geth, which is unfortunately private.