0

If I have a frontend app in a server and the contracts are not in there, should I upload the ABI with the app so I can use it or is there a better way to fetch it from the internet?

1 Answer 1

1

Once you deploy a contract, the ABI is not natively available anywhere online. If you just have the contract address, you can only get the ABI by two means:

  1. Reverse-engineer the contract. Not fun nor easy

  2. Get the ABI from a third party service, where the ABI (or source code) was uploaded to. Such as Etherscan. This of course won't work if the ABI (or the source code) wasn't uploaded anywhere

So by far the easiest way is to keep the ABI with your app.

2
  • But if I do have the ABI, the default way to do it is to just upload it with the app, right?
    – Omar
    Commented Oct 22, 2021 at 20:48
  • Yes, upload the ABI with the app. If you don't need the full ABI, ethersjs even lets you import single functions
    – Alex Otsu
    Commented Oct 22, 2021 at 23:26

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.