blockchain-web3
travisjneuman/.claude/skills/blockchain-web3/SKILL.md
Solidity smart contracts, Web3 development, DeFi protocols, NFTs, EVM chains, Hardhat/Foundry tooling, and blockchain security. Use when writing smart contracts, building dApps, auditing contract security, or integrating Web3 wallets.
Skill99 starsChanged 7 months ago
What's in it
- Blockchain & Web3 Development
- Smart Contract Development (Solidity)
- Contract Structure
- Security Patterns
- Common Vulnerabilities
- Development Tooling
- Hardhat
- Foundry
- Frontend Integration (ethers.js v6 / viem)
- DeFi Patterns
- Gas Optimization
---
name: blockchain-web3
description: Solidity smart contracts, Web3 development, DeFi protocols, NFTs, EVM chains, Hardhat/Foundry tooling, and blockchain security. Use when writing smart contracts, building dApps, auditing contract security, or integrating Web3 wallets.
---
# Blockchain & Web3 Development
## Smart Contract Development (Solidity)
### Contract Structure
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20, Ownable {
constructor() ERC20("MyToken", "MTK") Ownable(msg.sender) {
_mint(msg.sender, 1000000 * 10 ** decimals());
}
}
```
### Security Patterns
- **Checks-Effects-Interactions:** Validate → update state → external calls
- **Reentrancy guard:** Use OpenZeppelin `ReentrancyGuard` or `nonReentrant`
- **Access control:** `Ownable`, `AccessControl`, or custom modifiers
- **Integer safety:** Solidity 0.8+ has built-in overflow checks
- **Pull over push:** Let users withdraw rather than sending funds
### Common Vulnerabilities
| Vulnerability | Prevention |
|--------------|------------|
| Reentrancy | `nonReentrant` modifier, CEI pattern |
| Front-running | Commit-reveal schemes, flashbot protection |
| Oracle manipulation | Use Chainlink, TWAP over spot prices |
| Unchecked return values | Always check `transfer()` return or use `safeTransfer` |
| Delegatecall injection | Never delegatecall to user-supplied addresses |
## Development Tooling
### Hardhat
```bash
npx hardhat init
npx hardhat compile
npx hardhat test
npx hardhat deploy --network sepolia
```
### Foundry
```bash
forge init
forge build
forge test -vvv
forge script script/Deploy.s.sol --rpc-url $RPC --broadcast
```
## Frontend Integration (ethers.js v6 / viem)
```typescript
// viem (recommended for new projects)
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
const client = createPublicClient({ chain: mainnet, transport: http() })
const balance = await client.getBalance({ address: '0x...' })
// wagmi hooks (React)
import { useAccount, useBalance, useContractWrite } from 'wagmi'
const { address } = useAccount()
const { data: balance } = useBalance({ address })
```
## DeFi Patterns
- **AMM:** Constant product formula (x * y = k), concentrated liquidity
- **Lending:** Overcollateralized loans, liquidation mechanisms, interest rate models
- **Staking:** Reward distribution with `rewardPerToken` accumulator pattern
- **Governance:** Token-weighted voting, timelock controllers, proposal lifecycle
## Gas Optimization
- Use `calldata` over `memory` for read-only params
- Pack structs (smaller types together for slot efficiency)
- Use `unchecked` blocks for safe arithmetic
- Minimize storage reads/writes (cache in memory)
- Use events instead of storage for data that doesn't need on-chain access
More agent context in travisjneuman/.claude
127 other files this repository gives its agents, the first 60 shown.
CLAUDE.md
Skill
- accessibility-a11yskills/accessibility-a11y/SKILL.md
- agent-teamsskills/agent-teams/SKILL.md
- ai-ml-developmentskills/ai-ml-development/SKILL.md
- ai-policy-generatorskills/ai-policy-generator/SKILL.md
- android-developmentskills/android-development/SKILL.md
- api-designskills/api-design/SKILL.md
- application-securityskills/application-security/SKILL.md
- ar-vr-xrskills/ar-vr-xr/SKILL.md
- audio-productionskills/audio-production/SKILL.md
- authentication-patternsskills/authentication-patterns/SKILL.md
- auto-claudeskills/auto-claude/SKILL.md
- battle-card-builderskills/battle-card-builder/SKILL.md
- brand-identityskills/brand-identity/SKILL.md
- business-strategyskills/business-strategy/SKILL.md
- career-path-plannerskills/career-path-planner/SKILL.md
- case-interview-practiceskills/case-interview-practice/SKILL.md
- codebase-documenterskills/codebase-documenter/SKILL.md
- compliance-engineeringskills/compliance-engineering/SKILL.md
- content-repurposerskills/content-repurposer/SKILL.md
- contract-redlinerskills/contract-redliner/SKILL.md
- core-workflowskills/core-workflow/SKILL.md
- course-material-creatorskills/course-material-creator/SKILL.md
- customer-persona-builderskills/customer-persona-builder/SKILL.md
- customer-successskills/customer-success/SKILL.md
- database-expertskills/database-expert/SKILL.md
- data-engineeringskills/data-engineering/SKILL.md
- data-scienceskills/data-science/SKILL.md
- debate-practice-coachskills/debate-practice-coach/SKILL.md
- debug-systematicskills/debug-systematic/SKILL.md
- devex-sdk-designskills/devex-sdk-design/SKILL.md
- devops-cloudskills/devops-cloud/SKILL.md
- docxskills/document-skills/docx/SKILL.md
- pdfskills/document-skills/pdf/SKILL.md
- pptxskills/document-skills/pptx/SKILL.md
- document-skillsskills/document-skills/SKILL.md
- xlsxskills/document-skills/xlsx/SKILL.md
- edge-computingskills/edge-computing/SKILL.md
- electron-desktopskills/electron-desktop/SKILL.md
- email-systemsskills/email-systems/SKILL.md
- embedded-iotskills/embedded-iot/SKILL.md
- event-driven-architectureskills/event-driven-architecture/SKILL.md
- event-plannerskills/event-planner/SKILL.md
- financeskills/finance/SKILL.md
- financial-scenario-plannerskills/financial-scenario-planner/SKILL.md
- flutter-developmentskills/flutter-development/SKILL.md
- frontend-enhancerskills/frontend-enhancer/SKILL.md
- fundraising-analyzerskills/fundraising-analyzer/SKILL.md
- game-developmentskills/game-development/SKILL.md
- generic-code-reviewerskills/generic-code-reviewer/SKILL.md
- generic-design-systemskills/generic-design-system/SKILL.md
- generic-feature-developerskills/generic-feature-developer/SKILL.md
- generic-fullstack-code-reviewerskills/generic-fullstack-code-reviewer/SKILL.md
- generic-fullstack-design-systemskills/generic-fullstack-design-system/SKILL.md
- generic-fullstack-feature-developerskills/generic-fullstack-feature-developer/SKILL.md
- generic-fullstack-ux-designerskills/generic-fullstack-ux-designer/SKILL.md
- generic-react-code-reviewerskills/generic-react-code-reviewer/SKILL.md
- generic-react-design-systemskills/generic-react-design-system/SKILL.md
- generic-react-feature-developerskills/generic-react-feature-developer/SKILL.md
- generic-react-ux-designerskills/generic-react-ux-designer/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

