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 Answer
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?– NamelessJun 8, 2018 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– JaimeJun 8, 2018 at 13:42
-
If this solved your question please close the question by accepting the answer– JaimeJun 8, 2018 at 13:58