Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\n  function rebalanceXChain(uint256 _slippage, uint256 _relayerFee) external payable {\n    requ. ```\n  function rebalanceXChain(uint256 _slippage, uint256 _relayerFee) external payable {\n    require(state == State.SendingFundsXChain, stateError);\n\n\n    if (amountToSendXChain > getVaultBalance()) pullFunds(amountToSendXChain);\n    if (amountToSendXChain > getVaultBalance()) amountToSendXCh

Vulnerable code:
```\n  function rebalanceXChain(uint256 _slippage, uint256 _relayerFee) external payable {\n    require(state == State.SendingFundsXChain, stateError);\n\n\n    if (amountToSendXChain > getVaultBalance()) pullFunds(amountToSendXChain);\n    if (amountToSendXChain > getVaultBalance()) amountToSendXChain = getVaultBalance();\n\n\n    vaultCurrency.safeIncreaseAllowance(xProvider, amountToSendXChain);\n    IXProvider(xProvider).xTransferToController{value: msg.value}(\n      vaultNumber,\n      amountToSendXChain,\n      address(vaultCurrency),\n      _slippage,\n      _relayerFee\n    );\n\n\n    emit RebalanceXChain(vaultNumber, amountToSendXChain, address(vaultCurrency));\n\n\n    amountToSendXChain = 0;\n    settleReservedFunds();\n  }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction delegateMgCvg(uint256 _tokenId, address _to, uint96 _percentage) external onlyTokenOwn. ```\nfunction delegateMgCvg(uint256 _tokenId, address _to, uint96 _percentage) external onlyTokenOwner(_tokenId) {\n    require(_percentage <= 100, "INVALID_PERCENTAGE");\n\n    uint256 _delegateesLength = delegatedMgCvg[_tokenId].length;\n    require(_delegateesLength < maxMgDelegatees, "TOO_MUCH_D

Vulnerable code:
```\nfunction delegateMgCvg(uint256 _tokenId, address _to, uint96 _percentage) external onlyTokenOwner(_tokenId) {\n    require(_percentage <= 100, "INVALID_PERCENTAGE");\n\n    uint256 _delegateesLength = delegatedMgCvg[_tokenId].length;\n    require(_delegateesLength < maxMgDelegatees, "TOO_MUCH_DELEGATEES");\n\n    uint256 tokenIdsDelegated = mgCvgDelegatees[_to].length;\n    require(tokenIdsDelegated < maxTokenIdsDelegated, "TOO_MUCH_MG_TOKEN_ID_DELEGATED");\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction create(\n    uint256  maxLoanDur\_,\n    uint256  maxFundDur\_,\n    address  arbiter\. ```\nfunction create(\n    uint256  maxLoanDur\_,\n    uint256  maxFundDur\_,\n    address  arbiter\_,\n    bool     compoundEnabled\_,\n    uint256  amount\_\n) external returns (bytes32 fund) {\n    require(fundOwner[msg.sender].lender != msg.sender || msg.sender == deployer); // Only allow one lo

Vulnerable code:
```\nfunction create(\n    uint256  maxLoanDur\_,\n    uint256  maxFundDur\_,\n    address  arbiter\_,\n    bool     compoundEnabled\_,\n    uint256  amount\_\n) external returns (bytes32 fund) {\n    require(fundOwner[msg.sender].lender != msg.sender || msg.sender == deployer); // Only allow one loan fund per address\n```\n
MEDIUM severity: Vulnerable function: ```\nif (validatorDetails.cap > 0 && newValidatorCap == 0) {\n            // If . ```\nif (validatorDetails.cap > 0 && newValidatorCap == 0) {\n            // If there are active deposits, queue the operator for strategy exit.\n            if (activeDeposits > 0) {\n                -> operatorDetails.queueOperatorStrategyExit(operatorId, BEACON_CHAIN_STRATEGY);\n                .

Vulnerable code:
```\nif (validatorDetails.cap > 0 && newValidatorCap == 0) {\n            // If there are active deposits, queue the operator for strategy exit.\n            if (activeDeposits > 0) {\n                -> operatorDetails.queueOperatorStrategyExit(operatorId, BEACON_CHAIN_STRATEGY);\n                .\n            }\n           .\n        } else if (validatorDetails.cap == 0 && newValidatorCap > 0) {\n           .\n        } else {\n           .\n        }\n```\n
MEDIUM severity: Vulnerable function: ```\nminRoundId=1\nmaxRoundId=1001\n\n-> \n\nminRoundId=1\nmaxRoundId=501\n\n-> . ```\nminRoundId=1\nmaxRoundId=1001\n\n-> \n\nminRoundId=1\nmaxRoundId=501\n\n-> \n\nminRoundId=1\nmaxRoundId=251\n\n-> \n\nminRoundId=1\nmaxRoundId=126\n\n-> \n\nminRoundId=1\nmaxRoundId=63\n\n-> \n\nminRoundId=1\nmaxRoundId=32\n\n-> \n\nminRoundId=1\nmaxRoundId=16\n\n-> \n\nminRoundId=1\nmaxRoundId

Vulnerable code:
```\nminRoundId=1\nmaxRoundId=1001\n\n-> \n\nminRoundId=1\nmaxRoundId=501\n\n-> \n\nminRoundId=1\nmaxRoundId=251\n\n-> \n\nminRoundId=1\nmaxRoundId=126\n\n-> \n\nminRoundId=1\nmaxRoundId=63\n\n-> \n\nminRoundId=1\nmaxRoundId=32\n\n-> \n\nminRoundId=1\nmaxRoundId=16\n\n-> \n\nminRoundId=1\nmaxRoundId=8\n\n-> \n\nminRoundId=1\nmaxRoundId=4\n\n-> \n\nminRoundId=1\nmaxRoundId=2\n\nNow the loop terminates because\nminRoundId + 1 !< maxRoundId\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction changeMaintainer(\n bytes calldata password,\n bytes32 newPasswordHash,\n address newM. ```\nfunction changeMaintainer(\n bytes calldata password,\n bytes32 newPasswordHash,\n address newMaintainer\n)\n external\n virtual\n override\n onlyPortal\n whenNotPaused\n returns (bool success)\n{\n require(\n SELF.PASSWORD\_HASH == bytes32(0) ||\n SELF.PASSWORD\_HASH ==\n keccak256(abi.encodeP

Vulnerable code:
```\nfunction changeMaintainer(\n bytes calldata password,\n bytes32 newPasswordHash,\n address newMaintainer\n)\n external\n virtual\n override\n onlyPortal\n whenNotPaused\n returns (bool success)\n{\n require(\n SELF.PASSWORD\_HASH == bytes32(0) ||\n SELF.PASSWORD\_HASH ==\n keccak256(abi.encodePacked(SELF.ID, password))\n );\n SELF.PASSWORD\_HASH = newPasswordHash;\n\n \_refreshSenate(newMaintainer);\n\n success = true;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function updateTrust(address borrower, uint96 trustAmount) external onlyMember(msg.sender) . ```\n    function updateTrust(address borrower, uint96 trustAmount) external onlyMember(msg.sender) whenNotPaused {\n// rest of code\n            uint256 voucheesLength = vouchees[staker].length;\n            if (voucheesLength >= maxVouchers) revert MaxVouchees();\n\n\n            uint256 voucherIn

Vulnerable code:
```\n    function updateTrust(address borrower, uint96 trustAmount) external onlyMember(msg.sender) whenNotPaused {\n// rest of code\n            uint256 voucheesLength = vouchees[staker].length;\n            if (voucheesLength >= maxVouchers) revert MaxVouchees();\n\n\n            uint256 voucherIndex = vouchers[borrower].length;\n            voucherIndexes[borrower][staker] = Index(true, uint128(voucherIndex));\n            vouchers[borrower].push(Vouch(staker, trustAmount, 0, 0)); /**** don't check maxVouchers****/\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction recreateBlockheaders(uint \_blockNumber, bytes[] memory \_blockheaders) public {\n\n  . ```\nfunction recreateBlockheaders(uint \_blockNumber, bytes[] memory \_blockheaders) public {\n\n    bytes32 currentBlockhash = blockhashMapping[\_blockNumber];\n    require(currentBlockhash != 0x0, "parentBlock is not available");\n\n    bytes32 calculatedHash = reCalculateBlockheaders(\_blockhead

Vulnerable code:
```\nfunction recreateBlockheaders(uint \_blockNumber, bytes[] memory \_blockheaders) public {\n\n    bytes32 currentBlockhash = blockhashMapping[\_blockNumber];\n    require(currentBlockhash != 0x0, "parentBlock is not available");\n\n    bytes32 calculatedHash = reCalculateBlockheaders(\_blockheaders, currentBlockhash);\n    require(calculatedHash != 0x0, "invalid headers");\n```\n
MEDIUM severity: Vulnerable function: ```\n    function getMedianPriceIfDeviation(\n        uint256[] memory prices_,\n        bytes memor. ```\n    function getMedianPriceIfDeviation(\n        uint256[] memory prices_,\n        bytes memory params_\n    ) public pure returns (uint256) {\n        // Misconfiguration\n        if (prices_.length < 3) revert SimpleStrategy_PriceCountInvalid(prices_.length, 3);\n\n237     uint256[] memory n

Vulnerable code:
```\n    function getMedianPriceIfDeviation(\n        uint256[] memory prices_,\n        bytes memory params_\n    ) public pure returns (uint256) {\n        // Misconfiguration\n        if (prices_.length < 3) revert SimpleStrategy_PriceCountInvalid(prices_.length, 3);\n\n237     uint256[] memory nonZeroPrices = _getNonZeroArray(prices_);\n\n        // Return 0 if all prices are 0\n        if (nonZeroPrices.length == 0) return 0;\n\n        // Cache first non-zero price since the array is sorted in place\n        uint256 firstNonZeroPrice = nonZeroPrices[0];\n\n        // If there are not enough non-zero prices to calculate a median, return the first non-zero price\n246     if (nonZeroPrices.length < 3) return firstNonZeroPrice;\n\n        uint256[] memory sortedPrices = nonZeroPrices.sort();\n\n        // Get the average and median and abort if there's a problem\n        // The following two values are guaranteed to not be 0 since sortedPrices only contains non-zero values and has a length of 3+\n        uint256 averagePrice = _getAveragePrice(sortedPrices);\n253     uint256 medianPrice = _getMedianPrice(sortedPrices);\n\n        if (params_.length != DEVIATION_PARAMS_LENGTH) revert SimpleStrategy_ParamsInvalid(params_);\n        uint256 deviationBps = abi.decode(params_, (uint256));\n        if (deviationBps <= DEVIATION_MIN || deviationBps >= DEVIATION_MAX)\n            revert SimpleStrategy_ParamsInvalid(params_);\n\n        // Check the deviation of the minimum from the average\n        uint256 minPrice = sortedPrices[0];\n262     if (((averagePrice - minPrice) * 10000) / averagePrice > deviationBps) return medianPrice;\n\n        // Check the deviation of the maximum from the average\n        uint256 maxPrice = sortedPrices[sortedPrices.length - 1];\n266     if (((maxPrice - averagePrice) * 10000) / averagePrice > deviationBps) return medianPrice;\n\n        // Otherwise, return the first non-zero value\n        return firstNonZeroPrice;\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n contract UXDGovernor is\n    ReentrancyGuard,\n    Governor,\n    Governor. ```\n contract UXDGovernor is\n    ReentrancyGuard,\n    Governor,\n    GovernorVotes,\n    GovernorVotesQuorumFraction,\n    GovernorTimelockControl,\n    GovernorCountingSimple,\n    GovernorSettings\n```\n

Vulnerable code:
```\n contract UXDGovernor is\n    ReentrancyGuard,\n    Governor,\n    GovernorVotes,\n    GovernorVotesQuorumFraction,\n    GovernorTimelockControl,\n    GovernorCountingSimple,\n    GovernorSettings\n```\n
HIGH severity: Vulnerable function: ```\nif (!router.withdraws(transferId)) {\n    router.withdraw(\_request, \_sigs. ```\nif (!router.withdraws(transferId)) {\n    router.withdraw(\_request, \_sigs, \_signers, \_powers);\n}\n```\n

Vulnerable code:
```\nif (!router.withdraws(transferId)) {\n    router.withdraw(\_request, \_sigs, \_signers, \_powers);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction \_poolBalanceIsSufficient(address \_collateral) internal view returns (bool) {\n    re. ```\nfunction \_poolBalanceIsSufficient(address \_collateral) internal view returns (bool) {\n    return controller.balanceOf(address(reserve), \_collateral) >= collateralsToBeClaimed[\_collateral];\n}\n```\n

Vulnerable code:
```\nfunction \_poolBalanceIsSufficient(address \_collateral) internal view returns (bool) {\n    return controller.balanceOf(address(reserve), \_collateral) >= collateralsToBeClaimed[\_collateral];\n}\n```\n
HIGH severity: Vulnerable function: ```\n  if (feeToken == ETH) \n   {uint256 totalFee = (gasUsed + GAS_OVERHEAD_NAT. ```\n  if (feeToken == ETH) \n   {uint256 totalFee = (gasUsed + GAS_OVERHEAD_NATIVE) * tx.gasprice;\n     totalFee = _applyMultiplier(totalFee);\n       return (totalFee, recipient, TokenTransfer._nativeTransferExec(recipient, totalFee));\n            } else {uint256 totalFee = (gasUsed + GAS_OVERHE

Vulnerable code:
```\n  if (feeToken == ETH) \n   {uint256 totalFee = (gasUsed + GAS_OVERHEAD_NATIVE) * tx.gasprice;\n     totalFee = _applyMultiplier(totalFee);\n       return (totalFee, recipient, TokenTransfer._nativeTransferExec(recipient, totalFee));\n            } else {uint256 totalFee = (gasUsed + GAS_OVERHEAD_ERC20) * tx.gasprice;\n      // Convert fee amount value in fee tokenuint256 feeToCollect =PriceFeedManager(_addressProvider.priceFeedManager()).getTokenXPriceInY(totalFee, ETH, feeToken);\n  feeToCollect = _applyMultiplier(feeToCollect);\n return (feeToCollect, recipient, TokenTransfer._erc20TransferExec(feeToken, recipient, feeToCollect));}\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 currentThreshold = safe.getThreshold();\nuint256 newThreshold;\nuin. ```\nuint256 currentThreshold = safe.getThreshold();\nuint256 newThreshold;\nuint256 target = targetThreshold; // save SLOADs\n\nif (validSignerCount <= target && validSignerCount != currentThreshold) {\n    newThreshold = validSignerCount;\n} else if (validSignerCount > target && currentThreshold <

Vulnerable code:
```\nuint256 currentThreshold = safe.getThreshold();\nuint256 newThreshold;\nuint256 target = targetThreshold; // save SLOADs\n\nif (validSignerCount <= target && validSignerCount != currentThreshold) {\n    newThreshold = validSignerCount;\n} else if (validSignerCount > target && currentThreshold < target) {\n    newThreshold = target;\n}\nif (newThreshold > 0) { // rest of code update safe threshold // rest of code }\n```\n
HIGH severity: Vulnerable function: ```\n    function claimProceeds(\n        uint96 lotId_,\n        bytes calldata callbackData_\n    . ```\n    function claimProceeds(\n        uint96 lotId_,\n        bytes calldata callbackData_\n    ) external override nonReentrant {\n        \n        // rest of code\n\n        (uint96 purchased_, uint96 sold_, uint96 payoutSent_) =\n            _getModuleForId(lotId_).claimProceeds(lotId_);\n\n

Vulnerable code:
```\n    function claimProceeds(\n        uint96 lotId_,\n        bytes calldata callbackData_\n    ) external override nonReentrant {\n        \n        // rest of code\n\n        (uint96 purchased_, uint96 sold_, uint96 payoutSent_) =\n            _getModuleForId(lotId_).claimProceeds(lotId_);\n\n        // rest of code.\n\n        // Refund any unused capacity and curator fees to the address dictated by the callbacks address\n        // By this stage, a partial payout (if applicable) and curator fees have been paid, leaving only the payout amount (`totalOut`) remaining.\n        uint96 prefundingRefund = routing.funding + payoutSent_ - sold_;\n        unchecked {\n            routing.funding -= prefundingRefund;\n        }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function executeModule(ITOFT.Module _module, bytes memory _data, bool _forwardRevert)\n    . ```\n    function executeModule(ITOFT.Module _module, bytes memory _data, bool _forwardRevert)\n        external\n        payable\n      whenNotPaused\n        returns (bytes memory returnData)\n    {\n// rest of code\n    function sendPacket(LZSendParam calldata _lzSendParam, bytes calldata _compos

Vulnerable code:
```\n    function executeModule(ITOFT.Module _module, bytes memory _data, bool _forwardRevert)\n        external\n        payable\n      whenNotPaused\n        returns (bytes memory returnData)\n    {\n// rest of code\n    function sendPacket(LZSendParam calldata _lzSendParam, bytes calldata _composeMsg)\n        public\n        payable\n      whenNotPaused\n        returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt)\n    {\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction changeHatToggle(uint256 _hatId, address _newToggle) external {\n    if (_newToggle == . ```\nfunction changeHatToggle(uint256 _hatId, address _newToggle) external {\n    if (_newToggle == address(0)) revert ZeroAddress();\n\n    _checkAdmin(_hatId);\n    Hat storage hat = _hats[_hatId];\n\n    if (!_isMutable(hat)) {\n        revert Immutable();\n    }\n\n    hat.toggle = _newToggle;\n

Vulnerable code:
```\nfunction changeHatToggle(uint256 _hatId, address _newToggle) external {\n    if (_newToggle == address(0)) revert ZeroAddress();\n\n    _checkAdmin(_hatId);\n    Hat storage hat = _hats[_hatId];\n\n    if (!_isMutable(hat)) {\n        revert Immutable();\n    }\n\n    hat.toggle = _newToggle;\n\n    emit HatToggleChanged(_hatId, _newToggle);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction governorAddPoolMultiplier(\n    uint256 \_pid,\n    uint64 lockLength,\n    uint64 new. ```\nfunction governorAddPoolMultiplier(\n    uint256 \_pid,\n    uint64 lockLength,\n    uint64 newRewardsMultiplier\n) external onlyGovernor {\n    PoolInfo storage pool = poolInfo[\_pid];\n    uint256 currentMultiplier = rewardMultipliers[\_pid][lockLength];\n    // if the new multplier is less t

Vulnerable code:
```\nfunction governorAddPoolMultiplier(\n    uint256 \_pid,\n    uint64 lockLength,\n    uint64 newRewardsMultiplier\n) external onlyGovernor {\n    PoolInfo storage pool = poolInfo[\_pid];\n    uint256 currentMultiplier = rewardMultipliers[\_pid][lockLength];\n    // if the new multplier is less than the current multiplier,\n    // then, you need to unlock the pool to allow users to withdraw\n    if (newRewardsMultiplier < currentMultiplier) {\n        pool.unlocked = true;\n    }\n    rewardMultipliers[\_pid][lockLength] = newRewardsMultiplier;\n\n    emit LogPoolMultiplier(\_pid, lockLength, newRewardsMultiplier);\n}\n```\n
HIGH severity: Vulnerable function: ```\n   function onUndelegate(address delegator, uint amount) external {\n       // limitation only . ```\n   function onUndelegate(address delegator, uint amount) external {\n       // limitation only applies to the operator, others can always undelegate\n       if (delegator != owner) { return; }\n\n       uint actualAmount = amount < balanceOf(owner) ? amount : balanceOf(owner); //@audit amount:D

Vulnerable code:
```\n   function onUndelegate(address delegator, uint amount) external {\n       // limitation only applies to the operator, others can always undelegate\n       if (delegator != owner) { return; }\n\n       uint actualAmount = amount < balanceOf(owner) ? amount : balanceOf(owner); //@audit amount:DATA, balanceOf:Operator\n       uint balanceAfter = balanceOf(owner) - actualAmount;\n       uint totalSupplyAfter = totalSupply() - actualAmount;\n       require(1 ether * balanceAfter >= totalSupplyAfter * streamrConfig.minimumSelfDelegationFraction(), "error_selfDelegationTooLow");\n   }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction requestWithdraw(\n    Types.State storage state,\n    address from,\n    uint256 prima. ```\nfunction requestWithdraw(\n    Types.State storage state,\n    address from,\n    uint256 primaryAmount,\n    uint256 secondaryAmount\n)\n    external\n{\n    require(isWithdrawValid(state, msg.sender, from, primaryAmount, secondaryAmount), Errors.WITHDRAW_INVALID);\n    state.pendingPrimaryWit

Vulnerable code:
```\nfunction requestWithdraw(\n    Types.State storage state,\n    address from,\n    uint256 primaryAmount,\n    uint256 secondaryAmount\n)\n    external\n{\n    require(isWithdrawValid(state, msg.sender, from, primaryAmount, secondaryAmount), Errors.WITHDRAW_INVALID);\n    state.pendingPrimaryWithdraw[msg.sender] = primaryAmount;\n    state.pendingSecondaryWithdraw[msg.sender] = secondaryAmount;\n    state.withdrawExecutionTimestamp[msg.sender] = block.timestamp + state.withdrawTimeLock;\n    emit RequestWithdraw(msg.sender, primaryAmount, secondaryAmount, state.withdrawExecutionTimestamp[msg.sender]);\n}\n```\n
HIGH severity: Vulnerable function: ```\n      if (isLong) {\n          uint swapFeeBP = getSwapFeeBP(isLong, true, . ```\n      if (isLong) {\n          uint swapFeeBP = getSwapFeeBP(isLong, true, collateralDelta);\n           collateralDelta = (collateralDelta * (BASIS_POINTS_DIVISOR + swapFeeBP)) / BASIS_POINTS_DIVISOR;\n      }\n      // add margin fee\n      // when we increase position, fee always got deducte

Vulnerable code:
```\n      if (isLong) {\n          uint swapFeeBP = getSwapFeeBP(isLong, true, collateralDelta);\n           collateralDelta = (collateralDelta * (BASIS_POINTS_DIVISOR + swapFeeBP)) / BASIS_POINTS_DIVISOR;\n      }\n      // add margin fee\n      // when we increase position, fee always got deducted from collateral\n          collateralDelta += _getPositionFee(currentPos.size, sizeDelta, currentPos.entryFundingRate);\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction convertToPeUSD(address user, uint256 eusdAmount) public {\n require(\_msgSender() == u. ```\nfunction convertToPeUSD(address user, uint256 eusdAmount) public {\n require(\_msgSender() == user || \_msgSender() == address(this), "MDM");\n require(eusdAmount != 0, "ZA");\n require(EUSD.balanceOf(address(this)) + eusdAmount <= configurator.getEUSDMaxLocked(),"ESL");\n```\n

Vulnerable code:
```\nfunction convertToPeUSD(address user, uint256 eusdAmount) public {\n require(\_msgSender() == user || \_msgSender() == address(this), "MDM");\n require(eusdAmount != 0, "ZA");\n require(EUSD.balanceOf(address(this)) + eusdAmount <= configurator.getEUSDMaxLocked(),"ESL");\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _claimRewards(\n    address gauge,\n    address defaultToken,\n    address sendTo\n) i. ```\nfunction _claimRewards(\n    address gauge,\n    address defaultToken,\n    address sendTo\n) internal returns (uint256[] memory amounts, address[] memory tokens) {\n    // rest of code \n\n    // Record balances before claiming\n    for (uint256 i = 0; i < totalLength; ++i) {\n        // The t

Vulnerable code:
```\nfunction _claimRewards(\n    address gauge,\n    address defaultToken,\n    address sendTo\n) internal returns (uint256[] memory amounts, address[] memory tokens) {\n    // rest of code \n\n    // Record balances before claiming\n    for (uint256 i = 0; i < totalLength; ++i) {\n        // The totalSupply check is used to identify stash tokens, which can\n        // substitute as rewardToken but lack a "balanceOf()"\n        if (IERC20(rewardTokens[i]).totalSupply() > 0) {\n            balancesBefore[i] = IERC20(rewardTokens[i]).balanceOf(account);\n        }\n    }\n\n    // Claim rewards\n    bool result = rewardPool.getReward(account, /*_claimExtras*/ true);\n    if (!result) {\n        revert RewardAdapter.ClaimRewardsFailed();\n    }\n\n    // Record balances after claiming and calculate amounts claimed\n    for (uint256 i = 0; i < totalLength; ++i) {\n        uint256 balance = 0;\n        // Same check for "stash tokens"\n        if (IERC20(rewardTokens[i]).totalSupply() > 0) {\n            balance = IERC20(rewardTokens[i]).balanceOf(account);\n        }\n\n        amountsClaimed[i] = balance - balancesBefore[i];\n\n        if (sendTo != address(this) && amountsClaimed[i] > 0) {\n            IERC20(rewardTokens[i]).safeTransfer(sendTo, amountsClaimed[i]);\n        }\n    }\n\n    RewardAdapter.emitRewardsClaimed(rewardTokens, amountsClaimed);\n\n    return (amountsClaimed, rewardTokens);\n}\n```\n
HIGH severity: Vulnerable function: ```\nuint256 currentSharePrice = ethStEthPool.get\_virtual\_price();\nif (curren. ```\nuint256 currentSharePrice = ethStEthPool.get\_virtual\_price();\nif (currentSharePrice > prevSharePrice) {\n    // claim any gain on lp token yields\n    uint256 contractLpTokenBalance = lpToken.balanceOf(address(this));\n    uint256 totalLpBalance = contractLpTokenBalance +\n        baseReward

Vulnerable code:
```\nuint256 currentSharePrice = ethStEthPool.get\_virtual\_price();\nif (currentSharePrice > prevSharePrice) {\n    // claim any gain on lp token yields\n    uint256 contractLpTokenBalance = lpToken.balanceOf(address(this));\n    uint256 totalLpBalance = contractLpTokenBalance +\n        baseRewardPool.balanceOf(address(this));\n    uint256 yieldEarned = (currentSharePrice - prevSharePrice) \*\n        totalLpBalance;\n```\n