Skip to content

Feature: generating test case from reproducer #651

@montyly

Description

@montyly

It looks like every team ended up building their own foundry test-case producer (fuzz-utils, getrecon, fuzz-trace-parser etc), so what would you think if we added this feature directly into medusa?

For example, we could generate a solidity file with this structure for each reproducer

solidity

interface I0{
   function public f();
}

interface I1{
   function public g();
}

contract PoC is Test{

   I0 contract_0 = I0(0x4141...);
   I1 contract_1 = I1(0x4242...);

   function test_run() public{

          uint256 initialBlockNumber = block.number;
          uint256 initialTimestamp = block.timestamp;

          initialTimestamp += 154:
          vm.warp(initialTimestamp);

          contract_0.f();
          contract_1.g();
   }
}

This is the format I am currently using with my own custom script, but curious if others have opinions

What do you think? I would be happy to implement it in the following weeks if there is no other volunteer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions