Skip to content
/ soroban Public

A basic calculator of SSTORE2 costs for large data storage in contract data on-chain

License

Notifications You must be signed in to change notification settings

Swader/soroban

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSTORE2 Storage Cost Calculator

GitHub license

Compare on-chain storage costs across different blockchains using the SSTORE2 pattern. Calculate deployment costs for Ethereum, Solana, Polygon, and other chains with real-time price data.

🔗 Try it live or run locally by downloading the repository.

Key Features

  • 📊 Multi-Chain Support: Compare costs across Ethereum, Solana, Polygon, BSC, Avalanche, and more
  • 💰 Real-Time Pricing: Live data from CoinGecko (default) or CoinMarketCap
  • 🔒 Privacy First: All calculations happen client-side - no file uploads
  • Zero Dependencies: Pure JavaScript, runs entirely in browser
  • 🛠 Customizable: Add custom chains and modify gas prices

Supported Networks

  • Layer 1: Ethereum, BSC, Avalanche, Solana
  • Layer 2: Arbitrum, Optimism, Base, Blast
  • ZK Rollups: Polygon zkEVM, Scroll, Linea
  • Sidechains: Polygon (with checkpoint cost calculation)
  • Other: Moonbeam (Polkadot)

Features

File Size Input

  • Drag & drop file support for automatic size calculation
  • Manual size input option
  • No file upload - size is calculated client-side for privacy
  • Automatic detection and handling of files exceeding single contract size limit (24,576 bytes)

Chain Support

  • Pre-configured support for major chains:
    • L1s: Ethereum, BSC, Avalanche, Solana
    • L2s: Arbitrum, Optimism, Base, Blast
    • ZK Rollups: Polygon zkEVM, Scroll, Linea
    • Sidechains: Polygon
    • Other: Moonbeam (Polkadot)
  • Custom chain support with configurable parameters
  • Solana included as a non-EVM comparison baseline

Cost Calculation

  • Accurate gas calculations including:
    • Base contract deployment costs
    • Per-byte storage costs
    • L2-specific costs (data availability, compression)
    • Polygon checkpoint costs
    • Solana rent-exempt storage
  • Automatic contract splitting for large files
  • Real-time price data from CoinGecko (default) or CoinMarketCap (optional - see gear icon)
  • USD conversion for easy comparison

Technical Details

SSTORE2 Implementation

  • Contract Creation: ~32k gas overhead
  • Data Storage: ~200 gas per byte
  • Size Limit: 24kb per contract
  • Automatic chunking for files > 24kb

Usage

  1. Input file size (drag & drop or manual entry)
  2. Select chains to compare
  3. Adjust gas prices if needed
  4. Click "Compute Storage Costs"
  5. Review the comparison table showing costs across all selected chains

The calculator will display:

  • Number of contracts/transactions needed
  • Gas costs and fees
  • Native token costs
  • USD equivalent costs
  • Highlighting of most economical option

About

A basic calculator of SSTORE2 costs for large data storage in contract data on-chain

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published