{
    "Function": "slitherConstructorConstantVariables",
    "File": "src/ImmutableSplitsDriver.sol",
    "Parent Contracts": [
        "src/Managed.sol",
        "lib/openzeppelin-contracts/contracts/proxy/utils/UUPSUpgradeable.sol",
        "lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol",
        "lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract ImmutableSplitsDriver is Managed {\n    /// @notice The DripsHub address used by this driver.\n    DripsHub public immutable dripsHub;\n    /// @notice The driver ID which this driver uses when calling DripsHub.\n    uint32 public immutable driverId;\n    /// @notice The required total splits weight of each splits configuration\n    uint32 public immutable totalSplitsWeight;\n    /// @notice The ERC-1967 storage slot holding a single `uint256` counter of created identities.\n    bytes32 private immutable _counterSlot = _erc1967Slot(\"eip1967.immutableSplitsDriver.storage\");\n\n    /// @notice Emitted when an immutable splits configuration is created.\n    /// @param userId The user ID\n    /// @param receiversHash The splits receivers list hash\n    event CreatedSplits(uint256 indexed userId, bytes32 indexed receiversHash);\n\n    /// @param _dripsHub The drips hub to use.\n    /// @param _driverId The driver ID to use when calling DripsHub.\n    constructor(DripsHub _dripsHub, uint32 _driverId) {\n        dripsHub = _dripsHub;\n        driverId = _driverId;\n        totalSplitsWeight = _dripsHub.TOTAL_SPLITS_WEIGHT();\n    }\n\n    /// @notice The ID of the next user to be created.\n    /// @return userId The user ID.\n    function nextUserId() public view returns (uint256 userId) {\n        return (uint256(driverId) << 224) + StorageSlot.getUint256Slot(_counterSlot).value;\n    }\n\n    /// @notice Creates a new user ID, configures its splits configuration and emits its metadata.\n    /// The configuration is immutable and nobody can control the user ID after its creation.\n    /// Calling this function is the only way and the only chance to emit metadata for that user.\n    /// @param receivers The list of the user's splits receivers to be set.\n    /// Must be sorted by the splits receivers' addresses, deduplicated and without 0 weights.\n    /// Each splits receiver will be getting `weight / totalSplitsWeight`\n    /// share of the funds collected by the user.\n    /// The sum of the receivers' weights must be equal to `totalSplitsWeight`,\n    /// or in other words the configuration must be splitting 100% of received funds.\n    /// @param userMetadata The list of user metadata to emit for the created user.\n    /// The keys and the values are not standardized by the protocol, it's up to the user\n    /// to establish and follow conventions to ensure compatibility with the consumers.\n    /// @return userId The new user ID with `receivers` configured.\n    function createSplits(SplitsReceiver[] calldata receivers, UserMetadata[] calldata userMetadata)\n        public\n        whenNotPaused\n        returns (uint256 userId)\n    {\n        userId = nextUserId();\n        StorageSlot.getUint256Slot(_counterSlot).value++;\n        uint256 weightSum = 0;\n        for (uint256 i = 0; i < receivers.length; i++) {\n            weightSum += receivers[i].weight;\n        }\n        require(weightSum == totalSplitsWeight, \"Invalid total receivers weight\");\n        emit CreatedSplits(userId, dripsHub.hashSplits(receivers));\n        dripsHub.setSplits(userId, receivers);\n        if (userMetadata.length > 0) dripsHub.emitUserMetadata(userId, userMetadata);\n    }\n}"
}