Skip to content

Function parameters shadowing contract storage variables#

Informational

For example in BaseFacet.sol,

    function installApp(bytes32 name) external onlyOwner {
        _installApp(name, address(0), "");
    }

    function installApp(bytes32 name, bytes memory data) external onlyOwner {
        _installApp(name, address(this), data);
    }

    function removeApp(bytes32 name) external onlyOwner {
        _removeApp(name, address(0), "");
    }

    function removeApp(bytes32 name, bytes memory data) external onlyOwner {
        _removeApp(name, address(this), data);
    }

name parameter shadows the ERC721Upgradable.name storage variable. It works without issues and it's not a problem by itself, but it could mislead code readers or developers.

Recommendation#

Consider using different function variable names that don't shadow storage variables.