Skip to content

axic/warp

 
 

Repository files navigation

Warp

Warp brings Solidity to StarkNet, making it possible to transpile Ethereum smart contracts to StarkNet Cairo Contracts.

Installation ⚙️

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.

Installation from source

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

Usage 💻

To transpile a contract:

bin/warp transpile example_contracts/ERC20.sol

Contributing ⚒️

Testing

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

About

Bringing Solidity to StarkNet at warp speed!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 91.0%
  • Solidity 7.0%
  • Cairo 1.4%
  • Python 0.6%
  • Shell 0.0%
  • Makefile 0.0%