> 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. This guide targets **Martius**, the public testnet chain; the same steps work on [Hadrian](/networks/hadrian.md) (devnet) by swapping the network values.

## Prerequisites

* [Node.js](https://nodejs.org/) v22.13+
* [MetaMask](https://metamask.io/) browser extension
* A Solana wallet (e.g. Phantom) set to **Devnet**

## 1. Add Martius to MetaMask

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

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

## 2. Fund your wallet

Gas is paid in the chain's SPL gas token (USDC on Martius). Two ways to get it:

**From Solana** — get devnet SOL from the [Solana faucet](https://faucet.solana.com/) (set your Solana wallet to Devnet), then open the [Rome App](https://app.testnet.romeprotocol.xyz), connect both wallets, and wrap into the gas token.

**By bridging in** — 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?** Contract deploys on Rome carry Solana-side account costs, so gas estimates run well above Ethereum intuition — the quickstart contract estimates \~20M gas and costs about **0.2 USDC** to deploy, and wallets pre-check roughly double the estimate up front. Fund at least **0.5 USDC of gas**; 1 USDC leaves comfortable headroom.

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: {
    martius: {
      type: "http",
      chainType: "l1",
      chainId: 121214,
      url: "https://martius.testnet.romeprotocol.xyz/",
      accounts: [configVariable("PRIVATE_KEY")],
    },
    rome_local: {
      type: "http",
      chainType: "l1",
      chainId: 1001,
      url: "http://localhost:9090",
      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 Martius:

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

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-martius.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 — wallets pre-check \~2× the gas estimate | Fund at least 0.5 USDC of gas (see step 2) via the [Rome App](https://app.testnet.romeprotocol.xyz) or bridge |
| `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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
