Fetch the Owner's Wallet Address From a Smart Contract

InstructorRyan Harris

Share this video with your friends

Send Tweet

We don’t want any user to be able to access admin pages. Let’s check if the user’s wallet address matches the address of our connected smart contract.

This can be done by using OpenZeppelin to get the owner address from the smart contract, then comparing that to the currently connected address.

~ 2 years ago

the owner() function is not working? do I have a mistake on my side or did ethers change the ABI?

~ 2 years ago

having the same issue with owner() not working and not being able to verify myself as the owner

Giuseppe Rodriguez
~ 2 years ago

You have to change your network in metamask to rinkeby for the owner method to work.