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 z3On ubuntu:
sudo apt install libz3-devMake sure that you have the venv
module for your python installation.
To get the dependencies:
yarnCompile the project:
yarn tscGet python dev dependencies: (recommended to create a python3.7 venv for this)
pip install -r requirements.txtbin/warpTo transpile a contract:
bin/warp transpile example_contracts/ERC20.solTo test run warp on all example contracts:
bin/warp testFor this to work, you must be able to run
starknet-compileInstructions 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.shSecond, in a separate terminal, start a starknet-testnet server:
yarn testnetthen to run the tests:
yarn testIn order to generate benchmarks locally during development:
yarn testnet:benchmark
yarn testpython starknet-testnet/generateMarkdown.pyThis saves the benchmarks at benchmark/stats/data.md