Warp brings Solidity to StarkNet, making it possible to transpile Ethereum smart contracts to StarkNet Cairo Contracts.
You will also need z3 to use warp, installation instructions:
On macos:
brew install z3
On ubuntu:
sudo apt install libz3-dev
Make sure that you have the venv
module for your python installation.
To get the dependencies:
yarn
Compile the project:
yarn tsc
Get python dev dependencies: (recommended to create a python3.7 venv for this)
pip install -r requirements.txt
bin/warp
To transpile a contract:
bin/warp transpile example_contracts/ERC20.sol
To test run warp on all example contracts:
bin/warp test
For this to work, you must be able to run
starknet-compile
Instructions to set this up can be found at https://www.cairo-lang.org/docs/quickstart.html
To examine a solidity file in unwarped AST form:
bin/warp analyse example_contracts/ERC20.sol
---New tests--- The old tests check for successfully compiling cairo code The new tests check for correctly running cairo code
First run the setup script:
tests/behaviour/setup.sh
Second, in a separate terminal, start a starknet-testnet server:
yarn testnet
then to run the tests:
yarn test
In order to generate benchmarks locally during development:
yarn testnet:benchmark
yarn test
python starknet-testnet/generateMarkdown.py
This saves the benchmarks at benchmark/stats/data.md