Type object
File match Scarb.toml
Schema URL https://catalog.lintel.tools/schemas/schemastore/scarb/latest.json
Source https://www.schemastore.org/scarb.json

Validate with Lintel

npx @lintel/lintel check
Type: object

This type is used to deserialize Scarb.toml files.

Properties

cairo TomlCairo | null

Global Cairo compiler configuration for this package or workspace profile.

cairo-plugin TomlTarget3 | null

The [cairo-plugin] target describing a Cairo compiler plugin artifact.

dependencies Record<string, TomlWorkspaceDependency | TomlDependency>

The [dependencies] table for normal build dependencies.

Your packages can depend on other libraries from registries, Git repositories, or subdirectories on your local file system.

dev-dependencies Record<string, TomlWorkspaceDependency | TomlDependency>

The [dev-dependencies] table for dependencies used only in tests. Development dependencies are not used when compiling a package for building, but are used for compiling tests.

These dependencies are not propagated to other packages which depend on this package.

executable TomlTarget2 | null

The [executable] target describing how to build an executable entrypoint.

The executable target defines an artifact that can be executed with scarb execute command. This target should be used for packages that are meant to be executed rather than used as dependencies.

Configure the entry function, allow-syscalls, and whether to emit Sierra output for the executable.

features Record<string, TomlFeatureToEnable[]>

The [features] table defining feature flags for conditional compilation.

lib TomlTarget | null

The [lib] target describing how to build the package library.

The library target defines a "library" that can be used by other packages. In other words, if a package does not provide a library target, it cannot be used as a dependency. If not specified, the name of the library defaults to the name of the package. A package can have only one library target.

If the manifest does not list any targets, Scarb will assume the library target with its default parameters.

Controls output artifacts (e.g. sierra, casm) and optional name overrides.

package TomlPackage | null

The [package] section with metadata about the current package.

Required for non-workspace members. Contains fields like name, version, edition, publish, license, etc.

patch Record<string, object>

The [patch.<source>] tables to override dependency sources.

Useful to redirect packages to local paths or forks for the resolver.

profile Record<string, object>

The [profile] table defining build profiles.

Common profiles are dev and release. Each profile can override cairo options and tool settings, and may inherit from another profile.

The [scripts] table with custom commands you can run via scarb run <name>.

Script commands are simple shell snippets; in workspaces, they can be marked with { workspace = true } to indicate inheritance.

target Record<string, TomlTarget4[]>

The [[target.*]] tables to define additional, custom-named targets.

target-defaults Record<string, TomlWorkspaceTargetDefault | TomlTargetDefaults>

The [target-defaults] table to define defaults applied to targets (for example, test settings) when not explicitly set on a target.

test array | null

The [[test]] array of tables defining external test suites.

Each table describes a test target with its own parameters. When absent, Scarb may auto-detect tests under the default tests directory.

tool Record<string, TomlWorkspaceTool>

The [tool] table for third‑party tool configuration namespaces.

Keys under tool.<name> are passed to external tools. Use { workspace = true } to opt into workspace inheritance when applicable.

workspace TomlWorkspace | null

The [workspace] section defining a multi-package workspace.

Lets you list members, define shared dependencies, scripts, and defaults inherited by workspace members.

Definitions

DetailedTomlDependency object
branch string | null

Git branch to use when git is specified.

default-features boolean | null

Whether to enable this dependency's default features (defaults to true).

features array | null

A list of features to enable for this dependency.

git string | null

Git URL for the dependency source.

path RelativeUtf8PathBuf | null

Local path to the dependency source, relative to the manifest that declares it.

registry string | null

Custom registry index URL to fetch this dependency from.

rev string | null

Specific Git revision (commit hash) to use when git is specified.

tag string | null

Git tag to use when git is specified.

version string | null

A semver version requirement for the dependency.

InliningStrategy integer | string

Controls function inlining behavior during compilation.

Can be a non-negative integer (inline small functions up to the given weight) or one of the predefined strategies: "default", "avoid".

MaybeWorkspace TomlWorkspaceField | string

Allows inheriting keys from a workspace.

MaybeWorkspace2 TomlWorkspaceField | string[]

Allows inheriting keys from a workspace.

MaybeWorkspace3 TomlWorkspaceField | PathOrBool

Allows inheriting keys from a workspace.

MaybeWorkspace4 TomlWorkspaceDependency | TomlDependency

Allows inheriting keys from a workspace.

MaybeWorkspace5 WorkspaceScriptDefinition | ScriptDefinition

Allows inheriting keys from a workspace.

MaybeWorkspace6 TomlWorkspaceTool

Allows inheriting keys from a workspace.

MaybeWorkspace7 TomlWorkspaceTargetDefault | TomlTargetDefaults

Allows inheriting keys from a workspace.

MaybeWorkspace8 TomlWorkspaceBuildExternalContracts | string[]

Allows inheriting keys from a workspace.

PackageInheritableFields object
authors array | null

Authors list to inherit for members.

cairo-version string | null

A Cairo compiler version requirement that this package is compatible with. This does not change the compiler version used by Scarb but enforces compatibility (can be ignored with --ignore-cairo-version).

description string | null

Short description of the package; shown on registries.

documentation string | null

URL of the package documentation.

format=uri
edition string | null

Cairo edition to inherit for members (e.g. "2023_10").

homepage string | null

Project homepage URL.

format=uri
keywords array | null

Search keywords for package discovery on registries.

license string | null

SPDX license expression, e.g. "MIT" or "Apache-2.0".

license-file string | null

Path to a license file to include in the package.

readme PathOrBool | null

Path to a README file, or false to disable including a readme.

repository string | null

URL of the source repository.

format=uri
version string | null

Version to inherit for members that opt into workspace.package.version = ....

PackageName string

A valid Cairo package name.

Must use only ASCII lowercase alphanumeric characters or _, cannot be empty, cannot start with a digit, cannot be a Cairo keyword, and cannot be just _.

See the full naming rules in the Scarb docs.

PathOrBool string | boolean
RelativeUtf8PathBuf string

Type representing a path for use in Scarb.toml where all paths are expected to be relative to it.

ScriptDefinition string
TargetDefaults object
build-external-contracts string[] required
TomlCairo object
add-functions-debug-info boolean | null

Add additional information about sierra functions to debug info. Used by cairo-debugger. This feature is unstable and is subject to change.

add-statements-code-locations-debug-info boolean | null

Add a mapping between sierra statement indexes and lines in cairo code to debug info. A statement index maps to a vector consisting of a line which caused the statement to be generated and all lines that were inlined or generated along the way. Used by cairo-coverage. This feature is unstable and is subject to change.

add-statements-functions-debug-info boolean | null

Add a mapping between sierra statement indexes and fully qualified paths of cairo functions to debug info. A statement index maps to a vector consisting of a function which caused the statement to be generated and all functions that were inlined or generated along the way. Used by cairo-profiler. This feature is unstable and is subject to change.

allow-warnings boolean | null

Do not exit with error on compiler warnings.

enable-gas boolean | null

Enable auto gas withdrawal and gas usage check.

incremental boolean | null

Whether to enable incremental compilation.

inlining-strategy InliningStrategy | null

Inlining strategy. If skip_sierra_optimizations is set to true, the value of this field has to be set to [None] or [Some] with [InliningStrategy::Avoid].

panic-backtrace boolean | null

Whether to add panic backtrace handling to the generated code.

sierra-replace-ids boolean | null

Replace all names in generated Sierra code with dummy counterparts, representing the expanded information about the named items.

For libfuncs and types that would be recursively opening their generic arguments. For functions, that would be their original name in Cairo. For example, while the Sierra name be [6], with this flag turned on it might be:

  • For libfuncs: felt252_const<2> or unbox<Box<Box<felt252>>>.
  • For types: felt252 or Box<Box<felt252>>.
  • For user functions: test::foo.

Defaults to false except for "dev" profile.

skip-optimizations boolean | null

