Skip to content

vyperlang/vyper

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9e916f1 · Feb 23, 2025
Feb 11, 2025
Jan 3, 2025
Feb 18, 2025
Dec 14, 2021
Feb 23, 2025
Feb 23, 2025
May 28, 2024
Mar 17, 2024
Feb 12, 2024
Feb 12, 2024
Sep 1, 2024
Jan 29, 2025
May 6, 2022
Apr 15, 2024
Feb 6, 2025
Sep 10, 2024
May 28, 2024
Sep 28, 2020
Mar 17, 2024
Jan 14, 2025
Feb 12, 2024
Feb 6, 2025
Jan 14, 2025

Repository files navigation

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 beta software, use with care

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