The newest Transparent Proxy from Openzeppelin deploys the admin contract by itself and emits an event from where we can find the admin contract's address.

This event is emitted during the deployment transaction, along with 3 other events. Here is an example of the transaction

How should I fetch and parse that event from the transaction receipt to get the admin address, just after deployment?

1 Answer 1


Following code will do your work

const { ethers } = require("ethers");
const ABI = <Contract ABI>
const rpcProvider = new ethers.JsonRpcProvider(
  <rpc url>

async function getEventFromReceipt(provider, abi, tx, topic) {
  const receipt = await provider.getTransactionReceipt(tx);
  const iface = new ethers.Interface(abi);
  const logs = receipt.logs.filter((log) => log.topics[0] === topic);
  const log = logs.map((log) => iface.parseLog(log));
  return log[0].args[1];

).then((newAdmin) => {
  console.log("New Admin", newAdmin);

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.