> ## Documentation Index
> Fetch the complete documentation index at: https://developers.stellar.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Contract Explorer

> Explore and interact with deployed Stellar smart contracts through a browser-based interface. View contract specs, source code, storage, build info, version history, and invoke contract methods directly.

The [Contract Explorer](https://lab.stellar.org/smart-contracts/contract-explorer) is your primary interface for examining deployed smart contracts on the Stellar network. Through an intuitive browser-based interface, you can access comprehensive insights into [contract specifications](#contract-spec), [source code](#source-code), [storage state](#contract-storage), [build information](#build-info), [version history](#version-history), and [client bindings](#bindings) — plus [invoke contract](#invoke-contract) methods directly without any command-line tools.

> [!WARNING]
>
> RPC URL is required to view the contract information. You can update or set the RPC URL in the network selector in the top right corner. See [RPC Providers](https://developers.stellar.org/docs/data/apis/rpc/providers.md).

![Lab: Contract Explorer](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-contract-explorer.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=f2bfa13805e67a5ee3b22cf1517790b1)

## Getting Started

To explore a contract:

1. Navigate to the [Contract Explorer](https://lab.stellar.org/smart-contracts/contract-explorer)
2. Select your network `Testnet` or `Mainnet`
3. Enter a contract ID
4. Browse through the tabs to familiarize yourself with the contract's structure and capabilities

Let's load `CAJJZSGMMM3PD7N33TAPHGBUGTB43OC73HVIK2L2G6BNGGGYOSSYBXBD` contract ID on the `Mainnet` network, and see what we can learn about it.

## Contract Info

In the "Contract Info" section, we can view the date when the contract was created and the creator's Stellar address. It also displays the Wasm hash and GitHub repository, along with a link to the source code of this contract. Also, you can see how many contract storage entries this contract has.

![Lab: Contract Explorer: Contract Info](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-contract-explorer-info.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=c48e6346c47d6537f0f4aad4c15577e5)

## Contract Spec

In this section, you can view [Contract Meta](https://developers.stellar.org/docs/learn/fundamentals/contract-development/overview.md#contract-meta), [Contract Env Meta](https://developers.stellar.org/docs/learn/fundamentals/contract-development/overview.md#environment-meta), and [Contract Spec](https://developers.stellar.org/docs/learn/fundamentals/contract-development/overview.md#contract-spec) from the Wasm file. You can view each section in `Interface`, `JSON` or `XDR` formats, by selecting the type from the dropdown in the top-right corner of the editor view. You can also download each section individually in the chosen format (the download button is located next to the type dropdown), or download the entire Wasm file by clicking the "Download Wasm" button at the bottom of the section.

![Lab: Contract Explorer: Contract Spec](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-contract-explorer-spec.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=3c47a812b35d5b24b9b54436e5c192dc)

## Source Code

In the code editor, you can view the `README.md` file of the smart contract repository. You can further explore the code by opening it in a Dev Container, Codeanywhere, or by using the GitHub link (see the dropdown in the top right corner of the editor view).

![Lab: Contract Explorer: Source Code](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-contract-explorer-source.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=26ced75a4df2eb715046adf48f2c8a26)

## Contract Storage

This section displays all stored data entries for the smart contract in a human-readable format. The data can be filtered by `Key` and `Value`, sorted by `Durability`, `TTL`, or `Updated` columns, and exported in either `XDR` or `JSON` formats.

![Lab: Contract Explorer: Contract Storage](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-contract-explorer-storage.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=390b1ed32415bdd3a59132c191340a91)

### Restore Footprint

Archived storage entries can be restored by clicking the `Restore` button next to the entry.

![Lab: Contract Explorer: Contract Storage Restore](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/stellar-lab-restore.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=df5fbf558ee5dca389ef3ce56810cd41)

This action redirects you to the [Build Transactions page](https://lab.stellar.org/transaction/build) with a `RestoreFootprintOp` operation automatically configured with the necessary parameters to restore the archived footprint.

![Lab: Contract Explorer: Contract Storage Restore in action](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/restore-footprint.gif?s=d6d86baca85f3eba4cda85cd470a5318)

> [!TIP]
>
> Verify that the prepared Soroban Transaction XDR includes the contract data you want to restore in its `footprint.read_write` resources, and confirm that both read and write bytes are non-zero.

## Build Info

If the smart contract has build verification configured (following the [Contract Source Validation SEP](https://github.com/orgs/stellar/discussions/1573)), this section displays information from the GitHub attestation.

> [!NOTE]
>
> "Build Verified" only means that the GitHub Action run has attested to have built the Wasm, but does not verify the source code. Always make sure you fully understand what the smart contract does before using it.

![Lab: Contract Explorer: Build Info](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-contract-explorer-build.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=be5251e87b2467205e770c08885231d8)

## Version History

In this section, you can find the Wasm history of changes.

![Lab: Contract Explorer: Version History](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-contract-explorer-version.png?fit=max\&auto=format\&n=hmWBKBicbGG4DTu6\&q=85\&s=d6ecc5ef9b09e1da4b14196f3117263a)

## Bindings

Bindings are a feature of the [Stellar CLI](../../cli) that generate fully typed client libraries for your smart contracts, tailored to your chosen programming language, including TypeScript, JSON, Rust, Python, and Java. This makes it easy to integrate Stellar contracts into your application as if they were native modules. Each binding provides type-safe functions corresponding to your contract’s methods. To learn more about generating bindings, please see the [Stellar CLI’s bindings command](https://developers.stellar.org/docs/tools/cli/stellar-cli.md#stellar-contract-bindings).

## Invoke Contract

The Invoke Contract page lets you interact with smart contracts directly through the web interface—no command-line tools or custom scripts required.

> [!WARNING]
>
> A connected wallet is required to invoke the contract.

### How to Use

1. **Connect Your Wallet**: Choose to connect a browser wallet by clicking "Connect Wallet" in the top right corner.
2. **Select the network**: `Testnet` or `Mainnet` in the top right corner.
3. **Enter Contract Details**: Provide the contract ID
4. **Select a Function**: Choose which contract function you want to invoke from the available options.
5. **Fill in Parameters**: Enter the required parameters for your selected function. Lab provides type hints based on the [Contract Spec](#contract-spec).
6. **Simulate**: Simulate the transaction to get the correct fee amount and see the result before submitting to the network. By default, you'll see the result of the invoked function. If you want the full response of the invoke contract, simply toggle "Show full response".
7. **Submit**: Only use this when it's a `Write` operation and you want to change the data on the network.

![Lab: Contract Explorer: Invoke Contract](https://mintcdn.com/stellardevelopmentfoundation/hmWBKBicbGG4DTu6/assets/lab/lab-contract-explorer-invoke.gif?s=9344e90e113e06cf3b0bced90171aaef)

> [!NOTE]
>
> Once you simulate the function, you will see a tooltip that says either `Read` or `Write` next to the title of the function you invoked. When a transaction doesn't change the state of the contract, it is considered a `Read` operation. In this scenario, it is not necessary to submit the transaction to the network, as it does not modify any data. You can simply simulate the transaction to see the results without incurring any costs.

### Use Cases

* **Testing**: Quickly test contract functions during development without deploying test scripts
* **Debugging**: Investigate issues by invoking functions with different parameters and examining outputs
* **Education**: Learn how contracts work by exploring and invoking public contracts
* **Prototyping**: Experiment with contract interactions before building full applications
