(Advice Needed) Debugging Dapps

Hello everyone,

Any advice on how to debug a dapp’s smart contract more efficiently while developing your front/backend?

If I run into an issue (e.g. developing a frontend, executing a function via UI and metamask throws an error) than I have to assume its a “require” error (I have verified the functions of the smart contract behave as expected via manual/unit tests).

This usually helps in solving the issue I’m having. However, I have run into an issue where everything seems to be correct and I still receive an error.

Typically when this happens, I reset metamask, log out of metamask, reset truffle develop, and re-deploy my smart contract. Unfortunately, I still receive the same error.

Before I post my issue with code on the forum, I would like to know if I have done all I could to resolve the issue. One method I would like to know more about is Debugging. I have not found an efficient way of debugging this process without manual intervention. I would appreciate any help/direction.

Thank You.

Before debugging with Metamask (which is very difficult…), I would write tests with Truffle for the action I am trying to execute, run the tests and make sure they pass.

Then I would try to reproduce the same steps but from the frontend with Metamask, and make sure that the correct parameters are passed.

For debugging in Solidity, there is a section in Dapp 30 specifically on this.

Let me know if that answers your question.

1 Like