Cairo Contract Interactions
Overview
Guide contract to contract calls using interfaces, dispatchers, and low-level syscalls.
Quick Use
- •Read
references/contract-interactions.mdbefore 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?"