Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\nfunction pullTokens(\n    address \_token,\n    address \_from,\n    uint256 \_amount\n) intern. ```\nfunction pullTokens(\n    address \_token,\n    address \_from,\n    uint256 \_amount\n) internal returns (uint256) {\n    // handle max uint amount\n    if (\_amount == type(uint256).max) {\n        uint256 allowance = IERC20(\_token).allowance(address(this), \_from);\n        uint256 balance 

Vulnerable code:
```\nfunction pullTokens(\n    address \_token,\n    address \_from,\n    uint256 \_amount\n) internal returns (uint256) {\n    // handle max uint amount\n    if (\_amount == type(uint256).max) {\n        uint256 allowance = IERC20(\_token).allowance(address(this), \_from);\n        uint256 balance = getBalance(\_token, \_from);\n\n        \_amount = (balance > allowance) ? allowance : balance;\n    }\n\n    if (\_from != address(0) && \_from != address(this) && \_token != ETH\_ADDR && \_amount != 0) {\n        IERC20(\_token).safeTransferFrom(\_from, address(this), \_amount);\n    }\n\n    return \_amount;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction validateOrderParam(IPerpetual perpetual, LibOrder.OrderParam memory orderParam)\n    i. ```\nfunction validateOrderParam(IPerpetual perpetual, LibOrder.OrderParam memory orderParam)\n    internal\n    view\n    returns (bytes32)\n{\n    address broker = perpetual.currentBroker(orderParam.trader);\n    require(broker == msg.sender, "invalid broker");\n    require(orderParam.getOrderVers

Vulnerable code:
```\nfunction validateOrderParam(IPerpetual perpetual, LibOrder.OrderParam memory orderParam)\n    internal\n    view\n    returns (bytes32)\n{\n    address broker = perpetual.currentBroker(orderParam.trader);\n    require(broker == msg.sender, "invalid broker");\n    require(orderParam.getOrderVersion() == 2, "unsupported version");\n    require(orderParam.getExpiredAt() >= block.timestamp, "order expired");\n\n    bytes32 orderHash = orderParam.getOrderHash(address(perpetual), broker);\n    require(orderParam.signature.isValidSignature(orderHash, orderParam.trader), "invalid signature");\n    require(filled[orderHash] < orderParam.amount, "fullfilled order");\n\n    return orderHash;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nif (\_fee > 0) {\n address feeReceiver = \_feeRecipient == address(0) ? msg. ```\nif (\_fee > 0) {\n address feeReceiver = \_feeRecipient == address(0) ? msg.sender : \_feeRecipient;\n (bool feePaymentSuccess, ) = feeReceiver.call{ value: \_fee }("");\n if (!feePaymentSuccess) {\n revert FeePaymentFailed(feeReceiver);\n }\n```\n

Vulnerable code:
```\nif (\_fee > 0) {\n address feeReceiver = \_feeRecipient == address(0) ? msg.sender : \_feeRecipient;\n (bool feePaymentSuccess, ) = feeReceiver.call{ value: \_fee }("");\n if (!feePaymentSuccess) {\n revert FeePaymentFailed(feeReceiver);\n }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction withdraw(uint256 \_shares, uint256 \_minAmount) external onlyEOAorWhitelist nonReentra. ```\nfunction withdraw(uint256 \_shares, uint256 \_minAmount) external onlyEOAorWhitelist nonReentrant\n{\n address \_from = msg.sender;\n (uint256 \_amount, uint256 \_withdrawalAmount, uint256 \_netAmount) = \_calcAmountFromShares(\_shares);\n require(\_netAmount >= \_minAmount, "high slippage");\n

Vulnerable code:
```\nfunction withdraw(uint256 \_shares, uint256 \_minAmount) external onlyEOAorWhitelist nonReentrant\n{\n address \_from = msg.sender;\n (uint256 \_amount, uint256 \_withdrawalAmount, uint256 \_netAmount) = \_calcAmountFromShares(\_shares);\n require(\_netAmount >= \_minAmount, "high slippage");\n \_burn(\_from, \_shares);\n \_withdraw(\_amount);\n Transfers.\_pushFunds(reserveToken, \_from, \_withdrawalAmount);\n}\n```\n
HIGH severity: Vulnerable function: ```\n      function canInitSwap(address subAccount, address inputToken, uint256 interval, uint256 la. ```\n      function canInitSwap(address subAccount, address inputToken, uint256 interval, uint256 lastSwap)\n          external view returns (bool)\n        {\n      if (hasZeroBalance(subAccount, inputToken)) \n          { return false;\n        }\n      return ((lastSwap + interval) < block.timest

Vulnerable code:
```\n      function canInitSwap(address subAccount, address inputToken, uint256 interval, uint256 lastSwap)\n          external view returns (bool)\n        {\n      if (hasZeroBalance(subAccount, inputToken)) \n          { return false;\n        }\n      return ((lastSwap + interval) < block.timestamp);\n      }\n```\n
MEDIUM severity: Vulnerable function: ```\nRocketDAONodeTrustedInterface rocketDAONodeTrusted = RocketDAONodeTrustedIn. ```\nRocketDAONodeTrustedInterface rocketDAONodeTrusted = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));\nif (calcBase.mul(submissionCount).div(rocketDAONodeTrusted.getMemberCount()) >= rocketDAOProtocolSettingsNetwork.getNodeConsensusThreshold()) {\n    setMinipoolWithdr

Vulnerable code:
```\nRocketDAONodeTrustedInterface rocketDAONodeTrusted = RocketDAONodeTrustedInterface(getContractAddress("rocketDAONodeTrusted"));\nif (calcBase.mul(submissionCount).div(rocketDAONodeTrusted.getMemberCount()) >= rocketDAOProtocolSettingsNetwork.getNodeConsensusThreshold()) {\n    setMinipoolWithdrawable(\_minipoolAddress, \_stakingStartBalance, \_stakingEndBalance);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nbytes32 resultHash = keccak256(abi.encodePacked(groupPubKey, misbehaved));\. ```\nbytes32 resultHash = keccak256(abi.encodePacked(groupPubKey, misbehaved));\n```\n

Vulnerable code:
```\nbytes32 resultHash = keccak256(abi.encodePacked(groupPubKey, misbehaved));\n```\n
MEDIUM severity: Vulnerable function: ```\n    function _revertOnMinDebt(\n        LoansState storage loans_,\n        uint256 poolDebt_,\. ```\n    function _revertOnMinDebt(\n        LoansState storage loans_,\n        uint256 poolDebt_,\n        uint256 borrowerDebt_,\n        uint256 quoteDust_\n    ) view {\n        if (borrowerDebt_ != 0) {\n            uint256 loansCount = Loans.noOfLoans(loans_);\n            if (loansCount >= 1

Vulnerable code:
```\n    function _revertOnMinDebt(\n        LoansState storage loans_,\n        uint256 poolDebt_,\n        uint256 borrowerDebt_,\n        uint256 quoteDust_\n    ) view {\n        if (borrowerDebt_ != 0) {\n            uint256 loansCount = Loans.noOfLoans(loans_);\n            if (loansCount >= 10) {\n                if (borrowerDebt_ < _minDebtAmount(poolDebt_, loansCount)) revert AmountLTMinDebt();\n            } else {\n                if (borrowerDebt_ < quoteDust_)                            revert DustAmountNotExceeded();\n            }\n        }\n    }\n```\n
HIGH severity: Vulnerable function: ```\nfunction deposit(GMXTypes.DepositParams memory dp) external payable nonReentrant {\n        GMX. ```\nfunction deposit(GMXTypes.DepositParams memory dp) external payable nonReentrant {\n        GMXDeposit.deposit(_store, dp, false);\n    }\n\nstruct DepositParams {\n    // Address of token depositing; can be tokenA, tokenB or lpToken\n    address token;\n    // Amount of token to deposit in tok

Vulnerable code:
```\nfunction deposit(GMXTypes.DepositParams memory dp) external payable nonReentrant {\n        GMXDeposit.deposit(_store, dp, false);\n    }\n\nstruct DepositParams {\n    // Address of token depositing; can be tokenA, tokenB or lpToken\n    address token;\n    // Amount of token to deposit in token decimals\n    uint256 amt;\n    // Minimum amount of shares to receive in 1e18\n    uint256 minSharesAmt;\n    // Slippage tolerance for adding liquidity; e.g. 3 = 0.03%\n    uint256 slippage;\n    // Execution fee sent to GMX for adding liquidity\n    uint256 executionFee;\n  }\n```\n
HIGH severity: Vulnerable function: ```\nfunction _executeTrade(\n    address target,\n    uint256 msgValue,\n    bytes memory params,\n. ```\nfunction _executeTrade(\n    address target,\n    uint256 msgValue,\n    bytes memory params,\n    address spender,\n    Trade memory trade\n) private {\n    uint256 preTradeBalance;\n\n    if (trade.sellToken == address(Deployments.WETH) && spender == Deployments.ETH_ADDRESS) {\n        preTra

Vulnerable code:
```\nfunction _executeTrade(\n    address target,\n    uint256 msgValue,\n    bytes memory params,\n    address spender,\n    Trade memory trade\n) private {\n    uint256 preTradeBalance;\n\n    if (trade.sellToken == address(Deployments.WETH) && spender == Deployments.ETH_ADDRESS) {\n        preTradeBalance = address(this).balance;\n        // Curve doesn't support Deployments.WETH (spender == address(0))\n        uint256 withdrawAmount = _isExactIn(trade) ? trade.amount : trade.limit;\n        Deployments.WETH.withdraw(withdrawAmount);\n    } else if (trade.sellToken == Deployments.ETH_ADDRESS && spender != Deployments.ETH_ADDRESS) {\n        preTradeBalance = IERC20(address(Deployments.WETH)).balanceOf(address(this));\n        // UniswapV3 doesn't support ETH (spender != address(0))\n        uint256 depositAmount = _isExactIn(trade) ? trade.amount : trade.limit;\n        Deployments.WETH.deposit{value: depositAmount }();\n    }\n\n    (bool success, bytes memory returnData) = target.call{value: msgValue}(params);\n    if (!success) revert TradeExecution(returnData);\n\n    if (trade.buyToken == address(Deployments.WETH)) {\n        if (address(this).balance > preTradeBalance) {\n            // If the caller specifies that they want to receive Deployments.WETH but we have received ETH,\n            // wrap the ETH to Deployments.WETH.\n            uint256 depositAmount;\n            unchecked { depositAmount = address(this).balance - preTradeBalance; }\n            Deployments.WETH.deposit{value: depositAmount}();\n        }\n    } else if (trade.buyToken == Deployments.ETH_ADDRESS) {\n        uint256 postTradeBalance = IERC20(address(Deployments.WETH)).balanceOf(address(this));\n        if (postTradeBalance > preTradeBalance) {\n            // If the caller specifies that they want to receive ETH but we have received Deployments.WETH,\n            // unwrap the Deployments.WETH to ETH.\n            uint256 withdrawAmount;\n            unchecked { withdrawAmount = postTradeBalance - preTradeBalance; }\n            Deployments.WETH.withdraw(withdrawAmount);\n        }\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n        address burnToken = address(ISoftVault(strategy.vault).uToken());\n. ```\n        address burnToken = address(ISoftVault(strategy.vault).uToken());\n        if (collSize > 0) {\n            if (posCollToken != address(wrapper))\n                revert Errors.INCORRECT_COLTOKEN(posCollToken);\n            bank.takeCollateral(collSize);\n            wrapper.burn(burnTo

Vulnerable code:
```\n        address burnToken = address(ISoftVault(strategy.vault).uToken());\n        if (collSize > 0) {\n            if (posCollToken != address(wrapper))\n                revert Errors.INCORRECT_COLTOKEN(posCollToken);\n            bank.takeCollateral(collSize);\n            wrapper.burn(burnToken, collSize);\n            _doRefund(burnToken);\n        }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function setIncentiveSettings(IncentiveSettings memory _newIncentiveSettings) external only. ```\n    function setIncentiveSettings(IncentiveSettings memory _newIncentiveSettings) external onlyOperator noRebalanceInProgress {\n        incentive = _newIncentiveSettings;\n\n        _validateNonExchangeSettings(methodology, execution, incentive);\n\n        emit IncentiveSettingsUpdated(\n    

Vulnerable code:
```\n    function setIncentiveSettings(IncentiveSettings memory _newIncentiveSettings) external onlyOperator noRebalanceInProgress {\n        incentive = _newIncentiveSettings;\n\n        _validateNonExchangeSettings(methodology, execution, incentive);\n\n        emit IncentiveSettingsUpdated(\n            incentive.etherReward,\n            incentive.incentivizedLeverageRatio,\n            incentive.incentivizedSlippageTolerance,\n            incentive.incentivizedTwapCooldownPeriod\n        );\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\noffTargetPercentage = abs(90 - 100) / (100 + 90) = 10 / 190 = 0.0526 = 5.26. ```\noffTargetPercentage = abs(90 - 100) / (100 + 90) = 10 / 190 = 0.0526 = 5.26%\n```\n

Vulnerable code:
```\noffTargetPercentage = abs(90 - 100) / (100 + 90) = 10 / 190 = 0.0526 = 5.26%\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _setMinThreshold(uint256 _minThreshold) internal {\n    if (_minThreshold > maxSigners. ```\nfunction _setMinThreshold(uint256 _minThreshold) internal {\n    if (_minThreshold > maxSigners || _minThreshold > targetThreshold) {\n        revert InvalidMinThreshold();\n    }\n\n    minThreshold = _minThreshold;\n}\n```\n

Vulnerable code:
```\nfunction _setMinThreshold(uint256 _minThreshold) internal {\n    if (_minThreshold > maxSigners || _minThreshold > targetThreshold) {\n        revert InvalidMinThreshold();\n    }\n\n    minThreshold = _minThreshold;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction setFlashCloseFee(uint64 \_newFactorA, uint64 \_newFactorB) external isAuthorized {\n f. ```\nfunction setFlashCloseFee(uint64 \_newFactorA, uint64 \_newFactorB) external isAuthorized {\n flashCloseF.a = \_newFactorA;\n flashCloseF.b = \_newFactorB;\n```\n

Vulnerable code:
```\nfunction setFlashCloseFee(uint64 \_newFactorA, uint64 \_newFactorB) external isAuthorized {\n flashCloseF.a = \_newFactorA;\n flashCloseF.b = \_newFactorB;\n```\n
MEDIUM severity: Vulnerable function: ```\nif (value > 0) {\n    totalERC20Claimed[_token][_to] += value;\n    _token.. ```\nif (value > 0) {\n    totalERC20Claimed[_token][_to] += value;\n    _token.transfer(_to, value);\n}\n```\n

Vulnerable code:
```\nif (value > 0) {\n    totalERC20Claimed[_token][_to] += value;\n    _token.transfer(_to, value);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n            function getTokenPriceFromStablePool(\n        address lookupToken_,\n        uint8. ```\n            function getTokenPriceFromStablePool(\n        address lookupToken_,\n        uint8 outputDecimals_,\n        bytes calldata params_\n    ) external view returns (uint256) {\n\n                // rest of code..\n\n                try pool.getLastInvariant() returns (uint256, uint256

Vulnerable code:
```\n            function getTokenPriceFromStablePool(\n        address lookupToken_,\n        uint8 outputDecimals_,\n        bytes calldata params_\n    ) external view returns (uint256) {\n\n                // rest of code..\n\n                try pool.getLastInvariant() returns (uint256, uint256 ampFactor) {\n                   \n                   // @audit the amplification factor as of the last invariant calculation is used\n                    lookupTokensPerDestinationToken = StableMath._calcOutGivenIn(\n                        ampFactor,\n                        balances_,\n                        destinationTokenIndex,\n                        lookupTokenIndex,\n                        1e18,\n                        StableMath._calculateInvariant(ampFactor, balances_) // Sometimes the fetched invariant value does not work, so calculate it\n                    );\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _createActionInfo() internal view returns(ActionInfo memory) {\n        ActionInfo mem. ```\nfunction _createActionInfo() internal view returns(ActionInfo memory) {\n        ActionInfo memory rebalanceInfo;\n\n        // Calculate prices from chainlink. Chainlink returns prices with 8 decimal places, but we need 36 - underlyingDecimals decimal places.\n        // This is so that when t

Vulnerable code:
```\nfunction _createActionInfo() internal view returns(ActionInfo memory) {\n        ActionInfo memory rebalanceInfo;\n\n        // Calculate prices from chainlink. Chainlink returns prices with 8 decimal places, but we need 36 - underlyingDecimals decimal places.\n        // This is so that when the underlying amount is multiplied by the received price, the collateral valuation is normalized to 36 decimals.\n        // To perform this adjustment, we multiply by 10^(36 - 8 - underlyingDecimals)\n        int256 rawCollateralPrice = strategy.collateralPriceOracle.latestAnswer();\n        rebalanceInfo.collateralPrice = rawCollateralPrice.toUint256().mul(10 ** strategy.collateralDecimalAdjustment);\n        int256 rawBorrowPrice = strategy.borrowPriceOracle.latestAnswer();\n        rebalanceInfo.borrowPrice = rawBorrowPrice.toUint256().mul(10 ** strategy.borrowDecimalAdjustment);\n// More Code// rest of code.\n}\n   \n```\n
MEDIUM severity: Vulnerable function: ```\nfunction test_ExtendLock_AlreadyEnded() external {\n        uint256 amount = 100e18;\n        u. ```\nfunction test_ExtendLock_AlreadyEnded() external {\n        uint256 amount = 100e18;\n        uint256 duration = 5 days;\n\n        _stake(amount, duration, alice, alice);\n\n        // 5 days later, lock is ended for Alice\n        skip(5 days + 1);\n\n        (,, uint128 _ends,,) = veTRUF.loc

Vulnerable code:
```\nfunction test_ExtendLock_AlreadyEnded() external {\n        uint256 amount = 100e18;\n        uint256 duration = 5 days;\n\n        _stake(amount, duration, alice, alice);\n\n        // 5 days later, lock is ended for Alice\n        skip(5 days + 1);\n\n        (,, uint128 _ends,,) = veTRUF.lockups(alice, 0);\n\n        // Alice's lock is indeed ended\n        assertTrue(_ends < block.timestamp, "lock is ended");\n\n        // 36 days passed  \n        skip(36 days);\n\n        // Alice extends her already finished lock 30 more days\n        vm.prank(alice);\n        veTRUF.extendLock(0, 30 days);\n\n        (,,_ends,,) = veTRUF.lockups(alice, 0);\n\n        // Alice's lock can be easily unlocked right away\n        assertTrue(_ends < block.timestamp, "lock is ended");\n\n        // Alice unstakes her lock, basically alice can unstake her lock anytime she likes\n        vm.prank(alice);\n        veTRUF.unstake(0);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfor (uint256 i = 0; i < redeemableTokens.length; i++) {\n    vaultTokenBala. ```\nfor (uint256 i = 0; i < redeemableTokens.length; i++) {\n    vaultTokenBalance = vault.balance(redeemableTokens[i]);\n\n    redemptionAmount = \_burnableAmount.mul(vaultTokenBalance).div(burnableTokenTotalSupply);\n    totalRedemptionAmount = totalRedemptionAmount.add(redemptionAmount);\n\n    

Vulnerable code:
```\nfor (uint256 i = 0; i < redeemableTokens.length; i++) {\n    vaultTokenBalance = vault.balance(redeemableTokens[i]);\n\n    redemptionAmount = \_burnableAmount.mul(vaultTokenBalance).div(burnableTokenTotalSupply);\n    totalRedemptionAmount = totalRedemptionAmount.add(redemptionAmount);\n\n    if (redemptionAmount > 0) {\n        vault.transfer(redeemableTokens[i], msg.sender, redemptionAmount);\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n  function withdrawalRequest(\n    uint256 _amount\n  ) external nonReentrant onlyWhenVaultIsOn. ```\n  function withdrawalRequest(\n    uint256 _amount\n  ) external nonReentrant onlyWhenVaultIsOn returns (uint256 value) {\n    UserInfo storage user = userInfo[msg.sender];\n    require(user.withdrawalRequestPeriod == 0, "Already a request");\n\n    value = (_amount * exchangeRate) / (10 ** dec

Vulnerable code:
```\n  function withdrawalRequest(\n    uint256 _amount\n  ) external nonReentrant onlyWhenVaultIsOn returns (uint256 value) {\n    UserInfo storage user = userInfo[msg.sender];\n    require(user.withdrawalRequestPeriod == 0, "Already a request");\n\n    value = (_amount * exchangeRate) / (10 ** decimals());\n\n    _burn(msg.sender, _amount);\n\n    user.withdrawalAllowance = value;\n    user.withdrawalRequestPeriod = rebalancingPeriod;\n    totalWithdrawalRequests += value;\n  }\n```\n
MEDIUM severity: Vulnerable function: ```\n/\*\*\n\* @notice Checks whether a transaction is "standard finalized"\n\* @dev MVP: requires t. ```\n/\*\*\n\* @notice Checks whether a transaction is "standard finalized"\n\* @dev MVP: requires that both inclusion proof and confirm signature is checked\n\* @dev MoreVp: checks inclusion proof only\n\*/\nfunction isStandardFinalized(Model.Data memory data) public view returns (bool) {\n    if (

Vulnerable code:
```\n/\*\*\n\* @notice Checks whether a transaction is "standard finalized"\n\* @dev MVP: requires that both inclusion proof and confirm signature is checked\n\* @dev MoreVp: checks inclusion proof only\n\*/\nfunction isStandardFinalized(Model.Data memory data) public view returns (bool) {\n    if (data.protocol == Protocol.MORE\_VP()) {\n        return checkInclusionProof(data);\n    } else if (data.protocol == Protocol.MVP()) {\n        revert("MVP is not yet supported");\n    } else {\n        revert("Invalid protocol value");\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\naddress underlying = getUnderlyingAddress(_vaultNumber, _chain);\nuint256 b. ```\naddress underlying = getUnderlyingAddress(_vaultNumber, _chain);\nuint256 balance = IERC20(underlying).balanceOf(address(this));\n```\n

Vulnerable code:
```\naddress underlying = getUnderlyingAddress(_vaultNumber, _chain);\nuint256 balance = IERC20(underlying).balanceOf(address(this));\n```\n
MEDIUM severity: Vulnerable function: ```\n        } else {\n            // Default to PaymentType.EMI\n            //. ```\n        } else {\n            // Default to PaymentType.EMI\n            // Max payable amount in a cycle\n            // NOTE: the last cycle could have less than the calculated payment amount\n            uint256 maxCycleOwed = isLastPaymentCycle\n                ? owedPrincipal_ + interest_\

Vulnerable code:
```\n        } else {\n            // Default to PaymentType.EMI\n            // Max payable amount in a cycle\n            // NOTE: the last cycle could have less than the calculated payment amount\n            uint256 maxCycleOwed = isLastPaymentCycle\n                ? owedPrincipal_ + interest_\n                : _bid.terms.paymentCycleAmount;\n\n            // Calculate accrued amount due since last repayment\n            uint256 owedAmount = (maxCycleOwed * owedTime) /\n                _bid.terms.paymentCycle;\n            duePrincipal_ = Math.min(owedAmount - interest_, owedPrincipal_);\n        }\n```\n
MEDIUM severity: Vulnerable function: ```\nmodifier onlyWhenUnderlyingsReceived(uint256 _vaultNumber) {\n  require(\n . ```\nmodifier onlyWhenUnderlyingsReceived(uint256 _vaultNumber) {\n  require(\n    vaultStage[_vaultNumber].underlyingReceived == vaultStage[_vaultNumber].activeVaults,\n    "Not all underlyings received"\n  );\n  _;\n}\n```\n

Vulnerable code:
```\nmodifier onlyWhenUnderlyingsReceived(uint256 _vaultNumber) {\n  require(\n    vaultStage[_vaultNumber].underlyingReceived == vaultStage[_vaultNumber].activeVaults,\n    "Not all underlyings received"\n  );\n  _;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction latestRoundData(\n  address base,\n  address quote\n)\n  external\n  view\n  override\. ```\nfunction latestRoundData(\n  address base,\n  address quote\n)\n  external\n  view\n  override\n  checkPairAccess()\n  returns (\n    uint80 roundId,\n    int256 answer,\n    uint256 startedAt,\n    uint256 updatedAt,\n    uint80 answeredInRound\n  )\n{\n  uint16 currentPhaseId = s_currentPhase

Vulnerable code:
```\nfunction latestRoundData(\n  address base,\n  address quote\n)\n  external\n  view\n  override\n  checkPairAccess()\n  returns (\n    uint80 roundId,\n    int256 answer,\n    uint256 startedAt,\n    uint256 updatedAt,\n    uint80 answeredInRound\n  )\n{\n  uint16 currentPhaseId = s_currentPhaseId[base][quote];\n  //@audit this pulls the Aggregator for the requested pair\n  AggregatorV2V3Interface aggregator = _getFeed(base, quote);\n  require(address(aggregator) != address(0), "Feed not found");\n  (\n    roundId,\n    answer,\n    startedAt,\n    updatedAt,\n    answeredInRound\n  ) = aggregator.latestRoundData();\n  return _addPhaseIds(roundId, answer, startedAt, updatedAt, answeredInRound, currentPhaseId);\n}\n```\n