Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\nOracleVersion memory latestOracleVersion = market.oracle().latest();\nlates. ```\nOracleVersion memory latestOracleVersion = market.oracle().latest();\nlatestPrice = latestOracleVersion.price;\nIPayoffProvider payoff = market.payoff();\nif (address(payoff) != address(0)) latestPrice = payoff.payoff(latestPrice);\n```\n

Vulnerable code:
```\nOracleVersion memory latestOracleVersion = market.oracle().latest();\nlatestPrice = latestOracleVersion.price;\nIPayoffProvider payoff = market.payoff();\nif (address(payoff) != address(0)) latestPrice = payoff.payoff(latestPrice);\n```\n
HIGH severity: Vulnerable function: ```\nrocketMinipoolManager.setMinipoolWithdrawalBalances(\_minipoolAddress, \_st. ```\nrocketMinipoolManager.setMinipoolWithdrawalBalances(\_minipoolAddress, \_stakingEndBalance, nodeAmount);\n// Apply node penalties by liquidating RPL stake\nif (\_stakingEndBalance < userDepositBalance) {\n    RocketNodeStakingInterface rocketNodeStaking = RocketNodeStakingInterface(getContractA

Vulnerable code:
```\nrocketMinipoolManager.setMinipoolWithdrawalBalances(\_minipoolAddress, \_stakingEndBalance, nodeAmount);\n// Apply node penalties by liquidating RPL stake\nif (\_stakingEndBalance < userDepositBalance) {\n    RocketNodeStakingInterface rocketNodeStaking = RocketNodeStakingInterface(getContractAddress("rocketNodeStaking"));\n    rocketNodeStaking.slashRPL(minipool.getNodeAddress(), userDepositBalance - \_stakingEndBalance);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: BondBaseOFDA.sol\n    function _createMarket(MarketParams memory params_) internal return. ```\nFile: BondBaseOFDA.sol\n    function _createMarket(MarketParams memory params_) internal returns (uint256) {\n..SNIP..\n        // Calculate the maximum payout amount for this market\n        uint256 capacity = params_.capacityInQuote\n            ? params_.capacity.mulDiv(\n                sca

Vulnerable code:
```\nFile: BondBaseOFDA.sol\n    function _createMarket(MarketParams memory params_) internal returns (uint256) {\n..SNIP..\n        // Calculate the maximum payout amount for this market\n        uint256 capacity = params_.capacityInQuote\n            ? params_.capacity.mulDiv(\n                scale,\n                price.mulDivUp(\n                    uint256(ONE_HUNDRED_PERCENT - params_.fixedDiscount),\n                    uint256(ONE_HUNDRED_PERCENT)\n                )\n            )\n            : params_.capacity;\n        market.maxPayout = capacity.mulDiv(uint256(params_.depositInterval), uint256(length));\n```\n
MEDIUM severity: Vulnerable function: ```\n      (address[] memory tokens, uint256[] memory rewards) = IERC20Wrapper(\. ```\n      (address[] memory tokens, uint256[] memory rewards) = IERC20Wrapper(\n          pos.collToken\n      ).pendingRewards(pos.collId, pos.collateralSize);\n      for (uint256 i; i < tokens.length; i++) {\n          rewardsValue += oracle.getTokenValue(tokens[i], rewards[i]);\n      }\n```\n

Vulnerable code:
```\n      (address[] memory tokens, uint256[] memory rewards) = IERC20Wrapper(\n          pos.collToken\n      ).pendingRewards(pos.collId, pos.collateralSize);\n      for (uint256 i; i < tokens.length; i++) {\n          rewardsValue += oracle.getTokenValue(tokens[i], rewards[i]);\n      }\n```\n
MEDIUM severity: Vulnerable function: ```\n      struct PoolInfo {\n          uint128 accRewardPerShare;\n            . ```\n      struct PoolInfo {\n          uint128 accRewardPerShare;\n            uint64 lastRewardTime;\n               uint64 allocPoint;\n```\n

Vulnerable code:
```\n      struct PoolInfo {\n          uint128 accRewardPerShare;\n            uint64 lastRewardTime;\n               uint64 allocPoint;\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction reward(\n    uint8 subjectType,\n    uint256 subjectId,\n    uint256 amount,\n    uint. ```\nfunction reward(\n    uint8 subjectType,\n    uint256 subjectId,\n    uint256 amount,\n    uint256 epochNumber\n) external onlyRole(REWARDER\_ROLE) {\n    if (subjectType != NODE\_RUNNER\_SUBJECT) revert InvalidSubjectType(subjectType);\n    if (!\_subjectGateway.isRegistered(subjectType, subje

Vulnerable code:
```\nfunction reward(\n    uint8 subjectType,\n    uint256 subjectId,\n    uint256 amount,\n    uint256 epochNumber\n) external onlyRole(REWARDER\_ROLE) {\n    if (subjectType != NODE\_RUNNER\_SUBJECT) revert InvalidSubjectType(subjectType);\n    if (!\_subjectGateway.isRegistered(subjectType, subjectId)) revert RewardingNonRegisteredSubject(subjectType, subjectId);\n    uint256 shareId = FortaStakingUtils.subjectToActive(getDelegatorSubjectType(subjectType), subjectId);\n    \_rewardsPerEpoch[shareId][epochNumber] = amount;\n    totalRewardsDistributed += amount;\n    emit Rewarded(subjectType, subjectId, amount, epochNumber);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n function currentRewardsPerToken() public view returns (uint256) {\n        // Rewards do not a. ```\n function currentRewardsPerToken() public view returns (uint256) {\n        // Rewards do not accrue if the total balance is zero\n        if (totalBalance == 0) return rewardsPerTokenStored;\n\n        // @audit\n        // loss of precision\n        // The number of rewards to apply is based 

Vulnerable code:
```\n function currentRewardsPerToken() public view returns (uint256) {\n        // Rewards do not accrue if the total balance is zero\n        if (totalBalance == 0) return rewardsPerTokenStored;\n\n        // @audit\n        // loss of precision\n        // The number of rewards to apply is based on the reward rate and the amount of time that has passed since the last reward update\n        uint256 rewardsToApply = ((block.timestamp - lastRewardUpdate) * rewardRate) /\n            REWARD_PERIOD;\n\n        // The rewards per token is the current rewards per token plus the rewards to apply divided by the total staked balance\n        return rewardsPerTokenStored + (rewardsToApply * 10 ** stakedTokenDecimals) / totalBalance;\n    }\n```\n
HIGH severity: Vulnerable function: ```\nfunction commitCollateral(\n    uint256 _bidId,\n    Collateral[] calldata _collateralInfo\n) p. ```\nfunction commitCollateral(\n    uint256 _bidId,\n    Collateral[] calldata _collateralInfo\n) public returns (bool validation_) {\n    address borrower = tellerV2.getLoanBorrower(_bidId);\n    (validation_, ) = checkBalances(borrower, _collateralInfo); <- @audit-issue no access control\n\n    i

Vulnerable code:
```\nfunction commitCollateral(\n    uint256 _bidId,\n    Collateral[] calldata _collateralInfo\n) public returns (bool validation_) {\n    address borrower = tellerV2.getLoanBorrower(_bidId);\n    (validation_, ) = checkBalances(borrower, _collateralInfo); <- @audit-issue no access control\n\n    if (validation_) {\n        for (uint256 i; i < _collateralInfo.length; i++) {\n            Collateral memory info = _collateralInfo[i];\n            _commitCollateral(_bidId, info);\n        }\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nif (address(quote.sellToken) != ETH) _transferFrom(permit, stake, stakeSize. ```\nif (address(quote.sellToken) != ETH) _transferFrom(permit, stake, stakeSize);\n if (address(quote.sellToken) != stake) _fillQuote(quote);\n```\n

Vulnerable code:
```\nif (address(quote.sellToken) != ETH) _transferFrom(permit, stake, stakeSize);\n if (address(quote.sellToken) != stake) _fillQuote(quote);\n```\n
HIGH severity: Vulnerable function: ```\n    function _poolRepayAll(address pool, address token) internal {\n        .\n        .\n     . ```\n    function _poolRepayAll(address pool, address token) internal {\n        .\n        .\n        info.totalBorrows = info.totalBorrows - amount;\n        info.balance = info.balance - amount; // amount should be added here\n        .\n        .\n    }\n```\n

Vulnerable code:
```\n    function _poolRepayAll(address pool, address token) internal {\n        .\n        .\n        info.totalBorrows = info.totalBorrows - amount;\n        info.balance = info.balance - amount; // amount should be added here\n        .\n        .\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function externalSwap(\n        address fromToken,\n        address toToken,\n        addre. ```\n    function externalSwap(\n        address fromToken,\n        address toToken,\n        address approveTarget,\n        address swapTarget,\n        uint256 fromTokenAmount,\n        uint256 minReturnAmount,\n        bytes memory feeData,\n        bytes memory callDataConcat,\n        uint256

Vulnerable code:
```\n    function externalSwap(\n        address fromToken,\n        address toToken,\n        address approveTarget,\n        address swapTarget,\n        uint256 fromTokenAmount,\n        uint256 minReturnAmount,\n        bytes memory feeData,\n        bytes memory callDataConcat,\n        uint256 deadLine\n    ) external payable judgeExpired(deadLine) returns (uint256 receiveAmount) {      \n        require(isWhiteListedContract[swapTarget], "DODORouteProxy: Not Whitelist Contract");  \n        require(isApproveWhiteListedContract[approveTarget], "DODORouteProxy: Not Whitelist Appprove Contract");  \n\n        // transfer in fromToken\n        if (fromToken != _ETH_ADDRESS_) {\n            // approve if needed\n            if (approveTarget != address(0)) {\n                IERC20(fromToken).universalApproveMax(approveTarget, fromTokenAmount);\n            }\n\n            IDODOApproveProxy(_DODO_APPROVE_PROXY_).claimTokens(\n                fromToken,\n                msg.sender,\n                address(this),\n                fromTokenAmount\n            );\n        }\n\n        // swap\n        uint256 toTokenOriginBalance;\n        if(toToken != _ETH_ADDRESS_) {\n            toTokenOriginBalance = IERC20(toToken).universalBalanceOf(address(this));\n        } else {\n            toTokenOriginBalance = IERC20(_WETH_).universalBalanceOf(address(this));\n        }\n```\n
HIGH severity: Vulnerable function: ```\nit('pending deposit pushed by 1 epoch causing shares difference', async () . ```\nit('pending deposit pushed by 1 epoch causing shares difference', async () => {\n      const smallDeposit = utils.parseEther('1000')\n      const smallestDeposit = utils.parseEther('0.000001')\n\n      await updateOracleEth() // epoch now stale\n      // make a pending deposit\n      await vaul

Vulnerable code:
```\nit('pending deposit pushed by 1 epoch causing shares difference', async () => {\n      const smallDeposit = utils.parseEther('1000')\n      const smallestDeposit = utils.parseEther('0.000001')\n\n      await updateOracleEth() // epoch now stale\n      // make a pending deposit\n      await vault.connect(user).deposit(smallDeposit, user.address)\n      await updateOracleBtc()\n      await vault.sync()\n\n      await updateOracleEth() // epoch now stale\n      /* \n      user2 deposits for user1, thereby pushing the pending deposit ahead and causing the \n      global settlement flywheel and user settlement flywheel to get out of sync\n      */\n      await vault.connect(user2).deposit(smallestDeposit, user.address)\n      await updateOracleBtc()\n      await vault.sync()\n\n      await updateOracle()\n      // pending deposit for user1 is now processed in the user settlement flywheel\n      await vault.syncAccount(user.address)\n\n      const totalSupply = await vault.totalSupply()\n      const balanceUser1 = await vault.balanceOf(user.address)\n      const balanceUser2 = await vault.balanceOf(user2.address)\n\n      /*\n      totalSupply is bigger than the amount of shares of both users together\n      this is because user1 loses out on some shares that he is entitled to\n      -> loss of funds\n      */\n      console.log(totalSupply);\n      console.log(balanceUser1.add(balanceUser2));\n\n})\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _fundPool(uint256 _amount, uint256 _poolId, IStrategy _strategy) internal {\n        u. ```\nfunction _fundPool(uint256 _amount, uint256 _poolId, IStrategy _strategy) internal {\n        uint256 feeAmount;\n        uint256 amountAfterFee = _amount;\n\n        Pool storage pool = pools[_poolId];\n        address _token = pool.token;\n\n        if (percentFee > 0) {\n            feeAmoun

Vulnerable code:
```\nfunction _fundPool(uint256 _amount, uint256 _poolId, IStrategy _strategy) internal {\n        uint256 feeAmount;\n        uint256 amountAfterFee = _amount;\n\n        Pool storage pool = pools[_poolId];\n        address _token = pool.token;\n\n        if (percentFee > 0) {\n            feeAmount = (_amount * percentFee) / getFeeDenominator();\n            amountAfterFee -= feeAmount;\n\n            _transferAmountFrom(_token, TransferData({from: msg.sender, to: treasury, amount: feeAmount}));\n        }\n\n        _transferAmountFrom(_token, TransferData({from: msg.sender, to: address(_strategy), amount: amountAfterFee}));\n        _strategy.increasePoolAmount(amountAfterFee);\n\n        emit PoolFunded(_poolId, amountAfterFee, feeAmount);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\ncontract Vault is IVault, ERC20, EpochControls, AccessControl, Pausable {\n. ```\ncontract Vault is IVault, ERC20, EpochControls, AccessControl, Pausable {\n```\n

Vulnerable code:
```\ncontract Vault is IVault, ERC20, EpochControls, AccessControl, Pausable {\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _qv_allocate(\n        // rest of code\n    ) internal onlyActiveAllocation {\n       . ```\nfunction _qv_allocate(\n        // rest of code\n    ) internal onlyActiveAllocation {\n        // rest of code\n        uint256 creditsCastToRecipient = _allocator.voiceCreditsCastToRecipient[_recipientId];\n        // rest of code\n        // get the total credits and calculate the vote resul

Vulnerable code:
```\nfunction _qv_allocate(\n        // rest of code\n    ) internal onlyActiveAllocation {\n        // rest of code\n        uint256 creditsCastToRecipient = _allocator.voiceCreditsCastToRecipient[_recipientId];\n        // rest of code\n        // get the total credits and calculate the vote result\n        uint256 totalCredits = _voiceCreditsToAllocate + creditsCastToRecipient;\n        // rest of code\n        //E update allocator mapping voice for this recipient\n        _allocator.voiceCreditsCastToRecipient[_recipientId] += totalCredits; //E @question should be only _voiceCreditsToAllocate\n        // rest of code\n    }\n```\n
HIGH severity: Vulnerable function: ```\n       uint96 prefundingRefund = routing.funding + payoutSent_ - sold_;\n  . ```\n       uint96 prefundingRefund = routing.funding + payoutSent_ - sold_;\n        unchecked {\n            routing.funding -= prefundingRefund;\n        }\n        Transfer.transfer(\n            routing.baseToken,\n            _getAddressGivenCallbackBaseTokenFlag(routing.callbacks, routing.sel

Vulnerable code:
```\n       uint96 prefundingRefund = routing.funding + payoutSent_ - sold_;\n        unchecked {\n            routing.funding -= prefundingRefund;\n        }\n        Transfer.transfer(\n            routing.baseToken,\n            _getAddressGivenCallbackBaseTokenFlag(routing.callbacks, routing.seller),\n            prefundingRefund,\n            false\n        );\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 cf = IUSSD(USSD).collateralFactor();\nuint256 flutter = 0;\nfor (fl. ```\nuint256 cf = IUSSD(USSD).collateralFactor();\nuint256 flutter = 0;\nfor (flutter = 0; flutter < flutterRatios.length; flutter++) {\n if (cf < flutterRatios[flutter]) {\n   break;\n }\n}\n```\n

Vulnerable code:
```\nuint256 cf = IUSSD(USSD).collateralFactor();\nuint256 flutter = 0;\nfor (flutter = 0; flutter < flutterRatios.length; flutter++) {\n if (cf < flutterRatios[flutter]) {\n   break;\n }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n         require(\n             balance + tokenXAmount <= maxLiquidity,\n  . ```\n         require(\n             balance + tokenXAmount <= maxLiquidity,\n             "Pool has already reached it's max limit"\n         );\n```\n

Vulnerable code:
```\n         require(\n             balance + tokenXAmount <= maxLiquidity,\n             "Pool has already reached it's max limit"\n         );\n```\n
HIGH severity: Vulnerable function: ```\nfor (uint256 i = 0; i < \_toReset.length; i++) {\n    require(\_tokenIsCont. ```\nfor (uint256 i = 0; i < \_toReset.length; i++) {\n    require(\_tokenIsContractOrETH(\_toReset[i]), ERROR\_INVALID\_TOKENS);\n    toReset.push(\_toReset[i]);\n}\n```\n

Vulnerable code:
```\nfor (uint256 i = 0; i < \_toReset.length; i++) {\n    require(\_tokenIsContractOrETH(\_toReset[i]), ERROR\_INVALID\_TOKENS);\n    toReset.push(\_toReset[i]);\n}\n```\n
HIGH severity: Vulnerable function: ```\nrequire(\_startBlock > block.number, "Proposal start block must be in the f. ```\nrequire(\_startBlock > block.number, "Proposal start block must be in the future");\nrequire(\_durationBlocks > 0, "Proposal cannot have a duration of 0 blocks");\nrequire(\_expiresBlocks > 0, "Proposal cannot have a execution expiration of 0 blocks");\nrequire(\_votesRequired > 0, "Proposal ca

Vulnerable code:
```\nrequire(\_startBlock > block.number, "Proposal start block must be in the future");\nrequire(\_durationBlocks > 0, "Proposal cannot have a duration of 0 blocks");\nrequire(\_expiresBlocks > 0, "Proposal cannot have a execution expiration of 0 blocks");\nrequire(\_votesRequired > 0, "Proposal cannot have a 0 votes required to be successful");\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction viewRawAmount (address \_assim, int128 \_amt) internal returns (uint256 amount\_) {\n\. ```\nfunction viewRawAmount (address \_assim, int128 \_amt) internal returns (uint256 amount\_) {\n\n    // amount\_ = IAssimilator(\_assim).viewRawAmount(\_amt); // for production\n\n    bytes memory data = abi.encodeWithSelector(iAsmltr.viewRawAmount.selector, \_amt.abs()); // for development\n\n 

Vulnerable code:
```\nfunction viewRawAmount (address \_assim, int128 \_amt) internal returns (uint256 amount\_) {\n\n    // amount\_ = IAssimilator(\_assim).viewRawAmount(\_amt); // for production\n\n    bytes memory data = abi.encodeWithSelector(iAsmltr.viewRawAmount.selector, \_amt.abs()); // for development\n\n    amount\_ = abi.decode(\_assim.delegate(data), (uint256)); // for development\n\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nl2Outputs.push(\n            Types.OutputProposal({\n                output. ```\nl2Outputs.push(\n            Types.OutputProposal({\n                outputRoot: _outputRoot,\n                timestamp: uint128(block.timestamp),\n                l2BlockNumber: uint128(_l2BlockNumber)\n            })\n        );\n```\n

Vulnerable code:
```\nl2Outputs.push(\n            Types.OutputProposal({\n                outputRoot: _outputRoot,\n                timestamp: uint128(block.timestamp),\n                l2BlockNumber: uint128(_l2BlockNumber)\n            })\n        );\n```\n
HIGH severity: Vulnerable function: ```\nUFixed6 collateral = marketContext.currentPosition.maker\n    .sub(marketCo. ```\nUFixed6 collateral = marketContext.currentPosition.maker\n    .sub(marketContext.currentPosition.net().min(marketContext.currentPosition.maker))  // available maker\n    .min(marketContext.closable.mul(StrategyLib.LEVERAGE_BUFFER))                       // available closable\n    .muldiv(market

Vulnerable code:
```\nUFixed6 collateral = marketContext.currentPosition.maker\n    .sub(marketContext.currentPosition.net().min(marketContext.currentPosition.maker))  // available maker\n    .min(marketContext.closable.mul(StrategyLib.LEVERAGE_BUFFER))                       // available closable\n    .muldiv(marketContext.latestPrice.abs(), registration.leverage)                     // available collateral\n    .muldiv(totalWeight, registration.weight);                                          // collateral in market\n\nredemptionAssets = redemptionAssets.min(collateral);\n```\n
HIGH severity: Vulnerable function: ```\n  function repay(uint256 repayAmount, uint256 _userLoanId) external {\n    Loan memory userLoan. ```\n  function repay(uint256 repayAmount, uint256 _userLoanId) external {\n    Loan memory userLoan = loans[msg.sender][_userLoanId];\n    if(userLoan.borrowedAmount < repayAmount) revert ExcessiveRepay();\n    if(block.timestamp > userLoan.endDate) revert LoanExpired();\n    uint256 interestLoanRa

Vulnerable code:
```\n  function repay(uint256 repayAmount, uint256 _userLoanId) external {\n    Loan memory userLoan = loans[msg.sender][_userLoanId];\n    if(userLoan.borrowedAmount < repayAmount) revert ExcessiveRepay();\n    if(block.timestamp > userLoan.endDate) revert LoanExpired();\n    uint256 interestLoanRatio = FixedPointMathLib.divWad(userLoan.interest, userLoan.borrowedAmount);\n    uint256 interest = FixedPointMathLib.mulWadUp(repayAmount, interestLoanRatio);\n    outstandingDebt -= repayAmount - interest > outstandingDebt ? outstandingDebt : repayAmount - interest;\n    loans[msg.sender][_userLoanId].borrowedAmount -= repayAmount;\n    loans[msg.sender][_userLoanId].interest -= interest;\n    poolSize += userLoan.interest * (1000 - (multisigShare + apdaoShare)) / 1000; //@audit should use interest instead of userLoan.interest\n// rest of code\n  }\n```\n
HIGH severity: Vulnerable function: ```\nFile: VaultValuation.sol\n        // NOTE: deposit amount is always positiv. ```\nFile: VaultValuation.sol\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 

Vulnerable code:
```\nFile: VaultValuation.sol\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```\n
MEDIUM severity: Vulnerable function: ```\nFile:\n\n  function consult(address token) public view whenNotPaused returns (int256, uint8) {\. ```\nFile:\n\n  function consult(address token) public view whenNotPaused returns (int256, uint8) {\n    address _feed = feeds[token];\n\n    if (_feed == address(0)) revert Errors.NoTokenPriceFeedAvailable();\n\n    ChainlinkResponse memory chainlinkResponse = _getChainlinkResponse(_feed);\n    Cha

Vulnerable code:
```\nFile:\n\n  function consult(address token) public view whenNotPaused returns (int256, uint8) {\n    address _feed = feeds[token];\n\n    if (_feed == address(0)) revert Errors.NoTokenPriceFeedAvailable();\n\n    ChainlinkResponse memory chainlinkResponse = _getChainlinkResponse(_feed);\n    ChainlinkResponse memory prevChainlinkResponse = _getPrevChainlinkResponse(_feed, chainlinkResponse.roundId);//@audit incorrect way to get historical data\n    if (_chainlinkIsFrozen(chainlinkResponse, token)) revert Errors.FrozenTokenPriceFeed();\n    if (_chainlinkIsBroken(chainlinkResponse, prevChainlinkResponse, token)) revert Errors.BrokenTokenPriceFeed();\n\n return (chainlinkResponse.answer, chainlinkResponse.decimals);\n  }\n```\n