title: How to get emitted events corresponding to sent transaction
body: <p>I want to write smart contract which saves hash value and return identifier of that hash to check saved hash later.</p>
  <p>My contract is like:</p>
  <pre><code>pragma solidity &gt;=0.4.25 &lt;0.7.0;
  pragma experimental ABIEncoderV2;
  
  contract SaveHash {
      event HashSaved(uint id);
      Hash[] hashes;
      function save(Hash memory hash) public {
          // some process
          emit HashSaved(hashes.length - 1);
      }
  }
  </code></pre>
  <p>However, I don't understand how to know event emitted by contract is corresponding to which transaction.</p>
  <p>How can I know by which transaction an event is created?</p>