Slither

Slither

Community Analyzer

Incorrect exponentiation SLITHER-W1022

Anti-pattern
Critical

Detect use of bitwise xor ^ instead of exponential **

Exploit Scenario

contract Bug{
    uint UINT_MAX = 2^256 - 1;
    ...
}

Alice deploys a contract in which UINT_MAX incorrectly uses ^ operator instead of ** for exponentiation

Recommendation

Use the correct operator ** for exponentiation.

Learn more

incorrect-exp on Slither's wiki.