# How to simulate a transaction and debug it ?
On tenderly you can add any contract and simulate transactions.
**Step 1:** Find the contract you want to interact with, in this example we will use the SushiBar contract. Find the address and enter it in the search bar.

**Step 2:** Add the contract to your project.


**Step 3:** Go in the contract tab and find the contract you just added and click on it.


**Step 4:** Once on the contract page, click on simulate a transaction.

**Step 5:** Select the function you want to call, I will call the enter function which allows to enter in the sushiBar (convert Sushi into xSUSHI). I will enter 1 Sushi in the amount (18 zero = decimals).


**Step 6:** On the right you can change how you want to call the function : You can change the block, the caller, the gas price etc...
I will call with a random empty address I just created.

**Step 7:** We are now on the transaction page. As you can see my transaction was reverted because I don't have any Sushi in my wallet.

**Step 8:** Sometime you will need more details to understand why a transaction failed, you can scroll down and use the debugger. Inside the debugger you can jump up and down between every action and function calls to find where the error happened.
In this example we see that at the moment of the transfer it failed because our amount exceeds our balance.



Good job ! You now are able to simulate and analyze transactions on tenderly. :heavy_check_mark: