Skip to content

InvalidAddressError: Address "undefined" is invalid. #4284

Closed Answered by tmm
Neaxic asked this question in Q&A
Discussion options

You must be logged in to vote

Are you using TypeScript? If not, would highly recommend using it so args is automatically inferred.

Based on the code you shared, args is incorrect. The following code should work.

TypeScript Playground

import { useWriteContract } from 'wagmi'

const { writeContract } = useWriteContract()

const switchContractABI = [
  {
    inputs: [
      {
        components: [
          { internalType: 'address', name: 'nftContract', type: 'address' },
          { internalType: 'uint256', name: 'tokenId', type: 'uint256' },
          { internalType: 'uint256', name: 'donorFee', type: 'uint256' },
          { internalType: 'bool', name: 'isERC721', type: 'bool' },
        ],
        internalType: 'str…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Neaxic
Comment options

Answer selected by Neaxic
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