Releases: foundry-rs/starknet-foundry
Release list
0.62.1
Forge
Added
- Full support for Starknet v0.14.3
- Support for
sha512_process_blocksyscall
Changed
- Minimal recommended
Scarbversion is now2.17.0(updated from2.16.1) - Temporarily disabled the
add-types-debug-info = truerequirement for--launch-debuggeron Scarb>= 2.19.0due to compile errors
Fixed
- Fixed a performance regression from the previous version that could cause slowdowns during tests execution with debugging trace or gas report enabled
0.62.0
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.
0.61.0
Forge
Added
#[should_panic(expected: (...))]now supports regular strings inside mixed tuples, alongside short strings and numbers.#[derive(Fuzzable)]macro that automatically generatesFuzzabletrait implementations for structs and enumsSNFOUNDRY_CACHEenvironment variable to allow to specify a custom cache directory
Changed
snforge_scarb_plugindiagnostics for named-argument kind violations now include both possible values and invalid arguments found.snforge test --exactnow reports the exact number of filtered-out tests in summaries instead ofother.- Minimal required
Scarbversion is now2.13.1(updated from2.12.0).
Fixed
- Bug in forge debugging and
--gas-reportthat caused panic in case of a call to non-existent selector snforge testnow fails fast and explicitly when[cairo] enable-gas = false. Read more inScarb.tomlreference.#[test]macro now expands correctly insnforge_scarb_pluginfor cases involving block expressions (e.g. function code starting with[)tracked_resourcefield fromScarb.tomlis now taken into account when runningsnforge test
Removed
- The deprecated
snforge clean-cachecommand. Usesnforge clean cacheinstead
Cast
Added
--no-abiflag fordeclare,declare-from, anddeploy, erasing the ABI before class declaration.sncast get spec-versioncommand that returns the version of the Starknet JSON-RPC specification used by the nodesncast get tx-receipt(alias:get transaction-receipt) command that returns the receipt of a transaction
Fixed
sncast completionsno longer fails due to invalid local or globalsnfoundry.tomlconfig.- Non-panic errors no longer bypass foundry UI.
--jsonnow works for user-facing errors where plain text was printed before (excluding clap arg-parsing errors). - Build failures now return command errors instead of panicking.
- In command errors,
commandfield now universally displays a full command path (get tx-status,account import) (previously in some cases, only top-level command name was shown, e.g.get,account). sncast account deploynow correctly writes deployed address to keystore account file.sncast declarenow correctly includes--keystoreflag in the suggested deploy command when keystore is used.
Removed
argentoption for--typeflag inaccount createandaccount importcommands. Usereadyinstead. Old account files with"type": "argent"are still loaded correctly.
0.60.0
Forge
Added
--launch-debuggerflag that allows launching a test in debug mode usingcairo-debuggercrate.
Tip
This version adds support for using Cairo Debugger in snforge tests!
Check out snforge live debugging guide and VS Code debugging guide to get started 🚀
Changed
- Updated predeployed ETH and STRK token contracts, matching Starknet
v0.14.2token event changes from SNIP-13 - Minimal recommended
Scarbversion is now2.16.1(updated from2.14.0)
Fixed
- Validation of Scarb's compiler config now properly takes into account
[cairo]section and keys withoutunstable-prefix
Cast
Added
contract-addresscommand tosncast utils, which calculates the contract address- Aliases
sncast get transactionandsncast get transaction-statusforget txandget tx-status. - Support for serialization of corelib
OptionandResult, values passed via--arguments --dry-runand--detailedflags for all transaction commands, allowing users to validate transaction logic and estimate fees without submitting to the network- Config setting for Scarb profile, as
scarb-profilefield insnfoundry.toml, and--scarb-profilecli flag
Changed
- In JSON output for
sncast utilscommands, the"command"field now includes theutilsprefix (e.g."serialize"->"utils serialize") - Reworked profile layering in
snfoundry.toml:[sncast.default]is always the base layer, and global-only profiles can work without a local config. Read more here - Improved
snfoundry.tomlconfig error reporting --profilenow only determinessnfoundry.tomlprofile. For Scarb profile, use--scarb-profileflag orscarb-profilefromsnfoundry.tomlinstead. Defaults toreleaseif unspecified
Fixed
sncast verifynow uses the configured network or infers it from the RPC chain ID when--networkis omittedsncastnow returns non-zero exit code when a command fails- Invalid
snfoundry.tomlconfigs now fail with errors instead of being silently ignored - Panics in config validation. Errors are now properly propagated and reported
sncast show-configquietly ignoring provider errors
0.59.0
Forge
Added
- Cheats for transaction info
proof_facts
Changed
- Updated execution to reflect Starknet
v0.14.2, specifically the storage gas price changes (see SNIP-37 for more details)
Cast
Added
sncast get txcommand to get transaction details by hash.sncast utils selectorcommand to calculate entrypoint selector (sn_keccak) from function name.sncast get class-hash-atcommand to get the class hash of a contract at a given address.--with-proof-factsflag forsncast get txto include proof facts in tx response. Read more here.--proof-fileand--proof-facts-fileflags forsncast invoketo attach proof data from files.
0.58.1
Forge
Fixed
- Bug with using cheats in library calls
Cast
Added
--nonceflag tosncast multicall run
0.58.0
Forge
Added
--max-threadsflag to control the maximum number of threads used for test executionoptimize-inliningsubcommand, which performs a brute-force search of the optimalinlining-strategythreshold for the project over user defined benchmark
Fixed
- Bug with invalid function name mappings for functions with
#[test]attribute --exit-firstflag now correctly stops execution for all packages when tests are run in a workspace
Cast
Added
- Support for Ledger hardware wallet as a transaction signer
sncast get noncecommand to get the nonce of a contractsncast multicall execute, which allows to pass calls directly as CLI arguments. Read more here
Changed
sncast balanceandsncast tx-statuscommands have been moved undersncast getsubcommand (sncast get balance,sncast get tx-status). The old commands still work, but will be removed in the future.- Referencing an id in multicall configuration files now requires the
@prefix.
0.57.0
Forge
Added
- Partitioned test execution with
--partition <INDEX>/<TOTAL>flag. Read more here
Changed
- Minimal recommended
Scarbversion is now2.14.0(updated from2.13.1) - In case of a test failure, generic
ENTRYPOINT_FAILEDerrors are now included in the panic data
Fixed
- State modified by failed contract calls executed within the test function is now correctly reverted
--exactflag now requires--test-filterto be non-empty
Cast
Added
--sierra-fileflag tosncast declare-fromto allow declaring contract from a local Sierra file.
Removed
- Due to termination of starkscan.co,
StarkScanoption forblock-explorerfield insnfoundry.tomlwas removed. For a full list of supported block explorer services, see the block explorer documentation
0.56.0
Forge
Removed
- Support for Scarb versions < 2.12.0.
snforgenow requires Scarb 2.12.0 or newer - The deprecated
snforge_scarb_plugin_deprecated - The deprecated
snforge_std_deprecated
Changed
--detailed-resourcesoutput now includes all gas-related resourcesdeployanddeploy_atmethods onContractClassinstance now allow constructor errors to be caught instead of failing immediately. This change diverges from the behavior of thedeploy_syscallon the network, where such errors cannot be caught.- Template created by
snforge new --template erc20-contractnow usesopenzeppelin_tokenversion3.0.0(updated from1.0.0). This template requires Scarb version >=2.15.1.
Cast
Fixed
sncast balancecommand now correctly displays token unit instead of token forethandstrk
0.55.0
Forge
Changed
- Minimal recommended
Scarbversion is now2.13.1(updated from2.12.2) snforge_scarb_pluginnow emits an error if unexpected named args are passed to#[available_gas],#[fork],#[fuzzer],#[should_panic]and#[test_case]attributes
Fixed
- Byte arrays containing non-printable characters are now displayed correctly in fuzz test output
Warning
This is the last version publishing snforge_std_deprecated. If you are still using the deprecated version, please migrate to the stable snforge_std as soon as possible.
Cast
Added
networkfield can now be configured insnfoundry.toml
Changed
--networkflag can be used with--add-profileflag