ont

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TRANSFER_FLAG byte = 1
	APPROVE_FLAG  byte = 2
)
View Source
const (
	UNBOUND_TIME_OFFSET_KEY = "unboundTimeOffset"
	TOTAL_SUPPLY_KEY        = "totalSupply"
)

storage key

View Source
const (
	INIT_NAME            = "init"
	TRANSFER_NAME        = "transfer"
	APPROVE_NAME         = "approve"
	TRANSFERFROM_NAME    = "transferFrom"
	NAME_NAME            = "name"
	SYMBOL_NAME          = "symbol"
	DECIMALS_NAME        = "decimals"
	TOTAL_SUPPLY_NAME    = "totalSupply"
	BALANCEOF_NAME       = "balanceOf"
	ALLOWANCE_NAME       = "allowance"
	TOTAL_ALLOWANCE_NAME = "totalAllowance"

	TRANSFER_V2_NAME        = "transferV2"
	APPROVE_V2_NAME         = "approveV2"
	TRANSFERFROM_V2_NAME    = "transferFromV2"
	DECIMALS_V2_NAME        = "decimalsV2"
	TOTAL_SUPPLY_V2_NAME    = "totalSupplyV2"
	BALANCEOF_V2_NAME       = "balanceOfV2"
	ALLOWANCE_V2_NAME       = "allowanceV2"
	TOTAL_ALLOWANCE_V2_NAME = "totalAllowanceV2"

	UNBOUND_ONG_TO_GOVERNANCE = "unboundOngToGovernance"
)

methods

Variables

This section is empty.

Functions

func AddTransferNotifications added in v1.15.0

func AddTransferNotifications(native *native.NativeService, contract common.Address, state *TransferStateV2)

func GenApproveKey

func GenApproveKey(contract, from, to common.Address) []byte

func GenBalanceKey

func GenBalanceKey(contract, addr common.Address) []byte

func GenTotalSupplyKey

func GenTotalSupplyKey(contract common.Address) []byte

func GetBalanceValue

func GetBalanceValue(native *native.NativeService, flag byte, scaleDecimal9 bool) ([]byte, error)

func GetToUInt64StorageItem

func GetToUInt64StorageItem(toBalance, value uint64) *cstates.StorageItem

func InitOnt

func InitOnt()

func OntAllowance

func OntAllowance(native *native.NativeService) ([]byte, error)

func OntAllowanceV2 added in v1.15.0

func OntAllowanceV2(native *native.NativeService) ([]byte, error)

func OntApprove

func OntApprove(native *native.NativeService) ([]byte, error)

func OntApproveV2 added in v1.15.0

func OntApproveV2(native *native.NativeService) ([]byte, error)

func OntBalanceOf

func OntBalanceOf(native *native.NativeService) ([]byte, error)

func OntBalanceOfV2 added in v1.15.0

func OntBalanceOfV2(native *native.NativeService) ([]byte, error)

func OntDecimals

func OntDecimals(native *native.NativeService) ([]byte, error)

func OntDecimalsV2 added in v1.15.0

func OntDecimalsV2(native *native.NativeService) ([]byte, error)

func OntInit

func OntInit(native *native.NativeService) ([]byte, error)

func OntName

func OntName(native *native.NativeService) ([]byte, error)

func OntSymbol

func OntSymbol(native *native.NativeService) ([]byte, error)

func OntTotalSupply

func OntTotalSupply(native *native.NativeService) ([]byte, error)

func OntTotalSupplyV2 added in v1.15.0

func OntTotalSupplyV2(native *native.NativeService) ([]byte, error)

func OntTransfer

func OntTransfer(native *native.NativeService) ([]byte, error)

func OntTransferFrom

func OntTransferFrom(native *native.NativeService) ([]byte, error)

func OntTransferFromV2 added in v1.15.0

func OntTransferFromV2(native *native.NativeService) ([]byte, error)

func OntTransferV2 added in v1.15.0

