gas

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: GPL-3.0 Imports: 8 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gas implements helper functions for calculating gas parameters based on Ethereum protocol values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallGasEstimate added in v0.3.0

func CallGasEstimate(
	eth *ethclient.Client,
	from common.Address,
	op *userop.UserOperation,
) (uint64, error)

Types

type GasEstimates added in v0.2.0

type GasEstimates struct {
	PreVerificationGas *big.Int `json:"preVerificationGas"`
	VerificationGas    *big.Int `json:"verificationGas"`
	CallGasLimit       *big.Int `json:"callGasLimit"`
}

GasEstimates provides estimate values for all gas fields in a UserOperation.

type Overhead

type Overhead struct {
	// contains filtered or unexported fields
}

Overhead provides helper methods for calculating gas limits based on pre-defined parameters.

func NewDefaultOverhead

func NewDefaultOverhead() *Overhead

NewDefaultOverhead returns an instance of Overhead using parameters defined by the Ethereum protocol.

func (*Overhead) CalcPreVerificationGas

func (ov *Overhead) CalcPreVerificationGas(op *userop.UserOperation) *big.Int

CalcPreVerificationGas returns an expected gas cost for processing a UserOperation from a batch.

func (*Overhead) NonZeroValueCall

func (ov *Overhead) NonZeroValueCall() *big.Int

NonZeroValueCall returns an expected gas cost of using the CALL opcode in the context of EIP-4337. See https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-1-call.

Jump to

Keyboard shortcuts

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