EVM Toolkit (etk) is a comprehensive collection of tools designed for writing, reading, and analyzing EVM bytecode. Developed in Rust, this toolkit simplifies the process of working with Ethereum Virtual Machine (EVM) bytecode, providing developers with powerful utilities to streamline their workflow.
The etk toolkit includes several key components:
These tools enable developers to write EVM bytecode with ease, read and understand existing bytecode, and perform various analyses to ensure code correctness and efficiency.
For a comprehensive guide on using etk, refer to the etk book. This documentation includes:
Examples can also be found in the etk-asm/tests/asm
directory in the repository. For further questions or community support, join the Telegram chat.
To install etk, you need the latest stable version of rustc
. Use the following command to install the necessary components:
cargo install --features cli etk-asm etk-dasm
Here's a simple example to illustrate how to use etk for assembling and disassembling EVM bytecode.
contract.etk:
push1 42
push1 13
add
pop
$ eas contract.etk out.hex
$ disease --hex-file out.hex
0: push1 0x2a
2: push1 0x0d
4: add
5: pop
etk requires z3 to build. For instance, on Ubuntu, you can install z3 and its development libraries using the following commands:
sudo apt-get update -y
sudo apt-get install -y z3
sudo apt-get install -y libz3-dev
Ensure that the installation completes without errors by checking the system logs.
EVM Toolkit (etk) provides a powerful set of tools for developers working with EVM bytecode, facilitating tasks from assembly to analysis, all within the robust and efficient Rust ecosystem.