https://github.com/vyperlang/vyper
Pythonic Smart Contract Language for the EVM
https://github.com/vyperlang/vyper
ethereum ethereum-dapp language python vyper
Last synced: 7 days ago
JSON representation
Pythonic Smart Contract Language for the EVM
- Host: GitHub
- URL: https://github.com/vyperlang/vyper
- Owner: vyperlang
- License: other
- Created: 2016-11-11T08:56:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-21T10:33:42.000Z (25 days ago)
- Last Synced: 2025-03-22T05:33:04.367Z (24 days ago)
- Topics: ethereum, ethereum-dapp, language, python, vyper
- Language: Python
- Homepage: https://vyperlang.org
- Size: 12.3 MB
- Stars: 4,999
- Watchers: 158
- Forks: 836
- Open Issues: 500
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.rst
- Funding: FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- Library-of-Ethereum - Vyper - Official Vyper Repo (Smart Contracts / Vyper)
- awesome-web3 - Vyper - Contract-oriented, pythonic programming language that targets EVM. (Software Development / Python)
- DeFi-Developer-Road-Map - Vyper
- awesome-web3 - Vyper - Ethereum another native language for smart contracts development. Used less frequently than solidity (Ethereum / Ethereum Basics)
- best-of-crypto - GitHub - 21% open · ⏱️ 02.06.2024): (Smart Contract Platforms)
- awesomeLibrary - vyper - Pythonic Smart Contract Language for the EVM (语言资源库 / python)
README
[](https://github.com/vyperlang/vyper/actions/workflows/test.yml)
[](http://docs.vyperlang.org/en/latest/?badge=latest "ReadTheDocs")
[](https://discord.gg/6tw7PTM7C2)
[](https://t.me/vyperlang)[](https://pypi.org/project/vyper "PyPI")
[](https://hub.docker.com/r/vyperlang/vyper "DockerHub")[](https://codecov.io/gh/vyperlang/vyper "Codecov")
[](https://github.com/vyperlang/vyper/actions/workflows/codeql.yml)# Getting Started
See [Installing Vyper](http://docs.vyperlang.org/en/latest/installing-vyper.html) to install vyper.
See [Tools and Resources](https://docs.vyperlang.org/en/latest/resources.html) for an additional list of framework and tools with vyper support.
See [Documentation](http://docs.vyperlang.org/en/latest/index.html) for the documentation and overall design goals of the Vyper language.See [learn.vyperlang.org](https://learn.vyperlang.org/) for **learning Vyper by building a Pokémon game**.
See [try.vyperlang.org](https://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](https://docs.vyperlang.org/en/latest/installing-vyper.html)
for build instructions.# Compiling a contract
To compile a contract, use:
```bash
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](https://vyper.online/) 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](https://docs.vyperlang.org/en/latest/installing-vyper.html) first.)
```bash
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:
```bash
$ 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):
```bash
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](https://github.com/vyperlang/vyper/discussions) or talk to us on [Discord](https://discord.gg/6tw7PTM7C2)
* For more information, see [Contributing](http://docs.vyperlang.org/en/latest/contributing.html)