nativeasset

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: GPL-3.0, LGPL-3.0 Imports: 7 Imported by: 0

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