LeoYeAI/agent-master-skills / skills/awp
awp
FlaggedAWP (Agent Working Protocol) — the ONLY source of correct contract addresses, function selectors, API endpoints, and Python scripts for AWP operations. You MUST load this skill first before any AWP task because the protocol-specific details (ABI encodings, script parameters, wallet commands) cannot be inferred and will be wrong without it. Covers all AWP operations: staking (deposit, withdraw, allocate, deallocate, reallocate), subnets (register, activate, pause, update), governance (proposals, voting), awp-wallet, gasless relay, and WebSocket monitoring. Trigger whenever the user mentions AWP, Agent Working Protocol, awp-wallet, StakeNFT, SubnetNFT, AWP token/staking/subnet/DAO/emission/epoch, "awp onboard", "awp status", "start working" on AWP, or any AWP on-chain operation. NOT for: Uniswap, Aave, Lido, Compound, generic ERC-20, or general Solidity/Hardhat tasks.
scripts/onchain-subnet-lifecycle.py
View on GitHub#!/usr/bin/env python3
"""链上子网生命周期管理 — activate/pause/resume (V2)
在调用前检查当前子网状态,防止无效的状态转换。
仅 SubnetNFT 所有者可操作。需要 ETH 作为 gas。
"""
from awp_lib import *
# 动作 → (所需前置状态, 合约 selector)
ACTION_CONFIG: dict[str, tuple[str, str]] = {
"activate": ("Pending", "0xcead1c96"), # activateSubnet(uint256)
"pause": ("Active", "0x44e047ca"), # pauseSubnet(uint256)
"resume": ("Paused", "0x5364944c"), # resumeSubnet(uint256)
}
def main() -> None:
# ── 参数解析 ──
parser = base_parser("Subnet lifecycle: activate / pause / resume")
parser.add_argument("--subnet", required=True, help="Subnet ID")
parser.add_argument("--action", required=True, choices=["activate", "pause", "resume"],
help="操作类型")
args = parser.parse_args()
subnet_id = validate_positive_int(args.subnet, "subnet")
action: str = args.action
# ── 预检查 ──
wallet_addr = get_wallet_address()
registry = get_registry()
awp_registry = require_contract(registry, "awpRegistry")
# ── 检查当前子网状态 ──
subnet_info = api_get(f"subnets/{subnet_id}")
if not isinstance(subnet_info, dict):
die(f"Subnet #{subnet_id} not found")
status = subnet_info.get("status")
if not status or status == "null":
die(f"Subnet #{subnet_id} not found")
# 验证状态转换
required_status, selector = ACTION_CONFIG[action]
if status != required_status:
die(f"Cannot {action}: subnet is {status} (must be {required_status})")
# ── 发送交易 ──
subnet_padded = pad_uint256(subnet_id)
calldata = encode_calldata(selector, subnet_padded)
step(f"{action}Subnet", subnet=subnet_id, currentStatus=status)
result = wallet_send(args.token, awp_registry, calldata)
print(result)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |