smart-contract-security

smart-contract-security is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 113 tokens per session (725 once invoked), scanned A, original, MIT.

A guide to securing smart contracts, which are blockchain programs that manage assets and rules. It covers common attack types, protective coding patterns, automated checks, and manual review.

In plain words
What is it for?
Use it to review contract code, add reentrancy protection, protect price calculations, run static analysis and fuzzing, and organise a smart-contract audit.
Why use it?
It helps identify weaknesses such as reentrancy, where a contract is called again before an earlier operation finishes, and flash-loan price manipulation. The workflow combines several kinds of security testing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review contract code, add reentrancy protection, protect price calculations, run static analysis and fuzzing, and organise a smart-contract audit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/smart-contract-security
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j4flmao/agent-skills --skill smart-contract-security
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for smart-contract-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/smart-contract-security/github.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/smart-contract-security)
Your own site
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/smart-contract-security"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/smart-contract-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for smart-contract-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/smart-contract-security"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/smart-contract-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 725 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.00725
Opus 5.5 $0.00045 $0.00290
Sonnet 5.5 $0.00023 $0.00145
Haiku 4.5 $0.00011 $0.00072

Measured 1mo ago against content hash 7f7da911ab5a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

smart-contract-security scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/blockchain/smart-contract-security/SKILL.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Smart Contract Security

Purpose

Explain the highest-impact Solidity security controls — Checks-Effects-Interactions with a reentrancy guard, oracle-manipulation resistance, and a layered audit workflow — so developers write defensible contracts and reviewers triage risk. Reference and remediation guidance, not exploit construction.

Agent Protocol

Trigger

User phrases: "reentrancy guard", "checks effects interactions", "flash loan attack prevention", "oracle manipulation", "Slither/Echidna", "audit workflow".

Input Context

  • Solidity version and OpenZeppelin Contracts version (v5 changed import paths).
  • External calls and price dependencies in scope.

Output Artifact

Security pattern recommendation plus the audit-stage plan.

Response Format

Risk: {class}
Control: {pattern / tool}
Residual: {what still needs manual review}

Reentrancy Guards

Use the Checks-Effects-Interactions pattern and OpenZeppelin's ReentrancyGuard. In OpenZeppelin Contracts v5 the guard moved from security/ to utils/ — use @openzeppelin/contracts/utils/ReentrancyGuard.sol (the security/ReentrancyGuard.sol path only exists in v4.x).

// OpenZeppelin Contracts v5+:
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

contract Vault is ReentrancyGuard {
    mapping(address => uint) public balances;

    function withdraw() external nonReentrant {
        uint bal = balances[msg.sender];
        require(bal > 0, "No balance");
        balances[msg.sender] = 0; // Effect
        (bool success, ) = msg.sender.call{value: bal}(""); // Interaction
        require(success, "Transfer failed");
    }
}

Flash Loan Attack Prevention

Flash loans let an attacker borrow large capital atomically, so any value that depends on a single-block spot price is manipulable. Use decentralized oracles (Chainlink price feeds) or a time-weighted average price (Uniswap V3 TWAP via the pool's observation oracle) instead of spot getReserves()/slot0. Also avoid read-only reentrancy by never trusting external balances mid-callback, and validate that oracle data is fresh (check updatedAt / answeredInRound).

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +28 lines · +94 tokens per session 7f7da911ab5a
  2. 3mo ago First seen · 40 lines · 19 tokens per session scan A 7b53f12f71f8

Subscribe to this mod's changes

smart-contract-security is a skill published in the GitHub repository j4flmao/agent-skills (47 stars, last pushed 17d ago), licensed MIT. It adds 113 tokens to every session and 725 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

smart-contract-security compared with skills from other repositories

smart-contract-security next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
smart-contract-securityj4flmao/agent-skillsSkill4717d agoMITA113Claude Code, Codex
analyzing-ethereum-smart-contract-vulnerabilitiesxalgorix/xalgorixSkill1.6kyesterdayApache-2.0A49Claude Code, Codex
analyzing-ethereum-smart-contract-vulnerabilitiesmukul975/Anthropic-Cybersecurity-SkillsSkill37k3mo agoApache-2.0A49Claude Code
foundry-testingPaulRBerg/foundry-templateSkill6411mo agoMITA64Codex
solidity-codingPaulRBerg/foundry-templateSkill6411mo agoMITA53Codex
new-contractprotokol/solidity-typescript-hardhat-templateSkill482d agoMITA18Claude Code
blockchain-expertpersonamanagmentlayer/pclSkill471mo agoApache-2.0A63Claude Code