> 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/zh/zi-yuan/faq.md).

# 常见问题

关于 Rome Protocol 的常见问题——Rome 是桥还是 rollup、Solidity 兼容性、预言机、gas 代币以及与 Solana 的互操作性。

## 常规

**什么是 Rome Protocol？** Rome 是一个 EVM 执行环境，原生运行在 Solana 运行时中。Solidity 合约部署在 Solana 上，并可直接通过 CPI 访问所有 Solana 程序。参见 [什么是 Rome？](/zh/kuai-su-kai-shi/what-is-rome.md)

**Rome 是桥吗？** 不是。Rome EVM 作为一等程序直接运行在 Solana 的运行时中。不同链之间没有消息中继。EVM 状态就是 Solana 状态。

**Rome 是 Rollup 吗？** Rome EVM 链（Rubicon 和 Hadrian）不是。区块索引器（Hercules）会为钱包和浏览器生成与以太坊兼容的区块，但 EVM 执行发生在 Solana 程序内部——而不是在单独的 rollup 链上。 [Rome ZK EVM](/zh/rome-zk-evm/zk-evm.md) 是一个不同的产品：运营者运行 rollup，将批次提交到 Solana，并在其上结算已证明的根。

## 开发

**我可以使用现有的 Solidity 合约吗？** 可以。标准 Solidity 合约可在 Rome 上原样部署。如果你的合约使用 Chainlink 预言机，Oracle Gateway 提供相同的 `AggregatorV3Interface`。对用户而言，有一项新变化，而不是对合约：在包装器能够移动钱包中的代币之前，该钱包需要先向包装器授予一次权限（`approve_spl` 在 Helper 预编译合约上）。通过 `transferFrom` 提取包装器代币的合约，需要每个用户都执行过这一步。参见 [每个钱包一次性授权](/zh/he-xin-gai-nian/token-interop.md#one-time-grant-per-wallet).

**我应该使用哪个 Solidity 版本？** 推荐使用 0.8.28（与 Rome Solidity SDK 匹配）。更早的版本也可正常工作。

**我可以使用 Hardhat 吗？Foundry 呢？** 两者都可以。请使用 Rome RPC URL 和链 ID 配置你的网络。参见 [部署 Solidity](/zh/kai-fa-zhe-zhi-nan/deploy-solidity.md).

**我可以使用 MetaMask 吗？** 可以。在 MetaMask 中将 Rome 作为自定义网络添加，并配置相应的 RPC URL 和链 ID。参见 [快速开始](/zh/kuai-su-kai-shi/quickstart.md).

**一笔交易会消耗多少 gas？** 询问链：使用 `eth_estimateGas`，像标准工具那样，且绝不要硬编码 21,000。大部分写入成本来自创建 Solana 账户，例如从未使用过的接收方、新的代币账户或已部署的合约，而估算值已包含这一部分。在 Hadrian 上测得，向从未使用过的地址进行原生转账，估算为 1,086,961 gas；而向已存在地址转账则估算为 21,000，实际使用为 10,001。Rome 按交易实际使用的 gas 收费，在这些测量中从未超过估算值。对于调用 Solana 程序的操作，请增加余量，如 SDK 的 1.3x 填充所做的那样，并在估算本身会回退时设置 gas 上限。参见 [JSON-RPC 支持](/zh/can-kao/json-rpc.md).

**如何从 Solidity 调用 Solana 程序？** 使用 CPI 预编译合约（`0xFF...08`）通过 Rome Solidity SDK。参见 [从 EVM 调用 Solana](/zh/kai-fa-zhe-zhi-nan/call-solana-from-evm.md).

## 性能

**交易最终确认时间是多少？** 交易会在大约一个 Solana slot 内确认，约为不到一秒。这是 Rome 链上的确认，而不是 Solana 上的最终确定性，后者需要更长时间。

**计算预算是多少？** 每笔原子交易约 140 万 compute units。超过此限制的操作将使用迭代模式（拆分为多笔 Solana 交易）。参见 [计算预算](/zh/he-xin-gai-nian/compute-budget.md).

## 代币

**Rome 使用什么 gas 代币？** 每条链可自行选择 gas 代币——任何 SPL 代币均可，并通过 Meteora 池定价。公开链（Rubicon 和 Hadrian）使用 USDC 作为 gas。在 Hadrian 上是测试版 USDC；在 [Rubicon](/zh/wang-luo/rubicon.md) 上则是真实 USDC。

**ERC-20 代币在 Rome 上如何运作？** Rome 上的 ERC-20 代币是对 SPL 代币的包装。对于钱包地址， `balanceOf()` 读取的是 Solana 上的 SPL 代币账户。对于合约地址，包装器会将余额保存在自己的账本中，因为该合约的代币存放在包装器的代币账户里。 `allowance()` 保存在 EVM 存储中，与 Solana delegate 分开；在一次性授权之后，包装器会作为该用户的 SPL delegate 移动该用户的代币。参见 [代币互操作](/zh/he-xin-gai-nian/token-interop.md).

**在 Solana 侧进行存款或桥接转账时显示“SOL 不足”，但我的钱包是有资金的——为什么？** Rome 的公共测试网 Hadrian 结算在 Solana Devnet 上，因此你的 Solana 钱包必须处于匹配的网络模式（Rubicon 结算在 Solana 主网）。在 Phantom 中，打开设置 → 开发者设置 → 启用测试网模式，并将网络设置为 Devnet，然后断开并重新连接两个钱包，再重试。如果存款后代币余额未显示，请手动将该代币导入钱包。

## 基础设施

**我需要运行自己的节点吗？** 不需要——连接到公共链的 RPC（参见 [网络](/zh/wang-luo/networks.md)）。运行你自己的链意味着要运维 Proxy 和 Hercules。

**Rome 需要哪些数据库？** PostgreSQL，Hercules 用于区块索引，Proxy 用于区块查询。

**我可以在本地运行 Rome 吗？** 不能作为现成的本地栈；目前没有公开可用的本地栈。请针对公共链进行开发—— [快速开始](/zh/kuai-su-kai-shi/quickstart.md) 可在几分钟内部署到 Hadrian（测试网）。


---

# 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/zh/zi-yuan/faq.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.
