The ABI should contain an array of inputs

I get this error. “Invalid ABI, The ABI should contain an array of inputs.”
I tried this but this time I got this error “Invalid ABI, please verify”

ABI I copied from bscscan:

[{"inputs":[{"internalType":"address","name":"_logic","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]

Where do you want to use this abi?

1 Like

ync and watch smart contract events

Ok, you need a simple ABI there, only with the event, and if the names start with _ the you should remove that _ in that abi directly

2 Likes

There is API code on the subject. Can you look at it?

i did this but it gave this error: Invalid ABI, The ABI should contain an array of inputs.

[
  {
    
    "stateMutability": "payable",
    "type": "constructor"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "previousAdmin",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "address",
        "name": "newAdmin",
        "type": "address"
      }
    ],
    "name": "AdminChanged",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "beacon",
        "type": "address"
      }
    ],
    "name": "BeaconUpgraded",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "implementation",
        "type": "address"
      }
    ],
    "name": "Upgraded",
    "type": "event"
  },
  {
    "stateMutability": "payable",
    "type": "fallback"
  },
  {
    "stateMutability": "payable",
    "type": "receive"
  }
]

bscscan APİ code:

[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "_logic",
        "type": "address"
      },
      {
        "internalType": "bytes",
        "name": "_data",
        "type": "bytes"
      }
    ],
    "stateMutability": "payable",
    "type": "constructor"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "previousAdmin",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "address",
        "name": "newAdmin",
        "type": "address"
      }
    ],
    "name": "AdminChanged",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "beacon",
        "type": "address"
      }
    ],
    "name": "BeaconUpgraded",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "implementation",
        "type": "address"
      }
    ],
    "name": "Upgraded",
    "type": "event"
  },
  {
    "stateMutability": "payable",
    "type": "fallback"
  },
  {
    "stateMutability": "payable",
    "type": "receive"
  }
]

It looks like that ABI has more than one event. What is the event that you want to sync?

1 Like

This Contract
Lock event

Ok, you need the ABI for that Lock event then.

1 Like

ABI is here. but it doesn’t work

[{"inputs":[{"internalType":"address","name":"_logic","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"payable","type":"receive"}]

This is one of the events that I see there, I don’t see an event named Lock

1 Like

contract ABI writes in bscscan: https://bscscan.com/address/0x7ee058420e5937496f5a2096f04caa7721cf70cc#code
Can’t I use this?

it looks like the contract that you are looking at is a proxy for this contract: https://bscscan.com/address/0xb9abf98cab2c8bd2adf8282e52bf659adb0260fe#code

how did you find this? How do I find this? I tried copying. but it gave this error: Invalid ABI, The ABI should contain an array of inputs.

if you try to use read functions from that smart contract in bscscan, you will see the address of the real contract

anyway, if you copy all the ABI of the real contract, will still not work, you need only the ABI for the event that you want to sync

there are too many inputs how do i find it?

you copy the entire abi somewhere in a text editor, format it if possible, search the event that you need by name, and then extract only the info for that event

node worked but not pulling transfer
i use this ABI:

{
  "anonymous": false,
  "inputs": [
    {
      "indexed": true,
      "internalType": "uint256",
      "name": "id",
      "type": "uint256"
    },
    {
      "indexed": false,
      "internalType": "address",
      "name": "token",
      "type": "address"
    },
    {
      "indexed": false,
      "internalType": "address",
      "name": "owner",
      "type": "address"
    },
    {
      "indexed": false,
      "internalType": "uint256",
      "name": "amount",
      "type": "uint256"
    },
    {
      "indexed": false,
      "internalType": "uint256",
      "name": "unlockDate",
      "type": "uint256"
    }
  ],
  "name": "LockAdded",
  "type": "event"
}

what you mean by this? did you try with both smart contract addresses?

i tried both but it doesn’t find the transfer

topic: lock(address owner, address token, bool isLpToken, uint256 amount, uint256 unlockDate)

ok, that is not the right topic, it is easier to take the topic in the hash form from an event from bscscan