What problem does it solve?
Adding fungible and non-fungible token support to a Dojo game and making token balances, transfers, and metadata discoverable via Torii is repetitive and error prone; developers need a clear pattern for implementing tokens in Cairo, deploying them as external contracts, and configuring indexers to surface token data to clients and queries.
Core Features & Use Cases
- ERC20 and ERC721 implementations: Patterns and model examples for fungible currency and NFT items using Dojo models and Cairo traits.
- Deployment guidance: Instructions to include token contracts as external contracts in Scarb.toml and deploy with sozo build and sozo migrate.
- Indexer configuration and queries: How to add token contracts to Torii indexing, available database tables (tokens, balances, erc_transfers), SQL examples, and client SDK usage.
- Use Cases: Create in-game currency (ERC20), mint and transfer collectible items (ERC721), and surface balances and transfer history to frontends and analytics.
Quick Start
Deploy an ERC20 token contract alongside your Dojo world, add its address to Torii's indexing configuration, and run Torii so balances and transfers become queryable.