Releases: foundry-rs/starknet-foundry
Releases · foundry-rs/starknet-foundry
0.8.1
Forge
Fixed
- significantly reduced ram usage
0.8.0
⚠️ This release has some bugs and might not be usable in your projects ⚠️
Fixes are coming in the next few days
Forge
Added
#[fuzzer(...)]attribute allowing to specify a fuzzer configuration for a single test case- Support for
u8,u16,u32,u64,u128,u256types to fuzzer --clean-cacheflag- Changed interface of
L1Handler.executeandL1Handler(droppedfeeparameter, added result handling withRevertedTransaction) - Contract now has associated state, more about it here
- cheatcodes (
prank,roll,warp) now work on forked Cairo 0 contracts
Changed
0.7.1
Forge
Added
snforge_stdvarlibrary function for reading environmental variables
Fixed
- Crashes while using any concrete
block_idwhen using forking mode insnforge
0.7.0
Forge
Added
- Support for scarb workspaces
- Initial version of fuzz testing with randomly generated values
#[fork(...)]attribute allowing testing against a network fork
Changed
- Tests are collected only from a package tree (
src/lib.cairoas an entrypoint) andtestsfolder:- If there is a
lib.cairofile intestsfolder, then it is treated as an entrypoint to thetestspackage from which tests are collected - Otherwise, all test files matching
tests/*.cairoregex are treated as modules and added to a single virtuallib.cairo, which is treated as described above
- If there is a
You can read more about new test collection mechanism here
Cast
Added
account addcommand for importing accounts to the accounts fileaccount createcommand for creating openzeppelin accounts with starkli-style keystoreaccount deploycommand for deploying openzeppelin accounts with starkli-style keystore
Changed
--add-profileno longer accepts-afor short- allow the
idproperty in multicalls to be referenced in the inputs ofdeployandinvokecalls
0.6.0
Forge
Added
deploy_atcheatcode- printing failures summary at the end of an execution
- filtering tests now uses an absolute module tree path — it is possible to filter tests by module names, etc.
Fixed
- non-zero exit code is returned when any tests fail
- mock_call works with dispatchers if contract does not exists
Cast
Added
- support for starkli-style accounts, allowing the use of existing accounts
Changed
- fixed misleading error message when there was no scarb in PATH and
--path-to-scarb-tomlwas passed - modified
multicall newcommand output, to be in line with other commands outputs
0.5.0
Forge
Added
- support for
keccak_syscallsyscall - it can be used directly in cairo tests l1_handler_executecheatcode by @glihm- support for
rolling/warping/pranking the constructor logic (precalculate address, prank, assert pranked state in constructor) spy_eventscheatcode- support for printing in contracts
spoofcheatcode
Cast
Added
- Support for custom networks - accounts created on custom networks are saved in
accounts-fileunder network's
chain_id accounts-filefield in Scarb.toml profile- Include the class hash of an account contract in the
accounts-file
Removed
--networkoption together with thenetworkfield in Scarb.toml profile — previously used as a validation factor;
now networks are identified by their chain_id
Other contributors: @amlord , @tiagofneto
Compatible Scarb Versions
| Tool | Scarb Version |
|---|---|
snforge |
0.7.0 |
sncast |
>=0.4.1, <=0.7.0 |
0.4.1
Changed
- fixed version number (now
0.4.1)
Compatible Scarb Versions
| Tool | Scarb Version |
|---|---|
snforge |
0.6.0 |
sncast |
>=0.4.1, <=0.6.0 |
0.4.0
Forge
Added
mock_callcheatcodes- Functions
parse_txtandTxtParser<T>::deserialize_txtto load data from plain text files and serialize it #[should_panic]attribute support by @enitratget_class_hashcheatcode by @glihm- Print support for all basic numeric data types
Changed
- Exported
snforge_stdas a Scarb package, now you have to import it explicitly with e.g.use snforge_std::declare
and add it as a dependency to your Scarb.toml
[dependencies]
# ...
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "0.4.0" }- Gently fails test when user tries to use syscalls not supported by forge test runner
- Updated cairo-lang to 2.1.0, starknet-api to 0.4.1 and blockifier to 0.2.0-rc0
Cast
Added
- Added
--class-hashflag to account create/deploy, allowing for custom openzeppelin account contract class hash
Other contributors: @Utilitycoder , @binsta,
Compatible Scarb Versions
| Tool | Scarb Version |
|---|---|
snforge |
0.6.0 |
sncast |
>=0.4.1, <=0.6.0 |
0.4.0-alpha.0
This is a pre-release of starknet-foundry v0.4.0
What's Changed
Forge
Added
should_panicattribute
Changed
- Cheatcodes now are a scarb package
0.3.0
What's Changed
Forge
Added
warpcheatcoderollcheatcodeprankcheatcode- Most unsafe libfuncs can now be used in contracts
Changed
declarereturn type tostarknet::ClassHash, doesn't return aResultPreparedContractclass_hashchanged tostarknet::ClassHashdeployreturn type toResult::<starknet::ContractAddress, RevertedTransaction>
Fixed
- Using the same cairo file names as corelib files no longer fails test execution
Cast
Added
- multicall as a single transaction
- account creation and deployment
--waitflag to wait for transaction to be accepted/rejected
Changed
- sierra and casm artifacts are now required in Scarb.toml for contract declaration
- improved error messages
Compatible Scarb Versions
| Tool | Scarb Version |
|---|---|
snforge |
0.6.0-alpha.2 |
sncast |
>=0.4.1, <=0.6.0-alpha.2 |