Ethereum Smart Contract Vulnerability Analysis
tradecatlabs/vibe-coding-cn
Runs Slither and Mythril against Solidity contracts to find reentrancy, overflow and access-control bugs before mainnet deployment, then triages and reports findings.
Comprehensive reentrancy attack patterns and defenses for Solidity.
$ npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ccashwell/evm-cortex reentrancy-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/reentrancy-patterns .claude/skills/reentrancy-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "reentrancy-patterns" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/reentrancy-patterns into .claude/skills/reentrancy-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "reentrancy-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ccashwell/evm-cortex/tree/main/skills/reentrancy-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ccashwell/evm-cortex reentrancy-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/reentrancy-patterns .agents/skills/reentrancy-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "reentrancy-patterns" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/reentrancy-patterns into .agents/skills/reentrancy-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "reentrancy-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ccashwell/evm-cortex reentrancy-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/reentrancy-patterns .cursor/skills/reentrancy-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "reentrancy-patterns" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/reentrancy-patterns into .cursor/skills/reentrancy-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "reentrancy-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ccashwell/evm-cortex.git --path skills/reentrancy-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ccashwell/evm-cortex reentrancy-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/reentrancy-patterns .gemini/skills/reentrancy-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "reentrancy-patterns" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/reentrancy-patterns into .gemini/skills/reentrancy-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "reentrancy-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ccashwell/evm-cortex reentrancy-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/reentrancy-patterns .github/skills/reentrancy-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "reentrancy-patterns" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/reentrancy-patterns into .github/skills/reentrancy-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "reentrancy-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ccashwell/evm-cortex reentrancy-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/reentrancy-patterns .opencode/skills/reentrancy-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "reentrancy-patterns" agent skill from https://github.com/ccashwell/evm-cortex/tree/main/skills/reentrancy-patterns into .opencode/skills/reentrancy-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "reentrancy-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
reentrancy-patternsComprehensive reentrancy attack patterns and defenses for Solidity.
Reentrancy Patterns is an agent skill from ccashwell/evm-cortex. Comprehensive reentrancy attack patterns and defenses for Solidity. Use when writing contracts with external calls, integrating tokens with callbacks (ERC-777, ERC-1363), or auditing for reentrancy vulnerabilities. Covers all variants including read-only reentrancy.
Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Security, covering Smart contract auditing. It works with Solidity. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.
Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Reentrancy Patterns loads about 1.9k tokens when it runs. Until then it costs about 72 tokens; SKILL.md has 209 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 209 words, ~1,850 tokens.
.claude/skills/reentrancy-patterns/SKILL.md (or your agent's skills folder).The classic variant. An external call re-enters the same function before state is updated.
// VULNERABLE: state update after external call
contract VulnerableVault {
mapping(address => uint256) public balances;
function withdraw(uint256 amount) external {
require(balances[msg.sender] >= amount);
(bool success,) = msg.sender.call{value: amount}(""); // ← re-entry point
require(success);
balances[msg.sender] -= amount; // ← too late, attacker already re-entered
}
}
// FIXED: checks-effects-interactions
contract FixedVault {
mapping(address => uint256) public balances;
function withdraw(uint256 amount) external {
if (balances[msg.sender] < amount) revert InsufficientBalance();
balances[msg.sender] -= amount; // effect BEFORE interaction
(bool success,) = msg.sender.call{value: amount}("");
if (!success) revert TransferFailed();
}
}Attacker re-enters a different function that reads stale state.
// VULNERABLE: withdraw and transfer share state
contract Vulnerable {
mapping(address => uint256) public balances;
function withdraw(uint256 amount) external {
require(balances[msg.sender] >= amount);
(bool success,) = msg.sender.call{value: amount}(""); // ← attacker calls transfer() here
require(success);
balances[msg.sender] -= amount;
}
function transfer(address to, uint256 amount) external {
require(balances[msg.sender] >= amount);
balances[msg.sender] -= amount; // uses stale balance
balances[to] += amount;
}
}Defense: ReentrancyGuard on all functions sharing state, plus CEI ordering.
Attacker re-enters a different contract that reads stale state from the first.
// Contract A: Lending pool that updates user balance
// Contract B: Reads user balance from A for collateral check
// Attack: Borrow from A → callback during withdrawal → B reads stale (higher) balance → over-borrow
// Defense: ReentrancyGuard + cross-contract state synchronization
// OR: use a protocol-wide reentrancy lockcontract ReentrancyLock {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status = _NOT_ENTERED;
error ReentrancyGuard_ReentrantCall();
modifier globalNonReentrant() {
if (_status == _ENTERED) revert ReentrancyGuard_ReentrantCall();
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
// All contracts in the protocol inherit from or check the same lock
contract LendingPool is ReentrancyLock {
function borrow(uint256 amount) external globalNonReentrant { ... }
}
contract CollateralManager is ReentrancyLock {
function checkCollateral(address user) external globalNonReentrant { ... }
}The most subtle variant. A view function returns stale state during a callback, and a different protocol reads that stale state.
// Scenario: Curve pool with removeLiquidity that triggers a callback
// 1. Attacker calls removeLiquidity() on Curve pool
// 2. Curve sends ETH to attacker (callback)
// 3. During callback, pool's internal accounting is stale
// 4. Attacker calls a lending protocol that reads Curve's get_virtual_price()
// 5. Virtual price is inflated (stale state) → attacker borrows more than they should
// Defense in the reading protocol:
function getCollateralValue(address pool) internal view returns (uint256) {
// Check if the Curve pool is mid-operation
// Many Curve pools have a reentrancy lock that can be checked
try ICurvePool(pool).claim_admin_fees() {
// If this succeeds, pool is not locked — safe to read
} catch {
revert PoolReentrant();
}
return ICurvePool(pool).get_virtual_price();
}Key insight: Read-only reentrancy doesn't attack the contract making the callback. It attacks other contracts that read the first contract's stale view functions.
ERC-777 tokens call tokensReceived() on the recipient, creating a reentrancy vector on every transfer.
// VULNERABLE: ERC-777 token triggers callback on transfer
function deposit(uint256 amount) external {
shares[msg.sender] += calculateShares(amount);
IERC777(token).send(address(this), amount, ""); // callback before state finalized
}
// SAFE: use ReentrancyGuard + CEI
function deposit(uint256 amount) external nonReentrant {
uint256 shareAmount = calculateShares(amount);
shares[msg.sender] += shareAmount;
IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
emit Deposited(msg.sender, amount, shareAmount);
}Similar to ERC-777 — onTransferReceived() is called on the recipient.
// Any token implementing ERC-1363 transferAndCall will trigger onTransferReceived
// Always use ReentrancyGuard when accepting arbitrary tokensimport {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
contract Vault is ReentrancyGuard {
// Apply to ALL functions that:
// 1. Make external calls
// 2. Share state with functions that make external calls
// 3. Are called by other protocols that might read your state
function deposit(uint256 amount) external nonReentrant {
// safe from reentrancy
}
function withdraw(uint256 amount) external nonReentrant {
// safe from reentrancy
}
// View functions don't need nonReentrant unless read-only reentrancy is a concern
// In that case, add a reentrancy check without the mutex reset:
function getSharePrice() external view returns (uint256) {
// Consider if stale reads during reentrancy could be exploited
}
}Post-Cancun, use transient storage for cheaper reentrancy locks (~100 gas vs ~2,900 gas).
contract TransientReentrancyGuard {
bytes32 constant REENTRANCY_SLOT = keccak256("reentrancy.lock");
modifier nonReentrant() {
assembly {
if tload(REENTRANCY_SLOT) { revert(0, 0) }
tstore(REENTRANCY_SLOT, 1)
}
_;
assembly {
tstore(REENTRANCY_SLOT, 0)
}
}
}nonReentrant© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/reentrancy-patterns of ccashwell/evm-cortex.
Open the folder on GitHubat commit f8f3301
Reentrancy Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Reentrancy Patterns this skillccashwell/evm-cortex | 131 | — | ~1.9k | Automated safety check: Pass | MIT | |
| Ethereum Smart Contract Vulnerability Analysistradecatlabs/vibe-coding-cn | 17k | 1 repos | ~738 | Automated safety check: Pass | Apache-2.0 | |
| Reentrancy Auditoralt-research2/SolidityGuard | 104 | — | ~1.8k | Automated safety check: Pass | Custom licence | |
| Smart Contract Auditforefy/.context | 152 | 1 repos | ~5.1k | Automated safety check: Pass | MIT | |
| Smart Contract Auditelophanto/EloPhanto | 106 | — | ~2.7k | Automated safety check: Pass | Custom licence | |
| Securityaustintgriffith/ethskills | 294 | — | ~4.9k | Automated safety check: Pass | None |
tradecatlabs/vibe-coding-cn
Runs Slither and Mythril against Solidity contracts to find reentrancy, overflow and access-control bugs before mainnet deployment, then triages and reports findings.
alt-research2/SolidityGuard
Deep reentrancy vulnerability analysis for Solidity contracts.
forefy/.context
Comprehensive smart contract security audit framework with multi-expert analysis.
elophanto/EloPhanto
A skill your agent uses when reviewing a Solidity, Vyper, or Rust (Solana/Anchor) smart contract for paid audit work or pre-launch sanity check.
austintgriffith/ethskills
Solidity security patterns, common vulnerabilities, and pre-deploy audit checklist.
awarexone/Agentic-Bug-Hunter
Guides smart contract audits and bounty target selection with ten DeFi bug classes, kill signals, a Foundry PoC template and grep patterns.
ccashwell/evm-cortex
A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.
ccashwell/evm-cortex
A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.
ccashwell/evm-cortex
Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.
ccashwell/evm-cortex
A skill your agent uses when running a local Ethereum node with Anvil.
ccashwell/evm-cortex
A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.
ccashwell/evm-cortex
A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.
Works with
Categories
Comprehensive reentrancy attack patterns and defenses for Solidity. Reentrancy Patterns is an agent skill from ccashwell/evm-cortex. Comprehensive reentrancy attack patterns and defenses for Solidity.
Reentrancy Patterns fits situations like: writing contracts with external calls; integrating tokens with callbacks (ERC-777; auditing for reentrancy vulnerabilities.
Run `npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a claude-code`. Or copy the skill folder (skills/reentrancy-patterns in ccashwell/evm-cortex) into .claude/skills/reentrancy-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a codex`. Or copy the skill folder (skills/reentrancy-patterns in ccashwell/evm-cortex) into .agents/skills/reentrancy-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill reentrancy-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/reentrancy-patterns, .gemini/skills/reentrancy-patterns, .github/skills/reentrancy-patterns and .opencode/skills/reentrancy-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Reentrancy Patterns is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Reentrancy Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Reentrancy Patterns: Ethereum Smart Contract Vulnerability Analysis (tradecatlabs/vibe-coding-cn, 17k stars), Reentrancy Auditor (alt-research2/SolidityGuard, 104 stars), Smart Contract Audit (forefy/.context, 152 stars) and Smart Contract Audit (elophanto/EloPhanto, 106 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.
Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.