syuhei176 / ovm-compiler

Compiler and Utilities for OVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ovm-compiler

Build Status

Usage

npm i @cryptoeconomicslab/ovm-compiler
const { Parser, SolidityCodeGenerator, Transpiler } = require('ovm-compiler')

const parser = new Parser()
const generator = new SolidityCodeGenerator()
const compiledPredicates = Transpiler.calculateInteractiveNodes(
  parser.parse(
    'def ownership(owner) := with Tx(su) as tx { SignedBy(tx, owner) }' +
      'def SignedBy(message, owner) := with Bytes() as signature {IsValidSignature(message, owner, signature)}'
  )
)
const result = generator.generate(compiledPredicates)
console.log(result)

Online Demo

https://ovm-compiler.netlify.com

Test

npm test

Roadmap

  • Plasma checkpoint example
  • Plasma exit example
  • Plasma ownership predicate example
  • Plasma swap predicate example
  • Plasma offline swap predicate example
  • Plasma fast finality predicate example
  • Plasma swap between main chain and Plasma chain predicate example
  • State channel example
  • Optimistic Rollup example
  • add parser
  • add byte code generator for ethereum
  • add code generator for Substrate
  • update language to write state transition

About

Compiler and Utilities for OVM


Languages

Language:TypeScript 84.7%Language:HTML 13.8%Language:JavaScript 1.5%