Farseen0/scar-pairs huggingface dataset:
HIGH severity: Vulnerable function: ```\nfunction withdrawFromGauge(uint256 _NFTId, address[] memory _tokens)  public  {\n    uint256 am. ```\nfunction withdrawFromGauge(uint256 _NFTId, address[] memory _tokens)  public  {\n    uint256 amount = depositReceipt.pooledTokens(_NFTId);\n    depositReceipt.burn(_NFTId);\n    gauge.getReward(address(this), _tokens);\n    gauge.withdraw(amount);\n    //AMMToken adheres to ERC20 spec meaning i

Vulnerable code:
```\nfunction withdrawFromGauge(uint256 _NFTId, address[] memory _tokens)  public  {\n    uint256 amount = depositReceipt.pooledTokens(_NFTId);\n    depositReceipt.burn(_NFTId);\n    gauge.getReward(address(this), _tokens);\n    gauge.withdraw(amount);\n    //AMMToken adheres to ERC20 spec meaning it reverts on failure, no need to check return\n    //slither-disable-next-line unchecked-transfer\n    AMMToken.transfer(msg.sender, amount);\n}\n```\n
HIGH severity: Vulnerable function: ```\ndef lp_price() -> uint256:\n    """\n    Approximate LP token price\n    "". ```\ndef lp_price() -> uint256:\n    """\n    Approximate LP token price\n    """\n    return 2 * self.virtual_price * self.sqrt_int(self.internal_price_oracle()) / 10**18\n```\n

Vulnerable code:
```\ndef lp_price() -> uint256:\n    """\n    Approximate LP token price\n    """\n    return 2 * self.virtual_price * self.sqrt_int(self.internal_price_oracle()) / 10**18\n```\n
MEDIUM severity: Vulnerable function: ```\n  function cancel(uint256 proposalId) external {\n    if(_getProposalState(proposalId) == Propo. ```\n  function cancel(uint256 proposalId) external {\n    if(_getProposalState(proposalId) == ProposalState.Executed) revert InvalidProposalState();\n    Proposal storage proposal = proposals[proposalId];\n    if(msg.sender != proposal.proposer) revert NotProposer();\n    if(GovLocks(govlocks).getP

Vulnerable code:
```\n  function cancel(uint256 proposalId) external {\n    if(_getProposalState(proposalId) == ProposalState.Executed) revert InvalidProposalState();\n    Proposal storage proposal = proposals[proposalId];\n    if(msg.sender != proposal.proposer) revert NotProposer();\n    if(GovLocks(govlocks).getPriorVotes(proposal.proposer, block.number - 1) > proposalThreshold) revert AboveThreshold(); //@audit incorrect\n    proposal.cancelled = true;\n    uint256 targetsLength = proposal.targets.length;\n    for (uint256 i = 0; i < targetsLength; i++) {\n      Timelock(timelock).cancelTransaction(proposal.targets[i], proposal.eta, proposal.values[i], proposal.calldatas[i], proposal.signatures[i]);\n    }\n    emit ProposalCanceled(proposalId);\n  }\n```\n
HIGH severity: Vulnerable function: ```\nFile: LiquidationFacetImpl.sol\n    function liquidatePositionsPartyA(\n        address partyA,. ```\nFile: LiquidationFacetImpl.sol\n    function liquidatePositionsPartyA(\n        address partyA,\n        uint256[] memory quoteIds\n    ) internal returns (bool) {\n..SNIP..\n            (bool hasMadeProfit, uint256 amount) = LibQuote.getValueOfQuoteForPartyA(\n                accountLayout.sym

Vulnerable code:
```\nFile: LiquidationFacetImpl.sol\n    function liquidatePositionsPartyA(\n        address partyA,\n        uint256[] memory quoteIds\n    ) internal returns (bool) {\n..SNIP..\n            (bool hasMadeProfit, uint256 amount) = LibQuote.getValueOfQuoteForPartyA(\n                accountLayout.symbolsPrices[partyA][quote.symbolId].price,\n                LibQuote.quoteOpenAmount(quote),\n                quote\n            );\n..SNIP..\n            if (\n                accountLayout.liquidationDetails[partyA].liquidationType == LiquidationType.NORMAL\n            ) {\n                accountLayout.partyBAllocatedBalances[quote.partyB][partyA] += quote\n                    .lockedValues\n                    .cva;\n                if (hasMadeProfit) {\n                    accountLayout.partyBAllocatedBalances[quote.partyB][partyA] -= amount;\n                } else {\n                    accountLayout.partyBAllocatedBalances[quote.partyB][partyA] += amount;\n                }\n            } else if (\n                accountLayout.liquidationDetails[partyA].liquidationType == LiquidationType.LATE\n            ) {\n                accountLayout.partyBAllocatedBalances[quote.partyB][partyA] +=\n                    quote.lockedValues.cva -\n                    ((quote.lockedValues.cva * accountLayout.liquidationDetails[partyA].deficit) /\n                        accountLayout.lockedBalances[partyA].cva);\n                if (hasMadeProfit) {\n                    accountLayout.partyBAllocatedBalances[quote.partyB][partyA] -= amount;\n                } else {\n                    accountLayout.partyBAllocatedBalances[quote.partyB][partyA] += amount;\n                }\n            } else if (\n                accountLayout.liquidationDetails[partyA].liquidationType == LiquidationType.OVERDUE\n            ) {\n                if (hasMadeProfit) {\n                    accountLayout.partyBAllocatedBalances[quote.partyB][partyA] -= amount;\n                } else {\n                    accountLayout.partyBAllocatedBalances[quote.partyB][partyA] +=\n                        amount -\n                        ((amount * accountLayout.liquidationDetails[partyA].deficit) /\n                            uint256(-accountLayout.liquidationDetails[partyA].totalUnrealizedLoss));\n                }\n            }\n```\n
HIGH severity: Vulnerable function: ```\n    function rebase(uint32 _l2Gas) external {\n        inflationMultiplier = IECO(l1Eco).getPas. ```\n    function rebase(uint32 _l2Gas) external {\n        inflationMultiplier = IECO(l1Eco).getPastLinearInflation(block.number);\n```\n

Vulnerable code:
```\n    function rebase(uint32 _l2Gas) external {\n        inflationMultiplier = IECO(l1Eco).getPastLinearInflation(block.number);\n```\n
MEDIUM severity: Vulnerable function: ```\npriceShift = current price - last price\npriceShift = $600 - $1000 = -$400\. ```\npriceShift = current price - last price\npriceShift = $600 - $1000 = -$400\n\nprofitLossTotal = (globalPosition.sizeOpenedTotal * priceShift) / current price\nprofitLossTotal = (12 ETH * -$400) / $600\nprofitLossTotal = -8 ETH\n```\n

Vulnerable code:
```\npriceShift = current price - last price\npriceShift = $600 - $1000 = -$400\n\nprofitLossTotal = (globalPosition.sizeOpenedTotal * priceShift) / current price\nprofitLossTotal = (12 ETH * -$400) / $600\nprofitLossTotal = -8 ETH\n```\n
MEDIUM severity: Vulnerable function: ```\n} else if (key == "emaAlpha") {\n    require(value > 0, "alpha should be > . ```\n} else if (key == "emaAlpha") {\n    require(value > 0, "alpha should be > 0");\n    governance.emaAlpha = value;\n    emaAlpha2 = 10\*\*18 - governance.emaAlpha;\n    emaAlpha2Ln = emaAlpha2.wln();\n```\n

Vulnerable code:
```\n} else if (key == "emaAlpha") {\n    require(value > 0, "alpha should be > 0");\n    governance.emaAlpha = value;\n    emaAlpha2 = 10\*\*18 - governance.emaAlpha;\n    emaAlpha2Ln = emaAlpha2.wln();\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _calcQuoteAmountSellBase(\n        address baseToken,\n        uint256 baseAmount,\n  . ```\nfunction _calcQuoteAmountSellBase(\n        address baseToken,\n        uint256 baseAmount,\n        IWooracleV2.State memory state\n    ) private view returns (uint256 quoteAmount, uint256 newPrice) {\n        require(state.woFeasible, "WooPPV2: !ORACLE_FEASIBLE");\n\n        DecimalInfo memor

Vulnerable code:
```\nfunction _calcQuoteAmountSellBase(\n        address baseToken,\n        uint256 baseAmount,\n        IWooracleV2.State memory state\n    ) private view returns (uint256 quoteAmount, uint256 newPrice) {\n        require(state.woFeasible, "WooPPV2: !ORACLE_FEASIBLE");\n\n        DecimalInfo memory decs = decimalInfo(baseToken);\n\n        // gamma = k * price * base_amount; and decimal 18\n        uint256 gamma;\n        {\n            uint256 notionalSwap = (baseAmount * state.price * decs.quoteDec) / decs.baseDec / decs.priceDec;\n            require(notionalSwap <= tokenInfos[baseToken].maxNotionalSwap, "WooPPV2: !maxNotionalValue");\n\n            gamma = (baseAmount * state.price * state.coeff) / decs.priceDec / decs.baseDec;\n            require(gamma <= tokenInfos[baseToken].maxGamma, "WooPPV2: !gamma");\n\n            // Formula: quoteAmount = baseAmount * oracle.price * (1 - oracle.k * baseAmount * oracle.price - oracle.spread)\n            quoteAmount =\n                (((baseAmount * state.price * decs.quoteDec) / decs.priceDec) *\n                    (uint256(1e18) - gamma - state.spread)) /\n                1e18 /\n                decs.baseDec;\n        }\n\n        // newPrice = oracle.price * (1 - k * oracle.price * baseAmount)\n        newPrice = ((uint256(1e18) - gamma) * state.price) / 1e18;\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction contribute(address \_contributor, uint256 \_value) external payable nonReentrant auth(. ```\nfunction contribute(address \_contributor, uint256 \_value) external payable nonReentrant auth(CONTRIBUTE\_ROLE) {\n    require(state() == State.Funding, ERROR\_INVALID\_STATE);\n\n    if (contributionToken == ETH) {\n        require(msg.value == \_value, ERROR\_INVALID\_CONTRIBUTE\_VALUE);\n  

Vulnerable code:
```\nfunction contribute(address \_contributor, uint256 \_value) external payable nonReentrant auth(CONTRIBUTE\_ROLE) {\n    require(state() == State.Funding, ERROR\_INVALID\_STATE);\n\n    if (contributionToken == ETH) {\n        require(msg.value == \_value, ERROR\_INVALID\_CONTRIBUTE\_VALUE);\n    } else {\n        require(msg.value == 0,      ERROR\_INVALID\_CONTRIBUTE\_VALUE);\n    }\n```\n
HIGH severity: Vulnerable function: ```\nfunction getCErc20Price(ICToken cToken, address underlying) internal view returns (uint) {\n   . ```\nfunction getCErc20Price(ICToken cToken, address underlying) internal view returns (uint) {\n    /*\n        cToken Exchange rates are scaled by 10^(18 - 8 + underlying token decimals) so to scale\n        the exchange rate to 18 decimals we must multiply it by 1e8 and then divide it by the\n   

Vulnerable code:
```\nfunction getCErc20Price(ICToken cToken, address underlying) internal view returns (uint) {\n    /*\n        cToken Exchange rates are scaled by 10^(18 - 8 + underlying token decimals) so to scale\n        the exchange rate to 18 decimals we must multiply it by 1e8 and then divide it by the\n        number of decimals in the underlying token. Finally to find the price of the cToken we\n        must multiply this value with the current price of the underlying token\n    */\n    return cToken.exchangeRateStored()\n    .mulDivDown(1e8 , IERC20(underlying).decimals())\n    .mulWadDown(oracle.getPrice(underlying));\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction deposit(\n    address asset,\n    uint256 amount\n) external onlyController returns (u. ```\nfunction deposit(\n    address asset,\n    uint256 amount\n) external onlyController returns (uint256) {\n    if (asset == assetToken) {\n        _depositAsset(amount);\n        (, uint256 quoteAmount) = _openShort(amount);\n        return quoteAmount; // @audit this mint UXD equivalent to the 

Vulnerable code:
```\nfunction deposit(\n    address asset,\n    uint256 amount\n) external onlyController returns (uint256) {\n    if (asset == assetToken) {\n        _depositAsset(amount);\n        (, uint256 quoteAmount) = _openShort(amount);\n        return quoteAmount; // @audit this mint UXD equivalent to the amount of vUSD gained\n    } else if (asset == quoteToken) {\n        return _processQuoteMint(amount);\n    } else {\n        revert UnsupportedAsset(asset);\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function _openQueuedTrade(uint256 queueId, uint256 price) internal {\n// rest of code\n    . ```\n    function _openQueuedTrade(uint256 queueId, uint256 price) internal {\n// rest of code\n        if (revisedFee < queuedTrade.totalFee) {\n            tokenX.transfer( //***@audit call transfer , if ERC777 , can re-enter ***/\n                queuedTrade.user,\n                queuedTrade.tot

Vulnerable code:
```\n    function _openQueuedTrade(uint256 queueId, uint256 price) internal {\n// rest of code\n        if (revisedFee < queuedTrade.totalFee) {\n            tokenX.transfer( //***@audit call transfer , if ERC777 , can re-enter ***/\n                queuedTrade.user,\n                queuedTrade.totalFee - revisedFee\n            );\n        }\n\n        queuedTrade.isQueued = false;  //****@audit  change state****/\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction setContractAddress(bytes32 name, address addr) public returns (bool) {\n    require(na. ```\nfunction setContractAddress(bytes32 name, address addr) public returns (bool) {\n    require(name > 0x0000000000000000000000000000000000000000000000000000000000000000, "Contract name must not be empty.");\n    require(isAuthorized(msg.sender), "Not authorized to update contract registry.");\n\n

Vulnerable code:
```\nfunction setContractAddress(bytes32 name, address addr) public returns (bool) {\n    require(name > 0x0000000000000000000000000000000000000000000000000000000000000000, "Contract name must not be empty.");\n    require(isAuthorized(msg.sender), "Not authorized to update contract registry.");\n\n    ContractDetails memory info = registry[name];\n    // create info if it doesn't exist in the registry\n    if (info.contractAddress == address(0)) {\n        info = ContractDetails({\n            owner: msg.sender,\n            contractAddress: addr\n        });\n\n        // Update registry indexing\n        contractKeys.push(name);\n   } else {\n        info.contractAddress = addr;\n   }\n    // update record in the registry\n    registry[name] = info;\n\n    emit RegistryUpdated(addr,name);\n\n    return true;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction updateTemperature(int8 bT, uint256 caseId) private {\n        uint256 t = s.w.t;\n    . ```\nfunction updateTemperature(int8 bT, uint256 caseId) private {\n        uint256 t = s.w.t;\n        if (bT < 0) {\n            if (t <= uint256(-bT)) {\n                // if (change < 0 && t <= uint32(-change)),\n                // then 0 <= t <= type(int8).max because change is an int8.\n     

Vulnerable code:
```\nfunction updateTemperature(int8 bT, uint256 caseId) private {\n        uint256 t = s.w.t;\n        if (bT < 0) {\n            if (t <= uint256(-bT)) {\n                // if (change < 0 && t <= uint32(-change)),\n                // then 0 <= t <= type(int8).max because change is an int8.\n                // Thus, downcasting t to an int8 will not cause overflow.\n                bT = 1 - int8(t);\n                s.w.t = 1;\n            } else {\n                s.w.t = uint32(t - uint256(-bT));\n            }\n        } else {\n            s.w.t = uint32(t + uint256(bT));\n        }\n\n        emit TemperatureChange(s.season.current, caseId, bT);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function isAdminOfHat(address _user, uint256 _hatId) public view returns (bool isAdmin) {\n. ```\n    function isAdminOfHat(address _user, uint256 _hatId) public view returns (bool isAdmin) {\n        uint256 linkedTreeAdmin;\n        uint32 adminLocalHatLevel;\n        if (isLocalTopHat(_hatId)) {\n            linkedTreeAdmin = linkedTreeAdmins[getTopHatDomain(_hatId)];\n            if (li

Vulnerable code:
```\n    function isAdminOfHat(address _user, uint256 _hatId) public view returns (bool isAdmin) {\n        uint256 linkedTreeAdmin;\n        uint32 adminLocalHatLevel;\n        if (isLocalTopHat(_hatId)) {\n            linkedTreeAdmin = linkedTreeAdmins[getTopHatDomain(_hatId)];\n            if (linkedTreeAdmin == 0) {\n                // tree is not linked\n                return isAdmin = isWearerOfHat(_user, _hatId);\n            } else {\n                // tree is linked\n                if (isWearerOfHat(_user, linkedTreeAdmin)) {\n                    return isAdmin = true;\n                } // user wears the treeAdmin\n                else {\n                    adminLocalHatLevel = getLocalHatLevel(linkedTreeAdmin);\n                    _hatId = linkedTreeAdmin;\n                }\n            }\n        } else {\n            // if we get here, _hatId is not a tophat of any kind\n            // get the local tree level of _hatId's admin\n            adminLocalHatLevel = getLocalHatLevel(_hatId) - 1;\n        }\n\n        // search up _hatId's local address space for an admin hat that the _user wears\n        while (adminLocalHatLevel > 0) {\n            if (isWearerOfHat(_user, getAdminAtLocalLevel(_hatId, adminLocalHatLevel))) {\n                return isAdmin = true;\n            }\n            // should not underflow given stopping condition > 0\n            unchecked {\n                --adminLocalHatLevel;\n            }\n        }\n\n        // if we get here, we've reached the top of _hatId's local tree, ie the local tophat\n        // check if the user wears the local tophat\n        if (isWearerOfHat(_user, getAdminAtLocalLevel(_hatId, 0))) return isAdmin = true;\n\n        // if not, we check if it's linked to another tree\n        linkedTreeAdmin = linkedTreeAdmins[getTopHatDomain(_hatId)];\n        if (linkedTreeAdmin == 0) {\n            // tree is not linked\n            // we've already learned that user doesn't wear the local tophat, so there's nothing else to check; we return false\n            return isAdmin = false;\n        } else {\n            // tree is linked\n            // check if user is wearer of linkedTreeAdmin\n            if (isWearerOfHat(_user, linkedTreeAdmin)) return true;\n            // if not, recurse to traverse the parent tree for a hat that the user wears\n            isAdmin = isAdminOfHat(_user, linkedTreeAdmin);\n        }\n    }\n```\n
HIGH severity: Vulnerable function: ```\nfunction getOperatorUtilizationHeapForETH(RioLRTOperatorRegistryStorageV1.StorageV1 storage s)\. ```\nfunction getOperatorUtilizationHeapForETH(RioLRTOperatorRegistryStorageV1.StorageV1 storage s)\n        internal\n        view\n        returns (OperatorUtilizationHeap.Data memory heap)\n    {\n        uint8 numActiveOperators = s.activeOperatorCount;\n        if (numActiveOperators == 0) retu

Vulnerable code:
```\nfunction getOperatorUtilizationHeapForETH(RioLRTOperatorRegistryStorageV1.StorageV1 storage s)\n        internal\n        view\n        returns (OperatorUtilizationHeap.Data memory heap)\n    {\n        uint8 numActiveOperators = s.activeOperatorCount;\n        if (numActiveOperators == 0) return OperatorUtilizationHeap.Data(new OperatorUtilizationHeap.Operator[](0), 0);\n\n        heap = OperatorUtilizationHeap.initialize(MAX_ACTIVE_OPERATOR_COUNT);\n\n        uint256 activeDeposits;\n        IRioLRTOperatorRegistry.OperatorValidatorDetails memory validators;\n        unchecked {\n            uint8 i;\n            for (i = 0; i < numActiveOperators; ++i) {\n                uint8 operatorId = s.activeOperatorsByETHDepositUtilization.get(i);\n\n                // Non-existent operator ID. We've reached the end of the heap.\n                if (operatorId == 0) break;\n\n                validators = s.operatorDetails[operatorId].validatorDetails;\n                activeDeposits = validators.deposited - validators.exited;\n                heap.operators[i + 1] = OperatorUtilizationHeap.Operator({\n                    id: operatorId,\n                    utilization: activeDeposits.divWad(validators.cap)\n                });\n            }\n            heap.count = i;\n        }\n    }\n```\n
HIGH severity: Vulnerable function: ```\nFile: VaultAccount.sol\n    function repayAccountPrimeDebtAtSettlement(\n        PrimeRate memo. ```\nFile: VaultAccount.sol\n    function repayAccountPrimeDebtAtSettlement(\n        PrimeRate memory pr,\n        VaultStateStorage storage primeVaultState,\n        uint16 currencyId,\n        address vault,\n        address account,\n        int256 accountPrimeCash,\n        int256 accountPrimeS

Vulnerable code:
```\nFile: VaultAccount.sol\n    function repayAccountPrimeDebtAtSettlement(\n        PrimeRate memory pr,\n        VaultStateStorage storage primeVaultState,\n        uint16 currencyId,\n        address vault,\n        address account,\n        int256 accountPrimeCash,\n        int256 accountPrimeStorageValue\n    ) internal returns (int256 finalPrimeDebtStorageValue, bool didTransfer) {\n        didTransfer = false;\n        finalPrimeDebtStorageValue = accountPrimeStorageValue;\n        \n        if (accountPrimeCash > 0) {\n            // netPrimeDebtRepaid is a negative number\n            int256 netPrimeDebtRepaid = pr.convertUnderlyingToDebtStorage(\n                pr.convertToUnderlying(accountPrimeCash).neg()\n            );\n\n            int256 netPrimeDebtChange;\n            if (netPrimeDebtRepaid < accountPrimeStorageValue) {\n                // If the net debt change is greater than the debt held by the account, then only\n                // decrease the total prime debt by what is held by the account. The residual amount\n                // will be refunded to the account via a direct transfer.\n                netPrimeDebtChange = accountPrimeStorageValue;\n                finalPrimeDebtStorageValue = 0;\n\n                int256 primeCashRefund = pr.convertFromUnderlying(\n                    pr.convertDebtStorageToUnderlying(netPrimeDebtChange.sub(accountPrimeStorageValue))\n                );\n                TokenHandler.withdrawPrimeCash(\n                    account, currencyId, primeCashRefund, pr, false // ETH will be transferred natively\n                );\n                didTransfer = true;\n            } else {\n                // In this case, part of the account's debt is repaid.\n                netPrimeDebtChange = netPrimeDebtRepaid;\n                finalPrimeDebtStorageValue = accountPrimeStorageValue.sub(netPrimeDebtRepaid);\n            }\n\n            // Updates the global prime debt figure and events are emitted via the vault.\n            pr.updateTotalPrimeDebt(vault, currencyId, netPrimeDebtChange);\n\n            // Updates the state on the prime vault storage directly.\n            int256 totalPrimeDebt = int256(uint256(primeVaultState.totalDebt));\n            int256 newTotalDebt = totalPrimeDebt.add(netPrimeDebtChange);\n            // Set the total debt to the storage value\n            primeVaultState.totalDebt = newTotalDebt.toUint().toUint80();\n        }\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    uint256 balanceBefore = getVaultBalance() - reservedFunds;\n    vaultCu. ```\n    uint256 balanceBefore = getVaultBalance() - reservedFunds;\n    vaultCurrency.safeTransferFrom(msg.sender, address(this), _amount);\n    uint256 balanceAfter = getVaultBalance() - reservedFunds;\n    uint256 amount = balanceAfter - balanceBefore;\n```\n

Vulnerable code:
```\n    uint256 balanceBefore = getVaultBalance() - reservedFunds;\n    vaultCurrency.safeTransferFrom(msg.sender, address(this), _amount);\n    uint256 balanceAfter = getVaultBalance() - reservedFunds;\n    uint256 amount = balanceAfter - balanceBefore;\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction \_updateInterest() internal virtual override {\n    InterestLocalVars memory \_vars;\n. ```\nfunction \_updateInterest() internal virtual override {\n    InterestLocalVars memory \_vars;\n    \_vars.currentCash = \_getCurrentCash();\n    \_vars.totalBorrows = totalBorrows;\n    \_vars.totalReserves = totalReserves;\n\n    // Gets the current borrow interest rate.\n    \_vars.borrowRate

Vulnerable code:
```\nfunction \_updateInterest() internal virtual override {\n    InterestLocalVars memory \_vars;\n    \_vars.currentCash = \_getCurrentCash();\n    \_vars.totalBorrows = totalBorrows;\n    \_vars.totalReserves = totalReserves;\n\n    // Gets the current borrow interest rate.\n    \_vars.borrowRate = interestRateModel.getBorrowRate(\n        \_vars.currentCash,\n        \_vars.totalBorrows,\n        \_vars.totalReserves\n    );\n    require(\n        \_vars.borrowRate <= maxBorrowRate,\n        "\_updateInterest: Borrow rate is too high!"\n    );\n```\n