func OntTransferV2(native *native.NativeService) ([]byte, error)

func RegisterOntContract

func RegisterOntContract(native *native.NativeService)

func TotalAllowance added in v1.15.0

func TotalAllowance(native *native.NativeService) ([]byte, error)

func TotalAllowanceV2 added in v1.15.0

func TotalAllowanceV2(native *native.NativeService) ([]byte, error)

func Transfer

func Transfer(native *native.NativeService, contract common.Address, from, to common.Address,
	value cstates.NativeTokenBalance) (oldFrom, oldTo cstates.NativeTokenBalance, err error)

func TransferedFrom

func TransferedFrom(native *native.NativeService, currentContract common.Address, state *TransferFromStateV2) (oldFrom cstates.NativeTokenBalance, oldTo cstates.NativeTokenBalance, err error)

func UnboundOngToGovernance added in v1.15.0

func UnboundOngToGovernance(native *native.NativeService) ([]byte, error)

Types

type TransferFrom

type TransferFrom struct {
	Sender common.Address
	TransferState
}

func NewTransferFromState added in v1.15.0

func NewTransferFromState(sender, from, to common.Address, value uint64) *TransferFrom

func (*TransferFrom) Deserialization added in v1.0.3

func (this *TransferFrom) Deserialization(source *common.ZeroCopySource) error

func (*TransferFrom) Serialization added in v1.0.3

func (this *TransferFrom) Serialization(sink *common.ZeroCopySink)

func (*TransferFrom) ToV2 added in v1.15.0

func (self *TransferFrom) ToV2() *TransferFromStateV2

type TransferFromStateV2 added in v1.15.0

type TransferFromStateV2 struct {
	Sender common.Address
	TransferStateV2
}

func (*TransferFromStateV2) Deserialization added in v1.15.0

func (self *TransferFromStateV2) Deserialization(source *common.ZeroCopySource) error

func (*TransferFromStateV2) Serialization added in v1.15.0

func (self *TransferFromStateV2) Serialization(sink *common.ZeroCopySink)

type TransferState added in v1.15.0

type TransferState struct {
	From  common.Address
	To    common.Address
	Value uint64
}

func (*TransferState) Deserialization added in v1.15.0

func (this *TransferState) Deserialization(source *common.ZeroCopySource) error

func (*TransferState) Serialization added in v1.15.0

func (this *TransferState) Serialization(sink *common.ZeroCopySink)

func (*TransferState) ToV2 added in v1.15.0

func (this *TransferState) ToV2() *TransferStateV2

type TransferStateV2 added in v1.15.0

type TransferStateV2 struct {
	From  common.Address
	To    common.Address
	Value states.NativeTokenBalance
}

func (*TransferStateV2) Deserialization added in v1.15.0

func (this *TransferStateV2) Deserialization(source *common.ZeroCopySource) error

func (*TransferStateV2) Serialization added in v1.15.0

func (this *TransferStateV2) Serialization(sink *common.ZeroCopySink)

type TransferStates added in v1.15.0

type TransferStates struct {
	States []TransferState
}

TransferStates

func (*TransferStates) Deserialization added in v1.15.0

func (this *TransferStates) Deserialization(source *common.ZeroCopySource) error

func (*TransferStates) Serialization added in v1.15.0

func (this *TransferStates) Serialization(sink *common.ZeroCopySink)

func (*TransferStates) ToV2 added in v1.15.0

func (this *TransferStates) ToV2() *TransferStatesV2

type TransferStatesV2 added in v1.15.0

type TransferStatesV2 struct {
	States []*TransferStateV2
}

func (*TransferStatesV2) Deserialization added in v1.15.0

func (this *TransferStatesV2) Deserialization(source *common.ZeroCopySource) error

func (*TransferStatesV2) Serialization added in v1.15.0

func (this *TransferStatesV2) Serialization(sink *common.ZeroCopySink)

Jump to

Keyboard shortcuts

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