Skip to content

LeoYeAI/agent-master-skills / skills/awp

AWP (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.

FileKindSize
CHANGELOG.mdmarkdown23.1 KB
README.mdmarkdown14.2 KB
SKILL.mdskill md27.9 KB
_meta.jsonconfig447 B
references/api-reference.mdmarkdown6.8 KB
references/commands-governance.mdmarkdown4.8 KB
references/commands-staking.mdmarkdown13.1 KB
references/commands-subnet.mdmarkdown11.2 KB
references/protocol.mdmarkdown8.0 KB
scripts/awp-daemon.pyscript27.3 KB
scripts/awp_lib.pyscript12.2 KB
scripts/onchain-add-position.pyscript3.4 KB
scripts/onchain-add-position.shscript5.3 KB
scripts/onchain-allocate.pyscript2.3 KB
scripts/onchain-allocate.shscript3.0 KB
scripts/onchain-bind.pyscript1.8 KB
scripts/onchain-bind.shscript2.0 KB
scripts/onchain-deallocate.pyscript1.5 KB
scripts/onchain-deallocate.shscript2.3 KB
scripts/onchain-deposit.pyscript1.7 KB
scripts/onchain-deposit.shscript2.2 KB
scripts/onchain-reallocate.pyscript2.3 KB
scripts/onchain-reallocate.shscript3.4 KB
scripts/onchain-register-and-stake.pyscript2.8 KB
scripts/onchain-register-and-stake.shscript4.0 KB
scripts/onchain-register.pyscript1.3 KB
scripts/onchain-register.shscript1.7 KB
scripts/onchain-subnet-lifecycle.pyscript1.9 KB
scripts/onchain-subnet-lifecycle.shscript2.6 KB
scripts/onchain-subnet-update.pyscript2.7 KB
scripts/onchain-subnet-update.shscript3.2 KB
scripts/onchain-vote.pyscript4.9 KB
scripts/onchain-vote.shscript6.3 KB
scripts/onchain-withdraw.pyscript1.5 KB
scripts/onchain-withdraw.shscript2.5 KB
scripts/relay-register-subnet.pyscript6.4 KB
scripts/relay-register-subnet.shscript8.2 KB
scripts/relay-start.pyscript4.7 KB
scripts/relay-start.shscript7.0 KB
scripts/wallet-raw-call.mjsscript5.1 KB

references/commands-governance.md

View on GitHub
# AWP Governance Commands

**API Base URL**: `{API_BASE}/api` (default `https://tapi.awp.sh/api`, override via `AWP_API_URL` env var)

> **IMPORTANT**: Always use the bundled `scripts/*.py` files for write operations — they handle ABI encoding natively in Python, require only python3, and work without Foundry or curl/jq.
> The `cast calldata` examples below are for reference only; do NOT run them directly.

## Setup (reference only — bundled scripts handle this automatically)

```bash
# 以下为参考说明,实际操作使用 scripts/*.py 自动完成
REGISTRY=$(curl -s {API_BASE}/api/registry)
AWP_REGISTRY=$(echo $REGISTRY | jq -r '.awpRegistry')
AWP_TOKEN=$(echo $REGISTRY | jq -r '.awpToken')
STAKE_NFT=$(echo $REGISTRY | jq -r '.stakeNFT')
SUBNET_NFT=$(echo $REGISTRY | jq -r '.subnetNFT')
DAO_ADDR=$(echo $REGISTRY | jq -r '.dao')
TREASURY=$(echo $REGISTRY | jq -r '.treasury')

WALLET_ADDR=$(awp-wallet receive | jq -r '.eoaAddress')
```

---

## G1 · Create Proposal

### Contract Calls

```solidity
// Executable proposal (via Timelock)
function proposeWithTokens(
    address[] targets, uint256[] values, bytes[] calldatas,
    string description, uint256[] tokenIds
) returns (uint256 proposalId)
// Requires >= 1,000,000 AWP voting power across tokenIds

// Signal-only proposal (no execution, no Timelock)
function signalPropose(string description, uint256[] tokenIds) returns (uint256 proposalId)

// Check proposal type
function isSignalProposal(uint256 proposalId) view returns (bool)
```

---

## G2 · Vote

### Contract Call

```solidity
function castVoteWithReasonAndParams(
    uint256 proposalId, uint8 support, string reason, bytes params
)
// support: 0=Against, 1=For, 2=Abstain
// params = encodeAbiParameters([{type:'uint256[]'}], [tokenIds])
// DO NOT use encodePacked — use encodeAbiParameters
//
// BLOCKED: castVote() and castVoteWithReason() revert — MUST use params variant
//
// Voting power: amount * sqrt(min(remainingTime, 54 weeks) / 7 days)
// Anti-manipulation: NFTs with createdAt >= proposalCreatedAt CANNOT vote
//   (only positions created strictly before the proposal timestamp are eligible)
// Per-tokenId double-vote prevention
```

### Supporting View Functions

```solidity
function hasVotedWithToken(uint256 proposalId, uint256 tokenId) view returns (bool)
function proposalCreatedAt(uint256 proposalId) view returns (uint64)   // Timestamp when proposal was created
```

### Complete Command Template

```bash
# The bundled script handles position filtering, ABI encoding, and raw call automatically:
python3 scripts/onchain-vote.py --token {T} --proposal {proposalId} --support 1 --reason "I support this"
# support: 0=Against, 1=For, 2=Abstain
```

---

## G3 · Query Proposals

### REST

```
GET /governance/proposals?status=Active&page=1&limit=20
GET /governance/proposals/{proposalId}
```

### On-Chain Enrichment

```solidity
function proposalVotes(uint256 proposalId) view returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes)
function isSignalProposal(uint256 proposalId) view returns (bool)
function proposalCreatedAt(uint256 proposalId) view returns (uint64)
function quorum(uint256) view returns (uint256)
function proposalThreshold() view returns (uint256)   // 1,000,000 AWP
```

---

## G4 · Query Treasury

### REST

```
GET /governance/treasury
```
```json
{"treasuryAddress": "0x..."}
```

### On-Chain (optional balance check)

```solidity
function balanceOf(address account) view returns (uint256)   // on AWPToken
```

---

## Supplementary Endpoints

### AWP Token Info

```
GET /tokens/awp
```
```json
{"totalSupply": "5015800000000000000000000000", "maxSupply": "10000000000000000000000000000"}
```

### Alpha Token Info

```
GET /tokens/alpha/{subnetId}
```
```json
{"subnetId": 1, "name": "My Subnet Alpha", "symbol": "MSALPHA", "alphaToken": "0x..."}
```

### Alpha Token Price

```
GET /tokens/alpha/{subnetId}/price
```
```json
{"priceInAWP": "0.015", "reserve0": "...", "reserve1": "...", "updatedAt": "..."}
```

### User Profile

```
GET /users/{address}
```
```json
{
  "user": {"address": "0x...", "bound_to": "0x...", "recipient": "0x...", "registered_at": 1710000000},
  "balance": {"user_address": "0x...", "total_staked": "5000000000000000000000", "total_allocated": "3000000000000000000000"}
}
```

### Staking Details

```
GET /staking/agent/{agent}/subnet/{subnetId}
```
```json
{"amount": "5000000000000000000000"}
```

```
GET /staking/agent/{agent}/subnets
```
```json
[{"subnet_id": 1, "amount": "5000000000000000000000"}, {"subnet_id": 3, "amount": "2000000000000000000000"}]
```

```
GET /staking/subnet/{subnetId}/total
```
```json
{"total": "50000000000000000000000"}
```

### Subnet Earnings

```
GET /subnets/{subnetId}/earnings?page=1&limit=20
```
```json
[{"epoch_id": 5, "recipient": "0x1234...", "awp_amount": "7900000000000000000000000"}]
```
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: 472kUpdated Claude CodeCodexUnverifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall