> For the complete documentation index, see [llms.txt](https://x1ecochain.gitbook.io/x1-ecochain-tech-whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://x1ecochain.gitbook.io/x1-ecochain-tech-whitepaper/deploying-on-x1-ecochain/deploy-smart-contract.md).

# 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
