Agent skill

Denial Of Service

by ccashwell in ccashwell/evm-cortex

Denial-of-service attack vectors and prevention patterns for Solidity.

MITAuto-check passedBackend & APIs

Install Denial Of Service

skills CLI
$ npx skills add ccashwell/evm-cortex --skill denial-of-service -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex denial-of-service --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/denial-of-service .claude/skills/denial-of-service && rm -rf skills-src

Use ~/.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/

Facts

Skill name
denial-of-service
GitHub stars
131
Token cost
~1.7k tokens
SKILL.md length
215 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Denial-of-service attack vectors and prevention patterns for Solidity.

  • Designing loops
  • SKILL.md covers Unbounded Loops Over Dynamic…, External Call Failures…, Unexpected Reverts (Push vs… and Block Gas Limit DoS, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Batch operations

What it does

Denial Of Service is an agent skill from ccashwell/evm-cortex. Denial-of-service attack vectors and prevention patterns for Solidity. Use when designing loops, batch operations, withdrawal mechanisms, or any contract that iterates over user-controlled data. Covers unbounded loops, gas limits, griefing, and force-send ETH.

Its SKILL.md is about 1.7k 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 Backend & APIs, covering Smart contracts. It works with Solidity. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Designing loops
  • Batch operations
  • Withdrawal mechanisms
  • Any contract that iterates over user-controlled data

Example prompts

  • “/denial-of-service”

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    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.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Denial Of Service loads about 1.7k tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 215 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 215 words, ~1,694 tokens.

Download SKILL.mdSave it as .claude/skills/denial-of-service/SKILL.md (or your agent's skills folder).
name
denial-of-service
description
Denial-of-service attack vectors and prevention patterns for Solidity. Use when designing loops, batch operations, withdrawal mechanisms, or any contract that iterates over user-controlled data. Covers unbounded loops, gas limits, griefing, and force-send ETH.

Denial of Service

Unbounded Loops Over Dynamic Arrays

Iterating over arrays that grow with user interaction will eventually exceed the block gas limit.

solidity
// VULNERABLE: array grows unboundedly
address[] public stakers;

function distributeRewards() external {
    // If stakers.length > ~1500, this exceeds block gas limit
    for (uint256 i; i < stakers.length; ++i) {
        _sendReward(stakers[i]);
    }
}
Defense: Pull Pattern
solidity
// Users claim their own rewards — no unbounded iteration
mapping(address => uint256) public pendingRewards;

function claimReward() external {
    uint256 amount = pendingRewards[msg.sender];
    if (amount == 0) revert NothingToClaim();

    pendingRewards[msg.sender] = 0;

    (bool success,) = msg.sender.call{value: amount}("");
    if (!success) revert TransferFailed();

    emit RewardClaimed(msg.sender, amount);
}
Defense: Paginated Processing
solidity
uint256 public lastProcessedIndex;

function distributeRewards(uint256 batchSize) external {
    uint256 end = lastProcessedIndex + batchSize;
    if (end > stakers.length) end = stakers.length;

    for (uint256 i = lastProcessedIndex; i < end;) {
        _sendReward(stakers[i]);
        unchecked { ++i; }
    }

    lastProcessedIndex = end;

    if (end == stakers.length) {
        lastProcessedIndex = 0; // reset for next round
        emit DistributionComplete();
    }
}

External Call Failures Blocking Execution

A single failing external call in a loop blocks all subsequent operations.

solidity
// VULNERABLE: one failed transfer blocks all
function distributeAll(address[] calldata recipients, uint256[] calldata amounts) external {
    for (uint256 i; i < recipients.length; ++i) {
        IERC20(token).safeTransfer(recipients[i], amounts[i]); // if one reverts, all fail
    }
}

// FIXED: record failures, continue processing
function distributeAll(address[] calldata recipients, uint256[] calldata amounts) external {
    for (uint256 i; i < recipients.length;) {
        try IERC20(token).transfer(recipients[i], amounts[i]) returns (bool success) {
            if (!success) {
                pendingClaims[recipients[i]] += amounts[i];
                emit DistributionFailed(recipients[i], amounts[i]);
            }
        } catch {
            pendingClaims[recipients[i]] += amounts[i];
            emit DistributionFailed(recipients[i], amounts[i]);
        }
        unchecked { ++i; }
    }
}

Unexpected Reverts (Push vs Pull)

Contracts that don't accept ETH (no receive() or fallback()) will cause call to revert, blocking push-based distributions.

solidity
// VULNERABLE: recipient can be a contract that reverts on receive
function payWinner(address winner) external {
    (bool success,) = winner.call{value: prize}("");
    require(success); // blocks if winner is a contract that reverts
}

// FIXED: pull pattern
mapping(address => uint256) public claimable;

function recordWinner(address winner) external onlyOwner {
    claimable[winner] += prize;
    emit WinnerRecorded(winner, prize);
}

function claim() external {
    uint256 amount = claimable[msg.sender];
    if (amount == 0) revert NothingToClaim();
    claimable[msg.sender] = 0;
    (bool success,) = msg.sender.call{value: amount}("");
    if (!success) revert TransferFailed();
}

Block Gas Limit DoS

Functions that approach the block gas limit become uncallable.

solidity
// Gas estimation per operation:
// SLOAD (cold):      2,100 gas
// SLOAD (warm):        100 gas
// SSTORE (cold):    20,000 gas (new value)
// SSTORE (warm):     2,900 gas
// External call:     2,600 gas (cold account)
// ETH transfer:      9,000 gas (with value)
// ERC-20 transfer:  ~50,000 gas

// Block gas limit: ~30M gas (mainnet)
// Safe iteration: ~300-600 operations per transaction
// Always test with forge gas reports

Griefing Attacks

Attackers who can waste protocol gas or block operations without direct profit.

solidity
// VULNERABLE: attacker creates many small positions to inflate loop iterations
function liquidateAll() external {
    for (uint256 i; i < positions.length; ++i) {
        if (isLiquidatable(positions[i])) {
            _liquidate(positions[i]);
        }
    }
}

// DEFENSE: liquidate specific positions by ID
function liquidate(uint256[] calldata positionIds) external {
    for (uint256 i; i < positionIds.length;) {
        if (!isLiquidatable(positionIds[i])) revert NotLiquidatable(positionIds[i]);
        _liquidate(positionIds[i]);
        unchecked { ++i; }
    }
}
Minimum Deposit / Position Size
solidity
uint256 public constant MIN_DEPOSIT = 0.01 ether;

function deposit() external payable {
    if (msg.value < MIN_DEPOSIT) revert BelowMinimum(msg.value, MIN_DEPOSIT);
    // prevents dust position griefing
}

Force-Sending ETH via selfdestruct

A contract can receive ETH via selfdestruct(target) even without receive() or fallback(). Never rely on address(this).balance for accounting.

solidity
// VULNERABLE: invariant relies on balance
function invariantCheck() external view {
    require(address(this).balance == totalDeposited); // can be broken by force-send
}

// FIXED: track deposits explicitly
uint256 public totalDeposited;

function deposit() external payable {
    totalDeposited += msg.value;
}

function invariantCheck() external view {
    require(totalDeposited >= totalWithdrawn);
}

Note: Post-Dencun (EIP-6780), selfdestruct only sends ETH if called in the same transaction as contract creation.

RETURNDATA Bomb

A malicious contract can return a massive returndata, causing the caller to spend gas copying it.

solidity
// VULNERABLE: copies all return data
(bool success, bytes memory data) = target.call(payload);

// SAFER: limit return data copy
(bool success,) = target.call(payload);
// Only copy return data if you need it and know the expected size

DoS Prevention Checklist

  • No unbounded loops over user-controlled arrays
  • Pull pattern for fund distribution (users claim their own)
  • Paginated processing for batch operations
  • External call failures don't block other operations
  • Minimum deposit/position sizes to prevent dust griefing
  • No reliance on address(this).balance for accounting
  • Gas consumption tested for worst-case array sizes
  • Critical functions estimated to stay well under block gas limit

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/denial-of-service of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Denial Of Service 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.

Denial Of Service compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Denial Of Service this skillccashwell/evm-cortex131—~1.7kAutomated safety check: PassMIT
Fizz Convertpashov/skills1.2k2 repos~3.7kAutomated safety check: PassMIT
Feynman Auditor0xiehnnkta/nemesis-auditor2431 repos~11kAutomated safety check: PassMIT
Smart Contract Auditgreatpie/smart-contract-audit-skill101—~1.1kAutomated safety check: PassNone
RadarAuditware/radar154—~2.1kAutomated safety check: PassGPL-3.0
Solidity AuditorGabson0x/bountyforge442—~3.7kAutomated safety check: PassNone

Similar skills

  • Fizz Convert

    pashov/skills

    Convert English-language properties in PROPERTIES.md (produced by the Fizz skill) into Solidity assertions inside the existing fuzz harness, then flip their checkboxes.

    1.2k GitHub starsUsed in 2 repos~3.7k tokens
    Backend & APIsAuto-check passed
  • Feynman Auditor

    0xiehnnkta/nemesis-auditor

    Deep business logic bug finder using the Feynman technique. An agent skill from 0xiehnnkta/nemesis-auditor.

    243 GitHub starsUsed in 1 repo~11k tokens
    Backend & APIsAuto-check passed
  • Smart Contract Audit

    greatpie/smart-contract-audit-skill

    Script-backed, out-of-box auditing workflow for Solidity/EVM repositories based on EVMbench detect/patch/exploit methodology.

    101 GitHub stars~1.1k tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Radar

    Auditware/radar

    Use radar for smart contract security analysis, AST generation, and detection template development.

    154 GitHub stars~2.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Solidity Auditor

    Gabson0x/bountyforge

    Security audit of Solidity code while you develop. An agent skill from Gabson0x/bountyforge.

    442 GitHub stars~3.7k tokensUpdated 24 days ago
    Backend & APIsAuto-check passed
  • Add Explorer

    lidofinance/diffyscan

    Adds or repairs Diffyscan explorer API routing and response adapters for a new host, chain or payload format.

    142 GitHub stars~1k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    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.

    131 GitHub stars~25k tokensUpdated 11 days ago
    Auto-check passed
  • Aave Integration

    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.

    131 GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 11 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 11 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 11 days ago
    Auto-check passed

Works with

Categories

Questions about Denial Of Service

What does Denial Of Service do?

Denial-of-service attack vectors and prevention patterns for Solidity. Denial Of Service is an agent skill from ccashwell/evm-cortex. Denial-of-service attack vectors and prevention patterns for Solidity.

When should I use Denial Of Service?

Denial Of Service fits situations like: designing loops; batch operations; withdrawal mechanisms; any contract that iterates over user-controlled data.

How do I install Denial Of Service in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill denial-of-service -a claude-code`. Or copy the skill folder (skills/denial-of-service in ccashwell/evm-cortex) into .claude/skills/denial-of-service in your project. Claude Code loads it when a task matches its description.

How do I install Denial Of Service in Codex?

Run `npx skills add ccashwell/evm-cortex --skill denial-of-service -a codex`. Or copy the skill folder (skills/denial-of-service in ccashwell/evm-cortex) into .agents/skills/denial-of-service in your project. Codex loads it when a task matches its description.

Can I use Denial Of Service in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill denial-of-service -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/denial-of-service, .gemini/skills/denial-of-service, .github/skills/denial-of-service and .opencode/skills/denial-of-service in your project.

What does Denial Of Service need to run?

SKILL.md names no scripts, command-line tools or credentials: Denial Of Service is instructions for the agent only.

Does Denial Of Service access the network?

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.

Is Denial Of Service safe to install?

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.

What licence does Denial Of Service use?

Denial Of Service is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Denial Of Service use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Denial Of Service?

Skills that share tags, products or a category with Denial Of Service: Fizz Convert (pashov/skills, 1.2k stars), Feynman Auditor (0xiehnnkta/nemesis-auditor, 243 stars), Smart Contract Audit (greatpie/smart-contract-audit-skill, 101 stars) and Radar (Auditware/radar, 154 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Denial Of Service?

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.