{"id":18797944,"url":"https://github.com/ewasm/hera","last_synced_at":"2025-04-09T22:18:55.732Z","repository":{"id":45877956,"uuid":"66198886","full_name":"ewasm/hera","owner":"ewasm","description":"Hera: Ewasm virtual machine conforming to the EVMC API","archived":false,"fork":false,"pushed_at":"2023-01-11T18:59:20.000Z","size":1001,"stargazers_count":182,"open_issues_count":35,"forks_count":49,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-09T22:18:51.887Z","etag":null,"topics":["ethereum","ewasm","vm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ewasm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-21T12:58:03.000Z","updated_at":"2024-12-23T01:05:11.000Z","dependencies_parsed_at":"2023-02-09T04:15:37.763Z","dependency_job_id":null,"html_url":"https://github.com/ewasm/hera","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewasm%2Fhera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewasm%2Fhera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewasm%2Fhera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewasm%2Fhera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ewasm","download_url":"https://codeload.github.com/ewasm/hera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119284,"owners_count":21050755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","ewasm","vm","webassembly"],"created_at":"2024-11-07T22:10:04.292Z","updated_at":"2025-04-09T22:18:55.712Z","avatar_url":"https://github.com/ewasm.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# Hera ![Status](https://circleci.com/gh/ewasm/hera.svg?style=shield\u0026circle-token=:circle-token)\n\nHera is an [ewasm] (revision 4) virtual machine implemented in C++ conforming to [EVMC] ABIv10.\n\nIt is designed to leverage various Wasm backends, both interpreters and AOT/JITs.\n\n## Client support\n\nHera has been tested with [aleth] and [geth]. It should however work with any client with compliant [EVMC] support.\n\n## Building Hera\n\nFirst clone this repository and make sure the submodules are checked out:\n```bash\n$ git clone https://github.com/ewasm/hera\n$ cd hera\n$ git submodule update --init\n```\n\nThe preferred way is building Hera as a shared library:\n\n```bash\n$ mkdir build\n$ cd build\n$ cmake -DBUILD_SHARED_LIBS=ON ..\n$ cmake --build .\n```\n\nIn this case the built library will be placed at `build/src/libhera/libhera.so` on Linux or `build/src/libhera/libhera.dylib` on MacOS.\n\nPlease also check the build options listed in the following section.\n\n## Build options\n\n- `-DHERA_DEBUGGING=ON` will turn on debugging features and messages. This is off by default.\n- `-DBUILD_SHARED_LIBS=ON` is a standard CMake option to build libraries as shared. This will build Hera shared library that can be then dynamically loaded by EVMC compatible Clients (e.g. `aleth` from [aleth]). **This is the preferred way of compilation.**\n\n### wabt support\n\n*Complete support.*\n\n[wabt] is built by default and needs no build options. It can be disabled with:\n\n- `-DHERA_WABT=OFF`\n\n### Binaryen support\n\n*Complete support.*\n\n[Binaryen] support needs to be enabled via the following build option and requested at runtime with `engine=binaryen`:\n\n- `-DHERA_BINARYEN=ON` will request the compilation of Binaryen support\n\n### WAVM support\n\n*Complete support.*\n\n[WAVM] support needs to be enabled via the following build option and requested at runtime with `engine=wavm`:\n\n- `-DHERA_WAVM=ON` will request the compilation of WAVM support\n- `-DLLVM_DIR=...` one will need to specify the path to LLVM's CMake file. In most installations this has to be within the `lib/cmake/llvm` directory, such as `/usr/local/Cellar/llvm/6.0.1/lib/cmake/llvm` on Homebrew.\n\n## Runtime options\n\nThese are to be used via EVMC `set_option`:\n\n- `engine=\u003cengine\u003e` will select the underlying WebAssembly engine, where the only accepted values currently are `binaryen`, `wabt`, and `wavm`\n- `metering=true` will enable metering of bytecode at deployment using the [Sentinel system contract] (set to `false` by default)\n- `benchmark=true` will produce execution timings and output it to both standard error output and `hera_benchmarks.log` file.\n- `evm1mode=\u003cevm1mode\u003e` will select how EVM1 bytecode is handled\n- `sys:\u003calias/address\u003e=file.wasm` will override the code executing at the specified address with code loaded from a filepath at runtime. This option supports aliases for system contracts as well, such that `sys:sentinel=file.wasm` and `sys:evm2wasm=file.wasm` are both valid. **This option is intended for debugging purposes.**\n\n### evm1mode\n\n- `reject` will reject any EVM1 bytecode with an error (the default setting)\n- `fallback` will allow EVM1 bytecode to be passed through to the client for execution\n- `evm2wasm` will enable transformation of bytecode using the [EVM Transcompiler]\n- `runevm` will transform EVM1 bytecode using [runevm]\n\n## Interfaces\n\nHera implements two interfaces: [EEI] and a debugging module.\n\n### Debugging module\n\n- `debug::print32(value: i32)` - print value\n- `debug::print64(value: i64)` - print value\n- `debug::printMem(offset: i32, len: i32)` - print memory segment as printable characters\n- `debug::printMemHex(offset: i32, len: i32)` - print memory segment as hex\n- `debug::printStorage(pathOffset: i32)` - print storage value as printable characters\n- `debug::printStorageHex(pathOffset: i32)` - print storage value as hex\n\nThese are only enabled if Hera is compiled with debugging on.\n\n### EVM Tracing\n\n- `debug::evmTrace(pc: i32, opcode: i32, cost: i32, sp: i32)`\n\nThis is useful to trace the translated code by [EVM Transcompiler]. This is only enabled if Hera is compiled with debugging on.\n\n**Note:** it is valid to invoke `evmTrace` with a negative value for `sp`.  In this case, no stack values will be printed.\n\n## Fuzzing\n\nTo enable fuzzing you need clang compiler and provide `-DHERA_FUZZING=ON` option to CMake.\nYou should also enable both Binaryen and WABT engines.\nThis will build additional executable `hera-fuzzer`.\nCheck out its help and [libFuzzer documentation](https://llvm.org/docs/LibFuzzer.html).\n\n```bash\ntest/fuzzing/hera-fuzzer -help=1\n```\n\n## Author(s)\n\n* Alex Beregszaszi\n* Jake Lang\n\n## License\n\nApache 2.0\n\n[ewasm]: https://github.com/ewasm/design\n[EVMC]: https://github.com/ethereum/evmc\n[aleth]: https://github.com/ethereum/aleth\n[geth]: https://github.com/ethereum/go-ethereum\n[Binaryen]: https://github.com/webassembly/binaryen\n[wabt]: https://github.com/webassembly/wabt\n[WAVM]: https://github.com/WAVM/WAVM\n[Sentinel system contract]: https://github.com/ewasm/design/blob/master/system_contracts.md#sentinel-contract\n[EVM Transcompiler]: https://github.com/ewasm/design/blob/master/system_contracts.md#evm-transcompiler\n[EEI]: https://github.com/ewasm/design/blob/master/eth_interface.md\n[runevm]: https://github.com/axic/runevm\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewasm%2Fhera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fewasm%2Fhera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewasm%2Fhera/lists"}