# Lesson 7: AssertionError: expected BigNumber{ …(2) } to equal +0 #4857
TheDude-dev
started this conversation in
General
Replies: 1 comment
-
I've fixed the problem! The issue was coming from my fundMe contract, more precisely my withdraw function. I had this: function withdraw() public onlyOwner {
for (
uint256 funderindex = 0;
funderindex < funders.length;
funderindex++
) {
address funder = funders[funderindex];
addressToAmountFunded[funder] = 0;
funders = new address[](0);
(bool callSuccess, ) = payable(msg.sender).call{
value: address(this).balance
}("");
require(callSuccess, "Call failed");
}
} instead of this : function withdraw() public onlyOwner {
for (
uint256 funderindex = 0;
funderindex < funders.length;
funderindex++
) {
address funder = funders[funderindex];
addressToAmountFunded[funder] = 0;
}
funders = new address[](0);
(bool callSuccess, ) = payable(msg.sender).call{
value: address(this).balance
}("");
require(callSuccess, "Call failed");
} |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
hi! guys! I'm going through lesson 7 at 11:41:34 of the course, and I'm getting this error while running my test
The problem appears to come from here :
Please, help!
Beta Was this translation helpful? Give feedback.
All reactions