Invalid ABI, Please verify

Im currently following yalls tutorial on the docs. I’m on the part that is Sync and watch contract events

the part where i enter the abi i keep getting the error “Invalid ABI, Please veryify” im not sure exactly what else to do iv tried going in and copying what i believe is the correct abi but i have no idea?

2 Likes

Hey @camerond33

You have copied the ABI incorrectlyI. All open { } and [ ] should be closed.

Try this:

{
  "anonymous": false,
  "inputs": [
    {
      "indexed": true,
      "internalType": "address",
      "name": "from",
      "type": "address"
    },
    {
      "indexed": true,
      "internalType": "address",
      "name": "to",
      "type": "address"
    },
    {
      "indexed": false,
      "internalType": "uint256",
      "name": "value",
      "type": "uint256"
    }
  ],
  "name": "Transfer",
  "type": "event"
}

I hope I helped you. :nerd_face:

2 Likes

I had a same issue.
But thanks to your answer, I have solved the problem.
Maybe it wasn’t good that I pasted the auto-formatted code by VS Code extension.

2 Likes

We also need to enclose the key in “”.

Be careful, because VS Code’s automatic formatting will erase the “” in the key.

2 Likes

Hi @classlacia

It’s true, you have to be very careful with formatters. I advise you to customize the formatter settings to avoid problems later.

Happy BUIDLing :sunglasses:

2 Likes

Hey Guys - Having the same trouble with the ABI

},
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "buyer",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "askingPrice",
          "type": "uint256"
        }
      ],
      "name": "itemSold",
      "type": "event"
    },

Please remove this extra bracket for resolving the issue in your ABI.

Hope this helps.

1 Like

Thanks a bunch - I was also copying

  "name": "itemSold",
  "type": "event"
}, 

should be
“name”: “itemSold”,
“type”: “event”
}

no , at the end

1 Like

I also had the same issue and it turned out my VS code formatter removed all the quotes from that object, everything is fixed now.

I am having trouble with this also but my contract ABI is very condensed and even when formatted still results in the ABI code being declined

My ABI Code Below

For syncing events you have to extract only the ABI specific to. your event from the entire ABI specific to that smart contract.