The next step for the Tenderly Visual Debugger (pun very much intended)

Today we are launching our brand new Debugger which greatly simplifies debugging Ethereum transactions.

At a glance, you can see the current step in your code for a given transaction and all input and output variable values at that point in time: no more log statements, no more code simulation in your head, no more frustration.

Debugging

First things first: why is this needed so much in the Ethereum ecosystem? We all know bugs are inevitable. Heck, even Thomas Edison wrote about them to his associate Puskas in 1878.

It has been just so in all of my inventions. The first step is an intuition, and comes with a burst, then difficulties arise — this thing gives out and it is then that “Bugs” — as such little faults and difficulties are called — show themselves and months of intense watching, study and labor are requisite before commercial success or failure is certainly reached

If bugs cannot be removed entirely, the only logical step is to make tools that help us reduce the time spent debugging, so we can focus on the important stuff.

The current state of affairs is that debugging is hard. It’s more or less the same as when you start programming: you either use your head as the debugger or if you are writing something like C or JavaScript, you have dozens of printf / console.log statements just so you can reason what is actually happening with your code.

Let’s step into an example (no more puns, I promise)

By the end of this example, I hope you will see the value and speed this Visual Debugger brings to the table.

To showcase the debugger we will create a simple smart contract that is used to track the score of a tennis match.

We call the addPoints function to add points for a player. This means that we expect player A to win the first game if we call the addPoints(0) 4 times. Let’s try it out:

That’s odd: contract.playerAGamesWon() should’ve returned 1 not 0. Let’s open up the debugger and see what happened. I’ve verified this contract so you can follow along at the contracts public listing. Click on the debugger tab and then on the ↓ icon: this will make the debugger jump to the next step in the execution. Instantly we can see that newScore variable is 60 instead of 50.