crytic / crytic/slither

Overridden function's base function is also available in the contract

Open
#1,975 2 comments 0 reactions 0 assignees View on GitHub
documentation question
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

When a function is overridden in the contract B, the contract B contains two functions with identical signatures but one of that functions are not accessible from an object of type B

### Code example to reproduce the issue:

```solidity
abstract contract A {
function f() virtual public returns(uint);
}

contract B is A {
function f() public override returns(uint) {
return 2;
}
}
```

### Version:

0.9.3

### Relevant log output:

```shell
>>> from slither import Slither
>>> B = Slither('override.sol').contracts[1]
>>> B.functions_signatures
['f()']
>>> B.functions
[, ]
>>> B.functions[0].contract == B
True
>>> B.functions[1].contract == B
True
>>> B.functions[0].signature == B.functions[1].signature
True
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.