nativeasset

package
v1.21.49 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: GPL-3.0, LGPL-3.0, LGPL-3.0 Imports: 7 Imported by: ? modules, 0 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

Index

Constants

This section is empty.

Variables

View Source
var (
	GenesisContractAddr    = common.HexToAddress("0x0100000000000000000000000000000000000000")
	NativeAssetBalanceAddr = common.HexToAddress("0x0100000000000000000000000000000000000001")
	NativeAssetCallAddr    = common.HexToAddress("0x0100000000000000000000000000000000000002")
)

Functions

func PackNativeAssetBalanceInput

func PackNativeAssetBalanceInput(address common.Address, assetID common.Hash) []byte

PackNativeAssetBalanceInput packs the arguments into the required input data for a transaction to be passed into the native asset balance contract.

func PackNativeAssetCallInput

func PackNativeAssetCallInput(address common.Address, assetID common.Hash, assetAmount *big.Int, callData []byte) []byte

PackNativeAssetCallInput packs the arguments into the required input data for a transaction to be passed into the native asset contract. Assumes that [assetAmount] is non-nil.

func UnpackNativeAssetBalanceInput

func UnpackNativeAssetBalanceInput(input []byte) (common.Address, common.Hash, error)

UnpackNativeAssetBalanceInput attempts to unpack [input] into the arguments to the native asset balance precompile

func UnpackNativeAssetCallInput

func UnpackNativeAssetCallInput(input []byte) (common.Address, common.Hash, *big.Int, []byte, error)

UnpackNativeAssetCallInput attempts to unpack [input] into the arguments to the native asset call precompile

Types

type DeprecatedContract

type DeprecatedContract struct{}

func (*DeprecatedContract) Run

func (*DeprecatedContract) Run(accessibleState contract.AccessibleState, caller common.Address, addr common.Address, input []byte, suppliedGas uint64, readOnly bool) (ret []byte, remainingGas uint64, err error)

type NativeAssetBalance

type NativeAssetBalance struct {
	GasCost uint64
}

NativeAssetBalance is a precompiled contract used to retrieve the native asset balance

func (*NativeAssetBalance) Run

func (b *NativeAssetBalance) Run(accessibleState contract.AccessibleState, caller common.Address, addr common.Address, input []byte, suppliedGas uint64, readOnly bool) (ret []byte, remainingGas uint64, err error)

Run implements StatefulPrecompiledContract

type NativeAssetCall

type NativeAssetCall struct {
	GasCost           uint64
	CallNewAccountGas uint64
}

NativeAssetCall atomically transfers a native asset to a recipient address as well as calling that address

func (*NativeAssetCall) Run

func (c *NativeAssetCall) Run(accessibleState contract.AccessibleState, caller common.Address, addr common.Address, input []byte, suppliedGas uint64, readOnly bool) (ret []byte, remainingGas uint64, err error)

Run implements contract.StatefulPrecompiledContract

Jump to

Keyboard shortcuts

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