Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\n### BunniPrice.sol and BunniSupply.sol : \n    function _validateReserves( BunniKey memory key_. ```\n### BunniPrice.sol and BunniSupply.sol : \n    function _validateReserves( BunniKey memory key_,BunniLens lens_,uint16 twapMaxDeviationBps_,uint32 twapObservationWindow_) internal view \n        {\n        uint256 reservesTokenRatio = BunniHelper.getReservesRatio(key_, lens_);\n        uint256 

Vulnerable code:
```\n### BunniPrice.sol and BunniSupply.sol : \n    function _validateReserves( BunniKey memory key_,BunniLens lens_,uint16 twapMaxDeviationBps_,uint32 twapObservationWindow_) internal view \n        {\n        uint256 reservesTokenRatio = BunniHelper.getReservesRatio(key_, lens_);\n        uint256 twapTokenRatio = UniswapV3OracleHelper.getTWAPRatio(address(key_.pool),twapObservationWindow_);\n\n        // Revert if the relative deviation is greater than the maximum.\n        if (\n            // `isDeviatingWithBpsCheck()` will revert if `deviationBps` is invalid.\n            Deviation.isDeviatingWithBpsCheck(\n                reservesTokenRatio,\n                twapTokenRatio,\n                twapMaxDeviationBps_,\n                TWAP_MAX_DEVIATION_BASE\n            )\n        ) {\n            revert BunniPrice_PriceMismatch(address(key_.pool), twapTokenRatio, reservesTokenRatio);\n        }\n    }\n\n### BunniHelper.sol : \n    function getReservesRatio(BunniKey memory key_, BunniLens lens_) public view returns (uint256) {\n        IUniswapV3Pool pool = key_.pool;\n        uint8 token0Decimals = ERC20(pool.token0()).decimals();\n\n        (uint112 reserve0, uint112 reserve1) = lens_.getReserves(key_);\n        \n        //E compute fees and return values \n        (uint256 fee0, uint256 fee1) = lens_.getUncollectedFees(key_);\n        \n        //E calculates ratio of token1 in token0\n        return (reserve1 + fee1).mulDiv(10 ** token0Decimals, reserve0 + fee0);\n    }\n\n### UniswapV3OracleHelper.sol : \n    //E Returns the ratio of token1 to token0 in token1 decimals based on the TWAP\n        //E used in bophades/src/modules/PRICE/submodules/feeds/BunniPrice.sol, and SPPLY/submodules/BunniSupply.sol\n    function getTWAPRatio(\n        address pool_, \n        uint32 period_ //E period of the TWAP in seconds \n    ) public view returns (uint256) \n    {\n        //E return the time-weighted tick from period_ to now\n        int56 timeWeightedTick = getTimeWeightedTick(pool_, period_);\n\n        IUniswapV3Pool pool = IUniswapV3Pool(pool_);\n        ERC20 token0 = ERC20(pool.token0());\n        ERC20 token1 = ERC20(pool.token1());\n\n        // Quantity of token1 for 1 unit of token0 at the time-weighted tick\n        // Scale: token1 decimals\n        uint256 baseInQuote = OracleLibrary.getQuoteAtTick(\n            int24(timeWeightedTick),\n            uint128(10 ** token0.decimals()), // 1 unit of token0 => baseAmount\n            address(token0),\n            address(token1)\n        );\n        return baseInQuote;\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction getAllDelegationRequests() external returns(uint[] memory) {\n    revert("Not implemen. ```\nfunction getAllDelegationRequests() external returns(uint[] memory) {\n    revert("Not implemented");\n}\n\nfunction getDelegationRequestsForValidator(uint validatorId) external returns (uint[] memory) {\n    revert("Not implemented");\n}\n```\n

Vulnerable code:
```\nfunction getAllDelegationRequests() external returns(uint[] memory) {\n    revert("Not implemented");\n}\n\nfunction getDelegationRequestsForValidator(uint validatorId) external returns (uint[] memory) {\n    revert("Not implemented");\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 totalFunding = (2 * overbalancedValue * fundingRateMultiplier * ora. ```\nuint256 totalFunding = (2 * overbalancedValue * fundingRateMultiplier * oracleManager.EPOCH_LENGTH()) / (365.25 days * 10000);\n```\n

Vulnerable code:
```\nuint256 totalFunding = (2 * overbalancedValue * fundingRateMultiplier * oracleManager.EPOCH_LENGTH()) / (365.25 days * 10000);\n```\n
HIGH severity: Vulnerable function: ```\nfunction recalculateNftPower(uint256 tokenId) public override returns (uint256 newPower) {\n   . ```\nfunction recalculateNftPower(uint256 tokenId) public override returns (uint256 newPower) {\n    // @audit execution allowed to continue when\n    // block.timestamp == powerCalcStartTimestamp\n    if (block.timestamp < powerCalcStartTimestamp) {\n        return 0;\n    }\n    // @audit getNftPo

Vulnerable code:
```\nfunction recalculateNftPower(uint256 tokenId) public override returns (uint256 newPower) {\n    // @audit execution allowed to continue when\n    // block.timestamp == powerCalcStartTimestamp\n    if (block.timestamp < powerCalcStartTimestamp) {\n        return 0;\n    }\n    // @audit getNftPower() returns 0 when\n    // block.timestamp == powerCalcStartTimestamp\n    newPower = getNftPower(tokenId);\n\n    NftInfo storage nftInfo = nftInfos[tokenId];\n\n    // @audit as this is the first update since power\n    // calculation has just started, totalPower will be\n    // subtracted by nft's max power\n    totalPower -= nftInfo.lastUpdate != 0 ? nftInfo.currentPower : getMaxPowerForNft(tokenId);\n    // @audit totalPower += 0 (newPower = 0 in above line)\n    totalPower += newPower;\n\n    nftInfo.lastUpdate = uint64(block.timestamp);\n    // @audit will set nft's current power to 0\n    nftInfo.currentPower = newPower;\n}\n\nfunction getNftPower(uint256 tokenId) public view override returns (uint256) {\n    // @audit execution always returns 0 when\n    // block.timestamp == powerCalcStartTimestamp\n    if (block.timestamp <= powerCalcStartTimestamp) {\n        return 0;\n```\n
MEDIUM severity: Vulnerable function: ```\n    if (shares.gt(_maxRedeemAtEpoch(context, accountContext, account))) rev. ```\n    if (shares.gt(_maxRedeemAtEpoch(context, accountContext, account))) revert BalancedVaultRedemptionLimitExceeded();\n```\n

Vulnerable code:
```\n    if (shares.gt(_maxRedeemAtEpoch(context, accountContext, account))) revert BalancedVaultRedemptionLimitExceeded();\n```\n
HIGH severity: Vulnerable function: ```\n    function claimCOMPAndTransfer(address[] calldata cTokens)\n        external\n        overri. ```\n    function claimCOMPAndTransfer(address[] calldata cTokens)\n        external\n        override\n        onlyManagerContract\n        nonReentrant\n        returns (uint256)\n    {\n        uint256 balanceBefore = COMP.balanceOf(address(this));\n        COMPTROLLER.claimComp(address(this), cT

Vulnerable code:
```\n    function claimCOMPAndTransfer(address[] calldata cTokens)\n        external\n        override\n        onlyManagerContract\n        nonReentrant\n        returns (uint256)\n    {\n        uint256 balanceBefore = COMP.balanceOf(address(this));\n        COMPTROLLER.claimComp(address(this), cTokens);\n        uint256 balanceAfter = COMP.balanceOf(address(this));\n\n        // NOTE: the onlyManagerContract modifier prevents a transfer to address(0) here\n        uint256 netBalance = balanceAfter.sub(balanceBefore);   //<-------@only transfer out `netBalance`\n        if (netBalance > 0) {\n            COMP.safeTransfer(msg.sender, netBalance);\n        }\n\n        // NOTE: TreasuryManager contract will emit a COMPHarvested event\n        return netBalance;\n```\n
HIGH severity: Vulnerable function: ```\n 69    // Else if user wants to withdraw in LP token, the tokensToUser is a. ```\n 69    // Else if user wants to withdraw in LP token, the tokensToUser is already previously\n 70    // set in GMXWithdraw.withdraw()\n 71    if (\n 72      self.withdrawCache.withdrawParams.token == address(self.tokenA) ||\n 73      self.withdrawCache.withdrawParams.token == address(self.token

Vulnerable code:
```\n 69    // Else if user wants to withdraw in LP token, the tokensToUser is already previously\n 70    // set in GMXWithdraw.withdraw()\n 71    if (\n 72      self.withdrawCache.withdrawParams.token == address(self.tokenA) ||\n 73      self.withdrawCache.withdrawParams.token == address(self.tokenB)\n 74    ) {\n\n104      GMXChecks.afterWithdrawChecks(self);\n105    }\n106  }  \n```\n
MEDIUM severity: Vulnerable function: ```\n/\*\*\n \* @notice Registers an exit game within the PlasmaFramework. Only the maintainer can c. ```\n/\*\*\n \* @notice Registers an exit game within the PlasmaFramework. Only the maintainer can call the function.\n \* @dev Emits ExitGameRegistered event to notify clients\n \* @param \_txType The tx type where the exit game wants to register\n \* @param \_contract Address of the exit game cont

Vulnerable code:
```\n/\*\*\n \* @notice Registers an exit game within the PlasmaFramework. Only the maintainer can call the function.\n \* @dev Emits ExitGameRegistered event to notify clients\n \* @param \_txType The tx type where the exit game wants to register\n \* @param \_contract Address of the exit game contract\n \* @param \_protocol The transaction protocol, either 1 for MVP or 2 for MoreVP\n \*/\nfunction registerExitGame(uint256 \_txType, address \_contract, uint8 \_protocol) public onlyFrom(getMaintainer()) {\n    require(\_txType != 0, "Should not register with tx type 0");\n    require(\_contract != address(0), "Should not register with an empty exit game address");\n    require(\_exitGames[\_txType] == address(0), "The tx type is already registered");\n    require(\_exitGameToTxType[\_contract] == 0, "The exit game contract is already registered");\n    require(Protocol.isValidProtocol(\_protocol), "Invalid protocol value");\n\n    \_exitGames[\_txType] = \_contract;\n    \_exitGameToTxType[\_contract] = \_txType;\n    \_protocols[\_txType] = \_protocol;\n    \_exitGameQuarantine.quarantine(\_contract);\n\n    emit ExitGameRegistered(\_txType, \_contract, \_protocol);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: TreasuryAction.sol\n    function _rebalanceCurrency(uint16 currencyId, bool useCooldownCh. ```\nFile: TreasuryAction.sol\n    function _rebalanceCurrency(uint16 currencyId, bool useCooldownCheck) private { \n        RebalancingContextStorage memory context = LibStorage.getRebalancingContext()[currencyId]; \n        // Accrues interest up to the current block before any rebalancing is exec

Vulnerable code:
```\nFile: TreasuryAction.sol\n    function _rebalanceCurrency(uint16 currencyId, bool useCooldownCheck) private { \n        RebalancingContextStorage memory context = LibStorage.getRebalancingContext()[currencyId]; \n        // Accrues interest up to the current block before any rebalancing is executed\n        IPrimeCashHoldingsOracle oracle = PrimeCashExchangeRate.getPrimeCashHoldingsOracle(currencyId); \n        PrimeRate memory pr = PrimeRateLib.buildPrimeRateStateful(currencyId); \n\n        bool hasCooldownPassed = _hasCooldownPassed(context); \n        (bool isExternalLendingUnhealthy, OracleData memory oracleData, uint256 targetAmount) = \n            _isExternalLendingUnhealthy(currencyId, oracle, pr); \n\n        // Cooldown check is bypassed when the owner updates the rebalancing targets\n        if (useCooldownCheck) require(hasCooldownPassed || isExternalLendingUnhealthy); \n```\n
MEDIUM severity: Vulnerable function: ```\n            _handleDepositError(\n                key,\n                sta. ```\n            _handleDepositError(\n                key,\n                startingGas,\n                reasonBytes\n            );\n```\n

Vulnerable code:
```\n            _handleDepositError(\n                key,\n                startingGas,\n                reasonBytes\n            );\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: VaultAccount.sol\n    function updateAccountDebt(\n..SNIP..\n        // Truncate dust bal. ```\nFile: VaultAccount.sol\n    function updateAccountDebt(\n..SNIP..\n        // Truncate dust balances towards zero\n        if (0 < vaultState.totalDebtUnderlying && vaultState.totalDebtUnderlying < 10) vaultState.totalDebtUnderlying = 0;\n..SNIP..\n    }\n```\n

Vulnerable code:
```\nFile: VaultAccount.sol\n    function updateAccountDebt(\n..SNIP..\n        // Truncate dust balances towards zero\n        if (0 < vaultState.totalDebtUnderlying && vaultState.totalDebtUnderlying < 10) vaultState.totalDebtUnderlying = 0;\n..SNIP..\n    }\n```\n
HIGH severity: Vulnerable function: ```\nFile: SwEthEthOracle.sol\n/**\n * @notice Price oracle specifically for swE. ```\nFile: SwEthEthOracle.sol\n/**\n * @notice Price oracle specifically for swEth (Swell Eth).\n * @dev getPriceEth is not a view fn to support reentrancy checks. Does not actually change state.\n */\ncontract SwEthEthOracle is SystemComponent, IPriceOracle {\n```\n

Vulnerable code:
```\nFile: SwEthEthOracle.sol\n/**\n * @notice Price oracle specifically for swEth (Swell Eth).\n * @dev getPriceEth is not a view fn to support reentrancy checks. Does not actually change state.\n */\ncontract SwEthEthOracle is SystemComponent, IPriceOracle {\n```\n
HIGH severity: Vulnerable function: ```\n    function setSymbolsPrice(address partyA, PriceSig memory priceSig) internal {\n        MASt. ```\n    function setSymbolsPrice(address partyA, PriceSig memory priceSig) internal {\n        MAStorage.Layout storage maLayout = MAStorage.layout();\n        AccountStorage.Layout storage accountLayout = AccountStorage.layout();\n      LibMuon.verifyPrices(priceSig, partyA);\n        require(\n  

Vulnerable code:
```\n    function setSymbolsPrice(address partyA, PriceSig memory priceSig) internal {\n        MAStorage.Layout storage maLayout = MAStorage.layout();\n        AccountStorage.Layout storage accountLayout = AccountStorage.layout();\n      LibMuon.verifyPrices(priceSig, partyA);\n        require(\n          priceSig.timestamp <=\n                maLayout.liquidationTimestamp[partyA] + maLayout.liquidationTimeout,\n            "LiquidationFacet: Expired signature"\n        );\n```\n
MEDIUM severity: Vulnerable function: ```\n    function claimBids(\n        uint96 lotId_,\n        uint64[] calldata bidIds_\n    )\n    . ```\n    function claimBids(\n        uint96 lotId_,\n        uint64[] calldata bidIds_\n    )\n        external\n        override\n        onlyInternal\n        returns (BidClaim[] memory bidClaims, bytes memory auctionOutput)\n    {\n        // Standard validation\n        _revertIfLotInvalid(lotI

Vulnerable code:
```\n    function claimBids(\n        uint96 lotId_,\n        uint64[] calldata bidIds_\n    )\n        external\n        override\n        onlyInternal\n        returns (BidClaim[] memory bidClaims, bytes memory auctionOutput)\n    {\n        // Standard validation\n        _revertIfLotInvalid(lotId_);\n        _revertIfLotNotSettled(lotId_);\n```\n
HIGH severity: Vulnerable function: ```\nPnL = Position Size * Price Shift / Current Price\nPnL = Position Size * (C. ```\nPnL = Position Size * Price Shift / Current Price\nPnL = Position Size * (Current Price - Last Price) / Current Price\nPnL = 40 rETH * ($2000 - $1000) / $2000\nPnL = $40000 / $2000 = 20 rETH\n```\n

Vulnerable code:
```\nPnL = Position Size * Price Shift / Current Price\nPnL = Position Size * (Current Price - Last Price) / Current Price\nPnL = 40 rETH * ($2000 - $1000) / $2000\nPnL = $40000 / $2000 = 20 rETH\n```\n
HIGH severity: Vulnerable function: ```\nfunction univTransfer(\n IERC20 token,\n address payable to,\n uint256 amount\n) internal {\n i. ```\nfunction univTransfer(\n IERC20 token,\n address payable to,\n uint256 amount\n) internal {\n if (amount > 0) {\n if (isFTM(token)) {\n (bool sent, ) = to.call{ value: amount }("");\n require(sent, "Failed to send Ether");\n } else {\n token.safeTransfer(to, amount);\n }\n }\n}\n```\n

Vulnerable code:
```\nfunction univTransfer(\n IERC20 token,\n address payable to,\n uint256 amount\n) internal {\n if (amount > 0) {\n if (isFTM(token)) {\n (bool sent, ) = to.call{ value: amount }("");\n require(sent, "Failed to send Ether");\n } else {\n token.safeTransfer(to, amount);\n }\n }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n        constructor( address _layerZeroEndpoint, uint8 _sharedDecimals\n   . ```\n        constructor( address _layerZeroEndpoint, uint8 _sharedDecimals\n            ) OFTV2("Mozaic Token", "MOZ", _sharedDecimals, _layerZeroEndpoint) {\n            _mint(msg.sender, 1000000000 * 10 ** _sharedDecimals);\n                isAdmin[msg.sender] = true;\n            }\n```\n

Vulnerable code:
```\n        constructor( address _layerZeroEndpoint, uint8 _sharedDecimals\n            ) OFTV2("Mozaic Token", "MOZ", _sharedDecimals, _layerZeroEndpoint) {\n            _mint(msg.sender, 1000000000 * 10 ** _sharedDecimals);\n                isAdmin[msg.sender] = true;\n            }\n```\n
MEDIUM severity: Vulnerable function: ```\n/**\n * @notice Overrides Blacklist function to transfer balance of a blacklisted user to the c. ```\n/**\n * @notice Overrides Blacklist function to transfer balance of a blacklisted user to the caller.\n * @dev This function is called internally when an account is blacklisted.\n * @param user The blacklisted user whose balance will be transferred.\n */\nfunction _onceBlacklisted(address user)

Vulnerable code:
```\n/**\n * @notice Overrides Blacklist function to transfer balance of a blacklisted user to the caller.\n * @dev This function is called internally when an account is blacklisted.\n * @param user The blacklisted user whose balance will be transferred.\n */\nfunction _onceBlacklisted(address user) internal override {\n  _transfer(user, _msgSender(), balanceOf(user));\n}\n```\n
HIGH severity: Vulnerable function: ```\n  function claim(address _aToken, address _claimer) public override returns (bool) {}\n```\n. ```\n  function claim(address _aToken, address _claimer) public override returns (bool) {}\n```\n

Vulnerable code:
```\n  function claim(address _aToken, address _claimer) public override returns (bool) {}\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 adjustedTotalAssets = _totalAssets() + l.totalWithdrawals;\n\nif (a. ```\nuint256 adjustedTotalAssets = _totalAssets() + l.totalWithdrawals;\n\nif (adjustedTotalAssets > l.lastTotalAssets) {\n    netIncome = adjustedTotalAssets - l.lastTotalAssets;\n\n    feeInCollateral = l.performanceFee64x64.mulu(netIncome);\n\n    ERC20.safeTransfer(l.feeRecipient, feeInCollatera

Vulnerable code:
```\nuint256 adjustedTotalAssets = _totalAssets() + l.totalWithdrawals;\n\nif (adjustedTotalAssets > l.lastTotalAssets) {\n    netIncome = adjustedTotalAssets - l.lastTotalAssets;\n\n    feeInCollateral = l.performanceFee64x64.mulu(netIncome);\n\n    ERC20.safeTransfer(l.feeRecipient, feeInCollateral);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function _submitBid(// rest of code)\n        // rest of code\n        (bid.terms.paymentCy. ```\n    function _submitBid(// rest of code)\n        // rest of code\n        (bid.terms.paymentCycle, bidPaymentCycleType[bidId]) = marketRegistry\n            .getPaymentCycle(_marketplaceId);\n\n        bid.terms.APR = _APR;\n\n        bidDefaultDuration[bidId] = marketRegistry.getPaymentDefaul

Vulnerable code:
```\n    function _submitBid(// rest of code)\n        // rest of code\n        (bid.terms.paymentCycle, bidPaymentCycleType[bidId]) = marketRegistry\n            .getPaymentCycle(_marketplaceId);\n\n        bid.terms.APR = _APR;\n\n        bidDefaultDuration[bidId] = marketRegistry.getPaymentDefaultDuration(\n            _marketplaceId\n        );\n\n        bidExpirationTime[bidId] = marketRegistry.getBidExpirationTime(\n            _marketplaceId\n        );\n\n        bid.paymentType = marketRegistry.getPaymentType(_marketplaceId);\n        \n        bid.terms.paymentCycleAmount = V2Calculations\n            .calculatePaymentCycleAmount(\n                bid.paymentType,\n                bidPaymentCycleType[bidId],\n                _principal,\n                _duration,\n                bid.terms.paymentCycle,\n                _APR\n            );\n        // rest of code\n```\n
HIGH severity: Vulnerable function: ```\nFile: ProxyFactory.sol\n    function setContest(address organizer, bytes32 contestId, uint256 c. ```\nFile: ProxyFactory.sol\n    function setContest(address organizer, bytes32 contestId, uint256 closeTime, address implementation)\n        public\n        onlyOwner\n// rest of code\n// rest of code\n        bytes32 salt = _calculateSalt(organizer, contestId, implementation);\n        if (saltTo

Vulnerable code:
```\nFile: ProxyFactory.sol\n    function setContest(address organizer, bytes32 contestId, uint256 closeTime, address implementation)\n        public\n        onlyOwner\n// rest of code\n// rest of code\n        bytes32 salt = _calculateSalt(organizer, contestId, implementation);\n        if (saltToCloseTime[salt] != 0) revert ProxyFactory__ContestIsAlreadyRegistered();\n        saltToCloseTime[salt] = closeTime;\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction doERC20TransferIn(address token, uint256 amountCall)\n    internal\n    returns (uint2. ```\nfunction doERC20TransferIn(address token, uint256 amountCall)\n    internal\n    returns (uint256)\n{\n    uint256 balanceBefore = IERC20Upgradeable(token).balanceOf(\n        address(this)\n    );\n    IERC20Upgradeable(token).safeTransferFrom(\n        msg.sender,\n        address(this),\n   

Vulnerable code:
```\nfunction doERC20TransferIn(address token, uint256 amountCall)\n    internal\n    returns (uint256)\n{\n    uint256 balanceBefore = IERC20Upgradeable(token).balanceOf(\n        address(this)\n    );\n    IERC20Upgradeable(token).safeTransferFrom(\n        msg.sender,\n        address(this),\n        amountCall\n    );\n    uint256 balanceAfter = IERC20Upgradeable(token).balanceOf(\n        address(this)\n    );\n    return balanceAfter - balanceBefore;\n}\n```\n
HIGH severity: Vulnerable function: ```\nFile: VaultValuation.sol\n        int256 maxLiquidatorDepositLocal = _calcu. ```\nFile: VaultValuation.sol\n        int256 maxLiquidatorDepositLocal = _calculateDeleverageAmount(\n            vaultConfig,\n            h.vaultShareValueUnderlying,\n            h.totalDebtOutstandingInPrimary.neg(),\n            h.debtOutstanding[currencyIndex].neg(),\n            minBorrowSiz

Vulnerable code:
```\nFile: VaultValuation.sol\n        int256 maxLiquidatorDepositLocal = _calculateDeleverageAmount(\n            vaultConfig,\n            h.vaultShareValueUnderlying,\n            h.totalDebtOutstandingInPrimary.neg(),\n            h.debtOutstanding[currencyIndex].neg(),\n            minBorrowSize,\n            exchangeRate,\n            er.rateDecimals\n        );\n\n        // NOTE: deposit amount is always positive in this method\n        if (depositUnderlyingInternal < maxLiquidatorDepositLocal) {\n            // If liquidating past the debt outstanding above the min borrow, then the entire\n            // debt outstanding must be liquidated.\n\n            // (debtOutstanding - depositAmountUnderlying) is the post liquidation debt. As an\n            // edge condition, when debt outstanding is discounted to present value, the account\n            // may be liquidated to zero while their debt outstanding is still greater than the\n            // min borrow size (which is normally enforced in notional terms -- i.e. non present\n            // value). Resolving this would require additional complexity for not much gain. An\n            // account within 20% of the minBorrowSize in a vault that has fCash discounting enabled\n            // may experience a full liquidation as a result.\n            require(\n                h.debtOutstanding[currencyIndex].sub(depositUnderlyingInternal) < minBorrowSize,\n                "Must Liquidate All Debt"\n            );\n        } else {\n            // If the deposit amount is greater than maxLiquidatorDeposit then limit it to the max\n            // amount here.\n            depositUnderlyingInternal = maxLiquidatorDepositLocal;\n        }\n```\n