Slither

Slither

Community Analyzer

The order of parameters in a shift instruction is incorrect SLITHER-W1005

Anti-pattern
Critical

Detect if the values in a shift operation are reversed

Exploit Scenario

contract C {
    function f() internal returns (uint a) {
        assembly {
            a := shr(a, 8)
        }
    }
}

The shift statement will right-shift the constant 8 by a bits

Recommendation

Swap the order of parameters.

Learn more

incorrect-shift on Slither's wiki.