safehands-pharos 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +64 -26
- package/README.md +333 -445
- package/dist/cli.d.ts +5 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +124 -98
- package/dist/cli.js.map +1 -1
- package/dist/demo.d.ts +1 -1
- package/dist/demo.js +171 -171
- package/dist/index.d.ts +2 -2
- package/dist/index.js +138 -85
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +1 -1
- package/dist/init.js +65 -65
- package/dist/lib/auditLog.d.ts +9 -0
- package/dist/lib/auditLog.d.ts.map +1 -0
- package/dist/lib/auditLog.js +30 -0
- package/dist/lib/auditLog.js.map +1 -0
- package/dist/lib/constants.d.ts +291 -291
- package/dist/lib/constants.js +292 -292
- package/dist/lib/dodoApi.d.ts +78 -70
- package/dist/lib/dodoApi.d.ts.map +1 -1
- package/dist/lib/dodoApi.js +196 -178
- package/dist/lib/dodoApi.js.map +1 -1
- package/dist/lib/http.d.ts +14 -14
- package/dist/lib/http.js +118 -118
- package/dist/lib/pharosClient.d.ts +58 -58
- package/dist/lib/pharosClient.d.ts.map +1 -1
- package/dist/lib/pharosClient.js +63 -53
- package/dist/lib/pharosClient.js.map +1 -1
- package/dist/lib/policy/actionPolicyEngine.d.ts +53 -53
- package/dist/lib/policy/actionPolicyEngine.js +212 -212
- package/dist/lib/riskEngine.d.ts +26 -26
- package/dist/lib/riskEngine.js +283 -283
- package/dist/lib/signer/index.d.ts +24 -24
- package/dist/lib/signer/index.d.ts.map +1 -1
- package/dist/lib/signer/index.js +88 -89
- package/dist/lib/signer/index.js.map +1 -1
- package/dist/lib/spendAccumulator.d.ts +10 -0
- package/dist/lib/spendAccumulator.d.ts.map +1 -0
- package/dist/lib/spendAccumulator.js +54 -0
- package/dist/lib/spendAccumulator.js.map +1 -0
- package/dist/lib/testDodoLive.d.ts +1 -1
- package/dist/lib/testDodoLive.js +104 -104
- package/dist/lib/testLiveSafehands.d.ts +1 -1
- package/dist/lib/testLiveSafehands.js +92 -92
- package/dist/lib/testRpc.d.ts +1 -1
- package/dist/lib/testRpc.js +29 -29
- package/dist/lib/testRpcLive.d.ts +1 -1
- package/dist/lib/testRpcLive.js +88 -88
- package/dist/lib/testTools.d.ts +1 -1
- package/dist/lib/testTools.js +397 -397
- package/dist/lib/testX402Live.d.ts +1 -1
- package/dist/lib/testX402Live.js +159 -159
- package/dist/lib/toolResponse.d.ts +25 -25
- package/dist/lib/toolResponse.js +53 -53
- package/dist/lib/wallet/index.d.ts +37 -18
- package/dist/lib/wallet/index.d.ts.map +1 -1
- package/dist/lib/wallet/index.js +128 -70
- package/dist/lib/wallet/index.js.map +1 -1
- package/dist/scripts/checkDeploy.d.ts +1 -1
- package/dist/scripts/checkDeploy.js +24 -24
- package/dist/scripts/deployRegistry.d.ts +1 -1
- package/dist/scripts/deployRegistry.js +100 -100
- package/dist/scripts/testRegistry.d.ts +1 -1
- package/dist/scripts/testRegistry.js +43 -43
- package/dist/tools/approveToken.d.ts +45 -46
- package/dist/tools/approveToken.d.ts.map +1 -1
- package/dist/tools/approveToken.js +85 -83
- package/dist/tools/approveToken.js.map +1 -1
- package/dist/tools/assessRisk.d.ts +79 -79
- package/dist/tools/assessRisk.d.ts.map +1 -1
- package/dist/tools/assessRisk.js +104 -93
- package/dist/tools/assessRisk.js.map +1 -1
- package/dist/tools/checkAllowance.d.ts +43 -36
- package/dist/tools/checkAllowance.d.ts.map +1 -1
- package/dist/tools/checkAllowance.js +56 -42
- package/dist/tools/checkAllowance.js.map +1 -1
- package/dist/tools/checkTokenSecurity.d.ts +46 -46
- package/dist/tools/checkTokenSecurity.d.ts.map +1 -1
- package/dist/tools/checkTokenSecurity.js +95 -88
- package/dist/tools/checkTokenSecurity.js.map +1 -1
- package/dist/tools/createAgentWallet.d.ts +26 -26
- package/dist/tools/createAgentWallet.d.ts.map +1 -1
- package/dist/tools/createAgentWallet.js +58 -59
- package/dist/tools/createAgentWallet.js.map +1 -1
- package/dist/tools/estimateGas.d.ts +79 -79
- package/dist/tools/estimateGas.js +124 -124
- package/dist/tools/executeSwap.d.ts +61 -59
- package/dist/tools/executeSwap.d.ts.map +1 -1
- package/dist/tools/executeSwap.js +141 -129
- package/dist/tools/executeSwap.js.map +1 -1
- package/dist/tools/explainRisk.d.ts +29 -29
- package/dist/tools/explainRisk.js +32 -32
- package/dist/tools/getAgentWallet.d.ts +21 -21
- package/dist/tools/getAgentWallet.js +27 -27
- package/dist/tools/getAgentWalletBalance.d.ts +11 -11
- package/dist/tools/getAgentWalletBalance.js +70 -70
- package/dist/tools/getExecutionHistory.d.ts +49 -51
- package/dist/tools/getExecutionHistory.d.ts.map +1 -1
- package/dist/tools/getExecutionHistory.js +154 -93
- package/dist/tools/getExecutionHistory.js.map +1 -1
- package/dist/tools/getGasPrice.d.ts +43 -43
- package/dist/tools/getGasPrice.js +59 -59
- package/dist/tools/getPoolInfo.d.ts +75 -75
- package/dist/tools/getPoolInfo.js +137 -137
- package/dist/tools/getTokenPrice.d.ts +113 -113
- package/dist/tools/getTokenPrice.js +117 -117
- package/dist/tools/getTransactionStatus.d.ts +43 -57
- package/dist/tools/getTransactionStatus.d.ts.map +1 -1
- package/dist/tools/getTransactionStatus.js +59 -67
- package/dist/tools/getTransactionStatus.js.map +1 -1
- package/dist/tools/getWalletBalance.d.ts +68 -68
- package/dist/tools/getWalletBalance.js +87 -87
- package/dist/tools/publishRiskScore.d.ts +63 -63
- package/dist/tools/publishRiskScore.d.ts.map +1 -1
- package/dist/tools/publishRiskScore.js +88 -85
- package/dist/tools/publishRiskScore.js.map +1 -1
- package/dist/tools/queryRiskRegistry.d.ts +38 -48
- package/dist/tools/queryRiskRegistry.d.ts.map +1 -1
- package/dist/tools/queryRiskRegistry.js +55 -60
- package/dist/tools/queryRiskRegistry.js.map +1 -1
- package/dist/tools/safehandsPreflightCheck.d.ts +77 -77
- package/dist/tools/safehandsPreflightCheck.js +47 -47
- package/dist/tools/safehandsRiskReport.d.ts +81 -81
- package/dist/tools/safehandsRiskReport.js +28 -28
- package/dist/tools/safehandsSafeExecute.d.ts +20 -20
- package/dist/tools/safehandsSafeExecute.d.ts.map +1 -1
- package/dist/tools/safehandsSafeExecute.js +81 -75
- package/dist/tools/safehandsSafeExecute.js.map +1 -1
- package/dist/tools/safehandsWalletHealth.d.ts +14 -14
- package/dist/tools/safehandsWalletHealth.js +103 -103
- package/dist/tools/safehandsX402Preflight.d.ts +26 -26
- package/dist/tools/safehandsX402Preflight.js +65 -65
- package/dist/tools/sendPayment.d.ts +57 -58
- package/dist/tools/sendPayment.d.ts.map +1 -1
- package/dist/tools/sendPayment.js +117 -108
- package/dist/tools/sendPayment.js.map +1 -1
- package/dist/tools/simulateTransaction.d.ts +60 -81
- package/dist/tools/simulateTransaction.d.ts.map +1 -1
- package/dist/tools/simulateTransaction.js +83 -88
- package/dist/tools/simulateTransaction.js.map +1 -1
- package/dist/tools/tokenRegistryStatus.d.ts +26 -26
- package/dist/tools/tokenRegistryStatus.js +96 -96
- package/dist/tools/x402PayAndFetch.d.ts +81 -81
- package/dist/tools/x402PayAndFetch.d.ts.map +1 -1
- package/dist/tools/x402PayAndFetch.js +152 -149
- package/dist/tools/x402PayAndFetch.js.map +1 -1
- package/dist/x402Server.d.ts +1 -1
- package/dist/x402Server.js +252 -252
- package/examples/dashboard/index.html +337 -0
- package/package.json +83 -84
- package/.agents/skill/safehands/SKILL.md +0 -212
- package/.agents/skill/safehands/assets/networks.json +0 -24
- package/.agents/skill/safehands/assets/tokens.json +0 -66
- package/.agents/wallets.json +0 -20
- package/docs/reports/OFFICIAL_DOCS_ALIGNMENT_REPORT.md +0 -137
- package/docs/reports/final_audit_report.md +0 -307
- package/docs/reports/live_verification_report.md +0 -147
- package/docs/reports/pharos_skill_engine_alignment_report.md +0 -85
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
name: safehands
|
|
2
|
-
version: 1.3.0
|
|
3
|
-
description: Transaction Safety Firewall for Pharos agents. 27 tools (17 legacy/core + 3 managed wallet + 7 guardrail) that preflight, assess, simulate, and gate payments, token approvals, swaps, and x402 paid requests before execution.
|
|
4
|
-
author: "SZtch"
|
|
5
|
-
chain: pharos
|
|
6
|
-
tags: [execution, safety, defi, swap, payment, risk, registry, middleware, composable, x402]
|
|
7
|
-
categories: [safety, execution, defi, intelligence]
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# SafeHands
|
|
11
|
-
|
|
12
|
-
> *"Before an AI agent acts on-chain, SafeHands checks whether the action is safe."*
|
|
13
|
-
|
|
14
|
-
SafeHands is **risk intelligence middleware** for the Pharos AI Agent economy. It sits between agent intent and on-chain execution, providing a 27-tool safety layer that any agent can compose into their workflow. Every payment, transfer, approval, swap, and x402 paid request can flow through a policy-based preflight before touching the chain.
|
|
15
|
-
|
|
16
|
-
SafeHands is not an agent and does not replace Pharos Skill Engine — it is the safety layer other agents can depend on.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Tools (27)
|
|
21
|
-
|
|
22
|
-
### Core Safety — Assess before you execute
|
|
23
|
-
|
|
24
|
-
| Tool | Description |
|
|
25
|
-
|------|-------------|
|
|
26
|
-
| `assess_risk` | 5-dimension risk score (0–100) for any swap or transfer. Auto-publishes to on-chain RiskRegistry when `autoPublish=true` and SignerProvider is configured. |
|
|
27
|
-
| `check_token_security` | Check token contract security (honeypot check, tax checks, mint privileges) via GoPlus Security API. |
|
|
28
|
-
| `simulate_transaction` | Dry run via eth_call — zero gas. Returns expected output, gas estimate, and revert reasons before committing. |
|
|
29
|
-
| `estimate_gas` | Pre-execution gas cost in PHRS and USD. Checks whether the wallet has sufficient funds for gas + value. |
|
|
30
|
-
|
|
31
|
-
### Execution — Act with guardrails
|
|
32
|
-
|
|
33
|
-
| Tool | Description |
|
|
34
|
-
|------|-------------|
|
|
35
|
-
| `execute_swap` | Swap tokens via FaroSwap (DODO) with built-in risk gate. Automatically blocks if risk score exceeds 80. |
|
|
36
|
-
| `send_payment` | Native PHRS transfer with risk assessment, address validation, balance checks, and high-exposure warnings. Blocks if risk score exceeds 80. |
|
|
37
|
-
| `approve_token` | ERC-20 approval for DODO router. Supports exact amounts or unlimited ("max") approval. |
|
|
38
|
-
|
|
39
|
-
### Market Intelligence — Know before you trade
|
|
40
|
-
|
|
41
|
-
| Tool | Description |
|
|
42
|
-
|------|-------------|
|
|
43
|
-
| `get_token_price` | Real-time PHRS, USDC, USDT prices derived from DODO liquidity quotes on Pharos. |
|
|
44
|
-
| `get_pool_info` | DODO pool data for any token pair — price ratio, price impact, and fees. |
|
|
45
|
-
| `get_gas_price` | Current Pharos gas price with trend classification (low/normal/high) and cost estimates. |
|
|
46
|
-
|
|
47
|
-
### Wallet & History — Observe the full picture
|
|
48
|
-
|
|
49
|
-
| Tool | Description |
|
|
50
|
-
|------|-------------|
|
|
51
|
-
| `get_wallet_balance` | PHRS, USDC, USDT balances for any wallet with total USD estimate. |
|
|
52
|
-
| `check_allowance` | Check ERC-20 allowance granted to DODO router. Reports whether approval is needed before a swap. |
|
|
53
|
-
| `get_transaction_status` | Look up any transaction by hash — status, block number, gas used, explorer link. |
|
|
54
|
-
| `get_execution_history` | On-chain audit trail for any wallet. Categorizes activity as swaps, transfers, or other. |
|
|
55
|
-
|
|
56
|
-
### On-Chain Risk Registry — Share risk intelligence across agents
|
|
57
|
-
|
|
58
|
-
| Tool | Description |
|
|
59
|
-
|------|-------------|
|
|
60
|
-
| `publish_risk_score` | Run risk assessment and publish the result to the on-chain RiskRegistry smart contract. |
|
|
61
|
-
| `query_risk_registry` | Read any wallet's published risk score from the registry. Read-only — no SignerProvider signer needed. |
|
|
62
|
-
|
|
63
|
-
### x402 Payments — Composable micro-payment gating
|
|
64
|
-
|
|
65
|
-
| Tool | Description |
|
|
66
|
-
|------|-------------|
|
|
67
|
-
| `x402_pay_and_fetch` | Fetch resources from an HTTP x402 payment-gated server. Automatically handles HTTP 402 payment challenge by signing a payment payload and completing the fetch. |
|
|
68
|
-
|
|
69
|
-
### SafeHands Guardrail Tools — Policy-first agent firewall
|
|
70
|
-
|
|
71
|
-
| Tool | Description |
|
|
72
|
-
|------|-------------|
|
|
73
|
-
| `safehands_preflight_check` | Policy-based preflight for payments, approvals, swaps, x402 payments, registry publishing, and custom contract calls. Returns `ALLOW`, `WARN`, `BLOCK`, `REQUIRE_CONFIRMATION`, `REQUIRE_FUNDING`, or `REQUIRE_TOKEN_REVIEW`. |
|
|
74
|
-
| `safehands_safe_execute` | Guarded wrapper that runs preflight first and executes only when the action is allowed, write tools are enabled, and explicit runtime confirmation is provided. |
|
|
75
|
-
| `safehands_wallet_health` | Checks signer availability, wallet mode, PHRS/USDC readiness, gas readiness, x402 readiness, chain ID, and testnet safety posture. |
|
|
76
|
-
| `safehands_x402_preflight` | Validates URL/SSRF safety, x402 payment amount, payment token, signer readiness, and Pharos Atlantic policy before signing. |
|
|
77
|
-
| `safehands_risk_report` | Audit-friendly human-readable report explaining why an action was allowed, warned, blocked, or requires confirmation. |
|
|
78
|
-
| `explain_risk` | Converts a policy decision and reasons into a concise human-readable explanation. |
|
|
79
|
-
| `token_registry_status` | Classifies exact token input as canonical testnet token, demo/test liquidity token, custom, unknown, or invalid. |
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Composability
|
|
84
|
-
|
|
85
|
-
SafeHands is designed as a **building block**, not a standalone application. Other skills and agents compose SafeHands into their workflows by calling its tools as middleware.
|
|
86
|
-
|
|
87
|
-
### Read-only tools (safe for any agent, no key needed)
|
|
88
|
-
`check_token_security` · `simulate_transaction` · `estimate_gas` · `get_token_price` · `get_pool_info` · `get_gas_price` · `get_wallet_balance` · `check_allowance` · `get_transaction_status` · `get_execution_history` · `query_risk_registry`
|
|
89
|
-
|
|
90
|
-
### Read+Write tool (read without key, auto-publishes with key)
|
|
91
|
-
`assess_risk` — returns risk score without a key; if `autoPublish=true` and SignerProvider is configured, also publishes the result to the on-chain RiskRegistry.
|
|
92
|
-
|
|
93
|
-
### Write tools (require a SignerProvider signer)
|
|
94
|
-
`execute_swap` · `send_payment` · `approve_token` · `publish_risk_score` · `x402_pay_and_fetch`
|
|
95
|
-
|
|
96
|
-
### How Phase 2 agents compose with SafeHands
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
┌─────────────────────────────────────────────────────┐
|
|
100
|
-
│ Phase 2 Agent (DeFi bot, payment agent, etc.) │
|
|
101
|
-
│ │
|
|
102
|
-
│ 1. Call assess_risk → get risk score │
|
|
103
|
-
│ 2. Call simulate_transaction → dry run │
|
|
104
|
-
│ 3. If safe → call execute_swap or send_payment │
|
|
105
|
-
│ 4. Call get_transaction_status → confirm result │
|
|
106
|
-
│ 5. Call query_risk_registry → check counterparty │
|
|
107
|
-
└─────────────────────────────────────────────────────┘
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Any agent (including those built with **Anvita Flow**) that performs on-chain actions on Pharos can import SafeHands as its safety layer. The agent handles user intent and strategy; SafeHands handles risk gating and execution.
|
|
111
|
-
|
|
112
|
-
### Cross-agent risk intelligence
|
|
113
|
-
|
|
114
|
-
The RiskRegistry contract (`0x61962a6c812ee9f57b207e1ea47c19ae70bb7141`) enables agents to share risk assessments:
|
|
115
|
-
|
|
116
|
-
- **Agent A** publishes a risk score for a wallet via `publish_risk_score`
|
|
117
|
-
- **Agent B** queries that score via `query_risk_registry` before interacting with the same wallet
|
|
118
|
-
- No API keys, no centralized service — purely on-chain, permissionless
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## Usage Examples
|
|
123
|
-
|
|
124
|
-
**Example 1 — Pre-trade safety check:**
|
|
125
|
-
```
|
|
126
|
-
User: "Swap 100 PHRS to USDC"
|
|
127
|
-
Agent: → assess_risk(swap, PHRS, USDC, 100, wallet)
|
|
128
|
-
→ Score 12/100, low risk, proceed
|
|
129
|
-
→ simulate_transaction(swap, PHRS, USDC, 100)
|
|
130
|
-
→ Would succeed, ~166 USDC out
|
|
131
|
-
→ execute_swap(PHRS, USDC, 100, wallet, SignerProvider)
|
|
132
|
-
→ ✅ TX confirmed
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
**Example 2 — Risk-gated payment:**
|
|
136
|
-
```
|
|
137
|
-
User: "Send 500 PHRS to 0xabc..."
|
|
138
|
-
Agent: → assess_risk(transfer, 500, toAddress=0xabc)
|
|
139
|
-
→ Score 85/100, critical, BLOCKED
|
|
140
|
-
→ "This transfer uses 95% of your wallet. Reduce amount or confirm override."
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
**Example 3 — Portfolio check before action:**
|
|
144
|
-
```
|
|
145
|
-
User: "What's in my wallet?"
|
|
146
|
-
Agent: → get_wallet_balance(wallet) → PHRS=19.4, USDC=0.85, USDT=0
|
|
147
|
-
→ get_token_price(PHRS) → $1.66
|
|
148
|
-
→ "Your portfolio: $32.21 USD across 3 tokens"
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
**Example 4 — Cross-agent reputation lookup:**
|
|
152
|
-
```
|
|
153
|
-
Agent B: → query_risk_registry(0xsuspicious...)
|
|
154
|
-
→ Score 92, critical, block
|
|
155
|
-
→ "This wallet was flagged high-risk by another agent. Refusing to interact."
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## Safety Model
|
|
161
|
-
|
|
162
|
-
1. **Risk-first execution** — every write tool (`execute_swap`, `send_payment`) internally calls `assess_risk` before proceeding.
|
|
163
|
-
2. **Automatic blocking** — actions scoring above 80 are prevented. No override without explicit `bypassRiskCheck`.
|
|
164
|
-
3. **Transient keys** — write tools request signatures through SignerProvider; SignerProvider signers are never returned or logged.
|
|
165
|
-
4. **Simulation before commitment** — `simulate_transaction` lets agents verify outcomes at zero cost before committing gas.
|
|
166
|
-
5. **On-chain audit** — all risk scores can be published to the RiskRegistry, creating a permanent, verifiable record.
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## On-Chain Registry
|
|
171
|
-
|
|
172
|
-
**Contract:** `0x61962a6c812ee9f57b207e1ea47c19ae70bb7141`
|
|
173
|
-
**Chain:** Pharos Atlantic Testnet (688689)
|
|
174
|
-
|
|
175
|
-
The RiskRegistry is a Solidity smart contract deployed on Pharos that stores risk assessments on-chain. Any agent can publish. Any agent can query. No API keys, no centralized infrastructure.
|
|
176
|
-
|
|
177
|
-
When `assess_risk` is called with `autoPublish=true` plus SignerProvider, the result is automatically published — making every risk assessment a permanent, queryable on-chain record that other agents can trust.
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
|
-
## x402 Monetized API Server
|
|
182
|
-
|
|
183
|
-
SafeHands exposes a paid HTTP REST API server using the Coinbase-designed **x402 micro-payment protocol** on Pharos Atlantic. This allows developers to offer risk gating and intelligence tools as a paid utility to external AI agents.
|
|
184
|
-
|
|
185
|
-
### API Endpoints
|
|
186
|
-
- `GET /health` (Free) — Health check, token registry, and receiver addresses.
|
|
187
|
-
- `GET /assess-risk` (Paid: USDC 0.001) — Gate queries with 5-dimension risk score checks.
|
|
188
|
-
- `GET /check-token-security` (Paid: USDC 0.001) — Verify contract security, honeypots, and token code privileges.
|
|
189
|
-
- `GET /simulate-transaction` (Paid: USDC 0.001) — Perform dry-runs of transfers and swaps.
|
|
190
|
-
|
|
191
|
-
### Flow Architecture
|
|
192
|
-
1. **Challenge:** When a client fetches a gated resource, the server replies with `HTTP 402 Payment Required` and a Base64-encoded `PAYMENT-REQUIRED` header specifying token address, receiver wallet, and pricing details.
|
|
193
|
-
2. **On-Chain Settlement:** The client signs a standard authorization envelope with their SignerProvider signer, transferring the micro-payment directly to the recipient wallet.
|
|
194
|
-
3. **Resubmission:** The client resubmits the request, appending the payload signature in the `PAYMENT-SIGNATURE` header.
|
|
195
|
-
4. **Unlocking Content:** The integrated Facilitator verifies the signature, settles the transfer on-chain, and responds with `HTTP 200 OK` carrying the resource response payload.
|
|
196
|
-
|
|
197
|
-
---
|
|
198
|
-
|
|
199
|
-
## Supported Tokens
|
|
200
|
-
|
|
201
|
-
Pharos Atlantic Testnet registered tokens:
|
|
202
|
-
- **PHRS**: Native Pharos token (`0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`)
|
|
203
|
-
- **USDC**: USD Coin (`0xE0BE08c77f415F577A1B3A9aD7a1Df1479564ec8`) - Primary Pharos Skill Engine USDC
|
|
204
|
-
- **USDT**: Tether USD (`0xE7E84B8B4f39C507499c40B4ac199B050e2882d5`)
|
|
205
|
-
- **WBTC**: Wrapped BTC (`0x0c64F03EEa5c30946D5c55B4b532D08ad74638a4`)
|
|
206
|
-
- **WETH**: Wrapped ETH (`0x7d211F77525ea39A0592794f793cC1036eEaccD5`)
|
|
207
|
-
- **WPHRS**: Wrapped PHRS (`0x838800b758277CC111B2d48Ab01e5E164f8E9471`)
|
|
208
|
-
- **altUSDC**: Alternate USDC (`0xcfC8330f4BCAB529c625D12781b1C19466A9Fc8B`) - Alternate Circle-referenced USDC
|
|
209
|
-
|
|
210
|
-
## Chain
|
|
211
|
-
|
|
212
|
-
Pharos Atlantic Testnet — Chain ID 688689 — RPC: `https://atlantic.dplabs-internal.com/`
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"atlantic": {
|
|
3
|
-
"name": "Pharos Atlantic Testnet",
|
|
4
|
-
"chainId": 688689,
|
|
5
|
-
"rpcUrl": "https://atlantic.dplabs-internal.com/",
|
|
6
|
-
"explorerUrl": "https://atlantic.pharosscan.xyz/",
|
|
7
|
-
"nativeCurrency": {
|
|
8
|
-
"name": "PHRS",
|
|
9
|
-
"symbol": "PHRS",
|
|
10
|
-
"decimals": 18
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"pacific": {
|
|
14
|
-
"name": "Pharos Pacific Mainnet",
|
|
15
|
-
"chainId": 1672,
|
|
16
|
-
"rpcUrl": "https://rpc.pharos.xyz",
|
|
17
|
-
"explorerUrl": "https://www.pharosscan.xyz",
|
|
18
|
-
"nativeCurrency": {
|
|
19
|
-
"name": "PROS",
|
|
20
|
-
"symbol": "PROS",
|
|
21
|
-
"decimals": 18
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"atlantic": [
|
|
3
|
-
{
|
|
4
|
-
"symbol": "USDC",
|
|
5
|
-
"name": "USD Coin",
|
|
6
|
-
"address": "0xE0BE08c77f415F577A1B3A9aD7a1Df1479564ec8",
|
|
7
|
-
"decimals": 6
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"symbol": "altUSDC",
|
|
11
|
-
"name": "Alternate USD Coin",
|
|
12
|
-
"address": "0xcfC8330f4BCAB529c625D12781b1C19466A9Fc8B",
|
|
13
|
-
"decimals": 6
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"symbol": "USDT",
|
|
17
|
-
"name": "Tether USD",
|
|
18
|
-
"address": "0xE7E84B8B4f39C507499c40B4ac199B050e2882d5",
|
|
19
|
-
"decimals": 6
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"symbol": "WBTC",
|
|
23
|
-
"name": "Wrapped BTC",
|
|
24
|
-
"address": "0x0c64F03EEa5c30946D5c55B4b532D08ad74638a4",
|
|
25
|
-
"decimals": 18
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"symbol": "WETH",
|
|
29
|
-
"name": "Wrapped ETH",
|
|
30
|
-
"address": "0x7d211F77525ea39A0592794f793cC1036eEaccD5",
|
|
31
|
-
"decimals": 18
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"symbol": "WPHRS",
|
|
35
|
-
"name": "Wrapped PHRS",
|
|
36
|
-
"address": "0x838800b758277CC111B2d48Ab01e5E164f8E9471",
|
|
37
|
-
"decimals": 18
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"pacific": [
|
|
41
|
-
{
|
|
42
|
-
"symbol": "WPROS",
|
|
43
|
-
"name": "Wrapped PROS",
|
|
44
|
-
"address": "0x52c48d4213107b20bc583832b0d951fb9ca8f0b0",
|
|
45
|
-
"decimals": 18
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"symbol": "USDC",
|
|
49
|
-
"name": "USD Coin",
|
|
50
|
-
"address": "0xc879c018db60520f4355c26ed1a6d572cdac1815",
|
|
51
|
-
"decimals": 6
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"symbol": "LINK",
|
|
55
|
-
"name": "Chainlink Token",
|
|
56
|
-
"address": "0x51e2A24742Db77604B881d6781Ee16B5b8fcBE29",
|
|
57
|
-
"decimals": 18
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"symbol": "WETH",
|
|
61
|
-
"name": "Wrapped ETH",
|
|
62
|
-
"address": "0x1f4b7011Ee3d53969bb67F59428a9ec0477856E9",
|
|
63
|
-
"decimals": 18
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
}
|
package/.agents/wallets.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"smoke-agent": {
|
|
3
|
-
"agentId": "smoke-agent",
|
|
4
|
-
"address": "0xB0Bf0b4F81E369005DF03fc5f150aC9cEd20757E",
|
|
5
|
-
"encryptedKey": "0xf390e3a01fac911f608b339364aabfe93f46552db4929b2fd01e0b040390d9ce",
|
|
6
|
-
"environment": "atlantic-testnet",
|
|
7
|
-
"chainId": 688689,
|
|
8
|
-
"isMainnet": false,
|
|
9
|
-
"createdAt": "2026-06-12T13:57:21.166Z"
|
|
10
|
-
},
|
|
11
|
-
"smoke-agent-no-key": {
|
|
12
|
-
"agentId": "smoke-agent-no-key",
|
|
13
|
-
"address": "0xB92eaB93f5da6F9B12791c485c5789c75e105C12",
|
|
14
|
-
"encryptedKey": "0xe8653d92a8cd93cbb9f9ba9170f822c0e89449167a6b3721e57ba4358728dddb",
|
|
15
|
-
"environment": "atlantic-testnet",
|
|
16
|
-
"chainId": 688689,
|
|
17
|
-
"isMainnet": false,
|
|
18
|
-
"createdAt": "2026-06-12T13:57:21.179Z"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# SafeHands-Pharos — Official Docs Alignment Report
|
|
2
|
-
|
|
3
|
-
> **Generated:** 2026-06-12
|
|
4
|
-
> **Project:** SafeHands-Pharos v1.2.0
|
|
5
|
-
> **Scope:** Pharos Atlantic Testnet only (no mainnet)
|
|
6
|
-
> **Methodology:** Every value was checked against live official documentation pages. No hallucinated values.
|
|
7
|
-
|
|
8
|
-
## Official Docs Sources Checked
|
|
9
|
-
|
|
10
|
-
| # | Source URL | Status |
|
|
11
|
-
|---|-----------|--------|
|
|
12
|
-
| 1 | https://docs.pharos.xyz/getting-started/network/atlantic-testnet | Fetched ✅ |
|
|
13
|
-
| 2 | https://docs.pharos.xyz/getting-started/token-registry | Fetched ✅ |
|
|
14
|
-
| 3 | https://docs.pharos.xyz/getting-started/canonical-contracts | Fetched ✅ |
|
|
15
|
-
| 4 | https://docs.pharos.xyz/developer-guide/x402 | Fetched ✅ (prior session) |
|
|
16
|
-
| 5 | https://docs.pharos.xyz/tooling-and-infrastructure/pharos-skill-engine-guide | Fetched ✅ (prior session) |
|
|
17
|
-
| 6 | https://developers.circle.com/stablecoins/usdc-contract-addresses | Fetched ✅ |
|
|
18
|
-
| 7 | https://docs.faroswap.xyz/en/introduction | ❌ HTTP 307 redirect (docs unavailable) |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Alignment Table
|
|
23
|
-
|
|
24
|
-
| # | Item | Project Value | Official Docs Value | Status | Source | Notes |
|
|
25
|
-
|---|------|--------------|---------------------|--------|--------|-------|
|
|
26
|
-
| 1 | Environment name | `atlantic-testnet` | Atlantic Testnet | **DOCS_VERIFIED** | [network/atlantic-testnet](https://docs.pharos.xyz/getting-started/network/atlantic-testnet) | Exact match |
|
|
27
|
-
| 2 | Chain ID | `688689` | `688689` | **DOCS_VERIFIED** | [network/atlantic-testnet](https://docs.pharos.xyz/getting-started/network/atlantic-testnet) | Exact match |
|
|
28
|
-
| 3 | RPC URL | `https://atlantic.dplabs-internal.com/` | `https://atlantic.dplabs-internal.com` | **DOCS_VERIFIED** | [network/atlantic-testnet](https://docs.pharos.xyz/getting-started/network/atlantic-testnet) | Trailing slash in project is harmless |
|
|
29
|
-
| 4 | Explorer URL | `https://atlantic.pharosscan.xyz/` | `https://atlantic.pharosscan.xyz/` | **DOCS_VERIFIED** | [network/atlantic-testnet](https://docs.pharos.xyz/getting-started/network/atlantic-testnet) | Exact match |
|
|
30
|
-
| 5 | Native token symbol | `PHRS` | PHRS (implied as native currency) | **DOCS_VERIFIED** | [network/atlantic-testnet](https://docs.pharos.xyz/getting-started/network/atlantic-testnet) | Used in chain definition |
|
|
31
|
-
| 6 | Primary USDC | `0xE0BE08c77f415F577A1B3A9aD7a1Df1479564ec8` | `0xE0BE08c77f415F577A1B3A9aD7a1Df1479564ec8` | **DOCS_VERIFIED_FROM_PHAROS_SKILL_ENGINE** | Official Skill Engine `tokens.json` | Pharos Skill Engine canonical USDC |
|
|
32
|
-
| 7 | USDT address | `0xE7E84B8B4f39C507499c40B4ac199B050e2882d5` | `0xE7E84B8B4f39C507499c40B4ac199B050e2882d5` | **DOCS_VERIFIED** | [Pharos Token Registry](https://docs.pharos.xyz/getting-started/token-registry) | Exact match |
|
|
33
|
-
| 8 | WBTC address | `0x0c64F03EEa5c30946D5c55B4b532D08ad74638a4` | `0x0c64F03EEa5c30946D5c55B4b532D08ad74638a4` | **DOCS_VERIFIED** | [Pharos Token Registry](https://docs.pharos.xyz/getting-started/token-registry) | Exact match |
|
|
34
|
-
| 9 | WETH address | `0x7d211F77525ea39A0592794f793cC1036eEaccD5` | `0x7d211F77525ea39A0592794f793cC1036eEaccD5` | **DOCS_VERIFIED** | [Pharos Token Registry](https://docs.pharos.xyz/getting-started/token-registry) | Exact match |
|
|
35
|
-
| 10 | WPHRS address | `0x838800b758277CC111B2d48Ab01e5E164f8E9471` | `0x838800b758277CC111B2d48Ab01e5E164f8E9471` | **DOCS_VERIFIED** | [Pharos Token Registry](https://docs.pharos.xyz/getting-started/token-registry) | Exact match |
|
|
36
|
-
| 11 | Alternate USDC | `0xcfC8330f4BCAB529c625D12781b1C19466A9Fc8B` | `0xcfC8330f4BCAB529c625D12781b1C19466A9Fc8B` | **CIRCLE_REFERENCED_USDC** | [Circle USDC](https://developers.circle.com/stablecoins/usdc-contract-addresses) | Listed by Circle but not primary in Skill Engine |
|
|
37
|
-
| 12 | x402 behavior | HTTP 402 + payment payload | x402 = internet-native payment protocol using HTTP 402 | **DOCS_VERIFIED** | [x402 guide](https://docs.pharos.xyz/developer-guide/x402) | Matches protocol description |
|
|
38
|
-
| 13 | Skill Engine structure | `SKILL.safehands.md` + `references/safehands.md` | Capability Index + instruction manuals | **DOCS_VERIFIED** | [Skill Engine guide](https://docs.pharos.xyz/tooling-and-infrastructure/pharos-skill-engine-guide) | Follows PiggyBank reference pattern |
|
|
39
|
-
| 14 | DODO Approve Address | `0x4Cf317b8918FbE8A890c01eDAb7d548555Ac2cE9` | Not found in available docs | **PROJECT_CONFIGURED** | Project constants | FaroSwap docs returned HTTP 307; cannot verify |
|
|
40
|
-
| 15 | DODO Route Proxy | `0x819829e5CF6e19F9fED92F6b4CC1edF45a2cC4A2` | Not found in available docs | **PROJECT_CONFIGURED** | Project constants | FaroSwap docs returned HTTP 307; cannot verify |
|
|
41
|
-
| 16 | Position Manager | `0x1c430d84DD6185b1Ea2d4693e0033799d193542f` | Not found in available docs | **PROJECT_CONFIGURED** | Project constants | Same as above |
|
|
42
|
-
| 17 | RiskRegistry contract | `0x71fc28ed3a31016b42f18764889cd911f22b67b8` | Not in canonical contracts | **PROJECT_CONFIGURED** | Project-deployed contract | Project custom deployment |
|
|
43
|
-
| 18 | Testnet-only scope | `IS_MAINNET = false` | Correct for hackathon | **DOCS_VERIFIED** | Project architecture | Mainnet actions are blocked |
|
|
44
|
-
| 19 | WSS endpoint | Not used | `wss://atlantic.dplabs-internal.com` | N/A | [network/atlantic-testnet](https://docs.pharos.xyz/getting-started/network/atlantic-testnet) | Not needed for SafeHands |
|
|
45
|
-
| 20 | Rate limit | Not enforced client-side | 500 times/5m | N/A | [network/atlantic-testnet](https://docs.pharos.xyz/getting-started/network/atlantic-testnet) | Informational only |
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Verification Status Summary
|
|
50
|
-
|
|
51
|
-
| Status | Count | Items |
|
|
52
|
-
|--------|-------|-------|
|
|
53
|
-
| **DOCS_VERIFIED** | 12 | Environment, Chain ID, RPC, Explorer, Native token, USDT, WBTC, WETH, WPHRS, x402 behavior, Skill Engine, Testnet scope |
|
|
54
|
-
| **DOCS_VERIFIED_FROM_PHAROS_SKILL_ENGINE** | 1 | Primary USDC |
|
|
55
|
-
| **CIRCLE_REFERENCED_USDC** | 1 | Alternate USDC |
|
|
56
|
-
| **PROJECT_CONFIGURED** | 4 | DODO Approve, DODO Route Proxy, Position Manager, RiskRegistry |
|
|
57
|
-
| **UNVERIFIED_BY_OFFICIAL_DOCS** | 0 | — |
|
|
58
|
-
| **CONFLICT** | 0 | — |
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Live Verification Results
|
|
63
|
-
|
|
64
|
-
### RPC Read Test (`npm run test:rpc:live`)
|
|
65
|
-
|
|
66
|
-
| Check | Result |
|
|
67
|
-
|-------|--------|
|
|
68
|
-
| RPC reachable | ✅ yes |
|
|
69
|
-
| Chain ID | 688689 ✅ match |
|
|
70
|
-
| Latest block | 24023029 |
|
|
71
|
-
| Wallet balance | SKIPPED_NO_WALLET_ADDRESS |
|
|
72
|
-
| **Status** | **PASS** |
|
|
73
|
-
|
|
74
|
-
### SafeHands CLI Live Checks (`npm run test:live:safehands`)
|
|
75
|
-
|
|
76
|
-
| # | Check | Result |
|
|
77
|
-
|---|-------|--------|
|
|
78
|
-
| 1 | wallet_health_no_wallet | ✅ PASS |
|
|
79
|
-
| 2 | token_registry_skill_engine_usdc | ✅ PASS |
|
|
80
|
-
| 3 | token_registry_circle_usdc | ✅ PASS |
|
|
81
|
-
| 4 | token_registry_usdt_docs_verified | ✅ PASS |
|
|
82
|
-
| 5 | preflight_block_unlimited_approval | ✅ PASS |
|
|
83
|
-
| 6 | preflight_block_mainnet | ✅ PASS |
|
|
84
|
-
| 7 | preflight_allow_testnet | ✅ PASS |
|
|
85
|
-
| **Status** | **7/7 PASS** |
|
|
86
|
-
|
|
87
|
-
### x402 Behavior Check (`npm run test:x402:live`)
|
|
88
|
-
|
|
89
|
-
| # | Check | Result |
|
|
90
|
-
|---|-------|--------|
|
|
91
|
-
| 1 | /supported without private key | ✅ 200 OK |
|
|
92
|
-
| 2 | /health without private key | ✅ 200 OK, isMainnet=false |
|
|
93
|
-
| 3 | Paid endpoint without config → structured 503 | ✅ X402_SERVER_RECEIVER_CONFIG_MISSING |
|
|
94
|
-
| 4 | No crash on missing config | ✅ All paid endpoints 503 gracefully |
|
|
95
|
-
| 5 | x402 token label matches docs | ✅ USDC on eip155:688689 |
|
|
96
|
-
| Label | **LOCAL_X402_SERVER_DOCS_BEHAVIOR_TEST** |
|
|
97
|
-
| **Status** | **5/5 PASS** |
|
|
98
|
-
|
|
99
|
-
### DODO/FaroSwap Check (`npm run test:dodo:live`)
|
|
100
|
-
|
|
101
|
-
| # | Check | Result |
|
|
102
|
-
|---|-------|--------|
|
|
103
|
-
| 1 | API route check | ⏭️ SKIPPED_MISSING_DODO_API_KEY |
|
|
104
|
-
| 2 | DODO Approve address | ✅ PROJECT_CONFIGURED |
|
|
105
|
-
| 3 | DODO Route Proxy address | ✅ PROJECT_CONFIGURED |
|
|
106
|
-
| **Status** | **2/3 PASS, 1 SKIPPED** |
|
|
107
|
-
|
|
108
|
-
### Full Smoke Test Suite (`npm run test:all`)
|
|
109
|
-
|
|
110
|
-
| Result |
|
|
111
|
-
|--------|
|
|
112
|
-
| **37/37 smoke checks passed** |
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## Remaining Docs-Unverified Values
|
|
117
|
-
|
|
118
|
-
| Value | Current Status | Why |
|
|
119
|
-
|-------|---------------|-----|
|
|
120
|
-
| DODO Approve Address | PROJECT_CONFIGURED | FaroSwap docs HTTP 307; cannot access |
|
|
121
|
-
| DODO Route Proxy | PROJECT_CONFIGURED | FaroSwap docs HTTP 307; cannot access |
|
|
122
|
-
| Position Manager | PROJECT_CONFIGURED | FaroSwap docs HTTP 307; cannot access |
|
|
123
|
-
| RiskRegistry contract | PROJECT_CONFIGURED | Project custom deployment; not in Pharos canonical contracts |
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## Real Transactions Broadcast
|
|
128
|
-
|
|
129
|
-
**None.** All tests are read-only RPC calls, dry-run preflight checks, or local server behavior tests. No transactions were signed or broadcast during this verification pass.
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Conclusion
|
|
134
|
-
|
|
135
|
-
**Status: Ready for DoraHacks Phase 1 submission with real docs/live verification**
|
|
136
|
-
|
|
137
|
-
All 13 docs-verifiable configuration values match official Pharos documentation exactly. The 4 PROJECT_CONFIGURED values are clearly labeled and do not make false claims. Live RPC connectivity to Pharos Atlantic Testnet chain ID 688689 is confirmed. All 37 smoke checks, 7 live CLI checks, 5 x402 behavior checks, and the DODO skip pass cleanly.
|