Crates.io | cubipods |
lib.rs | cubipods |
version | 0.1.1 |
source | src |
created_at | 2024-08-26 17:46:02.826042 |
updated_at | 2024-09-10 22:59:48.847247 |
description | A minimal EVM implemented in Rust. |
homepage | |
repository | |
max_upload_size | |
id | 1352471 |
size | 195,428 |
Cubipods is a minimal Ethereum Virtual Machine (EVM) written in Rust. This project offers a lightweight and efficient platform for running EVM bytecode, complete with features like lexical analysis, stack management, memory handling, and storage operations. Cubipods can execute bytecode consisting of EVM opcodes and provides detailed output for stack, memory, and storage states after execution.
Cubipods currently supports the following EVM opcodes:
STOP
(0x00)ADD
(0x01)MUL
(0x02)SUB
(0x03)DIV
(0x04)MOD
(0x06)EXP
(0x0a)LT
(0x10)GT
(0x11)EQ
(0x14)ISZERO
(0x15)AND
(0x16)OR
(0x17)XOR
(0x18)NOT
(0x19)BYTE
(0x1a)KECCAK256
(0x20)POP
(0x50)MLOAD
(0x51)MSTORE
(0x52)SLOAD
(0x54)SSTORE
(0x55)PUSH0
to PUSH32
DUP1
to DUP16
SWAP1
to SWAP16
Cubipods can be used through its command-line interface (CLI). Users can provide bytecode for execution and optionally enable verbose mode to get detailed output.
You can add Cubipods to your project using Cargo. Run the following command:
cargo install cubipods
Here are the available CLI options:
-b, --bytecode <BYTECODE>
: Bytecode consisting of EVM opcodes to be executed.-v, --verbose
: Enables verbose mode, printing execution history and final states of Stack, Memory, and Storage.Execute a bytecode:
cubipods -b 6003600201
0x03
and 0x02
onto the stack and then adds them together (PUSH1 0x03
, PUSH1 0x02
, ADD
).Enable verbose mode:
cubipods -b 6003600201 -v
To contribute to Cubipods, follow these steps:
Cubipods is licensed under the MIT License. See the LICENSE file for more details.
This project uses the following crates:
clap
for command-line argument parsing.tiny-keccak
for cryptographic hashing functions.hex
for hexadecimal encoding and decoding.Thank you for using Cubipods! If you have any questions or feedback, feel free to open an issue on GitHub. Happy coding!