Agent skill

Governance Attacks

by ccashwell in ccashwell/evm-cortex

Governance vulnerabilities and safe design patterns for onchain DAOs.

MITAuto-check passedDevelopment

Install Governance Attacks

skills CLI
$ npx skills add ccashwell/evm-cortex --skill governance-attacks -a claude-code

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

GitHub CLI
$ gh skill install ccashwell/evm-cortex governance-attacks --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/governance-attacks .claude/skills/governance-attacks && 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
governance-attacks
GitHub stars
131
Token cost
~1.9k tokens
SKILL.md length
165 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Governance vulnerabilities and safe design patterns for onchain DAOs.

  • Auditing governance systems
  • SKILL.md covers Flash Loan Voting, Vote Buying / Dark DAOs, Proposal Griefing and Timelock Bypass, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Voting mechanisms

What it does

Governance Attacks is an agent skill from ccashwell/evm-cortex. Governance vulnerabilities and safe design patterns for onchain DAOs. Use when designing or auditing governance systems, voting mechanisms, proposal workflows, or treasury management. Covers flash loan voting, vote buying, proposal griefing, timelock bypass, and quorum manipulation.

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 Development, covering Design patterns and Proposals and quotes. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Auditing governance systems
  • Voting mechanisms
  • Proposal workflows
  • Treasury management

Example prompts

  • “/governance-attacks”

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

Governance Attacks loads about 1.9k tokens when it runs. Until then it costs about 76 tokens; SKILL.md has 165 words of instructions outside code blocks.

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

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). 165 words, ~1,886 tokens.

Download SKILL.mdSave it as .claude/skills/governance-attacks/SKILL.md (or your agent's skills folder).
name
governance-attacks
description
Governance vulnerabilities and safe design patterns for onchain DAOs. Use when designing or auditing governance systems, voting mechanisms, proposal workflows, or treasury management. Covers flash loan voting, vote buying, proposal griefing, timelock bypass, and quorum manipulation.

Governance Attacks

Flash Loan Voting

Borrow governance tokens → acquire voting power → vote → return tokens. All in one transaction.

1. Flash borrow 10M GOV tokens
2. Delegate to self (if not already delegated)
3. Cast vote on active proposal
4. Return tokens
Defense: Snapshot-Based Voting
solidity
contract SafeGovernor {
    // Voting power is snapshotted BEFORE proposal voting begins
    function propose(
        address[] memory targets,
        uint256[] memory values,
        bytes[] memory calldatas,
        string memory description
    ) public returns (uint256 proposalId) {
        uint256 snapshot = block.number + votingDelay;
        // votingDelay ensures tokens must be held before voting starts
        proposals[proposalId].snapshot = snapshot;
        proposals[proposalId].deadline = snapshot + votingPeriod;
        // ...
    }

    function _getVotes(address account, uint256 blockNumber)
        internal
        view
        returns (uint256)
    {
        // Historical balance — flash loans have zero effect
        return token.getPastVotes(account, blockNumber);
    }
}
Key Parameters
solidity
uint256 public votingDelay = 1 days;     // blocks between propose and vote start
uint256 public votingPeriod = 1 weeks;   // duration of voting
uint256 public proposalThreshold = 100_000e18; // tokens needed to propose

Vote Buying / Dark DAOs

Off-chain vote buying markets where token holders sell their voting power.

1. Attacker deploys contract: "Deposit GOV tokens, vote my way, earn rewards"
2. Token holders delegate to attacker's contract
3. Attacker controls large voting block
Defense: Vote Escrow (veToken)
solidity
// Voters must lock tokens for extended periods to gain voting power
// Makes vote buying expensive (capital must be locked, not just held momentarily)
struct LockInfo {
    uint256 amount;
    uint256 unlockTime;
}

function getVotingPower(address account) public view returns (uint256) {
    LockInfo memory lock = locks[account];
    if (lock.unlockTime <= block.timestamp) return 0;

    // Voting power decays linearly toward unlock
    uint256 timeRemaining = lock.unlockTime - block.timestamp;
    uint256 maxLockDuration = 4 * 365 days;

    return lock.amount * timeRemaining / maxLockDuration;
}

Proposal Griefing

Spamming proposals to exhaust voter attention or bloat governance systems.

solidity
// VULNERABLE: low proposal threshold
function propose(...) external {
    require(getVotes(msg.sender) >= proposalThreshold);
    // proposalThreshold = 1 token → anyone can spam proposals
}

// DEFENSE: meaningful proposal threshold + proposal deposit
uint256 public proposalThreshold = 100_000e18; // 0.1% of supply
uint256 public proposalDeposit = 10 ether;

mapping(uint256 => address) public proposalDepositors;

function propose(...) external payable returns (uint256 proposalId) {
    if (getVotes(msg.sender) < proposalThreshold) revert BelowThreshold();
    if (msg.value < proposalDeposit) revert InsufficientDeposit();

    proposalId = _createProposal(...);
    proposalDepositors[proposalId] = msg.sender;
}

// Refund deposit if proposal passes or is not spam
function refundDeposit(uint256 proposalId) external {
    if (state(proposalId) != ProposalState.Succeeded &&
        state(proposalId) != ProposalState.Executed) {
        revert ProposalNotSucceeded();
    }
    payable(proposalDepositors[proposalId]).call{value: proposalDeposit}("");
}

Timelock Bypass

Governance proposals typically execute through a timelock. Attacks that bypass or shorten the timelock.

solidity
// Attack: propose to reduce timelock delay to 0, then execute malicious proposals
// Defense: minimum timelock delay is hardcoded, not governable

contract SafeTimelock {
    uint256 public constant MINIMUM_DELAY = 2 days;
    uint256 public constant MAXIMUM_DELAY = 30 days;

    function setDelay(uint256 newDelay) external onlySelf {
        if (newDelay < MINIMUM_DELAY) revert DelayTooShort();
        if (newDelay > MAXIMUM_DELAY) revert DelayTooLong();
        delay = newDelay;
    }
}
Emergency Guardian
solidity
// Guardian can veto proposals but cannot execute them
// Provides a safety net without centralization risk
address public guardian;

function veto(uint256 proposalId) external {
    if (msg.sender != guardian) revert NotGuardian();
    if (state(proposalId) == ProposalState.Executed) revert AlreadyExecuted();

    proposals[proposalId].vetoed = true;
    emit ProposalVetoed(proposalId, msg.sender);
}

// Guardian power can be revoked by governance after sufficient decentralization
function renounceGuardian() external {
    if (msg.sender != guardian) revert NotGuardian();
    guardian = address(0);
    emit GuardianRenounced();
}

Delegation Manipulation

Exploiting delegation mechanics for concentrated voting power.

solidity
// Attack: create many accounts, receive airdrop, delegate all to one address
// Defense: identity verification for airdrops is hard onchain

// Attack: delegate, vote, undelegate, re-delegate to another proposal
// Defense: delegation snapshot at proposal creation time
function delegate(address delegatee) external {
    _delegate(msg.sender, delegatee);
    // Checkpointing ensures changes don't affect active proposals
}

Quorum Manipulation

Reducing effective quorum by increasing total supply or burning opposing votes.

solidity
// VULNERABLE: quorum as percentage of totalSupply at vote time
function quorumReached(uint256 proposalId) public view returns (bool) {
    return proposalVotes[proposalId].forVotes >= totalSupply() * quorumPct / 100;
    // totalSupply can change between proposal and vote
}

// SAFE: quorum as absolute number, snapshotted at proposal creation
function quorumReached(uint256 proposalId) public view returns (bool) {
    uint256 snapshot = proposals[proposalId].snapshot;
    uint256 quorum = token.getPastTotalSupply(snapshot) * quorumPct / 100;
    return proposalVotes[proposalId].forVotes >= quorum;
}

Safe Governance Design Template

solidity
// Recommended parameters for production governance
struct GovernanceConfig {
    uint256 votingDelay;          // 1-2 days
    uint256 votingPeriod;         // 5-7 days
    uint256 proposalThreshold;    // 0.1-1% of supply
    uint256 quorumPercentage;     // 4-10% of supply
    uint256 timelockDelay;        // 2-7 days
    bool snapshotVoting;          // always true
    bool guardianEnabled;         // true until sufficiently decentralized
}

Governance Security Checklist

  • Snapshot-based voting (historical balances, not current)
  • Meaningful voting delay (1+ days between propose and vote start)
  • Proposal threshold prevents spam (0.1%+ of supply)
  • Timelock on execution with hardcoded minimum delay
  • Quorum calculated from snapshotted total supply
  • Guardian/veto mechanism for emergency response
  • Vote escrow (veToken) for sustained commitment
  • Proposal deposit to disincentivize griefing
  • Delegation changes checkpointed (no retroactive manipulation)
  • Treasury operations behind timelock with multi-sig

© 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/governance-attacks of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Governance Attacks 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.

Governance Attacks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Governance Attacks this skillccashwell/evm-cortex131—~1.9kAutomated safety check: PassMIT
Plan ArbiterBuilderIO/skills4.6k—~1kAutomated safety check: PassMIT
Qv Quality Reportingtetherto/qvac683—~1.6kAutomated safety check: PassApache-2.0
Dev Rfcpproenca/dot-skills215—~3.8kAutomated safety check: PassMIT
Triangulate Spec ReviewQoderAI/better-harness2.4k—~614Automated safety check: PassMIT
Python Pep Authorpproenca/dot-skills215—~2.1kAutomated safety check: PassMIT

Similar skills

  • Plan Arbiter

    BuilderIO/skills

    A skill your agent uses when asked to compare, cross-review, merge, judge, choose, or arbitrate competing plans from multiple agents such as Codex and Claude Code; when given two or more proposed…

    4.6k GitHub stars~1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Run the deterministic code-quality audit, turn related findings into contextual remediation groups, prepare approval-gated Asana proposals, reconcile recurring runs, or configure twice-monthly…

    683 GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Dev Rfc

    pproenca/dot-skills

    Create well-structured RFCs and technical proposals for software projects.

    215 GitHub stars~3.8k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Triangulate Spec Review

    QoderAI/better-harness

    Review and improve architecture specs, ADRs, plugin or agent directory proposals, and other design documents by running multiple independent AI reviewers such as Claude, Qoder, Codex, or Cursor…

    2.4k GitHub stars~614 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Python Pep Author

    pproenca/dot-skills

    Drafting Python Enhancement Proposals (PEPs) — proposing a Python language feature, a standard library change, an interoperability standard, or an informational/process document for the Python…

    215 GitHub stars~2.1k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Codex Agent

    majiayu000/spellbook

    A skill your agent uses when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals.

    287 GitHub stars~1.9k tokensUpdated yesterday
    DevelopmentAuto-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 9 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 9 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 9 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 9 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 9 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 9 days ago
    Auto-check passed

Questions about Governance Attacks

What does Governance Attacks do?

Governance vulnerabilities and safe design patterns for onchain DAOs. Governance Attacks is an agent skill from ccashwell/evm-cortex. Governance vulnerabilities and safe design patterns for onchain DAOs.

When should I use Governance Attacks?

Governance Attacks fits situations like: auditing governance systems; voting mechanisms; proposal workflows; treasury management.

How do I install Governance Attacks in Claude Code?

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

How do I install Governance Attacks in Codex?

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

Can I use Governance Attacks 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 governance-attacks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/governance-attacks, .gemini/skills/governance-attacks, .github/skills/governance-attacks and .opencode/skills/governance-attacks in your project.

What does Governance Attacks need to run?

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

Does Governance Attacks 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 Governance Attacks 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 Governance Attacks use?

Governance Attacks 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 Governance Attacks use?

About 1.9k tokens (SKILL.md is roughly 7.5k 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 Governance Attacks?

Skills that share tags, products or a category with Governance Attacks: Plan Arbiter (BuilderIO/skills, 4.6k stars), Qv Quality Reporting (tetherto/qvac, 683 stars), Dev Rfc (pproenca/dot-skills, 215 stars) and Triangulate Spec Review (QoderAI/better-harness, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Governance Attacks?

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.