In Web 3, debugging errors is a time-sensitive task, especially when hacks and exploits happen. A quick response is particularly important in DeFi as hacks target high-value assets. Such events require a fast, coordinated War Room protocol that outlines steps you and your team can take to address the issue.
This is exactly what the Tenderly War Room Aid Kit brings – a structured, precise, and fast procedure for finding the issue, debugging the error, and mitigating potential consequences.
What are Tenderly War Rooms?
The War Room Aid Kit comprises a set of Debugger functionalities available along with other Tenderly features. More specifically, the aid kit consists of Call Trace, Evaluate Expression, and Annotation and Prioritization options. These functionalities provide an essential framework for you and your team, allowing you to address potential exploits, hacks, and Smart Contract bugs in a quick and straightforward way.
Why you need the War Room Aid Kit
In time-sensitive War Room situations, speed and coordination are critical for saving funds and minimizing damage, which is where War Rooms come in. With this aid kit, you can expect the following:
- Accessible and comprehensive information relevant to the transaction(s) you’re analyzing
- A structured framework that guides you throughout the process, from diagnosing to debugging the issue
- Easy communication with your team members so you can coordinate your efforts and identify the cause of the problem
- Access to the Tenderly Debugger where you can further inspect a potential problem
- An in-depth view of transaction expressions where you can evaluate relevant parameters
How to set up an emergency protocol using War Rooms
War Rooms consist of 3 important functionalities that can help you establish a framework for analyzing and debugging Smart Contract issues. Here’s how to create a war room procedure your team can use when investigating one or multiple transactions on more than 20 networks Tenderly supports.
Use Call Trace to filter out calls
The Call Trace functionality is particularly useful in the event of exploits since they’re usually caused by external calls. The feature allows you to navigate through the list of transaction calls in less than a second.
In the Execution Trace section, you’ll find a dropdown menu next to the search bar. By default, it’s set to Function Trace, showing all the external and internal calls that happened in the transaction you’re examining.
Instead of going through all the listed transactions in the Execution Trace, you can use Call Trace to filter out external calls. Simply choose Call Trace in the drop-down menu, narrowing the list down to external calls. This way, you instantly gain a quick and clear overview and can identify potential starting points for further analysis and debugging.
Dive deeper using Evaluate Expression
After narrowing down the list of calls to those that might be causing the problem, you can dig deeper into a transaction using Evaluate Expression. This feature significantly simplifies the debugging process by allowing you to inspect any state of your transaction in a human-readable format. It’s currently supported for Solidity contracts, but it will become available for Vyper contracts in the near future as well.
Evaluate Expression also enables you to understand the whole context of the transaction by allowing you to evaluate parts of the code, including functions, conditions, global and local variables, and complex expressions. By dissecting the code, you can identify the issue quickly and take steps to come up with a solution.
Once you’ve identified the external call you want to inspect, you can click “View in Debugger” and then hit the Evaluate button.
You can also find this feature by accessing the Transaction section, clicking the Debugger tab, and then using Evaluate Expression.
Choose any expression you want to evaluate, paste it into the box, and finally hit the Evaluate button to decode the expression. The feature works for both simple and complex expressions.
Get down to business with Annotation & Prioritization
Throughout the process, you need to work closely with everyone in the war room. In these situations, each Web3 expert assumes a specific role, but you need to coordinate your efforts to address the problem efficiently. This requires open and clear communication, which is possible through the Annotation and Prioritization functionality in Tenderly War Rooms.
Annotation allows you to leave comments directly to the lines of code. It enables you to coordinate with your team members, draw their attention to specific lines of code, or leave reminders for yourself, providing direction for further debugging.
Setting priorities can help you further streamline debugging and guide your team through the process. You can set different levels of priority (high, medium, and low) for the call traces you and your team need to examine. Flag the issues that need your immediate attention and even leave comments instructing your team how to proceed.
Tenderly is with you in the war room
Dealing with time-sensitive War Room situations can be highly challenging, especially in the Web3 space where there’s a lot at stake and a complex architecture behind every issue. At Tenderly, we want to facilitate this process for developers, equipping them with an effective aid kit when they need it the most. With the right team of experts and well-developed tooling, a sense of urgency is nothing but a form of motivation to solve the problem and prevent it from happening again.