title: Why does an event emitted by a smart contract function called via `delegateCall` disappear?
body: <p>I have two interacting smart contracts that I am developing/testing in Hardhat and deploying to <a href="https://developers.rsk.co/" rel="nofollow noreferrer">RSK</a>:</p>
  <ol>
  <li><code>DelegateCallee</code> smart contract with a <code>getData()</code> function, emitting a <code>Received</code> event:</li>
  </ol>
  <pre><code>contract DelegateCallee {
    event Received(address sender, uint value);
    function getData() external payable {
      emit Received(msg.sender, msg.value);
    }
  }
  </code></pre>
  <ol start="2">
  <li><code>DelegateCaller</code> smart contract which uses Solidity's <code>delegateCall</code> to invoke <code>getData()</code> from the <code>DelegateCallee</code>:</li>
  </ol>
  <pre><code>contract DelegateCaller {
    address callee;
  
    constructor(address _callee) {
      callee = _callee;
    }
  
    function delegateCallGetData() external payable {
      (bool success, ) = callee.delegatecall(
        abi.encodeWithSelector(DelegateCallee.getData.selector)
      );
      require(success, &quot;delegate call failed&quot;);
    }
  }
  </code></pre>
  <p>I am running Hardhat tests to intercept the events emitted by <code>DelegateCallee</code>. When I am invoking <code>getData()</code> directly on the <code>DelegateCallee</code>, the event is being emitted as expected:</p>
  <pre class="lang-js prettyprint-override"><code>  it('getData function on callee should emit the Received event', async () =&gt; {
      const value = ethers.utils.parseEther('1');
      const tx = await delagateCallee.getData({ value });
      await expect(tx)
        .to.emit(delagateCallee, 'Received')
        .withArgs(deployer.address, value);
    });
  </code></pre>
  <pre class="lang-bash prettyprint-override"><code>  Low level calls
      ✔ getData function on callee should emit the Received event
  </code></pre>
  <p>However when I use the <code>DelegateCaller</code> contract,
  invoking its <code>delegateCallGetData()</code>,
  which in turn invokes the <code>DelegateCallee</code> contract's
  <code>getData()</code> function, the <code>Received</code> event is not emitted.</p>
  <pre class="lang-js prettyprint-override"><code>  it('delegateCallGetData function on caller should emit the Received event on the callee', async () =&gt; {
      const value = ethers.utils.parseEther('1');
      const tx = await delegateCaller.delegateCallGetData({ value });
      await expect(tx)
        .to.emit(delagateCallee, 'Received')
        .withArgs(deployer.address, value);
    });
  </code></pre>
  <pre><code>  1) Low level calls
         delegateCallGetData function on caller should emit the Received event on the callee:
       AssertionError: Expected event &quot;Received&quot; to be emitted, but it wasn't
  </code></pre>
  <p>Where is my event lost?</p>