> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/getting-started/quickstart.md).

# Quickstart

Deploy your first Solidity contract on Rome in under 5 minutes.

Deploy your first Solidity contract on Rome in under 5 minutes. This guide targets [**Hadrian**](/networks/hadrian.md), the public testnet chain. [Rubicon](/networks/rubicon.md) is the mainnet chain, where gas is real USDC; try everything on a test chain first.

## Prerequisites

* [Node.js](https://nodejs.org/) v22.13+
* [MetaMask](https://metamask.io/) browser extension
* A Solana wallet set to **Devnet**, only if you fund from Solana (step 2). Calling contracts from a Solana wallet needs one that signs Solana v1 transactions, which is covered in [Open your contract to Solana users](/developer-guides/open-to-solana-users.md).

## 1. Add Hadrian to MetaMask

Add it manually (Settings → Networks → Add network):

| Field           | Value                                           |
| --------------- | ----------------------------------------------- |
| Network Name    | Rome Hadrian                                    |
| RPC URL         | `https://hadrian.testnet.romeprotocol.xyz/`     |
| Chain ID        | `200010`                                        |
| Currency Symbol | `USDC`                                          |
| Block Explorer  | `https://via-hadrian.testnet.romeprotocol.xyz/` |

## 2. Fund your wallet

Gas is paid in the chain's gas token, which is USDC on Hadrian. On Hadrian it is backed by Circle's Solana Devnet USDC (mint `4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU`), so devnet SOL is not gas. There is no Rome faucet. Two ways to get USDC onto Hadrian:

**From Solana** — get Solana Devnet USDC from the [Circle faucet](https://faucet.circle.com/) (choose Solana Devnet) and a little devnet SOL for Solana fees from the [Solana faucet](https://faucet.solana.com/), with your Solana wallet set to Devnet. Then use the [Rome Bridge](/apps-on-rome/bridge-api.md) with Hadrian as the destination and its Solana route, with your EVM wallet's address as the recipient; the bridge asks that EVM wallet to sign a claim transaction on Hadrian, which turns the USDC into gas.

**By bridging in from an EVM chain** — mint test USDC on Ethereum Sepolia from the [Circle faucet](https://faucet.circle.com/), then bring it to Rome with the [Rome Bridge](/apps-on-rome/bridge-api.md) (CCTP). You'll need a little Sepolia ETH for the source-side transaction — see [Faucets](/resources/faucets.md) for every faucet.

**How much?** A write on Rome costs more than Ethereum intuition suggests, because most of its gas pays for creating Solana accounts: a recipient that has never been used, a new token account, a deployed contract. Use `eth_estimateGas`, which standard tooling does, and never hardcode 21,000. The estimate includes the account creation, Rome charges the gas a transaction actually uses (in measurements on Hadrian that was never more than the estimate), and the SDK's `submitRomeTx` pads the estimate by 1.3x as a margin, which costs nothing because only the gas used is charged. Fund at least **0.5 USDC of gas**; 1 USDC leaves comfortable headroom. Numbers in [JSON-RPC Support](/reference/json-rpc.md) show what individual writes cost.

If a Solana-side deposit fails with an "insufficient SOL" warning despite a funded wallet, set your Solana wallet to Testnet Mode / Devnet (see the [FAQ](/resources/faq.md)).

## 3. Create a Hardhat project

```bash
mkdir rome-hello && cd rome-hello
npx hardhat --init
```

Accept the defaults when prompted — Hardhat 3, the current directory, and the TypeScript + Node Test Runner + viem template — and let it install dependencies. The template ships an example `Counter` contract with tests; they don't interfere with this guide.

## 4. Configure Hardhat for Rome

Edit the generated `hardhat.config.ts` and add the Rome networks inside `defineConfig({ ... })`:

```typescript
  networks: {
    hadrian: {
      type: "http",
      chainType: "l1",
      chainId: 200010,
      url: "https://hadrian.testnet.romeprotocol.xyz/",
      accounts: [configVariable("PRIVATE_KEY")],
    },
  },
```

`configVariable("PRIVATE_KEY")` resolves from the environment, so export your MetaMask private key:

```bash
export PRIVATE_KEY="0xYOUR_PRIVATE_KEY"
```

(For anything beyond a throwaway key, prefer the encrypted keystore that ships with the toolbox: `npx hardhat keystore set PRIVATE_KEY`.)

## 5. Write a contract

Create `contracts/HelloRome.sol`:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

contract HelloRome {
    string public greeting = "Hello from Solana!";
    uint256 public counter;

    event Greeted(address indexed sender, uint256 count);

    function greet() external returns (string memory) {
        counter++;
        emit Greeted(msg.sender, counter);
        return greeting;
    }

    function setGreeting(string calldata _greeting) external {
        greeting = _greeting;
    }
}
```

## 6. Deploy

Create `scripts/deploy.ts`:

```typescript
import hardhat from "hardhat";

async function main() {
  const { viem } = await hardhat.network.connect();
  const publicClient = await viem.getPublicClient();

  const hello = await viem.deployContract("HelloRome");
  console.log("HelloRome deployed to:", hello.address);

  const hash = await hello.write.greet();
  await publicClient.waitForTransactionReceipt({ hash });

  console.log("Counter:", (await hello.read.counter()).toString());
  console.log("Greeting:", await hello.read.greeting());
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});
```

Deploy to Hadrian:

```bash
npx hardhat run scripts/deploy.ts --network hadrian
```

Expected output (your address will differ):

```
HelloRome deployed to: 0x09c437e305eeb698e1776cff23ca16c1bb25aabd
Counter: 1
Greeting: Hello from Solana!
```

Open the deployed address in the [explorer](https://via-hadrian.testnet.romeprotocol.xyz/) to see the Solana instructions behind your transaction. Your Solidity contract is now running on Solana.

## What's Next

* [Deploy Solidity](/developer-guides/deploy-solidity.md) — Hardhat and Foundry deployment in depth
* [Call Solana from EVM](/developer-guides/call-solana-from-evm.md) — call Solana programs from Solidity via CPI
* [Architecture](/getting-started/architecture.md) — how Rome executes EVM inside Solana

## Common Errors

| Error                | Cause                                                      | Fix                                                                                            |
| -------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `insufficient funds` | Not enough gas token for the gas limit times the gas price | Fund at least 0.5 USDC of gas (see step 2) with the [Rome Bridge](/apps-on-rome/bridge-api.md) |
| `nonce too low`      | Transaction nonce mismatch                                 | Reset the account (MetaMask → Settings → Advanced → Clear activity)                            |
| `execution reverted` | Contract execution failed                                  | Check contract logic; use `eth_call` to debug                                                  |
| Connection timeout   | RPC unreachable                                            | Verify the RPC URL                                                                             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rome.builders/getting-started/quickstart.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
