Skip to content

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

Open
@bsamuels453

Description

@bsamuels453

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-candidateBugs reports that are not yet confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions