Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei2308 committed Dec 26, 2024
1 parent a6b4099 commit dba8c29
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions script/DeployMoodNft.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,14 @@ contract DeployMoodNft is Script {
string memory sadSvg = vm.readFile("./img/sad.svg");
string memory happySvg = vm.readFile("./img/happy.svg");
vm.startBroadcast();
MoodNft moodNft = new MoodNft(
svgToImageURI(sadSvg),
svgToImageURI(happySvg)
);
MoodNft moodNft = new MoodNft(svgToImageURI(sadSvg), svgToImageURI(happySvg));
vm.stopBroadcast();
return moodNft;
}

function svgToImageURI(
string memory svg
) public pure returns (string memory) {
function svgToImageURI(string memory svg) public pure returns (string memory) {
string memory baseURL = "data:image/svg+xml;base64,";
string memory svgBase64Encoded = Base64.encode(
bytes(abi.encodePacked(svg))
);
string memory svgBase64Encoded = Base64.encode(bytes(abi.encodePacked(svg)));
return string(abi.encodePacked(baseURL, svgBase64Encoded));
}
}

0 comments on commit dba8c29

Please sign in to comment.