Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
rappie opened this issue Nov 4, 2024 · 1 comment
Open

Comments

@rappie
Copy link

rappie commented Nov 4, 2024

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
Copy link
Author

rappie commented Nov 5, 2024

Turns out the issue was caused by this Foundry setting:

bytecode_hash = "none"

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant