Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\nFile: BondBaseSDA.sol\n    function payoutFor(\n        uint256 amount_,\n        uint256 id_,\. ```\nFile: BondBaseSDA.sol\n    function payoutFor(\n        uint256 amount_,\n        uint256 id_,\n        address referrer_\n    ) public view override returns (uint256) {\n        // Calculate the payout for the given amount of tokens\n        uint256 fee = amount_.mulDiv(_teller.getFee(referrer

Vulnerable code:
```\nFile: BondBaseSDA.sol\n    function payoutFor(\n        uint256 amount_,\n        uint256 id_,\n        address referrer_\n    ) public view override returns (uint256) {\n        // Calculate the payout for the given amount of tokens\n        uint256 fee = amount_.mulDiv(_teller.getFee(referrer_), 1e5);\n        uint256 payout = (amount_ - fee).mulDiv(markets[id_].scale, marketPrice(id_));\n\n        // Check that the payout is less than or equal to the maximum payout,\n        // Revert if not, otherwise return the payout\n        if (payout > markets[id_].maxPayout) {\n            revert Auctioneer_MaxPayoutExceeded();\n        } else {\n            return payout;\n        }\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function roll (uint256 loanID) external {\n        Loan storage loan = loans[loanID];\n    . ```\n    function roll (uint256 loanID) external {\n        Loan storage loan = loans[loanID];\n        Request memory req = loan.request;\n\n        if (block.timestamp > loan.expiry) \n            revert Default();\n\n        if (!loan.rollable)\n            revert NotRollable();\n\n        uint25

Vulnerable code:
```\n    function roll (uint256 loanID) external {\n        Loan storage loan = loans[loanID];\n        Request memory req = loan.request;\n\n        if (block.timestamp > loan.expiry) \n            revert Default();\n\n        if (!loan.rollable)\n            revert NotRollable();\n\n        uint256 newCollateral = collateralFor(loan.amount, req.loanToCollateral) - loan.collateral;\n        uint256 newDebt = interestFor(loan.amount, req.interest, req.duration);\n\n        loan.amount += newDebt;\n        loan.expiry += req.duration;\n        loan.collateral += newCollateral;\n        \n        collateral.transferFrom(msg.sender, address(this), newCollateral); //@audit 0 amount\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n        uint256 cvgLockAmount = (amount * ysPercentage) / MAX_PERCENTAGE;\n. ```\n        uint256 cvgLockAmount = (amount * ysPercentage) / MAX_PERCENTAGE;\n        uint256 ysTotal = (lockDuration * cvgLockAmount) / MAX_LOCK;\n```\n

Vulnerable code:
```\n        uint256 cvgLockAmount = (amount * ysPercentage) / MAX_PERCENTAGE;\n        uint256 ysTotal = (lockDuration * cvgLockAmount) / MAX_LOCK;\n```\n
MEDIUM severity: Vulnerable function: ```\n    function _executeAutomation( address _wallet, address _subAccount, address _strategy,\n    . ```\n    function _executeAutomation( address _wallet, address _subAccount, address _strategy,\n       Types.Executable[] memory _actionExecs ) internal {\n        uint256 actionLen = _actionExecs.length;\n    if (actionLen == 0) {\n           revert InvalidActions();\n        } else {\n      uint25

Vulnerable code:
```\n    function _executeAutomation( address _wallet, address _subAccount, address _strategy,\n       Types.Executable[] memory _actionExecs ) internal {\n        uint256 actionLen = _actionExecs.length;\n    if (actionLen == 0) {\n           revert InvalidActions();\n        } else {\n      uint256 idx = 0;\n    do {\n    _executeOnSubAccount(_wallet, _subAccount, _strategy,\n    _actionExecs[idx]);\n    unchecked {\n    ++idx;\n            }\n          } while (idx < actionLen);\n        }\n      }\n```\n
MEDIUM severity: Vulnerable function: ```\nrequire(\n    \_balanceOfByPartition[\_from][\_fromPartition] >= \_value,\n. ```\nrequire(\n    \_balanceOfByPartition[\_from][\_fromPartition] >= \_value,\n    EC\_52\_INSUFFICIENT\_BALANCE\n);\n\nbytes32 toPartition = \_fromPartition;\nif (\_data.length >= 64) {\n    toPartition = \_getDestinationPartition(\_fromPartition, \_data);\n}\n\n\_callPreTransferHooks(\n    \_from

Vulnerable code:
```\nrequire(\n    \_balanceOfByPartition[\_from][\_fromPartition] >= \_value,\n    EC\_52\_INSUFFICIENT\_BALANCE\n);\n\nbytes32 toPartition = \_fromPartition;\nif (\_data.length >= 64) {\n    toPartition = \_getDestinationPartition(\_fromPartition, \_data);\n}\n\n\_callPreTransferHooks(\n    \_fromPartition,\n    \_operator,\n    \_from,\n    \_to,\n    \_value,\n    \_data,\n    \_operatorData\n);\n\n\_removeTokenFromPartition(\_from, \_fromPartition, \_value);\n\_transfer(\_from, \_to, \_value);\n\_addTokenToPartition(\_to, toPartition, \_value);\n\n\_callPostTransferHooks(\n    toPartition,\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: CurveAdapter.sol\n    function _exactInSingle(Trade memory trade)\n        internal view . ```\nFile: CurveAdapter.sol\n    function _exactInSingle(Trade memory trade)\n        internal view returns (address target, bytes memory executionCallData)\n    {\n        address sellToken = _getTokenAddress(trade.sellToken);\n        address buyToken = _getTokenAddress(trade.buyToken);\n        I

Vulnerable code:
```\nFile: CurveAdapter.sol\n    function _exactInSingle(Trade memory trade)\n        internal view returns (address target, bytes memory executionCallData)\n    {\n        address sellToken = _getTokenAddress(trade.sellToken);\n        address buyToken = _getTokenAddress(trade.buyToken);\n        ICurvePool pool = ICurvePool(Deployments.CURVE_REGISTRY.find_pool_for_coins(sellToken, buyToken));\n\n        if (address(pool) == address(0)) revert InvalidTrade();\n\n        int128 i = -1;\n        int128 j = -1;\n        for (int128 c = 0; c < MAX_TOKENS; c++) {\n            address coin = pool.coins(uint256(int256(c)));\n            if (coin == sellToken) i = c;\n            if (coin == buyToken) j = c;\n            if (i > -1 && j > -1) break;\n        }\n\n        if (i == -1 || j == -1) revert InvalidTrade();\n\n        return (\n            address(pool),\n            abi.encodeWithSelector(\n                ICurvePool.exchange.selector,\n                i,\n                j,\n                trade.amount,\n                trade.limit\n            )\n        );\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\ngraph BT;\n classDef nogap fill:#f96;\n classDef hasgap fill:#99cc00;\n    . ```\ngraph BT;\n classDef nogap fill:#f96;\n classDef hasgap fill:#99cc00;\n    MetaStable2TokenAuraVault-->MetaStable2TokenVaultMixin:::nogap\n    MetaStable2TokenVaultMixin:::nogap-->TwoTokenPoolMixin:::nogap\n    MetaStable2TokenVaultMixin:::nogap-->BalancerOracleMixin:::nogap\n    TwoTokenPoolMi

Vulnerable code:
```\ngraph BT;\n classDef nogap fill:#f96;\n classDef hasgap fill:#99cc00;\n    MetaStable2TokenAuraVault-->MetaStable2TokenVaultMixin:::nogap\n    MetaStable2TokenVaultMixin:::nogap-->TwoTokenPoolMixin:::nogap\n    MetaStable2TokenVaultMixin:::nogap-->BalancerOracleMixin:::nogap\n    TwoTokenPoolMixin:::nogap-->PoolMixin:::nogap\n    PoolMixin:::nogap-->AuraStakingMixin:::nogap\n    PoolMixin:::nogap-->BalancerStrategyBase;\n    BalancerStrategyBase:::hasgap-->BaseStrategyVault:::hasgap\n    BalancerStrategyBase:::hasgap-->UUPSUpgradeable\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: BondBaseSDA.sol\n        // Circuit breaker. If max debt is breached,. ```\nFile: BondBaseSDA.sol\n        // Circuit breaker. If max debt is breached, the market is closed\n        if (term.maxDebt < market.totalDebt) {\n            _close(id_);\n        } else {\n            // If market will continue, the control variable is tuned to to expend remaining capacity ove

Vulnerable code:
```\nFile: BondBaseSDA.sol\n        // Circuit breaker. If max debt is breached, the market is closed\n        if (term.maxDebt < market.totalDebt) {\n            _close(id_);\n        } else {\n            // If market will continue, the control variable is tuned to to expend remaining capacity over remaining market duration\n            _tune(id_, currentTime, price);\n        }\n```\n
HIGH severity: Vulnerable function: ```\npoolInfo.accTidalPerShare = poolInfo.accTidalPerShare.add(\n amount\_.mul(S. ```\npoolInfo.accTidalPerShare = poolInfo.accTidalPerShare.add(\n amount\_.mul(SHARE\_UNITS)).div(poolInfo.totalShare);\n```\n

Vulnerable code:
```\npoolInfo.accTidalPerShare = poolInfo.accTidalPerShare.add(\n amount\_.mul(SHARE\_UNITS)).div(poolInfo.totalShare);\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: TwoTokenPoolMixin.sol\n    constructor(\n        NotionalProxy notion. ```\nFile: TwoTokenPoolMixin.sol\n    constructor(\n        NotionalProxy notional_, \n        AuraVaultDeploymentParams memory params\n    ) PoolMixin(notional_, params) {\n..SNIP..\n        // If the underlying is ETH, primaryBorrowToken will be rewritten as WETH\n        uint256 primaryDecimals =

Vulnerable code:
```\nFile: TwoTokenPoolMixin.sol\n    constructor(\n        NotionalProxy notional_, \n        AuraVaultDeploymentParams memory params\n    ) PoolMixin(notional_, params) {\n..SNIP..\n        // If the underlying is ETH, primaryBorrowToken will be rewritten as WETH\n        uint256 primaryDecimals = IERC20(primaryAddress).decimals();\n        // Do not allow decimal places greater than 18\n        require(primaryDecimals <= 18);\n        PRIMARY_DECIMALS = uint8(primaryDecimals);\n\n        uint256 secondaryDecimals = address(SECONDARY_TOKEN) ==\n            Deployments.ETH_ADDRESS\n            ? 18\n            : SECONDARY_TOKEN.decimals();\n        require(primaryDecimals <= 18);\n        SECONDARY_DECIMALS = uint8(secondaryDecimals);\n    }\n```\n
HIGH severity: Vulnerable function: ```\n        require(\n            bidder != l.highestBids[tokenId][round].bidde. ```\n        require(\n            bidder != l.highestBids[tokenId][round].bidder,\n            'EnglishPeriodicAuction: Cannot cancel bid if highest bidder'\n        );\n```\n

Vulnerable code:
```\n        require(\n            bidder != l.highestBids[tokenId][round].bidder,\n            'EnglishPeriodicAuction: Cannot cancel bid if highest bidder'\n        );\n```\n
MEDIUM severity: Vulnerable function: ```\n/\*\*\n \* @dev Calculates the USD price of asset.\n \* @param \_asset: the asset address.\n \*. ```\n/\*\*\n \* @dev Calculates the USD price of asset.\n \* @param \_asset: the asset address.\n \* Returns the USD price of the given asset\n \*/\nfunction \_getUSDPrice(address \_asset) internal view returns (uint256 price) {\n require(usdPriceFeeds[\_asset] != address(0), Errors.ORACLE\_NONE\_PR

Vulnerable code:
```\n/\*\*\n \* @dev Calculates the USD price of asset.\n \* @param \_asset: the asset address.\n \* Returns the USD price of the given asset\n \*/\nfunction \_getUSDPrice(address \_asset) internal view returns (uint256 price) {\n require(usdPriceFeeds[\_asset] != address(0), Errors.ORACLE\_NONE\_PRICE\_FEED);\n\n (, int256 latestPrice, , , ) = AggregatorV3Interface(usdPriceFeeds[\_asset]).latestRoundData();\n\n price = uint256(latestPrice);\n}\n```\n
HIGH severity: Vulnerable function: ```\n/\*\*\*\* Recovery \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/\n   \n// In an explicable black swan scenari. ```\n/\*\*\*\* Recovery \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/\n   \n// In an explicable black swan scenario where the DAO loses more than the min membership required (3), this method can be used by a regular node operator to join the DAO\n// Must have their ID, email, current RPL bond amount available and

Vulnerable code:
```\n/\*\*\*\* Recovery \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/\n   \n// In an explicable black swan scenario where the DAO loses more than the min membership required (3), this method can be used by a regular node operator to join the DAO\n// Must have their ID, email, current RPL bond amount available and must be called by their current registered node account\nfunction memberJoinRequired(string memory \_id, string memory \_email) override public onlyLowMemberMode onlyRegisteredNode(msg.sender) onlyLatestContract("rocketDAONodeTrusted", address(this)) {\n    // Ok good to go, lets add them\n    (bool successPropose, bytes memory responsePropose) = getContractAddress('rocketDAONodeTrustedProposals').call(abi.encodeWithSignature("proposalInvite(string,string,address)", \_id, \_email, msg.sender));\n    // Was there an error?\n    require(successPropose, getRevertMsg(responsePropose));\n    // Get the to automatically join as a member (by a regular proposal, they would have to manually accept, but this is no ordinary situation)\n    (bool successJoin, bytes memory responseJoin) = getContractAddress("rocketDAONodeTrustedActions").call(abi.encodeWithSignature("actionJoinRequired(address)", msg.sender));\n    // Was there an error?\n    require(successJoin, getRevertMsg(responseJoin));\n}\n```\n
HIGH severity: Vulnerable function: ```\nfunction updateFormula(IBancorFormula \_formula) external auth(UPDATE\_FORMULA\_ROLE) {\n    re. ```\nfunction updateFormula(IBancorFormula \_formula) external auth(UPDATE\_FORMULA\_ROLE) {\n    require(isContract(\_formula), ERROR\_CONTRACT\_IS\_EOA);\n\n    \_updateFormula(\_formula);\n}\n```\n

Vulnerable code:
```\nfunction updateFormula(IBancorFormula \_formula) external auth(UPDATE\_FORMULA\_ROLE) {\n    require(isContract(\_formula), ERROR\_CONTRACT\_IS\_EOA);\n\n    \_updateFormula(\_formula);\n}\n```\n
HIGH severity: Vulnerable function: ```\n/\*\*\n \* @dev Reports unauthorized signing for the provided group. Must provide\n \* a valid . ```\n/\*\*\n \* @dev Reports unauthorized signing for the provided group. Must provide\n \* a valid signature of the group address as a message. Successful signature\n \* verification means the private key has been leaked and all group members\n \* should be punished by seizing their tokens. The sub

Vulnerable code:
```\n/\*\*\n \* @dev Reports unauthorized signing for the provided group. Must provide\n \* a valid signature of the group address as a message. Successful signature\n \* verification means the private key has been leaked and all group members\n \* should be punished by seizing their tokens. The submitter of this proof is\n \* rewarded with 5% of the total seized amount scaled by the reward adjustment\n \* parameter and the rest 95% is burned.\n \*/\nfunction reportUnauthorizedSigning(\n    uint256 groupIndex,\n    bytes memory signedGroupPubKey\n) public {\n    groups.reportUnauthorizedSigning(groupIndex, signedGroupPubKey, minimumStake);\n}\n```\n
HIGH severity: Vulnerable function: ```\nif (removeParams.bucketCollateral == 0 && unscaledRemaining == 0 && lpsRema. ```\nif (removeParams.bucketCollateral == 0 && unscaledRemaining == 0 && lpsRemaining != 0) {\n emit BucketBankruptcy(params_.index, lpsRemaining);\n bucket.lps            = 0;\n bucket.bankruptcyTime = block.timestamp;\n} else {\n bucket.lps = lpsRemaining;\n}\n```\n

Vulnerable code:
```\nif (removeParams.bucketCollateral == 0 && unscaledRemaining == 0 && lpsRemaining != 0) {\n emit BucketBankruptcy(params_.index, lpsRemaining);\n bucket.lps            = 0;\n bucket.bankruptcyTime = block.timestamp;\n} else {\n bucket.lps = lpsRemaining;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: LibQuote.sol\n    function closeQuote(Quote storage quote, uint256 filledAmount, uint256 . ```\nFile: LibQuote.sol\n    function closeQuote(Quote storage quote, uint256 filledAmount, uint256 closedPrice) internal {\n..SNIP..\n        if (quote.closedAmount == quote.quantity) {\n            quote.quoteStatus = QuoteStatus.CLOSED;\n            quote.requestedClosePrice = 0;\n            rem

Vulnerable code:
```\nFile: LibQuote.sol\n    function closeQuote(Quote storage quote, uint256 filledAmount, uint256 closedPrice) internal {\n..SNIP..\n        if (quote.closedAmount == quote.quantity) {\n            quote.quoteStatus = QuoteStatus.CLOSED;\n            quote.requestedClosePrice = 0;\n            removeFromOpenPositions(quote.id);\n            quoteLayout.partyAPositionsCount[quote.partyA] -= 1;\n            quoteLayout.partyBPositionsCount[quote.partyB][quote.partyA] -= 1;\n        } else if (\n            quote.quoteStatus == QuoteStatus.CANCEL_CLOSE_PENDING || quote.quantityToClose == 0\n        ) {\n            quote.quoteStatus = QuoteStatus.OPENED;\n            quote.requestedClosePrice = 0;\n            quote.quantityToClose = 0; // for CANCEL_CLOSE_PENDING status\n        } else {\n            require(\n                quote.lockedValues.total() >=\n                    SymbolStorage.layout().symbols[quote.symbolId].minAcceptableQuoteValue,\n                "LibQuote: Remaining quote value is low"\n            );\n        }\n    }\n```\n
HIGH severity: Vulnerable function: ```\nfunction flagShort(address asset, address shorter, uint8 id, uint16 flaggerHint)\n        exter. ```\nfunction flagShort(address asset, address shorter, uint8 id, uint16 flaggerHint)\n        external\n        isNotFrozen(asset)\n        nonReentrant\n        onlyValidShortRecord(asset, shorter, id)\n    {\n        // initial code\n\n        short.setFlagger(cusd, flaggerHint);\n        emit Ev

Vulnerable code:
```\nfunction flagShort(address asset, address shorter, uint8 id, uint16 flaggerHint)\n        external\n        isNotFrozen(asset)\n        nonReentrant\n        onlyValidShortRecord(asset, shorter, id)\n    {\n        // initial code\n\n        short.setFlagger(cusd, flaggerHint);\n        emit Events.FlagShort(asset, shorter, id, msg.sender, adjustedTimestamp);\n    }\n```\n
HIGH severity: Vulnerable function: ```\nif (twapCheck || positions[pos].twapOverride) {\n  // check twap\n  checkPr. ```\nif (twapCheck || positions[pos].twapOverride) {\n  // check twap\n  checkPriceChange(\n    pos,\n    (positions[pos].twapOverride ? positions[pos].twapInterval : twapInterval),\n    (positions[pos].twapOverride ? positions[pos].priceThreshold : priceThreshold)\n  );\n}\n```\n

Vulnerable code:
```\nif (twapCheck || positions[pos].twapOverride) {\n  // check twap\n  checkPriceChange(\n    pos,\n    (positions[pos].twapOverride ? positions[pos].twapInterval : twapInterval),\n    (positions[pos].twapOverride ? positions[pos].priceThreshold : priceThreshold)\n  );\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 colRatio = StableMath.min(props.colRatio, StableMath.getFullScale(). ```\nuint256 colRatio = StableMath.min(props.colRatio, StableMath.getFullScale());\n\n// Ensure payout is related to the collateralised mAsset quantity\nuint256 collateralisedMassetQuantity = \_mAssetQuantity.mulTruncate(colRatio);\n```\n

Vulnerable code:
```\nuint256 colRatio = StableMath.min(props.colRatio, StableMath.getFullScale());\n\n// Ensure payout is related to the collateralised mAsset quantity\nuint256 collateralisedMassetQuantity = \_mAssetQuantity.mulTruncate(colRatio);\n```\n
HIGH severity: Vulnerable function: ```\n function deposit(uint256 _underlyingAmount, address _receiver)\n    external\n    override\n  . ```\n function deposit(uint256 _underlyingAmount, address _receiver)\n    external\n    override\n    whenNotPaused\n    nonReentrant\n  {\n    _deposit(_underlyingAmount, _receiver);\n  }\n\n  function _deposit(uint256 _underlyingAmount, address _receiver) internal {\n    /// Verify that the pool i

Vulnerable code:
```\n function deposit(uint256 _underlyingAmount, address _receiver)\n    external\n    override\n    whenNotPaused\n    nonReentrant\n  {\n    _deposit(_underlyingAmount, _receiver);\n  }\n\n  function _deposit(uint256 _underlyingAmount, address _receiver) internal {\n    /// Verify that the pool is not in OpenToBuyers phase\n    if (poolInfo.currentPhase == ProtectionPoolPhase.OpenToBuyers) {\n      revert ProtectionPoolInOpenToBuyersPhase();\n    }\n\n    uint256 _sTokenShares = convertToSToken(_underlyingAmount);\n    totalSTokenUnderlying += _underlyingAmount;\n    _safeMint(_receiver, _sTokenShares);\n    poolInfo.underlyingToken.safeTransferFrom(\n      msg.sender,\n      address(this),\n      _underlyingAmount\n    );\n\n    /// Verify leverage ratio only when total capital/sTokenUnderlying is higher than minimum capital requirement\n    if (_hasMinRequiredCapital()) {\n      /// calculate pool's current leverage ratio considering the new deposit\n      uint256 _leverageRatio = calculateLeverageRatio();\n\n      if (_leverageRatio > poolInfo.params.leverageRatioCeiling) {\n        revert ProtectionPoolLeverageRatioTooHigh(_leverageRatio);\n      }\n    }\n\n    emit ProtectionSold(_receiver, _underlyingAmount);\n }\n```\n
HIGH severity: Vulnerable function: ```\nif (protected && (\n    !context.closable.isZero() || // @audit even if clo. ```\nif (protected && (\n    !context.closable.isZero() || // @audit even if closable is 0, position can still increase\n    context.latestPosition.local.maintained(\n        context.latestVersion,\n        context.riskParameter,\n        context.pendingCollateral.sub(collateral)\n    ) ||\n    coll

Vulnerable code:
```\nif (protected && (\n    !context.closable.isZero() || // @audit even if closable is 0, position can still increase\n    context.latestPosition.local.maintained(\n        context.latestVersion,\n        context.riskParameter,\n        context.pendingCollateral.sub(collateral)\n    ) ||\n    collateral.lt(Fixed6Lib.from(-1, _liquidationFee(context, newOrder)))\n)) revert MarketInvalidProtectionError();\n\nif (\n    !(context.currentPosition.local.magnitude().isZero() && context.latestPosition.local.magnitude().isZero()) &&   // sender has no position\n    !(newOrder.isEmpty() && collateral.gte(Fixed6Lib.ZERO)) &&                                                      // sender is depositing zero or more into account, without position change\n    (context.currentTimestamp - context.latestVersion.timestamp >= context.riskParameter.staleAfter)                // price is not stale\n) revert MarketStalePriceError();\n\nif (context.marketParameter.closed && newOrder.increasesPosition())\n    revert MarketClosedError();\n\nif (context.currentPosition.global.maker.gt(context.riskParameter.makerLimit))\n    revert MarketMakerOverLimitError();\n\nif (!newOrder.singleSided(context.currentPosition.local) || !newOrder.singleSided(context.latestPosition.local))\n    revert MarketNotSingleSidedError();\n\nif (protected) return; // The following invariants do not apply to protected position updates (liquidations)\n```\n
MEDIUM severity: Vulnerable function: ```\nmodifier lockedWhileVotesCast() {\n  uint[] memory activeProposals = govern. ```\nmodifier lockedWhileVotesCast() {\n  uint[] memory activeProposals = governance.getActiveProposals();\n  for (uint i = 0; i < activeProposals.length; i++) {\n    if (governance.getReceipt(activeProposals[i], getDelegate(msg.sender)).hasVoted) revert TokenLocked();\n    (, address proposer,) = g

Vulnerable code:
```\nmodifier lockedWhileVotesCast() {\n  uint[] memory activeProposals = governance.getActiveProposals();\n  for (uint i = 0; i < activeProposals.length; i++) {\n    if (governance.getReceipt(activeProposals[i], getDelegate(msg.sender)).hasVoted) revert TokenLocked();\n    (, address proposer,) = governance.getProposalData(activeProposals[i]);\n    if (proposer == getDelegate(msg.sender)) revert TokenLocked();\n  }\n  _;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function heal(uint256[] calldata agentIds) external nonReentrant {\n        _assertFrontrun. ```\n    function heal(uint256[] calldata agentIds) external nonReentrant {\n        _assertFrontrunLockIsOff();\n//@audit If there are not enough activeAgents, heal is disabled\n        if (gameInfo.activeAgents <= NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {\n            revert HealingDisabled();\n  

Vulnerable code:
```\n    function heal(uint256[] calldata agentIds) external nonReentrant {\n        _assertFrontrunLockIsOff();\n//@audit If there are not enough activeAgents, heal is disabled\n        if (gameInfo.activeAgents <= NUMBER_OF_SECONDARY_PRIZE_POOL_WINNERS) {\n            revert HealingDisabled();\n        }\n```\n