> 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](/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
```

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

```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({
  // …الإضافات، Solidity، الشبكات…
  verify: {
    etherscan: { enabled: false },
    blockscout: { enabled: false },
    sourcify: {
      enabled: true,
      apiUrl: "https://verify.testnet.romeprotocol.xyz",   // الشبكة الرئيسية Rubicon: "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>
```

يعيد العقد المتحقق منه `مطابقة` الحقل:

* **`exact_match`** — bytecode *و* مطابقة تجزئة البيانات الوصفية (مطابقة كاملة ومثالية).
* **`مطابقة`** — يتطابق bytecode؛ وتختلف البيانات الوصفية قليلًا (ولا يزال هذا تطابقًا حقيقيًا ومتحققًا منه).
* `404` / `null` — غير متحقق منه.

## ملاحظات

* لا يحتاج التحقق إلا إلى bytecode المنشور لعقدك + الشيفرة المصدرية وإعدادات المترجم التي ترسلها — وهي نفس المدخلات في أي سلسلة 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.
