Minimal template for simulating contracts with arbiter. This template is used by the arbiter init
command when starting new simulations. This template provides a framework for performantly simulating Agent Based Models (ABM) with evm parity. In this model you can think of any things that happens as an action of an agent. Agents can own keys and externally owned accounts, they can interact with each other and they can interact with smart contracts.
This repository has some example agents including a TokenAdmin
, BlockAdmin
, and CounterAgent
which their own functionality and responsibilities. We also give an example of how to parametarize your simulations with a configuration file containing different price paths and price path parameters. These can be played with to see how the simulation changes. Furthermore we provide an api to batch simulations and run them in parallel. This is useful for running many simulations with different parameters.
- Rust programming language and Cargo package manager (latest stable version recommended)
- Foundry is used behind the scenes to generate rust contract bindings. Make sure you have forge installed and up to date.
- Install arbiter
cargo install arbiter
- Create arbiter project from this template
arbiter init <name_of_project>
- Run the project
cargo run simulate src/config/counter.toml
The documentation for the repository is primarily inline with the code. Cargo automatically can compile these into a browsable format. To view the documentation run the following command:
cargo doc --open