Releases: foundry-rs/starknet-foundry
0.42.0
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
inScarb.toml
. Without using this feature, the backtrace may be less accurate than before.
As of this release, this feature is available only inscarb 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
Forge
Added
--template
flag tosnforge new
command that allows selecting a template for the new project. Possible values arebalance-contract
(default),cairo-program
anderc20-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 asblock-explorer
option
0.40.0
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()
andestimate()
(insncast_std
)
Changed
- Updated argent class hash used in account creation to v0.4.0
- wrapped error for
ContractError
is now of typeContractErrorData
(insncast_std
) - field
execution_error
inTransactionExecutionErrorData
is now of typeContractExecutionError
(insncast_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 thesncast_std
dependency from the registry
Removed
--max-gas
and--max-gas-unit-price
flagsmax_gas
,max_gas_unit_price
fields inFeeSettings
(insncast_std
)
0.39.0
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
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
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 withsnforge_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
Forge
Added
snforge clean
command - used to manage and remove files generated by snforge. It supports cleaning the following components: coverage, profile, cache, trace, allsnforge new
now adds thesnfoundry_trace
,coverage
, andprofile
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 usingaccount create
(default name is generated)
0.37.0
Forge
Added
- Rust is no longer required to use
snforge
if using Scarb >= 2.10.0 on supported platforms - precompiledsnforge_scarb_plugin
plugin binaries are now published to package registry for new versions. - Added a suggestion for using the
--max-n-steps
flag when the Cairo VM returns the error:Could not reach the end of the program. RunResources has no remaining steps
. - Environmental variables in both
Scarb.toml
andsnfoundry.toml
can be now used either with or without curly braces (e.g.${MY_ENV}
or$MY_ENV
)
Fixed
- coverage validation now supports comments in
Scarb.toml
Cast
Added
- Default RPC providers under
--network
flag
Changed
- Renamed
--network
flag to--network-name
insncast account delete
command
Fixed
- Bug resulting in value passed for
max_fee
being ignored in cast scripts when usingdeploy
with STRK token
Removed
--fee-token
and--version
flags, subsequently support for transaction versions other than v3- Support for ETH transactions in scripts
0.36.0
Forge
Changed
- Trace files saved in
snfoundry_trace
directory will now use_
as separators instead of::
Cast
Added
- When using
--max-fee
with transactions v3, calculated max gas and max gas unit price are automatically validated to ensure they are greater than 0 after conversion - interactive interface that allows setting created or imported account as the default
Changed
- Values passed to the
--max-fee
,--max-gas
, and--max-gas-unit-price
flags must be greater than 0
Deprecated
--version
flag
0.35.1
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)