Releases: foundry-rs/starknet-foundry
Releases · foundry-rs/starknet-foundry
0.34.0
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 usingaccount import
- a default name will be generated. - Addresses outputted when calling
sncast account create
,sncast deploy
andsncast declare
are now padded to 64 characters length and prefixed with0x0
- 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
Cast
Added
- You can now use numbers without quotes as inputs for calls in multicall config file.
- New
--arguments
flag tocall
,invoke
anddeploy
for automatic conversion of Cairo expressions instead of serialized form.
Forge
Changed
- You can now pass arguments to
cairo-profiler
andcairo-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 to2024_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
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 toaccount 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
Cast
Changed
declare
andverify
commands now use the Scarbrelease
profile instead of thedev
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 withbytecode_segment_lengths
being a number)
Forge
Added
- Project generated by
snforge
containsassert_macros
dependency with version 0.1.0 for Scarb <= 2.8.0, otherwise equal to Scarb - Support for overriding fork configuration in test attribute with a different block ID, tag, or hash.
--no-optimization
flag that can be used to build contracts using the [starknet contract target](https://docs.swmansion.com/scarb/docs/extensions/starknet/contract-target.html#starknet-contract-target. This is the default behavior when using Scarb < 2.8.3
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 forcairo-coverage
when running--coverage
flag
snforge_scarb_plugin
Fixed
- The package is now correctly versioned
0.30.0
Forge
Added
- Derived
Debug
andClone
ontrace.cairo
items --coverage
flag to thetest
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 inScarb.toml
is now consistentRangeCheck96
,AddMod
,MulMod
builtins are now properly supported- Fixed escaping
'
in#[should_panic]
s - Fixed
scarb init
with snforge runner
0.29.0
0.28.0
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 addingassert_macros = "0.1.0"
to dependencies section ofScarb.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
tolatest
declare
cheatcode now returnsResult<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
andaccount 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
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 astart_
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
0.26.0
0.25.0
Forge
Changed
SyscallResultStringErrorTrait::map_error_to_string
removed in favor of utility function (snforge_std::byte_array::try_deserialize_bytearray_error
)
Cast
Removed
--class-hash
flag fromaccount deploy
command
Added
tx-status
subcommand to get transaction status. Read more heretx_status
function to cast_std. Read more here- Support for creating argent accounts
- Support for creating braavos accounts