5,439,582 AI resources indexedWorking toward the world’s largest AI resource index.

PDF

Cairo Contract Functions

Explain Starknet contract entry points (external, view, constructor, l1 handler) and ABI configuration; use when a request involves defining or exposing contract functions in Cairo.

Installable skillApache-2.0By David-Li0406Updated Oct 30, 2026
INTENDED FOROpenClawInstall in a listed agent.

instructions.md

---
name: cairo-contract-functions-7c403809faa0
description: Explain Starknet contract entry points (external, view, constructor, l1 handler) and ABI configuration; use when a request involves defining or exposing contract functions in Cairo.
---

# Cairo Contract Functions

## Overview
Guide how to define contract entry points and control ABI exposure in Cairo.

## Quick Use
- Read `references/contract-functions.md` before answering.
- Use `#[starknet::interface]` with `#[abi(embed_v0)]` for standard ABI definitions.
- Use `self: ContractState` for view, `ref self: ContractState` for state-mutating entry points.

## Response Checklist
- Mark constructors with `#[constructor]` and L1 handlers with `#[l1_handler]`.
- Use `#[external(v0)]` for public entry points if using per-item ABI.
- Explain that view functions are not enforced by the protocol.

## Example Requests
- "How do I define a view function vs external function?"
- "Where do I put a constructor in a Cairo contract?"
- "How do I expose a function in the ABI?"

Discuss this resource

Platform guidance

Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.