Versions in this module Expand all Collapse all v0 v0.7.2 Apr 16, 2020 v0.7.1 Apr 9, 2020 Changes in this version + var BLOCK_HEGHT_GAS uint64 = 1 + var CALLER_ADDRESS_GAS uint64 = 1 + var CALL_CONTRACT_GAS uint64 = 10 + var CHECKWITNESS_GAS uint64 = 200 + var CODE_CACHE_SIZE = 100 + var CONTRACT_CREATE_GAS uint64 = 20000000 + var CONTRACT_METHOD_NAME = "invoke" + var CONTRACT_MIGRATE_GAS uint64 = 20000000 + var CONTRACT_NOT_EXIST = errors.NewErr("[WasmVmService] Get contract code from db fail") + var CURRENT_BLOCK_HASH_GAS uint64 = 100 + var CURRENT_TX_HASH_GAS uint64 = 100 + var CodeCache *lru.ARCCache + var DEPLOYCODE_TYPE_ERROR = errors.NewErr("[WasmVmService] DeployCode type error!") + var ENTRY_ADDRESS_GAS uint64 = 1 + var ERR_CHECK_STACK_SIZE = errors.NewErr("[WasmVmService] vm over max stack size!") + var ERR_EXECUTE_CODE = errors.NewErr("[WasmVmService] vm execute code invalid!") + var ERR_GAS_INSUFFICIENT = errors.NewErr("[WasmVmService] gas insufficient") + var NATIVE_INVOKE_GAS uint64 = 1000 + var PER_UNIT_CODE_LEN uint64 = 1024 + var SELF_ADDRESS_GAS uint64 = 1 + var SHA256_GAS uint64 = 10 + var STORAGE_DELETE_GAS uint64 = 100 + var STORAGE_GET_GAS uint64 = 200 + var STORAGE_PUT_GAS uint64 = 4000 + var TIMESTAMP_GAS uint64 = 1 + var UINT_DEPLOY_CODE_LEN_GAS uint64 = 200000 + var VM_EXEC_FAULT = errors.NewErr("[WasmVmService] vm execute state fault!") + var VM_EXEC_STEP_EXCEED = errors.NewErr("[WasmVmService] vm execute step exceed!") + var VM_INIT_FAULT = errors.NewErr("[WasmVmService] vm init state fault!") + var VM_STEP_LIMIT = 40000000 + var WASM_CALLSTACK_LIMIT = 1024 + var WASM_MEM_LIMITATION uint64 = 10 * 1024 * 1024 + func BlockHeight(proc *exec.Process) uint32 + func CallContract(proc *exec.Process, contractAddr uint32, inputPtr uint32, inputLen uint32) uint32 + func CallOutputLength(proc *exec.Process) uint32 + func CallerAddress(proc *exec.Process, dst uint32) + func Checkwitness(proc *exec.Process, dst uint32) uint32 + func ContractCreate(proc *exec.Process, codePtr uint32, codeLen uint32, vmType uint32, ...) uint32 + func ContractDestroy(proc *exec.Process) + func ContractMigrate(proc *exec.Process, codePtr uint32, codeLen uint32, vmType uint32, ...) uint32 + func Debug(proc *exec.Process, ptr uint32, len uint32) + func EntryAddress(proc *exec.Process, dst uint32) + func GetCallOut(proc *exec.Process, dst uint32) + func GetCurrentBlockHash(proc *exec.Process, ptr uint32) uint32 + func GetCurrentTxHash(proc *exec.Process, ptr uint32) uint32 + func GetInput(proc *exec.Process, dst uint32) + func InputLength(proc *exec.Process) uint32 + func NewHostModule() *wasm.Module + func Notify(proc *exec.Process, ptr uint32, l uint32) + func RaiseException(proc *exec.Process, ptr uint32, len uint32) + func ReadWasmMemory(proc *exec.Process, ptr uint32, len uint32) ([]byte, error) + func ReadWasmModule(Code []byte, verify bool) (*exec.CompiledModule, error) + func Ret(proc *exec.Process, ptr uint32, len uint32) + func SelfAddress(proc *exec.Process, dst uint32) + func Sha256(proc *exec.Process, src uint32, slen uint32, dst uint32) + func StorageDelete(proc *exec.Process, keyPtr uint32, keyLen uint32) + func StorageRead(proc *exec.Process, keyPtr uint32, klen uint32, val uint32, vlen uint32, ...) uint32 + func StorageWrite(proc *exec.Process, keyPtr uint32, keyLen uint32, valPtr uint32, valLen uint32) + func Timestamp(proc *exec.Process) uint64 + type ContractType byte + const NATIVE_CONTRACT + const NEOVM_CONTRACT + const UNKOWN_CONTRACT + const WASMVM_CONTRACT + type Runtime struct + CallOutPut []byte + Input []byte + Output []byte + Service *WasmVmService + type WasmVmService struct + BlockHash common.Uint256 + CacheDB *storage.CacheDB + Code []byte + ContextRef context.ContextRef + ExecStep *uint64 + GasFactor uint64 + GasLimit *uint64 + GasPrice uint64 + Height uint32 + IsTerminate bool + Notifications []*event.NotifyEventInfo + PreExec bool + Store store.LedgerStore + Time uint32 + Tx *types.Transaction + func (this *WasmVmService) Invoke() (interface{}, error)