Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\n        if (validSignerCount == currentSignerCount) {\n            newSigne. ```\n        if (validSignerCount == currentSignerCount) {\n            newSignerCount = currentSignerCount;\n        } else {\n            newSignerCount = currentSignerCount - 1;\n        }\n```\n

Vulnerable code:
```\n        if (validSignerCount == currentSignerCount) {\n            newSignerCount = currentSignerCount;\n        } else {\n            newSignerCount = currentSignerCount - 1;\n        }\n```\n
HIGH severity: Vulnerable function: ```\n    uint256 received;\n    {\n        // Get the starting balance of the pr. ```\n    uint256 received;\n    {\n        // Get the starting balance of the principal token\n        uint256 starting = token.balanceOf(address(this));\n\n        // Swap those tokens for the principal tokens\n        ISensePeriphery(x).swapUnderlyingForPTs(adapter, s, lent, r);\n\n        // Calc

Vulnerable code:
```\n    uint256 received;\n    {\n        // Get the starting balance of the principal token\n        uint256 starting = token.balanceOf(address(this));\n\n        // Swap those tokens for the principal tokens\n        ISensePeriphery(x).swapUnderlyingForPTs(adapter, s, lent, r);\n\n        // Calculate number of principal tokens received in the swap\n        received = token.balanceOf(address(this)) - starting;\n\n        // Verify that we received the principal tokens\n        if (received < r) {\n            revert Exception(11, 0, 0, address(0), address(0));\n        }\n    }\n\n    // Mint the Illuminate tokens based on the returned amount\n    IERC5095(principalToken(u, m)).authMint(msg.sender, received);\n```\n
MEDIUM severity: Vulnerable function: ```\n    function createGauge4pool(\n       address _4pool,\n          address _dai,\n            ad. ```\n    function createGauge4pool(\n       address _4pool,\n          address _dai,\n            address _usdc,\n               address _usdt,\n             address _cash\n       ) external returns (address) {\n```\n

Vulnerable code:
```\n    function createGauge4pool(\n       address _4pool,\n          address _dai,\n            address _usdc,\n               address _usdt,\n             address _cash\n       ) external returns (address) {\n```\n
HIGH severity: Vulnerable function: ```\nfunction claim(address user) external returns (uint256) {\n    drop();\n    \_captureNewTokensF. ```\nfunction claim(address user) external returns (uint256) {\n    drop();\n    \_captureNewTokensForUser(user);\n    uint256 balance = userStates[user].balance;\n    userStates[user].balance = 0;\n    totalUnclaimed = uint256(totalUnclaimed).sub(balance).toUint112();\n\n    // Transfer asset/rewar

Vulnerable code:
```\nfunction claim(address user) external returns (uint256) {\n    drop();\n    \_captureNewTokensForUser(user);\n    uint256 balance = userStates[user].balance;\n    userStates[user].balance = 0;\n    totalUnclaimed = uint256(totalUnclaimed).sub(balance).toUint112();\n\n    // Transfer asset/reward token to user\n    asset.transfer(user, balance);\n\n    // Emit Claimed\n    emit Claimed(user, balance);\n\n    return balance;\n}\n```\n
HIGH severity: Vulnerable function: ```\n/**\n * @title GeoEmaAndCumSmaPump\n * @author Publius\n * @notice Stores a. ```\n/**\n * @title GeoEmaAndCumSmaPump\n * @author Publius\n * @notice Stores a geometric EMA and cumulative geometric SMA for each reserve.\n * @dev A Pump designed for use in Beanstalk with 2 tokens.\n *\n * This Pump has 3 main features:\n *  1. Multi-block MEV resistence reserves\n *  2. MEV-re

Vulnerable code:
```\n/**\n * @title GeoEmaAndCumSmaPump\n * @author Publius\n * @notice Stores a geometric EMA and cumulative geometric SMA for each reserve.\n * @dev A Pump designed for use in Beanstalk with 2 tokens.\n *\n * This Pump has 3 main features:\n *  1. Multi-block MEV resistence reserves\n *  2. MEV-resistant Geometric EMA intended for instantaneous reserve queries\n *  3. MEV-resistant Cumulative Geometric intended for SMA reserve queries\n *\n * Note: If an `update` call is made with a reserve of 0, the Geometric mean oracles will be set to 0.\n * Each Well is responsible for ensuring that an `update` call cannot be made with a reserve of 0.\n */\n```\n
MEDIUM severity: Vulnerable function: ```\n  /**\n    * @notice @inheritdoc GMXVault\n    * @param self GMXTypes.Store\n    * @param isNat. ```\n  /**\n    * @notice @inheritdoc GMXVault\n    * @param self GMXTypes.Store\n    * @param isNative Boolean as to whether user is depositing native asset (e.g. ETH, AVAX, etc.)\n  */\n  function deposit(\n    GMXTypes.Store storage self,\n    GMXTypes.DepositParams memory dp,\n    bool isNative\

Vulnerable code:
```\n  /**\n    * @notice @inheritdoc GMXVault\n    * @param self GMXTypes.Store\n    * @param isNative Boolean as to whether user is depositing native asset (e.g. ETH, AVAX, etc.)\n  */\n  function deposit(\n    GMXTypes.Store storage self,\n    GMXTypes.DepositParams memory dp,\n    bool isNative\n  ) external {\n    // rest of code\n    self.status = GMXTypes.Status.Deposit;\n\n    self.vault.mintFee();    ///<----------------------- @audit\n    // rest of code\n```\n
HIGH severity: Vulnerable function: ```\n    function repayAccountPrimeDebtAtSettlement(\n        PrimeRate memory pr,\n        VaultSta. ```\n    function repayAccountPrimeDebtAtSettlement(\n        PrimeRate memory pr,\n        VaultStateStorage storage primeVaultState,\n        uint16 currencyId,\n        address vault,\n        address account,\n        int256 accountPrimeCash,\n        int256 accountPrimeStorageValue\n    ) inter

Vulnerable code:
```\n    function repayAccountPrimeDebtAtSettlement(\n        PrimeRate memory pr,\n        VaultStateStorage storage primeVaultState,\n        uint16 currencyId,\n        address vault,\n        address account,\n        int256 accountPrimeCash,\n        int256 accountPrimeStorageValue\n    ) internal returns (int256 finalPrimeDebtStorageValue, bool didTransfer) {\n// rest of code\n\n            if (netPrimeDebtRepaid < accountPrimeStorageValue) {\n                // If the net debt change is greater than the debt held by the account, then only\n                // decrease the total prime debt by what is held by the account. The residual amount\n                // will be refunded to the account via a direct transfer.\n                netPrimeDebtChange = accountPrimeStorageValue;\n                finalPrimeDebtStorageValue = 0;\n\n                int256 primeCashRefund = pr.convertFromUnderlying(\n                    pr.convertDebtStorageToUnderlying(netPrimeDebtChange.sub(accountPrimeStorageValue)) //<--------@audit always ==0\n                );\n                TokenHandler.withdrawPrimeCash(\n                    account, currencyId, primeCashRefund, pr, false // ETH will be transferred natively\n                );\n                didTransfer = true;\n            } else {\n```\n
MEDIUM severity: Vulnerable function: ```\n    function setDefaults(uint32[6] memory defaults_) external override requiresAuth {\n        . ```\n    function setDefaults(uint32[6] memory defaults_) external override requiresAuth {\n        // Restricted to authorized addresses\n        defaultTuneInterval = defaults_[0];\n        defaultTuneAdjustment = defaults_[1];\n        minDebtDecayInterval = defaults_[2];\n        minDepositInter

Vulnerable code:
```\n    function setDefaults(uint32[6] memory defaults_) external override requiresAuth {\n        // Restricted to authorized addresses\n        defaultTuneInterval = defaults_[0];\n        defaultTuneAdjustment = defaults_[1];\n        minDebtDecayInterval = defaults_[2];\n        minDepositInterval = defaults_[3];\n        minMarketDuration = defaults_[4];\n        minDebtBuffer = defaults_[5];\n    }\n```\n
HIGH severity: Vulnerable function: ```\nFile: TwoTokenPoolUtils.sol\n    function _getTimeWeightedPrimaryBalance(\n        TwoTokenPool. ```\nFile: TwoTokenPoolUtils.sol\n    function _getTimeWeightedPrimaryBalance(\n        TwoTokenPoolContext memory poolContext,\n        StrategyContext memory strategyContext,\n        uint256 poolClaim,\n        uint256 oraclePrice,\n        uint256 spotPrice\n    ) internal view returns (uint256 

Vulnerable code:
```\nFile: TwoTokenPoolUtils.sol\n    function _getTimeWeightedPrimaryBalance(\n        TwoTokenPoolContext memory poolContext,\n        StrategyContext memory strategyContext,\n        uint256 poolClaim,\n        uint256 oraclePrice,\n        uint256 spotPrice\n    ) internal view returns (uint256 primaryAmount) {\n        // Make sure spot price is within oracleDeviationLimit of pairPrice\n        strategyContext._checkPriceLimit(oraclePrice, spotPrice);\n        \n        // Get shares of primary and secondary balances with the provided poolClaim\n        uint256 totalSupply = poolContext.poolToken.totalSupply();\n        uint256 primaryBalance = poolContext.primaryBalance * poolClaim / totalSupply;\n        uint256 secondaryBalance = poolContext.secondaryBalance * poolClaim / totalSupply;\n\n        // Value the secondary balance in terms of the primary token using the oraclePairPrice\n        uint256 secondaryAmountInPrimary = secondaryBalance * strategyContext.poolClaimPrecision / oraclePrice;\n\n        // Make sure primaryAmount is reported in primaryPrecision\n        uint256 primaryPrecision = 10 ** poolContext.primaryDecimals;\n        primaryAmount = (primaryBalance + secondaryAmountInPrimary) * primaryPrecision / strategyContext.poolClaimPrecision;\n    }\n```\n
HIGH severity: Vulnerable function: ```\nFile: StrategyUtils.sol\n    /// @notice Converts strategy tokens to BPT\n    function _convert. ```\nFile: StrategyUtils.sol\n    /// @notice Converts strategy tokens to BPT\n    function _convertStrategyTokensToBPTClaim(StrategyContext memory context, uint256 strategyTokenAmount)\n        internal pure returns (uint256 bptClaim) {\n        require(strategyTokenAmount <= context.vaultState.tot

Vulnerable code:
```\nFile: StrategyUtils.sol\n    /// @notice Converts strategy tokens to BPT\n    function _convertStrategyTokensToBPTClaim(StrategyContext memory context, uint256 strategyTokenAmount)\n        internal pure returns (uint256 bptClaim) {\n        require(strategyTokenAmount <= context.vaultState.totalStrategyTokenGlobal);\n        if (context.vaultState.totalStrategyTokenGlobal > 0) {\n            bptClaim = (strategyTokenAmount * context.vaultState.totalBPTHeld) / context.vaultState.totalStrategyTokenGlobal;\n        }\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nreceive() external payable {\n    (bool success,) = address(rewardDistribut. ```\nreceive() external payable {\n    (bool success,) = address(rewardDistributor()).call{value: msg.value}('');\n    require(success);\n}\n```\n

Vulnerable code:
```\nreceive() external payable {\n    (bool success,) = address(rewardDistributor()).call{value: msg.value}('');\n    require(success);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n           uint256 amountToSend = _send.amountLD > _options.tapAmount ? _op. ```\n           uint256 amountToSend = _send.amountLD > _options.tapAmount ? _options.tapAmount : _send.amountLD;\n                if (_send.minAmountLD > amountToSend) {\n                    _send.minAmountLD = amountToSend;\n                }\n```\n

Vulnerable code:
```\n           uint256 amountToSend = _send.amountLD > _options.tapAmount ? _options.tapAmount : _send.amountLD;\n                if (_send.minAmountLD > amountToSend) {\n                    _send.minAmountLD = amountToSend;\n                }\n```\n
HIGH severity: Vulnerable function: ```\nif (!ASTARIA_ROUTER.isValidRefinance(lienData[lienId], ld)) {\n  revert Inv. ```\nif (!ASTARIA_ROUTER.isValidRefinance(lienData[lienId], ld)) {\n  revert InvalidRefinance();\n}\n```\n

Vulnerable code:
```\nif (!ASTARIA_ROUTER.isValidRefinance(lienData[lienId], ld)) {\n  revert InvalidRefinance();\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction initialize\_1(\n address \_admin,\n address \_treasury,\n address \_depositContract,\n. ```\nfunction initialize\_1(\n address \_admin,\n address \_treasury,\n address \_depositContract,\n address \_elDispatcher,\n address \_clDispatcher,\n address \_feeRecipientImplementation,\n uint256 \_globalFee,\n uint256 \_operatorFee,\n uint256 globalCommissionLimitBPS,\n uint256 operatorCommiss

Vulnerable code:
```\nfunction initialize\_1(\n address \_admin,\n address \_treasury,\n address \_depositContract,\n address \_elDispatcher,\n address \_clDispatcher,\n address \_feeRecipientImplementation,\n uint256 \_globalFee,\n uint256 \_operatorFee,\n uint256 globalCommissionLimitBPS,\n uint256 operatorCommissionLimitBPS\n) external init(1) {\n```\n
MEDIUM severity: Vulnerable function: ```\n    function commitRequested(uint256 versionIndex, bytes calldata updateData)\n        public\n. ```\n    function commitRequested(uint256 versionIndex, bytes calldata updateData)\n        public\n        payable\n        keep(KEEPER_REWARD_PREMIUM, KEEPER_BUFFER, updateData, "")\n    {\n// rest of code\n\n      if (pythPrice.publishTime <= lastCommittedPublishTime) revert PythOracleNonIncreasi

Vulnerable code:
```\n    function commitRequested(uint256 versionIndex, bytes calldata updateData)\n        public\n        payable\n        keep(KEEPER_REWARD_PREMIUM, KEEPER_BUFFER, updateData, "")\n    {\n// rest of code\n\n      if (pythPrice.publishTime <= lastCommittedPublishTime) revert PythOracleNonIncreasingPublishTimes();\n        lastCommittedPublishTime = pythPrice.publishTime;\n// rest of code\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: MetaStable2TokenAuraHelper.sol\n    function reinvestReward(\n        MetaStable2TokenAur. ```\nFile: MetaStable2TokenAuraHelper.sol\n    function reinvestReward(\n        MetaStable2TokenAuraStrategyContext calldata context,\n        ReinvestRewardParams calldata params\n    ) external {\n```\n

Vulnerable code:
```\nFile: MetaStable2TokenAuraHelper.sol\n    function reinvestReward(\n        MetaStable2TokenAuraStrategyContext calldata context,\n        ReinvestRewardParams calldata params\n    ) external {\n```\n
HIGH severity: Vulnerable function: ```\nfunction testExploitTransferOut() public {\n    uint256 collateralPrice = 1000e8;\n\n    vm.sta. ```\nfunction testExploitTransferOut() public {\n    uint256 collateralPrice = 1000e8;\n\n    vm.startPrank(alice);\n\n    uint256 balance = WETH.balanceOf(alice);\n    console2.log("alice balance", balance);\n    \n    (uint256 minFillPrice, ) = oracleModProxy.getPrice();\n\n    // Announce order t

Vulnerable code:
```\nfunction testExploitTransferOut() public {\n    uint256 collateralPrice = 1000e8;\n\n    vm.startPrank(alice);\n\n    uint256 balance = WETH.balanceOf(alice);\n    console2.log("alice balance", balance);\n    \n    (uint256 minFillPrice, ) = oracleModProxy.getPrice();\n\n    // Announce order through delayed orders to lock tokenId\n    delayedOrderProxy.announceLeverageClose(\n        tokenId,\n        minFillPrice - 100, // add some slippage\n        mockKeeperFee.getKeeperFee()\n    );\n    \n    // Announce limit order to lock tokenId\n    limitOrderProxy.announceLimitOrder({\n        tokenId: tokenId,\n        priceLowerThreshold: 900e18,\n        priceUpperThreshold: 1100e18\n    });\n    \n    // Cancel limit order to unlock tokenId\n    limitOrderProxy.cancelLimitOrder(tokenId);\n    \n    balance = WETH.balanceOf(alice);\n    console2.log("alice after creating two orders", balance);\n\n    // TokenId is unlocked and can be transferred while the delayed order is active\n    leverageModProxy.transferFrom(alice, address(0x1), tokenId);\n    console2.log("new owner of position NFT", leverageModProxy.ownerOf(tokenId));\n\n    balance = WETH.balanceOf(alice);\n    console2.log("alice after transfering position NFT out e.g. selling", balance);\n\n    skip(uint256(vaultProxy.minExecutabilityAge())); // must reach minimum executability time\n\n    uint256 oraclePrice = collateralPrice;\n\n    bytes[] memory priceUpdateData = getPriceUpdateData(oraclePrice);\n    delayedOrderProxy.executeOrder{value: 1}(alice, priceUpdateData);\n\n    uint256 finalBalance = WETH.balanceOf(alice);\n    console2.log("alice after executing delayerd order and cashing out profit", finalBalance);\n    console2.log("profit", finalBalance - balance);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 collateralToLiquidateWithoutDiscount = (_debtToLiquidate * (10 ** d. ```\nuint256 collateralToLiquidateWithoutDiscount = (_debtToLiquidate * (10 ** decimals)) / price;\ncollateralToLiquidate = (collateralToLiquidateWithoutDiscount * totalLiquidationDiscount) / Constants.PRECISION;\nif (collateralToLiquidate > _accountCollateral) {\n            collateralToLiquidate =

Vulnerable code:
```\nuint256 collateralToLiquidateWithoutDiscount = (_debtToLiquidate * (10 ** decimals)) / price;\ncollateralToLiquidate = (collateralToLiquidateWithoutDiscount * totalLiquidationDiscount) / Constants.PRECISION;\nif (collateralToLiquidate > _accountCollateral) {\n            collateralToLiquidate = _accountCollateral;\n}\nuint256 liquidationSurcharge = (collateralToLiquidateWithoutDiscount * LIQUIDATION_SURCHARGE) / Constants.PRECISION\n```\n
MEDIUM severity: Vulnerable function: ```\n        if (_isLever) {\n            uint256 netBorrowLimit = _actionInfo.c. ```\n        if (_isLever) {\n            uint256 netBorrowLimit = _actionInfo.collateralValue\n                .preciseMul(maxLtvRaw.mul(10 ** 14))\n                .preciseMul(PreciseUnitMath.preciseUnit().sub(execution.unutilizedLeveragePercentage));\n\n            return netBorrowLimit\n        

Vulnerable code:
```\n        if (_isLever) {\n            uint256 netBorrowLimit = _actionInfo.collateralValue\n                .preciseMul(maxLtvRaw.mul(10 ** 14))\n                .preciseMul(PreciseUnitMath.preciseUnit().sub(execution.unutilizedLeveragePercentage));\n\n            return netBorrowLimit\n                .sub(_actionInfo.borrowValue)\n                .preciseDiv(_actionInfo.collateralPrice);\n        } else {\n            uint256 netRepayLimit = _actionInfo.collateralValue\n                .preciseMul(liquidationThresholdRaw.mul(10 ** 14))\n                .preciseMul(PreciseUnitMath.preciseUnit().sub(execution.unutilizedLeveragePercentage));\n\n            return _actionInfo.collateralBalance\n                .preciseMul(netRepayLimit.sub(_actionInfo.borrowValue)) \n                .preciseDiv(netRepayLimit);\n        \n```\n
MEDIUM severity: Vulnerable function: ```\nIUniV2Router2 internal constant UNIV2_ROUTER = IUniV2Router2(0xE592427A0AEc. ```\nIUniV2Router2 internal constant UNIV2_ROUTER = IUniV2Router2(0xE592427A0AEce92De3Edee1F18E0157C05861564);\n```\n

Vulnerable code:
```\nIUniV2Router2 internal constant UNIV2_ROUTER = IUniV2Router2(0xE592427A0AEce92De3Edee1F18E0157C05861564);\n```\n
MEDIUM severity: Vulnerable function: ```\n/\*\*\n \* @notice Transfers ownership of the contract to a new account (`newOwner`).\n \* Can . ```\n/\*\*\n \* @notice Transfers ownership of the contract to a new account (`newOwner`).\n \* Can only be called by the current owner.\n \*/\nfunction acceptProposedOwner() public virtual onlyOwner {\n  require((block.timestamp - \_proposedTimestamp) > \_delay, "#APO:030");\n  \_setOwner(\_propose

Vulnerable code:
```\n/\*\*\n \* @notice Transfers ownership of the contract to a new account (`newOwner`).\n \* Can only be called by the current owner.\n \*/\nfunction acceptProposedOwner() public virtual onlyOwner {\n  require((block.timestamp - \_proposedTimestamp) > \_delay, "#APO:030");\n  \_setOwner(\_proposed);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction bootstrapMember(string memory _id, string memory _url, address _nodeAddress) override . ```\nfunction bootstrapMember(string memory _id, string memory _url, address _nodeAddress) override external onlyGuardian onlyBootstrapMode onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", address(this)) {\n    // Ok good to go, lets add them\n    RocketDAONodeTrustedPropo

Vulnerable code:
```\nfunction bootstrapMember(string memory _id, string memory _url, address _nodeAddress) override external onlyGuardian onlyBootstrapMode onlyRegisteredNode(_nodeAddress) onlyLatestContract("rocketDAONodeTrusted", address(this)) {\n    // Ok good to go, lets add them\n    RocketDAONodeTrustedProposalsInterface(getContractAddress("rocketDAONodeTrustedProposals")).proposalInvite(_id, _url, _nodeAddress);\n}\n\n\n// Bootstrap mode - Uint Setting\nfunction bootstrapSettingUint(string memory _settingContractName, string memory _settingPath, uint256 _value) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAONodeTrusted", address(this)) {\n    // Ok good to go, lets update the settings\n    RocketDAONodeTrustedProposalsInterface(getContractAddress("rocketDAONodeTrustedProposals")).proposalSettingUint(_settingContractName, _settingPath, _value);\n}\n\n// Bootstrap mode - Bool Setting\nfunction bootstrapSettingBool(string memory _settingContractName, string memory _settingPath, bool _value) override external onlyGuardian onlyBootstrapMode onlyLatestContract("rocketDAONodeTrusted", address(this)) {\n    // Ok good to go, lets update the settings\n    RocketDAONodeTrustedProposalsInterface(getContractAddress("rocketDAONodeTrustedProposals")).proposalSettingBool(_settingContractName, _settingPath, _value);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n(1,400,000 + 2 * 604,800) / 604,800 = 4\n\n4 * 604,800 = 2,419,200\n```\n. ```\n(1,400,000 + 2 * 604,800) / 604,800 = 4\n\n4 * 604,800 = 2,419,200\n```\n

Vulnerable code:
```\n(1,400,000 + 2 * 604,800) / 604,800 = 4\n\n4 * 604,800 = 2,419,200\n```\n
HIGH severity: Vulnerable function: ```\nfunction notifyFor(address account) external {\n    \_notifyFor(account, balanceOf(msg.sender)). ```\nfunction notifyFor(address account) external {\n    \_notifyFor(account, balanceOf(msg.sender));\n}\n```\n

Vulnerable code:
```\nfunction notifyFor(address account) external {\n    \_notifyFor(account, balanceOf(msg.sender));\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n/\*\*\n \* @notice Update reserve to `\_reserve`\n \* @param \_reserve The address of the new r. ```\n/\*\*\n \* @notice Update reserve to `\_reserve`\n \* @param \_reserve The address of the new reserve [pool] contract\n\*/\nfunction updateReserve(Vault \_reserve) external auth(UPDATE\_RESERVE\_ROLE) {\n    require(isContract(\_reserve), ERROR\_CONTRACT\_IS\_EOA);\n\n    \_updateReserve(\_rese

Vulnerable code:
```\n/\*\*\n \* @notice Update reserve to `\_reserve`\n \* @param \_reserve The address of the new reserve [pool] contract\n\*/\nfunction updateReserve(Vault \_reserve) external auth(UPDATE\_RESERVE\_ROLE) {\n    require(isContract(\_reserve), ERROR\_CONTRACT\_IS\_EOA);\n\n    \_updateReserve(\_reserve);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 balTotalSupply = pool.balancerPool.totalSupply();\nuint256[] memory. ```\nuint256 balTotalSupply = pool.balancerPool.totalSupply();\nuint256[] memory balances = new uint256[](_vaultTokens.length);\n// Calculate the proportion of the pool balances owned by the polManager\nif (balTotalSupply != 0) {\n    // Calculate the amount of OHM in the pool owned by the polManage

Vulnerable code:
```\nuint256 balTotalSupply = pool.balancerPool.totalSupply();\nuint256[] memory balances = new uint256[](_vaultTokens.length);\n// Calculate the proportion of the pool balances owned by the polManager\nif (balTotalSupply != 0) {\n    // Calculate the amount of OHM in the pool owned by the polManager\n    // We have to iterate through the tokens array to find the index of OHM\n    uint256 tokenLen = _vaultTokens.length;\n    for (uint256 i; i < tokenLen; ) {\n        uint256 balance = _vaultBalances[i];\n        uint256 polBalance = (balance * balBalance) / balTotalSupply;\n\n\n        balances[i] = polBalance;\n\n\n        unchecked {\n            ++i;\n        }\n    }\n}\n```\n