pub struct Vyper<'a> {
pub path_to_code: &'a Path,
pub bytecode: Option<String>,
pub abi: PathBuf,
pub venv: Option<&'a Path>,
}Expand description
Represents important information about a Vyper contract. ABI doesn’t need to point to an
existing file since it can just be generated using gen_abi(). If the ABI already exists at the given path, you can use serde_json to retrieve it from a file.
Fields§
§path_to_code: &'a Path§bytecode: Option<String>§abi: PathBuf§venv: Option<&'a Path>Implementations§
Source§impl<'a> Vyper<'a>
impl<'a> Vyper<'a>
Sourcepub fn new(path: &'a Path) -> Self
pub fn new(path: &'a Path) -> Self
Constructor function that takes in the path to your vyper contract
pub fn with_abi(root: &'a Path, abi_path: PathBuf) -> Self
pub fn with_venv(path: &'a Path, venv: &'a Path) -> Vyper<'a>
pub fn with_venv_and_abi( path: &'a Path, venv: &'a Path, abi: PathBuf, ) -> Vyper<'a>
pub fn abi_mut(&mut self) -> &mut PathBuf
pub fn abi_exists(&self) -> bool
pub fn contract_exists(&self) -> bool
pub fn get_vyper(&self) -> String
pub fn get_pip(&self) -> String
pub fn exists(&self) -> bool
Sourcepub fn get_version(&self) -> Result<String, VyperErrors>
pub fn get_version(&self) -> Result<String, VyperErrors>
check the version of the vyper compiler
Sourcepub fn compile(&mut self) -> Result<(), VyperErrors>
pub fn compile(&mut self) -> Result<(), VyperErrors>
Compiles a vyper contract by invoking the vyper compiler, updates the ABI field in the Vyper struct
pub fn compile_blueprint(&mut self) -> Result<(), VyperErrors>
Sourcepub fn compile_ver(&mut self, ver: &Evm) -> Result<(), VyperErrors>
pub fn compile_ver(&mut self, ver: &Evm) -> Result<(), VyperErrors>
Compiles a vyper contract by invoking the vyper compiler, arg for specifying the EVM version to compile to
Sourcepub fn gen_abi(&self) -> Result<(), VyperErrors>
pub fn gen_abi(&self) -> Result<(), VyperErrors>
Generates the ABI and creates a file @ the abi path specified in the Vyper struct
Sourcepub fn get_abi(&self) -> Result<Value, VyperErrors>
pub fn get_abi(&self) -> Result<Value, VyperErrors>
Generates the ABI and creates a file @ the abi path specified in the Vyper struct
Sourcepub fn storage_layout(&self) -> Result<(), VyperErrors>
pub fn storage_layout(&self) -> Result<(), VyperErrors>
Storage layout as JSON, saves it to a file
Sourcepub fn ast(&self) -> Result<(), VyperErrors>
pub fn ast(&self) -> Result<(), VyperErrors>
AST of your contract as JSON, saves it to a file
Sourcepub fn interface(&self) -> Result<(), VyperErrors>
pub fn interface(&self) -> Result<(), VyperErrors>
Generates an external interface for your vyper contract to be called with
Sourcepub fn opcodes(&self) -> Result<(), VyperErrors>
pub fn opcodes(&self) -> Result<(), VyperErrors>
Generates the opcodes produced by your vyper contract, saves it as a text file
Sourcepub fn opcodes_runtime(&self) -> Result<(), VyperErrors>
pub fn opcodes_runtime(&self) -> Result<(), VyperErrors>
Generates the opcodes produced by your vyper contract at runtime, saves it as a text file
Sourcepub fn userdoc(&self) -> Result<(), VyperErrors>
pub fn userdoc(&self) -> Result<(), VyperErrors>
Natspec user documentation for vyper contract
Sourcepub fn devdoc(&self) -> Result<(), VyperErrors>
pub fn devdoc(&self) -> Result<(), VyperErrors>
Natspec dev documentation for vyper contract