Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Build Status Documentation Status Discord Telegram Twitter

PyPI Docker

Coverage Status Language grade: Python

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

  1. Clone this repo and cd into it
  2. Run git fetch --tags git@github.com:vyperlang/vyper.git to get the tags necessary for version inference
  3. Run uv sync
  4. Run source .venv/bin/activate to activate the virtual environment
  5. Run vyper --version to verify the setup
  6. (optional) Run git config blame.ignoreRevsFile .git-blame-ignore-revs to improve git blame

pip

Make sure you have pip (version 25.1 or above), setuptools, and pytest installed

  1. Clone this repo and cd into it
  2. Run git fetch --tags git@github.com:vyperlang/vyper.git to get the tags necessary for version inference
  3. Run python -m venv .venv to create a virtual environment
  4. Run source .venv/bin/activate to activate it
  5. Run make init to install the main dependencies
  6. Run make dev-init to install the dev dependencies
  7. Run vyper --version to verify the setup
  8. (optional) Run git config blame.ignoreRevsFile .git-blame-ignore-revs to improve git blame

Commands

  • vyper path/to/file.vy to run your local copy of the compiler
  • pytest to 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 tests
  • make mypy to type check your changes
  • make lint to check your files are correctly formatted (also runs mypy)

Docker Setup

Note: This is only useful for contributors, if you just want to use vyper, look here.

Build the image:

docker build . -t vyper -f Dockerfile

Check it runs:

docker run -v $(pwd):/code vyper --help

Run vyper:

It works like vyper locally, with the difference that you should add /code/ before the local path:

docker run -v $(pwd):/code vyper /code/<path to vy file>

Example:

  • vyper -f abi_python examples/name_registry/name_registry.vy becomes
  • docker run -v $(pwd):/code vyper -f abi_python /code/examples/name_registry/name_registry.vy

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".

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vyper-0.5.0b1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

vyper-0.5.0b1-py3-none-any.whl (668.3 kB view details)

Uploaded Python 3

File details

Details for the file vyper-0.5.0b1.tar.gz.

File metadata

  • Download URL: vyper-0.5.0b1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vyper-0.5.0b1.tar.gz
Algorithm Hash digest
SHA256 c98ed60eaa1c04e079052ef5adf76ab1b5c581107b8dd1031d0d6dea50d0400e
MD5 8ac2ab6627950b1de26e9780a2ebe7c1
BLAKE2b-256 12b152b494bab667fc27b6ca004eff1c5afd5fa5ab2b56eda1247d707bad7bc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyper-0.5.0b1.tar.gz:

Publisher: release-pypi.yml on vyperlang/vyper

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

File details

Details for the file vyper-0.5.0b1-py3-none-any.whl.

File metadata

  • Download URL: vyper-0.5.0b1-py3-none-any.whl
  • Upload date:
  • Size: 668.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vyper-0.5.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2fe1e26e242f31210eabdbcc1ad54167046aa6c5d0ea4472d2ab3f0f2367cd1
MD5 61e187aff9cc1411a529fb5de137725c
BLAKE2b-256 0d499574463d87f9abf0e5ed56d3c7bc22dbd61d08a3f7cb7eaedfc298b36258

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyper-0.5.0b1-py3-none-any.whl:

Publisher: release-pypi.yml on vyperlang/vyper

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

Release history Release notifications | RSS feed

This release

0.5.0b1 This release

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.10

2 files

0.3.10rc1

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.16

2 files

0.2.15

2 files

0.2.14

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page