1

I have a simple contract that emits two events when the purchase function is called.

contract OwnedToken {
   ...

   function purchase(tokenId) public payable{
       ...
       FirstEvent(...);
       ...
       SecondEvent(...);
       ...
   }
   ...
}

I tested it on Rinkeby network and logs for both FirstEvent and SecondEvent seem to have same transactionHash & blockNumber.

Is it guaranteed to have same transactionHash for both above event logs even in the MainNet?

1 Answer 1

1

Yes, both events will have the same transactionHash: they are both triggered by the same, single transaction. This example assumes that there is no conditional logic that might only emit one of the events.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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