rollups

package
v2.10.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ArbGasInfoAddress is the address of the "Precompiled contract that exists in every Arbitrum chain."
	// https://github.com/OffchainLabs/nitro/blob/f7645453cfc77bf3e3644ea1ac031eff629df325/contracts/src/precompiles/ArbGasInfo.sol
	ArbGasInfoAddress = "0x000000000000000000000000000000000000006C"
	// ArbGasInfo_getL1BaseFeeEstimate is the a hex encoded call to:
	// `function getL1BaseFeeEstimate() external view returns (uint256);`
	ArbGasInfo_getL1BaseFeeEstimate = "getL1BaseFeeEstimate"
	// NodeInterfaceAddress is the address of the precompiled contract that is only available through RPC
	// https://github.com/OffchainLabs/nitro/blob/e815395d2e91fb17f4634cad72198f6de79c6e61/nodeInterface/NodeInterface.go#L37
	ArbNodeInterfaceAddress = "0x00000000000000000000000000000000000000C8"
	// ArbGasInfo_getPricesInArbGas is the a hex encoded call to:
	// `function gasEstimateL1Component(address to, bool contractCreation, bytes calldata data) external payable returns (uint64 gasEstimateForL1, uint256 baseFee, uint256 l1BaseFeeEstimate);`
	ArbNodeInterface_gasEstimateL1Component = "gasEstimateL1Component"

	// OPGasOracleAddress is the address of the precompiled contract that exists on OP stack chain.
	// This is the case for Optimism and Base.
	OPGasOracleAddress = "0x420000000000000000000000000000000000000F"
	// OPGasOracle_l1BaseFee is a hex encoded call to:
	// `function l1BaseFee() external view returns (uint256);`
	OPGasOracle_l1BaseFee = "l1BaseFee"
	// OPGasOracle_getL1Fee is a hex encoded call to:
	// `function getL1Fee(bytes) external view returns (uint256);`
	OPGasOracle_getL1Fee = "getL1Fee"

	// ScrollGasOracleAddress is the address of the precompiled contract that exists on Scroll chain.
	ScrollGasOracleAddress = "0x5300000000000000000000000000000000000002"
	// ScrollGasOracle_l1BaseFee is a hex encoded call to:
	// `function l1BaseFee() external view returns (uint256);`
	ScrollGasOracle_l1BaseFee = "l1BaseFee"
	// ScrollGasOracle_getL1Fee is a hex encoded call to:
	// `function getL1Fee(bytes) external view returns (uint256);`
	ScrollGasOracle_getL1Fee = "getL1Fee"

	// GasOracleAddress is the address of the precompiled contract that exists on Kroma chain.
	// This is the case for Kroma.
	KromaGasOracleAddress = "0x4200000000000000000000000000000000000005"
	// GasOracle_l1BaseFee is the a hex encoded call to:
	// `function l1BaseFee() external view returns (uint256);`
	KromaGasOracle_l1BaseFee = "l1BaseFee"

	// Interval at which to poll for L1BaseFee. A good starting point is the L1 block time.
	PollPeriod = 6 * time.Second
)
View Source
const GasEstimateL1ComponentAbiString = `` /* 478-byte string literal not displayed */

ABI found at https://arbiscan.io/address/0x00000000000000000000000000000000000000C8#code

View Source
const GetL1BaseFeeEstimateAbiString = `` /* 154-byte string literal not displayed */
ABIs for Arbitrum Gas Info and Node Interface precompile contract methods needed for the L1 oracle

ABI found at https://arbiscan.io/address/0x000000000000000000000000000000000000006C#code

View Source
const GetL1FeeAbiString = `` /* 196-byte string literal not displayed */
View Source
const L1BaseFeeAbiString = `` /* 143-byte string literal not displayed */
ABIs for Optimism, Scroll, and Kroma precompile contract methods needed for the L1 oracle

All ABIs found at https://optimistic.etherscan.io/address/0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3000f#code

Variables

This section is empty.

Functions

func IsRollupWithL1Support

func IsRollupWithL1Support(chainType config.ChainType) bool

Types

type L1Oracle

type L1Oracle interface {
	services.ServiceCtx

	GasPrice(ctx context.Context) (*assets.Wei, error)
	GetGasCost(ctx context.Context, tx *types.Transaction, blockNum *big.Int) (*assets.Wei, error)
}

L1Oracle provides interface for fetching L1-specific fee components if the chain is an L2. For example, on Optimistic Rollups, this oracle can return rollup-specific l1BaseFee

func NewL1GasOracle added in v2.10.0

func NewL1GasOracle(lggr logger.Logger, ethClient ethClient, chainType config.ChainType) L1Oracle

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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