# Creating and Deploying a Contract

In the File Explorer, create a new file by clicking on the new file icon, and name it.

<figure><img src="/files/ILqQq1jtZD04w5tL7Qhb" alt=""><figcaption><p>New file</p></figcaption></figure>

Write the sample code&#x20;

**Compile the contract:**

<figure><img src="/files/wgd7Ca6MAbQqcandT8MW" alt=""><figcaption></figcaption></figure>

The Deployment Module in Q-Remix IDE enables developers to **deploy**, **interact**, and **manage smart contracts** efficiently, both locally and on-chain. This module is crucial for testing contract behavior and pushing production-ready contracts to the blockchain.

You can access this module by clicking the **deploy icon on the far-left sidebar**.

<figure><img src="/files/aOsih8V1KlH4Cf3bQVZt" alt=""><figcaption></figcaption></figure>

### Deploy & Run Interface Overview

There are three main sections in the ***deploy & run*** section&#x20;

1. **Environment**
2. **Account**
3. **Contract**

> Make sure MetaMask is unlocked and the correct network is selected before proceeding.

<figure><img src="/files/uurTW39qr7HBR9Q3kC9A" alt=""><figcaption></figcaption></figure>

For now Q-Remix IDE supports the first two options

1. Q-Remix VM: Uses Hardhat to generate 10 test addresses with 10,000 ETHs in each address. The user can switch the addresses anytime and test or deploy with them. The states of each of the contracts remain the same even after refreshing the entire page. This ensures that no progress made is lost during the session. However, if the session is closed all the accounts are reset to have the original 10,000 ETHs.
2. Injected Provider MetaMask: This connects the wallet metamask with the remix IDE allowing teh contracts to be deployed either Mainnet or in the Testnet.<br>

   <figure><img src="/files/3LHb73Ej9UZbiFyfBzfG" alt=""><figcaption></figcaption></figure>

After giving your MetaMask password, the selected address or account will be reflected in the Account section of the Deploy & Run&#x20;

<figure><img src="/files/9HaxuCCT11SScp1tGcCe" alt=""><figcaption></figcaption></figure>

##

You can choose any available account for deploying or interacting with contracts.<br>

<figure><img src="/files/OqCSeBYEtqq4YlX4LwXR" alt=""><figcaption></figcaption></figure>

For deploying the selected contract one can use any of the accounts. In the above example one contract has been deployed using the first account.

> Always **review your code** and **verify constructor arguments** before deploying on a live network.

<figure><img src="/files/sdXvT1K9TKHHfyFyAwNV" alt=""><figcaption></figcaption></figure>

One must review the code or understand the code before completely deploying it on the chain.

Once the contracts has been selected, clicking on the deploy button would deploy the contract on the said chain or network. The details of the deployment including the contract address would be shown on the terminal&#x20;

<figure><img src="/files/tYoY4ZJKRWdPQXCikIyW" alt=""><figcaption></figcaption></figure>


---

# 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.qremix.org/guide/creating-and-deploying-a-contract.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.
