Skip to content

software-mansion/scarb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f477f30 · Mar 8, 2023
Jan 13, 2023
Mar 3, 2023
Feb 24, 2023
Feb 16, 2023
Mar 8, 2023
Jan 30, 2023
Mar 8, 2023
Dec 2, 2022
Feb 24, 2023
Mar 6, 2023
Mar 6, 2023
Jan 12, 2023
Mar 1, 2023
Jan 13, 2023

Repository files navigation

Scarb

Scarb is the project management tool for the Cairo language. Scarb manages your dependencies, compiles your projects and works as an extensible platform assisting in development.

Getting started

Installation

Binary archives for all major platforms (Linux, macOS, Windows) are published on our GitHub releases page. Simply download suitable one, extract, and move the scarb executable to a directory reachable by your PATH. In the future, an automated installer is planned to be created.

Creating new project

$ scarb new project/directory

Also: There is scarb init which runs in current directory instead of creating new one.

Compiling

$ scarb build

Built artifacts will be written to target/release directory.

Also: scarb clean cleans target directory.

Building CASM

Add following to Scarb.toml:

[lib]
casm = true

Also: Adding sierra = false will stop building Sierra code.

Building StarkNet contracts

Add following to Scarb.toml:

[[target.starknet-contract]]

Note: Ensure there is no [lib] section, they are conflicting until #63 will be done.

Adding dependencies

Note: This is identical to Cargo.

In manifest

[dependencies]
quaireaux = { path = "path/to/quaireaux" }
quaireaux = { git = "https://github.com/keep-starknet-strange/quaireaux.git" }

Also: You can add version field to specify package version, but this will do more harm than good currently, Scarb lacks proper version solution algorithm yet.

Also: You can add branch, tag and rev fields to Git dependencies.

Also: You can use ssh:// URLs, Scarb uses local git installation for all network operations.

Via scarb add

$ scarb add quaireaux --path path/to/quaireaux
$ scarb add quaireaux --git https://github.com/keep-starknet-strange/quaireaux.git

Also: You can specify package version like this: quaireaux@0.1.0, but see remarks in previous section.

Also: --git supports --branch, --tag and --rev arguments.

Also: scarb rm removes a dependency.

Formatting

# Format Cairo code:
$ scarb fmt

# Check formatting in CI:
$ scarb fmt -c

Changelog and roadmap

All notable changes to this project are documented on the GitHub releases page.

We track project roadmap here.

Credits

This product includes modified portions of code of Cargo, developed by the Rust project contributors.

This product includes modified portions of code of hex_solver, developed by Six Colors AB.