Your file exceeds the EVM code size limit (24,576 bytes). It will be split into multiple contracts automatically.
Chains to Compare
Chain
Type
Gas Price (Gwei)
RPC URL
Cost Comparison
Chain
File Size (bytes)
Number of Contracts/Tx
Gas Used
Gas Price (Gwei)
Cost in Native
Native Price (USD)
Total (USD)
What happens when a file is bigger than the maximum contract size?
When your file exceeds the EVM's maximum contract size of 24,576 bytes, the SSTORE2 implementation automatically splits it into multiple contracts. Each contract stores a chunk of your data, and a main contract keeps track of these storage contracts' addresses in sequence. When reading the data back, the implementation automatically concatenates all chunks in the correct order, making the splitting process transparent to the end user.
How does SSTORE2 work for storing data?
SSTORE2 is a clever pattern that stores data as contract code instead of contract storage. It works by:
Taking your data and wrapping it in minimal bytecode that makes it valid EVM code
Deploying this "data contract" using CREATE2 (for deterministic addresses)
Storing only the address of this contract (20 bytes) in the main contract
When reading, it uses EXTCODECOPY to efficiently retrieve the data
This approach is much more gas efficient than traditional storage because contract deployment has different gas mechanics than storage operations.
Why is SSTORE2 more efficient than SSTORE?
SSTORE2 is more efficient than regular SSTORE operations for several reasons:
SSTORE costs 20,000 gas for a new storage slot, while code storage only costs about 200 gas per byte
SSTORE requires 32-byte alignment, potentially wasting space, while code storage is byte-aligned
Multiple SSTORE operations are needed for large data, while code storage is contiguous
Reading from code (EXTCODECOPY) is cheaper than reading from storage (SLOAD)
For example, storing 24kb of data using SSTORE would cost approximately 15M gas, while using SSTORE2 would cost only about 5M gas.
How are Polygon fees calculated?
Polygon's fee structure involves both L2 transaction fees and L1 security costs:
Direct transaction fees are paid in POL on the Polygon network
Every 30 minutes, Polygon submits a "checkpoint" to Ethereum containing state changes
Each checkpoint costs approximately 0.02 ETH on mainnet (0.06 ETH per hour)
On average, a checkpoint contains about 1500 blocks
Each block contains approximately 80 transactions
This means each checkpoint includes roughly 120,000 transactions (1500 * 80)
The L1 costs (0.02 ETH) are effectively distributed across these 120,000 transactions
Therefore, the true cost of a Polygon transaction is:
Direct cost: The POL fee you pay for the transaction
Indirect L1 cost: Your share of the checkpoint cost (approximately 0.02 ETH / 120,000 transactions)
This calculator includes both components to give you the full cost of storing data on Polygon.