1

I am developing a Javascript SDK to allow for integration of external services with our Dapp. The SDK calls the smart contracts' methods and therefore needs to know contracts addresses and ABIs.

Some contracts are upgradable so their addresses and ABIs may change in the future.

What would be the best solution? 1) Hardcode addresses and ABI inside the SDK (in a json file) and release a new version of the SDK every time a contract is updated 2) Let the SDK fetch addresses and ABI's from the server (this would require an async initialization of the sdk)

1 Answer 1

1

Kind of depends on how those external services interact with your DAPP, do they just use the blockchain ? if so, to protect their user's privacy, i'd say bundle the addresses and ABI inside the SDK. As a dev that focuses on privacy i'd love you for that choice.

If they do query your centralized server, and that server has to be there, then it makes sense to let the SDK fetch them from there.

Your Answer

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

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