axic / warp

Bringing Solidity to StarkNet at warp speed!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

License:Apache License 2.0


Languages

Language:TypeScript 90.9%Language:Solidity 7.0%Language:Cairo 1.4%Language:Python 0.6%Language:Shell 0.0%Language:Makefile 0.0%Language:JavaScript 0.0%