Skip to main content

Pythonic smart contract development framework using Titanoboa

Project description

This tool is in beta, use at your own risk



Moccasin

A fast, pythonic, Vyper smart contract testing and development framework.

uv moccasin license python-versions

The smaller bar is better, it means it's faster

Shows a bar chart with benchmark results.

You can see how we conducted these tests from the benchmarking repo.

Fast to install, test, and run python commands on your smart contracts.

Highlights

  • 🐍 Pythonic start to finish, built on top of Vyper's titanoboa
  • 🔐 ZKsync built-in support
  • 📑 Named Contracts allow you to define smart contract addresses without scaffolding anything yourself
  • 🧪 Custom staging pytest markers so you can run tests anywhere, anyhow
  • 🦊 Support for encrypting wallets, no private keys in .env files!
  • 🧳 GitHub and Python smart contract dependency installation

Quickstart

Head over to the moccasin installation documentation to for other install methodologies and getting stated.

This README Quickstart

To install the moccasin mox command, we recommend the uv tool.

uv tool install moccasin --prerelease=allow

Then, see a list of commands with:

mox --help

Documentation

You can view the documentation here.

Contributing

If you're interested in helping build moccasin, please see the contributing guide.

Help output

mox --help
usage: Moccasin CLI [-h] [-d] [-q]
                    {init,compile,build,test,run,script,deploy,wallet,console,install,purge,config,explorer,inspect,deployments,utils,u,util}
                    ...

🐍 Pythonic Smart Contract Development Framework

positional arguments:
  {init,compile,build,test,run,script,deploy,wallet,console,install,purge,config,explorer,inspect,deployments,utils,u,util}
    init                Initialize a new project.
    compile (build)     Compiles the project.
    test                Runs all tests in the project.
    run (script)        Runs a script with the project's context.
    deploy              Deploys a contract named in the config with a deploy script.
    wallet              Wallet management utilities.
    console             BETA, USE AT YOUR OWN RISK: Interact with the network in a python shell.
    install             Installs the project's dependencies.
    purge               Purge a given dependency
    config              View the Moccasin configuration.
    explorer            Work with block explorers to get data.
    inspect             Inspect compiler data of a contract.
    deployments         View deployments of the project from your DB.
    utils (u, util)     Helpful utilities - right now it's just the one.

options:
  -h, --help            show this help message and exit
  -d, --debug           Run in debug mode
  -q, --quiet           Suppress all output except errors

Acknowledgements

Background

Agkistrodon piscivorus is a species of venomous snake, a pit viper in the subfamily Crotalinae of the family Viperidae. The generic name is derived from the Greek words ἄγκιστρον agkistron "fish-hook, hook" and ὀδών odon "tooth", and the specific name comes from the Latin piscis 'fish' and voro '(I) eat greedily, devour'; thus, the scientific name translates to "hook-toothed fish-eater". Common names include cottonmouth, northern cottonmouth, water moccasin, swamp moccasin, black moccasin, and simply viper.

More Stats



License

moccasin is licensed under either of:

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in moccasin by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.

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

moccasin-0.3.4b1.tar.gz (639.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moccasin-0.3.4b1-py3-none-any.whl (61.7 kB view details)

Uploaded Python 3

File details

Details for the file moccasin-0.3.4b1.tar.gz.

File metadata

  • Download URL: moccasin-0.3.4b1.tar.gz
  • Upload date:
  • Size: 639.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for moccasin-0.3.4b1.tar.gz
Algorithm Hash digest
SHA256 0e0642e8b34cd12f72968f82ca7c5b9b0c9b67aad091208b3cd63874c66aff25
MD5 3d41e05b634a7b8ffc0e2b73821dd6b5
BLAKE2b-256 843ffede42550fc3f73e1a1b14392ba5db0083a74814335c423eac2fcae49fdc

See more details on using hashes here.

Provenance

The following attestation bundles were made for moccasin-0.3.4b1.tar.gz:

Publisher: pypi-release.yml on Cyfrin/moccasin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moccasin-0.3.4b1-py3-none-any.whl.

File metadata

  • Download URL: moccasin-0.3.4b1-py3-none-any.whl
  • Upload date:
  • Size: 61.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for moccasin-0.3.4b1-py3-none-any.whl
Algorithm Hash digest
SHA256 5cbc3ebc7f19b5ac4f3dcaf2752fcec0d21e43625ca00b883228dd186900c737
MD5 846cba122ce17743347fced4628275b0
BLAKE2b-256 a8b5ba7fabfcb4e51199ee910e6eb71eb952d4aff82a8d2b222ea7270c7900fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for moccasin-0.3.4b1-py3-none-any.whl:

Publisher: pypi-release.yml on Cyfrin/moccasin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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