DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Large Literal Values Can Be Replaced with Scientific Notation

Summary

The constant uint256 BPS = 10_000;in KeeperProxy contract, uint256 public constant BASIS_POINTS_DIVISOR = 10_000 in GmxProxy contract and uint256 constant BPS = 10_000, uint256 public constant BASIS_POINTS_DIVISOR = 10_000 and callbackGasLimit = 2_000_000 in PerpetualVault contract
are declared using a large literal value which can be represented more concisely using scientific notation to enhance readability and reduce potential formatting errors.

Vulnerability Details

Large numeric literals formatted with underscores can sometimes be misread or mistyped. Using scientific notation (e.g., 1e4) improves clarity and ensures consistency.

Link for GmxProxy

uint256 public constant BASIS_POINTS_DIVISOR = 10_000;

Link for KeeperProxy

uint256 constant BPS = 10_000;

Link for PerpetualValut

uint256 public constant BASIS_POINTS_DIVISOR = 10_000;

Link for PerpetualVault

callbackGasLimit = 2_000_000;

Impact

  • Improves readability and maintainability of the code.

  • Reduces potential errors from misreading large numeric literals.

Tools Used

Manual code review

Recommendations

Replace 10_000 with 1e4and 2_000_000 with 2e6

Updates

Lead Judging Commences

n0kto Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.