Skip to content

Releases: foundry-rs/starknet-foundry

0.44.0

27 May 07:47
437d128
Compare
Choose a tag to compare

Warning

Make sure to upgrade snforge_std version in Scarb.toml to 0.44.0 otherwise test execution will fail.

Forge

Changed

  • Minimal supported snforge_std version is 0.44.0
  • Changed the code generated by snforge_std's #[test] attribute

Fixed

  • "invalid syscall selector" error appearing when using arithmetic circuits
  • Bug that caused incorrect gas tracking for contracts using Sierra version less than 1.7.0 when sierra-gas was passed as the tracked-resource

Cast

Added

  • Displaying the path of the config file when adding a new profile

Changed

  • OpenZeppelin account updated to v1.0.0 preset
  • Restored support for Braavos accounts
  • Accounts created with --type braavos use updated v1.2.0 class hash
  • Output of sncast account create is now clearer; the estimated fee is displayed in both STRK and FRI.
  • Renamed the field max_fee to estimated_fee in the sncast account create output.

0.43.1

19 May 07:52
Compare
Choose a tag to compare

Cast

Removed

  • Broken Voyager RPC provider

0.43.0

13 May 08:06
ea57c49
Compare
Choose a tag to compare

Forge

Added

  • set_balance cheatcode for setting an ERC-20 token balance for specified contract address. The STRK token is now pre-deployed in every test by default. This can be disabled by adding #[disable_predeployed_contracts] attribute to test.
  • added option to display trace of contracts execution. Read more here

Changed

  • "Success data" message is no longer printed when a test using the #[should_panic] attribute passes

Cast

Added

  • when using sncast call the response will be printed as a Cairo-like string representation of the return values

Changed

  • The supported RPC version is now 0.8.1

0.42.0

28 Apr 11:23
24abff8
Compare
Choose a tag to compare

Forge

Added

  • Safe dispatchers can now be used inside contracts

Note

Due to the change related to safe dispatchers the behavior of existing code can change. This might be especially relevant for tests using the attribute #[should_panic]

Changed

  • Minimal supported Scarb version is now 2.9.1
  • Improved display of backtrace for contracts that panicked, when panic-backtrace = true in Scarb.toml. Without using this feature, the backtrace may be less accurate than before.
    As of this release, this feature is available only in scarb nightly-2025-03-27.

Fixed

  • The state correctly reverts after failed internal calls

Cast

Fixed

  • Bug that prevented from passing values to --arguments that started with a leading minus - sign.
  • User is now prompted to save an imported or deployed account in sncast config even when using --network flag

0.41.0

10 Apr 12:10
d6589e6
Compare
Choose a tag to compare

Forge

Added

  • --template flag to snforge new command that allows selecting a template for the new project. Possible values are balance-contract (default), cairo-program and erc20-contract

Fixed

  • fixed incorrect extra newlines in test summary

Cast

Added

  • Support for array![].span() in --arguments command

Changed

  • verify command now supports the --class-hash for Walnut verification

Removed

  • NftScan is no longer supported as block-explorer option

0.40.0

26 Mar 15:54
c20f769
Compare
Choose a tag to compare

Cast

Added

  • --l1-gas, --l1-gas-price, --l2-gas, --l2-gas-price, --l1-data-gas, --l1-data-gas-price flags
  • methods for fee settings creation, in FeeSettingsTrait: max_fee(), resource_bounds() and estimate() (in sncast_std)

Changed

  • Updated argent class hash used in account creation to v0.4.0
  • wrapped error for ContractError is now of type ContractErrorData (in sncast_std)
  • field execution_error in TransactionExecutionErrorData is now of type ContractExecutionError (in sncast_std)
  • Using Braavos accounts is temporarily disabled because they don't yet work with the RPC version supported by sncast
  • sncast script init command now initializes project with the sncast_std dependency from the registry

Removed

  • --max-gas and --max-gas-unit-price flags
  • max_gas, max_gas_unit_price fields in FeeSettings (in sncast_std)

