Giter VIP home page Giter VIP logo

nethermindeth / warp Goto Github PK

View Code? Open in Web Editor NEW
751.0 15.0 68.0 678.76 MB

Warp - Bringing Solidity to Starknet at warp speed. Warp is a Solidity to Cairo Compiler, this allows teams to write/migrate Solidity to Cairo for easy onboarding into the StarkNet ecosystem.

Home Page: https://nethermind.io/warp/

License: Apache License 2.0

Shell 0.05% Python 0.44% Makefile 0.01% Solidity 6.76% TypeScript 80.64% JavaScript 0.03% Cairo 11.84% Dockerfile 0.01% PEG.js 0.22%
ethereum solidity solidity-contracts starkware cairo-lang starknet evm evm-bytecode

warp's Introduction

Warp

๐Ÿ“ข Warp is no longer maintained. Feel free to fork it. You can start developing warp by checking supported features and issues. Development instructions are here.

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

โš ๏ธ Note: Cairo 1 is not fully supported yet. For more details see supported features.

โš ๏ธ Note: Cairo 0 implementation of warp can be found at this tag.

Quickstart

Note: Executing Warp using Docker works only for x86 architecture. If you're using ARM architecture (such as Apple's M1) you can find warp installation instructions here.

Note: The method refers to warp for cairo 0. If you are looking for cairo 1 warp see installing from source. You might be also interested in supported features in cairo 1 warp.

The easiest way to start with warp is using docker. To do that navigate to the directory where you store your contracts and run command:

docker run --rm -v "$PWD:/dapp" nethermind/warp transpile <contract-path>

You can find docker installation guide here.

Quick links

๐Ÿ“– Documentation

๐Ÿ“ฆ Installation

โœ๏ธ Developing warp

Discord

twitter

Libraries


Libraries are bundled into the point of use, therefore if you try transpile a standalone library it will result in no output. If you would like to transpile and deploy a standalone library please alter its declaration to `contract`.

Supported features

Solidity: Warp supports Solidity 0.8. In order to support newer versions nethersolc has to be updated, and nethersolc binaries within warp repository have to be updated.

Cairo: The latest version of Cairo compiler supported by warp is 1.1. You can find compiler binaries together with warp plugin executable in cairo1 directory. Warp plugin repository is located here.

Warp doesn't support all features of Cairo 1 yet. You can find an example contract supported by warp in tests/behaviour/contracts/if/localVariables.sol:

contract WARP {
function ifNoElse(bool choice) pure public returns (uint8 a) {
uint8 x = 2;
if (choice) {
x = 1;
}
return x;
}
function ifWithElse(bool choice) pure public returns (uint8 a) {
uint8 x = 2;
if (choice) {
x = 1;
} else {
x= 3;
}
return x;
}
}

For more fully working examples see here. Uncommented lines are Solidity files that are passing tests. Those files are located in tests/behaviour/contracts/. There is also a list of compilation tests here. It contains contracts that are partially working ie. they are compiling, but the code might not yield correct results in runtime.

You can find a list of missing features here. Feel free to pick one of those and implement it yourself!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.