Smart-Cache Stylus
SmartCache is an automated caching-as-a-service system for Arbitrum Stylus contracts. It allows developers to optimize contract performance directly from their code, without needing to manually interact with the CacheManager through a GUI or CLI. Using a simple annotation such as #[auto_cache], developers can indicate which contracts or functions should be evaluated for caching. An off-chain service then handles the entire process: benchmarking gas usage, analyzing cost-efficiency, and submitting a bid through Arbitrum’s CacheManager if the caching decision is financially beneficial.
Videos
Description
SmartCache is an open-source caching solution designed to take the pain of cache management away from developers. It provides both manual and automated approaches for optimizing cache performance, enabling teams to choose the workflow that best suits their needs.
For those who prefer manual bidding, an upcoming “Ask AI” assistant will offer concise, plain-language guidance directly in the dashboard, simplifying cache configuration and decision-making.
For automated workflows, SmartCache offers two powerful options:
smart-cache-cli: A command-line utility that automates cache hygiene by generating consistent keys, managing invalidation, and eliminating repetitive boilerplate. It integrates seamlessly into developer workflows, acting as an autopilot for cache management.
stylus-cache-sdk: A lightweight SDK that provides a clean API for reading, writing, and invalidating cache programmatically. This ensures predictable, uniform behavior across applications without custom reinvention.
SmartCache is already serving 236 contracts—6 on mainnet and 230 on testnets—with adoption by 82 developers to date. Its proven track record demonstrates reliability and scalability in real-world environments.
The project is fully open source, backed by comprehensive documentation, and built for the community to use, extend, and improve.
Progress During Hackathon
Before the Buildathon, we were already developing SmartCache as an open-source caching solution. During the event, we focused on adding the economic layer that makes the project viable and sustainable for the community. We integrated payments directly into SmartCache, so that a Stylus developer can now store funds within the system. SmartCache then automatically manages both the cache manager and the bidding process, optimizing usage and generating savings for the user. From these savings, a portion is redirected back to the hosts of the SmartCache system, creating an incentive model for community members who provide infrastructure and support. This not only ensures sustainability but also builds a collaborative ecosystem where contributors are rewarded. The end result is a system that both simplifies Stylus on WASM for developers and rewards community participation, making SmartCache not just technically useful, but also economically sustainable.
Tech Stack
Fundraising Status
We have successfully secured an $8,000 grant under the DAO Developer Tooling Program focused on Arbitrum One and Stylus 3.0.