Skip to content

Foundry Fundamentals : Section 2 : Lesson 22 : Integration Testing #3256

Answered by EngrPips
Fahad3242 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @Fahad3242, Please wrap your FundMe(payable(mostRecentlyDeployed)).fund{value: SEND_VALUE}(); inside a vm.startBroadcast() and vm.stopBroadcast(); as shown below, then retry the process. You should run forge clean and delete the cache folder if you have one before retrying.

function fundFundMe(address mostRecentlyDeployed) public {
        console.log("Most recently deployed FundMe contract: %s", mostRecentlyDeployed);
        console.log("Sending %s to FundMe contract", SEND_VALUE);
        console.log("Funding FundMe contract with %s", SEND_VALUE);
        vm.startBroadcast();
        FundMe(payable(mostRecentlyDeployed)).fund{value: SEND_VALUE}();
        vm.stopBroadcast();
    }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Fahad3242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants