A Python smart-contract API with a fast (embedded) Ethereum Virtual Machine (EVM). Simular creates a Python wrapper around production grade Rust based Ethereum APIs.
How is it different than Brownie, Ganache, Anvil?
- It's only an EVM, no blocks or mining
- No HTTP/JSON-RPC. You talk directly to the EVM (and it's fast)
- Full functionality: account transfers, contract interaction, etc...
The primary motivation for this work is to be able to model smart-contract interaction in an Agent Based Modeling environment like Mesa.
EVM: run a local version with an in-memory database, or fork db state from a remote node.Snapshot: dump the current state of the EVM to json for future use in pre-populating EVM storageABI: parse compiled Solidity json files or define a specific set of functions usinghuman-readablenotationContract: high-level, user-friendy Python API
- You need
RustandPython, and optionallyMake. We usehatchfor Python project management, but it's not required - Create a local Python virtual environment. Within that environment install Python dependencies
- Run
make buildorhatch run maturin develop - See
simular/for the main python api
See Simular Documentation for examples and API details.
Thanks to the following projects for making this work possible!