Skip to content

Commit

Permalink
moccasin (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickAlphaC authored Sep 12, 2024
1 parent dd366fd commit 2e9efdb
Show file tree
Hide file tree
Showing 65 changed files with 451 additions and 468 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wheels/
.pytest_cache/
.ruff_cache/

# Gaboon
# Moccasin
built_docs/
anvil1
zkrich1
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Follow the steps to clone the repo for you to make changes to this project.
1. Clone the repo

```bash
git clone https://github.com/cyfrin/gaboon
cd gaboon
git clone https://github.com/cyfrin/moccasin
cd moccasin
```

2. Sync dependencies
Expand Down Expand Up @@ -88,7 +88,7 @@ However, if you run tests and scripts using the `uv` or `just` commands as we wi

## Running Tests

First, you'll need to make sure you have the `anvil1` keystore in your `~/.gaboon/keystores` folder. You can [find it here](./tests/data/keystores/anvil1). Please move it there.
First, you'll need to make sure you have the `anvil1` keystore in your `~/.moccasin/keystores` folder. You can [find it here](./tests/data/keystores/anvil1). Please move it there.

Run the following:

Expand Down Expand Up @@ -119,4 +119,4 @@ You can see in `justfile` a list of scripts one can run. To see them all you can

# Thank you!

Thank you for wanting to participate in titanoboa and gaboon!
Thank you for wanting to participate in titanoboa and moccasin!
53 changes: 50 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
>[!IMPORTANT]
> *This project has been moved to a new location. Check out https://github.com/cyfrin/moccasin*
> *This repo is a work in progress and is not ready for production use.*
This project has moved to:
# Moccasin

https://github.com/cyfrin/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)

<!-- <p align="center">
<br />
<a href="https://cyfrin.io/">
<img src="./img/moccasin-logo.png" width="250" alt=""/></a>
<br />
</p> -->

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

# Quickstart

Head over to [the moccasin installation documentation](https://cyfrin.github.io/moccasin/installing-moccasin.html) to for other install methodologies and getting stated.


```bash
uv tool install moccasin
```

# Documentation

The documentation roughly attempts to follow [Diátaxis](https://diataxis.fr/).

# Speed Comparisons

*The following comparisions were done taking the `user` result from running the bash `time` command followed by the appropriote command on an M3 MacOS*
*Compile command tested with a basic vyper counter contract on version 0.4.0 or 0.3.10 depending on compatibility*


| Command | Moccasin | Brownie | Hardhat | Foundry | Ape |
| ------- | -------- | ------- | ------- | ------- | ----- |
| help | 0.03s | 0.37s | 0.30s | 0.01s | 2.55s |
| init | 0.04s | 0.37s | xx | 0.20s | 5.08s |
| compile | 0.49s | 0.42s | xx | 0.17s | 2.00s |


# 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.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
All gaboon toml parameters
All moccasin toml parameters
===========================

.. code-block:: toml
Expand All @@ -22,10 +22,10 @@ All gaboon toml parameters
is_zksync = false
# This is the name of the account that will be unlocked when running on this network
default_account_name = "anvil"
# If you don't provide a password or private key, gaboon will prompt you to unlock it
# If you don't provide a password or private key, moccasin will prompt you to unlock it
# If you do, it will unlock it automatically
# But be careful about storing passwords and private keys! NEVER store them in plain text
unsafe_password_file = "/home/user/.gaboon/password" # Replace with actual path
unsafe_password_file = "/home/user/.moccasin/password" # Replace with actual path
[networks.sepolia.extra_data]
my_key = "{$ETHERSCAN_API_KEY}"
Expand Down
6 changes: 3 additions & 3 deletions docs/source/cli_commands.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
gab
mox
###

.. argparse::
:module: gaboon_wrapper_for_docs
:module: moccasin_wrapper_for_docs
:func: get_main_parser
:prog: gab
:prog: mox

2 changes: 1 addition & 1 deletion docs/source/common-errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Common Errors
ValueError: <boa.network.NetworkEnv object at 0xXXXXXXXXX>.eoa not defined!
----------------------------------------------------------------------------

This is the most common error you'll run into, and it means you'll need to add an account to your `gaboon.toml`. You can do this by following the :doc:`wallet <wallet>` guide.
This is the most common error you'll run into, and it means you'll need to add an account to your `moccasin.toml`. You can do this by following the :doc:`wallet <wallet>` guide.
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import gaboon
import moccasin
import os
import sys

sys.path.insert(0, os.path.abspath("."))

project = "gaboon"
project = "moccasin"
copyright = "2024, Patrick Collins, Charles Cooper"
author = "Patrick Collins, Charles Cooper"

Expand Down Expand Up @@ -48,11 +48,11 @@
html_context = {
"source_type": "github",
"source_user": "cyfrin",
"source_repo": "gaboon",
"source_repo": "moccasin",
}

# Options for sphinx_multiversion
smv_remote_whitelist = r"^origin$"
smv_branch_whitelist = r"^master$" # master is gross
smv_tag_whitelist = r"^v\d+\.\d+.\d+$"
version = gaboon.version()
version = moccasin.version()
4 changes: 2 additions & 2 deletions docs/source/console.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Console
#######

You can enter a python shell with the `console` command. This will start a python shell with the `gaboon` module loaded, so you can interact with your contracts directly.
You can enter a python shell with the `console` command. This will start a python shell with the `moccasin` module loaded, so you can interact with your contracts directly.

.. code-block:: bash
gab console
mox console
Press `q` and hit `ENTER` to exit the console.
20 changes: 10 additions & 10 deletions docs/source/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Dependencies
############


Gaboon allows for working with either:
Moccasin allows for working with either:

- :ref:`Installing from GitHub repositories <installing_github_dependencies>`

Expand All @@ -18,18 +18,18 @@ To install a package from GitHub, you can run the following:

.. code-block:: bash
gab install ORG/REPO[@VERSION]
mox install ORG/REPO[@VERSION]
For example:

.. code-block:: bash
# Without a version
gab install pcaversaccio/snekmate
mox install pcaversaccio/snekmate
# With a version
gab install pcaversaccio/[email protected]
mox install pcaversaccio/[email protected]
This will create an entry in your `gaboon.toml` file that looks like this:
This will create an entry in your `moccasin.toml` file that looks like this:

.. code-block:: toml
Expand Down Expand Up @@ -64,14 +64,14 @@ You can then use these packages in your vyper contracts, for example in an minia
Installing pip/PyPI Dependencies
================================

Gaboon let's you directly install and work with PyPI packages as you would any other python package. PyPi dependencies in gaboon are by default powered by the `uv <https://docs.astral.sh/uv/>`_ tool. In order to use this, you need to have the `uv` tool installed. However, you can change this setting to `pip` in your `gaboon.tom`.
Moccasin let's you directly install and work with PyPI packages as you would any other python package. PyPi dependencies in moccasin are by default powered by the `uv <https://docs.astral.sh/uv/>`_ tool. In order to use this, you need to have the `uv` tool installed. However, you can change this setting to `pip` in your `moccasin.tom`.

.. code-block:: toml
[project]
installer = "pip" # change/add this setting
As of today, `gaboon` supports:
As of today, `moccasin` supports:

- `pip`

Expand All @@ -81,19 +81,19 @@ You can also directly install and work with PyPI packages as you would any other

.. code-block:: bash
gab install PACKAGE
mox install PACKAGE
For example:

.. code-block:: bash
gab install snekmate
mox install snekmate
.. note::

Snekmate is both a `pypi <https://pypi.org/project/snekmate/>`_ and a GitHub package.

This will create an entry in your `gaboon.toml` file that looks like this:
This will create an entry in your `moccasin.toml` file that looks like this:

.. code-block:: toml
Expand Down
14 changes: 7 additions & 7 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.. image:: _static/docs-logo.png
:width: 140px
:alt: Gaboon logo
:alt: Moccasin logo
:align: center


Gaboon
Moccasin
######

Gaboon is a fast, pythonic smart contract development framework heavily powered by `titanoboa <https://github.com/vyperlang/titanoboa>`_.
Moccasin is a fast, pythonic smart contract development framework heavily powered by `titanoboa <https://github.com/vyperlang/titanoboa>`_.


.. note::
Expand All @@ -17,9 +17,9 @@ Gaboon is a fast, pythonic smart contract development framework heavily powered
How to read the documentation
=============================

The gaboon documentation is written in a way that assumes you are on a MacOS or Linux-like system. If you are using windows, we recommend you watch the first `10 minutes of this WSL tutorial <https://www.youtube.com/watch?v=xqUZ4JqHI_8>`_ and work with WSL. WSL stands for "Windows Subsystem for Linux" and it allows you to run a Linux commands on Windows machine.
The moccasin documentation is written in a way that assumes you are on a MacOS or Linux-like system. If you are using windows, we recommend you watch the first `10 minutes of this WSL tutorial <https://www.youtube.com/watch?v=xqUZ4JqHI_8>`_ and work with WSL. WSL stands for "Windows Subsystem for Linux" and it allows you to run a Linux commands on Windows machine.

Why Gaboon?
Why Moccasin?
===========

We think web3 needs the following:
Expand All @@ -30,7 +30,7 @@ We think web3 needs the following:
a. Running scripts to interact with contracts needs to be easy in a language that humans can understand.
3. And finally... it needs to be fast!

Then, we have some fun plans for AI, formal verification, fuzzing, and more in the future of gaboon, so stay tuned!
Then, we have some fun plans for AI, formal verification, fuzzing, and more in the future of moccasin, so stay tuned!


Head over to :doc:`installing gaboon <installing-gaboon>` to get started.
Head over to :doc:`installing moccasin <installing-moccasin>` to get started.
Loading

0 comments on commit 2e9efdb

Please sign in to comment.