Questions tagged [fuzz-test]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
56 views

Foundry Logging no longer working for contracts in lib folder?

My fuzz tests are calling Smart Contracts in my lib/ folder. In these tests, I'm trying to log variables, but nothing is logged. Yes, I'm using -vv. I even increased verbosity (all the way up to -...
António Gonçalves's user avatar
2 votes
0 answers
51 views

How to Statefully Fuzz in Foundry without Invariants?

I want to Statefully (not Statelessly) Fuzz my Protocol. However, I don't have any Invariants to check. I just want to call all of my Protocol's functions, and see if anything breaks. This is my ...
António Gonçalves's user avatar
0 votes
1 answer
35 views

invariant tests not fuzzing using foundry

I am writing invariant tests using a handler contract in foundry. However, for some reason, the handler contract is not fuzzing (I know because when I run forge test --mt assertSomething It doesn't ...
IBeFrogs's user avatar
0 votes
1 answer
31 views

How do I test for two conditions at the same time in Foundry while running a fuzz test?

Let us say I am trying to fuzz simple addition b/w two 'uint' variables in Solidity using foundry, I expect one of two conditions to happen: The test passes without overflow error. The test fails ...
Priyank Gupta's user avatar
3 votes
1 answer
118 views

Fuzz Testing for Solidity Smart Contract

I'm deeply involved in smart contract security, and I'm currently exploring the world of fuzz testing for Solidity smart contracts. Fuzz testing seems to hold significant promise for identifying ...
Mehran Ra's user avatar
  • 545
0 votes
1 answer
280 views

Foundry Fuzzing How to increase the runs to be more than default 256

I am testing the Foundry Fuzzing feature. Therefore I created this simple contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Vault { bool public s_locked; uint private ...
Dakata's user avatar
  • 205
0 votes
1 answer
198 views

What is the best way of setting limits of fuzz test input parameters in Foundry?

Let's take an example, where we have a stake function, with the stake's endTimestamp in uin64. function stake(uint256 amount, uin64 endTimestamp) It is assumed endTimestamp should never be less than ...
Nal Luksic's user avatar
  • 1,087
2 votes
0 answers
475 views

Between writing fuzzing tests with echidna vs writing fuzzing tests with foundry, are there any advantages one has over the other?

Deciding which tool to use to write some fuzzing tests, was curious if one tool or the other performs better at fuzz testing than the other. It seems to me that foundry will be easier to setup my ...
Bruce's user avatar
  • 937
3 votes
1 answer
347 views

Symbolic Execution vs Fuzz Testing - What's the difference?

In web3, we have a number of fuzzing tools like foundry's fuzz & invariant tests and Trail of Bits Echidna. But what are the purposes of symbolic execution tools like manticore and maat? Fuzz ...
Patrick Collins's user avatar
2 votes
1 answer
319 views

Foundry invariant tests: targetArtifact not seemed to be working

I'm working on a project that is deployed behind a proxy, and looking to do invariant tests with it in foundry. My setup in my invariant test looks as such: function setUp() public { ...
Patrick Collins's user avatar
5 votes
1 answer
898 views

What's the difference between invariant and fuzz testing?

echidna is a popular property-based fuzz tester, and Foundry comes packed with invariant tests. What is the difference between them?
Patrick Collins's user avatar