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:

0x00000000000000000000000008dd827efaae7501cc9156f3cb75845a7a49bc99

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: https://github.com/OpenZeppelin/openzeppelin-upgrades/blob/d446a47a4f9c9bacefd0f9ac7d7fc8cfa0888ed5/packages/core/src/utils/address.ts#L9