Forge
Added
-
Support for structs, enums, tuples, arrays and spans in live debugging
⚠️ These features work best with Scarb >= 2.19.0 and[cairo] add-types-debug-info = trueconfig (or equivalent) in Scarb.toml.
You may still use other Scarb versions but names of structs, enums, their fields and variants will not be available. -
Backtrace support for panics that originate directly in a test function body, not only inside called contracts. Read more here.
Changed
- Backtrace output format: a single
stack backtrace:header now groups frames by contract or test. Read more here.
Fixed
- Debugging trace is now correctly displayed for predeployed contracts (STRK, ETH) in non-fork tests.
snforge_std::declarenow fails with a clear, deterministic error when a contract name resolves to multiple contracts, instead of non-deterministically selecting one of them. The module tree path (e.g.my_package::module::MyContractormodule::MyContract) can now be passed todeclareto disambiguate contracts that share a name.- Fixed
#[should_panic(expected: (...))]matching for panic data containing byte array values inside tuples.
Cast
Added
- Aliases in
snfoundry.toml. Read more here. @aliassyntax for felt arguments insncast call,invoke,deploy,declare-from,account create,account import,get balance,get nonce,get class-hash-at,verify,utils serialize,utils contract-address,multicall execute, andmulticall run. Read more here.sncast alias listcommand for listing aliases. Read more here.sncast config-pathfor printing the paths to the local and globalsnfoundry.tomlconfig files. Read more here.sncast get blockcommand for fetching a block with transactions--sierra-fileflag tosncast utils class-hashfor calculating the class hash directly from an already compiled Sierra contract class file.--contract-nameflag now accepts absolute/partial module tree paths (e.g.hello_sncast::contracts::HelloSncastorcontracts::HelloSncast).
Changed
- Unknown keys in
snfoundry.toml([sncast.<profile>],[sncast.<profile>.networks],wait-params) now emit a warning and are ignored instead of causing a hard error, so configs can be shared acrosssncastversions. Read more in configuration. sncast account import/deployinteractive "make default account" prompt now emits a warning when globalsnfoundry.tomlcannot be accessed/created.sncast multicall runTOMLinputsnow always require the@prefix for step id references. Bare step ids no longer resolve. Migration: update entries to new format (e.g."map"->"@map"). Read more here.sncast get noncenow displays the nonce in decimal instead of hexadecimal.
Fixed
- Devnet accounts (
devnet-<i>) no longer require the default accounts file to exist. - Commands that use
--contract-namenow return an error when multiple contracts with the same name are found in the compiled artifacts, instead of non-deterministically selecting one of them.
Warning
This is the final version to include Cairo Deployment Scripts and the sncast_std package. Both will be permanently removed in the next release.