0

Everytime I try to register my UpKeep on Chainlink Automation, I get this error, "ABI must be of type { "name": string, "inputs": { "name": string, "type": string }[] }[]".

The ABI is,

[
    {
      "inputs": [],
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "stateMutability": "payable",
      "type": "fallback"
    },
    {
      "inputs": [],
      "name": "getAmpleforthPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getBitcoinPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getBritishPoundPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "uint8",
          "name": "",
          "type": "uint8"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getChainlinkPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getEtherPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getEuroPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "uint8",
          "name": "",
          "type": "uint8"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getGoldPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getKorunaPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "uint8",
          "name": "",
          "type": "uint8"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getStakeStarPoR",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getSynnexPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "uint8",
          "name": "",
          "type": "uint8"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getYenPrice",
      "outputs": [
        {
          "internalType": "int256",
          "name": "",
          "type": "int256"
        },
        {
          "internalType": "uint8",
          "name": "",
          "type": "uint8"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "stateMutability": "payable",
      "type": "receive"
    }
  ]

Please, can anyone help?

1
  • Hi Vidhan, can you edit your question and share the solidity code of your contract?
    – Frank Kong
    Feb 2, 2023 at 14:52

2 Answers 2

0

I converted your ABI file to an interface and find all functions in the interface are view functions, which means that no state will be modified when these functions are called. Solidity codes are shown below:

interface GeneratedInterface {
  function getAmpleforthPrice (  ) external view returns ( int256, int256 );
  function getBitcoinPrice (  ) external view returns ( int256, int256 );
  function getBritishPoundPrice (  ) external view returns ( int256, uint8 );
  function getChainlinkPrice (  ) external view returns ( int256, int256 );
  function getEtherPrice (  ) external view returns ( int256, int256 );
  function getEuroPrice (  ) external view returns ( int256, uint8 );
  function getGoldPrice (  ) external view returns ( int256, int256 );
  function getKorunaPrice (  ) external view returns ( int256, uint8 );
  function getStakeStarPoR (  ) external view returns ( int256, int256 );
  function getSynnexPrice (  ) external view returns ( int256, uint8 );
  function getYenPrice (  ) external view returns ( int256, uint8 );
}

Chainlink automation is not designed to call view functions. Try to add a non view functions in your contract and you can go to next step.

If you have any use case where view functions are supposed to be called by Chainlink automation, please share the use case and we can see how to design the process.

Hope it helps!

0

I encountered the same error while attempting to register a time-based keeper for a proxy contract. The issue lies in the fact that the ABI cannot be automatically verified, necessitating manual provision. Specifically, I encountered the error when compiling with the ABI of the TransparentUpgradeableProxy contract.

The specific error message is as follows:

"ABI must be of type { 'name': string, 'inputs': { 'name': string,
> 'type': string }[] }[]."

Here are the addresses for the smart contracts that I have hosted on Sepolia:

  • Proxy Admin: 0x4f64157434aaA2296dc9F6c7199bc5D0a129B417
  • Implementation: 0x158fa258C8715C5A3bDb48ae8384972303e22353
  • TransparentUpgradeableProxy: 0x8Df6700E99950991F73a7C5CE23bbEC6D8cC9dAB

Furthermore, I have included one of the Perform Upkeep transaction hashes for your reference: 0x5c433cdc2680ba0f82e5de42d6c5da01559a759d94055bd72bb90b4c0db3882a.

The answer is use Implementation contract ABI for the TransparentUpgradeableProxy contract address

1
  • Hi! Thanks for answering. You may want to specify that while this could be a useful answer for others experiencing this error, it doesn't seem to directly answer the OP's q since OP never mentions anything about a proxy and the ABI is not a proxy ABI. Nov 8, 2023 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.