# Simulator

Phalcon simulator allows a user to simulate a transaction at an arbitrary position of an arbitrary block. The simulated transaction can be **viewed in Phalcon Explorer and shared with others.**

This feature can be used in multiple scenarios.&#x20;

* Users: Understand the transaction before signing it
* Developers: Debug a transaction
* Security researchers: Simulate and debug an attack transaction

## Launch the Simulator

The simulator can be launched inside a detailed transaction or the landing page of Phalcon Explorer.

&#x20;

* ![](https://2319654293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwxbNGlBc5Kji1KaYLlhe%2Fuploads%2Ft5tNMJrtzPNDeBV90HzR%2Fimage.png?alt=media\&token=82b7b503-45ae-4649-a9f4-2c0445a41436)Network: Select the network. Ethereum, BSC, Arbitrum, Optimism, Avalanche, and Polygon are currently supported.
* Sender: The sender of the transaction (the `from` address)
* Receiver: The target of this transaction (the `to` address)
* Calldata: the detailed call data of this transaction. To facilitate the construction of the calldata, the call data can be specified using the contract ABI.
* Value: the value of this transaction.
* Gas Limit: The gas limit.
* Gas Price: The gas price.
* Use Pending Block: Whether the simulation occurs on the latest block or an old block specified in the `Block Number`. The default value is `False`.
* Block Number: The block number where the transaction simulates.
* Position in Block: The position inside the block.

When launching inside the transaction page, the transaction data is automatically fed into the simulator (and can be changed) for a quick simulation. This is useful when you just want to slightly change the data of an existing transaction, e.g., changing the position inside the block.

<figure><img src="https://2319654293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwxbNGlBc5Kji1KaYLlhe%2Fuploads%2F5jXmE7suWgzzu8S3p62y%2Fimage.png?alt=media&#x26;token=ddde6776-a73c-4c4d-a7e3-eef6bb07ee82" alt=""><figcaption></figcaption></figure>

## Examples

In the following, we will use some examples to illustrate this feature.

### Sending Ether

We can simulate a transaction to send 200 Ether to an address, e.g., from to `vitalik.eth` `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045`to`0xdeadbeef40e59eb8582ff949afb313e09c5815c9.`

<figure><img src="https://2319654293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwxbNGlBc5Kji1KaYLlhe%2Fuploads%2Fl02ZD3kLlXie8Za87WRK%2Fimage.png?alt=media&#x26;token=4d78c12c-16d9-4358-95c2-25a331b44ce3" alt="" width="375"><figcaption></figcaption></figure>

The simulated transaction can be viewed in Phalcon Explorer. The link to this simulated transaction can be shared with friends (the link is valid 48 hours after sharing).&#x20;

<figure><img src="https://2319654293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwxbNGlBc5Kji1KaYLlhe%2Fuploads%2FqNqhBqXcLTENcaBeIWAC%2Fimage.png?alt=media&#x26;token=2830cd69-372e-4ecb-b7af-cacd396e6ebc" alt=""><figcaption></figcaption></figure>

### Sending USDC

<figure><img src="https://2319654293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwxbNGlBc5Kji1KaYLlhe%2Fuploads%2FBsajv6rcXJpyPA0iOGfT%2Fimage.png?alt=media&#x26;token=0d73a653-2291-4f6f-b96e-1e6dff521251" alt=""><figcaption></figcaption></figure>

When the `Receiver` is a contract, our system will get the ABI of the contract if it's verified and show the list of methods. Users can select a method to invoke in the transaction. For instance, the contract is `USDC` contract, and the method `transfer` is invoked to send USDC from the sender to the `to` value of the invocation.&#x20;

If the contract is not verified, a Local ABI can be uploaded. Of course, a raw calldata can also be used.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blocksec.com/phalcon/phalcon-explorer/simulator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
