Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\nfunction _depositLPIncentive(\n    StoredReward memory reward,\n    uint256 amount,\n    uint25. ```\nfunction _depositLPIncentive(\n    StoredReward memory reward,\n    uint256 amount,\n    uint256 periodReceived\n) private {\n    IERC20(reward.token).safeTransferFrom(\n        msg.sender,\n        address(this),\n        amount\n    );\n\n    // @audit stored `amount` here will be incorrect s

Vulnerable code:
```\nfunction _depositLPIncentive(\n    StoredReward memory reward,\n    uint256 amount,\n    uint256 periodReceived\n) private {\n    IERC20(reward.token).safeTransferFrom(\n        msg.sender,\n        address(this),\n        amount\n    );\n\n    // @audit stored `amount` here will be incorrect since it doesn't account for\n    // the actual amount received after the transfer fee was deducted in-transit\n    _storeReward(periodReceived, reward, amount);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function testswapExactTokensForETHStuckTokens() public {\n        address wrappedTokenA = I. ```\n    function testswapExactTokensForETHStuckTokens() public {\n        address wrappedTokenA = IChilizWrapperFactory(wrapperFactory).wrappedTokenFor(address(tokenA));\n\n        tokenA.approve(address(wrapperFactory), type(uint256).max);\n        wrapperFactory.wrap(address(this), address(tokenA

Vulnerable code:
```\n    function testswapExactTokensForETHStuckTokens() public {\n        address wrappedTokenA = IChilizWrapperFactory(wrapperFactory).wrappedTokenFor(address(tokenA));\n\n        tokenA.approve(address(wrapperFactory), type(uint256).max);\n        wrapperFactory.wrap(address(this), address(tokenA), 100);\n\n        IERC20(wrappedTokenA).approve(address(router), 100 ether);\n        router.addLiquidityETH{value: 100 ether}(wrappedTokenA, 100 ether, 0, 0, address(this), type(uint40).max);\n\n        address pairAddress = factory.getPair(address(WETH), wrapperFactory.wrappedTokenFor(address(tokenA)));\n\n        uint256 pairBalance = JalaPair(pairAddress).balanceOf(address(this));\n\n        address[] memory path = new address[](2);\n        path[0] = wrappedTokenA;\n        path[1] = address(WETH);\n\n        vm.startPrank(user0);\n        console.log("ETH user balance before:       ", user0.balance);\n        console.log("TokenA user balance before:    ", tokenA.balanceOf(user0));\n        console.log("WTokenA router balance before: ", IERC20(wrappedTokenA).balanceOf(address(masterRouter)));\n\n        tokenA.approve(address(masterRouter), 550);\n        masterRouter.swapExactTokensForETH(address(tokenA), 550, 0, path, user0, type(uint40).max);\n        vm.stopPrank();\n\n        console.log("ETH user balance after:       ", user0.balance);\n        console.log("TokenA user balance after:    ", tokenA.balanceOf(user0));\n        console.log("WTokenA router balance after: ", IERC20(wrappedTokenA).balanceOf(address(masterRouter)));\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 \_tmpIndex = \_currentIndex - 1;\nuint256 \_currentUserAmount = use. ```\nuint256 \_tmpIndex = \_currentIndex - 1;\nuint256 \_currentUserAmount = usersTeamInfo[msg.sender].stakedAmount;\n \nwhile (\_currentUserAmount > usersTeamInfo[topUsers[\_tmpIndex]].stakedAmount) {\n    address \_tmpAddr = topUsers[\_tmpIndex];\n    topUsers[\_tmpIndex] = msg.sender;\n    topUse

Vulnerable code:
```\nuint256 \_tmpIndex = \_currentIndex - 1;\nuint256 \_currentUserAmount = usersTeamInfo[msg.sender].stakedAmount;\n \nwhile (\_currentUserAmount > usersTeamInfo[topUsers[\_tmpIndex]].stakedAmount) {\n    address \_tmpAddr = topUsers[\_tmpIndex];\n    topUsers[\_tmpIndex] = msg.sender;\n    topUsers[\_tmpIndex + 1] = \_tmpAddr;\n \n    if (\_tmpIndex == 0) {\n        break;\n    }\n \n    \_tmpIndex--;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction withdraw(int256 \_withdrawAmount) public override nonReentrant {\n updateF1155Balances. ```\nfunction withdraw(int256 \_withdrawAmount) public override nonReentrant {\n updateF1155Balances();\n \_internalWithdraw(\_withdrawAmount);\n}\n```\n

Vulnerable code:
```\nfunction withdraw(int256 \_withdrawAmount) public override nonReentrant {\n updateF1155Balances();\n \_internalWithdraw(\_withdrawAmount);\n}\n```\n
HIGH severity: Vulnerable function: ```\n    tokenVotingPower[currentDelegate] -= amount;\n    tokenVotingPower[_del. ```\n    tokenVotingPower[currentDelegate] -= amount;\n    tokenVotingPower[_delegatee] += amount; \n\n    // If a user is delegating back to themselves, they regain their community voting power, so adjust totals up\n    if (_delegator == _delegatee) {\n      _updateTotalCommunityVotingPower(_delega

Vulnerable code:
```\n    tokenVotingPower[currentDelegate] -= amount;\n    tokenVotingPower[_delegatee] += amount; \n\n    // If a user is delegating back to themselves, they regain their community voting power, so adjust totals up\n    if (_delegator == _delegatee) {\n      _updateTotalCommunityVotingPower(_delegator, true);\n\n    // If a user delegates away their votes, they forfeit their community voting power, so adjust totals down\n    } else if (currentDelegate == _delegator) {\n      _updateTotalCommunityVotingPower(_delegator, false);\n    }\n```\n
HIGH severity: Vulnerable function: ```\nmodifier onlyPrizePool() {\n  require(\_msgSender() == address(prizePool), . ```\nmodifier onlyPrizePool() {\n  require(\_msgSender() == address(prizePool), "PeriodicPrizeStrategy/only-prize-pool");\n  \_;\n}\n```\n

Vulnerable code:
```\nmodifier onlyPrizePool() {\n  require(\_msgSender() == address(prizePool), "PeriodicPrizeStrategy/only-prize-pool");\n  \_;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    uint tokenInPrice = _getMinPrice(address(baseAsset));\n        uint tok. ```\n    uint tokenInPrice = _getMinPrice(address(baseAsset));\n        uint tokenOutPrice = _getMaxPrice(address(quoteAsset));\n    // rest of code\n    uint minOut = tokenInPrice\n      .multiplyDecimal(marketPricingParams[_optionMarket].minReturnPercent)\n        .multiplyDecimal(_amountBase)\n  

Vulnerable code:
```\n    uint tokenInPrice = _getMinPrice(address(baseAsset));\n        uint tokenOutPrice = _getMaxPrice(address(quoteAsset));\n    // rest of code\n    uint minOut = tokenInPrice\n      .multiplyDecimal(marketPricingParams[_optionMarket].minReturnPercent)\n        .multiplyDecimal(_amountBase)\n          .divideDecimal(tokenOutPrice);\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: bophades\src\external\governance\GovernorBravoDelegate.sol\n    function castVoteInternal. ```\nFile: bophades\src\external\governance\GovernorBravoDelegate.sol\n    function castVoteInternal(\n        address voter,\n        uint256 proposalId,\n        uint8 support\n    ) internal returns (uint256) {\n// rest of code// rest of code\n        // Get the user's votes at the start of the p

Vulnerable code:
```\nFile: bophades\src\external\governance\GovernorBravoDelegate.sol\n    function castVoteInternal(\n        address voter,\n        uint256 proposalId,\n        uint8 support\n    ) internal returns (uint256) {\n// rest of code// rest of code\n        // Get the user's votes at the start of the proposal and at the time of voting. Take the minimum.\n        uint256 originalVotes = gohm.getPriorVotes(voter, proposal.startBlock);\n446:->       uint256 currentVotes = gohm.getPriorVotes(voter, block.number);\n        uint256 votes = currentVotes > originalVotes ? originalVotes : currentVotes;\n// rest of code// rest of code\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: InvariantChecks.sol\n    /// @dev Returns the difference between actual total collateral . ```\nFile: InvariantChecks.sol\n    /// @dev Returns the difference between actual total collateral balance in the vault vs tracked collateral\n    ///      Tracked collateral should be updated when depositing to stable LP (stableCollateralTotal) or\n    ///      opening leveraged positions (marginD

Vulnerable code:
```\nFile: InvariantChecks.sol\n    /// @dev Returns the difference between actual total collateral balance in the vault vs tracked collateral\n    ///      Tracked collateral should be updated when depositing to stable LP (stableCollateralTotal) or\n    ///      opening leveraged positions (marginDepositedTotal).\n    /// TODO: Account for margin of error due to rounding.\n    function _getCollateralNet(IFlatcoinVault vault) private view returns (uint256 netCollateral) {\n        uint256 collateralBalance = vault.collateral().balanceOf(address(vault));\n        uint256 trackedCollateral = vault.stableCollateralTotal() + vault.getGlobalPositions().marginDepositedTotal;\n\n        if (collateralBalance < trackedCollateral) revert FlatcoinErrors.InvariantViolation("collateralNet");\n\n        return collateralBalance - trackedCollateral;\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n  function svTokenValue(GMXTypes.Store storage self) public view returns (uint256) {\n    uint2. ```\n  function svTokenValue(GMXTypes.Store storage self) public view returns (uint256) {\n    uint256 equityValue_ = equityValue(self);\n    uint256 totalSupply_ = IERC20(address(self.vault)).totalSupply();\n    if (equityValue_ == 0 || totalSupply_ == 0) return SAFE_MULTIPLIER;\n    return equityV

Vulnerable code:
```\n  function svTokenValue(GMXTypes.Store storage self) public view returns (uint256) {\n    uint256 equityValue_ = equityValue(self);\n    uint256 totalSupply_ = IERC20(address(self.vault)).totalSupply();\n    if (equityValue_ == 0 || totalSupply_ == 0) return SAFE_MULTIPLIER;\n    return equityValue_ * SAFE_MULTIPLIER / totalSupply_;\n  }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction uniTransferFrom(IERC20 token, address payable from, address to, uint256 amount) intern. ```\nfunction uniTransferFrom(IERC20 token, address payable from, address to, uint256 amount) internal {\n    if (amount > 0) {\n        if (isETH(token)) {\n            require(msg.value >= amount, "UniERC20: not enough value");\n            if (msg.value > amount) {\n                // Return rema

Vulnerable code:
```\nfunction uniTransferFrom(IERC20 token, address payable from, address to, uint256 amount) internal {\n    if (amount > 0) {\n        if (isETH(token)) {\n            require(msg.value >= amount, "UniERC20: not enough value");\n            if (msg.value > amount) {\n                // Return remainder if exist\n                from.transfer(msg.value.sub(amount));\n            }\n        } else {\n            token.safeTransferFrom(from, to, amount);\n        }\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function liquidatePendingPositionsPartyA(address partyA) internal {\n        QuoteStorage.L. ```\n    function liquidatePendingPositionsPartyA(address partyA) internal {\n        QuoteStorage.Layout storage quoteLayout = QuoteStorage.layout();\n        require(\n            MAStorage.layout().liquidationStatus[partyA],\n            "LiquidationFacet: PartyA is solvent"\n        );\n        

Vulnerable code:
```\n    function liquidatePendingPositionsPartyA(address partyA) internal {\n        QuoteStorage.Layout storage quoteLayout = QuoteStorage.layout();\n        require(\n            MAStorage.layout().liquidationStatus[partyA],\n            "LiquidationFacet: PartyA is solvent"\n        );\n        for (uint256 index = 0; index < quoteLayout.partyAPendingQuotes[partyA].length; index++) {\n            Quote storage quote = quoteLayout.quotes[\n                quoteLayout.partyAPendingQuotes[partyA][index]\n            ];\n            if (\n                (quote.quoteStatus == QuoteStatus.LOCKED ||\n                    quote.quoteStatus == QuoteStatus.CANCEL_PENDING) &&\n                quoteLayout.partyBPendingQuotes[quote.partyB][partyA].length > 0\n            ) {\n                delete quoteLayout.partyBPendingQuotes[quote.partyB][partyA];\n                AccountStorage\n                .layout()\n                .partyBPendingLockedBalances[quote.partyB][partyA].makeZero();\n            }\n            quote.quoteStatus = QuoteStatus.LIQUIDATED;\n            quote.modifyTimestamp = block.timestamp;\n        }\n        AccountStorage.layout().pendingLockedBalances[partyA].makeZero();\n        delete quoteLayout.partyAPendingQuotes[partyA];\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nif (swapQuantity != 0) {\n    pool.swap(\n        address(this),\n        s. ```\nif (swapQuantity != 0) {\n    pool.swap(\n        address(this),\n        swapQuantity > 0,\n        swapQuantity > 0 ? swapQuantity : -swapQuantity,\n        swapQuantity > 0 ? TickMath.MIN\_SQRT\_RATIO + 1 : TickMath.MAX\_SQRT\_RATIO - 1,\n        abi.encode(address(this))\n    );\n}\n```\n

Vulnerable code:
```\nif (swapQuantity != 0) {\n    pool.swap(\n        address(this),\n        swapQuantity > 0,\n        swapQuantity > 0 ? swapQuantity : -swapQuantity,\n        swapQuantity > 0 ? TickMath.MIN\_SQRT\_RATIO + 1 : TickMath.MAX\_SQRT\_RATIO - 1,\n        abi.encode(address(this))\n    );\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction createAgent(uint256 agentId, address owner, string calldata metadata, uint256[] callda. ```\nfunction createAgent(uint256 agentId, address owner, string calldata metadata, uint256[] calldata chainIds)\npublic\n    onlySorted(chainIds)\n    frontrunProtected(keccak256(abi.encodePacked(agentId, owner, metadata, chainIds)), frontRunningDelay)\n{\n    \_mint(owner, agentId);\n    \_beforeA

Vulnerable code:
```\nfunction createAgent(uint256 agentId, address owner, string calldata metadata, uint256[] calldata chainIds)\npublic\n    onlySorted(chainIds)\n    frontrunProtected(keccak256(abi.encodePacked(agentId, owner, metadata, chainIds)), frontRunningDelay)\n{\n    \_mint(owner, agentId);\n    \_beforeAgentUpdate(agentId, metadata, chainIds);\n    \_agentUpdate(agentId, metadata, chainIds);\n    \_afterAgentUpdate(agentId, metadata, chainIds);\n}\n```\n
HIGH severity: Vulnerable function: ```\nuint256 initiatorPayment = transferAmount.mulDivDown(\n      auction.initia. ```\nuint256 initiatorPayment = transferAmount.mulDivDown(\n      auction.initiatorFee,\n      100\n    ); \n```\n

Vulnerable code:
```\nuint256 initiatorPayment = transferAmount.mulDivDown(\n      auction.initiatorFee,\n      100\n    ); \n```\n
MEDIUM severity: Vulnerable function: ```\ntargetStakeAtRiskWei[target] = max(stakedWei[target], streamrConfig.minimum. ```\ntargetStakeAtRiskWei[target] = max(stakedWei[target], streamrConfig.minimumStakeWei()) * streamrConfig.slashingFraction() / 1 ether;\n```\n

Vulnerable code:
```\ntargetStakeAtRiskWei[target] = max(stakedWei[target], streamrConfig.minimumStakeWei()) * streamrConfig.slashingFraction() / 1 ether;\n```\n
HIGH severity: Vulnerable function: ```\nfunction _loadContext(address account) private view returns (Context memory context) {\n    // . ```\nfunction _loadContext(address account) private view returns (Context memory context) {\n    // rest of code\n    context.global = _accounts[address(0)].read();\n    context.local = _accounts[account].read();\n    context.latestCheckpoint = _checkpoints[context.global.latest].read();\n}\n```\n

Vulnerable code:
```\nfunction _loadContext(address account) private view returns (Context memory context) {\n    // rest of code\n    context.global = _accounts[address(0)].read();\n    context.local = _accounts[account].read();\n    context.latestCheckpoint = _checkpoints[context.global.latest].read();\n}\n```\n
HIGH severity: Vulnerable function: ```\nfunction initialize(address \_measure, address \_asset) external {\n    measure = IERC20Upgrade. ```\nfunction initialize(address \_measure, address \_asset) external {\n    measure = IERC20Upgradeable(\_measure);\n    asset = IERC20Upgradeable(\_asset);\n\n    // Set Factory Deployer\n    factory = msg.sender;\n}\n```\n

Vulnerable code:
```\nfunction initialize(address \_measure, address \_asset) external {\n    measure = IERC20Upgradeable(\_measure);\n    asset = IERC20Upgradeable(\_asset);\n\n    // Set Factory Deployer\n    factory = msg.sender;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\naccount = address(\n    new Proxy{ salt: keccak256(abi.encodePacked(salt, t. ```\naccount = address(\n    new Proxy{ salt: keccak256(abi.encodePacked(salt, tx.origin)) }(\n        versionInformation[accountVersion].implementation\n    )\n);\n```\n

Vulnerable code:
```\naccount = address(\n    new Proxy{ salt: keccak256(abi.encodePacked(salt, tx.origin)) }(\n        versionInformation[accountVersion].implementation\n    )\n);\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction emergencyPause(\n  GMXTypes.Store storage self\n) external {\n  self.refundee = payabl. ```\nfunction emergencyPause(\n  GMXTypes.Store storage self\n) external {\n  self.refundee = payable(msg.sender);\n\n  GMXTypes.RemoveLiquidityParams memory _rlp;\n\n  // Remove all of the vault's LP tokens\n  _rlp.lpAmt = self.lpToken.balanceOf(address(this));\n  _rlp.executionFee = msg.value;\n\n

Vulnerable code:
```\nfunction emergencyPause(\n  GMXTypes.Store storage self\n) external {\n  self.refundee = payable(msg.sender);\n\n  GMXTypes.RemoveLiquidityParams memory _rlp;\n\n  // Remove all of the vault's LP tokens\n  _rlp.lpAmt = self.lpToken.balanceOf(address(this));\n  _rlp.executionFee = msg.value;\n\n  GMXManager.removeLiquidity(\n    self,\n    _rlp\n  );\n\n  self.status = GMXTypes.Status.Paused;\n\n  emit EmergencyPause();\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    uint256 timeElapsed = blockTimestamp - blockTimestampLast;\n     // ove. ```\n    uint256 timeElapsed = blockTimestamp - blockTimestampLast;\n     // overflow is desired\n    if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {\n      reserve0CumulativeLast += _reserve0 * timeElapsed;\n        reserve1CumulativeLast += _reserve1 * timeElapsed;\n     }\n```\n

Vulnerable code:
```\n    uint256 timeElapsed = blockTimestamp - blockTimestampLast;\n     // overflow is desired\n    if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {\n      reserve0CumulativeLast += _reserve0 * timeElapsed;\n        reserve1CumulativeLast += _reserve1 * timeElapsed;\n     }\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: PartyBFacetImpl.sol\n    function openPosition(\n        uint256 quoteId,\n        uint25. ```\nFile: PartyBFacetImpl.sol\n    function openPosition(\n        uint256 quoteId,\n        uint256 filledAmount,\n        uint256 openedPrice,\n        PairUpnlAndPriceSig memory upnlSig\n    ) internal returns (uint256 currentId) {\n..SNIP..\n        LibSolvency.isSolventAfterOpenPosition(quoteI

Vulnerable code:
```\nFile: PartyBFacetImpl.sol\n    function openPosition(\n        uint256 quoteId,\n        uint256 filledAmount,\n        uint256 openedPrice,\n        PairUpnlAndPriceSig memory upnlSig\n    ) internal returns (uint256 currentId) {\n..SNIP..\n        LibSolvency.isSolventAfterOpenPosition(quoteId, filledAmount, upnlSig);\n\n        accountLayout.partyANonces[quote.partyA] += 1;\n        accountLayout.partyBNonces[quote.partyB][quote.partyA] += 1;\n        quote.modifyTimestamp = block.timestamp;\n\n        LibQuote.removeFromPendingQuotes(quote);\n\n        if (quote.quantity == filledAmount) {\n            accountLayout.pendingLockedBalances[quote.partyA].subQuote(quote);\n            accountLayout.partyBPendingLockedBalances[quote.partyB][quote.partyA].subQuote(quote);\n\n            if (quote.orderType == OrderType.LIMIT) {\n                quote.lockedValues.mul(openedPrice).div(quote.requestedOpenPrice);\n            }\n            accountLayout.lockedBalances[quote.partyA].addQuote(quote);\n            accountLayout.partyBLockedBalances[quote.partyB][quote.partyA].addQuote(quote);\n        }\n```\n
HIGH severity: Vulnerable function: ```\n        (\n        netPnLE36,\n             lenderProfitUSDValueE36,\n     . ```\n        (\n        netPnLE36,\n             lenderProfitUSDValueE36,\n                 borrowTotalUSDValueE36,\n                     positionOpenUSDValueE36,\n                      sharingProfitTokenAmts ) = calcProfitInfo(_positionManager, _user, _posId);\n        // 2. add liquidation premium

Vulnerable code:
```\n        (\n        netPnLE36,\n             lenderProfitUSDValueE36,\n                 borrowTotalUSDValueE36,\n                     positionOpenUSDValueE36,\n                      sharingProfitTokenAmts ) = calcProfitInfo(_positionManager, _user, _posId);\n        // 2. add liquidation premium to the shared profit amounts\n                            uint lenderLiquidatationPremiumBPS = IConfig(config).lenderLiquidatePremiumBPS();\n                         for (uint i; i < sharingProfitTokenAmts.length; ) {\n                    sharingProfitTokenAmts[i] +=\n                (pos.openTokenInfos[i].borrowAmt * lenderLiquidatationPremiumBPS) / BPS;\n        unchecked {\n        ++i;\n        }\n        }\n```\n
MEDIUM severity: Vulnerable function: ```\nmodifier initiator(\n DataStoreUtils.DataStore storage DATASTORE,\n uint256. ```\nmodifier initiator(\n DataStoreUtils.DataStore storage DATASTORE,\n uint256 \_TYPE,\n uint256 \_id,\n address \_maintainer\n) {\n require(\n msg.sender == DATASTORE.readAddressForId(\_id, "CONTROLLER"),\n "MaintainerUtils: sender NOT CONTROLLER"\n );\n require(\n DATASTORE.readUintForId(\_id, "

Vulnerable code:
```\nmodifier initiator(\n DataStoreUtils.DataStore storage DATASTORE,\n uint256 \_TYPE,\n uint256 \_id,\n address \_maintainer\n) {\n require(\n msg.sender == DATASTORE.readAddressForId(\_id, "CONTROLLER"),\n "MaintainerUtils: sender NOT CONTROLLER"\n );\n require(\n DATASTORE.readUintForId(\_id, "TYPE") == \_TYPE,\n "MaintainerUtils: id NOT correct TYPE"\n );\n require(\n DATASTORE.readUintForId(\_id, "initiated") == 0,\n "MaintainerUtils: already initiated"\n );\n\n DATASTORE.writeAddressForId(\_id, "maintainer", \_maintainer);\n\n \_;\n\n DATASTORE.writeUintForId(\_id, "initiated", block.timestamp);\n\n emit IdInitiated(\_id, \_TYPE);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nif (context.currentPosition.global.maker.gt(context.riskParameter.makerLimi. ```\nif (context.currentPosition.global.maker.gt(context.riskParameter.makerLimit))\n    revert MarketMakerOverLimitError();\n```\n

Vulnerable code:
```\nif (context.currentPosition.global.maker.gt(context.riskParameter.makerLimit))\n    revert MarketMakerOverLimitError();\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction syncDeps(address _registry) public onlyGovernance {\n    IRegistry registry = IRegistr. ```\nfunction syncDeps(address _registry) public onlyGovernance {\n    IRegistry registry = IRegistry(_registry);\n    vusd = IVUSD(registry.vusd());\n    marginAccount = IMarginAccount(registry.marginAccount());\n    insuranceFund = IInsuranceFund(registry.insuranceFund());\n}\n```\n

Vulnerable code:
```\nfunction syncDeps(address _registry) public onlyGovernance {\n    IRegistry registry = IRegistry(_registry);\n    vusd = IVUSD(registry.vusd());\n    marginAccount = IMarginAccount(registry.marginAccount());\n    insuranceFund = IInsuranceFund(registry.insuranceFund());\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction deposit(\n    uint256 _amount,\n    address _receiver\n  ) external nonReentrant onlyW. ```\nfunction deposit(\n    uint256 _amount,\n    address _receiver\n  ) external nonReentrant onlyWhenVaultIsOn returns (uint256 shares) {\n    if (training) {\n      require(whitelist[msg.sender]);\n      uint256 balanceSender = (balanceOf(msg.sender) * exchangeRate) / (10 ** decimals());\n      r

Vulnerable code:
```\nfunction deposit(\n    uint256 _amount,\n    address _receiver\n  ) external nonReentrant onlyWhenVaultIsOn returns (uint256 shares) {\n    if (training) {\n      require(whitelist[msg.sender]);\n      uint256 balanceSender = (balanceOf(msg.sender) * exchangeRate) / (10 ** decimals());\n      require(_amount + balanceSender <= maxTrainingDeposit);\n    }\n// rest of code\n```\n