Skip to main content

Vyper: the Pythonic Programming Language for the EVM

Project description

Build Status Documentation Status Discord Telegram

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.

Testing (using pytest)

(Complete installation steps first.)

make dev-init
./quicktest.sh -m "not fuzzing"

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, ./quicktest.sh -m "hevm" --hevm.

Developing (working on the compiler)

A useful script to have in your PATH is something like the following:

$ cat ~/.local/bin/vyc
#!/usr/bin/env bash
PYTHONPATH=. python vyper/cli/vyper_compile.py "$@"

To run a python performance profile (to find compiler perf hotspots):

PYTHONPATH=. python -m cProfile -s tottime vyper/cli/vyper_compile.py "$@"

To get a call graph from a python profile, pip install gprof2dot and xdot, and run it like gprof2dot -f pstats stats | xdot -. (See https://stackoverflow.com/a/23164271/).

The utility timer functions timeit, profileit and cumtimeit are available in vyper/utils.py.

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

Project details


Release history Release notifications | RSS feed

This version

0.4.1

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.4.1.tar.gz (734.2 kB view details)

Uploaded Source

Built Distribution

vyper-0.4.1-py3-none-any.whl (370.8 kB view details)

Uploaded Python 3

File details

Details for the file vyper-0.4.1.tar.gz.

File metadata

  • Download URL: vyper-0.4.1.tar.gz
  • Upload date:
  • Size: 734.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vyper-0.4.1.tar.gz
Algorithm Hash digest
SHA256 2a219b895c9b5ad6a71237a6fb7d03a6eccaa800faa30ba32418847e350a95e3
MD5 5536c1ab3b7e26bc895bc06a17146370
BLAKE2b-256 b3f13848bc040c2715bf77e80cc8cd03359257a959d9cf4a037a3506804cb995

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyper-0.4.1.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.4.1-py3-none-any.whl.

File metadata

  • Download URL: vyper-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 370.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vyper-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b22e19e20557b3c13fa2721efabc4e926f624af9a3bd328e1da8fb6b727d908f
MD5 6e78dc99fdc0338d5d26f5a0827f112a
BLAKE2b-256 2f3ffb474ea7f3e00a16fb23ea01e1844977e450aca7962e7ad9d11badb61683

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyper-0.4.1-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page