Skip to content

Releases: foundry-rs/starknet-foundry

0.8.3-alpha.1

16 Oct 10:55
Compare
Choose a tag to compare
0.8.3-alpha.1 Pre-release
Pre-release
v0.8.3-alpha.1

update version

0.8.2

12 Oct 11:33
6db50de
Compare
Choose a tag to compare

Forge

Fixed

  • incorrect caller address bug in called contracts

0.8.1

12 Oct 07:30
e6a47f1
Compare
Choose a tag to compare

Forge

Fixed

  • significantly reduced ram usage

0.8.0

11 Oct 13:46
a8ef6f1
Compare
Choose a tag to compare
0.8.0 Pre-release
Pre-release

⚠️ 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, u256 types to fuzzer
  • --clean-cache flag
  • Changed interface of L1Handler.execute and L1Handler (dropped fee parameter, added result handling with RevertedTransaction)
  • Contract now has associated state, more about it here
  • cheatcodes (prank, roll, warp) now work on forked Cairo 0 contracts

Changed

  • Spying events interface is updated to enable the use of events defined inside contracts in assertions
  • Test are executed in parallel
  • Fixed inconsistent pointers bug #659
  • Fixed an issue where deploy_at would not trigger the constructors #805

0.7.1

27 Sep 16:58
d1bd8b9
Compare
Choose a tag to compare

Forge

Added

  • snforge_std var library function for reading environmental variables

Fixed

  • Crashes while using any concrete block_id when using forking mode in snforge

0.7.0

27 Sep 12:19
d8d546a
Compare
Choose a tag to compare

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.cairo as an entrypoint) and tests folder:
    • If there is a lib.cairo file in tests folder, then it is treated as an entrypoint to the tests package from which tests are collected
    • Otherwise, all test files matching tests/*.cairo regex are treated as modules and added to a single virtual lib.cairo, which is treated as described above

You can read more about new test collection mechanism here

Cast

Added

  • account add command for importing accounts to the accounts file
  • account create command for creating openzeppelin accounts with starkli-style keystore
  • account deploy command for deploying openzeppelin accounts with starkli-style keystore

Changed

  • --add-profile no longer accepts -a for short
  • allow the id property in multicalls to be referenced in the inputs of deploy and invoke calls

0.6.0

13 Sep 13:44
edd2e35
Compare
Choose a tag to compare

Forge

Added

  • deploy_at cheatcode
  • 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-toml was passed
  • modified multicall new command output, to be in line with other commands outputs

0.5.0

30 Aug 12:34
368dfde
Compare
Choose a tag to compare

Forge

Added

  • support for keccak_syscall syscall - it can be used directly in cairo tests
  • l1_handler_execute cheatcode by @glihm
  • support for rolling/warping/pranking the constructor logic (precalculate address, prank, assert pranked state in constructor)
  • spy_events cheatcode
  • support for printing in contracts
  • spoof cheatcode

Cast

Added

  • Support for custom networks - accounts created on custom networks are saved in accounts-file under network's
    chain_id
  • accounts-file field in Scarb.toml profile
  • Include the class hash of an account contract in the accounts-file

Removed

  • --network option together with the network field 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

17 Aug 12:33
Compare
Choose a tag to compare

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

17 Aug 09:17
1981e86
Compare
Choose a tag to compare

Forge

Added

  • mock_call cheatcodes
  • Functions parse_txt and TxtParser<T>::deserialize_txt to load data from plain text files and serialize it
  • #[should_panic] attribute support by @enitrat
  • get_class_hash cheatcode by @glihm
  • Print support for all basic numeric data types

Changed

  • Exported snforge_std as 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-hash flag 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