> ## 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.

# Deploy a contract

> Deploy Greeter on Tavchain Testnet with Remix and MetaMask, read its state, send a contract update and inspect the resulting receipt.

Deploy the [compiled Greeter](https://docs.tavchain.safeney.com/tavchain/write-contract.md) to Tavchain Testnet using Remix and MetaMask, then read and change its greeting.

> [!NOTE]
>
> A [verified Greeter example](https://explorer.tavchain.safeney.com/address/0x065c1c017b8EF74f3B6001b51d188665bA9f4cd1?tab=contract) is available on chain **771002**. Deploy your own instance to follow the tutorial from its initial state; the shared example allows anyone to change its greeting.

## Connect your wallet

1. In Remix, open **Deploy & Run Transactions**.
2. Choose **Browser Extension**, then **MetaMask**. Older versions may call this **Injected Provider** or **Injected Web3**.
3. Approve connecting `app.remix.live` in MetaMask. Unlock the wallet privately if needed.
4. With the Remix tab active, select **Tavchain Testnet** for that connected site in MetaMask. Before deploying, require **Custom (771002)** and your intended account in Remix.

If Remix shows **Main (1)** or another chain, stop before clicking Deploy. Check MetaMask in the same browser/profile as this Remix tab and switch that site's connected network. Reconnect the wallet if the display has not updated, then check the chain again.

Remix's generic balance or fee label may say ETH. On chain **771002**, the native coin is **Test TAV**. Verify the chain ID instead of relying on that label.

If MetaMask is missing, open Remix in the same browser/profile where the extension is installed. A wallet available in another browser is not automatically available to this tab.

## Deploy once

1. Select **Greeter** and confirm it is compiled using the [compiler settings](https://docs.tavchain.safeney.com/tavchain/write-contract.md).
2. Leave **Value** at **0**. This constructor takes no arguments. For the separate verification workflow in this guide, turn off **Verify Contract on Explorers** if Remix displays that switch.
3. Click **Deploy** once.
4. In MetaMask, review Tavchain Testnet, the contract-deployment request and estimated fee. Confirm once.
5. Wait for the successful receipt. Save the transaction hash and the created contract address.

If the result is uncertain, check MetaMask activity and [the receipt](https://docs.tavchain.safeney.com/tavchain/api/transaction.md) before trying again. Repeating deployment creates a different contract and charges another fee.

Use the fee displayed by your wallet before confirming.

## Read the greeting

Under **Deployed Contracts**, expand your Greeter instance. Next to **greet**, click **Call**. The result should be:

```text theme={null}
Hello
```

This is a read-only call and needs no wallet transaction or gas payment.

## Optional: change the greeting

1. Enter `Hello Tavchain` in **setGreeting (string)**.
2. Leave **Value** at **0** and click **Transact** once.
3. Review and confirm that contract interaction in MetaMask.
4. Save the new transaction hash and require a successful receipt.
5. Click **Call** beside **greet** again. It should now return `Hello Tavchain`.

The receipt should include a **ChangeGreeting(address,string)** event with your account and the new text. Another user can change this demonstration contract too; it has no access control.

Read the receipt for the actual gas used and effective gas price.

## Check the explorer

Search your transaction hash in [the explorer](https://explorer.tavchain.safeney.com/). Check success, sender, contract address, block and fee. An indexed deployment does not mean the explorer has verified the contract's source code.

The [reference deployment transaction](https://explorer.tavchain.safeney.com/tx/0x5af18cfbcaf540d8b99e800aa8cb388fb99d4dab3198ebf84e204b906d46beff) created Greeter at `0x065c1c017b8EF74f3B6001b51d188665bA9f4cd1` on chain **771002**. Its [Contract → Code page](https://explorer.tavchain.safeney.com/address/0x065c1c017b8EF74f3B6001b51d188665bA9f4cd1?tab=contract) shows **Contract source code verified (exact match)**.

Use your own returned address when following the tutorial. The shared example's greeting may have changed since deployment.

## Verify the source

Follow [verify a contract](https://docs.tavchain.safeney.com/tavchain/verify-contract.md) to publish your source and enable the explorer's Read/Write contract interface. Verify your own deployment and require an exact source match. Previous verification results do not transfer across a genesis reset.

## Related guides

* [Write and compile Greeter](https://docs.tavchain.safeney.com/tavchain/write-contract.md)
* [Transaction receipts](https://docs.tavchain.safeney.com/tavchain/api/transaction.md)
* [Troubleshooting](https://docs.tavchain.safeney.com/tavchain/troubleshooting.md)


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