starknet

Guides StarkNet smart contract development with Cairo, Scarb, starknet.js, and L1-L2 messaging.

1|1|Updated May 21, 2026
One-click install
npx skills add https://github.com/naruto11eth/cryptoskills --skill starknet-naruto11eth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: starknet
Source: https://github.com/naruto11eth/cryptoskills/tree/main/skills/starknet
Command: npx skills add https://github.com/naruto11eth/cryptoskills --skill starknet-naruto11eth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents trained on EVM patterns generate incorrect StarkNet code because StarkNet is not EVM-compatible: it uses Cairo instead of Solidity, felt252 instead of uint256, contract-based accounts instead of EOAs, and a two-step declare-then-deploy flow. This Skill provides correct, current patterns for Cairo contract development, testing, deployment, and cross-layer messaging. ## Core Features & Use Cases - Cairo Contract Patterns: Provides working examples of storage, interfaces, events, ownable contracts, OpenZeppelin components, and ERC-20 tokens using Cairo 2.x syntax. - Full Development Workflow: Covers Scarb project setup, snforge testing with cheatcodes, and deployment via starkli, sncast, or starknet.js, including account deployment. - L1-L2 Messaging: Documents bidirectional Ethereum-StarkNet messaging with Cairo send_message_to_l1_syscall, Solidity sendMessageToL2, and #[l1_handler] receivers. - Use Case: Ask the agent to write an ERC-20 token on StarkNet, and it produces a correct OpenZeppelin component-based Cairo contract, compiles it with Scarb, tests it with snforge, and deploys it to Sepolia with sncast. ## Quick Start Ask the agent to create a new Cairo counter contract on StarkNet, test it with snforge, and deploy it to the Sepolia testnet.

Frequently Asked Questions about starknet

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a smart contract on StarkNet?

StarkNet contracts are written in Cairo, not Solidity. Create a project with Scarb, define a #[starknet::contract] module with #[storage], a #[constructor], and interface implementations, then compile with scarb build to produce Sierra output.

How do I deploy a Cairo contract to StarkNet?

Deployment is two steps: first declare the contract class with starkli declare or sncast declare to get a class hash, then deploy an instance with starkli deploy or sncast deploy passing constructor calldata. Multiple contracts can share one declared class hash.

Is StarkNet compatible with the EVM and Solidity?

No, StarkNet is not EVM-compatible. It uses the Cairo language, felt252 as the native type, sn_keccak function selectors, and Pedersen-hash-based storage. ETH exists as an ERC-20 token, and every account is a smart contract rather than an EOA.

How do I test StarkNet contracts with snforge?

Use Starknet Foundry's snforge: declare the contract by module name in a #[cfg(test)] module, deploy it with constructor calldata, and call functions through dispatchers. Cheatcodes like start_cheat_caller_address simulate different callers, and #[should_panic] verifies reverts.

Why does my StarkNet transaction fail with VALIDATION_FAILURE?

VALIDATION_FAILURE means the account contract's __validate__ entrypoint rejected the transaction, usually due to an incorrect signature or wrong private key for the account. Verify the key matches the account's public key and that the account is deployed on the correct network.

How does L1 to L2 messaging work between Ethereum and StarkNet?

An L1 Solidity contract calls sendMessageToL2 on the StarkNet Core contract with the target L2 address, function selector, and payload. The sequencer then invokes the matching #[l1_handler] function on the L2 contract, which should validate the from_address against the authorized L1 sender.