Sablier

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

Missing Comma in generateHrefs func generates broken HTML

Summary

The generateHrefs is inside the NFTSVG library which is used for the generation of the NFT.

But when generating the hrefs, there is a missing comma between two concatenated strings in the generateHrefs function:

return string.concat(
'<use href="#Glow" fill-opacity=".9"/>',
'<use href="#Glow" x="1000" y="1000" fill-opacity=".9"/>',
@> '<use href="#Logo" x="170" y="170" transform="scale(.6)"/>' // @audit missing ,
'<use href="#Hourglass" x="150" y="90" transform="rotate(10)" transform-origin="500 500"/>',
'<use href="#Progress" x="',
progressXPosition.toString(),
'" y="790"/>',
'<use href="#Status" x="',
statusXPosition.toString(),
'" y="790"/>',
'<use href="#Amount" x="',
amountXPosition.toString(),
'" y="790"/>',
'<use href="#Duration" x="',
durationXPosition.toString(),
'" y="790"/>'
);

Due to the missing comma this combines two separate SVG elements into one string, causing rendering issues.

Impact

  • Incorrect SVG structure, leading to rendering issues in the final output.

Tools Used

Manual Review

Recommendations

Add a comma at the end of the line to properly concat the HTML code.

function generateHrefs(
uint256 progressXPosition,
uint256 statusXPosition,
uint256 amountXPosition,
uint256 durationXPosition
)
internal
pure
returns (string memory)
{
return string.concat(
'<use href="#Glow" fill-opacity=".9"/>',
'<use href="#Glow" x="1000" y="1000" fill-opacity=".9"/>',
- '<use href="#Logo" x="170" y="170" transform="scale(.6)"/>'
+ '<use href="#Logo" x="170" y="170" transform="scale(.6)"/>',
'<use href="#Hourglass" x="150" y="90" transform="rotate(10)" transform-origin="500 500"/>',
'<use href="#Progress" x="',
progressXPosition.toString(),
'" y="790"/>',
'<use href="#Status" x="',
statusXPosition.toString(),
'" y="790"/>',
'<use href="#Amount" x="',
amountXPosition.toString(),
'" y="790"/>',
'<use href="#Duration" x="',
durationXPosition.toString(),
'" y="790"/>'
);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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