Skip to content

Releases: foundry-rs/starknet-foundry

0.35.1

17 Dec 12:10
089de2c
Compare
Choose a tag to compare

Forge

Fixed

  • Minimal Rust version in requirements check is the same as in docs (1.80.1)
  • snforge produces trace for contracts even if they fail or panic (assuming test passed)

0.35.0

16 Dec 11:32
281bd6b
Compare
Choose a tag to compare

⚠️ Minimal required Rust version is incorrectly set to 1.81.0 instead of 1.80.1 in this release. Fix is being published.

Forge

Added

  • Requirements validation during snforge runtime
  • snforge check-requirements command
  • snforge new command

Changed

  • snforge_scarb_plugin will now also emit warnings when errors occur
  • snforge_std migrated to 2024_07 edition
  • snforge_std from scarbs package registry is now used in snforge new template

Deprecated

  • snforge init command

Cast

Added

  • account create command shows prepared deployment command

Changed

  • --version flag is now optional and v3 will be used by default
  • Displaying underlying RPC error instead of "Unknown RPC error" in edge cases

Deprecated

  • --fee-token flag - strk will be used by default

0.34.0

27 Nov 09:49
d6976d4
Compare
Choose a tag to compare

Forge

Added

  • generate_random_felt() for generating (pseudo) random felt value.
  • Printing information about compiling Sierra using universal-sierra-compiler
  • Displaying backtrace when contract call fails

Changed

  • Tests config run is now executed in parallel resulting in faster snforge test setup in some cases

Cast

Added

  • You can skip --name flag when using account import - a default name will be generated.
  • Addresses outputted when calling sncast account create, sncast deploy and sncast declare are now padded to 64 characters length and prefixed with 0x0
  • Globally available configuration to store profiles to share between projects.

Changed

  • Changed return type of declare in Cairo Deployment Scripts so it can handle already declared contracts without failing
  • Allow using show-config command without providing rpc url

0.33.0

05 Nov 11:40
221b1db
Compare
Choose a tag to compare

Cast

Added

  • You can now use numbers without quotes as inputs for calls in multicall config file.
  • New --arguments flag to call, invoke and deploy for automatic conversion of Cairo expressions instead of serialized form.

Forge

Changed

  • You can now pass arguments to cairo-profiler and cairo-coverage. Everything after -- will be passed to underlying binary. E.g.
    snforge test --build-profile -- --show-inlined-functions
  • You can't use now --coverage and --build-profile flags at the same time. If you want to use both, you need to run
    snforge test twice with different flags.
  • Contract artifacts are compiled to CASM concurrently.
  • Starknet artifacts are now loaded from all tests targets
  • Cairo Edition in snforge init template set to 2024_07

Fixed

  • Scarb features work with optimized compilation
  • Custom test targets are now supported with optimized compilation
  • Calling contract functions via safe-dispatcher now returns an Err when attempting to invoke a non-existent entry point, instead of causing a panic.

0.32.0

17 Oct 14:32
Compare
Choose a tag to compare

Cast

Changed

  • Short option for --accounts-file flag has been removed.
  • Short option for --contract-address is now -d instead of -a.
  • account add is renamed to account import.
  • account import can be now used without specifying --private-key or --private-key-file flags. Instead private key will be read interactively from the user.

Fixed

  • account delete command: It is no longer necessary to provide the --url argument each time. Either the --url or --network argument must be provided, but not both, as they are mutually exclusive.

Forge

Changed

  • When using test name filter with --exact flag, forge will try to compile only the selected test.

0.31.0

26 Sep 19:09
72ea785
Compare
Choose a tag to compare

Cast

Changed

  • declare and verify commands now use the Scarb release profile instead of the dev profile as the default for building artifacts
  • StarkScan links now point to specific pages for transactions, contracts and classes.

Fixed

  • Explorer links displayed upon committing transactions are now properly formatted
  • sncast declare no longer fails for flat contracts (i.e. CASM artifacts with bytecode_segment_lengths being a number)

Forge

Added

Changed

  • For Scarb >= 2.8.3 contract artifacts are built as part of the test target now. This process speeds up the compilation time, but the behavior of the contracts potentially may not be 100% consistent with the real networks. It can be disabled using the --no-optimization flag
  • snforge now validates if your project is setup to generate debug info needed for cairo-coverage when running --coverage flag

snforge_scarb_plugin

Fixed

  • The package is now correctly versioned

0.30.0

04 Sep 11:22
196f06b
Compare
Choose a tag to compare

Forge

Added

  • Derived Debug and Clone on trace.cairo items
  • --coverage flag to the test command. Saves trace data and then generates coverage report of test cases which pass and are not fuzz tests. You need cairo-coverage installed on your system.

Fixed

  • latest fork block id tag validation in Scarb.toml is now consistent
  • RangeCheck96, AddMod, MulMod builtins are now properly supported
  • Fixed escaping ' in #[should_panic]s
  • Fixed scarb init with snforge runner

0.29.0

29 Aug 16:16
d37d227
Compare
Choose a tag to compare

Forge

Added

  • Support for Scarb features in snforge test - flags the same as in Scarb. Read more here

Fixed

  • snforge init no longer emits warnings
  • Project template generated by snforge init matches new declare cheatcode interface and compiles properly

0.28.0

22 Aug 10:52
4dfe39d
Compare
Choose a tag to compare

Forge

Breaking Changes

  • Forge 0.28.0 requires Scarb >= 2.7.0
  • Asserts (eg assert_eq!) now have to be included as a scarb dependency by adding assert_macros = "0.1.0" to dependencies section of Scarb.toml

Changed

  • Cairo version is bumped to 2.7.0
  • Max steps in tests (configured by argument --max-n-steps) now defaults to 10 million
    if not provided (changed from 4 million).
  • Fork tests now discover chain ID via provided RPC URL, defaulting to SN_SEPOLIA
  • #[fork] attribute parameters format. Read more here
  • Steps counting
  • Block tag changed name from Latest to latest
  • declare cheatcode now returns Result<DeclareResult, Array<felt252>>. Read more here

Cast

Added

  • Commands that commit transactions now display links to block explorers. When in human-readable mode, invoke, declare, deploy, multicall run, account create and account deploy will display additional information with an url. A new key in Cast configuration - block-explorer determines which block explorer service the displayed link leads to. Possible options are: StarkScan, Voyager, ViewBlock, OkLink, NftScan.

Changed

  • account create outputs hint about the type of the tokens required to prefund a newly created account with before deployment

  • sncast no longer expects --url as a common argument. It is now required specifically by commands that utilise it, i.e. account add, account create, account delete, account deploy, multicall run, script run, call, declare, deploy, invoke, show-config, tx-status.
    Commands that do not require --url anymore: account list, multicall new, script init, verify

0.27.0

24 Jul 10:42
2d99b7c
Compare
Choose a tag to compare

Forge

Added

  • spy_messages_to_l1() for listening in on messages to L1 sent by your contracts. Read more here.

Changed

  • Renamed global cheatcodes listed here - cheatcode invocations affecting the global scope and working indefinitely, already marked with a _global suffix, received a start_ prefix

Cast

Added

  • verify subcommand to verify contract (walnut APIs supported as of this version). Read more here
  • support for v3 transactions on account deploy, deploy, declare, invoke
  • Newest class hash for OpenZeppelin account contracts
  • account list subcommand for listing all available accounts Read more here

Changed

  • multicall new no longer prints generated template to stdout and now requires specifying output path. Read more here