Example Logs

When a contract is deployed, SmartCache triggers a backend process that validates whether the contract is cacheable, checks if the deployer has enough balance, and then performs ROI analysis. If caching is beneficial, it places a bid on behalf of the user automatically.

Example Logs

When your contract is deployed, you will see detailed traces like this:

πŸ”₯ handleProgramActivated CALLED with address: 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd on arbitrum-sepolia
πŸ†• New Stylus contract deployed: 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd on arbitrum-sepolia
πŸ” About to call checkContractOptIn for: 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd on arbitrum-sepolia
πŸ” Checking contract opt-in: 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd on arbitrum-sepolia
🎯 Contract 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd is cacheable on arbitrum-sepolia - checking user eligibility
βœ… User eligibility confirmed for contract 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd - deployer 0xd649cb59755ebc44610a8e5f15d3c93c3aeb08f1 has user account and balance deposit
🌐 Network: arbitrum-sepolia
🎯 Contract: 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd
πŸ”— RPC: https://sepolia-rollup.arbitrum.io/rpc
πŸ“œ CacheManager: 0x0C9043D042aB52cFa8d0207459260040Cca54253
βœ… checkContractOptIn completed for: 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd
🏁 handleProgramActivated FINISHED for: 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd on arbitrum-sepolia
βœ… Connected to chain ID: 421614
  Gas without cache: 13234
  Gas with cache: 1255
  Gas savings: 11979
  Gas savings percentage: 90.00%
Processing contract for bidding: 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd
Analyzing bidding decision for 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd...
πŸ”„ Cache miss or stale for arbitrum-sepolia - fetching latest bid value...
πŸ” Fetching latest InsertBid events in reverse order for arbitrum-sepolia...
Min bid (C) for 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd: 0.0 ETH
πŸ” Searching from block 182921999 to 182926999 (range: 5000 blocks) for arbitrum-sepolia
πŸ“Š Processing 2 recent events in reverse order for arbitrum-sepolia...
⚠️ No valid bid values found in recent 2 transactions for arbitrum-sepolia
No cached bid value available, using default: 0.0 ETH
Executing bid for 0x88d37c2431223CBEAa9c410a82A5ab39522E93Cd... { bidAmount: '0.0' }
Gas estimation { estimated: '158275', final: '189930' }
Transaction submitted: 0x078c1b4233de72ac4941998fa9a919d59b11948cbf18daaa6218fc9d3c220dcb
Bid executed successfully!
πŸ’° Charge calculation: {
  gasUsed: '0.000000000000155841',
  roiCharge: '0',
  minBid: '0',
  totalCharge: '0.000000000000155841'
}
βœ… Successfully charged deployer 0xd649cb59755ebc44610a8e5f15d3c93c3aeb08f1: {
  chargeAmount: '0.000000000000155841',
  updatedBalance: '0.000226249998285688'
}
πŸ’Ύ Storing contract data in database...
βœ… Contract data stored in database successfully

Log Walkthrough

  • πŸ”₯ handleProgramActivated – A new contract was detected on the chain.

  • πŸ†• New Stylus contract deployed – SmartCache confirms this is a fresh contract deployment.

  • 🎯 Contract is cacheable – The backend confirms the deployed contract can be cached.

  • βœ… User eligibility confirmed – Ensures the deployer has a registered account and sufficient deposit balance.

  • πŸ“Š ROI Analysis – Gas usage with and without cache is compared (here: 90% savings).

  • πŸ’° Charge calculation – The deployer is only charged based on ROI-driven gas savings.

  • πŸ’Ύ Database store – Contract metadata and caching details are stored for future queries.

With this crate, developers don’t need to manage caching logic manually β€” everything happens automatically, with full transparency through logs.

Last updated