---
description: Blockchain Development Overview
alwaysApply: false
---

# Blockchain Development Overview

Guidelines for blockchain and Web3 development: smart contracts, DeFi protocols, and dApps.

## Scope

- Smart contract development (Solidity, Vyper)
- DeFi protocols (AMMs, lending, yield strategies)
- Token implementations (ERC-20, ERC-721, ERC-1155, ERC-4626)
- Web3 frontend applications
- Cross-chain and L2 integrations

## Core Principles

- **Security is non-negotiable** — immutable code handles real value; assume all inputs are malicious; follow checks-effects-interactions; get audited before mainnet
- **Gas efficiency matters** — users pay for every operation; optimize storage access; use calldata over memory; pack variables into slots
- **Composability is king** — follow established standards; design for integration; document external interfaces
- **Defense in depth** — multiple layers of access control; rate limiting and circuit breakers; monitoring and incident response; gradual rollouts with timelocks

## Key Tooling

- **Contracts**: Solidity 0.8.x, OpenZeppelin, Foundry (Forge)
- **Analysis**: Slither, Mythril
- **Frontend**: Viem, Wagmi, ConnectKit/RainbowKit
- **Infra**: Alchemy/Infura, The Graph, Tenderly

## Definition of Done

### Smart Contract
- Tests cover all branches (>95%), fuzz + invariant tests pass
- Slither zero high/medium findings, gas benchmarks documented
- NatSpec on all functions, external audit completed (mainnet)

### Web3 Frontend
- Works with multiple wallets, handles all tx states (pending/confirmed/failed)
- Meaningful error messages, mobile wallet compatible
