Vyper: the Pythonic Programming Language for the EVM
Project description
Getting Started
See Installing Vyper to install vyper. See Tools and Resources for an additional list of framework and tools with vyper support. See Documentation for the documentation and overall design goals of the Vyper language.
See learn.vyperlang.org for learning Vyper by building a Pokémon game. See try.vyperlang.org to use Vyper in a hosted jupyter environment!
Note: Vyper is constantly evolving, use with care and understand the risks associated with smart contract development.
Installation
See the Vyper documentation for build instructions.
Compiling a contract
To compile a contract, use:
vyper your_file_name.vy
generate bytecode
vyper -f bytecode file-name.vy > file-name.bin
generate abi
vyper -f abi file-name.vy > file-name.abi
There is also an online compiler available you can use to experiment with
the language and compile to bytecode and/or IR.
Note: While the vyper version of the online compiler is updated on a regular basis it might be a bit behind the latest version found in the master branch of this repository.
Contributing
- See Issues tab, and feel free to submit your own issues
- Add PRs if you discover a solution to an existing issue
- For further discussions and questions, post in Discussions or talk to us on Discord
- For more information, see Contributing
Contributing Code
Setup
uv (recommended)
Make sure you have uv installed
- Clone this repo and
cdinto it - Run
git fetch --tags git@github.com:vyperlang/vyper.gitto get the tags necessary for version inference - Run
uv sync - Run
source .venv/bin/activateto activate the virtual environment - Run
vyper --versionto verify the setup
pip
Make sure you have pip, setuptools, and pytest installed
- Clone this repo and
cdinto it - Run
git fetch --tags git@github.com:vyperlang/vyper.gitto get the tags necessary for version inference - Run
python -m venv .venvto create a virtual environment - Run
source .venv/bin/activateto activate it - Run
make initto install the main dependencies - Run
make dev-initto install the dev dependencies - Run
vyper --versionto verify the setup
Commands
vyper path/to/file.vyto run your local copy of the compilerpytestto test your changes Useful pytest flags: *-x: Fail test run on first test failure *--instafail: Show reason for test failure directly, instead of at the end of a test run *--disable-warnings: Hide warnings which occurred during testsmake mypyto type check your changesmake lintto check your files are correctly formatted (also runs mypy)
Other Tips
Checking performance
To run a python performance profile (to find compiler perf hotspots):
PYTHONPATH=. python -m cProfile -s tottime vyper/cli/vyper_compile.py "$@"
The utility timer functions timeit, profileit and cumtimeit are available in vyper/utils.py.
Getting call graph
To get a call graph from a python profile, install gprof2dot and xdot, and run it like gprof2dot -f pstats stats | xdot -. (See https://stackoverflow.com/a/23164271/).
Testing with hevm
Install hevm by downloading it from the releases page (https://github.com/ethereum/hevm/releases/latest) and making sure it is in your PATH. hevm tests can be enabled with --hevm flag, and hevm tests can be selected with the -m hevm marker. For instance, pytest -m "hevm" --hevm.
Fuzzing tests
Fuzzing test are very slow, so they are not run by default.
To run them, use pytest -m "fuzzing".
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vyper-0.5.0a1.tar.gz.
File metadata
- Download URL: vyper-0.5.0a1.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d2c606a223f23dedbc4f0614af1fdbc593617b8bd129594d0d9468eada50344
|
|
| MD5 |
5580d1f9634666ad4595d168d6c3f63b
|
|
| BLAKE2b-256 |
8887b5722d5e10fb52aef626eff7699f7623221d82f27fdd432af6b060fff8ee
|
Provenance
The following attestation bundles were made for vyper-0.5.0a1.tar.gz:
Publisher:
release-pypi.yml on vyperlang/vyper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vyper-0.5.0a1.tar.gz -
Subject digest:
0d2c606a223f23dedbc4f0614af1fdbc593617b8bd129594d0d9468eada50344 - Sigstore transparency entry: 1459614587
- Sigstore integration time:
-
Permalink:
vyperlang/vyper@7d73c46878e850987891ac21430fc4d29af33d5a -
Branch / Tag:
refs/tags/v0.5.0a1 - Owner: https://github.com/vyperlang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@7d73c46878e850987891ac21430fc4d29af33d5a -
Trigger Event:
release
-
Statement type:
File details
Details for the file vyper-0.5.0a1-py3-none-any.whl.
File metadata
- Download URL: vyper-0.5.0a1-py3-none-any.whl
- Upload date:
- Size: 575.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c62f785526e01eb577e4de917252909eeb221539f2ce7c76a3c1fdac701f2710
|
|
| MD5 |
79742f632550ff52673a7044a3cb42bc
|
|
| BLAKE2b-256 |
cf3b6b5717f5a209369d905464066a1815267890b33e2323c8a57914db92e38f
|
Provenance
The following attestation bundles were made for vyper-0.5.0a1-py3-none-any.whl:
Publisher:
release-pypi.yml on vyperlang/vyper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vyper-0.5.0a1-py3-none-any.whl -
Subject digest:
c62f785526e01eb577e4de917252909eeb221539f2ce7c76a3c1fdac701f2710 - Sigstore transparency entry: 1459614905
- Sigstore integration time:
-
Permalink:
vyperlang/vyper@7d73c46878e850987891ac21430fc4d29af33d5a -
Branch / Tag:
refs/tags/v0.5.0a1 - Owner: https://github.com/vyperlang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@7d73c46878e850987891ac21430fc4d29af33d5a -
Trigger Event:
release
-
Statement type: