Skip to content

Commit

Permalink
base64 encode svg image string (#943)
Browse files Browse the repository at this point in the history
Co-authored-by: Mike <[email protected]>
  • Loading branch information
MikeHathaway and Mike authored Oct 12, 2023
1 parent a255759 commit 3d9e3c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libraries/external/PositionNFTSVG.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
Expand All @@ -52,7 +53,7 @@ library PositionNFTSVG {
description,
'", "image":"',
'data:image/svg+xml;base64,',
image,
encodedImage,
'", "owner":"',
ownerHexString,
'"}'
Expand Down

0 comments on commit 3d9e3c9

Please sign in to comment.