How to contribute (and get paid)

starknet.dart is a dart package allowing any dart program (mainly Flutter apps) to communicate with the Starknet blockchain.

The Starknet nodes expose a JSON-RPC API (see the specs) that we can call to call Smart Contract methods or even get information on blocks and past transactions.

The goal of the project is thus to build a bridge between dart applications and Starknet, while staying consistent with the common abstractions used in other blockchain SDKs (see ethers.js).

Why contribute to starknet.dart?

Starknet is a revolution in the web3 world: it allows to scale Ethereum and offers the best UX one can dream of on a blockchain thanks to unique features like account abstraction or session keys.

But web3 mainstream adoption won't happen unless decentralized applications go to mobile. That's why it's a priority to build the best possible Starknet SDK for Flutter, one of the most used cross-platform mobile frameworks.

If you want to contribute to the web3 adoption and more specifically Starknet one, then you probably can't have more impact than working on this SDK that will be used by the majority of Flutter dApps on Starknet!

To become a core contributor

After a few qualitative contributions, we'll probably offer you to join the core team to become a maintainer of the project and get paid for your work.

If you want to contribute to the project, you can follow the steps below:

  1. Join our telegram group and introduce yourself.
  2. We'll let you know what are good issues to start with.
  3. Create your account on Only Dust and receive your first payment.

How to set up your dev env

  1. Clone the repository:
git clone git@github.com:focustree/starknet.dart.git
  1. Install flutter and dart

  2. Install melos:

dart pub global activate melos

We use melos to manage our monorepo:

  • Run melos bs to fetch deps
  • Run melos format to format all packages
  • Run melos test to run tests
  • Run melos publish to publish all packages
  1. Fetch all dependencies:
melos bootstrap
  1. Set up your starknet dev env. First install asdf and cargo, then run:
source .env.devnet # Load the env variables
melos starknet:setup

How to run the tests

Start the devnet in one terminal:

melos devnet:start

Then run the tests in another terminal:

melos test

How to update devnet dump

Start the devnet in dump mode:

melos devnet:start:dump

Then deploy contracts to devnet:

melos devnet:setup

Then kill the devnet, that's it the assets/devnet-dump.json has been updated!

Repo structure

  • /contracts contains all the contracts we use in the project. We prefix the folder by the cairo version we use.
  • /packages contains all the packages we use in the project.
    • starknet contains the core logic with crypto hash functions and the main utility classes.
    • starknet_provider contains the main package that we use to interact with the Starknet rpc nodes.
    • secure_store manages the secure storage of the private key using different methods depending on the platform.
    • wallet_kit is a higher level ui kit to manage wallets and transactions in a flutter app.
  • /examples contains examples of apps using the packages. They should be accompanied by a tutorial in the docs to reproduce the app from scratch.
  • /docs contains the documentation of the project. Docs are automatically deployed when we merge to main.

Generate freezed model classes

To avoid writing too much boilerplate, we use the freezed library to automatically generate serializer logic.

You can run the following command to generate those classes:

dart run build_runner build

Alternatively, you can hit Cmd + Shift + B in vscode.

Troubleshooting

Tools need to be at the right version to avoid any incompability: