AbbyEVM, A simple Ethereum Virtual Machine implementation in Rust with a JavaScript-like programming language.
AbbyScript is a high-level language designed for writing smart contracts on the Ethereum blockchain. It provides a familiar syntax for JavaScript developers while abstracting away the complexities of EVM bytecode.
AbbyScript looks like JavaScript but compiles to EVM bytecode:
// Variables and arithmetic
let x = 42;
let y = x + 10;
let result = x * y;
// Storage operations
storage[0] = result;
let value = storage[0];
// Memory operations
memory[64] = 0xdeadbeef;
let data = memory[64];
// Control flow
if (x > 50) {
storage[1] = x * 2;
} else {
storage[1] = 0;
}
// Functions
function add(a, b) {
return a + b;
}
let sum = add(5, 3);
# Build
cargo build
# Run tests
cargo test
# Debug mode
RUST_LOG=debug cargo run -- execute --example simple-add
- Lexer breaks source code into tokens
- Parser builds an abstract syntax tree (AST)
- Code generator converts AST to EVM bytecode
- EVM executor runs the bytecode with proper gas metering
The EVM implementation supports most opcodes including arithmetic, logic, memory, storage, and control flow operations.
AbbyEVM includes a simple blockchain implementation that allows users to deploy and interact with smart contracts. The blockchain is designed to be lightweight and easy to use, making it ideal for educational purposes.
MIT License