Skip to content

Releases: foundry-rs/starknet-foundry

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

0.4.0-alpha.0

07 Aug 11:40
c693788
Compare
Choose a tag to compare
0.4.0-alpha.0 Pre-release
Pre-release

This is a pre-release of starknet-foundry v0.4.0

What's Changed

Forge

Added

  • should_panic attribute

Changed

  • Cheatcodes now are a scarb package

0.3.0

02 Aug 13:08
53ef523
Compare
Choose a tag to compare

What's Changed

Forge

Added

  • warp cheatcode
  • roll cheatcode
  • prank cheatcode
  • Most unsafe libfuncs can now be used in contracts

Changed

  • declare return type to starknet::ClassHash, doesn't return a Result
  • PreparedContract class_hash changed to starknet::ClassHash
  • deploy return type to Result::<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
  • --wait flag 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

0.2.0

26 Jul 15:45
8487e1c
Compare
Choose a tag to compare

This release fixes bugs related to collecting tests within the package. This changes the logic of test collecting - all tests within package must now be imported in lib.cairo or submodules.

Read the updated docs on test collecting for more details.

What's Changed

  • Fixed finding tests when using super in imports
  • Fixed finding tests using imported code

Compatible Scarb Versions

Tool Scarb Version
snforge 0.5.2
sncast 0.5.2

0.1.1

24 Jul 22:15
8a5a17c
Compare
Choose a tag to compare

What's Changed

Various bugfixes from 0.1.0

  • Fixed class_hashes calculation
  • Fixed test collection

Full Changelog: v0.1.0...v0.1.1

Compatible Scarb Versions

Tool Scarb Version
snforge 0.5.2
sncast 0.5.2

0.1.0

19 Jul 09:12
587f5b4
Compare
Choose a tag to compare

Starknet Foundry

The first release of Starknet Foundry is out! 🔥🚀

Create, test and deploy Starknet contracts directly from one tool.

Check out the Starknet Foundry Book 📕 to learn how to utilize it in
your projects.

What's Changed

  • Added forge - smart contract test runner
  • Added cast - all-in-one Starknet interactions tool

Compatible Scarb Versions

Tool Scarb Version
snforge 0.5.1
sncast 0.5.2