contract-vm

0.0.6 • Public • Published

Contract VM

This is an implementation of a minimalist smart contract system, written in TypeScript. Contracts are safely isolated in their own WebAssembly virtual machines.

This module is designed to be used in Node or the browser.

Usage

let Contract = require('contract-vm')
 
let bindings = {
  print(msg) {
    console.log(msg)
  }
}
 
let contract = Contract(codeBuffer, bindings)
 
let [result, gasCost] = contract.someMethod({ foo: 'bar' })

Features

  • Enforced determinism
  • Metered execution (ie. gas)
  • Lightweight and fast
  • Easily extensible with custom host bindings

Readme

Keywords

none

Package Sidebar

Install

npm i contract-vm

Weekly Downloads

1

Version

0.0.6

License

ISC

Unpacked Size

17.4 kB

Total Files

16

Last publish

Collaborators

  • kep