Versions in this module Expand all Collapse all v0 v0.0.2 Oct 5, 2022 v0.0.1 Oct 1, 2022 Changes in this version + const BuiltInFunctionMECTSetBurnRoleForAll + const BuiltInFunctionMECTTransferRoleAddAddress + const BuiltInFunctionMECTTransferRoleDeleteAddress + const BuiltInFunctionMECTUnSetBurnRoleForAll + const MECTAddMetadata + const MECTDeleteMetadata + const MECTRoleBurnForAll + 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 + type AcceptPayableChecker interface + IsInterfaceNil func() bool + SetPayableChecker func(payableHandler PayableChecker) error + type AccountDataHandler interface + IsInterfaceNil func() bool + RetrieveValue func(key []byte) ([]byte, 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) + GetMECTToken func(address []byte, tokenID []byte, nonce uint64) (*mect.MECToken, error) + GetShardOfAddress func(address []byte) uint32 + GetSnapshot func() int + GetStateRootHash func() []byte + GetStorageData func(accountAddress []byte, index []byte) ([]byte, 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 + MECTBurn uint64 + MECTLocalBurn uint64 + MECTLocalMint uint64 + MECTNFTAddQuantity uint64 + MECTNFTAddURI uint64 + MECTNFTBurn uint64 + MECTNFTChangeCreateOwner uint64 + MECTNFTCreate uint64 + MECTNFTMultiTransfer uint64 + MECTNFTTransfer uint64 + MECTNFTUpdateAttributes uint64 + MECTTransfer 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 + IsInterfaceNil func() bool + MECTGlobalSettingsHandler func() MECTGlobalSettingsHandler + NFTStorageHandler func() SimpleMECTNFTStorageHandler + 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 EpochNotifier interface + IsInterfaceNil func() bool + RegisterNotifyHandler func(handler EpochSubscriberHandler) + type EpochSubscriberHandler interface + EpochConfirmed func(epoch uint32, timestamp uint64) + IsInterfaceNil func() bool + type ExtendedMECTGlobalSettingsHandler interface + IsBurnForAll func(mectTokenKey []byte) bool + IsInterfaceNil func() bool + IsLimitedTransfer func(mectTokenKey []byte) bool + IsPaused func(mectTokenKey []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 MECTGlobalSettingsHandler interface + IsInterfaceNil func() bool + IsLimitedTransfer func(mectTokenKey []byte) bool + IsPaused func(mectTokenKey []byte) bool + type MECTNFTStorageHandler interface + AddToLiquiditySystemAcc func(mectTokenKey []byte, nonce uint64, transferValue *big.Int) error + GetMECTNFTTokenOnDestination func(acnt UserAccountHandler, mectTokenKey []byte, nonce uint64) (*mect.MECToken, bool, error) + GetMECTNFTTokenOnSender func(acnt UserAccountHandler, mectTokenKey []byte, nonce uint64) (*mect.MECToken, error) + IsInterfaceNil func() bool + SaveMECTNFTToken func(senderAddress []byte, acnt UserAccountHandler, mectTokenKey []byte, ...) ([]byte, error) + SaveNFTMetaDataToSystemAccount func(tx data.TransactionHandler) error + WasAlreadySentToDestinationShardAndUpdateState func(tickerID []byte, nonce uint64, dstAddress []byte) (bool, error) + type MECTRoleHandler interface + CheckAllowedToExecute func(account UserAccountHandler, tokenID []byte, action []byte) error + IsInterfaceNil func() bool + type MECTTransfer struct + MECTTokenName []byte + MECTTokenNonce uint64 + MECTTokenType uint32 + MECTValue *big.Int + type MECTTransferParser interface + IsInterfaceNil func() bool + ParseMECTTransfers func(sndAddr []byte, rcvAddr []byte, function string, args [][]byte) (*ParsedMECTTransfers, error) + 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 ParsedMECTTransfers struct + CallArgs [][]byte + CallFunction string + MECTTransfers []*MECTTransfer + 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 SimpleMECTNFTStorageHandler interface + GetMECTNFTTokenOnDestination func(accnt UserAccountHandler, mectTokenKey []byte, nonce uint64) (*mect.MECToken, 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 + GasLocked uint64 + GasPrice uint64 + GasProvided uint64 + MECTTransfers []*MECTTransfer + 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)