Created by Kshitij about a year ago
No description provided
even if a transaction of 0 ether keeps ongoing, then won't it affect mainnet, or system of the sender and requester, what will happen?
So address.transfer(1) will call fallback function but address.transfer(0) won't call fallback function?
Ok I get it, making balance[address] = 0 first, the second time when the fallback function in hacker's smart contract is called, we are going to transfer 0 ETH.
But, our smart contract is still executing the transfer function isn't it? Although its not transferring anything.
The issue here is that everytime our contract is executing the transfer() function we are spending gas in form of ETH from our contract balance and if this continue, then eventually we might empty of our contract balance.
One possible solution to this that I think is that using a require statement to check if balance[address] != zero and then only get to the transfer part.
Is it right Sir? Please try to reply 🙂