medusa icon indicating copy to clipboard operation
medusa copied to clipboard

Consume arguments emitted from events to be used in the fuzzing test

Open 0xicingdeath opened this issue 1 year ago • 1 comments

Feature Request: support parsing of event data after a function has been called to pull intermediate / updated values mid-execution

For the following code snippet, it becomes non-trivial to find the output of updatedVarA and updatedVarB, which is necessary in some cases to figure out how much allowance to grant a specific user, or how many funds to actually allocate in order to have a successful transaction.

function X() public { 
  _a(); 
  _b(); 
} 

function _a() private {
   // insert random calculations here 
   emit ValuesUpdated(updatedVarA, updatedVarB)
} 

This ends up slowing down invariant development, because helper contracts // functions need to be added to calculate hypothetical values, which is challenging especially in cases where the codebase is reaching max contract size.

0xicingdeath avatar Feb 29 '24 14:02 0xicingdeath

I would love to see this added, I believe it can be very powerful.

Echidna equivalent: https://github.com/crytic/echidna/issues/883

rappie avatar Feb 29 '24 20:02 rappie