Replies: 1 comment
-
Your decimals are off, starting balances are |
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.
-
@PatrickAlphaC
at this point of the tutorial where you started writing test for multiple funders.
As per my understanding of the solidity code below:
The deployer gets to withdraw all the amount of ETHs available in the smart contract to the deployer's address. whether funds came from 10 different accounts. Example Deployer's initial balance was 1 ETH and 9 other different accounts sent 1 ETH each to the smart contract, so smart contract is supposed to have 9 ETH in total. When we withdraw then Deployer's account should now have 10 ETH ( 1 it already had and the rest came in from the smart contract withdraw transaction)
When you wrote this test:
1 ETH goes to the smart contract due to the
beforeEach
then 5 more ETH(s) are funded by different accounts. so smart contract is supposed to have 6 ETH(s) in total.When I run the above test on the hardhat default network, my console logs print the following:
So my question is that should not all the 6 ETH(s) be withdrawn to the deployer and deployer's final balance should comes out to be 100.0499725211023 and it should be 106.0499725211023
I might have misunderstood something have been thinking about this for a while so thought to ask.
Beta Was this translation helpful? Give feedback.
All reactions