Disable most possible optimizations that happen during compilation. Since inlining is an optimization as well, setting this field to true will make the cairo compiler behave (in the aspect of inlining) as if the inlining_strategy was set to [InliningStrategy::Avoid].

unsafe-panic boolean | null

Do not generate panic handling code. This might be useful for client side proving.

unstable-add-statements-code-locations-debug-info boolean | null

Alias for add_statements_code_locations_debug_info. If both defined, add_statements_code_locations_debug_info takes precedence.

unstable-add-statements-functions-debug-info boolean | null

Alias for add_statements_functions_debug_info. If both defined, add_statements_functions_debug_info takes precedence.

TomlDependency string | DetailedTomlDependency
TomlFeatureToEnable string
TomlPackage object

Represents the package section of a Scarb.toml.

name string required

A valid Cairo package name.

Must use only ASCII lowercase alphanumeric characters or _, cannot be empty, cannot start with a digit, cannot be a Cairo keyword, and cannot be just _.

See the full naming rules in the Scarb docs.

version TomlWorkspaceField | string required

Allows inheriting keys from a workspace.

assets array | null

A list of additional assets to ship with the package (packaged alongside sources). Declare files that should be treated as runtime assets of the package. Paths are relative to the package root and must point to files (directories are not allowed). Assets must exist at build time.

[package]
assets = ["mypackage-oracle.wasm", "some/file.dat"]
authors MaybeWorkspace2 | null

List of package authors.

cairo-version MaybeWorkspace | null

A Cairo compiler version requirement that this package is compatible with. This does not change the compiler version used by Scarb but enforces compatibility (can be ignored with --ignore-cairo-version).

description MaybeWorkspace | null

Short description of the package.

documentation MaybeWorkspace | null

URL to package documentation.

edition MaybeWorkspace | null

An optional key that affects which Cairo edition your package is compiled with. The editions allow newer Cairo compiler versions to introduce opt-in features that may break existing code. Setting the edition key in [package] will affect all targets in the package, including test suites etc.

Most manifests have the edition field filled in automatically by scarb new with the latest available edition. If the edition field is not present in Scarb.toml, then the default edition is assumed.

experimental-features array | null

This field is responsible for setting experimental flags to be used on the package for the compiler.

[package]
experimental-features = ["negative_impls"]
homepage MaybeWorkspace | null

Project homepage URL.

include array | null

When packaging a package with scarb package command (see packaging your package), all files excluded with rules from .gitignore or .scarbignore files are not included in the resulting package tarball. This field can be used mark files and subdirectories that should be included in the package tarball, even if those files would be excluded by rules from ignore files. The paths are relative to the package root and cannot point to files outside the package.

[package]
include = ["target/some/file.txt"]
keywords MaybeWorkspace2 | null

An array of strings that describe your package. This can help when searching for the package on a registry, and it is allowed to choose any words that would help someone find this package.

license MaybeWorkspace | null

The license field contains the name of the software license that the package is released under. The license-file field contains the path to a file containing the text of the license (relative to this Scarb.toml).

Package registries must interpret the license field as an SPDX 2 license expression. The license name must be a known license from the SPDX license list.

SPDX license expressions support AND and OR operators to combine multiple licenses.

[package]
license = "MIT OR Apache-2.0"
license-file MaybeWorkspace | null
no-core boolean | null

UNSTABLE This package does not depend on Cairo's core.

publish boolean | null

Whether the package is allowed to be published to a registry. Defaults to true. Set to false to prevent publishing.

re-export-cairo-plugins array | null

Re-exports direct cairo-plugin dependencies to all downstream packages.

When declared, any package depending on this one will automatically inherit these plugins as dependencies. Only direct dependencies with the cairo-plugin target are eligible for re-export.

[package]
re-export-cairo-plugins = ["proc_macro_package"]
readme MaybeWorkspace3 | null

This field should be the path to a file in the package root (relative to this Scarb.toml) that contains general information about the package.

repository MaybeWorkspace | null

This field should be a URL to the source repository for your package.

[package]
repository = "<https://github.com/software-mansion/scarb>"
urls Record<string, string>

