crytic / crytic/slither

[Bug-Candidate]: Slither-mutate; ROR mutator doesn't respect whether the integer is signed

Open
#2,674 0 comments 1 reaction 0 assignees View on GitHub
bug-candidate
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

slither-mutate generates some mutations that are semantically equivalent in code that performs equality checks between unsigned integers and zero.

Example ROR mutation:
`INFO:Slither-Mutate:[ROR] Line 162: 'amount == 0' ==> 'amount <= 0' --> UNCAUGHT`

amount is an unsigned integer, so comparing <=0 instead of ==0 is semantically equivalent

### Code example to reproduce the issue:

```
contract Test{
function deposit( uint256 amount) external {
if (amount == 0) {
revert();
}
}

```

### Version:

Slither 0.11.0

### Relevant log output:

```shell

```

Contributor guide

Open the contributing guide

Research direction

The issue provides no repository file, test, or entry point; start by locating the Slither-Mutate ROR mutator and run the Solidity reproduction shown in the report. Done means unsigned integer equality checks no longer produce semantically equivalent ROR mutations such as <= 0, with a regression test covering the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, solidity
Domain
testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.