How to get implement contract's event basing on proxy mode

I'm writing web3 interaction with a proxy contract, however, I could not get the event emit from the proxy contract. I have no idea how to deal with it and there is no document explaining it. Please give some tips

Your question is a bit unclear. Are you not able to get events emitted or not able to listen to events that have already been emitted?

Thanks for replying! @maxareo

I know the web3.eth.filter can help listen to event logs, but it didn't work based on proxy mode. I'm not sure whether did I do something wrong. Would you mind sharing some related guidelines?

In my understanding, proxy and event emission are independent. If you cannot listen to events, it may have nothing to do with proxy.

I agree.
How will you do if you wanna listen event logs based on proxy contract?

well, still unclear about which events. The events in the proxy contract or those in the logic contracts?

1 Like

I am having same kind of issue. The proxy contract calls the logic contract internally and the events are emitted in the proxy contract, not in the logic contract as it should be. But when we check it in the etherscan events section, there are the events with no names. How are we supposed to fetch that?

1 Like

@Parash_Agrawal Have you verified the proxy contract with the implement contract address?

Yes @uua and it works. Thank you.

https://rinkeby.etherscan.io/proxyContractChecker

Hey, what was the solution? I want to listen to events of my logic contract. I am using UUPS and trying to listen to my implementation logic events on the proxy address. I don't know if that works? Should I listen to implementation address?

nvm, i didn't use the --network localhost while deploying contracts on hardhat

Hi, try this method to get the logic event (await updateTx.wait()).events based on hardhat tool.

Context:

LogicContract A {

   uint256 public number1;

   function updateNumber(uint256 a) external {
      number1 = a;

      emit NumberUpdated(a)
   }

  event NumberUpdated(uint256 number1);
}

ProxyContract B {}

call the updateNumber() from proxy with a scripts =>

  const proxyWithLogic = logic1.attach(proxy.address);
  const updateTx = await proxyWithLogic.updateUint(BigNumber.from(2);
  const events = (await updateTx.wait()).events;

  console.log(events![0].args);

Therefore, you can check the call result like:

[ BigNumer { value: "2" }, updatedNumber: BigNumber { value: "2" } ]

hope it's helpful