0.39.0

20 Mar 09:20
13ee73d
Compare
Choose a tag to compare

Forge

Added

  • snforge completion command - used to generate autocompletion script
  • Cheats for get_block_hash_syscall
  • new --tracked-resource flag, that will change currently tracked resource
    (cairo-steps for vm resources - default; sierra-gas for sierra gas consumed resources in cairo native)

Changed

  • gas is now reported using resource bounds triplet (l1_gas, l1_data_gas and l2_gas)
  • available_gas now accepts named arguments denoting resource bounds (eg #[available_gas(l1_gas: 1, l1_data_gas: 2, l2_gas: 3)])

Fixed

  • Bug with file locking that prevented forking from working on Windows

Cast

Added

  • sncast completion command - used to generate autocompletion script

0.38.3

07 Mar 13:48
c845b1d
Compare
Choose a tag to compare

Migrating to Scarb 2.11.0

snforge relies on presence of both snforge_std and snforge_scarb_plugin dependencies. Due to changes in dependencies resolving in Scarb action might be necessary to continue using snforge.

If using Scarb version < 2.11.0 with any version of snforge_std

No action needed

If using Scarb version >= 2.11.0 with snforge_std >= 0.38.3

No action needed

If using Scarb version >= 2.11.0 with snforge_std < 0.38.3

Action required. In your Scarb.toml file, add snforge_scarb_plugin dependency with the version matching that of snforge_std

E.g. change this

snforge_std = "0.34.1"

to this

snforge_std = "0.34.1"
snforge_scarb_plugin = "0.34.1"

Alternatively, we strongly recommend upgrading to at least snforge version 0.38.3. Then, no action is needed as outlined above.

Changelog

Forge

Fixed

  • Issue with uploading snforge_std to scarbs package registry that prevented it from including package reexports required in Scarb >= 2.11.0

0.38.2

06 Mar 12:51
69d27d2
Compare
Choose a tag to compare

Migrating to Scarb 2.11.0

snforge relies on presence of both snforge_std and snforge_scarb_plugin dependencies. Due to changes in dependencies resolving in Scarb action might be necessary to continue using snforge.

If using Scarb version < 2.11.0 with any version of snforge_std

No action needed

If using Scarb version >= 2.11.0 with snforge_std >= 0.38.0

⚠️ We have uncovered the issue with package uploads to registry. Instead of "No action needed", please follow the "If using Scarb version >= 2.11.0 with snforge_std < 0.38.0" section

No action needed

If using Scarb version >= 2.11.0 with snforge_std < 0.38.0

Action required. In your Scarb.toml file, add snforge_scarb_plugin dependency with the version matching that of snforge_std

E.g. change this

snforge_std = "0.34.1"

to this

snforge_std = "0.34.1"
snforge_scarb_plugin = "0.34.1"

Alternatively, we strongly recommend upgrading to at least snforge version 0.38.2. Then, no action is needed as outlined above.

Changelog

Forge

Changed

  • Fork cache version is pinned to the forge version.

Fixed

  • snforge_scarb_plugin now emits an error when parameters are passed without using the #[fuzzer] attribute
  • A bug that was causing execution to hang if using forking

0.38.0

26 Feb 13:20
f2e7d0d
Compare
Choose a tag to compare

Forge

Added

  • snforge clean command - used to manage and remove files generated by snforge. It supports cleaning the following components: coverage, profile, cache, trace, all
  • snforge new now adds the snfoundry_trace, coverage, and profile directories to .gitignore.
  • Custom types can be used in fuzz testing by implementing the Fuzzable trait
  • Support for Cairo 2.10.0

Changed

  • It is now required to include the #[fuzzer] attribute for fuzz tests to work
  • Scarb 2.8.5 is now the minimal recommended version. Using Starknet Foundry with versions below it is no longer officially supported and may not work.

Deprecated

  • snforge clean-cache command

Cast

Changed

  • --name flag is now optional when using account create (default name is generated)