Let’s say you ran graph init
but you’re unable to auto-fetch ABI. The graph-cli asks you if you want to retry auto-fetching. In this case you can say “no” to every question and the cli will ask you to provide the ABI file path.
Here’s how you can get the ABI file ready.
If you developed the smart contract, it’s very likely you already have the ABI within your smart contract project folder. In the case of hardhat, it would be under artifacts/contracts
.
If it’s a contract that’s verified on the block explorer, you should be able to copy it from the contract tab of the smart contract.
Here’s an example:
https://www.vicscan.xyz/address/0xCB2d7A4f7ac98ba9b2DFE02a88bED1Aef60F7cdC#code
Copy the ABI from the block explorer’s contract page.
Paste it into vs code: