Alpha preview. Not for production use.
Working anonymously. to save your work permanently.
Reference

Transaction Simulation

Preview transaction results on deployed contracts before submitting to the network.

What is Simulation?

Simulation lets you execute transactions against real, deployed contracts without actually committing them to the blockchain. It's like a dry run for your transactions.

Use Cases

  • Preview method call results before signing
  • Test interactions with live contracts
  • Debug failing transactions
  • Estimate execution costs accurately
  • Verify transaction groups work correctly

How Simulation Works

When you simulate a transaction:

  1. The transaction is built with all parameters
  2. It's sent to the Algorand node's simulate endpoint
  3. The node executes it against current blockchain state
  4. Results are returned without modifying the blockchain
Note
Simulation uses the current blockchain state. Results may differ if state changes between simulation and submission.

Using Simulation

From the Explorer

  1. Find a contract in the Explorer
  2. Select a method to call
  3. Fill in the parameters
  4. Click Simulate instead of Call

From the Transaction Composer

  1. Build your transaction or group
  2. Click Simulate in the action bar
  3. Review the simulated results
  4. If satisfied, click Submit to send for real

Simulation Results

Transaction Success/Failure

Shows whether each transaction in the group would succeed or fail, with error messages for failures.

Return Values

For ABI method calls, see the decoded return value.

State Changes

Preview what state would be modified:

  • Global state changes
  • Local state changes
  • Box storage changes

Logs

View any log messages emitted by the contract during execution.

Inner Transactions

See any inner transactions that would be created by the contract.

Resource Usage

  • Opcode budget - How much budget was used
  • Fee - Transaction fee that would be charged

Debugging with Simulation

When a transaction fails, simulation helps you understand why:

  • Error message - Shows the assert message or error
  • Program counter - Where in the program it failed
  • Stack trace - Execution trace up to failure
Tip
Compare the simulation trace with your source code to identify the failing assertion or operation.

Limitations

  • State changes - Between simulation and execution, state may change
  • Timing - Timestamp and round number will differ
  • Randomness - VRF-based operations may produce different results

Simulation vs Ghost Testing

Ghost Testing

  • Tests undeployed contracts
  • You control initial state
  • No network required
  • Best for development

Simulation

  • Tests deployed contracts
  • Uses real blockchain state
  • Requires network connection
  • Best for production verification