{
    "Function": "_receiveDrips",
    "File": "src/Drips.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "_receiveDripsResult",
        "_dripsStorage"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _receiveDrips(uint256 userId, uint256 assetId, uint32 maxCycles)\n        internal\n        returns (uint128 receivedAmt)\n    {\n        uint32 receivableCycles;\n        uint32 fromCycle;\n        uint32 toCycle;\n        int128 finalAmtPerCycle;\n        (receivedAmt, receivableCycles, fromCycle, toCycle, finalAmtPerCycle) =\n            _receiveDripsResult(userId, assetId, maxCycles);\n        if (fromCycle != toCycle) {\n            DripsState storage state = _dripsStorage().states[assetId][userId];\n            state.nextReceivableCycle = toCycle;\n            mapping(uint32 => AmtDelta) storage amtDeltas = state.amtDeltas;\n            for (uint32 cycle = fromCycle; cycle < toCycle; cycle++) {\n                delete amtDeltas[cycle];\n            }\n            // The next cycle delta must be relative to the last received cycle, which got zeroed.\n            // In other words the next cycle delta must be an absolute value.\n            if (finalAmtPerCycle != 0) {\n                amtDeltas[toCycle].thisCycle += finalAmtPerCycle;\n            }\n        }\n        emit ReceivedDrips(userId, assetId, receivedAmt, receivableCycles);\n    }"
}