Versions in this module Expand all Collapse all v0 v0.0.1 Jun 8, 2022 Changes in this version + 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) + type AcceptPayableHandler interface + IsInterfaceNil func() bool + SetPayableHandler func(payableHandler PayableHandler) 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) + RecreateTrie func(rootHash []byte) 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) + GetMECToken func(address []byte, tokenID []byte, nonce uint64) (*mec.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 + MECBurn uint64 + MECLocalBurn uint64 + MECLocalMint uint64 + MECNFTAddQuantity uint64 + MECNFTAddURI uint64 + MECNFTBurn uint64 + MECNFTChangeCreateOwner uint64 + MECNFTCreate uint64 + MECNFTMultiTransfer uint64 + MECNFTTransfer uint64 + MECNFTUpdateAttributes uint64 + MECTransfer 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 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 + 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 FunctionNames = map[string]struct + type GasCost struct + BaseOperationCost BaseOperationCost + BuiltInCost BuiltInCost + type LogEntry struct + Address []byte + Data []byte + Identifier []byte + Topics [][]byte + type MECGlobalSettingsHandler interface + IsInterfaceNil func() bool + IsLimitedTransfer func(mecTokenKey []byte) bool + IsPaused func(mecTokenKey []byte) bool + type MECNFTStorageHandler interface + GetMECNFTTokenOnDestination func(acnt UserAccountHandler, mecTokenKey []byte, nonce uint64) (*mec.MECToken, bool, error) + GetMECNFTTokenOnSender func(acnt UserAccountHandler, mecTokenKey []byte, nonce uint64) (*mec.MECToken, error) + IsInterfaceNil func() bool + SaveMECNFTToken func(senderAddress []byte, acnt UserAccountHandler, mecTokenKey []byte, ...) ([]byte, error) + SaveNFTMetaDataToSystemAccount func(tx data.TransactionHandler) error + WasAlreadySentToDestinationShardAndUpdateState func(tickerID []byte, nonce uint64, dstAddress []byte) (bool, error) + type MECRoleHandler interface + CheckAllowedToExecute func(account UserAccountHandler, tokenID []byte, action []byte) error + IsInterfaceNil func() bool + type MECTransfer struct + MECTokenName []byte + MECTokenNonce uint64 + MECTokenType uint32 + MECValue *big.Int + type MECTransferParser interface + IsInterfaceNil func() bool + ParseMECTransfers func(sndAddr []byte, rcvAddr []byte, function string, args [][]byte) (*ParsedMECTransfers, 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 ParsedMECTransfers struct + CallArgs [][]byte + CallFunction string + MECTransfers []*MECTransfer + RcvAddr []byte + 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 SimpleMECNFTStorageHandler interface + GetMECNFTTokenOnDestination func(accnt UserAccountHandler, mecTokenKey []byte, nonce uint64) (*mec.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 + MECTransfers []*MECTransfer + 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)