This library generates unique and collision-resistant storage slots for use in upgradeable Solidity contracts. It ensures that different modules or instances do not unintentionally overwrite each other’s storage, even when used via proxy or delegate calls.

Storage Slot Strategy

This structure ensures:

Function

getSlot(string contractName, string name, uint256 version) → bytes32

Description:

Computes a deterministic, collision-resistant storage slot for a contract module.

Parameters:

Returns:

Example: