> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tavchain.safeney.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify a contract

> Publish your Solidity source on Tavchain Testnet's explorer, match the original compiler settings, and read your verified contract without a wallet.

Verify your deployed Tavchain contract so developers can inspect its source and use the explorer's **Read/Write contract** interface. Verification checks that compiled source corresponds to deployed bytecode. It does not audit the code.

> [!NOTE]
>
> The [Greeter reference contract](https://explorer.tavchain.safeney.com/address/0x065c1c017b8EF74f3B6001b51d188665bA9f4cd1?tab=contract) is verified on chain **771002**. Use your own deployment address when verifying your contract.

## Before you begin

Complete [write and compile](https://docs.tavchain.safeney.com/tavchain/write-contract.md) and [deploy and interact](https://docs.tavchain.safeney.com/tavchain/deploy-token.md). Keep your contract address, original source files and compiler settings.

Verification publishes your source. Review the files before submitting, including imported sources. Never include a seed phrase, private key or credential. The existing hosted Blockscout verifier processes verification requests.

You do not need a wallet connection, transaction or Test TAV payment to verify source or read contract state.

## Verify through the explorer

1. Open [Tavchain's explorer](https://explorer.tavchain.safeney.com/) and search for your deployed contract address.
2. Open **Contract**, then **Verify & publish**.
3. Select a verification method. Use **Solidity (Single file)** for the tutorial's standalone Greeter source. Use **Solidity (Standard JSON input)** when you have the original compiler input, particularly for contracts with imports.
4. If you declare a license, use the one that actually applies to your source.
5. Complete the selected form with the settings used for deployment, then click **Verify & publish**.
6. Wait for the result. Open **Contract → Code** and check the verification message, contract name, source and compiler settings. For this tutorial, require **Contract source code verified (exact match)**.

An indexed transaction or visible bytecode alone does not establish source verification.

### Single-file Greeter

Paste the original source from [write and compile](https://docs.tavchain.safeney.com/tavchain/write-contract.md) without editing it. Use these values only if you deployed with the tutorial's settings:

| Setting | Tutorial value |
| - | - |
| Contract | Greeter |
| Compiler | `v0.8.21+commit.d9974bed` |
| EVM version | Shanghai |
| Optimization | Enabled |
| Runs | 200 |
| Constructor arguments | None |
| External libraries | None |

A contract using other settings needs its own original values. Solidity's metadata also depends on source filenames and contents; retain both when you need an exact match.

### Standard JSON input

Upload the Solidity **Standard JSON input**, including the original source filenames, source contents and compiler settings. Select the exact compiler version separately in the form. Source entries must contain literal `content`, rather than only URLs.

The input is different from a compiler output file, ABI, deployed bytecode or metadata file. Do not rename source entries or change optimizer/EVM settings to match this tutorial if your deployment used different values.

See [Solidity's compiler input format](https://docs.soliditylang.org/en/v0.8.21/using-the-compiler.html#input-description) and [Blockscout's verification instructions](https://docs.blockscout.com/devs/verification/blockscout-ui).

## Verify with Hardhat

The [Hardhat starter](https://docs.tavchain.safeney.com/tavchain/hardhat.md) provides separate configurations for deployment and source verification. From starter version 2, verify without unlocking a signing key:

```bash theme={null}
npx hardhat --config hardhat.verify.config.ts verify blockscout --network tavchain CONTRACT_ADDRESS 1000000000000000000000
```

Replace `CONTRACT_ADDRESS` with your deployment. The constructor argument above applies only to the starter's 1,000-GLD example; use your own original arguments for another contract.

Verification does not require unlocking a signing key. The separate configuration preserves compiler/plugin/explorer settings while using a keyless HTTP connection. Selecting the deployment configuration can unnecessarily request `TAVCHAIN_PRIVATE_KEY`; do not provide a key just to verify source.

Keep the original npm build artifacts when verifying a Hardhat deployment. Remix and npm imports can produce different metadata.

## Read the verified contract

Open **Contract → Read/Write contract**. Expand **greet** to read the current greeting. The **Read** control can refresh it without a wallet signature or gas payment.

The **setGreeting** method changes state. Using it requires connecting your wallet and reviewing a transaction, as explained in [deploy and interact](https://docs.tavchain.safeney.com/tavchain/deploy-token.md). The demonstration contract allows anyone to change its greeting.

## Example contract

Open the [verified Greeter example](https://explorer.tavchain.safeney.com/address/0x065c1c017b8EF74f3B6001b51d188665bA9f4cd1?tab=contract) at `0x065c1c017b8EF74f3B6001b51d188665bA9f4cd1` on chain **771002**. Its [deployment transaction](https://explorer.tavchain.safeney.com/tx/0x5af18cfbcaf540d8b99e800aa8cb388fb99d4dab3198ebf84e204b906d46beff) succeeded, and the explorer reports an exact source match. The source file is `Greeter.sol`, compiled with Solidity `v0.8.21+commit.d9974bed`, Shanghai, optimization enabled and 200 runs.

This shared contract allows anyone to change its greeting. Its current value may differ from a tutorial's expected initial value. To verify your own instance, retain and submit its original filenames and compiler input.

## If verification fails

* Confirm you selected the correct network and contract address.
* Match the full compiler version, optimizer settings and EVM target used at deployment.
* Check source contents, filenames, imports, library addresses and any constructor arguments.
* For Standard JSON, upload the original input rather than compiler output or metadata.
* If the request result is unclear, check the contract page before submitting again.

You do not need to redeploy a contract to fix a verification-input mismatch.

## Related guides

* [EVM contract workflow](https://docs.tavchain.safeney.com/tavchain/contracts.md)
* [Write and compile Greeter](https://docs.tavchain.safeney.com/tavchain/write-contract.md)
* [Deploy and interact](https://docs.tavchain.safeney.com/tavchain/deploy-token.md)
* [Transaction receipts](https://docs.tavchain.safeney.com/tavchain/api/transaction.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.