Expand description
This is the documentation for the Vyper-rs crate. Vyper-rs is a library to interact with the vyper compiler and manage versions with a venv. Our goal is to connect Vyper with the robust tooling and infrastructure for the Solidity ecosystem written in Rust and become the standard compiler interface.
Modules§
- The Macro module contains powerful macros used to enhance the developer experience.
- Utilities offered by the crate.
- Manages versions of the vyper compiler with a venv or globally. This state machine represents all valid states for the venv and vyper compiler. While this works with and without a venv, it is strongly recommended to use a venv. Creating a venv with this program is simple, just call
new()
to construct the type andinit()
to create the venv (if not already created). If you called init(), then you can call the installation method ivyper_venv(). There is an optional argument that takes in the desired compiler version. You may call try_ready() if the compiler is already installed in your venv. Otherwise, this step be skipped with the skip() method in order to install vyper globally or use a preexisting installation. The accompanying installation method is called ivyper_pip() and try_ready() is also available in this namespace. Both of these methods under Venvreturn a Complete state. When this is reached, you may know with certainty that a version of Vyper is installed globally with pip and you can safely use the methods in the Vyper module. Likewise, when the state is Venv , you may use the namespace to access methods for use inside the venv. Methods inside the Venv namespace are mostly equivalent to the ones in the Vyper module, thus you can rely on the documentation for these methods inside the Venv module. - This is the main module of the crate. Uses the global installation of Vyper.
- This module contains the main error type returned when there’s some issue with the compiler in the Vyper module.
Macros§
- The
abi!
macro is used to compile one more more Vyper contracts and get or generate the ABI. - The
compile!
macro is used to compile one more more Vyper contracts. - The
venv!
macro creates a virtual environment with the latest version of the vyper compiler installed. Optionally, you can pass the desired version of the Vyper compiler you want to install, i.e “0.3.10”, as a &str. - The
vyper!
macro is used to construct the Vyper type without the boilerplate. If there is more than one pair of literals passed into the macro, the macro will return a Vypers.