Documentation ¶
Index ¶
- Constants
- Variables
- func NewBuiltInFunctionContainer() *functionContainer
- func NewBuiltInFunctionsFactory(args ArgsCreateBuiltInFunctionContainer) (*builtInFuncFactory, error)
- func NewChangeOwnerAddressFunc(gasCost uint64) *changeOwnerAddress
- func NewClaimDeveloperRewardsFunc(gasCost uint64) *claimDeveloperRewards
- func NewDCTBurnFunc(funcGasCost uint64, marshalizer vmcommon.Marshalizer, ...) (*dctBurn, error)
- func NewDCTFreezeWipeFunc(marshalizer vmcommon.Marshalizer, freeze bool, wipe bool) (*dctFreezeWipe, error)
- func NewDCTLocalBurnFunc(funcGasCost uint64, marshalizer vmcommon.Marshalizer, ...) (*dctLocalBurn, error)
- func NewDCTLocalMintFunc(funcGasCost uint64, marshalizer vmcommon.Marshalizer, ...) (*dctLocalMint, error)
- func NewDCTNFTAddQuantityFunc(funcGasCost uint64, marshalizer vmcommon.Marshalizer, ...) (*dctNFTAddQuantity, error)
- func NewDCTNFTAddUriFunc(funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, ...) (*dctNFTAddUri, error)
- func NewDCTNFTBurnFunc(funcGasCost uint64, marshalizer vmcommon.Marshalizer, ...) (*dctNFTBurn, error)
- func NewDCTNFTCreateFunc(funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, ...) (*dctNFTCreate, error)
- func NewDCTNFTCreateRoleTransfer(marshalizer vmcommon.Marshalizer, accounts vmcommon.AccountsAdapter, ...) (*dctNFTCreateRoleTransfer, error)
- func NewDCTNFTMultiTransferFunc(funcGasCost uint64, marshalizer vmcommon.Marshalizer, ...) (*dctNFTMultiTransfer, error)
- func NewDCTNFTTransferFunc(funcGasCost uint64, marshalizer vmcommon.Marshalizer, ...) (*dctNFTTransfer, error)
- func NewDCTNFTUpdateAttributesFunc(funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, ...) (*dctNFTupdate, error)
- func NewDCTPauseFunc(accounts vmcommon.AccountsAdapter, pause bool) (*dctPause, error)
- func NewDCTRolesFunc(marshalizer vmcommon.Marshalizer, set bool) (*dctRoles, error)
- func NewDCTTransferFunc(funcGasCost uint64, marshalizer vmcommon.Marshalizer, ...) (*dctTransfer, error)
- func NewSaveKeyValueStorageFunc(gasConfig vmcommon.BaseOperationCost, funcGasCost uint64) (*saveKeyValueStorage, error)
- func NewSaveUserNameFunc(gasCost uint64, mapDnsAddresses map[string]struct{}, enableChange bool) (*saveUserName, error)
- func SetPayableHandler(container vmcommon.BuiltInFunctionContainer, ...) error
- type ArgsCreateBuiltInFunctionContainer
- type DCTGlobalMetadata
- type DCTUserMetadata
Constants ¶
const (
// MetadataFrozen is the location of frozen flag in the dct user meta data
MetadataFrozen = 1
)
const (
// MetadataPaused is the location of paused flag in the dct global meta data
MetadataPaused = 1
)
Variables ¶
var ErrAccountNotPayable = errors.New("sending value to non payable contract")
ErrAccountNotPayable will be sent when trying to send money to a non-payable account
var ErrActionNotAllowed = errors.New("action is not allowed")
ErrActionNotAllowed signals that action is not allowed
var ErrAddressIsNotDCTSystemSC = errors.New("destination is not system sc address")
ErrAddressIsNotDCTSystemSC 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 dct 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 ErrDCTIsFrozenForAccount = errors.New("account is frozen for this dct token")
ErrDCTIsFrozenForAccount signals that account is frozen for given dct token
var ErrDCTTokenIsPaused = errors.New("dct token is paused")
ErrDCTTokenIsPaused signals that dct token is paused
var ErrEmptyFunctionName = errors.New("empty function name")
ErrEmptyFunctionName signals that an empty function name has been provided
var ErrHigherNonceInBlock = errors.New("higher nonce in block")
ErrHigherNonceInBlock signals that a block with higher nonce than permitted has been provided
var ErrHigherRoundInBlock = errors.New("higher round in block")
ErrHigherRoundInBlock signals that a block with higher round than permitted 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 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 ErrInvalidNFTQuantity = errors.New("invalid NFT quantity")
ErrInvalidNFTQuantity signals that invalid NFT quantity was provided
var ErrInvalidPeerAccount = errors.New("invalid peer account")
ErrInvalidPeerAccount signals that a peer account is invalid
var ErrInvalidRcvAddr = errors.New("invalid receiver address")
ErrInvalidRcvAddr signals that an invalid receiver address was provided
var ErrInvalidShardCacherIdentifier = errors.New("invalid identifier for shard cacher")
ErrInvalidShardCacherIdentifier signals an invalid identifier
var ErrInvalidSndAddr = errors.New("invalid sender address")
ErrInvalidSndAddr signals that an invalid sender address was provided
var ErrMissingHeader = errors.New("missing header")
ErrMissingHeader signals that header of the block is missing
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 ErrNilBadTxHandler = errors.New("nil bad tx handler")
ErrNilBadTxHandler signals that bad tx handler is nil
var ErrNilBalanceComputationHandler = errors.New("nil balance computation handler")
ErrNilBalanceComputationHandler signals that a nil balance computation handler has been provided
var ErrNilBlockHeader = errors.New("nil block header")
ErrNilBlockHeader signals that an operation has been attempted to or with a nil block header
var ErrNilBlockTracker = errors.New("nil block tracker")
ErrNilBlockTracker signals that a nil block tracker was provided
var ErrNilBootStorer = errors.New("nil boot storer")
ErrNilBootStorer signals that the provided boot storer is bil
var ErrNilContainerElement = errors.New("element cannot be nil")
ErrNilContainerElement signals when trying to add a nil element in the container
var ErrNilDataToProcess = errors.New("nil data to process")
ErrNilDataToProcess signals that nil data was provided
var ErrNilDnsAddresses = errors.New("nil dns addresses map")
ErrNilDnsAddresses signals that nil dns addresses map was provided
var ErrNilEpochHandler = errors.New("nil epoch handler")
ErrNilEpochHandler signals that a nil epoch handler was provided
var ErrNilFallbackHeaderValidator = errors.New("nil fallback header validator")
ErrNilFallbackHeaderValidator signals that a nil fallback header validator has been provided
var ErrNilForkDetector = errors.New("nil fork detector")
ErrNilForkDetector signals that the fork detector is nil
var ErrNilGasHandler = errors.New("nil gas handler")
ErrNilGasHandler signals that gas handler is nil
var ErrNilHdrValidator = errors.New("nil header validator")
ErrNilHdrValidator signals that a nil header validator has been provided
var ErrNilHeaderIntegrityVerifier = errors.New("nil header integrity verifier")
ErrNilHeaderIntegrityVerifier signals that a nil header integrity verifier 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 ErrNilOrEmptyList = errors.New("nil or empty provided list")
ErrNilOrEmptyList signals that a nil or empty list was provided
var ErrNilPauseHandler = errors.New("nil pause handler")
ErrNilPauseHandler signals that nil pause handler has been provided
var ErrNilPayableHandler = errors.New("nil payableHandler was provided")
ErrNilPayableHandler signals that nil payableHandler was provided
var ErrNilPoolsHolder = errors.New("nil pools holder")
ErrNilPoolsHolder signals that an operation has been attempted to or with a nil pools holder object
var ErrNilPreProcessor = errors.New("preprocessor is nil")
ErrNilPreProcessor signals that preprocessors is nil
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 ErrNilScAddress = errors.New("nil SC address")
ErrNilScAddress signals that a nil smart contract address has been provided
var ErrNilShardCoordinator = errors.New("nil shard coordinator")
ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator
var ErrNilShardedDataCacherNotifier = errors.New("nil sharded data cacher notifier")
ErrNilShardedDataCacherNotifier signals that a nil sharded data cacher notifier has been provided
var ErrNilSingleSigner = errors.New("nil single signer")
ErrNilSingleSigner signals that a nil single signer is used
var ErrNilTransactionVersionChecker = errors.New("nil transaction version checker")
ErrNilTransactionVersionChecker signals that provided transaction version checker is nil
var ErrNilTxProcessor = errors.New("nil transactions processor")
ErrNilTxProcessor signals that a nil transactions processor was used
var ErrNilTxValidator = errors.New("nil transaction validator")
ErrNilTxValidator signals that a nil tx validator 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 ErrNotEpochStartBlock = errors.New("not epoch start block")
ErrNotEpochStartBlock signals that block is not of type epoch start
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 ErrUserNameChangeIsDisabled = errors.New("user name change is disabled")
ErrUserNameChangeIsDisabled signals the user name change is not allowed
var ErrWrongNFTOnDestination = errors.New("wrong NFT on destination")
ErrWrongNFTOnDestination signals the NFT is mismatched on destination - should never happen
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 NewBuiltInFunctionsFactory ¶ added in v0.0.6
func NewBuiltInFunctionsFactory(args ArgsCreateBuiltInFunctionContainer) (*builtInFuncFactory, error)
NewBuiltInFunctionsFactory creates a factory 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 NewDCTBurnFunc ¶
func NewDCTBurnFunc( funcGasCost uint64, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, ) (*dctBurn, error)
NewDCTBurnFunc returns the dct burn built-in function component
func NewDCTFreezeWipeFunc ¶
func NewDCTFreezeWipeFunc( marshalizer vmcommon.Marshalizer, freeze bool, wipe bool, ) (*dctFreezeWipe, error)
NewDCTFreezeWipeFunc returns the dct freeze/un-freeze/wipe built-in function component
func NewDCTLocalBurnFunc ¶
func NewDCTLocalBurnFunc( funcGasCost uint64, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, rolesHandler vmcommon.DCTRoleHandler, ) (*dctLocalBurn, error)
NewDCTLocalBurnFunc returns the dct local burn built-in function component
func NewDCTLocalMintFunc ¶
func NewDCTLocalMintFunc( funcGasCost uint64, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, rolesHandler vmcommon.DCTRoleHandler, ) (*dctLocalMint, error)
NewDCTLocalMintFunc returns the dct local mint built-in function component
func NewDCTNFTAddQuantityFunc ¶
func NewDCTNFTAddQuantityFunc( funcGasCost uint64, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, rolesHandler vmcommon.DCTRoleHandler, ) (*dctNFTAddQuantity, error)
NewDCTNFTAddQuantityFunc returns the dct NFT add quantity built-in function component
func NewDCTNFTAddUriFunc ¶
func NewDCTNFTAddUriFunc( funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, rolesHandler vmcommon.DCTRoleHandler, activationEpoch uint32, epochNotifier vmcommon.EpochNotifier, ) (*dctNFTAddUri, error)
NewDCTNFTAddUriFunc returns the dct NFT add URI built-in function component
func NewDCTNFTBurnFunc ¶
func NewDCTNFTBurnFunc( funcGasCost uint64, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, rolesHandler vmcommon.DCTRoleHandler, ) (*dctNFTBurn, error)
NewDCTNFTBurnFunc returns the dct NFT burn built-in function component
func NewDCTNFTCreateFunc ¶
func NewDCTNFTCreateFunc( funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, rolesHandler vmcommon.DCTRoleHandler, ) (*dctNFTCreate, error)
NewDCTNFTCreateFunc returns the dct NFT create built-in function component
func NewDCTNFTCreateRoleTransfer ¶
func NewDCTNFTCreateRoleTransfer( marshalizer vmcommon.Marshalizer, accounts vmcommon.AccountsAdapter, shardCoordinator vmcommon.Coordinator, ) (*dctNFTCreateRoleTransfer, error)
NewDCTNFTCreateRoleTransfer returns the dct NFT create role transfer built-in function component
func NewDCTNFTMultiTransferFunc ¶
func NewDCTNFTMultiTransferFunc( funcGasCost uint64, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, accounts vmcommon.AccountsAdapter, shardCoordinator vmcommon.Coordinator, gasConfig vmcommon.BaseOperationCost, activationEpoch uint32, epochNotifier vmcommon.EpochNotifier, ) (*dctNFTMultiTransfer, error)
NewDCTNFTMultiTransferFunc returns the dct NFT multi transfer built-in function component
func NewDCTNFTTransferFunc ¶
func NewDCTNFTTransferFunc( funcGasCost uint64, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, accounts vmcommon.AccountsAdapter, shardCoordinator vmcommon.Coordinator, gasConfig vmcommon.BaseOperationCost, ) (*dctNFTTransfer, error)
NewDCTNFTTransferFunc returns the dct NFT transfer built-in function component
func NewDCTNFTUpdateAttributesFunc ¶
func NewDCTNFTUpdateAttributesFunc( funcGasCost uint64, gasConfig vmcommon.BaseOperationCost, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, rolesHandler vmcommon.DCTRoleHandler, activationEpoch uint32, epochNotifier vmcommon.EpochNotifier, ) (*dctNFTupdate, error)
NewDCTNFTAddUriFunc returns the dct NFT update attribute built-in function component
func NewDCTPauseFunc ¶ added in v0.0.6
func NewDCTPauseFunc( accounts vmcommon.AccountsAdapter, pause bool, ) (*dctPause, error)
NewDCTPauseFunc returns the dct pause/un-pause built-in function component
func NewDCTRolesFunc ¶
func NewDCTRolesFunc( marshalizer vmcommon.Marshalizer, set bool, ) (*dctRoles, error)
NewDCTRolesFunc returns the dct change roles built-in function component
func NewDCTTransferFunc ¶
func NewDCTTransferFunc( funcGasCost uint64, marshalizer vmcommon.Marshalizer, pauseHandler vmcommon.DCTPauseHandler, shardCoordinator vmcommon.Coordinator, ) (*dctTransfer, error)
NewDCTTransferFunc returns the dct transfer built-in function component
func NewSaveKeyValueStorageFunc ¶
func NewSaveKeyValueStorageFunc( gasConfig vmcommon.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 v0.0.6
func SetPayableHandler(container vmcommon.BuiltInFunctionContainer, payableHandler vmcommon.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 vmcommon.Marshalizer Accounts vmcommon.AccountsAdapter ShardCoordinator vmcommon.Coordinator EpochNotifier vmcommon.EpochNotifier DCTNFTImprovementV1ActivationEpoch uint32 }
ArgsCreateBuiltInFunctionContainer -
type DCTGlobalMetadata ¶
type DCTGlobalMetadata struct {
Paused bool
}
DCTGlobalMetadata represents dct global metadata saved on system account
func DCTGlobalMetadataFromBytes ¶
func DCTGlobalMetadataFromBytes(bytes []byte) DCTGlobalMetadata
DCTGlobalMetadataFromBytes creates a metadata object from bytes
func (*DCTGlobalMetadata) ToBytes ¶
func (metadata *DCTGlobalMetadata) ToBytes() []byte
ToBytes converts the metadata to bytes
type DCTUserMetadata ¶
type DCTUserMetadata struct {
Frozen bool
}
DCTUserMetadata represents dct user metadata saved on every account
func DCTUserMetadataFromBytes ¶
func DCTUserMetadataFromBytes(bytes []byte) DCTUserMetadata
DCTUserMetadataFromBytes creates a metadata object from bytes
func (*DCTUserMetadata) ToBytes ¶
func (metadata *DCTUserMetadata) ToBytes() []byte
ToBytes converts the metadata to bytes
Source Files ¶
- baseEnabled.go
- changeOwnerAddress.go
- claimDeveloperRewards.go
- container.go
- dctBurn.go
- dctFreezeWipe.go
- dctLocalBurn.go
- dctLocalMint.go
- dctMetaData.go
- dctNFTAddQuantity.go
- dctNFTAddUri.go
- dctNFTBurn.go
- dctNFTCreate.go
- dctNFTCreateRoleTransfer.go
- dctNFTTransfer.go
- dctPause.go
- dctRoles.go
- dctTransfer.go
- disabledPayable.go
- errors.go
- factory.go
- keyValueStorage.go
- logsAndEvents.go
- multiDCTNFTTransfer.go
- saveUserName.go
- updateNFTAttributes.go