Skip to content

Releases: foundry-rs/starknet-foundry

0.18.0

21 Feb 14:29
48f909a
Compare
Choose a tag to compare

Forge

⚠️ This and next releases of snforge require Scarb >= 2.5.4 to work - breaking changes to prepare for migration to USC ⚠️

Added

  • contract names to call trace
  • --max-n-steps argument that allows setting own steps limit

Changed

  • Unknown entry point error when calling a contract counts as a panic
  • Cairo edition set to 2023_11

Fixed

  • Calling Cairo 0 contract no longer cancels cheatcodes in further calls

Cast

Added

  • script init command to generate a template file structure for deployment scripts
  • Warning is emitted when executing sncast commands if the node's JSON-RPC version is incompatible

Changed

  • to run a deployment script it is required to use script run subcommand

0.17.1

12 Feb 15:06
f3237f2
Compare
Choose a tag to compare

Cast

Changed

  • fixed a bug where a profile was passed to scarb even when it did not exist

Forge

Added

  • map_string_error for use with dispatchers, which automatically converts string errors from the syscall result (read more here)

0.17.0

07 Feb 12:53
63f7f0b
Compare
Choose a tag to compare

Forge

Added

  • get_call_trace library function for retrieving call trace in tests

Changed

  • Gas estimation is now aligned with the Starknet v0.13

Removed

  • snforge_std::PrintTrait - use print!, println! macros and / or core::debug::PrintTrait instead

Fixed

  • Gas used in constructors and handling of L1 messages is now properly included in total gas cost

Cast

Changed

  • sncast tool configuration is now moved away from Scarb.toml to snfoundry.toml file. This file must be present in current or any parent directories in order to use profiles.

Added

  • --package flag for declare and script subcommands, that specifies scarb package to work with
  • Debug and Display impls for script subcommand responses - use print!, println! macros instead of calling .print()

0.16.0

26 Jan 09:00
f58e0ab
Compare
Choose a tag to compare

Forge

Added

  • Bump to cairo 2.5.0

Changed

  • SafeDispatchers usages need to be tagged with #[feature("safe_dispatcher)] (directly before usage), see the shamans post

0.15.0

24 Jan 13:05
7747a2d
Compare
Choose a tag to compare

Forge

Added

  • store and load cheatcodes
  • --save-trace-data flag to snforge test command. Traces can be used for profiling purposes.

Changed

  • available_gas attribute is now supported (Scarb >= 2.4.4 is required)

Fixed

  • Error message for tests that should panic but pass

Cast

Changed

  • the 'pending' block is used instead of 'latest' as the default when obtaining the nonce

0.14.0

11 Jan 13:26
e8cbece
Compare
Choose a tag to compare

Forge

Added

  • Secp256k1 and Secp256r1 curves support for KeyPair in snforge_std

Changed

  • maximum number of computational steps per call set to current Starknet limit (3M)
  • mean and std deviation fields are displayed for gas usage while running fuzzing tests
  • Cairo edition in snforge_std and sncast_std set to 2023_10
  • snforge_std::signature module with stark_curve, secp256k1_curve and secp256r1_curve submodules

Fixed

  • Safe library dispatchers in test code no longer propagate errors when not intended to

0.13.1

20 Dec 17:07
e1412ed
Compare
Choose a tag to compare

Forge

Changed

  • fields from starknet::info::v2::TxInfo are now part of TxInfoMock from snforge_std::cheatcodes::tx_info
  • consistent latest block numbers for each url are now used across the whole run when testing against forks

Fixed

  • Parsing panic data from call contract result

Cast

Added

  • add support for sepolia network
  • --yes option to account delete command that allows to skip confirmation prompt

Changed

  • Argument max-fee in account deploy is now optional

0.13.0

14 Dec 10:54
99c2f9d
Compare
Choose a tag to compare

Changed

  • Bump cairo to 2.4.0.
  • Migrated test compilation and collection to Scarb, snforge should now be compatible with every Scarb version >= 2.4.0 unless breaking changes happen

0.12.0

06 Dec 13:40
0c3d2fe
Compare
Choose a tag to compare

Forge

Added

  • print gas usage for each test
  • Support for test collector built-in in Scarb with the --use-scarb-collector flag. Requires at least nightly-2023-12-04 version of Scarb.

Cast

Added

  • --wait-timeout to set timeout for waiting for tx on network using --wait flag (default 60s)
  • --wait-retry-interval to adjust the time between consecutive attempts to fetch tx from network using --wait flag (default 5s)
  • allow setting nonce in declare, deploy and invoke (using --nonce and in deployment scripts)
  • add get_nonce function to cast_std
  • --private-key-file option to account add command that allows to provide a path to the file holding account private key

0.11.0

22 Nov 13:22
5465c41
Compare
Choose a tag to compare

Forge

Added

  • elect cheatcode for mocking the sequencer address. Read more here.
  • --rerun-failed option to run tests that failed during the last run.

Changed

  • start_warp and stop_warp now take CheatTarget as the first argument instead of ContractAddress. Read more here.
  • start_prank and stop_prank now take CheatTarget as the first argument instead of ContractAddress. Read more here.
  • start_roll and stop_roll now take CheatTarget as the first argument instead of ContractAddress. Read more here.

PS: Credits to @bllu404 for the help with the new interfaces for cheats!

Fixed

  • using unsupported available_gas attribute now fails the specific test case instead of the whole runner

Cast

Added

  • MVP for cairo deployment scripts with declare, deploy, invoke and call