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)"/>'
'<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
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"/>'
);
}