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 traits and structures
  • Contract data structures and utilities
  • Simulation environments
  • Simulation execution
  • Numerical and Ethereum utilities

Structs§

Traits§

  • Combined Revm database trait with data export methods