echidna icon indicating copy to clipboard operation
echidna copied to clipboard

[Bug-Candidate]: OpenZeppelin's `UUPSUpgradeable` seems to mess up coverage

Open rappie opened this issue 1 year ago • 1 comments

Describe the issue:

The coverage report shows no coverage for contracts inheriting UUPSUpgradeable

Code example to reproduce the issue:

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

// contract CoverMe {
contract CoverMe is UUPSUpgradeable {
    function doSomething() public pure returns (uint256) {
        uint256 something = 2;
        return something;
    }

    function _authorizeUpgrade(address) internal override { }
}

contract Fuzz {
    CoverMe coverMe;

    constructor() payable {
        coverMe = new CoverMe();
    }

    function testCoverage() public view {
        uint something = coverMe.doSomething();
        assert(something == 0);
    }
}

image

Version:

2.2.5 (latest master build)

Relevant log output:

Traces:
call 0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84::doSomething() (../Fuzz.sol:24)
 └╴← (2)

rappie avatar Nov 04 '24 20:11 rappie

Turns out the issue was caused by this Foundry setting:

bytecode_hash = "none"

https://book.getfoundry.sh/reference/config/solidity-compiler#bytecode_hash

rappie avatar Nov 05 '24 11:11 rappie

Closing as this was confirmed to be a Foundry configuration issue, not an Echidna bug.

dguido avatar Aug 25 '25 15:08 dguido