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);

  return r;

I'm seeing this in my console (Chrome): enter image description here

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?


2 Answers 2


Adding to the previous answer, use await since all the methods are async.

const r = await bc.methods.ownerOf(tokenId).call();

You didnt actually call:


need to do bc.methods.ownerOf(tokenId).call(blah)

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.