> 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/almfahym-alasasyh/token-interop.md).

# التشغيل البيني للرموز

تمثل Rome رمز ERC-20 ورمز SPL الأساسي الخاص به كحساب مشترك واحد. تشرح هذه الصفحة كيف تعمل الرموز عبر EVM وSolana.

## نموذج الحالة المشتركة

لا تقوم Rome بقفل الرموز على جانب واحد وسكّ نسخ مغلفة على جانب آخر. رمز ERC-20 على Rome هو **غلاف شفاف** فوق حساب رمز SPL على Solana — رصيد ERC-20 *هو* رصيد SPL.

<figure><img src="/files/507ea403e2685c8f88a60bf99a91cce1ce150d55" alt="An ERC-20 wrapper over the same SPL token account on Solana"><figcaption></figcaption></figure>

* لا يوجد تأخير في الجسر — رصيد ERC-20 هو رصيد SPL
* لا يوجد تجزؤ في السيولة — ترى DeFi على الجانبين الرموز نفسها
* لا توجد مخاطرة من الجسر — لا توجد أمانة منفصلة يمكن استغلالها

> تستخدم مسارات الاستيراد أدناه `@rome-protocol/rome-solidity`. لا يزال نشر npm قيد الانتظار؛ واليوم تحصل عليها من [`rome-solidity`](https://github.com/rome-protocol/rome-solidity) المستودع العام (اعتماد git أو الواجهات المنسوخة). توجد واجهات precompile في [`contracts/interface.sol`](https://github.com/rome-protocol/rome-solidity/blob/master/contracts/interface.sol).

## يعرض العقد المغلف

`SPL_ERC20` (وفضلاً عن نسخته ذات المسار المخبأ `SPL_ERC20_cached`، والتي ينشرها المصنع اليوم) واجهة ERC-20 كاملة فوق mint من نوع SPL:

* `balanceOf()` — يقرأ رصيد ATA الخاص بالمستخدم من Solana
* `transfer()` — ينقل الرموز على Solana
* `approve()` / `allowance()` — تستخدم تخزين EVM (لا يملك SPL صلاحيات على نمط EVM)
* `totalSupply()` — يقرأ المعروض من mint الخاص بـ SPL

## المصنع

`ERC20SPLFactory` ينشر غلافًا لأي mint من نوع SPL:

```solidity
import {ERC20SPLFactory} from "@rome-protocol/rome-solidity/contracts/erc20spl/erc20spl_factory.sol";

// انشر غلافًا، مع تحميل الاسم/الرمز من بيانات Metaplex الوصفية
address wrapper = factory.add_spl_token_with_metadata(splMint);

// أو حدّد الاسم/الرمز يدويًا
address wrapper = factory.add_spl_token_no_metadata(splMint, "USD Coin", "USDC");
```

عناوين المصنع المباشرة: Hadrian `0x86149124d74ebb3aa41a19641b700e88202b6285`، Martius `0xd7aeeedca26cdd4d34eb7c21110af2e590a8c58a`. تحقّق دائمًا من [السجل](https://github.com/rome-protocol/rome-registry/tree/main/chains) — فهو مصدر الحقيقة للعناوين المنشورة.

## السكّات القياسية

لا يوجد عقد سجل رموز على السلسلة. تتم إدارة الأغلفة القياسية ورموز الغاز/الجسر في [`rome-protocol/registry`](https://github.com/rome-protocol/rome-registry)المنفصل عن السلسلة؛ أما الأغلفة بلا إذن المنشأة عبر `add_spl_token_no_metadata` فيتم اكتشافها من حدث `TokenCreated` على السلسلة. هذا يبقي كل أصل مرتبطًا بمint SPL قياسي واحد دون تجزئة السيولة.

## عمليات SPL من Solidity

لأصول SPL الموقعة بواسطة PDA الخاص بالمستخدم، استخدم **HelperProgram** precompile (`0xFF…09`) — إنشاء ATA، وتحويلات SPL، والتحويل بين gas وlamports:

```solidity
import {IHelperProgram} from "@rome-protocol/rome-solidity/contracts/interface.sol";

IHelperProgram helper = IHelperProgram(0xFF00000000000000000000000000000000000009);

helper.create_ata(user, mint);              // أنشئ ATA الخاص بالمستخدم لمint
helper.transfer_spl(to, tokens, mint);      // انقل SPL من PDA الخاص بالمتصل
```

`transfer_spl` له عدة صيغ تحميل (بما في ذلك نسخة delegate لـ `transferFrom` التدفقات)؛ راجع `interface.sol` للتواقيع الدقيقة. في المسار المخبأ، توجد العمليات المكافئة على `ISplCached` (`0xFF…05`) و `IAssociatedSplCached` (`0xFF…06`). يستخدم العقد مسارًا واحدًا باستمرار.

## الإيداع والسحب

* **إلى EVM** — جانب SPL يضيف الرصيد إلى ATA المملوك لـ PDA الخاص بالمستخدم؛ ويعكس غلاف ERC-20 الرصيد فورًا. تتم التسويات الواردة عبر السلاسل بلا ثقة عبر تفويض موقع من المستخدم على الجسر.
* **إلى Solana** — استدعِ `Withdraw` precompile (`0x42…16`): `withdraw_to_pda` / `withdraw_to_ata` لنقل الرموز من PDA الخاص بالمستخدم إلى Solana مرة أخرى. مسار تغليف gas إلى SPL هو `withdraw_to_ata`.

## رمز الغاز

لكل سلسلة رمز غاز خاص بها — أي رمز SPL، يُسعَّر عبر مجمع Meteora DAMM (v1 أو v2، قابل للتهيئة). تستخدم السلاسل العامة (Martius، Hadrian) USDC. لا يوجد رمز غاز افتراضي عالمي.

## القيود

* كميات رموز SPL هي `uint64` (الحد الأقصى 18,446,744,073,709,551,615)
* تستخدم الصلاحيات تخزين EVM، وليس مفوضي Solana
* يجب أن تكون رموز أغلفة ERC-20 فريدة لكل مصنع

## ما التالي

* [عناوين العقود](/ar/almrja/contract-addresses.md) — precompiles وعناوين كل سلسلة
* [استدعِ Solana من EVM](/ar/adlh-almtwr/call-solana-from-evm.md) — عمليات CPI وSPL من Solidity


---

# 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/almfahym-alasasyh/token-interop.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.
