This section explains how to use the SmartCache Rust crate for integrating contract caching directly into your Stylus-based projects. Whether you’re building from scratch or optimizing existing contra
The SmartCache SDK is a Rust-based library that enables developers to easily integrate caching functionality into their Stylus smart contracts. It abstracts away low-level complexities like event handling, cache bidding, and lifecycle management, so that you can focus on building high-performance dApps.
With SmartCache SDK, you gain:
🛠️ Simplicity: Direct utility functions to check cacheability and manage cache slots.
🚀 Performance: Automatic event support for cache opt-in, ensuring contracts stay hot-loaded.
📦 Reusability: A standardized Cacheable trait for structuring your contracts.
📚 Documentation & Examples: Well-explained guides with copy-paste ready snippets.
The SDK is designed to work hand-in-hand with the SmartCache UI and CLI, but can also be used standalone if you want low-level control inside Rust projects.