Advanced Foundry | Section-2 | Lesson-17 NFT | Error on : testFlipTokenToSad test function #3092
Unanswered
vigneshbalu96
asked this question in
Q&A
Replies: 2 comments 5 replies
-
|
Hey @vigneshbalu96, Please show your deployment script. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Here is my //SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {MoodNft} from "../src/MoodNft.sol";
import {Script, console2} from "forge-std/Script.sol";
import {Base64} from "@openzeppelin/contracts/utils/Base64.sol";
contract DeployMoodNft is Script {
function run() external returns (MoodNft) {
string memory happySvg = vm.readFile("./image/happy.svg");
string memory sadSvg = vm.readFile("./image/sad.svg");
vm.startBroadcast();
MoodNft moodNft = new MoodNft(
svgToImageURI(happySvg),
svgToImageURI(sadSvg)
);
vm.stopBroadcast();
return moodNft;
}
function svgToImageURI(
string memory svg
) public pure returns (string memory) {
string memory baseUrl = "data:image/svg+xml;base64,";
string memory svgBase64Encoded = Base64.encode(
bytes(string(abi.encodePacked(svg)))
);
return string(abi.encodePacked(baseUrl, svgBase64Encoded));
}
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
✋ Hello Blockchianeers,
Getting error : FAIL. Reason: MoodNft__CantFlipMoodIfNotOwner()
This is my MoodNftIntegrationTest.t.sol
while running the test using
forge test --mt testFlipTokenToSadI get the error response as below
Any help could be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions