access-control-patterns

access-control-patterns is a skill for Claude Code, Codex from ccashwell/evm-cortex. It costs 54 tokens per session (1,639 once invoked), scanned A, original, MIT.

A collection of Solidity design patterns for controlling who can perform actions in a blockchain contract. Solidity is the programming language commonly used for Ethereum smart contracts.

In plain words
What is it for?
Implementing two-step ownership transfers, role-based permissions, timelocks, emergency controls, pause mechanisms, and multisignature requirements in Solidity protocols.
Why use it?
It helps prevent accidental ownership transfers and defines clear permissions for administrators, operators, guardians, and treasury users. It also covers delayed control changes and emergency pausing.

Skill for Claude CodeCodex

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

Good fit Implementing two-step ownership transfers, role-based permissions, timelocks, emergency controls, pause mechanisms, and multisignature requirements in Solidity protocols.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ccashwell/evm-cortex/access-control-patterns
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 ccashwell/evm-cortex --skill access-control-patterns
Clone the repo
git clone --depth 1 https://github.com/ccashwell/evm-cortex

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 access-control-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ccashwell/evm-cortex/access-control-patterns/github.svg)](https://agentmods.dev/skills/ccashwell/evm-cortex/access-control-patterns)
Your own site
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/access-control-patterns"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/access-control-patterns/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 access-control-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/ccashwell/evm-cortex/access-control-patterns"><img src="https://agentmods.dev/badge/skills/ccashwell/evm-cortex/access-control-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,639 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.00054 $0.01639
Opus 5.5 $0.00022 $0.00656
Sonnet 5.5 $0.00011 $0.00328
Haiku 4.5 $0.00005 $0.00164

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

Security

Grade A, and why

access-control-patterns 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 3mo 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/access-control-patterns/SKILL.md · 240 lines

How it starts

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

Access Control Patterns

Ownable2Step (Preferred over Ownable)

Two-step ownership transfer prevents accidental transfer to a wrong address.

import {Ownable2Step, Ownable} from "@openzeppelin/contracts/access/Ownable2Step.sol";

contract Treasury is Ownable2Step {
    constructor(address initialOwner) Ownable(initialOwner) {}

    function withdrawFunds(address to, uint256 amount) external onlyOwner {
        if (to == address(0)) revert ZeroAddress();
        (bool success,) = to.call{value: amount}("");
        if (!success) revert TransferFailed();
    }
}

// Transfer flow:
// 1. Current owner calls transferOwnership(newOwner)
// 2. newOwner calls acceptOwnership()
// 3. Ownership transferred only after step 2

Role-Based Access Control

For protocols needing multiple permission levels.

import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

contract Protocol is AccessControl {
    bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
    bytes32 public constant GUARDIAN_ROLE = keccak256("GUARDIAN_ROLE");
    bytes32 public constant TREASURY_ROLE = keccak256("TREASURY_ROLE");

    constructor(address admin) {
        _grantRole(DEFAULT_ADMIN_ROLE, admin);
    }

    function updateParameters(uint256 newFee) external onlyRole(OPERATOR_ROLE) {
        // routine parameter updates
    }

    function emergencyPause() external onlyRole(GUARDIAN_ROLE) {
        _pause();
    }

    function withdrawFees(address to) external onlyRole(TREASURY_ROLE) {
        // treasury management
    }
}

Role Hierarchy Template

DEFAULT_ADMIN_ROLE (multisig/timelock)
├── OPERATOR_ROLE (parameter updates, routine operations)
├── GUARDIAN_ROLE (emergency pause, circuit breakers)
├── TREASURY_ROLE (fee collection, fund management)
├── UPGRADER_ROLE (proxy upgrades — timelock only)
└── MINTER_ROLE (token minting — restricted)

Custom Role Admin

constructor(address admin) {
    _grantRole(DEFAULT_ADMIN_ROLE, admin);

    // OPERATOR_ROLE is managed by DEFAULT_ADMIN_ROLE (default)
    // GUARDIAN can manage itself (guardians can add/remove other guardians)
    _setRoleAdmin(GUARDIAN_ROLE, GUARDIAN_ROLE);

    // MINTER is managed by OPERATOR (operators control minters)
    _setRoleAdmin(MINTER_ROLE, OPERATOR_ROLE);
}

Read the full file on GitHub · 240 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. 3mo ago First seen · 240 lines · 54 tokens per session scan A 3c4d56872195

Subscribe to this mod's changes

access-control-patterns is a skill published in the GitHub repository ccashwell/evm-cortex (131 stars, last pushed 1mo ago), licensed MIT. It adds 54 tokens to every session and 1,639 once invoked, about $0.0002 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-08-30.

Related

access-control-patterns compared with skills from other repositories

access-control-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
access-control-patternsccashwell/evm-cortexSkill1311mo agoMITA54Claude Code, Codex
signature-replayPurpleAILAB/DecepticonSkill6.9k12d agoApache-2.0A31Claude Code, Codex
official-sui-skillsMystenLabs/suiSkill7.8ktodayApache-2.0A116Claude Code, Codex
bridgealsk1992/CloddsBotSkill3.1k18d agoMITA13Claude Code, Codex
onchainkitalsk1992/CloddsBotSkill3.1k18d agoMITA24Claude Code, Codex
marginfialsk1992/CloddsBotSkill3.1k18d agoMITA11Claude Code, Codex
devtools-event-clientTanStack/devtoolsSkill519yesterdayMITA79Claude Code, Codex