How to read the address of the proxy admin in UUPS

Hi everyone, I'm trying to read the address of the proxy admin of a contract but I'm struggling with it. I have deployed contract in mumbai at this address: 0x49f8B27A40659898F4B3707F038BE6134Fa02589.

I'm using hardhat console to read the value of the address for the proxy admin with this command:

> await ethers.provider.getStorageAt("0xf2A68A4aD717c0e21Fa88bA4401EcBB0202E6A94", "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103")

It returns this value here:


How can I translate this return value to a readable address?

You can just use erc1967.getAdminAddress(proxyAddress: string) from the Hardhat Upgrades plugin.

Here is how that function converts it into a readable address: