Versions in this module Expand all Collapse all v0 v0.6.1 Jan 21, 2020 Changes in this version + var APPCALL_GAS uint64 = 10 + var APPCALL_NAME = "APPCALL" + var ATTRIBUTE_GETDATA_NAME = "Ontology.Attribute.GetData" + var ATTRIBUTE_GETUSAGE_NAME = "Ontology.Attribute.GetUsage" + var BLOCKCHAIN_GETBLOCK_GAS uint64 = 200 + var BLOCKCHAIN_GETBLOCK_NAME = "System.Blockchain.GetBlock" + var BLOCKCHAIN_GETCONTRACT_GAS uint64 = 100 + var BLOCKCHAIN_GETCONTRACT_NAME = "System.Blockchain.GetContract" + var BLOCKCHAIN_GETHEADER_GAS uint64 = 100 + var BLOCKCHAIN_GETHEADER_NAME = "System.Blockchain.GetHeader" + var BLOCKCHAIN_GETHEIGHT_NAME = "System.Blockchain.GetHeight" + var BLOCKCHAIN_GETTRANSACTIONHEIGHT_NAME = "System.Blockchain.GetTransactionHeight" + var BLOCKCHAIN_GETTRANSACTION_GAS uint64 = 100 + var BLOCKCHAIN_GETTRANSACTION_NAME = "System.Blockchain.GetTransaction" + var BLOCK_GETTRANSACTIONCOUNT_NAME = "System.Block.GetTransactionCount" + var BLOCK_GETTRANSACTIONS_NAME = "System.Block.GetTransactions" + var BLOCK_GETTRANSACTION_NAME = "System.Block.GetTransaction" + var BYTE_ZERO_20 = []byte + var CONTRACT_CREATE_GAS uint64 = 20000000 + var CONTRACT_CREATE_NAME = "Ontology.Contract.Create" + var CONTRACT_DESTROY_NAME = "System.Contract.Destroy" + var CONTRACT_GETSCRIPT_NAME = "Ontology.Contract.GetScript" + var CONTRACT_GETSTORAGECONTEXT_NAME = "System.Contract.GetStorageContext" + var CONTRACT_MIGRATE_GAS uint64 = 20000000 + var CONTRACT_MIGRATE_NAME = "Ontology.Contract.Migrate" + var CONTRACT_NOT_EXIST = errors.NewErr("[NeoVmService] the given contract does not exist!") + var DEPLOYCODE_TYPE_ERROR = errors.NewErr("[NeoVmService] deploy code type error!") + var DUPLICATE_STACK_SIZE int = 1024 * 2 + var ERR_CHECK_STACK_SIZE = errors.NewErr("[NeoVmService] vm execution exceeded the max stack size!") + var ERR_EXECUTE_CODE = errors.NewErr("[NeoVmService] vm execution code was invalid!") + var ERR_GAS_INSUFFICIENT = errors.NewErr("[NeoVmService] insufficient gas for transaction!") + var GAS_TABLE = initGAS_TABLE() + var GAS_TABLE_KEYS = []string + var GETCALLINGSCRIPTHASH_NAME = "System.ExecutionEngine.GetCallingScriptHash" + var GETENTRYSCRIPTHASH_NAME = "System.ExecutionEngine.GetEntryScriptHash" + var GETEXECUTINGSCRIPTHASH_NAME = "System.ExecutionEngine.GetExecutingScriptHash" + var GETSCRIPTCONTAINER_NAME = "System.ExecutionEngine.GetScriptContainer" + var HASH160_GAS uint64 = 20 + var HASH160_NAME = "HASH160" + var HASH256_GAS uint64 = 20 + var HASH256_NAME = "HASH256" + var HEADER_GETCONSENSUSDATA_NAME = "Ontology.Header.GetConsensusData" + var HEADER_GETHASH_NAME = "System.Header.GetHash" + var HEADER_GETINDEX_NAME = "System.Header.GetIndex" + var HEADER_GETMERKLEROOT_NAME = "Ontology.Header.GetMerkleRoot" + var HEADER_GETNEXTCONSENSUS_NAME = "Ontology.Header.GetNextConsensus" + var HEADER_GETPREVHASH_NAME = "System.Header.GetPrevHash" + var HEADER_GETTIMESTAMP_NAME = "System.Header.GetTimestamp" + var HEADER_GETVERSION_NAME = "Ontology.Header.GetVersion" + var INIT_GAS_TABLE = map[string]uint64 + var METHOD_LENGTH_LIMIT int = 1024 + var MIN_TRANSACTION_GAS uint64 = 20000 + var NATIVE_INVOKE_GAS uint64 = 1000 + var NATIVE_INVOKE_NAME = "Ontology.Native.Invoke" + var OPCODE_GAS uint64 = 1 + var PER_UNIT_CODE_LEN int = 1024 + var RUNTIME_ADDRESSTOBASE58_GAS uint64 = 40 + var RUNTIME_ADDRESSTOBASE58_NAME = "Ontology.Runtime.AddressToBase58" + var RUNTIME_BASE58TOADDRESS_GAS uint64 = 30 + var RUNTIME_BASE58TOADDRESS_NAME = "Ontology.Runtime.Base58ToAddress" + var RUNTIME_CHECKWITNESS_GAS uint64 = 200 + var RUNTIME_CHECKWITNESS_NAME = "System.Runtime.CheckWitness" + var RUNTIME_DESERIALIZE_NAME = "System.Runtime.Deserialize" + var RUNTIME_GETCURRENTBLOCKHASH_NAME = "Ontology.Runtime.GetCurrentBlockHash" + var RUNTIME_GETTIME_NAME = "System.Runtime.GetTime" + var RUNTIME_GETTRIGGER_NAME = "System.Runtime.GetTrigger" + var RUNTIME_LOG_NAME = "System.Runtime.Log" + var RUNTIME_NOTIFY_NAME = "System.Runtime.Notify" + var RUNTIME_SERIALIZE_NAME = "System.Runtime.Serialize" + var RUNTIME_VERIFYMUTISIG_GAS uint64 = 400 + var RUNTIME_VERIFYMUTISIG_NAME = "Ontology.Runtime.VerifyMutiSig" + var SHA1_GAS uint64 = 10 + var SHA1_NAME = "SHA1" + var SHA256_GAS uint64 = 10 + var SHA256_NAME = "SHA256" + var STORAGECONTEXT_ASREADONLY_NAME = "System.StorageContext.AsReadOnly" + var STORAGE_DELETE_GAS uint64 = 100 + var STORAGE_DELETE_NAME = "System.Storage.Delete" + var STORAGE_GETCONTEXT_NAME = "System.Storage.GetContext" + var STORAGE_GETREADONLYCONTEXT_NAME = "System.Storage.GetReadOnlyContext" + var STORAGE_GET_GAS uint64 = 200 + var STORAGE_GET_NAME = "System.Storage.Get" + var STORAGE_PUT_GAS uint64 = 4000 + var STORAGE_PUT_NAME = "System.Storage.Put" + var ServiceMap = map[string]Service + var TAILCALL_GAS uint64 = 10 + var TAILCALL_NAME = "TAILCALL" + var TRANSACTION_GETATTRIBUTES_NAME = "Ontology.Transaction.GetAttributes" + var TRANSACTION_GETHASH_NAME = "System.Transaction.GetHash" + var TRANSACTION_GETTYPE_NAME = "Ontology.Transaction.GetType" + var UINT_DEPLOY_CODE_LEN_GAS uint64 = 200000 + var UINT_DEPLOY_CODE_LEN_NAME = "Deploy.Code.Gas" + var UINT_INVOKE_CODE_LEN_GAS uint64 = 20000 + var UINT_INVOKE_CODE_LEN_NAME = "Invoke.Code.Gas" + var VM_EXEC_FAULT = errors.NewErr("[NeoVmService] vm execution encountered a state fault!") + var VM_EXEC_STEP_EXCEED = errors.NewErr("[NeoVmService] vm execution exceeded the step limit!") + var VM_STEP_LIMIT int = 400000 + func AttributeGetData(service *NeoVmService, engine *vm.ExecutionEngine) error + func AttributeGetUsage(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockChainGetBlock(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockChainGetContract(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockChainGetHeader(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockChainGetHeight(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockChainGetTransaction(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockChainGetTransactionHeight(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockGetTransaction(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockGetTransactionCount(service *NeoVmService, engine *vm.ExecutionEngine) error + func BlockGetTransactions(service *NeoVmService, engine *vm.ExecutionEngine) error + func BuildParamToNative(bf *bytes.Buffer, item types.StackItems) error + func CircularRefAndDepthDetection(value vmtypes.StackItems) bool + func ContractCreate(service *NeoVmService, engine *vm.ExecutionEngine) error + func ContractDestory(service *NeoVmService, engine *vm.ExecutionEngine) error + func ContractGetCode(service *NeoVmService, engine *vm.ExecutionEngine) error + func ContractGetStorageContext(service *NeoVmService, engine *vm.ExecutionEngine) error + func ContractMigrate(service *NeoVmService, engine *vm.ExecutionEngine) error + func DeserializeStackItem(r io.Reader) (items vmtypes.StackItems, err error) + func GasPrice(engine *vm.ExecutionEngine, name string) (uint64, error) + func GetCallingAddress(service *NeoVmService, engine *vm.ExecutionEngine) error + func GetCodeContainer(service *NeoVmService, engine *vm.ExecutionEngine) error + func GetEntryAddress(service *NeoVmService, engine *vm.ExecutionEngine) error + func GetExecutingAddress(service *NeoVmService, engine *vm.ExecutionEngine) error + func HeaderGetConsensusData(service *NeoVmService, engine *vm.ExecutionEngine) error + func HeaderGetHash(service *NeoVmService, engine *vm.ExecutionEngine) error + func HeaderGetIndex(service *NeoVmService, engine *vm.ExecutionEngine) error + func HeaderGetMerkleRoot(service *NeoVmService, engine *vm.ExecutionEngine) error + func HeaderGetNextConsensus(service *NeoVmService, engine *vm.ExecutionEngine) error + func HeaderGetPrevHash(service *NeoVmService, engine *vm.ExecutionEngine) error + func HeaderGetTimestamp(service *NeoVmService, engine *vm.ExecutionEngine) error + func HeaderGetVersion(service *NeoVmService, engine *vm.ExecutionEngine) error + func NativeInvoke(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeAddressToBase58(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeBase58ToAddress(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeCheckWitness(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeDeserialize(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeGetCurrentBlockHash(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeGetTime(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeGetTrigger(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeLog(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeNotify(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeSerialize(service *NeoVmService, engine *vm.ExecutionEngine) error + func RuntimeVerifyMutiSig(service *NeoVmService, engine *vm.ExecutionEngine) error + func SerializeStackItem(item vmtypes.StackItems) ([]byte, error) + func StorageContextAsReadOnly(service *NeoVmService, engine *vm.ExecutionEngine) error + func StorageDelete(service *NeoVmService, engine *vm.ExecutionEngine) error + func StorageGet(service *NeoVmService, engine *vm.ExecutionEngine) error + func StorageGetContext(service *NeoVmService, engine *vm.ExecutionEngine) error + func StorageGetReadOnlyContext(service *NeoVmService, engine *vm.ExecutionEngine) error + func StoragePut(service *NeoVmService, engine *vm.ExecutionEngine) error + func StoreGasCost(engine *vm.ExecutionEngine) (uint64, error) + func TransactionGetAttributes(service *NeoVmService, engine *vm.ExecutionEngine) error + func TransactionGetHash(service *NeoVmService, engine *vm.ExecutionEngine) error + func TransactionGetType(service *NeoVmService, engine *vm.ExecutionEngine) error + type Execute func(service *NeoVmService, engine *vm.ExecutionEngine) error + type NeoVmService struct + BlockHash scommon.Uint256 + CacheDB *storage.CacheDB + Code []byte + ContextRef context.ContextRef + Engine *vm.ExecutionEngine + Height uint32 + Notifications []*event.NotifyEventInfo + PreExec bool + Store store.LedgerStore + Time uint32 + Tx *types.Transaction + func (this *NeoVmService) Invoke() (interface{}, error) + func (this *NeoVmService) SystemCall(engine *vm.ExecutionEngine) error + type Service struct + Execute Execute + Validator Validator + type StorageContext struct + Address common.Address + IsReadOnly bool + func NewStorageContext(address common.Address) *StorageContext + func (this *StorageContext) ToArray() []byte + type Validator func(engine *vm.ExecutionEngine) error