hook

package
v0.0.0-...-5582690 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var L1OracleAddress = common.HexToAddress("0x2A00000000000000000000000000000000000010")

Functions

func MakeSpecularEVMPreTransferHook

func MakeSpecularEVMPreTransferHook(l2ChainId uint64, l1FeeRecipient common.Address) vm.EVMHook

MakeSpecularEVMPreTransferHook creates specular's vm.EVMHook function which is injected into the EVM and runs before every transfer currently this is only used to calculate & charge the L1 Fee

func MakeSpecularL1FeeReader

func MakeSpecularL1FeeReader(l2ChainId uint64) vm.EVMReader

MakeSpecularL1FeeReader creates specular's vm.EVMReader function which is injected into the EVM and can be used to return the L1Fee of a transaction. This is a read only method and does not change the state.

func ScaleBigInt

func ScaleBigInt(num *big.Int, scalar float64) *big.Int

multiply a big.Int with a float only the first 3 decimal places of the scalar are used to guarantee precision

Types

type RollupConfig

type RollupConfig interface {
	GetL1FeeRecipient() common.Address // recipient of the L1 Fee
	GetL2ChainID() uint64              // chain ID of the specular rollup
}

Jump to

Keyboard shortcuts

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