Skip to content
Back to skills

Cairo Contract Storage

ASecurity

Explain Starknet contract storage layout, the storage struct, Store trait, and read/write access; use when a request involves storage variables or storage layout in Cairo.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
documentation

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill cairo-contract-storage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cairo Contract Storage?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cairo Contract Storage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-cairo-contract-storage/badge)](https://www.skillsdirectory.com/skills/david-li0406-cairo-contract-storage)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cairo-contract-storage
description: Explain Starknet contract storage layout, the storage struct, Store trait, and read/write access; use when a request involves storage variables or storage layout in Cairo.
---

# Cairo Contract Storage

## Overview
Explain how contract storage is declared and accessed, and how storage keys are computed.

## Quick Use
- Read `references/contract-storage.md` before answering.
- Use `#[storage]` struct for storage fields.
- Use `.read()` and `.write()` on storage variables in `ContractState`.

## Response Checklist
- Ensure storage field types implement `starknet::Store` (derive it when possible).
- Mention storage keys are derived from the variable name and hashed.
- Use `self` or `ref self` correctly depending on mutability.

## Example Requests
- "How do I declare storage in a Cairo contract?"
- "Why does my storage field need Store?"
- "How is the storage key computed for a variable?"

Files in this skill

  • SKILL.md945 B
  • references/contract-storage.md710 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…