Skip to main content

Installation and Usage

Installation​

Dependencies​

  1. You will need z3 and gmp installed to use Warp.
  • Install command on macOS:
brew install z3 gmp

If you're on an arm based Apple machine (m1/m2 mac) you'll need to install gmp and export some environment variables

export CFLAGS=-I`brew --prefix gmp`/include
export LDFLAGS=-L`brew --prefix gmp`/lib
  • Install command on Ubuntu:
sudo apt install libz3-dev libgmp3-dev
  1. Install Python3.9 with dev dependencies (python3.9 python3.9-venv python3.9-dev) into your base env. If you do not have the dev dependencies installed the installation will fail.
  • Install commands on MacOS:
brew install python@3.9

With python3.9 already installed you have venv covered:

If you are using Python 3.3 or newer (...) venv is included in the Python standard library and requires no additional installation.

Then you can install dev package using pip:

pip install python-dev-tools
  • Install commands on Ubuntu:
sudo apt install python3.9 python3.9-venv python3.9-dev

Or you can just install python3.9 and then install python-dev-tools using pip.

  1. Install Python dependencies. You can find them in requirements.txt file in repository: https://github.com/NethermindEth/warp/blob/develop/requirements.txt. You can install them via pip3.9 install <package-name> command.

Note: It is important to install dependencies for Python 3.9, not for any other version of Python you may have installed on your machine.

Installation​

The first step is to make sure you have all required external dependencies installed.

Then perform the following instructions in order:

  1. Add the warp package from npm.
yarn global add @nethermindeth/warp
  1. Ensure the package was added by checking the version number:
warp version
  1. Install the dependencies:
warp install --verbose

Use the --python flag to pass the path to python3.9 binary, if the above command complains.

warp install --python <path/to/python3.9> --verbose
  1. Test the installation worked by transpiling an example ERC20 contract:
warp transpile <contract-path>