Crate svm

source
Expand description

§Solidity Compiler Version Manager

crates.io docs.rs build status

This crate provides a cross-platform support for managing Solidity compiler versions.

§Install

From crates.io:

cargo install svm-rs

Or from the repository:

cargo install --locked --git https://github.com/alloy-rs/svm-rs/

§Usage

Solc version manager

Usage: svm <COMMAND>

Commands:
  help     Print this message or the help of the given subcommand(s)
  install  Install Solc versions
  list     List all Solc versions
  remove   Remove a Solc version, or "all" to remove all versions
  use      Set a Solc version as the global default

Options:
  -h, --help     Print help
  -V, --version  Print version

Structs§

  • Build info contains the SHA256 checksum of a solc binary.
  • Defines the struct that the JSON-formatted release list can be deserialized into.

Enums§

  • Types of supported platforms.
  • Error types from the svm_lib crate.

Functions§

  • Fetch all releases available for the provided platform.
  • Fetches the list of all the available versions of Solc. The list is platform dependent, so different versions can be found for macosx vs linux.
  • Returns the path to the default data directory.
  • Reads the currently set global version for Solc. Returns None if none has yet been set.
  • Returns the path to the global version file.
  • Installs the provided version of Solc in the machine.
  • Reads the list of Solc versions that have been installed in the machine. The version list is sorted in ascending order.
  • Read the current machine’s platform.
  • Removes the provided version of Solc from the machine.
  • Sets the provided version as the global version for Solc.
  • Setup SVM home directory.
  • Unset the global version. This should be done if all versions are removed.
  • Derive path to a specific Solc version’s binary file.
  • Returns the path to a specific Solc version’s directory.