Comment on page
Debugging Instrumented Code
We are working on adding more tooling for debugging your instrumented code. At the moment there are several guidelines to help you if you get stuck:
- 2.Use descriptive user-readable labels and look at emitted events to understand which property failed.
- 3.If you are using event-based assertions mode, you can use the
--debug-eventsoption, which will emit an additional event for each failure that holds the values of primitive variables appearing in the event.
- 4.If you have added contract-wide invariants and your contracts are failing to be deployed, be aware that contract-wide invariants are checked at the end of constructors. So if your invariant doesn't hold at the end of the constructor, it will prevent it from being deployed. If you are having trouble deploying instrumented contracts with invariants, you should also read the section on external calls in invariants.
- 5.Be aware of cases where your invariant evaluation itself may cause a failure. Specifically if you are using the division opreator or calling some
viewfunction which may fail under some conditions.