链上所有者分类
hyperlane-xyz2026-10-28查看 185复制 1288
用于识别所有者地址类型的底层链上探测——cast code → EOA / EIP-7702 委托 EOA / 合约,VERSION() → Gnosis Safe,只读 get-owner-ica.ts 推导 → ICA 推导,getAccountInfo → Sealevel 账户存在性——以及如何解读每种结果。这是 validate-owners / resolve-artifacts / update-owners 之下的原语层,后者各自在其之上应用自己的按链或按工件策略。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md5218 chars
---
name: classify-onchain-owner
description: The low-level on-chain probes for identifying what an owner address is — cast code → EOA / EIP-7702-delegated EOA / contract, VERSION() → Gnosis Safe, read-only get-owner-ica.ts derive → ICA derivation, getAccountInfo → Sealevel account existence — with how to interpret each result. The primitive layer beneath validate-owners / resolve-artifacts / update-owners, which each apply their own per-chain or per-artifact policy on top.
---
# Classify On-Chain Owner (primitive probes)
These are the raw probes for determining what an owner address IS on chain. A caller runs the relevant probe, interprets the result per the tables below, then applies its OWN policy (reject EOA, ask-the-user for non-Safe, existence-only sanity check, controller classification, etc.). This skill supplies the primitives and their interpretation only — it does not decide policy.
## EVM / Tron — code probe (EOA vs EIP-7702 vs contract)
`cast code <address> --rpc-url <rpc>` (or the multiProvider equivalent):
| Result | Meaning |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `0x` (no code) | **Plain EOA.** |
| `0xef0100<20-byte-delegate>` — 46 chars, matches `^0xef0100[0-9a-fA-F]{40}$` | **EIP-7702-delegated EOA.** Still has a private key behind it; treat as an EOA for ownership purposes. |
| any other bytecode | **Contract** (Safe / ICA / timelock / custom multisig / …) — probe further. |
## EVM — Safe probe
`cast call <address> "VERSION()(string)" --rpc-url <rpc>`:
| Result | Meaning |
| --------------------------------- | ---------------------------------------------------------------- |
| a version string (e.g. `"1.3.0"`) | **Gnosis Safe** — record the version. |
| reverts / no return | Not a Safe — some other contract; probe further or ask the user. |
## EVM — ICA derivation
Derive the deterministic ICA address for `(origin, controlling-owner)` **read-only** — view calls only, no transaction — with `get-owner-ica.ts` and NO `--deploy`:
```bash
pnpm --silent tsx typescript/infra/scripts/keys/get-owner-ica.ts \
--environment mainnet3 --ownerChain <origin> --owner <controlling-owner> --chains <chain>
```
> ⚠️ **Never use `hyperlane ica deploy` for this probe.** That CLI command has no read-only mode: it **deploys the ICA (spends gas, creates a contract) whenever the derived account is absent**. Probing a _non_-ICA owner therefore mints an unrelated ICA — the exact failure a read-only classifier must avoid. `get-owner-ica.ts` without `--deploy` only calls `InterchainAccount.getAccount` (a view) and prints the address.
Compare the derived address to the on-chain owner:
| Result | Meaning |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| derived address == the on-chain owner | The owner is an **ICA** controlled by `<controlling-owner>` on `<origin>`. Classify the controller by re-running the code + Safe probes on it. |
| derived address != the owner | Not an ICA from that origin/controller — try another origin/controller, or ask the user. |
## Sealevel — account existence
`getAccountInfo(<pubkey>)` via the SVM SDK provider:
| Result | Meaning |
| -------- | -------------------------------------------------------------------------------------------------- |
| null | Address has **never had state** on this chain (transferring ownership here would brick the route). |
| non-null | Account **exists** (may be executable / PDA / plain wallet). |
## Open-set note
Contract-but-not-a-Safe is NOT automatically an ICA. These probes cover only the cheap cases (EOA via code, Safe via `VERSION()`, ICA via a known origin/controller derivation). Everything else — Squads multisig PDA, Turnkey, Privy, MPC, custom multisig, timelock — the caller must resolve with the user; never guess.
## Consumers
`/warp-deploy-validate-owners` (per-chain classify + reject-EOA policy), `/warp-update-resolve-artifacts` (per-artifact classify + governance-map shortcut + open-set + controller classification), `/warp-deploy-update-owners` (target-owner existence sanity check).