Suppressing Issues

How to make MythX stop reporting false positives or accepted issues.

Suppressing issues in MythX is easy, and can be done using simple inline comments.

You can report false positives through the dashboard! Marking false positives allows us to optimise our analysis.

example.sol
contract Overflow {
    function add (uint a, uint b) public returns (uint) {
        return a + b;
    }
}

We have a simple contract that has a function add that takes two arguments and adds them. It's easy to see that there is an overflow here, as add is a simple wrapper around the + operator.

You can add a simple inline comment to make MythX suppress the overflow that occurs on line 3.

contract Overflow {
    function add (uint a, uint b) public returns (uint) {
        return a + b; // mythx-disable-line
    }
}

Suppression Methods

Single line suppression

// mythx-disable-line - Ignore any warnings reported for the line below.

// mythx-disable-line SWC-100, SWC-101, SWC-999 - Ignore any warnings in the line below with SWC-100, SWC-101 and SWC-999.

Multi line supression

Multi line suppression might hide true positive issues by accident. Use with caution!

/* mythx-disable */ - Ignore any warnings for all lines below.

/* mythx-disable SWC-100, SWC-999 */ - Only ignore warnings for specific SWC's.

/* mythx-enable */ - Re-enable any warnings for all lines below.

/* mythx-enable SWC-100 */ - Re-enable warnings for specific SWC's.

Last updated