Documentation ¶
Index ¶
- Constants
- Variables
- func NewBuiltInFunctionContainer() *functionContainer
- func NewBuiltInFunctionsCreator(args ArgsCreateBuiltInFunctionContainer) (*builtInFuncCreator, error)
- func NewChangeOwnerAddressFunc(gasCost uint64) *changeOwnerAddress
- func NewClaimDeveloperRewardsFunc(gasCost uint64) *claimDeveloperRewards
- func NewESDTBurnFunc(funcGasCost uint64, marshaller vmcommon.Marshalizer, ...) (*esdtBurn, error)
- func NewESDTDataStorage(args ArgsNewESDTDataStorage) (*esdtDataStorage, error)
- func NewESDTDeleteMetadataFunc(args ArgsNewESDTDeleteMetadata) (*esdtDeleteMetaData, error)
- func NewESDTFreezeWipeFunc(esdtStorageHandler vmcommon.ESDTNFTStorageHandler, ...) (*esdtFreezeWipe, error)
- func NewESDTGlobalSettingsFunc(accounts vmcommon.AccountsAdapter, marshaller marshal.Marshalizer, set bool, ...) (*esdtGlobalSettings, error)
- func NewESDTLocalBurnFunc(funcGasCost uint64, marshaller vmcommon.Marshalizer, ...) (*esdtLocalBurn, error)
- func NewESDTLocalMintFunc(funcGasCost uint64, marshaller vmcommon.Marshalizer, ...) (*esdtLocalMint, error)
- func NewESDTNFTAddQuantityFunc(funcGasCost uint64, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, ...) (*esdtNFTAddQuantity, error)
- func NewESDTNFTAddUriFunc(funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, ...) (*esdtNFTAddUri, error)
- func NewESDTNFTBurnFunc(funcGasCost uint64, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, ...) (*esdtNFTBurn, error)
- func NewESDTNFTCreateFunc(funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, ...) (*esdtNFTCreate, error)
- func NewESDTNFTCreateRoleTransfer(marshaller vmcommon.Marshalizer, accounts vmcommon.AccountsAdapter, ...) (*esdtNFTCreateRoleTransfer, error)
- func NewESDTNFTMultiTransferFunc(funcGasCost uint64, marshaller vmcommon.Marshalizer, ...) (*esdtNFTMultiTransfer, error)
- func NewESDTNFTTransferFunc(funcGasCost uint64, marshaller vmcommon.Marshalizer, ...) (*esdtNFTTransfer, error)
- func NewESDTNFTUpdateAttributesFunc(funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, ...) (*esdtNFTupdate, error)
- func NewESDTRolesFunc(marshaller vmcommon.Marshalizer, set bool) (*esdtRoles, error)
- func NewESDTTransferFunc(funcGasCost uint64, marshaller vmcommon.Marshalizer, ...) (*esdtTransfer, error)
- func NewESDTTransferRoleAddressFunc(accounts vmcommon.AccountsAdapter, marshaller marshal.Marshalizer, ...) (*esdtTransferAddress, error)
- func NewPayableCheckFunc(payable vmcommon.PayableHandler, ...) (*payableCheck, error)
- func NewSaveKeyValueStorageFunc(gasConfig vmcommon.BaseOperationCost, funcGasCost uint64) (*saveKeyValueStorage, error)
- func NewSaveUserNameFunc(gasCost uint64, mapDnsAddresses map[string]struct{}, enableChange bool) (*saveUserName, error)
- type ArgsCreateBuiltInFunctionContainer
- type ArgsNewESDTDataStorage
- type ArgsNewESDTDeleteMetadata
- type ESDTGlobalMetadata
- type ESDTUserMetadata
Constants ¶
const ( // MetadataPaused is the location of paused flag in the esdt global meta data MetadataPaused = 1 // MetadataLimitedTransfer is the location of limited transfer flag in the esdt global meta data MetadataLimitedTransfer = 2 // BurnRoleForAll is the location of burn role for all flag in the esdt global meta data BurnRoleForAll = 4 )
const (
// MetadataFrozen is the location of frozen flag in the esdt user meta data
MetadataFrozen = 1
)
Variables ¶
var ErrAccountNotPayable = errors.New("sending value to non payable contract")
ErrAccountNotPayable will be sent when trying to send tokens to a non-payableCheck account
var ErrActionNotAllowed = errors.New("action is not allowed")
ErrActionNotAllowed signals that action is not allowed
var ErrAddressIsNotAllowed = errors.New("address is not allowed to do the action")
ErrAddressIsNotAllowed signals that sender is not allowed to do the action
var ErrAddressIsNotESDTSystemSC = errors.New("destination is not system sc address")
ErrAddressIsNotESDTSystemSC signals that destination is not a system sc address
var ErrBuiltInFunctionCalledWithValue = errors.New("built in function called with tx value is not allowed")
ErrBuiltInFunctionCalledWithValue signals that builtin function was called with value that is not allowed
var ErrCallerIsNotTheDNSAddress = errors.New("not a dns address")
ErrCallerIsNotTheDNSAddress signals that called address is not the DNS address
var ErrCannotWipeAccountNotFrozen = errors.New("cannot wipe because the account is not frozen for this esdt token")
ErrCannotWipeAccountNotFrozen signals that account isn't frozen so the wipe is not possible
var ErrContainerKeyAlreadyExists = errors.New("provided key already exists in container")
ErrContainerKeyAlreadyExists signals that an element was already set in the container's map
var ErrESDTIsFrozenForAccount = errors.New("account is frozen for this esdt token")
ErrESDTIsFrozenForAccount signals that account is frozen for given esdt token
var ErrESDTTokenIsPaused = errors.New("esdt token is paused")
ErrESDTTokenIsPaused signals that esdt token is paused
var ErrEmptyFunctionName = errors.New("empty function name")
ErrEmptyFunctionName signals that an empty function name has been provided
var ErrInsufficientFunds = errors.New("insufficient funds")
ErrInsufficientFunds signals the funds are insufficient for the move balance operation but the transaction fee is covered by the current balance
var ErrInsufficientQuantityESDT = errors.New("insufficient quantity")
ErrInsufficientQuantityESDT signals the funds are insufficient for the ESDT transfer
var ErrInvalidAddressLength = errors.New("invalid address length")
ErrInvalidAddressLength signals that address length is invalid
var ErrInvalidArguments = errors.New("invalid arguments to process built-in function")
ErrInvalidArguments signals that invalid arguments were given to process built-in function
var ErrInvalidContainerKey = errors.New("element does not exist in container")
ErrInvalidContainerKey signals that an element does not exist in the container's map
var ErrInvalidLiquidityForESDT = errors.New("invalid liquidity for ESDT")
ErrInvalidLiquidityForESDT signals that liquidity is invalid for ESDT
var ErrInvalidMaxNumAddresses = errors.New("invalid max number of addresses")
ErrInvalidMaxNumAddresses signals that there is an invalid max number of addresses
var ErrInvalidMetadata = errors.New("invalid metadata")
ErrInvalidMetadata signals that invalid metadata was provided
var ErrInvalidNFTQuantity = errors.New("invalid NFT quantity")
ErrInvalidNFTQuantity signals that invalid NFT quantity was provided
var ErrInvalidNonce = errors.New("invalid nonce for esdt")
ErrInvalidNonce signals that invalid nonce for esdt
var ErrInvalidNumOfArgs = errors.New("invalid number of arguments")
ErrInvalidNumOfArgs signals that the number of arguments is invalid
var ErrInvalidRcvAddr = errors.New("invalid receiver address")
ErrInvalidRcvAddr signals that an invalid receiver address was provided
var ErrInvalidTokenID = errors.New("invalid tokenID")
ErrInvalidTokenID signals that invalid tokenID was provided
var ErrNFTDoesNotHaveMetadata = errors.New("NFT does not have metadata")
ErrNFTDoesNotHaveMetadata signals that NFT does not have metadata
var ErrNFTTokenDoesNotExist = errors.New("NFT token does not exist")
ErrNFTTokenDoesNotExist signals that NFT token does not exist
var ErrNegativeValue = errors.New("negative value")
ErrNegativeValue signals that a negative value has been detected and it is not allowed
var ErrNewNFTDataOnSenderAddress = errors.New("new NFT data on sender")
ErrNewNFTDataOnSenderAddress signals that a new NFT data was found on the sender address
var ErrNilAccountsAdapter = errors.New("nil AccountsAdapter")
ErrNilAccountsAdapter defines the error when trying to use a nil AccountsAddapter
var ErrNilActiveHandler = errors.New("nil active handler")
ErrNilActiveHandler signals that a nil active handler has been provided
var ErrNilContainerElement = errors.New("element cannot be nil")
ErrNilContainerElement signals when trying to add a nil element in the container
var ErrNilDnsAddresses = errors.New("nil dns addresses map")
ErrNilDnsAddresses signals that nil dns addresses map was provided
var ErrNilESDTData = errors.New("nil esdt data")
ErrNilESDTData signals that ESDT data does not exist
var ErrNilESDTNFTStorageHandler = errors.New("nil esdt nft storage handler")
ErrNilESDTNFTStorageHandler signals that a nil nft storage handler has been provided
var ErrNilEnableEpochsHandler = errors.New("nil enable epochs handler")
ErrNilEnableEpochsHandler signals that a nil enable epochs handler was provided
var ErrNilGlobalSettingsHandler = errors.New("nil pause handler")
ErrNilGlobalSettingsHandler signals that nil pause handler has been provided
var ErrNilMarshalizer = errors.New("nil Marshalizer")
ErrNilMarshalizer signals that an operation has been attempted to or with a nil Marshalizer implementation
var ErrNilPayableHandler = errors.New("nil payableHandler was provided")
ErrNilPayableHandler signals that nil payableHandler was provided
var ErrNilRolesHandler = errors.New("nil roles handler")
ErrNilRolesHandler signals that nil roles handler has been provided
var ErrNilSCDestAccount = errors.New("nil destination SC account")
ErrNilSCDestAccount signals that destination account is nil
var ErrNilShardCoordinator = errors.New("nil shard coordinator")
ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator
var ErrNilTransactionHandler = errors.New("nil transaction handler")
ErrNilTransactionHandler signals that a nil transaction handler has been provided
var ErrNilUserAccount = errors.New("nil user account")
ErrNilUserAccount signals that nil user account was provided
var ErrNilValue = errors.New("nil value")
ErrNilValue signals the value is nil
var ErrNilVmInput = errors.New("nil vm input")
ErrNilVmInput signals that provided vm input is nil
var ErrNotEnoughGas = errors.New("not enough gas was sent in the transaction")
ErrNotEnoughGas signals that not enough gas has been provided
var ErrOnlyFungibleTokensHaveBalanceTransfer = errors.New("only fungible tokens have balance transfer")
ErrOnlyFungibleTokensHaveBalanceTransfer signals that only fungible tokens have balance transfer
var ErrOnlySystemAccountAccepted = errors.New("only system account is accepted")
ErrOnlySystemAccountAccepted signals that only system account is accepted
var ErrOperationNotPermitted = errors.New("operation in account not permitted")
ErrOperationNotPermitted signals that operation is not permitted
var ErrTokenHasValidMetadata = errors.New("token has valid metadata")
ErrTokenHasValidMetadata signals that token has a valid metadata
var ErrTooManyTransferAddresses = errors.New("too many transfer addresses")
ErrTooManyTransferAddresses signals that too many transfer address roles has been added
var ErrUserNameChangeIsDisabled = errors.New("user name change is disabled")
ErrUserNameChangeIsDisabled signals the user name change is not allowed
var ErrWrongTypeAssertion = errors.New("wrong type assertion")
ErrWrongTypeAssertion signals that an type assertion failed
var ErrWrongTypeInContainer = errors.New("wrong type of object inside container")
ErrWrongTypeInContainer signals that a wrong type of object was found in container
Functions ¶
func NewBuiltInFunctionContainer ¶
func NewBuiltInFunctionContainer() *functionContainer
NewBuiltInFunctionContainer will create a new instance of a container
func NewBuiltInFunctionsCreator ¶
func NewBuiltInFunctionsCreator(args ArgsCreateBuiltInFunctionContainer) (*builtInFuncCreator, error)
NewBuiltInFunctionsCreator creates a component which will instantiate the built in functions contracts
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 ¶
func NewESDTBurnFunc( funcGasCost uint64, marshaller vmcommon.Marshalizer, globalSettingsHandler vmcommon.ESDTGlobalSettingsHandler, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*esdtBurn, error)
NewESDTBurnFunc returns the esdt burn built-in function component
func NewESDTDataStorage ¶
func NewESDTDataStorage(args ArgsNewESDTDataStorage) (*esdtDataStorage, error)
NewESDTDataStorage creates a new esdt data storage handler
func NewESDTDeleteMetadataFunc ¶
func NewESDTDeleteMetadataFunc( args ArgsNewESDTDeleteMetadata, ) (*esdtDeleteMetaData, error)
NewESDTDeleteMetadataFunc returns the esdt metadata deletion built-in function component
func NewESDTFreezeWipeFunc ¶
func NewESDTFreezeWipeFunc( esdtStorageHandler vmcommon.ESDTNFTStorageHandler, enableEpochsHandler vmcommon.EnableEpochsHandler, marshaller vmcommon.Marshalizer, freeze bool, wipe bool, ) (*esdtFreezeWipe, error)
NewESDTFreezeWipeFunc returns the esdt freeze/un-freeze/wipe built-in function component
func NewESDTGlobalSettingsFunc ¶
func NewESDTGlobalSettingsFunc( accounts vmcommon.AccountsAdapter, marshaller marshal.Marshalizer, set bool, function string, activeHandler func() bool, ) (*esdtGlobalSettings, error)
NewESDTGlobalSettingsFunc returns the esdt pause/un-pause built-in function component
func NewESDTLocalBurnFunc ¶
func NewESDTLocalBurnFunc( funcGasCost uint64, marshaller vmcommon.Marshalizer, globalSettingsHandler vmcommon.ExtendedESDTGlobalSettingsHandler, rolesHandler vmcommon.ESDTRoleHandler, ) (*esdtLocalBurn, error)
NewESDTLocalBurnFunc returns the esdt local burn built-in function component
func NewESDTLocalMintFunc ¶
func NewESDTLocalMintFunc( funcGasCost uint64, marshaller vmcommon.Marshalizer, globalSettingsHandler vmcommon.ESDTGlobalSettingsHandler, rolesHandler vmcommon.ESDTRoleHandler, ) (*esdtLocalMint, error)
NewESDTLocalMintFunc returns the esdt local mint built-in function component
func NewESDTNFTAddQuantityFunc ¶
func NewESDTNFTAddQuantityFunc( funcGasCost uint64, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, globalSettingsHandler vmcommon.ESDTGlobalSettingsHandler, rolesHandler vmcommon.ESDTRoleHandler, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*esdtNFTAddQuantity, error)
NewESDTNFTAddQuantityFunc returns the esdt NFT add quantity built-in function component
func NewESDTNFTAddUriFunc ¶
func NewESDTNFTAddUriFunc( funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, globalSettingsHandler vmcommon.ESDTGlobalSettingsHandler, rolesHandler vmcommon.ESDTRoleHandler, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*esdtNFTAddUri, error)
NewESDTNFTAddUriFunc returns the esdt NFT add URI built-in function component
func NewESDTNFTBurnFunc ¶
func NewESDTNFTBurnFunc( funcGasCost uint64, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, globalSettingsHandler vmcommon.ExtendedESDTGlobalSettingsHandler, rolesHandler vmcommon.ESDTRoleHandler, ) (*esdtNFTBurn, error)
NewESDTNFTBurnFunc returns the esdt NFT burn built-in function component
func NewESDTNFTCreateFunc ¶
func NewESDTNFTCreateFunc( funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, marshaller vmcommon.Marshalizer, globalSettingsHandler vmcommon.ESDTGlobalSettingsHandler, rolesHandler vmcommon.ESDTRoleHandler, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, accounts vmcommon.AccountsAdapter, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*esdtNFTCreate, error)
NewESDTNFTCreateFunc returns the esdt NFT create built-in function component
func NewESDTNFTCreateRoleTransfer ¶
func NewESDTNFTCreateRoleTransfer( marshaller vmcommon.Marshalizer, accounts vmcommon.AccountsAdapter, shardCoordinator vmcommon.Coordinator, ) (*esdtNFTCreateRoleTransfer, error)
NewESDTNFTCreateRoleTransfer returns the esdt NFT create role transfer built-in function component
func NewESDTNFTMultiTransferFunc ¶
func NewESDTNFTMultiTransferFunc( funcGasCost uint64, marshaller vmcommon.Marshalizer, globalSettingsHandler vmcommon.ExtendedESDTGlobalSettingsHandler, accounts vmcommon.AccountsAdapter, shardCoordinator vmcommon.Coordinator, gasConfig vmcommon.BaseOperationCost, enableEpochsHandler vmcommon.EnableEpochsHandler, roleHandler vmcommon.ESDTRoleHandler, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, ) (*esdtNFTMultiTransfer, error)
NewESDTNFTMultiTransferFunc returns the esdt NFT multi transfer built-in function component
func NewESDTNFTTransferFunc ¶
func NewESDTNFTTransferFunc( funcGasCost uint64, marshaller vmcommon.Marshalizer, globalSettingsHandler vmcommon.ExtendedESDTGlobalSettingsHandler, accounts vmcommon.AccountsAdapter, shardCoordinator vmcommon.Coordinator, gasConfig vmcommon.BaseOperationCost, rolesHandler vmcommon.ESDTRoleHandler, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*esdtNFTTransfer, error)
NewESDTNFTTransferFunc returns the esdt NFT transfer built-in function component
func NewESDTNFTUpdateAttributesFunc ¶
func NewESDTNFTUpdateAttributesFunc( funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, esdtStorageHandler vmcommon.ESDTNFTStorageHandler, globalSettingsHandler vmcommon.ESDTGlobalSettingsHandler, rolesHandler vmcommon.ESDTRoleHandler, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*esdtNFTupdate, error)
NewESDTNFTUpdateAttributesFunc returns the esdt NFT update attribute built-in function component
func NewESDTRolesFunc ¶
NewESDTRolesFunc returns the esdt change roles built-in function component
func NewESDTTransferFunc ¶
func NewESDTTransferFunc( funcGasCost uint64, marshaller vmcommon.Marshalizer, globalSettingsHandler vmcommon.ExtendedESDTGlobalSettingsHandler, shardCoordinator vmcommon.Coordinator, rolesHandler vmcommon.ESDTRoleHandler, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*esdtTransfer, error)
NewESDTTransferFunc returns the esdt transfer built-in function component
func NewESDTTransferRoleAddressFunc ¶
func NewESDTTransferRoleAddressFunc( accounts vmcommon.AccountsAdapter, marshaller marshal.Marshalizer, maxNumAddresses uint32, set bool, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*esdtTransferAddress, error)
NewESDTTransferRoleAddressFunc returns the esdt transfer role address handler built-in function component
func NewPayableCheckFunc ¶
func NewPayableCheckFunc( payable vmcommon.PayableHandler, enableEpochsHandler vmcommon.EnableEpochsHandler, ) (*payableCheck, error)
NewPayableCheckFunc returns a new component which checks if destination is payableCheck when needed
func NewSaveKeyValueStorageFunc ¶
func NewSaveKeyValueStorageFunc( gasConfig vmcommon.BaseOperationCost, funcGasCost uint64, ) (*saveKeyValueStorage, error)
NewSaveKeyValueStorageFunc returns the save key-value storage built in function
Types ¶
type ArgsCreateBuiltInFunctionContainer ¶
type ArgsCreateBuiltInFunctionContainer struct { GasMap map[string]map[string]uint64 MapDNSAddresses map[string]struct{} EnableUserNameChange bool Marshalizer vmcommon.Marshalizer Accounts vmcommon.AccountsAdapter ShardCoordinator vmcommon.Coordinator EnableEpochsHandler vmcommon.EnableEpochsHandler MaxNumOfAddressesForTransferRole uint32 ConfigAddress []byte }
ArgsCreateBuiltInFunctionContainer defines the input arguments to create built in functions container
type ArgsNewESDTDataStorage ¶
type ArgsNewESDTDataStorage struct { Accounts vmcommon.AccountsAdapter GlobalSettingsHandler vmcommon.ESDTGlobalSettingsHandler Marshalizer vmcommon.Marshalizer EnableEpochsHandler vmcommon.EnableEpochsHandler ShardCoordinator vmcommon.Coordinator }
ArgsNewESDTDataStorage defines the argument list for new esdt data storage handler
type ArgsNewESDTDeleteMetadata ¶
type ArgsNewESDTDeleteMetadata struct { FuncGasCost uint64 Marshalizer vmcommon.Marshalizer Accounts vmcommon.AccountsAdapter AllowedAddress []byte Delete bool EnableEpochsHandler vmcommon.EnableEpochsHandler }
ArgsNewESDTDeleteMetadata defines the argument list for new esdt delete metadata built in function
type ESDTGlobalMetadata ¶
ESDTGlobalMetadata represents esdt global metadata saved on system account
func ESDTGlobalMetadataFromBytes ¶
func ESDTGlobalMetadataFromBytes(bytes []byte) ESDTGlobalMetadata
ESDTGlobalMetadataFromBytes creates a metadata object from bytes
func (*ESDTGlobalMetadata) ToBytes ¶
func (metadata *ESDTGlobalMetadata) ToBytes() []byte
ToBytes converts the metadata to bytes
type ESDTUserMetadata ¶
type ESDTUserMetadata struct {
Frozen bool
}
ESDTUserMetadata represents esdt user metadata saved on every account
func ESDTUserMetadataFromBytes ¶
func ESDTUserMetadataFromBytes(bytes []byte) ESDTUserMetadata
ESDTUserMetadataFromBytes creates a metadata object from bytes
func (*ESDTUserMetadata) ToBytes ¶
func (metadata *ESDTUserMetadata) ToBytes() []byte
ToBytes converts the metadata to bytes
Source Files ¶
- baseActiveHandler.go
- changeOwnerAddress.go
- claimDeveloperRewards.go
- container.go
- creator.go
- disabledPayable.go
- errors.go
- esdtBurn.go
- esdtDataStorage.go
- esdtDeleteMetadata.go
- esdtFreezeWipe.go
- esdtGlobalSettings.go
- esdtLocalBurn.go
- esdtLocalMint.go
- esdtMetaData.go
- esdtNFTAddQuantity.go
- esdtNFTAddUri.go
- esdtNFTBurn.go
- esdtNFTCreate.go
- esdtNFTCreateRoleTransfer.go
- esdtNFTTransfer.go
- esdtRoles.go
- esdtTransfer.go
- esdtTransferRole.go
- keyValueStorage.go
- logsAndEvents.go
- multiESDTNFTTransfer.go
- payable.go
- saveUserName.go
- updateNFTAttributes.go