crytic / crytic/fuzz-utils

[Bug-Candidate]: Functions with the same signature can be generated multiple times

Open
#50 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Solidity
Stars
115
Forks
6
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

When multiple contracts have functions with the same signature fuzz-utils will generate the same function multiple times, preventing compilation.

We should:
- Add a prefix to the function e.g., `contractName_functionName` when generating
- Detect if a function is overriden and only generate one instance in that case

### Code example to reproduce the issue:

```solidity
contract A {
function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) {
// Do something
}
}

contract B is A {
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
// Do something else
}
}
```

### Version:

0.2.0

### Relevant log output:

```shell
N/A
```

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.