Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Define and use constant variables instead of using literals

Summary

If the same constant literal value is used multiple times, create a constant state variable and reference it throughout the contract.

Vulnerability Details


Found in src/libraries/Helpers.sol [Line: 55]

if (decimals == 18) {
  • Found in src/libraries/Helpers.sol [Line: 60]

    uint256 scaleFactor = 10 ** (18 - decimals);
  • Found in src/libraries/Helpers.sol [Line: 67]

    if (decimals == 18) {
  • Found in src/libraries/Helpers.sol [Line: 72]

    uint256 scaleFactor = 10 ** (18 - decimals);

Impact

Tools Used

Personal Knowledge

Recommendations

create a constant state variable and reference it throughout the contract

Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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