Cairo Contract Interactions

Explain how to call another Starknet contract using dispatcher patterns and interfaces; use when a request involves cross-contract calls, dispatchers, or contract_call_syscall.

teddyjfpender 885ea19 2 files · 1.5 KB Updated

File contents

Cairo Contract Interactions

Overview

Guide contract to contract calls using interfaces, dispatchers, and low-level syscalls.

Quick Use

  • Read references/contract-interactions.md before answering.
  • Prefer generated dispatchers over raw syscalls.
  • Mention safe dispatchers for error handling.

Response Checklist

  • Define an interface trait for the target contract.
  • Use a ContractDispatcher with a contract address.
  • Use SafeDispatcher when return errors must be handled explicitly.
  • Use contract_call_syscall only for low-level control.

Example Requests

  • "How do I call another contract from Cairo?"
  • "What is the difference between safe and unsafe dispatchers?"
  • "How do I use contract_call_syscall directly?"

teddyjfpender/skill-issues/tree/main/skills/cairo-contract-interactions commit 885ea19e77

Frequently asked questions

npx skillmds@latest add teddyjfpender/cairo-contract-interactions