Skip to main content

Plugin for Ape Ethereum Framework for compiling Vyper contracts

Project description

Quick Start

Ape compiler plugin around VVM

Dependencies

  • python3 version 3.8 or greater, python3-dev

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.

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

# Automatically allow importing voting contracts in your project.
vyper:
  import_remapping:
    - "voting=VyperVoting@v0.3.7"

Import the voting contract types like this:

# @version 0.3.7

import voting.ballot as ballot

Project details


Download files

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

Source Distribution

ape-vyper-0.6.4.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

ape_vyper-0.6.4-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file ape-vyper-0.6.4.tar.gz.

File metadata

  • Download URL: ape-vyper-0.6.4.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for ape-vyper-0.6.4.tar.gz
Algorithm Hash digest
SHA256 23ca7dc20de3584592bb270b8abadffac392dd3b560d4f8075d6a75b9b975d5a
MD5 074bbb3857058b80e3147bfe3279b12c
BLAKE2b-256 4ff3f1347b6a7e142a7238b2c0d5a352ea0005c986a07cea76ede228f8cb1f52

See more details on using hashes here.

Provenance

File details

Details for the file ape_vyper-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: ape_vyper-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for ape_vyper-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 25504e7a7b0349832f53b16810c4e30e1b234cd8313ad9e7ad527942ea3622ac
MD5 25eec81d9cf238097bb7865c1d889691
BLAKE2b-256 eec488857674b0695331ae57268e802c14a7eb6c1c6d4cf078e0926239596937

See more details on using hashes here.

Provenance

Supported by

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