# Quickstart

Deploye deinen ersten Solidity-Vertrag auf Rome EVM in unter 5 Minuten.

## Voraussetzungen

* [Node.js](https://nodejs.org/) v18+
* [MetaMask](https://metamask.io/) Browser-Erweiterung
* Eine Solana-Wallet mit Devnet-SOL (für Gas)

## 1. Füge das Rome-Netzwerk zu MetaMask hinzu

Öffne MetaMask → Einstellungen → Netzwerke → Netzwerk hinzufügen:

| Feld           | Wert                                       |
| -------------- | ------------------------------------------ |
| Netzwerkname   | Rome Devnet                                |
| RPC-URL        | `https://montispl.devnet.romeprotocol.xyz` |
| Chain-ID       | `200002`                                   |
| Währungssymbol | `RSOL`                                     |
| Block-Explorer | —                                          |

## 2. Deine Wallet aufladen

Zahle Devnet-SOL auf deine Rome-EVM-Adresse ein über die [Einzahlungs-UI](https://deposit.devnet.romeprotocol.xyz). Verbinde deine Solana-Wallet (mit Devnet-SOL) und dein MetaMask, gib dann den einzuzahlenden Betrag ein. Die UI konvertiert SOL 1:1 in RSOL und schreibt ihn deiner EVM-Adresse gut.

## 3. Erstelle ein Hardhat-Projekt

```bash
mkdir rome-hello && cd rome-hello
npm init -y
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
npx hardhat init
```

Wähle bei der Aufforderung "Create a JavaScript project" aus.

## 4. Konfiguriere Hardhat für Rome

Bearbeite `hardhat.config.js`:

```javascript
require("@nomicfoundation/hardhat-toolbox");

module.exports = {
  solidity: "0.8.28",
  networks: {
    rome_devnet: {
      url: "https://montispl.devnet.romeprotocol.xyz",
      chainId: 200002,
      accounts: [process.env.PRIVATE_KEY],
    },
    rome_local: {
      url: "http://localhost:9090",
      chainId: 1001,
      accounts: [process.env.PRIVATE_KEY],
    },
  },
};
```

Exportiere deinen MetaMask-Private-Key:

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

## 5. Schreibe einen Vertrag

Erstelle `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. Deployen

Erstelle `scripts/deploy.js`:

```javascript
const hre = require("hardhat");

async function main() {
  const HelloRome = await hre.ethers.getContractFactory("HelloRome");
  const hello = await HelloRome.deploy();
  await hello.waitForDeployment();

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

  // Vertrag aufrufen
  const tx = await hello.greet();
  await tx.wait();

  const count = await hello.counter();
  console.log("Zähler:", count.toString());

  const greeting = await hello.greeting();
  console.log("Begrüßung:", greeting);
}

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

Deploye auf das Rome-Devnet:

```bash
npx hardhat run scripts/deploy.js --network rome_devnet
```

Erwartete Ausgabe:

```
HelloRome deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
Zähler: 1
Begrüßung: Hello from Solana!
```

Dein Solidity-Vertrag läuft jetzt auf Solana.

## Was kommt als Nächstes

* [Solidity bereitstellen](/de/entwicklerhandbucher/deploy-solidity.md) — ausführlicher Bereitstellungsleitfaden mit Foundry und Hardhat
* [Solana von EVM aus aufrufen](/de/entwicklerhandbucher/call-solana-from-evm.md) — nutze CPI, um Jupiter, Kamino und andere Solana-Programme aus Solidity heraus aufzurufen
* [Architektur](/de/erste-schritte/architecture.md) — verstehe, wie Rome EVM im Hintergrund funktioniert

## Häufige Fehler

| Fehler                          | Ursache                                    | Behebung                                                                        |
| ------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------- |
| `unzureichende Mittel`          | Die EVM-Adresse hat kein Guthaben          | Zahle SOL über die Einzahlungs-UI ein                                           |
| `Nonce zu niedrig`              | Nonce der Transaktion stimmt nicht überein | Setze das MetaMask-Konto zurück (Einstellungen → Erweitert → Aktivität löschen) |
| `Ausführung rückgängig gemacht` | Vertragsausführung fehlgeschlagen          | Prüfe die Vertragslogik; verwende `eth_call` zum Debuggen                       |
| Verbindungszeitüberschreitung   | RPC-Endpunkt nicht erreichbar              | Überprüfe die Netzwerk-URL; prüfe, ob das Devnet in Betrieb ist                 |


---

# 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.rome.builders/de/erste-schritte/quickstart.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.
