Releases: foundry-rs/starknet-foundry
0.44.0
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
whensierra-gas
was passed as thetracked-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
toestimated_fee
in thesncast account create
output.
0.43.1
Cast
Removed
- Broken Voyager RPC provider
0.43.0
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
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)