Crate verbs_rs

Source
Expand description

§VERBS

Ethereum agent based modelling library

Verbs is a library designed to aid the implementation of agent based models of the ethereum blockchain with a focus on performance and quick development of simulations.

Verbs is built around the revm implementation of the Ethereum virtual machine, agents interact directly with EVM, avoiding the overhead of messaging or multi-threading.

§Loading Contracts

Verbs makes use of alloy_sol_types to convert ABI strings/files to Rust classes that can encode/decode function arguments etc.

An ABI rust representation can generated using the sol! macro, for example

use alloy_sol_types::sol;

sol!(
    ContractName,
    r#"[
        {
            "inputs": [],
            "name": "getValue",
            "outputs": [
                {
                    "internalType": "int256",
                    "name": "",
                    "type": "int256"
                }
            ],
            "stateMutability": "view",
            "type": "function"
        }
    ]"#
);

// Encodes call arguments
ContractName::getValueCall {};

Modules§

agent
Agent traits and structures
contract
Contract data structures and utilities
env
Simulation environments
sim_runner
Simulation execution
utils
Numerical and Ethereum utilities

Structs§

ForkDb
Database with ability to load data from a remote fork
LocalDB
Local in-memory EVm database
RequestCache
Cache of requests made by a super::ForkDb

Traits§

DB
Combined Revm database trait with data export methods