builtInFunctions

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetadataFrozen is the location of frozen flag in the esdt user meta data
	MetadataFrozen = 1
)
View Source
const (
	// MetadataPaused is the location of paused flag in the esdt global meta data
	MetadataPaused = 1
)

Variables

View Source
var (
	ErrInvalidLengthEsdt        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEsdt          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEsdt = fmt.Errorf("proto: unexpected end of group")
)

Functions

func CreateBuiltInFunctionContainer

func CreateBuiltInFunctionContainer(args ArgsCreateBuiltInFunctionContainer) (process.BuiltInFunctionContainer, error)

CreateBuiltInFunctionContainer will create the list of built-in functions

func NewBuiltInFunctionContainer

func NewBuiltInFunctionContainer() *functionContainer

NewBuiltInFunctionContainer will create a new instance of a container

func NewChangeOwnerAddressFunc

func NewChangeOwnerAddressFunc(gasCost uint64) *changeOwnerAddress

NewChangeOwnerAddressFunc create a new change owner built in function

func NewClaimDeveloperRewardsFunc

func NewClaimDeveloperRewardsFunc(gasCost uint64) *claimDeveloperRewards

NewClaimDeveloperRewardsFunc returns a new developer rewards implementation

func NewESDTBurnFunc added in v1.1.3

func NewESDTBurnFunc(
	funcGasCost uint64,
	marshalizer marshal.Marshalizer,
	pauseHandler process.ESDTPauseHandler,
) (*esdtBurn, error)

NewESDTBurnFunc returns the esdt burn built-in function component

func NewESDTFreezeWipeFunc added in v1.1.3

func NewESDTFreezeWipeFunc(
	marshalizer marshal.Marshalizer,
	freeze bool,
	wipe bool,
) (*esdtFreezeWipe, error)

NewESDTFreezeWipeFunc returns the esdt freeze/un-freeze/wipe built-in function component

func NewESDTPauseFunc added in v1.1.3

func NewESDTPauseFunc(
	accounts state.AccountsAdapter,
	pause bool,
) (*esdtPause, error)

NewESDTPauseFunc returns the esdt pause/un-pause built-in function component

func NewESDTTransferFunc added in v1.0.114

func NewESDTTransferFunc(
	funcGasCost uint64,
	marshalizer marshal.Marshalizer,
	pauseHandler process.ESDTPauseHandler,
) (*esdtTransfer, error)

NewESDTTransferFunc returns the esdt transfer built-in function component

func NewSaveKeyValueStorageFunc

func NewSaveKeyValueStorageFunc(
	gasConfig BaseOperationCost,
	funcGasCost uint64,
) (*saveKeyValueStorage, error)

NewSaveKeyValueStorageFunc returns the save key-value storage built in function

func NewSaveUserNameFunc

func NewSaveUserNameFunc(
	gasCost uint64,
	mapDnsAddresses map[string]struct{},
	enableChange bool,
) (*saveUserName, error)

NewSaveUserNameFunc returns a username built in function implementation

func SetPayableHandler added in v1.1.3

func SetPayableHandler(container process.BuiltInFunctionContainer, payableHandler process.PayableHandler) error

SetPayableHandler sets the payable interface to the needed functions

Types

type ArgsCreateBuiltInFunctionContainer

type ArgsCreateBuiltInFunctionContainer struct {
	GasMap               map[string]map[string]uint64
	MapDNSAddresses      map[string]struct{}
	EnableUserNameChange bool
	Marshalizer          marshal.Marshalizer
	Accounts             state.AccountsAdapter
}

ArgsCreateBuiltInFunctionContainer -

type BaseOperationCost

type BaseOperationCost struct {
	StorePerByte    uint64
	ReleasePerByte  uint64
	DataCopyPerByte uint64
	PersistPerByte  uint64
	CompilePerByte  uint64
}

BaseOperationCost defines cost for base operation cost

type BuiltInCost

type BuiltInCost struct {
	ChangeOwnerAddress    uint64
	ClaimDeveloperRewards uint64
	SaveUserName          uint64
	SaveKeyValue          uint64
	ESDTTransfer          uint64
	ESDTBurn              uint64
}

