Tenderly's Optimistic Rollup Network Report is live! 🎉 Explore how optimistic rollups help scale Ethereum ecosystem!

Tenderly

All About Tenderly Sandbox

Take full advantage of Tenderly Sandbox, a doorway to executing Smart Contracts instantly from your browser. From learning Solidity to sharing complex protocol integration, this zero-setup environment gives you everything you need to play with different Smart Contract concepts in just a few clicks.

Nenad Vitorovic
Nenad Vitorovic
Aug 11, 2022 · 6 min read

In this post

All About Tenderly Sandbox

Tenderly Sandbox is an in-browser, ready-made environment that allows you to make the most of Smart Contract experimenting as it eliminates dispensable technicalities for Web3 newcomers and veterans alike. It takes a lot of hassle out of the setup process and enables you to skip a few steps without missing out on learning opportunities.

What’s more, Sandboxes are beneficial beyond the initial steps in Web3. You can use them to share solutions to interesting problems, demonstrate how to integrate with your or others’ complex protocols, and show how to interact with several Smart Contracts. You can even use them as a hack explainer tool.

So, whether you’re ready to dive deeper into Web3 development, work with teammates on improving your or others’ protocols, or illustrate Solidity concepts in practice, Sandbox is a true Smart Contract playground that enables you to get down to business in a click of a button.

What are the elements of a Sandbox environment?

With Sandbox, you have everything you need to jump straight to Smart Contract coding and prototyping. Here’s what awaits you:

  • Up-to-date public network data: The code you’re running in Sandbox is executed against the actual state of a selected public network supported by Tenderly. You can run it at any point in the network's history by configuring the starting block for your Sandbox. This means that your contracts have access to not only the most recent but also historical data without making changes to the actual public network.
  • Solidity space: This is where you can write your Smart Contract(s) from scratch. If you already have a certain starting point, you can paste existing source code and make adjustments for testing or optimization purposes.
  • JavaScript space: Here, you can write JavaScript code that will deploy and interact with your contracts.
  • Configuration: Sandbox gives you different network, compiler, and optimization options and even allows you to choose the exact block number on any Tenderly-supported network. This way, you can execute your Smart Contract under desired circumstances.
  • Blazing fast deployment of Smart Contracts: Your Sandbox environment deploys your contracts to a new Tenderly Fork. Think of it as an isolated test network, based on a particular block of the public network of your choosing, but without the hassle of setting up an actual wallet with test Ether.

    You deploy and verify your contracts on the Fork, so they don’t land on the public network. Similarly, any calls sent to your Smart Contracts also stay inside the Fork, so the executed transactions don’t show up on public networks or block explorers.
  • Immediate (re)execution of JavaScript code: This is where you can write a simple or complex usage scenario for your Smart Contract. The JavaScript code deploys and runs your Smart Contract and you can re-run it by a single push of a button after changing it. Oh, and the time it takes to run several transactions is just a couple of seconds!
  • Execution output: Once you run your JavaScript code, you’ll get the output of its execution – everything you console.logged.
  • List of transactions: After running your Sandbox, it will display a list of the transactions it made.
  • Access to Tenderly Debugger & other features: To understand the execution path of your transactions and resolve any potential failures or bugs, Sandboxes take you immediately to Tenderly Debugger.

    Here, you can go through stack traces, investigate changes your transaction made, and evaluate simple or complex expressions. Simply put, you have access to the same tools you’d use in your live projects.

Why should you use Tenderly Sandbox?

Sandbox, especially in combination with other code editors, can offer significant benefits, enabling you to optimally use your time demonstrating protocol integrations, learning Solidity, or prototyping your Smart Contracts.

Here’s how you can benefit from using Sandbox:

1. You can save time when deploying your contracts. In Sandbox, you immediately deploy your Smart Contracts to a Tenderly Fork. Once again, think of it as an isolated and blazing fast fork of any network. You’re the only one using it, so deployments take no more than a few seconds.

2. You can run your Smart Contract almost instantly. It takes just a couple of seconds to execute the JavaScript code and get the output of your Smart Contract execution since Sandbox is powered by a Tenderly Fork.

3. You get a comprehensive execution context. Sandbox is connected to the Tenderly Dashboard, enabling you to access other features and get the whole picture once you execute your Smart Contract. For instance, you can access Gas Profiler to see which function calls used the most gas and then go back to Sandbox to tweak your code for gas reduction.

4. You can effortlessly find the root cause of bugs and errors: When your Smart Contract runs, you want to understand what it did and why potential errors happened. To streamline this process, Sandbox gives you access to Tenderly Debugger and other tools to understand the wider context and debug an error. For instance, you can break down contract execution to individual expressions and understand what went wrong.

5. You can collaborate with others. If you’re ready to share your work with others or could benefit from another pair of eyes, Sandbox makes this possible in just a few clicks. You could share a Sandbox that contains a solution to a problem, demonstrates how to operate a complex setup of Smart Contracts, shows how to integrate a protocol such as Aave flash loan, or illustrates some other concept.

How does Tenderly Sandbox enable collaboration?

Sandbox offers several options for collaborating with your teammates, mentors, or associates:

  • Cloning: This environment enables you to fork someone’s code and continue working in some other direction. You can pick up where someone else left off and try out some of your solutions.
  • Sharing: Even though your Sandbox is on an isolated Tenderly Fork, you can share it with others if you stumble upon something awesome. This is a great way to get valuable feedback from your team or guidance from more experienced engineers. The best part is, Sandbox is an entirely in-browser feature, so there’s no need to install any additional tooling or do any extra setup.

    Get a shareable link and send it to your teammates or mentor for further input or collaboration. They’ll get the most recent version of your code and any changes they make won’t affect your work. Any changes you make to a shared Sandbox become visible to the people you shared it to as soon as you save them.
  • Workshops: You can use Sandbox to demonstrate protocol integration, war room procedures, or other relevant topics during a workshop. Share examples with your participants, make changes as you go, and allow for practice on the spot.

You’re a Sandbox away from a Smart Contract playground

Tenderly Sandbox allows you to optimally use your time and energy and jump straight to playing around with Solidity. As a user-friendly tool, it paves the way for efficient prototyping, running, and optimizing your Smart Contracts.

Sandbox also enables you to explore different protocols and concepts, while setting aside any additional configuration not necessary in this phase. Plus, it gives you access to Tenderly Debugger and other features out of the box, so the tools you’d use in production are available from the get-go.

And once you’re ready to spread the word, simply share your Sandbox with others. So, ready to get playful?