Attempting to print s_Funders and s_addressToAmountFunded in FundMe contract #1584
-
I thought it would be nice to add some additional functionality to the FundMe contract. A function that prints the information of the s_Funders array and the s_addressToAmountFunded mapping. Cant seem to get it working. Running on localhost. First calling the fund script, then calling the withdraw script which is where the function is intended to work.
And calling this in the withdraw script with
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
@Stark-Code Maybe it consumes more gas, than your mentioned default one. Try to add gas manually. |
Beta Was this translation helpful? Give feedback.
-
I am certain console.log is NOT used in Solidity, you can use events to keep track of them instead. That seems like the plausible issue here, that is why it never prints, hence your problem. Note: Uhm.. let me know if I am wrong here. |
Beta Was this translation helpful? Give feedback.
-
Ok, I figured it out. I was running the code on a localhost. Turns out console.log is only available on the hardhat network. |
Beta Was this translation helpful? Give feedback.
Ok, I figured it out. I was running the code on a localhost. Turns out console.log is only available on the hardhat network.