Versions in this module Expand all Collapse all v0 v0.1.1 Jul 7, 2023 Changes in this version + const BuiltInFunctionDCTSetBurnRoleForAll + const BuiltInFunctionDCTTransferRoleAddAddress + const BuiltInFunctionDCTTransferRoleDeleteAddress + const BuiltInFunctionDCTUnSetBurnRoleForAll + const DCTAddMetadata + const DCTDeleteMetadata + const DCTRoleBurnForAll + const MaxLengthForValueToOptTransfer + const MetadataPayable + const MetadataPayableBySC + const MetadataReadable + const MetadataUpgradeable + const NumInitCharactersForScAddress + const ShardIdentiferLen + const VMTypeLen + var ErrSubtractionOverflow = errors.New("uint64 subtraction overflowed") + var SystemAccountAddress = bytes.Repeat([]byte{ ... }, 32) + func IsAllowedToSaveUnderKey(key []byte) bool + func IsEmptyAddress(address []byte) bool + func IsMetachainIdentifier(identifier []byte) bool + func IsSmartContractAddress(rcvAddress []byte) bool + func IsSmartContractOnMetachain(identifier []byte, rcvAddress []byte) bool + func IsSystemAccountAddress(address []byte) bool + func SafeSubUint64(a, b uint64) (uint64, error) + func ValidateToken(tokenID []byte) bool + func ZeroValueIfNil(value *big.Int) *big.Int + type AcceptPayableChecker interface + IsInterfaceNil func() bool + SetPayableChecker func(payableHandler PayableChecker) error + type AccountDataHandler interface + IsInterfaceNil func() bool + RetrieveValue func(key []byte) ([]byte, uint32, error) + SaveKeyValue func(key []byte, value []byte) error + type AccountHandler interface + AddressBytes func() []byte + GetNonce func() uint64 + IncreaseNonce func(nonce uint64) + IsInterfaceNil func() bool + type AccountsAdapter interface + Commit func() ([]byte, error) + GetCode func(codeHash []byte) []byte + GetExistingAccount func(address []byte) (AccountHandler, error) + IsInterfaceNil func() bool + JournalLen func() int + LoadAccount func(address []byte) (AccountHandler, error) + RemoveAccount func(address []byte) error + RevertToSnapshot func(snapshot int) error + RootHash func() ([]byte, error) + SaveAccount func(account AccountHandler) error + type BaseOperationCost struct + AoTPreparePerByte uint64 + CompilePerByte uint64 + DataCopyPerByte uint64 + PersistPerByte uint64 + ReleasePerByte uint64 + StorePerByte uint64 + type BlockchainHook interface + ClearCompiledCodes func() + CurrentEpoch func() uint32 + CurrentNonce func() uint64 + CurrentRandomSeed func() []byte + CurrentRound func() uint64 + CurrentTimeStamp func() uint64 + GetAllState func(address []byte) (map[string][]byte, error) + GetBlockhash func(nonce uint64) ([]byte, error) + GetBuiltinFunctionNames func() FunctionNames + GetCode func(UserAccountHandler) []byte + GetCompiledCode func(codeHash []byte) (bool, []byte) + GetDCTToken func(address []byte, tokenID []byte, nonce uint64) (*dct.DCToken, error) + GetShardOfAddress func(address []byte) uint32 + GetSnapshot func() int + GetStateRootHash func() []byte + GetStorageData func(accountAddress []byte, index []byte) ([]byte, uint32, error) + GetUserAccount func(address []byte) (UserAccountHandler, error) + IsInterfaceNil func() bool + IsLimitedTransfer func(tokenID []byte) bool + IsPaused func(tokenID []byte) bool + IsPayable func(sndAddress []byte, recvAddress []byte) (bool, error) + IsSmartContract func(address []byte) bool + LastEpoch func() uint32 + LastNonce func() uint64 + LastRandomSeed func() []byte + LastRound func() uint64 + LastTimeStamp func() uint64 + NewAddress func(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error) + ProcessBuiltInFunction func(input *ContractCallInput) (*VMOutput, error) + RevertToSnapshot func(snapshot int) error + SaveCompiledCode func(codeHash []byte, code []byte) + type BuiltInCost struct + ChangeOwnerAddress uint64 + ClaimDeveloperRewards uint64 + DCTBurn uint64 + DCTLocalBurn uint64 + DCTLocalMint uint64 + DCTNFTAddQuantity uint64 + DCTNFTAddURI uint64 + DCTNFTBurn uint64 + DCTNFTChangeCreateOwner uint64 + DCTNFTCreate uint64 + DCTNFTMultiTransfer uint64 + DCTNFTTransfer uint64 + DCTNFTUpdateAttributes uint64 + DCTTransfer uint64 + SaveKeyValue uint64 + SaveUserName uint64 + type BuiltInFunctionContainer interface + Add func(key string, function BuiltinFunction) error + Get func(key string) (BuiltinFunction, error) + IsInterfaceNil func() bool + Keys func() map[string]struct{} + Len func() int + Remove func(key string) + Replace func(key string, function BuiltinFunction) error + type BuiltInFunctionFactory interface + BuiltInFunctionContainer func() BuiltInFunctionContainer + CreateBuiltInFunctionContainer func() error + DCTGlobalSettingsHandler func() DCTGlobalSettingsHandler + IsInterfaceNil func() bool + NFTStorageHandler func() SimpleDCTNFTStorageHandler + SetPayableHandler func(handler PayableHandler) error + type BuiltinFunction interface + IsActive func() bool + IsInterfaceNil func() bool + ProcessBuiltinFunction func(acntSnd, acntDst UserAccountHandler, vmInput *ContractCallInput) (*VMOutput, error) + SetNewGasConfig func(gasCost *GasCost) + type CallArgsParser interface + IsInterfaceNil func() bool + ParseArguments func(data string) ([][]byte, error) + ParseData func(data string) (string, [][]byte, error) + type CodeMetadata struct + Payable bool + PayableBySC bool + Readable bool + Upgradeable bool + func CodeMetadataFromBytes(bytes []byte) CodeMetadata + func (metadata *CodeMetadata) ToBytes() []byte + type ContractCallInput struct + AllowInitFunction bool + Function string + RecipientAddr []byte + type ContractCreateInput struct + ContractCode []byte + ContractCodeMetadata []byte + type Coordinator interface + CommunicationIdentifier func(destShardID uint32) string + ComputeId func(address []byte) uint32 + IsInterfaceNil func() bool + NumberOfShards func() uint32 + SameShard func(firstAddress, secondAddress []byte) bool + SelfId func() uint32 + type CryptoHook interface + Ecrecover func(hash []byte, recoveryID []byte, r []byte, s []byte) ([]byte, error) + IsInterfaceNil func() bool + Keccak256 func(data []byte) ([]byte, error) + Ripemd160 func(data []byte) ([]byte, error) + Sha256 func(data []byte) ([]byte, error) + type DCTGlobalSettingsHandler interface + IsInterfaceNil func() bool + IsLimitedTransfer func(dctTokenKey []byte) bool + IsPaused func(dctTokenKey []byte) bool + type DCTNFTStorageHandler interface + AddToLiquiditySystemAcc func(dctTokenKey []byte, nonce uint64, transferValue *big.Int) error + GetDCTNFTTokenOnDestination func(acnt UserAccountHandler, dctTokenKey []byte, nonce uint64) (*dct.DCToken, bool, error) + GetDCTNFTTokenOnDestinationWithCustomSystemAccount func(accnt UserAccountHandler, dctTokenKey []byte, nonce uint64, ...) (*dct.DCToken, bool, error) + GetDCTNFTTokenOnSender func(acnt UserAccountHandler, dctTokenKey []byte, nonce uint64) (*dct.DCToken, error) + IsInterfaceNil func() bool + SaveDCTNFTToken func(senderAddress []byte, acnt UserAccountHandler, dctTokenKey []byte, ...) ([]byte, error) + SaveNFTMetaDataToSystemAccount func(tx data.TransactionHandler) error + WasAlreadySentToDestinationShardAndUpdateState func(tickerID []byte, nonce uint64, dstAddress []byte) (bool, error) + type DCTRoleHandler interface + CheckAllowedToExecute func(account UserAccountHandler, tokenID []byte, action []byte) error + IsInterfaceNil func() bool + type DCTTransfer struct + DCTTokenName []byte + DCTTokenNonce uint64 + DCTTokenType uint32 + DCTValue *big.Int + type DCTTransferParser interface + IsInterfaceNil func() bool + ParseDCTTransfers func(sndAddr []byte, rcvAddr []byte, function string, args [][]byte) (*ParsedDCTTransfers, error) + type EnableEpochsHandler interface + CheckExecuteReadOnlyEnableEpoch func() uint32 + CreateNFTThroughExecByCallerEnableEpoch func() uint32 + DisableExecByCallerEnableEpoch func() uint32 + FixFailExecutionOnErrorEnableEpoch func() uint32 + FixOOGReturnCodeEnableEpoch func() uint32 + IsAheadOfTimeGasUsageFlagEnabled func() bool + IsAlwaysSaveTokenMetaDataEnabled func() bool + IsBuiltInFunctionsFlagEnabled func() bool + IsCheckCorrectTokenIDForTransferRoleFlagEnabled func() bool + IsCheckExecuteOnReadOnlyFlagEnabled func() bool + IsCheckFrozenCollectionFlagEnabled func() bool + IsCheckFunctionArgumentFlagEnabled func() bool + IsCheckTransferFlagEnabled func() bool + IsCreateNFTThroughExecByCallerFlagEnabled func() bool + IsDCTNFTImprovementV1FlagEnabled func() bool + IsDCTTransferRoleFlagEnabled func() bool + IsDisableExecByCallerFlagEnabled func() bool + IsFailExecutionOnEveryAPIErrorFlagEnabled func() bool + IsFixAsyncCallbackCheckFlagEnabled func() bool + IsFixOOGReturnCodeFlagEnabled func() bool + IsFixOldTokenLiquidityEnabled func() bool + IsGlobalMintBurnFlagEnabled func() bool + IsInterfaceNil func() bool + IsManagedCryptoAPIsFlagEnabled func() bool + IsMaxBlockchainHookCountersFlagEnabled func() bool + IsMultiDCTTransferFixOnCallBackFlagEnabled func() bool + IsRefactorContextFlagEnabled func() bool + IsRemoveNonUpdatedStorageFlagEnabled func() bool + IsRepairCallbackFlagEnabled func() bool + IsRuntimeCodeSizeFixEnabled func() bool + IsRuntimeMemStoreLimitEnabled func() bool + IsSCDeployFlagEnabled func() bool + IsSaveToSystemAccountFlagEnabled func() bool + IsSendAlwaysFlagEnabled func() bool + IsStorageAPICostOptimizationFlagEnabled func() bool + IsTransferToMetaFlagEnabled func() bool + IsValueLengthCheckFlagEnabled func() bool + IsWipeSingleNFTLiquidityDecreaseEnabled func() bool + ManagedCryptoAPIEnableEpoch func() uint32 + MultiDCTTransferAsyncCallBackEnableEpoch func() uint32 + RefactorContextEnableEpoch func() uint32 + RemoveNonUpdatedStorageEnableEpoch func() uint32 + StorageAPICostOptimizationEnableEpoch func() uint32 + type EpochNotifier interface + IsInterfaceNil func() bool + RegisterNotifyHandler func(handler EpochSubscriberHandler) + type EpochSubscriberHandler interface + EpochConfirmed func(epoch uint32, timestamp uint64) + IsInterfaceNil func() bool + type ExtendedDCTGlobalSettingsHandler interface + IsBurnForAll func(dctTokenKey []byte) bool + IsInterfaceNil func() bool + IsLimitedTransfer func(dctTokenKey []byte) bool + IsPaused func(dctTokenKey []byte) bool + IsSenderOrDestinationWithTransferRole func(sender, destination, tokenID []byte) bool + type FunctionNames = map[string]struct + type GasCost struct + BaseOperationCost BaseOperationCost + BuiltInCost BuiltInCost + type LogEntry struct + Address []byte + Data []byte + Identifier []byte + Topics [][]byte + type Marshalizer interface + IsInterfaceNil func() bool + Marshal func(obj interface{}) ([]byte, error) + Unmarshal func(obj interface{}, buff []byte) error + type OutputAccount struct + Address []byte + Balance *big.Int + BalanceDelta *big.Int + BytesAddedToStorage uint64 + BytesDeletedFromStorage uint64 + Code []byte + CodeDeployerAddress []byte + CodeMetadata []byte + GasUsed uint64 + Nonce uint64 + OutputTransfers []OutputTransfer + StorageUpdates map[string]*StorageUpdate + func (o *OutputAccount) MergeOutputAccounts(outAcc *OutputAccount) + func (o *OutputAccount) MergeStorageUpdates(outAcc *OutputAccount) + type OutputTransfer struct + CallType vm.CallType + Data []byte + GasLimit uint64 + GasLocked uint64 + SenderAddress []byte + Value *big.Int + type ParsedDCTTransfers struct + CallArgs [][]byte + CallFunction string + DCTTransfers []*DCTTransfer + RcvAddr []byte + type PayableChecker interface + CheckPayable func(vmInput *ContractCallInput, dstAddress []byte, minLenArguments int) error + DetermineIsSCCallAfter func(vmInput *ContractCallInput, destAddress []byte, minLenArguments int) bool + IsInterfaceNil func() bool + type PayableHandler interface + IsInterfaceNil func() bool + IsPayable func(sndAddress, rcvAddress []byte) (bool, error) + type ReturnCode int + const AccountCollision + const CallStackOverFlow + const ContractInvalid + const ContractNotFound + const ExecutionFailed + const FunctionNotFound + const FunctionWrongSignature + const Ok + const OutOfFunds + const OutOfGas + const SimulateFailed + const UpgradeFailed + const UserError + func (rc ReturnCode) String() string + type SimpleDCTNFTStorageHandler interface + GetDCTNFTTokenOnDestination func(accnt UserAccountHandler, dctTokenKey []byte, nonce uint64) (*dct.DCToken, bool, error) + IsInterfaceNil func() bool + SaveNFTMetaDataToSystemAccount func(tx data.TransactionHandler) error + type StorageUpdate struct + Data []byte + Offset []byte + Written bool + type UserAccountHandler interface + AccountDataHandler func() AccountDataHandler + AddToBalance func(value *big.Int) error + ChangeOwnerAddress func([]byte, []byte) error + ClaimDeveloperRewards func([]byte) (*big.Int, error) + GetBalance func() *big.Int + GetCodeHash func() []byte + GetCodeMetadata func() []byte + GetDeveloperReward func() *big.Int + GetOwnerAddress func() []byte + GetRootHash func() []byte + GetUserName func() []byte + SetOwnerAddress func([]byte) + SetUserName func(userName []byte) + type VMExecutionHandler interface + GasScheduleChange func(newGasSchedule map[string]map[string]uint64) + GetVersion func() string + IsInterfaceNil func() bool + RunSmartContractCall func(input *ContractCallInput) (*VMOutput, error) + RunSmartContractCreate func(input *ContractCreateInput) (*VMOutput, error) + type VMInput struct + Arguments [][]byte + CallType vm.CallType + CallValue *big.Int + CallerAddr []byte + CurrentTxHash []byte + DCTTransfers []*DCTTransfer + GasLocked uint64 + GasPrice uint64 + GasProvided uint64 + OriginalTxHash []byte + PrevTxHash []byte + ReturnCallAfterError bool + type VMOutput struct + DeletedAccounts [][]byte + GasRefund *big.Int + GasRemaining uint64 + Logs []*LogEntry + OutputAccounts map[string]*OutputAccount + ReturnCode ReturnCode + ReturnData [][]byte + ReturnMessage string + TouchedAccounts [][]byte + func (vmOutput *VMOutput) GetFirstReturnData(asType vm.ReturnDataKind) (interface{}, error)