ability-analysis
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
Type Thought-template (instantiate before use) - Trigger Pattern STORAGE_LAYOUT flag detected
$ npx -y skills add PlamenTSV/plamen --skill storage-layout-safety --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/storage-layout-safetyContext preview
The summary Claude sees to decide when to auto-load this skill.
Type Thought-template (instantiate before use) - Trigger Pattern STORAGE_LAYOUT flag detected
name: "storage-layout-safety" description: "Type Thought-template (instantiate before use) - Trigger Pattern STORAGE_LAYOUT flag detected"
> **Type**: Thought-template (instantiate before use) > **Trigger Pattern**: STORAGE_LAYOUT flag detected > **Inject Into**: depth-state-trace, depth-edge-case > **Finding prefix**: `[SLS-N]` > **Rules referenced**: R1, R4, R8, R10, R14
Covers: memory vs storage confusion, lost writes, proxy/upgrade storage collisions, inline assembly slot safety, and storage semantic corruption.
This vulnerability class exists ONLY on EVM - type-safe VMs (Move, Solana's Borsh model) enforce layout correctness at the runtime level. EVM's untyped 256-bit slot model permits silent corruption when layouts diverge.
---
proxy|upgradeable|diamond|delegatecall|EIP1967|StorageSlot|
sstore|sload|assembly\s*\{|tstore|tload|reinitializer|
UUPSUpgradeable|TransparentUpgradeableProxy|BeaconProxy---
Map the contract's persistent state surface before analyzing bugs:
| # | Variable | Type | Slot Assignment | Written By | Read By | Proxy-Relevant? | |---|----------|------|----------------|-----------|---------|-----------------|
For each state variable, determine:
Tag: `[TRACE:variable={name} → slot={computation} → writers={functions}]`
---
For each function operating on structs or complex types:
Trace every local variable of struct, array, or mapping type:
For each function accepting struct/array parameters:
For libraries called via `using ... for`:
Tag: `[TRACE:function={name} → var={var} → location={memory/storage} → write_persisted={YES/NO}]`
---
For each upgrade path (V1 → V2):
For EIP-2535 or namespaced storage:
Tag: `[TRACE:proxy_slot={N} → impl_var={name} → collision={YES/NO}]`
---
For each inline assembly block using `sstore` or `sload`:
If `tstore`/`tload` used:
Tag: `[BOUNDARY:user_input={MAX} → computed_slot={value} → target={what_gets_overwritten}]`
**Processing**: ENUMERATE all `calldataload`/`mload(add(` sites with literal offsets + all byte-slicing with hardcoded N on dynamic-type data → PROCESS each against the criteria below → COVERAGE GATE before moving to Step 5.
**Scope**: Any code that reads from ABI-encoded data using hardcoded byte offsets rather than following offset pointers. This includes:
Grep: `calldataload\(` with a numeric literal, `mload(add(` with a literal offset on a bytes variable, fixed-offset byte-slicing on decoded `bytes` data.
| Read Site | Mechanism | Offset | Hardcoded? | Into Dynamic-Type Content? | Value Used For | Same Value Read via abi.decode? | |-----------|-----------|--------|-----------|---------------------------|----------------|-------------------------------|
**Root cause**: ABI encoding is a convention, not enforced by the EVM. Dynamic types (`bytes`, `string`, `T[]`) use offset pointers — the content can be placed anywhere the pointer says. Hardcoded offsets assume
Autonomous Web3 security auditor for Claude Code and OpenAI Codex CLI. Orchestrates 18-100 AI agents across 40+ phases to produce audit reports with verified PoC exploits — for smart contracts and L1 node-client infrastructure.
Repo: PlamenTSV/plamen
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into…
Trigger Protocol has privileged roles (admin, operator, governance, resource account owner) -…
Trigger EXTERNAL_LIB flag detected (protocol uses third-party Move dependencies) - Used by…
Trigger Pattern MONETARY_PARAMETER flag (required) - Inject Into Breadth agents (merged via…