Dubious Typecast

May 28, 2024 ยท View on GitHub

Configuration

  • Check: pess-dubious-typecast
  • Severity: Medium
  • Confidence: High

Description

Highlights explicit typecasts, where the result value can differ from the original one. E.g., uint8(uint256(1e18)), uint256(int256(-1)).

Vulnerable Scenario

test scenario

Recommendation

Verify that the typecast doesn't break the code.

Contents

  1. 1Configuration
  2. 2Description
  3. 3Vulnerable Scenario
  4. 4Recommendation