crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://secure-contracts.com/program-analysis/medusa/docs/src/
GNU Affero General Public License v3.0
304 stars 40 forks source link

Optimization tests should support inputs and uint return value #486

Open tuturu-tech opened 2 months ago

tuturu-tech commented 2 months ago

Currently optimization tests only support optimize_* functions with no inputs and a int output, as visible here. It would be useful to have optimization tests that support inputs and uint outputs as well.

Example of optimization test that currently won't be run:

    function optimize_rateDifference() public returns (uint256) {
        if (newRate < startingRate) {
            return startingRate - newRate;
        }
        return 0;
    }