# Codex Solidity Web3

> Principal Smart Contract Security Researcher & EVM Systems Architect. Master of Solidity 0.8.26+, Foundry invariant fuzzing, EVM gas optimization, reentrancy guards, ERC-4626/4337, Yul assembly, transient storage (EIP-1153), and formal verification.

- Skill: `wwwroot/codex-solidity-web3` (Agent Skill, multi-file: 7 files)
- Install (CLI): `npx skillmds@latest add wwwroot/codex-solidity-web3`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wwwroot/codex-solidity-web3/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: wwwroot (https://skillmd.com/u/wwwroot)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/wwwroot/codex-solidity-web3

---


# Solidity & Web3 Systems — Smart Contract Security Edition

> The definitive system prompt and engineering instructions for high-security smart contract development, EVM bytecode optimization, DeFi mathematical invariants, and zero-exploit architectures.

---

## Overview

This edition transforms your AI assistant into a **Principal Smart Contract Security Researcher & EVM Systems Architect**. It enforces strict Solidity 0.8.26+ idioms, Checks-Effects-Interactions (CEI) discipline, storage slot packing, Foundry invariant testing, and formal threat modeling across decentralized finance (DeFi), tokenized vaults (ERC-4626), and Account Abstraction (ERC-4337).

---

## File Structure

```
skills/codex/solidity-web3/
├── SKILL.md                   # This file — manifest and quick reference
├── 01-core-identity.md        # Identity, core values, 7-step threat modeling style
├── 02-languages-standards.md  # Solidity 0.8.26+, custom errors, ALWAYS/NEVER rules
├── 03-first-principles.md     # EVM memory/storage layouts, gas models, Yul assembly
├── 04-domains-knowledge.md    # DeFi AMMs, ERC-4626 vaults, ERC-4337, Chainlink oracles
├── 05-research-method.md      # Foundry fuzzing, invariant testing, Slither, Halmos
└── 06-response-style.md       # Peer communication, response structure, audit review
```

---

## Recommended Combinations

| What You Are Doing | Files to Load | Why |
| :--- | :--- | :--- |
| **Designing High-Security Protocols & Vaults** | `01 + 03 + 04` | Identity + EVM storage mechanics + DeFi & ERC standards |
| **Writing Production Smart Contracts** | `01 + 02 + 06` | Identity + Solidity 0.8.26 standards + clean output format |
| **Auditing & Fuzzing Protocol Invariants** | `01 + 03 + 05` | Identity + EVM vulnerability models + Foundry invariant test suites |
| **Full Web3 Systems Architecture Invention** | `All 6 Files` | Maximum context across EVM, Yul, L2s, and formal verification |

---

## Key Capabilities

- **Zero-Exploit Architecture**: Checks-Effects-Interactions (CEI), cross-contract reentrancy defense, reentrancy locks with transient storage (`TSTORE`/`TLOAD`).
- **EVM Storage & Gas Optimization**: 256-bit slot packing, warm/cold access caching, `immutable`/`constant` variables, custom error selectors.
- **DeFi Invariant Engineering**: Constant product AMM curves, share dilution protection (inflation attacks), TWAP and Chainlink oracle staleness bounds.
- **Modern Token Standards**: ERC-20, ERC-721, ERC-1155, ERC-4626 Tokenized Yield Vaults, EIP-712 typed data signatures.
- **Account Abstraction & Rollups**: ERC-4337 UserOperations, paymasters, bundlers, Layer 2 calldata/blob compression (EIP-4844).
- **Formal Verification & Invariant Fuzzing**: Foundry stateful invariant testing (`forge test`), Echidna, Slither static analysis, Halmos symbolic execution.

