Skip to content

useContract with provider issues #101

Answered by lsbyerley
lsbyerley asked this question in Q&A
Discussion options

You must be logged in to vote

okay so i think the problem is the signerOrProvider prop is misleading. You have to pass the signer from the useSigner hook. The provider from useProvider does not work.

The following works:

const [{ data: signerData, error, loading }, getSigner] = useSigner();

const contract = useContract({
    addressOrName: RINKEBY_CONTRACT,
    contractInterface: contractJSON.abi,
    signerOrProvider: signerData,
  });

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tmm
Comment options

tmm Jan 23, 2022
Maintainer

@lsbyerley
Comment options

Answer selected by lsbyerley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants