# Deploy smart contract

### Deployment Process Overview

When you deploy a Solidity contract, here's what happens:

1. **Compilation**: Your `.sol` file is compiled into bytecode and ABI (Application Binary Interface)
2. **Transaction Creation:** A deployment transaction is created with the bytecode as data
3. **Gas Estimation:** The network estimates gas costs for contract deployment
4. **Transaction Broadcast:** The transaction is sent to the blockchain network
5. **Mining/Validation:** Miners/validators process the transaction and execute the contract creation
6. **Contract Address Generation:** A unique contract address is generated and returned
7. **Contract State:** The contract is now live on the blockchain at its assigned address

### Popular Deployment Tools:

#### 1. **Remix IDE**

* **Type:** Browser-based IDE
* **Best for:** Beginners, testing, quick deployments
* **Features:** Built-in compiler, one-click deployment, MetaMask integration
* **Usage:** Write contract → Compile → Deploy tab → Select environment → Deploy

#### 2. **Hardhat**

* **Type**: Development framework
* **Best for**: Professional development, complex projects
* **Features**: Local blockchain, testing suite, deployment scripts, plugin ecosystem
* **Usage**

```
npx hardhat compile
npx hardhat run scripts/deploy.js --network mainnet

```

#### 3. **Foundry**

* **Type**: Fast development toolkit
* **Best for**: Advanced developers, testing-focused projects
* **Features**: Rust-based, extremely fast compilation, advanced testing
* **Usage**:

```
forge build
forge create --rpc-url https://nubica-rpc.x1eco.com --private-key $PRIVATE_KEY src/Contract.sol:Contract

```

### Quick Tips:

* Always test on testnets (Nubica) before mainnet
* Keep your private keys secure
* Verify contracts on block explorers for transparency
* Consider gas costs and network congestion when deploying


---

# 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://x1ecochain.gitbook.io/x1-ecochain-tech-whitepaper/deploying-on-x1-ecochain/deploy-smart-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.
