1

Liquidating some tokens on EtherDelta.

Some of the transactions are not successful - they have higher fees than transactions that are successful.

What is the reason for that?

enter image description here

3

Failed transactions send all of the gas available for that transaction (the gas limit) to the miner. It’s kind of a penalty for failed transactions.

Typically transactions will estimate a gas limit based on the operations of that transaction. In Ethereum, gas usage is based on computations executed (opcodes).

Transactions using up all of the gas are most likely caused by a failure in the code, an error thrown. So there was a condition not met, an error in input, etc. Another possibility is that the gas limit is set too low, and all the gas made available (gas limit) is used up before the entire operation has completed.

The message there bad jump destination looks like there’s a problem with the code, this explains Bad jumps: http://martin.swende.se/blog/Devcon1-and-contract-security.html#call_stack_attack

  • 1
    Thank you for explanation. I think that with EtherDelta the thing is - the bid / sell order has been already filled... – Mars Robertson Oct 8 '17 at 7:18
  • So it's best to set the gasLImit to the gasUsage * gasPrice if the gasUsage is known? – Andi Giga Nov 29 '17 at 14:32
  • Yes, you can check other similar past transactions to see how much gas they used. But you also want to give some margin, give some gasLimit cushion. Gas cost is typically pretty low anyways. So for a few cents more, by setting gasLimit a bit higher), you avoid the possibility of the transaction failing because you didn't provide enough gas. That being said, typically a lot of apps should alert you if gas is too low (e.g. Metamask); I don't have too much experience on EtherDelta, so I'm not sure if they have that, but would expect they should. – carlolm Nov 29 '17 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.