dvcrn/openclaw-skills-marketplace/afrexai-web3-engineering
- community
Checking that the SKILL.md file is still in the repository.
Web3 & Blockchain Engineering
Install
npx vskill@latest install dvcrn/openclaw-skills-marketplace/afrexai-web3-engineeringSKILL.md
Web3 & Blockchain Engineering
Complete methodology for evaluating, designing, building, securing, and operating blockchain-based systems. Covers smart contract development, DeFi protocol design, token economics, security auditing, and production operations.
Zero dependencies. Framework-agnostic. Works with any blockchain, any language, any AI agent.
Phase 1: Should You Use Blockchain?
The Database Test
Before writing a single line of Solidity, answer honestly:
Decision rules:
- Score ≤ 0 → Use PostgreSQL with audit logs
- Score 1-2 → Hybrid (anchoring/notarization on-chain, logic off-chain)
- Score 3+ → Blockchain is justified
Platform Selection Matrix
| Platform | TPS | Finality | Gas Cost | Best For | |
|---|---|---|---|---|---|
| Ethereum L1 | ~30 | ~12 min | $1-50+ | Settlement, high-value DeFi | |
| Arbitrum | ~4,000 | ~1 sec (soft) | $0.01-0.10 | DeFi, general dApps | |
| Optimism | ~2,000 | ~2 sec (soft) | $0.01-0.15 | Public goods, governance | |
| Base | ~2,000 | ~2 sec (soft) | $0.001-0.05 | Consumer apps, social | |
| Polygon PoS | ~7,000 | ~2 sec | $0.001-0.01 | Gaming, mass-market | |
| Solana | ~65,000 | ~400ms | $0.00025 | High-frequency, DePIN | |
| Avalanche C | ~4,500 | ~1 sec | $0.01-0.10 | Enterprise, subnets | |
| BNB Chain | ~2,000 | ~3 sec | $0.01-0.05 | Retail, low-cost | |
| Bitcoin L1 | ~7 | ~60 min | $0.50-5+ | Store of value, settlement | |
| Bitcoin L2 (Lightning) | ~1M+ | instant | <$0.01 | Micropayments, P2P |
Selection decision tree:
- Store of value / settlement only? → Bitcoin
- Micropayments / instant P2P? → Lightning Network
- Need EVM compatibility? → Yes: continue. No: consider Solana, Cosmos
- High-value DeFi / maximum security? → Ethereum L1
- General dApp with low gas? → Arbitrum or Base
- Mass-market consumer? → Base or Polygon
- Enterprise with custom rules? → Avalanche subnets or Hyperledger
Phase 2: Smart Contract Architecture
Design Principles
- Minimize on-chain state — Storage is expensive. Put data on-chain only if it needs consensus
- Fail loudly — Use
require()/revert()with descriptive messages, never silent failures - Immutability by default — Upgradeability adds attack surface. Only use if genuinely needed
- Separation of concerns — One contract per responsibility
- Gas-conscious design — Every operation costs money. Optimize hot paths
Contract Architecture Patterns
Upgrade Pattern Decision
| Pattern | Complexity | Gas Overhead | Storage Layout Risk | Best For | |
|---|---|---|---|---|---|
| Immutable | None | None | None | Simple contracts, tokens | |
| Transparent Proxy | Medium | +gas per call | High | Standard upgradeable | |
| UUPS | Medium | Lower than transparent | High | Gas-efficient upgradeable | |
| Diamond (EIP-2535) | High | Medium | High | Large modular systems | |
| Beacon | Medium | Medium | High | Many identical instances |
Rule: If you can avoid upgradeability, do it. If you must upgrade, use UUPS with timelock + multisig governance.
Solidity Development Standards
Coding Standards Checklist
- [ ] NatSpec on every public/external function
- [ ] Custom errors instead of require strings (saves ~50 gas each)
- [ ] Events for every state change
- [ ] CEI pattern (Checks-Effects-Interactions) on every external call
- [ ]
nonReentranton functions with external calls - [ ]
immutable/constantwhere possible - [ ] SafeERC20 for all token transfers
- [ ] No
tx.originfor auth (phishing vector) - [ ] Explicit visibility on all functions and state variables
- [ ] Storage variable packing (group smaller types together)
Phase 3: Token Economics (Tokenomics)
Token Type Decision
| Type | Standard | Use Case | Regulatory Risk | |
|---|---|---|---|---|
| Utility token | ERC-20 | Access, governance, gas | Medium | |
| Governance token | ERC-20 + voting | Protocol control | Medium | |
| Security token | ERC-1400/3643 | Equity, revenue share | HIGH — requires compliance | |
| NFT (unique) | ERC-721 | Collectibles, identity, access | Low-Medium | |
| Semi-fungible | ERC-1155 | Gaming items, editions | Low | |
| Soulbound (SBT) | ERC-5192 | Credentials, reputation | Low | |
| Stablecoin | ERC-20 + peg | Payments, DeFi collateral | HIGH — regulatory scrutiny |
Token Design Framework
Tokenomics Red Flags
| Red Flag | Why It's Bad | Fix | |
|---|---|---|---|
| >20% team allocation | Centralization, dump risk | Cap at 15-20%, long vesting | |
| No cliff period | Immediate sell pressure | 12-month cliff minimum | |
| Inflationary without utility | Token printing → zero | Emissions tied to real revenue | |
| "Yield" from new deposits | Ponzi economics | Real yield from fees only | |
| Governance without timelock | Admin can rug | Timelock + multisig mandatory | |
| 100% unlocked at launch | Massive sell pressure | Staged unlock over 2-4 years |
Phase 4: DeFi Protocol Design
Core DeFi Primitives
| Primitive | What It Does | Key Risk | Examples | |
|---|---|---|---|---|
| AMM (DEX) | Trustless token swaps | Impermanent loss | Uniswap, Curve | |
| Lending | Overcollateralized loans | Liquidation cascades | Aave, Compound | |
| Stablecoin | Price-stable token | Depeg risk | MakerDAO, Ethena | |
| Yield aggregator | Optimize yield farming | Smart contract risk stacking | Yearn | |
| Perpetuals | Leveraged derivatives | Liquidation, oracle manipulation | GMX, dYdX | |
| Liquid staking | Stake + maintain liquidity | Slashing, depeg | Lido, Rocket Pool | |
| Bridges | Cross-chain transfers | Bridge exploits (billions lost) | LayerZero, Wormhole | |
| Restaking | Re-use staked assets | Cascading slashing | EigenLayer |
AMM Design (Uniswap V2/V3 Pattern)
DeFi Security Invariants
Every DeFi protocol MUST maintain these:
- Solvency — Total assets ≥ total liabilities (always)
- No free tokens — No path creates tokens from nothing
- Monotonic shares — Depositing increases shares, withdrawing decreases
- Oracle freshness — Price data is within acceptable staleness window
- Liquidation viability — Undercollateralized positions can always be liquidated
- Access control — Admin functions behind timelock + multisig
- Withdrawal guarantee — Users can always withdraw their assets (no lock-up without consent)
Phase 5: Security Auditing
Vulnerability Taxonomy
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/1kalin--afrexai-web3-engineering/skills/afrexai-web3-engineering/SKILL.md
Popularity
- Repository stars
- 24
- Repository forks
- 9
- 7-day trend score
- 16
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dvcrn/openclaw-skills-marketplace/afrexai-web3-engineering)