Skip to content

lambdaclass/era_vm

Repository files navigation

EraVM

Requirements

Compiling programs

Note: This is a bit rough right now, it'll get better in the coming days when we add proper testing and other stuff.

To try out a program, write it in yul and put it under the programs directory, then run

make compile-programs

which compiles every program and puts the resulting artifacts in the program_artifacts directory.

As an example, there's an add.yul sample program right now. After compiling it, you'll see (among others) the following files in program_artifacts/add.artifacts:

  • add.yul.zasm: The resulting EraVM assembly generated from the yul code. It's a good idea to look at it to see the assembly that's actually going to run.
  • add.yul.zbin: The bytecode to be run (i.e. the assembled version of the zasm file above).
  • programs_add.yul.runtime.optimized.ll: The optimized LLVM IR generated by the compiler.
  • programs_add.yul.runtime.unoptimized.ll: The unoptimized LLVM IR generated by the compiler.

Running programs

After compiling, you can run any program by passing the binary file to the interpreter with:

cargo run -- <path_to_bin>

As an example, if you are running the add.yul program mentioned above, you need to run

cargo run -- program_artifacts/add.artifacts.yul/programs/add.yul.zbin

Documentation

Documentation can be found under the docs folder. Still a work in progress.

Useful references

Releases

No releases published

Packages

No packages published