> 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-almtwryn/verify-contracts.md).

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

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

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

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

| البيئة           | رابط أداة التحقق                          |
| ---------------- | ----------------------------------------- |
| Testnet و Devnet | `https://verify.testnet.romeprotocol.xyz` |

نسخة واحدة مشتركة تخدم كل سلسلة من سلاسل Rome في testnet/devnet — وتحدد السلسلة باستخدام الوسيط القياسي `--chain-id` .

## Foundry

بعد النشر (انظر [نشر عقود Solidity](/ar/adlh-almtwryn/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",
    },
  },
});
```

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

عند النجاح، تربط أداة التحقق المصدر المنشور، مثلًا `https://verify.testnet.romeprotocol.xyz/repo-ui/<CHAIN_ID>/<ADDRESS>`.

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

يقرأ المستكشف حالة التحقق من واجهة برمجة تطبيقات أداة التحقق. يمكنك الاستعلام عنها مباشرةً:

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

العقد الذي تم التحقق منه يُرجع `حقل` match:

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

## ملاحظات

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