A free-form map of additional internet links related to this package. Keys are human-readable link names, and values are URLs.

[package.urls]
"We can help you build your project" = "<https://swmansion.com/products/>"
"We're hiring" = "<https://swmansion.com/careers/>"
TomlProfile object
cairo TomlCairo | null

Cairo compiler configuration for this profile.

inherits string | null

The name of another profile to inherit defaults from.

tool object | null

Tool-specific configuration for this profile (under tool.<name>).

TomlTarget object
casm boolean | null

Emit CASM assembly for the library target.

name string | null

Override the default target name.

sierra boolean | null

Emit a compiled Sierra program for the library target, in JSON format.

sierra-text boolean | null

Emit Sierra in a human-readable text form.

source-path string | null

Path to the source root of this target. Defaults to src/lib.cairo.

TomlTarget2 object
allow-syscalls boolean | null

If true, will allow syscalls in the program.

In general, syscalls are not allowed in executables, as they are currently not checked.

function string | null

Program entrypoint.

Executable must have exactly one entrypoint that will be used during the execution. This must be a function with the #[executable] attribute.

name string | null

Override the default target name.

sierra boolean | null

Emit a compiled Sierra program for the executable function, in JSON format. This may be useful, for example, for debugging or local profiling.

source-path string | null

Path to the source root of this target. Defaults to src/lib.cairo.

TomlTarget3 object
builtin boolean | null

If true, mark this plugin as builtin. Generally, it should not be used.

name string | null

Override the default target name.

source-path string | null

Path to the source root of this target. Defaults to src/lib.cairo.

TomlTarget4 object
name string | null

Override the default target name.

source-path string | null

Path to the source root of this target. Defaults to src/lib.cairo.

TomlTargetDefaults object
build-external-contracts TomlWorkspaceBuildExternalContracts | string[] required

Allows inheriting keys from a workspace.

TomlWorkspace object

Represents the workspace root definition.

allow-no-audits array | null

List of workspace packages that are allowed to have no audits.

dependencies Record<string, string | DetailedTomlDependency>

Shared workspace [workspace.dependencies] available to members. Specifying a workspace dependency is similar to package dependencies, except you can then inherit the workspace dependency as a package dependency.

members array | null

List of workspace member package paths (relative to the workspace root). Supports globs to match multiple paths, using typical filename glob patterns like * and ?.

package PackageInheritableFields | null

Package fields that can be inherited by workspace members via workspace.package.* (e.g., version, edition, authors).

require-audits boolean | null

Setting this field to true will cause Scarb to ignore any versions of dependencies, including transitive ones, that are not marked as audited in the registry. If unable to resolve the dependency tree due to this, Scarb will exit with an error. By default, this field is set to false. This policy applies to the entire workspace. This field is ignored in member packages manifest files, and only the one defined in the workspace root manifest is applied when compiling member packages.

You may whitelist specific packages to ignore the require-audits setting by specifying them in the allow-no-audits key:

[workspace]
allow-no-audits = ["alexandria_math"]
scripts Record<string, string>

Workspace-wide [workspace.scripts] available to members.

target-defaults Record<string, object>

Defaults applied to targets within workspace members when not configured on the target, must be inherited explicitly. For example:

 [target-defaults]
 test.workspace = true
tool object | null

Workspace-level [workspace.tool] configuration passed to external tools.

TomlWorkspaceBuildExternalContracts object
workspace boolean required
TomlWorkspaceDependency object

When { workspace = true } you cannot define other keys that configure the source of the dependency such as version, registry, path, git, branch, tag, rev. You can also not define default-features. Only features is allowed.

workspace boolean required
features array | null
TomlWorkspaceField object
workspace boolean required
TomlWorkspaceTargetDefault object
workspace boolean required
TomlWorkspaceTool object
workspace boolean required

If true, indicates that the tool configuration is defined at the workspace level and should be inherited by members.

WorkspaceScriptDefinition object
workspace boolean required

If true, the script entry is defined at the workspace level and can be inherited by member packages.