gas

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBalance = 100 * native.GASFactor

DefaultBalance is a balance of every account in redefined GAS native contract.

Variables

This section is empty.

Functions

This section is empty.

Types

type GAS

type GAS struct {
	interop.ContractMD
}

GAS represents GAS custom native contract. It always returns DefaultBalance as a balance, has no-op `Burn`, `Mint`, `Transfer` operations.

func NewGAS

func NewGAS() *GAS

NewGAS returns GAS custom native contract.

func (*GAS) ActiveIn

func (g *GAS) ActiveIn() *config.Hardfork

ActiveIn implements the interop.Contract interface.

func (*GAS) BalanceOf

func (g *GAS) BalanceOf(d *dao.Simple, acc util.Uint160) *big.Int

BalanceOf returns native GAS token balance for the acc.

func (*GAS) Burn

func (g *GAS) Burn(ic *interop.Context, h util.Uint160, amount *big.Int)

func (*GAS) Initialize

func (g *GAS) Initialize(ic *interop.Context, hf *config.Hardfork, newMD *interop.HFSpecificContractMD) error

Initialize initializes a GAS contract.

func (*GAS) InitializeCache

func (g *GAS) InitializeCache(_ interop.IsHardforkEnabled, blockHeight uint32, d *dao.Simple) error

InitializeCache implements the interop.Contract interface.

func (*GAS) Metadata

func (g *GAS) Metadata() *interop.ContractMD

func (*GAS) Mint

func (g *GAS) Mint(ic *interop.Context, h util.Uint160, amount *big.Int, callOnPayment bool)

func (*GAS) MintDeferrable

func (g *GAS) MintDeferrable(ic *interop.Context, h util.Uint160, amount *big.Int, callOnPayment bool, continuation func())

func (*GAS) OnPersist

func (g *GAS) OnPersist(ic *interop.Context) error

OnPersist implements the interop.Contract interface.

func (*GAS) PostPersist

func (g *GAS) PostPersist(ic *interop.Context) error

PostPersist implements the interop.Contract interface.

Jump to

Keyboard shortcuts

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