{
    "Function": "slitherConstructorConstantVariables",
    "File": "src/AddressDriver.sol",
    "Parent Contracts": [
        "lib/openzeppelin-contracts/contracts/metatx/ERC2771Context.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol",
        "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 AddressDriver is Managed, ERC2771Context {\n    using SafeERC20 for IERC20;\n\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\n    /// @param _dripsHub The drips hub to use.\n    /// @param forwarder The ERC-2771 forwarder to trust. May be the zero address.\n    /// @param _driverId The driver ID to use when calling DripsHub.\n    constructor(DripsHub _dripsHub, address forwarder, uint32 _driverId)\n        ERC2771Context(forwarder)\n    {\n        dripsHub = _dripsHub;\n        driverId = _driverId;\n    }\n\n    /// @notice Calculates the user ID for an address\n    /// @param userAddr The user address\n    /// @return userId The user ID\n    function calcUserId(address userAddr) public view returns (uint256 userId) {\n        return (uint256(driverId) << 224) | uint160(userAddr);\n    }\n\n    /// @notice Calculates the user ID for the message sender\n    /// @return userId The user ID\n    function callerUserId() internal view returns (uint256 userId) {\n        return calcUserId(_msgSender());\n    }\n\n    /// @notice Collects the user's received already split funds\n    /// and transfers them out of the drips hub contract.\n    /// @param erc20 The used ERC-20 token.\n    /// It must preserve amounts, so if some amount of tokens is transferred to\n    /// an address, then later the same amount must be transferrable from that address.\n    /// Tokens which rebase the holders' balances, collect taxes on transfers,\n    /// or impose any restrictions on holding or transferring tokens are not supported.\n    /// If you use such tokens in the protocol, they can get stuck or lost.\n    /// @param transferTo The address to send collected funds to\n    /// @return amt The collected amount\n    function collect(IERC20 erc20, address transferTo) public whenNotPaused returns (uint128 amt) {\n        amt = dripsHub.collect(callerUserId(), erc20);\n        erc20.safeTransfer(transferTo, amt);\n    }\n\n    /// @notice Gives funds from the message sender to the receiver.\n    /// The receiver can collect them immediately.\n    /// Transfers the funds to be given from the message sender's wallet to the drips hub contract.\n    /// @param receiver The receiver\n    /// @param erc20 The used ERC-20 token.\n    /// It must preserve amounts, so if some amount of tokens is transferred to\n    /// an address, then later the same amount must be transferrable from that address.\n    /// Tokens which rebase the holders' balances, collect taxes on transfers,\n    /// or impose any restrictions on holding or transferring tokens are not supported.\n    /// If you use such tokens in the protocol, they can get stuck or lost.\n    /// @param amt The given amount\n    function give(uint256 receiver, IERC20 erc20, uint128 amt) public whenNotPaused {\n        _transferFromCaller(erc20, amt);\n        dripsHub.give(callerUserId(), receiver, erc20, amt);\n    }\n\n    /// @notice Sets the message sender's drips configuration.\n    /// Transfers funds between the message sender's wallet and the drips hub contract\n    /// to fulfill the change of the drips balance.\n    /// @param erc20 The used ERC-20 token.\n    /// It must preserve amounts, so if some amount of tokens is transferred to\n    /// an address, then later the same amount must be transferrable from that address.\n    /// Tokens which rebase the holders' balances, collect taxes on transfers,\n    /// or impose any restrictions on holding or transferring tokens are not supported.\n    /// If you use such tokens in the protocol, they can get stuck or lost.\n    /// @param currReceivers The list of the drips receivers set in the last drips update\n    /// of the sender.\n    /// If this is the first update, pass an empty array.\n    /// @param balanceDelta The drips balance change to be applied.\n    /// Positive to add funds to the drips balance, negative to remove them.\n    /// @param newReceivers The list of the drips receivers of the sender to be set.\n    /// Must be sorted by the receivers' addresses, deduplicated and without 0 amtPerSecs.\n    /// @param maxEndHint1 An optional parameter allowing gas optimization, pass `0` to ignore it.\n    /// The first hint for finding the maximum end time when all drips stop due to funds\n    /// running out after the balance is updated and the new receivers list is applied.\n    /// Hints have no effect on the results of calling this function, except potentially saving gas.\n    /// Hints are Unix timestamps used as the starting points for binary search for the time\n    /// when funds run out in the range of timestamps from the current block's to `2^32`.\n    /// Hints lower than the current timestamp are ignored.\n    /// You can provide zero, one or two hints. The order of hints doesn't matter.\n    /// Hints are the most effective when one of them is lower than or equal to\n    /// the last timestamp when funds are still dripping, and the other one is strictly larger\n    /// than that timestamp,the smaller the difference between such hints, the higher gas savings.\n    /// The savings are the highest possible when one of the hints is equal to\n    /// the last timestamp when funds are still dripping, and the other one is larger by 1.\n    /// It's worth noting that the exact timestamp of the block in which this function is executed\n    /// may affect correctness of the hints, especially if they're precise.\n    /// Hints don't provide any benefits when balance is not enough to cover\n    /// a single second of dripping or is enough to cover all drips until timestamp `2^32`.\n    /// Even inaccurate hints can be useful, and providing a single hint\n    /// or two hints that don't enclose the time when funds run out can still save some gas.\n    /// Providing poor hints that don't reduce the number of binary search steps\n    /// may cause slightly higher gas usage than not providing any hints.\n    /// @param maxEndHint2 An optional parameter allowing gas optimization, pass `0` to ignore it.\n    /// The second hint for finding the maximum end time, see `maxEndHint1` docs for more details.\n    /// @param transferTo The address to send funds to in case of decreasing balance\n    /// @return realBalanceDelta The actually applied drips balance change.\n    function setDrips(\n        IERC20 erc20,\n        DripsReceiver[] calldata currReceivers,\n        int128 balanceDelta,\n        DripsReceiver[] calldata newReceivers,\n        // slither-disable-next-line similar-names\n        uint32 maxEndHint1,\n        uint32 maxEndHint2,\n        address transferTo\n    ) public whenNotPaused returns (int128 realBalanceDelta) {\n        if (balanceDelta > 0) {\n            _transferFromCaller(erc20, uint128(balanceDelta));\n        }\n        realBalanceDelta = dripsHub.setDrips(\n            callerUserId(),\n            erc20,\n            currReceivers,\n            balanceDelta,\n            newReceivers,\n            maxEndHint1,\n            maxEndHint2\n        );\n        if (realBalanceDelta < 0) {\n            erc20.safeTransfer(transferTo, uint128(-realBalanceDelta));\n        }\n    }\n\n    /// @notice Sets user splits configuration. The configuration is common for all assets.\n    /// Nothing happens to the currently splittable funds, but when they are split\n    /// after this function finishes, the new splits configuration will be used.\n    /// Because anybody can call `split` on `DripsHub`, calling this function may be frontrun\n    /// and all the currently splittable funds will be split using the old splits configuration.\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 / TOTAL_SPLITS_WEIGHT`\n    /// share of the funds collected by the user.\n    function setSplits(SplitsReceiver[] calldata receivers) public whenNotPaused {\n        dripsHub.setSplits(callerUserId(), receivers);\n    }\n\n    /// @notice Emits the user metadata for the message sender.\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    /// @param userMetadata The list of user metadata.\n    function emitUserMetadata(UserMetadata[] calldata userMetadata) public whenNotPaused {\n        dripsHub.emitUserMetadata(callerUserId(), userMetadata);\n    }\n\n    function _transferFromCaller(IERC20 erc20, uint128 amt) internal {\n        erc20.safeTransferFrom(_msgSender(), address(this), amt);\n        // Approval is done only on the first usage of the ERC-20 token in DripsHub by the driver\n        if (erc20.allowance(address(this), address(dripsHub)) == 0) {\n            erc20.safeApprove(address(dripsHub), type(uint256).max);\n        }\n    }\n}"
}