Sablier

Sablier
DeFiFoundry
53,440 USDC
View results
Submission Details
Severity: low
Invalid

Define and use `constant` variables instead of using literals

Description: If the same constant literal value is used multiple times, create a constant state variable and reference it throughout the contract.
Impacts:
Recommended Mitigation:
use constant

  • Found in src/SablierV2NFTDescriptor.sol [Line: 135]

    return "0";
  • Found in src/SablierV2NFTDescriptor.sol [Line: 152]

    uint256 suffixIndex = 0;
  • Found in src/SablierV2NFTDescriptor.sol [Line: 154]

    // Truncate repeatedly until the amount is less than 1000.
  • Found in src/SablierV2NFTDescriptor.sol [Line: 156]

    while (truncatedAmount >= 1000) {
  • Found in src/SablierV2NFTDescriptor.sol [Line: 220]

    // The saturation is a percentage where 0% is grayscale and 100%, but here the range is bounded to [20,100]
  • Found in src/SablierV2NFTDescriptor.sol [Line: 225]

    // The lightness is typically a percentage between 0% (black) and 100% (white), but here the range
  • Found in src/SablierV2NFTDescriptor.sol [Line: 338]

    if (!success || returnData.length <= 64) {
  • Found in src/SablierV2NFTDescriptor.sol [Line: 355]

    function stringifyFractionalAmount(uint256 fractionalAmount) internal pure returns (string memory) {
  • Found in src/SablierV2NFTDescriptor.sol [Line: 366]

    return string.concat(".", fractionalAmount.toString());
  • Found in src/SablierV2NFTDescriptor.sol [Line: 371]

    /// @param percentage A numerical value with 4 implied decimals.
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Info/Gas/Invalid as per Docs

https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity

Support

FAQs

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