← 返回
未分类 中文

WEB3 Integration

Integrate apps with blockchain providers, wallets, and contract calls safely.
安全地将应用与区块链提供商、钱包和合约调用集成。
mzfshark mzfshark 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 333
下载
💾 0
安装
1
版本
#dev#latest

概述

SKILL: web3-integration

Purpose

Integrate a frontend/backend with blockchain interaction (wallet connect, provider configuration, contract calls) using safe, testable patterns.

When to Use

  • A dApp needs to read/write contract state.
  • A backend service must index or react to on-chain events.
  • Wallet connection UX and chain gating is required.

Inputs

  • stack (required, enum: ethers|viem|web3js): preferred client library.
  • chain (required, string): chain name + chainId.
  • rpc (optional, string): RPC URL reference (env/config), not hardcoded.
  • contract_address (required, string).
  • abi_source (required, string): ABI path/artifact reference.
  • wallet_flow (optional, enum: injected|walletconnect|server_signer).

Steps

  1. Validate chain/contract coordinates (chainId, address format, ABI match).
  2. Set provider/signer flow:
    • frontend: user wallet signer
    • backend: server signer only when explicitly required and keys are secured externally
  3. Implement contract client wrapper:
    • typed interfaces when possible
    • explicit timeouts/retries for RPC
  4. Add chain gating:
    • refuse wrong chain
    • prompt network switch (frontend)
  5. Add logging/audit hooks for write operations.
  6. Add tests:
    • unit tests for wrapper
    • local chain simulation when available

Validation

  • No secrets stored in repo (keys only via secrets manager/env).
  • Wrong-chain behavior is safe (no accidental writes).
  • Errors are handled deterministically (retry policy is explicit).

Output

  • Wrapper module path(s)
  • Environment variable contract (what must be configured)
  • Validation commands (tests/build)

Safety Rules

  • Never request or paste private keys into chat/output.
  • Never default to mainnet.
  • Avoid “auto-sign” server flows unless explicitly required and approved.

Example

Input:

  • stack: viem
  • chain: base:8453
  • contract_address: 0x...
  • abi_source: artifacts/MyContract.json

Output:

  • src/web3/client.ts with chainId checks and a typed contract instance.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 20:00 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 199 📥 68,361
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,210
data-analysis

OnChain Analysis

mzfshark
战略性解读区块链数据,以数据支撑的证据和明确的不确定性,识别模式、异常和流向。
★ 0 📥 621