> This tool is in beta, use at your own risk
<p align="center">
<br />
<img src="./docs/source/_static/gh_banner.png" width="100%" alt=""/></a>
<br />
</p>
# Moccasin
A fast, pythonic, Vyper smart contract testing and development framework.
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![moccasin](https://img.shields.io/pypi/v/moccasin.svg)](https://pypi.org/project/moccasin/)
[![license](https://img.shields.io/pypi/l/moccasin.svg)](https://pypi.python.org/pypi/moccasin)
[![python-versions](https://img.shields.io/pypi/pyversions/moccasin.svg)](https://pypi.python.org/pypi/moccasin)
> The smaller bar is better, it means it's faster
<p align="center">
<picture align="center">
<source media="(prefers-color-scheme: dark)" srcset="./docs/source/_static/stats-dark.png" width=70%>
<source media="(prefers-color-scheme: light)" srcset="./docs/source/_static/stats-light.png" width=70%>
<img alt="Shows a bar chart with benchmark results." src="./docs/source/_static/stats-default.png" width=70%>
</picture>
</p>
_You can see how we conducted these tests from the [benchmarking repo](https://github.com/PatrickAlphaC/benchmarking-frameworks)._
Fast to install, test, and run python commands on your smart contracts.
# Highlights
- 🐍 Pythonic start to finish, built on top of Vyper's [titanoboa](https://titanoboa.readthedocs.io/en/latest/)
- 🔐 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](https://cyfrin.github.io/moccasin/installing_moccasin.html) to for other install methodologies and getting stated.
## This README Quickstart
To install the moccasin `mox` command, we recommend the [uv](https://docs.astral.sh/uv/) tool.
```bash
uv tool install moccasin --prerelease=allow
```
Then, see a list of commands with:
```bash
mox --help
```
# Documentation
You can view the documentation [here](https://cyfrin.github.io/moccasin/).
# Contributing
If you're interested in helping build moccasin, please see the [contributing guide](./CONTRIBUTING.md).
# Help output
```bash
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
- [brownie](https://github.com/eth-brownie/brownie)
- [vyper](https://github.com/vyperlang/vyper)
- [boa](https://github.com/vyperlang/titanoboa)
## 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
<p align="center">
<br />
<a href="https://cyfrin.io/">
<img src="./docs/source/_static/speed-comparisons.png" width="70%" alt=""/></a>
<br />
</p>
# License
moccasin is licensed under either of:
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "moccasin",
"maintainer": null,
"docs_url": null,
"requires_python": "<=3.13,>=3.11",
"maintainer_email": null,
"keywords": "blockchain, ethereum, moccasin, mox, smart-contract, zksync",
"author": null,
"author_email": "PatrickAlphac <54278053+PatrickAlphaC@users.noreply.github.com>, charles-cooper <3867501+charles-cooper@users.noreply.github.com>",
"download_url": "https://files.pythonhosted.org/packages/3e/b4/c4e44a163056ef7d476efb710c5a319698671f554809d2e522c2fa883a74/moccasin-0.3.6.tar.gz",
"platform": null,
"description": "> This tool is in beta, use at your own risk\n\n<p align=\"center\">\n <br />\n <img src=\"./docs/source/_static/gh_banner.png\" width=\"100%\" alt=\"\"/></a>\n <br />\n</p>\n\n\n# Moccasin\n\nA fast, pythonic, Vyper smart contract testing and development framework.\n\n[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)\n[![moccasin](https://img.shields.io/pypi/v/moccasin.svg)](https://pypi.org/project/moccasin/)\n[![license](https://img.shields.io/pypi/l/moccasin.svg)](https://pypi.python.org/pypi/moccasin)\n[![python-versions](https://img.shields.io/pypi/pyversions/moccasin.svg)](https://pypi.python.org/pypi/moccasin)\n\n> The smaller bar is better, it means it's faster\n\n<p align=\"center\">\n <picture align=\"center\">\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"./docs/source/_static/stats-dark.png\" width=70%>\n <source media=\"(prefers-color-scheme: light)\" srcset=\"./docs/source/_static/stats-light.png\" width=70%>\n <img alt=\"Shows a bar chart with benchmark results.\" src=\"./docs/source/_static/stats-default.png\" width=70%>\n </picture>\n</p>\n\n_You can see how we conducted these tests from the [benchmarking repo](https://github.com/PatrickAlphaC/benchmarking-frameworks)._\n\nFast to install, test, and run python commands on your smart contracts.\n\n# Highlights\n\n- \ud83d\udc0d Pythonic start to finish, built on top of Vyper's [titanoboa](https://titanoboa.readthedocs.io/en/latest/)\n- \ud83d\udd10 ZKsync built-in support\n- \ud83d\udcd1 Named Contracts allow you to define smart contract addresses without scaffolding anything yourself\n- \ud83e\uddea Custom staging pytest markers so you can run tests anywhere, anyhow\n- \ud83e\udd8a Support for encrypting wallets, no private keys in `.env` files! \n- \ud83e\uddf3 GitHub and Python smart contract dependency installation \n\n# Quickstart\n\nHead over to [the moccasin installation documentation](https://cyfrin.github.io/moccasin/installing_moccasin.html) to for other install methodologies and getting stated.\n\n## This README Quickstart\n\nTo install the moccasin `mox` command, we recommend the [uv](https://docs.astral.sh/uv/) tool.\n\n```bash\nuv tool install moccasin --prerelease=allow\n```\n\nThen, see a list of commands with:\n\n```bash\nmox --help\n```\n\n# Documentation\n\nYou can view the documentation [here](https://cyfrin.github.io/moccasin/).\n\n# Contributing\n\nIf you're interested in helping build moccasin, please see the [contributing guide](./CONTRIBUTING.md).\n\n# Help output\n\n```bash\nmox --help\nusage: Moccasin CLI [-h] [-d] [-q]\n {init,compile,build,test,run,script,deploy,wallet,console,install,purge,config,explorer,inspect,deployments,utils,u,util}\n ...\n\n\ud83d\udc0d Pythonic Smart Contract Development Framework\n\npositional arguments:\n {init,compile,build,test,run,script,deploy,wallet,console,install,purge,config,explorer,inspect,deployments,utils,u,util}\n init Initialize a new project.\n compile (build) Compiles the project.\n test Runs all tests in the project.\n run (script) Runs a script with the project's context.\n deploy Deploys a contract named in the config with a deploy script.\n wallet Wallet management utilities.\n console BETA, USE AT YOUR OWN RISK: Interact with the network in a python shell.\n install Installs the project's dependencies.\n purge Purge a given dependency\n config View the Moccasin configuration.\n explorer Work with block explorers to get data.\n inspect Inspect compiler data of a contract.\n deployments View deployments of the project from your DB.\n utils (u, util) Helpful utilities - right now it's just the one.\n\noptions:\n -h, --help show this help message and exit\n -d, --debug Run in debug mode\n -q, --quiet Suppress all output except errors\n```\n\n# Acknowledgements \n\n- [brownie](https://github.com/eth-brownie/brownie)\n- [vyper](https://github.com/vyperlang/vyper)\n- [boa](https://github.com/vyperlang/titanoboa)\n\n## Background\n\n> 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 \u1f04\u03b3\u03ba\u03b9\u03c3\u03c4\u03c1\u03bf\u03bd agkistron \"fish-hook, hook\" and \u1f40\u03b4\u03ce\u03bd 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.\n\n# More Stats\n\n<p align=\"center\">\n <br />\n <a href=\"https://cyfrin.io/\">\n <img src=\"./docs/source/_static/speed-comparisons.png\" width=\"70%\" alt=\"\"/></a>\n <br />\n</p>\n\n# License \n\nmoccasin is licensed under either of:\n\n- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)\n- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)\n\nat your option.\n\nUnless 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.\n",
"bugtrack_url": null,
"license": null,
"summary": "Pythonic smart contract development framework using Titanoboa",
"version": "0.3.6",
"project_urls": {
"Documentation": "https://cyfrin.github.io/moccasin/",
"Releases": "https://github.com/Cyfrin/moccasin/releases",
"Repository": "https://github.com/cyfrin/moccasin"
},
"split_keywords": [
"blockchain",
" ethereum",
" moccasin",
" mox",
" smart-contract",
" zksync"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8af51d0d19fe23df1f4a6aff0256b9489db48d2f876498d184e539fdd19d9a7e",
"md5": "018e291849e687f72ef9b09e8c26ccbb",
"sha256": "11940537148b41e99b5b5539e5b03a5ace0e522de184e154f859a94a221771ea"
},
"downloads": -1,
"filename": "moccasin-0.3.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "018e291849e687f72ef9b09e8c26ccbb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<=3.13,>=3.11",
"size": 62579,
"upload_time": "2024-12-08T20:06:46",
"upload_time_iso_8601": "2024-12-08T20:06:46.670090Z",
"url": "https://files.pythonhosted.org/packages/8a/f5/1d0d19fe23df1f4a6aff0256b9489db48d2f876498d184e539fdd19d9a7e/moccasin-0.3.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3eb4c4e44a163056ef7d476efb710c5a319698671f554809d2e522c2fa883a74",
"md5": "ed317cd3b4383b9654c2e99652989b24",
"sha256": "cbf5cd5ba3cdae2c05c2ef8970c0491e9ac24337b96caacfb6a4a5fb18f834d4"
},
"downloads": -1,
"filename": "moccasin-0.3.6.tar.gz",
"has_sig": false,
"md5_digest": "ed317cd3b4383b9654c2e99652989b24",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<=3.13,>=3.11",
"size": 618613,
"upload_time": "2024-12-08T20:06:48",
"upload_time_iso_8601": "2024-12-08T20:06:48.319161Z",
"url": "https://files.pythonhosted.org/packages/3e/b4/c4e44a163056ef7d476efb710c5a319698671f554809d2e522c2fa883a74/moccasin-0.3.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-08 20:06:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Cyfrin",
"github_project": "moccasin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "moccasin"
}