{
    "Function": "_setBalanceStorage",
    "File": "contracts/stubs/BalanceHandler.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "LibStorage",
        "FloatingPoint56"
    ],
    "Internal Calls": [
        "require(bool)",
        "require(bool)",
        "require(bool)"
    ],
    "Library Calls": [
        "getBalanceStorage",
        "packTo56Bits"
    ],
    "Low-Level Calls": [],
    "Code": "function _setBalanceStorage(\n        address account,\n        uint256 currencyId,\n        int256 cashBalance,\n        int256 nTokenBalance,\n        uint256 lastClaimTime,\n        uint256 lastClaimIntegralSupply\n    ) private {\n        mapping(address => mapping(uint256 => BalanceStorage)) storage store = LibStorage.getBalanceStorage();\n        BalanceStorage storage balanceStorage = store[account][currencyId];\n\n        require(cashBalance >= type(int88).min && cashBalance <= type(int88).max); // dev: stored cash balance overflow\n        // Allows for 12 quadrillion nToken balance in 1e8 decimals before overflow\n        require(nTokenBalance >= 0 && nTokenBalance <= type(uint80).max); // dev: stored nToken balance overflow\n        require(lastClaimTime <= type(uint32).max); // dev: last claim time overflow\n\n        balanceStorage.nTokenBalance = uint80(nTokenBalance);\n        balanceStorage.lastClaimTime = uint32(lastClaimTime);\n        balanceStorage.cashBalance = int88(cashBalance);\n\n        // Last claim supply is stored in a \"floating point\" storage slot that does not maintain exact precision but\n        // is also not limited by storage overflows. `packTo56Bits` will ensure that the the returned value will fit\n        // in 56 bits (7 bytes)\n        balanceStorage.packedLastClaimIntegralSupply = FloatingPoint56.packTo56Bits(lastClaimIntegralSupply);\n    }"
}