Farseen0/scar-pairs huggingface dataset:
HIGH severity: Vulnerable function: ```\nfunction openLoan(\n    // // rest of code\n    ) external override whenNotPaused \n    {\n    . ```\nfunction openLoan(\n    // // rest of code\n    ) external override whenNotPaused \n    {\n    //// rest of code\n    uint256 colInUSD = priceCollateralToUSD(currencyKey, _colAmount\n                        + collateralPosted[_collateralAddress][msg.sender]);\n    uint256 totalUSDborrowed = _US

Vulnerable code:
```\nfunction openLoan(\n    // // rest of code\n    ) external override whenNotPaused \n    {\n    //// rest of code\n    uint256 colInUSD = priceCollateralToUSD(currencyKey, _colAmount\n                        + collateralPosted[_collateralAddress][msg.sender]);\n    uint256 totalUSDborrowed = _USDborrowed \n        +  (isoUSDLoaned[_collateralAddress][msg.sender] * virtualPrice)/LOAN_SCALE;\n        // @audit should be isoUSDLoanAndInterest[_collateralAddress][msg.sender]\n    require(totalUSDborrowed >= ONE_HUNDRED_DOLLARS, "Loan Requested too small");\n    uint256 borrowMargin = (totalUSDborrowed * minOpeningMargin) / LOAN_SCALE;\n    require(colInUSD >= borrowMargin, "Minimum margin not met!");\n\n    // // rest of code\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function getPriceFromChainlink(address base, address quote) internal view returns (uint256). ```\n    function getPriceFromChainlink(address base, address quote) internal view returns (uint256) {\n        (, int256 price,,,) = registry.latestRoundData(base, quote);\n        require(price > 0, "invalid price");\n\n        // Extend the decimals to 1e18.\n        return uint256(price) * 10 **

Vulnerable code:
```\n    function getPriceFromChainlink(address base, address quote) internal view returns (uint256) {\n        (, int256 price,,,) = registry.latestRoundData(base, quote);\n        require(price > 0, "invalid price");\n\n        // Extend the decimals to 1e18.\n        return uint256(price) * 10 ** (18 - uint256(registry.decimals(base, quote)));\n    }\n```\n
HIGH severity: Vulnerable function: ```\n    wAmount = wAmount > pos.underlyingAmount\n            ? pos.underlyingA. ```\n    wAmount = wAmount > pos.underlyingAmount\n            ? pos.underlyingAmount\n            : wAmount;\n\n        pos.underlyingVaultShare -= shareAmount;\n        pos.underlyingAmount -= wAmount;\n        bank.totalLend -= wAmount;\n```\n

Vulnerable code:
```\n    wAmount = wAmount > pos.underlyingAmount\n            ? pos.underlyingAmount\n            : wAmount;\n\n        pos.underlyingVaultShare -= shareAmount;\n        pos.underlyingAmount -= wAmount;\n        bank.totalLend -= wAmount;\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {. ```\nfunction transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {\n var _allowance = allowed[_from][msg.sender];\n\n // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met\n // if (_value > _allowance) throw;\n\n uint

Vulnerable code:
```\nfunction transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {\n var _allowance = allowed[_from][msg.sender];\n\n // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met\n // if (_value > _allowance) throw;\n\n uint fee = (_value.mul(basisPointsRate)).div(10000);\n if (fee > maximumFee) {\n  fee = maximumFee;\n }\n if (_allowance < MAX_UINT) {\n  allowed[_from][msg.sender] = _allowance.sub(_value);\n }\n uint sendAmount = _value.sub(fee);\n balances[_from] = balances[_from].sub(_value);\n balances[_to] = balances[_to].add(sendAmount);\n if (fee > 0) {\n  balances[owner] = balances[owner].add(fee);\n  Transfer(_from, owner, fee);\n }\n Transfer(_from, _to, sendAmount);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: LimitOrderRegistry.sol\n    function claimOrder(uint128 batchId, address user) external p. ```\nFile: LimitOrderRegistry.sol\n    function claimOrder(uint128 batchId, address user) external payable returns (ERC20, uint256) {\n        Claim storage userClaim = claim[batchId];\n        if (!userClaim.isReadyForClaim) revert LimitOrderRegistry__OrderNotReadyToClaim(batchId);\n        uint256

Vulnerable code:
```\nFile: LimitOrderRegistry.sol\n    function claimOrder(uint128 batchId, address user) external payable returns (ERC20, uint256) {\n        Claim storage userClaim = claim[batchId];\n        if (!userClaim.isReadyForClaim) revert LimitOrderRegistry__OrderNotReadyToClaim(batchId);\n        uint256 depositAmount = batchIdToUserDepositAmount[batchId][user];\n        if (depositAmount == 0) revert LimitOrderRegistry__UserNotFound(user, batchId);\n\n        // Zero out user balance.\n        delete batchIdToUserDepositAmount[batchId][user];\n\n        // Calculate owed amount.\n        uint256 totalTokenDeposited;\n        uint256 totalTokenOut;\n        ERC20 tokenOut;\n\n        // again, remembering that direction == true means that the input token is token0.\n        if (userClaim.direction) {\n            totalTokenDeposited = userClaim.token0Amount;\n            totalTokenOut = userClaim.token1Amount;\n            tokenOut = poolToData[userClaim.pool].token1;\n        } else {\n            totalTokenDeposited = userClaim.token1Amount;\n            totalTokenOut = userClaim.token0Amount;\n            tokenOut = poolToData[userClaim.pool].token0;\n        }\n\n        uint256 owed = (totalTokenOut * depositAmount) / totalTokenDeposited;\n\n        // Transfer tokens owed to user.\n        tokenOut.safeTransfer(user, owed);\n```\n
HIGH severity: Vulnerable function: ```\nfunction beforeWithdraw(\n    uint256 assets,\n    uint256,\n    address\n) internal override {. ```\nfunction beforeWithdraw(\n    uint256 assets,\n    uint256,\n    address\n) internal override {\n    /// @dev withdrawal will fail if the utilization goes above maxUtilization value due to a withdrawal\n    // totalUsdcBorrowed will reduce when borrower (junior vault) repays\n    if (totalUsdcB

Vulnerable code:
```\nfunction beforeWithdraw(\n    uint256 assets,\n    uint256,\n    address\n) internal override {\n    /// @dev withdrawal will fail if the utilization goes above maxUtilization value due to a withdrawal\n    // totalUsdcBorrowed will reduce when borrower (junior vault) repays\n    if (totalUsdcBorrowed() > ((totalAssets() - assets) * maxUtilizationBps) / MAX_BPS)\n        revert MaxUtilizationBreached();\n\n    // take out required assets from aave lending pool\n    pool.withdraw(address(asset), assets, address(this));\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n        IAccessControlledOffchainAggregator  aggregator = IAccessControlledOffchainAggregator(p. ```\n        IAccessControlledOffchainAggregator  aggregator = IAccessControlledOffchainAggregator(priceFeed.aggregator());\n        //fetch the pricefeeds hard limits so we can be aware if these have been reached.\n        tokenMinPrice = aggregator.minAnswer();\n        tokenMaxPrice = aggregator.

Vulnerable code:
```\n        IAccessControlledOffchainAggregator  aggregator = IAccessControlledOffchainAggregator(priceFeed.aggregator());\n        //fetch the pricefeeds hard limits so we can be aware if these have been reached.\n        tokenMinPrice = aggregator.minAnswer();\n        tokenMaxPrice = aggregator.maxAnswer();\n// rest of code\n            uint256 oraclePrice = getOraclePrice(priceFeed, tokenMaxPrice, tokenMinPrice);\n// rest of code\n    function getOraclePrice(IAggregatorV3 _priceFeed, int192 _maxPrice, int192 _minPrice) public view returns (uint256 ) {\n        (\n            /*uint80 roundID*/,\n            int signedPrice,\n            /*uint startedAt*/,\n            uint timeStamp,\n            /*uint80 answeredInRound*/\n        ) = _priceFeed.latestRoundData();\n        //check for Chainlink oracle deviancies, force a revert if any are present. Helps prevent a LUNA like issue\n        require(signedPrice > 0, "Negative Oracle Price");\n        require(timeStamp >= block.timestamp - HEARTBEAT_TIME , "Stale pricefeed");\n        require(signedPrice < _maxPrice, "Upper price bound breached");\n        require(signedPrice > _minPrice, "Lower price bound breached");\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction setReferralFeeReceiver(address newReferralFeeReceiver) external onlyOwner {\n    refer. ```\nfunction setReferralFeeReceiver(address newReferralFeeReceiver) external onlyOwner {\n    referralFeeReceiver = newReferralFeeReceiver;\n    emit ReferralFeeReceiverUpdate(newReferralFeeReceiver);\n}\n```\n

Vulnerable code:
```\nfunction setReferralFeeReceiver(address newReferralFeeReceiver) external onlyOwner {\n    referralFeeReceiver = newReferralFeeReceiver;\n    emit ReferralFeeReceiverUpdate(newReferralFeeReceiver);\n}\n```\n
HIGH severity: Vulnerable function: ```\n   function onReward(uint _pid, address _user, address _to, uint, uint _amt) external override . ```\n   function onReward(uint _pid, address _user, address _to, uint, uint _amt) external override onlyParent nonReentrant {\n      PoolInfo memory pool = updatePool(_pid);\n         if (pool.lastRewardTime == 0) return;\n            UserInfo storage user = userInfo[_pid][_user];\n            uint 

Vulnerable code:
```\n   function onReward(uint _pid, address _user, address _to, uint, uint _amt) external override onlyParent nonReentrant {\n      PoolInfo memory pool = updatePool(_pid);\n         if (pool.lastRewardTime == 0) return;\n            UserInfo storage user = userInfo[_pid][_user];\n            uint pending;\n         if (user.amount > 0) {\n              pending = ((user.amount * pool.accRewardPerShare) / ACC_TOKEN_PRECISION) - user.rewardDebt;\n      rewardToken.safeTransfer(_to, pending);\n         }\n         user.amount = _amt;\n         user.rewardDebt = (_amt * pool.accRewardPerShare) / \n            ACC_TOKEN_PRECISION;\n      emit LogOnReward(_user, _pid, pending, _to);\n      }\n```\n
HIGH severity: Vulnerable function: ```\n    function _sendFunds(address token, address to, uint256 amount) internal {\n        if (toke. ```\n    function _sendFunds(address token, address to, uint256 amount) internal {\n        if (token == ETHEREUM_ADDRESS) {\n            (bool success, ) = to.call{value: amount}("");\n            require(success, "TSP: failed to transfer ether");\n        } else {\n            IERC20(token).safeTr

Vulnerable code:
```\n    function _sendFunds(address token, address to, uint256 amount) internal {\n        if (token == ETHEREUM_ADDRESS) {\n            (bool success, ) = to.call{value: amount}("");\n            require(success, "TSP: failed to transfer ether");\n        } else {\n            IERC20(token).safeTransferFrom(msg.sender, to, amount.from18(token.decimals())); //@audit -> amount is assumed to be 18 decimals\n        }\n    }\n```\n
HIGH severity: Vulnerable function: ```\nfunction settle(bytes32[] memory ids, IMarket[] memory markets, uint256[] memory versions, uint. ```\nfunction settle(bytes32[] memory ids, IMarket[] memory markets, uint256[] memory versions, uint256[] memory maxCounts)\n    external\n    keep(settleKeepConfig(), msg.data, 0, "")\n{\n    if (\n        ids.length != markets.length ||\n        ids.length != versions.length ||\n        ids.length

Vulnerable code:
```\nfunction settle(bytes32[] memory ids, IMarket[] memory markets, uint256[] memory versions, uint256[] memory maxCounts)\n    external\n    keep(settleKeepConfig(), msg.data, 0, "")\n{\n    if (\n        ids.length != markets.length ||\n        ids.length != versions.length ||\n        ids.length != maxCounts.length ||\n        // Prevent calldata stuffing\n        abi.encodeCall(KeeperFactory.settle, (ids, markets, versions, maxCounts)).length != msg.data.length\n    )\n        revert KeeperFactoryInvalidSettleError();\n\n    for (uint256 i; i < ids.length; i++)\n        IKeeperOracle(address(oracles[ids[i]])).settle(markets[i], versions[i], maxCounts[i]);\n}\n```\n
HIGH severity: Vulnerable function: ```\nforge test --match-path test/vault/LMPVault-Withdraw.t.sol --match-test tes. ```\nforge test --match-path test/vault/LMPVault-Withdraw.t.sol --match-test test_AvoidTheLoss -vv\n```\n

Vulnerable code:
```\nforge test --match-path test/vault/LMPVault-Withdraw.t.sol --match-test test_AvoidTheLoss -vv\n```\n
MEDIUM severity: Vulnerable function: ```\nreturn ((priorValue * (1e18 - alpha)) + (currentValue * alpha)) / 1e18;\n``. ```\nreturn ((priorValue * (1e18 - alpha)) + (currentValue * alpha)) / 1e18;\n```\n

Vulnerable code:
```\nreturn ((priorValue * (1e18 - alpha)) + (currentValue * alpha)) / 1e18;\n```\n
HIGH severity: Vulnerable function: ```\nfunction _checkIfCollateralIsActive(bytes32 _currencyKey) internal view override {\n        \n . ```\nfunction _checkIfCollateralIsActive(bytes32 _currencyKey) internal view override {\n        \n         //Lyra LP tokens use their associated LiquidityPool to check if they're active\n         ILiquidityPoolAvalon LiquidityPool = ILiquidityPoolAvalon(collateralBook.liquidityPoolOf(_currencyKey))

Vulnerable code:
```\nfunction _checkIfCollateralIsActive(bytes32 _currencyKey) internal view override {\n        \n         //Lyra LP tokens use their associated LiquidityPool to check if they're active\n         ILiquidityPoolAvalon LiquidityPool = ILiquidityPoolAvalon(collateralBook.liquidityPoolOf(_currencyKey));\n         bool isStale;\n         uint circuitBreakerExpiry;\n         //ignore first output as this is the token price and not needed yet.\n         (, isStale, circuitBreakerExpiry) = LiquidityPool.getTokenPriceWithCheck();\n         require( !(isStale), "Global Cache Stale, can't trade");\n         require(circuitBreakerExpiry < block.timestamp, "Lyra Circuit Breakers active, can't trade");\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n  function processDeposit(GMXTypes.Store storage self) external {\n       // some code ..\n    . ```\n  function processDeposit(GMXTypes.Store storage self) external {\n       // some code ..\n      try GMXProcessDeposit.processDeposit(self) {\n           // ..more code\n        } catch (bytes memory reason) {\n            self.status = GMXTypes.Status.Deposit_Failed;\n\n            emit Deposi

Vulnerable code:
```\n  function processDeposit(GMXTypes.Store storage self) external {\n       // some code ..\n      try GMXProcessDeposit.processDeposit(self) {\n           // ..more code\n        } catch (bytes memory reason) {\n            self.status = GMXTypes.Status.Deposit_Failed;\n\n            emit DepositFailed(reason);\n        }\n    }\n```\n
HIGH severity: Vulnerable function: ```\n  function deposit(\n    GMXTypes.Store storage self,\n    GMXTypes.DepositParams memory dp,\n . ```\n  function deposit(\n    GMXTypes.Store storage self,\n    GMXTypes.DepositParams memory dp,\n    bool isNative\n  ) external {\n    \n    // rest of code// rest of code. more code \n\n    if (dp.token == address(self.lpToken)) {\n      // If LP token deposited\n      _dc.depositValue = self.gm

Vulnerable code:
```\n  function deposit(\n    GMXTypes.Store storage self,\n    GMXTypes.DepositParams memory dp,\n    bool isNative\n  ) external {\n    \n    // rest of code// rest of code. more code \n\n    if (dp.token == address(self.lpToken)) {\n      // If LP token deposited\n      _dc.depositValue = self.gmxOracle.getLpTokenValue(\n        address(self.lpToken),\n        address(self.tokenA),\n        address(self.tokenA),\n        address(self.tokenB),\n        false,\n        false\n      )\n      * dp.amt\n      / SAFE_MULTIPLIER;\n    } else {\n      // If tokenA or tokenB deposited\n      _dc.depositValue = GMXReader.convertToUsdValue(\n        self,\n        address(dp.token),\n        dp.amt\n      );\n    }\n    \n     // rest of code// rest of code. more code\n\n    _alp.tokenAAmt = self.tokenA.balanceOf(address(this));\n    _alp.tokenBAmt = self.tokenB.balanceOf(address(this));\n    _alp.minMarketTokenAmt = GMXManager.calcMinMarketSlippageAmt(\n      self,\n      _dc.depositValue,\n      dp.slippage\n    );\n    _alp.executionFee = dp.executionFee;\n\n\n    _dc.depositKey = GMXManager.addLiquidity(\n      self,\n      _alp\n    );\n```\n
MEDIUM severity: Vulnerable function: ```\nif (assetFrom[i - 1] == address(this)) {\n    uint256 curAmount = curTotalAmount * curPoolInfo.. ```\nif (assetFrom[i - 1] == address(this)) {\n    uint256 curAmount = curTotalAmount * curPoolInfo.weight / curTotalWeight;\n\n\n    if (curPoolInfo.poolEdition == 1) {\n        //For using transferFrom pool (like dodoV1, Curve), pool call transferFrom function to get tokens from adapter\n        I

Vulnerable code:
```\nif (assetFrom[i - 1] == address(this)) {\n    uint256 curAmount = curTotalAmount * curPoolInfo.weight / curTotalWeight;\n\n\n    if (curPoolInfo.poolEdition == 1) {\n        //For using transferFrom pool (like dodoV1, Curve), pool call transferFrom function to get tokens from adapter\n        IERC20(midToken[i]).transfer(curPoolInfo.adapter, curAmount);\n    } else {\n        //For using transfer pool (like dodoV2), pool determine swapAmount through balanceOf(Token) - reserve\n        IERC20(midToken[i]).transfer(curPoolInfo.pool, curAmount);\n    }\n}\n```\n
HIGH severity: Vulnerable function: ```\nVaultImplementation(vaultAddr).init(\n  VaultImplementation.InitParams(dele. ```\nVaultImplementation(vaultAddr).init(\n  VaultImplementation.InitParams(delegate)\n);\n```\n

Vulnerable code:
```\nVaultImplementation(vaultAddr).init(\n  VaultImplementation.InitParams(delegate)\n);\n```\n
HIGH severity: Vulnerable function: ```\ndef _calculate_leverage(\n    _position_value: uint256, _debt_value: uint25. ```\ndef _calculate_leverage(\n    _position_value: uint256, _debt_value: uint256, _margin_value: uint256\n) -> uint256:\n    if _position_value <= _debt_value:\n        # bad debt\n        return max_value(uint256)\n\n\n    return (\n        PRECISION\n        * (_debt_value + _margin_value)\n     

Vulnerable code:
```\ndef _calculate_leverage(\n    _position_value: uint256, _debt_value: uint256, _margin_value: uint256\n) -> uint256:\n    if _position_value <= _debt_value:\n        # bad debt\n        return max_value(uint256)\n\n\n    return (\n        PRECISION\n        * (_debt_value + _margin_value)\n        / (_position_value - _debt_value)\n        / PRECISION\n    )\n```\n
HIGH severity: Vulnerable function: ```\nuint256 j = index;\n// Note: We're skipping the first 32 bytes of `proof`, . ```\nuint256 j = index;\n// Note: We're skipping the first 32 bytes of `proof`, which holds the size of the dynamically sized `bytes`\nfor (uint256 i = 32; i <= proof.length; i += 32) {\n    // solhint-disable-next-line no-inline-assembly\n    assembly {\n        proofElement := mload(add(proof, i))

Vulnerable code:
```\nuint256 j = index;\n// Note: We're skipping the first 32 bytes of `proof`, which holds the size of the dynamically sized `bytes`\nfor (uint256 i = 32; i <= proof.length; i += 32) {\n    // solhint-disable-next-line no-inline-assembly\n    assembly {\n        proofElement := mload(add(proof, i))\n    }\n    if (j % 2 == 0) {\n        computedHash = keccak256(abi.encodePacked(NODE\_SALT, computedHash, proofElement));\n    } else {\n        computedHash = keccak256(abi.encodePacked(NODE\_SALT, proofElement, computedHash));\n    }\n    j = j / 2;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n      } else if (p == uint8(Principals.Notional)) {\n            // Princip. ```\n      } else if (p == uint8(Principals.Notional)) {\n            // Principal token must be approved for Notional's lend\n            ILender(lender).approve(address(0), address(0), address(0), a);\n```\n

Vulnerable code:
```\n      } else if (p == uint8(Principals.Notional)) {\n            // Principal token must be approved for Notional's lend\n            ILender(lender).approve(address(0), address(0), address(0), a);\n```\n
MEDIUM severity: Vulnerable function: ```\nTransferUtils.sol\n    function _transferERC20(address token, address to, uint256 amount) inter. ```\nTransferUtils.sol\n    function _transferERC20(address token, address to, uint256 amount) internal {\n        IERC20 erc20 = IERC20(token);\n        require(erc20 != IERC20(address(0)), "Token Address is not an ERC20");\n        uint256 initialBalance = erc20.balanceOf(to);\n        require(erc

Vulnerable code:
```\nTransferUtils.sol\n    function _transferERC20(address token, address to, uint256 amount) internal {\n        IERC20 erc20 = IERC20(token);\n        require(erc20 != IERC20(address(0)), "Token Address is not an ERC20");\n        uint256 initialBalance = erc20.balanceOf(to);\n        require(erc20.transfer(to, amount), "ERC20 Transfer failed");\n        uint256 balance = erc20.balanceOf(to);\n        require(balance >= (initialBalance + amount), "ERC20 Balance check failed");//@audit-issue reverts for fee on transfer token\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n if (totalSupply == 0) {\n            // case 1. initial supply\n          . ```\n if (totalSupply == 0) {\n            // case 1. initial supply\n            // The shares will be minted to user\n            shares = quoteBalance < DecimalMath.mulFloor(baseBalance, _I_)\n                ? DecimalMath.divFloor(quoteBalance, _I_)\n                : baseBalance;\n            /

Vulnerable code:
```\n if (totalSupply == 0) {\n            // case 1. initial supply\n            // The shares will be minted to user\n            shares = quoteBalance < DecimalMath.mulFloor(baseBalance, _I_)\n                ? DecimalMath.divFloor(quoteBalance, _I_)\n                : baseBalance;\n            // The target will be updated\n            _BASE_TARGET_ = uint112(shares);\n            _QUOTE_TARGET_ = uint112(DecimalMath.mulFloor(shares, _I_));\n```\n
MEDIUM severity: Vulnerable function: ```\ncontract Rewards is IRewards, OwnablePausableUpgradeable, ReentrancyGuardUp. ```\ncontract Rewards is IRewards, OwnablePausableUpgradeable, ReentrancyGuardUpgradeable {\n```\n

Vulnerable code:
```\ncontract Rewards is IRewards, OwnablePausableUpgradeable, ReentrancyGuardUpgradeable {\n```\n
MEDIUM severity: Vulnerable function: ```\n    bytes memory initializeParams = abi.encode(_ownerHatId, _signersHatId, . ```\n    bytes memory initializeParams = abi.encode(_ownerHatId, _signersHatId, _safe, hatsAddress, _minThreshold, \n    _targetThreshold, _maxSigners, version );\n        hsg = moduleProxyFactory.deployModule(hatsSignerGateSingleton, abi.encodeWithSignature("setUp(bytes)", \n    initializeParams), 

Vulnerable code:
```\n    bytes memory initializeParams = abi.encode(_ownerHatId, _signersHatId, _safe, hatsAddress, _minThreshold, \n    _targetThreshold, _maxSigners, version );\n        hsg = moduleProxyFactory.deployModule(hatsSignerGateSingleton, abi.encodeWithSignature("setUp(bytes)", \n    initializeParams), _saltNonce );\n```\n
HIGH severity: Vulnerable function: ```\n/\*\*\n \* @dev Gets balance of this contract in terms of the underlying\n \*/\nfunction \_getC. ```\n/\*\*\n \* @dev Gets balance of this contract in terms of the underlying\n \*/\nfunction \_getCurrentCash() internal view override returns (uint256) {\n    return address(this).balance.sub(msg.value);\n}\n```\n

Vulnerable code:
```\n/\*\*\n \* @dev Gets balance of this contract in terms of the underlying\n \*/\nfunction \_getCurrentCash() internal view override returns (uint256) {\n    return address(this).balance.sub(msg.value);\n}\n```\n