I'm writing a React app that calls to see who the owner of a tokenId is.
I am trying to call the built-in function ownerOf(uint256 tokenId) from the ERC721 contract.
Here is my javascript code:
const GetOwnerOf = async (tokenId) => {
console.log(`Getting owner of ${tokenId}`);
const bc = new web3.eth.Contract(bannerContractABI, bannerContractAddress);
const r = bc.methods.ownerOf(tokenId);
console.log(r);
return r;
}
I'm seeing this in my console (Chrome):
I have confirmed that the contract ABI is correct and the contract address is correct.
How do i retrieve the data? The ownerOf function returns an address, how do i view this address?
.