Plugin for Ape Ethereum Framework for compiling Vyper contracts
Project description
Quick Start
Ape compiler plugin around VVM
Dependencies
- python3 version 3.8 up to 3.11.
Installation
via pip
You can install the latest release via pip
:
pip install ape-vyper
via setuptools
You can clone the repository and use setuptools
for the most up-to-date version:
git clone https://github.com/ApeWorX/ape-vyper.git
cd ape-vyper
python3 setup.py install
Quick Usage
First, place Vyper contract source files (files with extension .vy
) in your Ape project's contracts folder.
An example Vyper contract can be found here.
Then, from your root Ape project folder, run the command:
ape compile
The .vy
files in your project will compile into ContractTypes
that you can deploy and interact with in Ape.
Compiler Version
By default, the ape-vyper
plugin uses version pragma for version specification.
However, you can also configure the version directly in your ape-config.yaml
file:
vyper:
version: 0.3.7
Interfaces
You can not compile interface source files directly.
Thus, you must place interface files in a directory named interfaces
in your contracts_folder
e.g. contracts/interfaces/IFace.vy
.
Then, these files can be imported in other .vy
sources files via:
import interfaces.IFace as IFace
Alternatively, use JSON interfaces from dependency contract types by listing them under the import_remapping
key:
# Use `voting` example contracts from Vyperlang repo.
dependencies:
- name: VyperVoting
github: vyperlang/vyper
contracts_folder: examples/voting/
version: v0.3.8
# Automatically allow importing voting contracts in your project.
vyper:
import_remapping:
- "voting=VyperVoting@v0.3.8"
Import the voting contract types like this:
# @version 0.3.10
import voting.ballot as ballot
Pragmas
Ape-Vyper supports Vyper 0.3.10's new pragma formats
Version Pragma
#pragma version 0.3.10
Optimization Pragma
#pragma optimize codesize
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
File details
Details for the file ape-vyper-0.6.12.tar.gz
.
File metadata
- Download URL: ape-vyper-0.6.12.tar.gz
- Upload date:
- Size: 46.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d8474701a7f6a510ee5c4eaddc10dbf4ebdcfb11287110e7d1248a5a85f7ee2 |
|
MD5 | 5f44322558833117f9191f610df1fe94 |
|
BLAKE2b-256 | b1d4997a30e60664d6be18d8732e19ac0ae359df0f8dd7d08bd1b232f84e8f8c |
File details
Details for the file ape_vyper-0.6.12-py3-none-any.whl
.
File metadata
- Download URL: ape_vyper-0.6.12-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbde7c3d95fe27c13d0f1d985b00d7214ab571ebb12e7a001b8d8e8d9ddcfce0 |
|
MD5 | 12beb1d70e97d733faf0cd31e74d3a40 |
|
BLAKE2b-256 | 051d8eebe77712a60905ef6ec2238b858e0d025335914bc2f11693a28bbfafd6 |