Enclave EVM (eEVM) is an open-source, standalone, embeddable, C++ implementation of the Ethereum Virtual Machine. It was originally built to run within a TEE (ie, SGX enclave) on top of the Open Enclave SDK, for use with Microsoft's Confidential Consortium Framework.
The main entry point is eevm::Processor::run()
. You will need to provide eevm::Processor
with an implementation of eevm::GlobalState
to handle all interactions with permanent state. The source includes eevm::SimpleGlobalState
as an example backed by std::map
, but other instances will likely want an implementation which provides permanent storage - perhaps a wrapper to read/write data from the Ethereum blockchain.
eEVM supports all opcodes from Ethereum's Homestead release, as listed in opcode.h. Note that this does not include more recent opcodes such as RETURNDATACOPY
or RETURNDATASIZE
from EIP #211.
The implementation ignores all gas costs - gas is not spent, tracked, or updated during execution, and execution will never throw an outofgas exception. However, it may still be necessary to pass a sensible initial gas value to eevm::Processor::run()
in case the bytecode calculates or verifies gas budgets itself. It also does not provide the precompiled contracts at addresses 1 to 8.
So far, the code is not particularly optimized in any dimension. In fact, it is in experimental state.
- CMake. Minimum version 3.10.
We build and test eEVM on Linux and Windows on x86-64, but it should be functional cross-platform.
Build the static library and tests.
mkdir build
cd build
cmake ..
make
It is also possible to build with Ninja or another generator of choice, and the code will compile with either GCC or Clang (other compilers are untested).
Run the tests.
cd build
ctest -VV