Conceptualizing Transactions vs Internal Transactions #1768
Replies: 2 comments 5 replies
-
Refer this for a better understanding: #1218 While it is okay for now Now, try to answer by yourself—I believe the above is sufficient—and if not, do not worry, I am here. |
Beta Was this translation helpful? Give feedback.
-
@paulgs9988 This part is ok, that you have created a parameter for passing the address for withdrawal, but there should be one thing more and that is onlyOnwer. Otherwise, anybody can call this function and withdraw the amount. And for your rest of transaction thing went our my head, I read three times. So I cannot answer it right now, maybe you brief your question more so I can understand what you are trying to say. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was hoping someone might be able to help me with conceptualizing some things. I am at the part of the tutorial where I just created the "withdraw" function in my FundMe contract and we just went over the three ways to transfer eth (i.e. transfer, send, call). The tutorial structures this code, it seems, that if you withdraw, you just withdraw the contract's eth to itself. So I changed the withdraw function so it looks like this:
In other words, I want to be able to pass an address to which to withdraw the funds as a variable in the withdraw function. I was expecting this to transfer the contract's amount to my address when I enter my address and click "withdraw" in Remix, but instead of having a transaction for the amount "IN" to my address on etherscan, it only shows up as an "internal transaction" on the separate tab.
I was viewing this whole thing as sort of: the contract exists as a separate "account" on the chain, and I can send eth as an "out" transaction to that contract, but then when I click "withdraw" I should be able to get an "in" transaction into my address account as that contract "account" is drained. Is this not correct? Can someone help me clarify?
Below is a screen shot that shows how these "withdrawals" are shown as "internal transactions" from the contract address to my metamask address
Beta Was this translation helpful? Give feedback.
All reactions