From 3d9e3c9b138b171988ee578f7b31cde91e4a80b3 Mon Sep 17 00:00:00 2001 From: Mike Hathaway Date: Thu, 12 Oct 2023 18:31:29 -0400 Subject: [PATCH] base64 encode svg image string (#943) Co-authored-by: Mike --- src/libraries/external/PositionNFTSVG.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/external/PositionNFTSVG.sol b/src/libraries/external/PositionNFTSVG.sol index 1328cd499..f9598ce14 100644 --- a/src/libraries/external/PositionNFTSVG.sol +++ b/src/libraries/external/PositionNFTSVG.sol @@ -34,6 +34,7 @@ library PositionNFTSVG { // set token metadata string memory description = "Ajna Positions NFT-V1"; string memory image = _generateSVGofTokenById(params_); + string memory encodedImage = Base64.encode(bytes(image)); string memory name = string( abi.encodePacked("Ajna Token #", Strings.toString(params_.tokenId)) ); @@ -52,7 +53,7 @@ library PositionNFTSVG { description, '", "image":"', 'data:image/svg+xml;base64,', - image, + encodedImage, '", "owner":"', ownerHexString, '"}'