5

I am trying to figure out how to print values to the console while doing truffle debug <txhash>. So far I have tried using an event called "TestValue", but I am not seeing the output in the console window like so. Does anybody have any insight as to how I can print out a numeric value to the console? I have also looked into logx, such as doing log0(uint256Value) but saw that that is looking for bytes instead of a uint256.

This is the TestValue event that I tried that is not printing the output I am looking for:

enter image description here

Which is the method that I believe is making my contract fail like so:

enter image description here

Greatly appreciate in advance if somebody can help me to see the values being compared in that condition!

1

Now you can easily see the state of local variables pressing v during the debug. Also, you can see specific expression using the watch function.

For more information please read the following very good Truffle tutorial: Variable Inspection: going deeper with the truffle solidity debugger

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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