This repository aims at comparing 2 development frameworks for starknet smart contract development:
You can see the results of the comparision below or jump to any subject for more details.
Here is the full list of comparisons:
Step | nile | protostar |
---|---|---|
1. Installation |
✔️ isolated in a python virtual env ❌ cairo-lang is not compatible with latest python, requires a dedicated setup
|
✔️ one-liner installation script |
2. Project initialization |
✔️ one-liner to initialize a project ✔️ install all required dependencies ✔️ generate .gitignore and Makefile
|
✔️ one-liner to initialize a project ❌ forces the generation of a git repository |
3. Compilation |
✔️ pretty output ✔️ all contracts are automatically detected ❌ compilation error messages are difficult to understand ❌ does not support multiple contracts with the same name ❌ requires a pip module to use an external library |
❌ need to provide all contract files in protostar.toml ❌ compilation error messages are difficult to understand ❌ requires a git repository to use an external library |
4.1. Unit testing - Assertions |
✔️ relies on proven pytest framework✔️ all the power of python ❌ need to be familiar with python ❌ need to explicitely deploy the contract to test it |
✔️ uses same language as smart contract development ✔️ can still use python hints to manipulate data or perform assertions ✔️ nice output |
4.2. Unit testing - Mocking | ❌ no built-in mocking strategy |
✔️ built-in mocking cheat code ✔️ manual mocking is still possible ✔️ mocking of blockchain data using cheat codes ❌ cannot mock function calls based on parameters |
4.3. Unit testing - Debugging | ❌ no extra tool to help unit test debugging | ✔️ usage of hints are very useful for debugging purposes |
5. Deployment |
✔️ several useful commands to deploy and interact with a contract ✔️ support of a local node using starknet-devnet
|
✔️ support of contract deployment ❌ lack of local devnet |
6. Performances |
❌ Compilation: 35s ❌ Test: 1min 29s |
✔️ Compilation: 17s ✔️ Test: 35s |
As a conclusion, protostar
offers more features during the development life cycle and is also way faster. Which is a nice advantage especially when using TDD.
nile
, on the other hand, offers more feature during the deployment, especially thanks to its compatibility with starknet-devnet
for running a local node.
Let's see how both projects evolve in the future and if more features are added.