Sending ALL wallet balance not working well #4373
Unanswered
DavidOzan83
asked this question in
Q&A
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Keep in mind, once we have EIP-3074 we’ll be able to trivially drain an account with no dust. If there is no hurry, I’ll put up a sample drain contract once it’s available. :) |
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.
-
Hi,
I'm trying to send the entire balance of a wallet to another wallet.
To do so, I'm calculating the estimated fees and decreasing them from the balance.
The issue is that I always get INSUFFICIENT_FUNDS, I believe it's due to the constantly changing gasPrice..
I was able to overcome this issue using maxFeePerGas for calculating the fees, but then I'm leaving around $0.3 every time.
Is there a way I can send the entire wallet balance such that it will loss $0, or at max $0.01?
PS:
my code:
Beta Was this translation helpful? Give feedback.
All reactions