Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: foundry-rs/starknet-foundry

0.62.1

Choose a tag to compare

@github-actions github-actions released this 03 Jul 16:31
14a3ee5

Forge

Added

  • Full support for Starknet v0.14.3
  • Support for sha512_process_block syscall

Changed

  • Minimal recommended Scarb version is now 2.17.0 (updated from 2.16.1)
  • Temporarily disabled the add-types-debug-info = true requirement for --launch-debugger on Scarb >= 2.19.0 due 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

Choose a tag to compare

@github-actions github-actions released this 26 Jun 07:14
7e11119

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 = true config (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::declare now 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::MyContract or module::MyContract) can now be passed to declare to 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.
  • @alias syntax for felt arguments in sncast 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, and multicall run. Read more here.
  • sncast alias list command for listing aliases. Read more here.
  • sncast config-path for printing the paths to the local and global snfoundry.toml config files. Read more here.
  • sncast get block command for fetching a block with transactions
  • --sierra-file flag to sncast utils class-hash for calculating the class hash directly from an already compiled Sierra contract class file.
  • --contract-name flag now accepts absolute/partial module tree paths (e.g. hello_sncast::contracts::HelloSncast or contracts::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 across sncast versions. Read more in configuration.
  • sncast account import/deploy interactive "make default account" prompt now emits a warning when global snfoundry.toml cannot be accessed/created.
  • sncast multicall run TOML inputs now 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 nonce now 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-name now 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

Choose a tag to compare

@github-actions github-actions released this 27 May 12:50
39598e4

Forge

Added

  • #[should_panic(expected: (...))] now supports regular strings inside mixed tuples, alongside short strings and numbers.
  • #[derive(Fuzzable)] macro that automatically generates Fuzzable trait implementations for structs and enums
  • SNFOUNDRY_CACHE environment variable to allow to specify a custom cache directory

Changed

  • snforge_scarb_plugin diagnostics for named-argument kind violations now include both possible values and invalid arguments found.
  • snforge test --exact now reports the exact number of filtered-out tests in summaries instead of other.
  • Minimal required Scarb version is now 2.13.1 (updated from 2.12.0).

Fixed

  • Bug in forge debugging and --gas-report that caused panic in case of a call to non-existent selector
  • snforge test now fails fast and explicitly when [cairo] enable-gas = false. Read more in Scarb.toml reference.
  • #[test] macro now expands correctly in snforge_scarb_plugin for cases involving block expressions (e.g. function code starting with [)
  • tracked_resource field from Scarb.toml is now taken into account when running snforge test

Removed

  • The deprecated snforge clean-cache command. Use snforge clean cache instead

Cast

Added

  • --no-abi flag for declare, declare-from, and deploy, erasing the ABI before class declaration.
  • sncast get spec-version command that returns the version of the Starknet JSON-RPC specification used by the node
  • sncast get tx-receipt (alias: get transaction-receipt) command that returns the receipt of a transaction

Fixed

  • sncast completions no longer fails due to invalid local or global snfoundry.toml config.
  • Non-panic errors no longer bypass foundry UI. --json now 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, command field 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 deploy now correctly writes deployed address to keystore account file.
  • sncast declare now correctly includes --keystore flag in the suggested deploy command when keystore is used.

Removed

  • argent option for --type flag in account create and account import commands. Use ready instead. Old account files with "type": "argent" are still loaded correctly.

0.60.0

Choose a tag to compare

@github-actions github-actions released this 27 Apr 10:56
090d8ea

Forge

Added

  • --launch-debugger flag that allows launching a test in debug mode using cairo-debugger crate.

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.2 token event changes from SNIP-13
  • Minimal recommended Scarb version is now 2.16.1 (updated from 2.14.0)

Fixed

  • Validation of Scarb's compiler config now properly takes into account [cairo] section and keys without unstable- prefix

Cast

Added

  • contract-address command to sncast utils, which calculates the contract address
  • Aliases sncast get transaction and sncast get transaction-status for get tx and get tx-status.
  • Support for serialization of corelib Option and Result, values passed via --arguments
  • --dry-run and --detailed flags 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-profile field in snfoundry.toml, and --scarb-profile cli flag

Changed

  • In JSON output for sncast utils commands, the "command" field now includes the utils prefix (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.toml config error reporting
  • --profile now only determines snfoundry.toml profile. For Scarb profile, use --scarb-profile flag or scarb-profile from snfoundry.toml instead. Defaults to release if unspecified

Fixed

  • sncast verify now uses the configured network or infers it from the RPC chain ID when --network is omitted
  • sncast now returns non-zero exit code when a command fails
  • Invalid snfoundry.toml configs now fail with errors instead of being silently ignored
  • Panics in config validation. Errors are now properly propagated and reported
  • sncast show-config quietly ignoring provider errors

0.59.0

Choose a tag to compare

@github-actions github-actions released this 10 Apr 16:20
f44def2

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 tx command to get transaction details by hash.
  • sncast utils selector command to calculate entrypoint selector (sn_keccak) from function name.
  • sncast get class-hash-at command to get the class hash of a contract at a given address.
  • --with-proof-facts flag for sncast get tx to include proof facts in tx response. Read more here.
  • --proof-file and --proof-facts-file flags for sncast invoke to attach proof data from files.

0.58.1

Choose a tag to compare

@github-actions github-actions released this 01 Apr 07:26
5892ff5

Forge

Fixed

  • Bug with using cheats in library calls

Cast

Added

  • --nonce flag to sncast multicall run

0.58.0

Choose a tag to compare

@github-actions github-actions released this 19 Mar 06:49
ba73649

Forge

Added

  • --max-threads flag to control the maximum number of threads used for test execution
  • optimize-inlining subcommand, which performs a brute-force search of the optimal inlining-strategy threshold for the project over user defined benchmark

Fixed

  • Bug with invalid function name mappings for functions with #[test] attribute
  • --exit-first flag 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 nonce command to get the nonce of a contract
  • sncast multicall execute, which allows to pass calls directly as CLI arguments. Read more here

Changed

  • sncast balance and sncast tx-status commands have been moved under sncast get subcommand (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

Choose a tag to compare

@github-actions github-actions released this 25 Feb 12:47
c1259b9

Forge

Added

  • Partitioned test execution with --partition <INDEX>/<TOTAL> flag. Read more here

Changed

  • Minimal recommended Scarb version is now 2.14.0 (updated from 2.13.1)
  • In case of a test failure, generic ENTRYPOINT_FAILED errors are now included in the panic data

Fixed

  • State modified by failed contract calls executed within the test function is now correctly reverted
  • --exact flag now requires --test-filter to be non-empty

Cast

Added

  • --sierra-file flag to sncast declare-from to allow declaring contract from a local Sierra file.

Removed

  • Due to termination of starkscan.co, StarkScan option for block-explorer field in snfoundry.toml was removed. For a full list of supported block explorer services, see the block explorer documentation

0.56.0

Choose a tag to compare

@github-actions github-actions released this 04 Feb 08:46
f530c15

Forge

Removed

  • Support for Scarb versions < 2.12.0. snforge now requires Scarb 2.12.0 or newer
  • The deprecated snforge_scarb_plugin_deprecated
  • The deprecated snforge_std_deprecated

Changed

  • --detailed-resources output now includes all gas-related resources
  • deploy and deploy_at methods on ContractClass instance now allow constructor errors to be caught instead of failing immediately. This change diverges from the behavior of the deploy_syscall on the network, where such errors cannot be caught.
  • Template created by snforge new --template erc20-contract now uses openzeppelin_token version 3.0.0 (updated from 1.0.0). This template requires Scarb version >= 2.15.1.

Cast

Fixed

  • sncast balance command now correctly displays token unit instead of token for eth and strk

0.55.0

Choose a tag to compare

@github-actions github-actions released this 14 Jan 10:27
8891212

Forge

Changed

  • Minimal recommended Scarb version is now 2.13.1 (updated from 2.12.2)
  • snforge_scarb_plugin now 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

  • network field can now be configured in snfoundry.toml

Changed

  • --network flag can be used with --add-profile flag