Warp
Warp brings Solidity to Starknet, making it possible to transpile Ethereum smart contracts to Starknet Cairo Contracts.
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
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:
warp/tests/behaviour/contracts/if/localVariables.sol
Lines 5 to 25 in 321bfe7
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!