Sablier

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

Single use of internal functions can be inlined

Summary

L-8: Internal functions called only once can be inlined

Vulnerability Details

  • Found in src/SablierV2NFTDescriptor.sol Line: 133

    function abbreviateAmount(uint256 amount, uint256 decimals) internal pure returns (string memory)
  • Found in src/SablierV2NFTDescriptor.sol Line: 171

    function calculateDurationInDays(uint256 startTime, uint256 endTime) internal pure returns (string memory)
  • Found in src/SablierV2NFTDescriptor.sol Line: 190

    function calculateStreamedPercentage()
  • Found in src/SablierV2NFTDescriptor.sol Line: 206

    function generateAccentColor(address sablier, uint256 streamId) internal view returns (string memory) {
  • Found in src/SablierV2NFTDescriptor.sol Line: 240

    function generateAttributes(
  • Found in src/SablierV2NFTDescriptor.sol Line: 261

    function generateDescription(
  • Found in src/SablierV2NFTDescriptor.sol Line: 301

    function generateName(string memory sablierModel, string memory streamId) internal pure returns (string memory) {
  • Found in src/SablierV2NFTDescriptor.sol Line: 307

    function mapSymbol(IERC721Metadata sablier) internal view returns (string memory)
  • Found in src/SablierV2NFTDescriptor.sol Line: 322

    function safeAssetDecimals(address asset) internal view returns (uint8) {
  • Found in src/SablierV2NFTDescriptor.sol Line: 334

    function safeAssetSymbol(address asset) internal view returns (string memory) {
  • Found in src/SablierV2NFTDescriptor.sol Line: 372

    function stringifyPercentage(uint256 percentage) internal pure returns (string memory)
  • Found in src/SablierV2NFTDescriptor.sol Line: 384

    function stringifyStatus(Lockup.Status status) internal pure returns (string memory)
  • Found in src/libraries/NFTSVG.sol Line: 98

    function generateDefs()
  • Found in src/libraries/NFTSVG.sol Line: 120

    function generateFloatingText()
  • Found in src/libraries/NFTSVG.sol Line: 146

    function generateHrefs()
  • Found in src/libraries/SVGElements.sol Line: 78

    function card()
  • Found in src/libraries/SVGElements.sol Line: 255

    function stringifyCardType(CardType cardType) internal pure returns (string memory)

Impact

Low

Tools Used

Aderyn

Recommendations

Instead of separating the logic into a separate function, consider inlining the logic into the calling function. This
can reduce the number of function calls and improve readability.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 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.