0

whats the difference between using events in my contract to execute something if event is emitted or executing the function when the transaction is mined? Is there any case in which event may be emitted but transaction fails to be mined?

1

Transactions can be started by you or by other users of your contract. In the last case, you have no access to the transaction details directly, instead, you program the contract to emit events so that you can track the activity in the contract, make statistics, or react to what the contract is doing.

Hope this helps

  • Is there any case in which event may be emitted but transaction fails to be mined? – Rajiv Shah Jun 8 '18 at 13:29
  • No, that I know about. If the execution of a function fails, the state is reverted so nothing change and the events are then not emitted – Jaime Jun 8 '18 at 13:42
  • If this solved your question please close the question by accepting the answer – Jaime Jun 8 '18 at 13:58

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.