Caveat: I tried to provide links to my transactions and addresses in etherscan.io, but I "need at least 10 reputation to post more than 2 links."
I have an account that I want to sweep. I want to sweep the ETH to a funds splitting contract (ETC/ETH). I'm only interested in sweeping the ETH balance and my goal is for the account to end up with a balance of zero (e.g. no dust).
This is the fund splitting contract I'm trying to use: 0x1e143b2588705dfea63a17f2032ca123df995ce0
It seems as if the gas required for this operation is 29,717. For example, here is a sample transaction I sent to the contract, which according to etherscan.io required that amount of gas: 0x7cd52325c0945d0de975a6713abdc50659c0c62ef523a1a99f2ad2a2d4128a8f
However, if I send a transaction and limit the amount of gas to 29,717, my transaction fails. For example, here is a sample transaction I sent to the contract with a gas limit of 29,717, which failed due to lack of gas:
I discovered the minimum amount of gas that I need to specify for one of these transfers to work is 31,991:
- Transaction with 31,991 gas which worked:
- Transaction with 31,990 gas which failed:
However, when the tx goes through, it seems as if it only used 29,717 gas. For example:
0x19d90f1106c600bd8a70b5775776b4ecdc7a945b (address) had a balance of
0.01282711 ETH (at block
I sent transaction
0xb57c8b5aede3070e2fb80ea9a21ec43293cb5c7392ccb36357388422e9055509 (TX) with the following details:
- Gas Price:
- Balance before TX:
- Amount to send:
- Supposed cost of TX:
- Balance - Amount to send - Supposed cost of TX = ZERO!
However, as you can see, account
0x19d90f1106c600bd8a70b5775776b4ecdc7a945b (address) has a balance of
This in turn means that the actual cost of the TX was
0.00059434 ETH: Actual Cost of TX = Balance before TX - Amount sent - Actual End Balance = 0.01282711 - 0.01218729 - 0.00004548 = 0.00059434.
At a gas price of
20000000000 Wei, this means the amount of gas used was:
29717 (0.00059434/0.00000002 = 29717)
So the question are:
- Why are the transactions which specify a gas limit of
- How do I sweep the funds so the ending balance of an ETH account is zero when using the contract above?
Geth version: 1.4.10-stable-c2eea630 OS & Version: Linux
Transaction 0x19d90f1106c600bd8a70b5775776b4ecdc7a945b should've been successful.
Transaction 0x19d90f1106c600bd8a70b5775776b4ecdc7a945b failed due to lack of gas.
Steps to reproduce the behaviour
transfer(address) function of contract
0x1e143b2588705dfea63a17f2032ca123df995ce0 by sending some amount and limit the amount of gas to
Here is a sample transaction to this contract you can send via the JSON-RPC API: