Skip to main content

smart-contract api and embedded ethereum virtual machine

Project description

Simular

pypi

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.

Features

  • 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 storage
  • ABI: parse compiled Solidity json files or define a specific set of functions using human-readable notation
  • Contract: high-level, user-friendy Python API

Build from source

  • You need Rust and Python, and optionally Make. We use hatch for Python project management, but it's not required
  • Create a local Python virtual environment. Within that environment install Python dependencies
  • Run make build or hatch run maturin develop
  • See simular/ for the main python api

Getting Started

See Simular Documentation for examples and API details.

Standing on the shoulders of giants...

Thanks to the following projects for making this work possible!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simular_evm-0.2.2.tar.gz (51.5 kB view hashes)

Uploaded Source

Built Distributions

simular_evm-0.2.2-cp312-none-win_amd64.whl (2.8 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

simular_evm-0.2.2-cp312-none-win32.whl (2.5 MB view hashes)

Uploaded CPython 3.12 Windows x86

simular_evm-0.2.2-cp312-cp312-manylinux_2_28_x86_64.whl (6.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

simular_evm-0.2.2-cp312-cp312-manylinux_2_28_armv7l.whl (5.9 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ ARMv7l

simular_evm-0.2.2-cp312-cp312-manylinux_2_28_aarch64.whl (6.4 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ ARM64

simular_evm-0.2.2-cp312-cp312-macosx_11_0_arm64.whl (2.8 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

simular_evm-0.2.2-cp312-cp312-macosx_10_12_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

simular_evm-0.2.2-cp311-none-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

simular_evm-0.2.2-cp311-none-win32.whl (2.5 MB view hashes)

Uploaded CPython 3.11 Windows x86

simular_evm-0.2.2-cp311-cp311-manylinux_2_28_x86_64.whl (6.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

simular_evm-0.2.2-cp311-cp311-manylinux_2_28_armv7l.whl (5.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARMv7l

simular_evm-0.2.2-cp311-cp311-manylinux_2_28_aarch64.whl (6.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARM64

simular_evm-0.2.2-cp311-cp311-macosx_11_0_arm64.whl (2.8 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

simular_evm-0.2.2-cp311-cp311-macosx_10_12_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page