Is there a convenient way to view the contents of a variable while debugging? Similar to other tooling, like the python debugger in pycharm, or the lldb debugger in Xcode.
The forge debugger has a section for EVM memory, but it's represented as bytes.
The testing framework has verbose options that allow function results to be shown, but only at the level they are called in the test method. For instance, in this basic example the result of calledFromTest
is viewable, but not _calledInternally
. How would I know the contents of value
if the right side of the expression was more complex?
// Example.sol
contract Example {
function calledFromTest() public view returns (uint256) {
return _calledInternally() + 10;
}
function _calledInternally() internal view returns (uint256) {
uint256 value = 12;
return value;
}
}
// Example.t.sol
contract ExampleTest is Test {
Example internal example;
function setUp() public {
example = new Example();
}
function testExample() public {
example.calledFromTest();
}
}