Skip to content

passing args into useContractWrite #230

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

You must be logged in to vote

nvm i got it

const [{ data, error, loading: waitForSignature }, write] = useContractWrite(
        {
          addressOrName: TOKEN_ADDRESS,
          contractInterface: Token.abi,
        },
        "approve",
        { args: [CONTRACT_ADDRESS, VOTE_TOKEN_AMOUNT]}
      );

pass the arguments into args as an actual array, not an array of objects

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bguan2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant