Using Truffle framework, you can debug any transaction with Truffle's debug command. To run truffle in debug mode, there are some requirements that you need to fulfill:
- If you are running Ganache, it should be running in verbose log mode. However, verbose logs are not much helpful in debugging the transactions manually. Its useful for truffle debug mode to read and parse the logs. You can run ganache-cli with -v flag to run Ganache in verbose log mode.
- The full contract code should be available.
- The ID of the transaction that you want to debug should be known. To find out the ID of a transaction that is not working as per your expectations with test cases, you can stop the test case when it fails and can find transaction ...