aergo
aergo copied to clipboard
Discard events from failed protected calls
Suppose this case:
Contract A calls contract B via a protected call (pcall) Contract B emits an event and then fails on an assertion The execution returns to contract A, which continues normally and the transaction succeeds
The event emitted on the failed call to contract B should NOT be present on the receipt
As an example, the failed call could be an ARC1 transfer. If it fails, no event should be added
Case 2:
Contract A --> Contract B --> Contract C
Similar as before
The first call (A -> B) is done via pcall and the second (B -> C) is done via a normal call
If contract C emits an event and succeeds, but contract B fails, then no events from both B and C should be on the receipt
The same applies for both pcall and contract.pcall