> 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/ar/adlh-almtw-ryn/verify-contracts.md).

# التحقق من العقود

تحقّق من مصدر عقد Solidity على Rome عبر خدمة Sourcify المستضافة — مسارات forge verify-contract وhardhat-verify القياسية، وشارات على مستكشف Via.

توفّر Rome خدمة مستضافة [Sourcify](https://sourcify.dev) للتحقّق. بعد التحقّق من العقد، يصبح مصدره وواجهة ABI قابليْن لإعادة الإنتاج علنًا، ويظهران مع شارة **✓ تم التحقّق من المصدر** في مستكشف كتل Rome (Via).

يعمل التحقّق باستخدام آليتَي `forge verify-contract` و `hardhat-verify` المعتادتين — ما عليك سوى توجيههما إلى أداة التحقّق الخاصة بـ Rome.

## نقطة نهاية أداة التحقّق

| البيئة                    | عنوان URL لأداة التحقّق                   |
| ------------------------- | ----------------------------------------- |
| شبكتا الاختبار والتطوير   | `https://verify.testnet.romeprotocol.xyz` |
| الشبكة الرئيسية (Rubicon) | `https://verify.mainnet.romeprotocol.xyz` |

تخدم نسخة مشتركة واحدة جميع سلاسل Rome للاختبار والتطوير — اختر السلسلة باستخدام الراية المعتادة `--chain-id`  .

## Foundry

بعد النشر (راجع [نشر عقود Solidity](https://docs.rome.builders/ar/adlh-almtw-ryn/deploy-solidity.md)):

```bash
forge verify-contract <CONTRACT_ADDRESS> src/MyContract.sol:MyContract \
  --verifier sourcify \
  --verifier-url https://verify.testnet.romeprotocol.xyz/ \
  --chain-id <YOUR_CHAIN_ID> \
  --compiler-version 0.8.20
```

إذا كان المُنشئ يتلقى وسيطات، فمرّرها إليه كي تتطابق الشيفرة الثنائية:

```bash
  --constructor-args $(cast abi-encode "constructor(uint256)" 42)
```

يمكنك أيضًا التحقّق وقت النشر باستخدام `forge create … --verify` أو `forge script … --verify` (تستنتج Foundry معرّف السلسلة من `--rpc-url`).

## Hardhat

`hardhat-verify` مضمّن مع مجموعة أدوات Hardhat 3. وجّه موفّر Sourcify فيه إلى أداة التحقّق الخاصة بـ Rome في `hardhat.config.ts` ثم شغّل `hardhat verify`:

```typescript
export default defineConfig({
  // …plugins, solidity, networks…
  verify: {
    etherscan: { enabled: false },
    blockscout: { enabled: false },
    sourcify: {
      enabled: true,
      apiUrl: "https://verify.testnet.romeprotocol.xyz",   // Rubicon mainnet: "https://verify.mainnet.romeprotocol.xyz"
    },
  },
});
```

```bash
npx hardhat verify --network <your-network> <CONTRACT_ADDRESS> [constructor args…]
```

عند نجاح العملية، يربط المُدقِّق المصدر المنشور، على سبيل المثال: `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

## التحقق من حالة التحقق

يقرأ المستكشف حالة التحقق من واجهة API الخاصة بالمُدقِّق. ويمكنك الاستعلام عنها مباشرةً:

```bash
curl https://verify.testnet.romeprotocol.xyz/v2/contract/<CHAIN_ID>/<ADDRESS>
```

يعيد العقد الذي تم التحقق منه حقلًا بقيمة `match` :

* **`exact_match`** — تطابق في الشيفرة الثنائية *و* تطابق في تجزئة البيانات الوصفية (تطابق «كامل» ودقيق).
* **`match`** — تطابق الشيفرة الثنائية، مع اختلاف طفيف في البيانات الوصفية (ومع ذلك، يظل تطابقًا حقيقيًا تم التحقق منه).
* `404` / `null` — لم يتم التحقق منه.

## ملاحظات

* تعرض العقود التي تم التحقق منها لدى مُدقِّق Rome اسم العقد في Rome Via (المستكشف).
* بالنسبة إلى الوكلاء القابلين للترقية، تحقَّق من التنفيذ وكذلك من الوكيل.
* لا يتطلب التحقق سوى الشيفرة الثنائية المنشورة لعقدك، إضافةً إلى المصدر وإعدادات المترجم التي تقدّمها — وهي المدخلات نفسها المطلوبة على أي سلسلة EVM.
* تُضاف سلاسل Rome الجديدة إلى المُدقِّق تلقائيًا؛ فإذا نشرت على سلسلة جديدة ولم يعثر عليها التحقق بعد، فانتظر قليلًا أو تواصل معنا.


---

# 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/ar/adlh-almtw-ryn/verify-contracts.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.
