Thank you for wanting to contribute! This project reviews PRs that have an associated issue with them. If you have not make an issue for your PR, please make one first.
Issues, feedback, and sharing that you're using Moccasin on social media is always welcome!
You must have the following installed to proceed with contributing to this project.
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- python
- You'll know you did it right if you can run
python --version
and you see a response likePython x.x.x
- You'll know you did it right if you can run
- uv
- You'll know you did it right if you can run
uv --version
and you see a response likeuv 0.4.7 (a178051e8 2024-09-07)
- You'll know you did it right if you can run
- anvil
- You'll know you did it right if you can run
anvil --version
and you see a response likeanvil 0.2.0 (b1f4684 2024-05-24T00:20:06.635557000Z)
- You'll know you did it right if you can run
- Linux and/or MacOS
- This project is not tested on Windows, so it is recommended to use a Linux or MacOS machine, or use a tool like WSL for windows users.
- just
- You'll know you did it right if you can run
just --version
and you see a response likejust 1.35.0
- You'll know you did it right if you can run
If you wish to run the ZKync tests, you'll need these as well (ran with just test-z
)
- anvil-zksync
- You'll know you did it right if you can run
anvil-zksync --version
and you see a response likeanvil-zksync 0.2.1
- You'll know you did it right if you can run
- era-compiler-vyper
- You'll know you did it right if you can run
zkvyper --version
and you see a response likeVyper compiler for ZKync v1.5.4 (LLVM build f9f732c8ebdb88fb8cd4528482a00e4f65bcb8b7)
- You'll know you did it right if you can run
Follow the steps to clone the repo for you to make changes to this project.
- Clone the repo
git clone https://github.com/cyfrin/moccasin
cd moccasin
- Sync dependencies
This repo uses uv to manage python dependencies and version. So you don't have to deal with virtual environments (much)
uv sync --all-extras
- Create a new branch
git checkout -b <branch_name>
And start making your changes! Once you're done, you can commit your changes and push them to your forked repo.
git add .
git commit -m 'your commit message'
git push <your_forked_github>
- Virtual Environment
You can then (optionally) work with the virtual environment created by uv
.
source .venv/bin/activate
And to remove the virtual environment, just run:
deactivate
However, if you run tests and scripts using the uv
or just
commands as we will describe below, you won't have to worry about that.
Note: When you delete your terminal/shell, you will need to reactivate this virtual environment again each time. To exit this python virtual environment, type deactivate
Run the following:
just test # Check out the justfile to see the command this runs
This is equivalent to running pytest
in the root directory of the project.
Read the README.md in the integration folder to see how to run the integration tests.
just test-i # Check out the justfile to see the command this runs
These will be the ZKync tests that require the ZKync requirements to be installed.
just test-z # Check out the justfile to see the command this runs
A "live test" is sending actual testnet ETH to sepolia. To do this, you'll need:
- An environment variable
SEPOLIA_ZKSYNC_RPC_URL
set to the sepolia testnet RPC URL - A
mox wallet
namedsmalltestnet
that has some sepolia ETH - A password for your
smalltestnet
wallet in~/.moccasin/unsafe-passwords/smalltestnet
Then run:
uv run pytest tests/live/test_live_verify.py --no-skip
Note: There is almost no reason to run this test.
We will run the .github/workflows
before merging your PR to ensure that your code is up to standard. Be sure to run the scripts in there before submitting a PR.
For type checking:
just typecheck # Check out the justfile to see the command this runs
For code formatting:
just format # Check out the justfile to see the command this runs
You can see in justfile
a list of scripts one can run. To see them all you can run simply just
Thank you for wanting to participate with moccasin!