BuiltInCost defines cost for built-in methods

type ESDTGlobalMetadata added in v1.1.3

type ESDTGlobalMetadata struct {
	Paused bool
}

ESDTGlobalMetadata represents esdt global metadata saved on system account

func ESDTGlobalMetadataFromBytes added in v1.1.3

func ESDTGlobalMetadataFromBytes(bytes []byte) ESDTGlobalMetadata

ESDTGlobalMetadataFromBytes creates a metadata object from bytes

func (*ESDTGlobalMetadata) ToBytes added in v1.1.3

func (metadata *ESDTGlobalMetadata) ToBytes() []byte

ToBytes converts the metadata to bytes

type ESDTUserMetadata added in v1.1.3

type ESDTUserMetadata struct {
	Frozen bool
}

ESDTUserMetadata represents esdt user metadata saved on every account

func ESDTUserMetadataFromBytes added in v1.1.3

func ESDTUserMetadataFromBytes(bytes []byte) ESDTUserMetadata

ESDTUserMetadataFromBytes creates a metadata object from bytes

func (*ESDTUserMetadata) ToBytes added in v1.1.3

func (metadata *ESDTUserMetadata) ToBytes() []byte

ToBytes converts the metadata to bytes

type ESDigitalToken added in v1.0.114

type ESDigitalToken struct {
	Value      *math_big.Int `` /* 132-byte string literal not displayed */
	Properties []byte        `protobuf:"bytes,2,opt,name=Properties,proto3" json:"properties"`
}

ESDigitalToken holds the data for a elrond standard digital token transaction

func (*ESDigitalToken) Descriptor added in v1.0.114

func (*ESDigitalToken) Descriptor() ([]byte, []int)

func (*ESDigitalToken) Equal added in v1.0.114

func (this *ESDigitalToken) Equal(that interface{}) bool

func (*ESDigitalToken) GetProperties added in v1.1.3

func (m *ESDigitalToken) GetProperties() []byte

func (*ESDigitalToken) GetValue added in v1.0.114

func (m *ESDigitalToken) GetValue() *math_big.Int

func (*ESDigitalToken) GoString added in v1.0.114

func (this *ESDigitalToken) GoString() string

func (*ESDigitalToken) Marshal added in v1.0.114

func (m *ESDigitalToken) Marshal() (dAtA []byte, err error)

func (*ESDigitalToken) MarshalTo added in v1.0.114

func (m *ESDigitalToken) MarshalTo(dAtA []byte) (int, error)

func (*ESDigitalToken) MarshalToSizedBuffer added in v1.0.114

func (m *ESDigitalToken) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ESDigitalToken) ProtoMessage added in v1.0.114

func (*ESDigitalToken) ProtoMessage()

func (*ESDigitalToken) Reset added in v1.0.114

func (m *ESDigitalToken) Reset()

func (*ESDigitalToken) Size added in v1.0.114

func (m *ESDigitalToken) Size() (n int)

func (*ESDigitalToken) String added in v1.0.114

func (this *ESDigitalToken) String() string

func (*ESDigitalToken) Unmarshal added in v1.0.114

func (m *ESDigitalToken) Unmarshal(dAtA []byte) error

func (*ESDigitalToken) XXX_DiscardUnknown added in v1.0.114

func (m *ESDigitalToken) XXX_DiscardUnknown()

func (*ESDigitalToken) XXX_Marshal added in v1.0.114

func (m *ESDigitalToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ESDigitalToken) XXX_Merge added in v1.0.114

func (m *ESDigitalToken) XXX_Merge(src proto.Message)

func (*ESDigitalToken) XXX_Size added in v1.0.114

func (m *ESDigitalToken) XXX_Size() int

func (*ESDigitalToken) XXX_Unmarshal added in v1.0.114

func (m *ESDigitalToken) XXX_Unmarshal(b []byte) error

type GasCost

type GasCost struct {
	BaseOperationCost BaseOperationCost
	BuiltInCost       BuiltInCost
}

GasCost holds all the needed gas costs for system smart contracts

Jump to

Keyboard shortcuts

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