If I have an account with 5 ETH, can I send the full account balance of 5ETH to another account and have exactly 5ETH received on the second account ?
I understood that it will fail because I have no ether left to pay for the transaction fees.
If I want exactly 5 ETH to be received by the second account, I think I should have around 5,0002 ETH in my account to be able to transfer 5 ETH. Can you confirm?
Best Answer
No.
You cannot send the entire balance because the fees are deducted from your account's balance, not from the value being sent. To sweep an account you need to send
balance-gas*price
ETH as thevalue
, and also manually set thegas
andgasPrice
to ensure that you exactly zero your account.E.g. If you have 5ETH and want to sweep it: