Install wasm-pack: cargo install wasm-pack
cd js
yarn build
You can use the compile
binary to compile Polylang functions to Miden. Compile outputs the generated Miden assembly to stdout, you can pipe it to miden-run
to run it.
$ cargo run --bin compile -- contract:Account function:setName <<<'contract Account { id: string; name: string; function setName(newName: string) { this.name = newName; } }'
$ cargo run --bin compile -- contract:Account function:setName <<<'contract Account { id: string; name: string; function setName(newName: string) { this.name = newName; } }' \
| cargo run -p miden-run -- \
--this-json '{ "id": "id1", "name": "John" }' \
--advice-tape-json '["Tom"]'
# Output: this_json: {"id":"id1","name":"Tom"}
$ cargo run --bin compile -- function:main <<<'function main() { }' | cargo run -p miden-run
cargo test && (cd parser && cargo test)
Contributions of all sorts (bug reports, enhancement requests etc.) are welcome. For more information on contribution tips and guidelines, please see the Contributing page.