Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

False positive on external-function #118

Closed
mrice32 opened this issue Jan 3, 2019 · 1 comment · Fixed by #122
Closed

False positive on external-function #118

mrice32 opened this issue Jan 3, 2019 · 1 comment · Fixed by #122
Labels
bug Something isn't working

Comments

@mrice32
Copy link
Contributor

mrice32 commented Jan 3, 2019

When a function is declared by and called within the base class and overridden by the derived class, slither generates an error on the derived class saying that the function could be made external because the derived class doesn't call the function internally. However, the internal linkage is being used by the base class, and Solidity doesn't allow a derived class to change the visibility of a function when overriding it. Feel free to close if you think this detector is working as intended. I've built a minimal example that shows the false positive.

/*
  Test
*/
pragma solidity ^0.5.0;


contract Base {
    // Meant to be customized/overridden by derived classes.
    function abstractFunction() public;
    function callAbstract() external {
        abstractFunction();
    }
}


contract Derived is Base {
    function abstractFunction() public {
        // Some custom functionality.
    }
}
@montyly
Copy link
Member

montyly commented Jan 4, 2019

Thanks @mrice32 for the report! It's a valid issue.

We are going to update the detector to avoid this FP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants