Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\n    function _addLiquidity(\n        address token,\n        uint256 tokenDesired,\n        uin. ```\n    function _addLiquidity(\n        address token,\n        uint256 tokenDesired,\n        uint256 wethDesired,\n        uint256 tokenMin,\n        uint256 wethMin,\n        GoatTypes.InitParams memory initParams\n    ) internal returns (uint256, uint256, bool) {\n        GoatTypes.LocalVariab

Vulnerable code:
```\n    function _addLiquidity(\n        address token,\n        uint256 tokenDesired,\n        uint256 wethDesired,\n        uint256 tokenMin,\n        uint256 wethMin,\n        GoatTypes.InitParams memory initParams\n    ) internal returns (uint256, uint256, bool) {\n        GoatTypes.LocalVariables_AddLiquidity memory vars;\n        GoatV1Pair pair = GoatV1Pair(GoatV1Factory(FACTORY).getPool(token));\n        if (address(pair) == address(0)) {\n            // First time liquidity provider\n            pair = GoatV1Pair(GoatV1Factory(FACTORY).createPair(token, initParams));\n            vars.isNewPair = true;\n        }\n\n        if (vars.isNewPair) {\n// rest of codeSNIP\n        } else {\n            /**\n             * @dev This block is accessed after the presale period is over and the pool is converted to AMM\n             */\n       (uint256 wethReserve, uint256 tokenReserve) = pair.getReserves();\n       uint256 tokenAmountOptimal = GoatLibrary.quote(wethDesired, wethReserve, tokenReserve);\n       if (tokenAmountOptimal <= tokenDesired) {\n           if (tokenAmountOptimal < tokenMin) {\n               revert GoatErrors.InsufficientTokenAmount();\n           }\n           (vars.tokenAmount, vars.wethAmount) = (tokenAmountOptimal, wethDesired);\n       } else {\n           uint256 wethAmountOptimal = GoatLibrary.quote(tokenDesired, tokenReserve, wethReserve);\n           assert(wethAmountOptimal <= wethDesired);\n           if (wethAmountOptimal < wethMin) revert GoatErrors.InsufficientWethAmount();\n           (vars.tokenAmount, vars.wethAmount) = (tokenDesired, wethAmountOptimal);\n       }\n   }\n   return (vars.tokenAmount, vars.wethAmount, vars.isNewPair);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction getPrice(address token) external view override returns (uint256) {\n    IICHIVault vau. ```\nfunction getPrice(address token) external view override returns (uint256) {\n    IICHIVault vault = IICHIVault(token);\n    uint256 totalSupply = vault.totalSupply();\n    if (totalSupply == 0) return 0;\n\n    address token0 = vault.token0();\n    address token1 = vault.token1();\n\n    (uint2

Vulnerable code:
```\nfunction getPrice(address token) external view override returns (uint256) {\n    IICHIVault vault = IICHIVault(token);\n    uint256 totalSupply = vault.totalSupply();\n    if (totalSupply == 0) return 0;\n\n    address token0 = vault.token0();\n    address token1 = vault.token1();\n\n    (uint256 r0, uint256 r1) = vault.getTotalAmounts();\n    uint256 px0 = base.getPrice(address(token0));\n    uint256 px1 = base.getPrice(address(token1));\n    uint256 t0Decimal = IERC20Metadata(token0).decimals();\n    uint256 t1Decimal = IERC20Metadata(token1).decimals();\n\n    uint256 totalReserve = (r0 * px0) /\n        10**t0Decimal +\n        (r1 * px1) /\n        10**t1Decimal;\n\n    return (totalReserve * 1e18) / totalSupply;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: LiquidationFacetImpl.sol\n    function setSymbolsPrice(address partyA, PriceSig memory pr. ```\nFile: LiquidationFacetImpl.sol\n    function setSymbolsPrice(address partyA, PriceSig memory priceSig) internal {\n..SNIP..\n        if (accountLayout.liquidationDetails[partyA].liquidationType == LiquidationType.NONE) {\n            accountLayout.liquidationDetails[partyA] = LiquidationDetail(

Vulnerable code:
```\nFile: LiquidationFacetImpl.sol\n    function setSymbolsPrice(address partyA, PriceSig memory priceSig) internal {\n..SNIP..\n        if (accountLayout.liquidationDetails[partyA].liquidationType == LiquidationType.NONE) {\n            accountLayout.liquidationDetails[partyA] = LiquidationDetail({\n                liquidationType: LiquidationType.NONE,\n                upnl: priceSig.upnl,\n                totalUnrealizedLoss: priceSig.totalUnrealizedLoss,\n                deficit: 0,\n                liquidationFee: 0\n            });\n..SNIP..\n            AccountStorage.layout().liquidators[partyA].push(msg.sender);\n        } else {\n            require(\n                accountLayout.liquidationDetails[partyA].upnl == priceSig.upnl &&\n                    accountLayout.liquidationDetails[partyA].totalUnrealizedLoss ==\n                    priceSig.totalUnrealizedLoss,\n                "LiquidationFacet: Invalid upnl sig"\n            );\n        }\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function sendPacket(LZSendParam calldata _lzSendParam, bytes calldata _composeMsg)\n       . ```\n    function sendPacket(LZSendParam calldata _lzSendParam, bytes calldata _composeMsg)\n        public\n        payable\n        whenNotPaused // @audit Pausing is not implemented yet.\n        returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt)\n    {\n        (msgReceip

Vulnerable code:
```\n    function sendPacket(LZSendParam calldata _lzSendParam, bytes calldata _composeMsg)\n        public\n        payable\n        whenNotPaused // @audit Pausing is not implemented yet.\n        returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt)\n    {\n        (msgReceipt, oftReceipt) = abi.decode(\n            _executeModule(\n                uint8(ITOFT.Module.TOFTSender),\n               abi.encodeCall(TapiocaOmnichainSender.sendPacket, (_lzSendParam, _composeMsg)),\n                false\n            ),\n            (MessagingReceipt, OFTReceipt)\n        );\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function _mintVaultShares(uint256 lpTokens) internal returns (uint256 vaultShares) {\n     . ```\n    function _mintVaultShares(uint256 lpTokens) internal returns (uint256 vaultShares) {\n        StrategyVaultState memory state = VaultStorage.getStrategyVaultState();\n        if (state.totalPoolClaim == 0) {\n            // Vault Shares are in 8 decimal precision\n          vaultShares = (l

Vulnerable code:
```\n    function _mintVaultShares(uint256 lpTokens) internal returns (uint256 vaultShares) {\n        StrategyVaultState memory state = VaultStorage.getStrategyVaultState();\n        if (state.totalPoolClaim == 0) {\n            // Vault Shares are in 8 decimal precision\n          vaultShares = (lpTokens * uint256(Constants.INTERNAL_TOKEN_PRECISION)) / POOL_PRECISION();\n        } else {\n            vaultShares = (lpTokens * state.totalVaultSharesGlobal) / state.totalPoolClaim;\n        }\n\n        // Updates internal storage here\n        state.totalPoolClaim += lpTokens;\n        state.totalVaultSharesGlobal += vaultShares.toUint80();\n        state.setStrategyVaultState();\n```\n
MEDIUM severity: Vulnerable function: ```\n    require(\n        _commitment.principalTokenAddress ==\n            com. ```\n    require(\n        _commitment.principalTokenAddress ==\n            commitments[_commitmentId].principalTokenAddress,\n        "Principal token address cannot be updated."\n    );\n    require(\n        _commitment.marketId == commitments[_commitmentId].marketId,\n        "Market Id cannot 

Vulnerable code:
```\n    require(\n        _commitment.principalTokenAddress ==\n            commitments[_commitmentId].principalTokenAddress,\n        "Principal token address cannot be updated."\n    );\n    require(\n        _commitment.marketId == commitments[_commitmentId].marketId,\n        "Market Id cannot be updated."\n    );\n\n    commitments[_commitmentId] = _commitment;\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction \_afterMint() internal override {\n    IPCVSwapper(target).swap();\n}\n```\n. ```\nfunction \_afterMint() internal override {\n    IPCVSwapper(target).swap();\n}\n```\n

Vulnerable code:
```\nfunction \_afterMint() internal override {\n    IPCVSwapper(target).swap();\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    if (self.delta == GMXTypes.Delta.Neutral) {\n      (uint256 _tokenAWeig. ```\n    if (self.delta == GMXTypes.Delta.Neutral) {\n      (uint256 _tokenAWeight, ) = tokenWeights(self);\n\n\n      uint256 _maxTokenALending = convertToUsdValue(\n        self,\n        address(self.tokenA),\n        self.tokenALendingVault.totalAvailableAsset()\n      ) * SAFE_MULTIPLIER\n     

Vulnerable code:
```\n    if (self.delta == GMXTypes.Delta.Neutral) {\n      (uint256 _tokenAWeight, ) = tokenWeights(self);\n\n\n      uint256 _maxTokenALending = convertToUsdValue(\n        self,\n        address(self.tokenA),\n        self.tokenALendingVault.totalAvailableAsset()\n      ) * SAFE_MULTIPLIER\n        / (self.leverage * _tokenAWeight / SAFE_MULTIPLIER);\n\n\n      uint256 _maxTokenBLending = convertToUsdValue(\n        self,\n        address(self.tokenB),\n        self.tokenBLendingVault.totalAvailableAsset()\n      ) * SAFE_MULTIPLIER\n        / (self.leverage * _tokenAWeight / SAFE_MULTIPLIER)\n        - 1e18;\n```\n
HIGH severity: Vulnerable function: ```\nLien storage lien = lienData[lienId];\nlien.amount = _getOwed(lien); // @au. ```\nLien storage lien = lienData[lienId];\nlien.amount = _getOwed(lien); // @audit current debt, including accrued interest; saved to storage!\n```\n

Vulnerable code:
```\nLien storage lien = lienData[lienId];\nlien.amount = _getOwed(lien); // @audit current debt, including accrued interest; saved to storage!\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction getTokenVotingPower(uint _tokenId) public override view returns (uint) {\n      if (ow. ```\nfunction getTokenVotingPower(uint _tokenId) public override view returns (uint) {\n      if (ownerOf(_tokenId) == address(0)) revert NonExistentToken();\n\n      // If tokenId < 10000, it's a FrankenPunk, so 100/100 = a multiplier of 1\n      uint multiplier = _tokenId < 10_000 ? PERCENT : mons

Vulnerable code:
```\nfunction getTokenVotingPower(uint _tokenId) public override view returns (uint) {\n      if (ownerOf(_tokenId) == address(0)) revert NonExistentToken();\n\n      // If tokenId < 10000, it's a FrankenPunk, so 100/100 = a multiplier of 1\n      uint multiplier = _tokenId < 10_000 ? PERCENT : monsterMultiplier;\n      \n      // evilBonus will return 0 for all FrankenMonsters, as they are not eligible for the evil bonus\n      return ((baseVotes * multiplier) / PERCENT) + stakedTimeBonus[_tokenId] + evilBonus(_tokenId);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nrequire(\n  msg.sender == address(_getPool(tokenIn, tokenOut, fee)),\n  'Ro. ```\nrequire(\n  msg.sender == address(_getPool(tokenIn, tokenOut, fee)),\n  'Router: invalid callback sender'\n);\n```\n

Vulnerable code:
```\nrequire(\n  msg.sender == address(_getPool(tokenIn, tokenOut, fee)),\n  'Router: invalid callback sender'\n);\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: SecondaryRewarder.sol\n    function _claimRewards(address account, uint256 nTokenBalanceB. ```\nFile: SecondaryRewarder.sol\n    function _claimRewards(address account, uint256 nTokenBalanceBefore, uint256 nTokenBalanceAfter) private { \n        uint256 rewardToClaim = _calculateRewardToClaim(account, nTokenBalanceBefore, accumulatedRewardPerNToken); \n\n        // Precision here is:\n   

Vulnerable code:
```\nFile: SecondaryRewarder.sol\n    function _claimRewards(address account, uint256 nTokenBalanceBefore, uint256 nTokenBalanceAfter) private { \n        uint256 rewardToClaim = _calculateRewardToClaim(account, nTokenBalanceBefore, accumulatedRewardPerNToken); \n\n        // Precision here is:\n        //  nTokenBalanceAfter (INTERNAL_TOKEN_PRECISION) \n        //  accumulatedRewardPerNToken (INCENTIVE_ACCUMULATION_PRECISION) \n        // DIVIDE BY\n        //  INTERNAL_TOKEN_PRECISION \n        //  => INCENTIVE_ACCUMULATION_PRECISION (1e18) \n        rewardDebtPerAccount[account] = nTokenBalanceAfter \n            .mul(accumulatedRewardPerNToken)\n            .div(uint256(Constants.INTERNAL_TOKEN_PRECISION))\n            .toUint128(); \n\n        if (0 < rewardToClaim) { \n            GenericToken.safeTransferOut(REWARD_TOKEN, account, rewardToClaim); \n            emit RewardTransfer(REWARD_TOKEN, account, rewardToClaim);\n        }\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _canLiquidate(MTypes.MarginCallPrimary memory m)\n    private\n    view\n    returns (. ```\nfunction _canLiquidate(MTypes.MarginCallPrimary memory m)\n    private\n    view\n    returns (bool)\n{\n// rest of code      // [// rest of code]\n    uint256 timeDiff = LibOrders.getOffsetTimeHours() - m.short.updatedAt;\n    uint256 resetLiquidationTime = LibAsset.resetLiquidationTime(m.asse

Vulnerable code:
```\nfunction _canLiquidate(MTypes.MarginCallPrimary memory m)\n    private\n    view\n    returns (bool)\n{\n// rest of code      // [// rest of code]\n    uint256 timeDiff = LibOrders.getOffsetTimeHours() - m.short.updatedAt;\n    uint256 resetLiquidationTime = LibAsset.resetLiquidationTime(m.asset);\n❌  if (timeDiff >= resetLiquidationTime) {\n        return false;\n    } else {\n        uint256 secondLiquidationTime = LibAsset.secondLiquidationTime(m.asset);\n        bool isBetweenFirstAndSecondLiquidationTime = timeDiff\n            > LibAsset.firstLiquidationTime(m.asset) && timeDiff <= secondLiquidationTime\n            && s.flagMapping[m.short.flaggerId] == msg.sender;\n        bool isBetweenSecondAndResetLiquidationTime =\n            timeDiff > secondLiquidationTime && timeDiff <= resetLiquidationTime;\n        if (\n            !(\n                (isBetweenFirstAndSecondLiquidationTime)\n                    || (isBetweenSecondAndResetLiquidationTime)\n            )\n        ) {\n            revert Errors.MarginCallIneligibleWindow();\n        }\n        return true;\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    modifier onlyEOAEx() {\n        if (!allowContractCalls && !whitelisted. ```\n    modifier onlyEOAEx() {\n        if (!allowContractCalls && !whitelistedContracts[msg.sender]) {\n            if (msg.sender != tx.origin) revert NOT_EOA(msg.sender);\n        }\n        _;\n    }\n```\n

Vulnerable code:
```\n    modifier onlyEOAEx() {\n        if (!allowContractCalls && !whitelistedContracts[msg.sender]) {\n            if (msg.sender != tx.origin) revert NOT_EOA(msg.sender);\n        }\n        _;\n    }\n```\n
HIGH severity: Vulnerable function: ```\n    1 2 3 4 5 6 7 8 9 < block number\nO1: A B B B B C C C D\nA A B B B B C . ```\n    1 2 3 4 5 6 7 8 9 < block number\nO1: A B B B B C C C D\nA A B B B B C C C\n^^ grouped oracle block ranges\n```\n

Vulnerable code:
```\n    1 2 3 4 5 6 7 8 9 < block number\nO1: A B B B B C C C D\nA A B B B B C C C\n^^ grouped oracle block ranges\n```\n
MEDIUM severity: Vulnerable function: ```\n    function reinvestReward(\n        MetaStable2TokenAuraStrategyContext calldata context,\n  . ```\n    function reinvestReward(\n        MetaStable2TokenAuraStrategyContext calldata context,\n        ReinvestRewardParams calldata params\n    )\n```\n

Vulnerable code:
```\n    function reinvestReward(\n        MetaStable2TokenAuraStrategyContext calldata context,\n        ReinvestRewardParams calldata params\n    )\n```\n
HIGH severity: Vulnerable function: ```\n    if (amountToSwap > 0) {\n        SWAP_POOL = IUniswapV3Pool(vault.pool(. ```\n    if (amountToSwap > 0) {\n        SWAP_POOL = IUniswapV3Pool(vault.pool());\n        uint160 deltaSqrt = (param.sqrtRatioLimit *\n            uint160(param.sellSlippage)) / uint160(Constants.DENOMINATOR);\n        SWAP_POOL.swap(\n            address(this),\n            // if withdraw token 

Vulnerable code:
```\n    if (amountToSwap > 0) {\n        SWAP_POOL = IUniswapV3Pool(vault.pool());\n        uint160 deltaSqrt = (param.sqrtRatioLimit *\n            uint160(param.sellSlippage)) / uint160(Constants.DENOMINATOR);\n        SWAP_POOL.swap(\n            address(this),\n            // if withdraw token is Token0, then swap token1 -> token0 (false)\n            !isTokenA,\n            amountToSwap.toInt256(),\n            isTokenA\n                ? param.sqrtRatioLimit + deltaSqrt\n                : param.sqrtRatioLimit - deltaSqrt, // slippaged price cap\n            abi.encode(address(this))\n        );\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction getRoundData(uint80 _roundId)\n    public\n    view\n    virtual\n    override\n    re. ```\nfunction getRoundData(uint80 _roundId)\n    public\n    view\n    virtual\n    override\n    returns (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 answeredInRound\n    )\n  {\n    (uint16 phaseId, uint64 aggregatorRoundId) = par

Vulnerable code:
```\nfunction getRoundData(uint80 _roundId)\n    public\n    view\n    virtual\n    override\n    returns (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 answeredInRound\n    )\n  {\n    (uint16 phaseId, uint64 aggregatorRoundId) = parseIds(_roundId);\n\n    (\n      uint80 roundId,\n      int256 answer,\n      uint256 startedAt,\n      uint256 updatedAt,\n      uint80 ansIn\n    ) = phaseAggregators[phaseId].getRoundData(aggregatorRoundId);\n\n    return addPhaseIds(roundId, answer, startedAt, updatedAt, ansIn, phaseId);\n  }\n```\n
MEDIUM severity: Vulnerable function: ```\n function test_protocol_owner_frontRuns_swaps_with_higher_fees() public whenMaturityNotPassed {. ```\n function test_protocol_owner_frontRuns_swaps_with_higher_fees() public whenMaturityNotPassed {\n        // pre-condition\n        vm.warp(maturity - 30 days);\n        deal(address(pts[0]), alice, type(uint96).max, false); // ensure alice has enough pt\n        uint256 preBaseLptSupply = tricr

Vulnerable code:
```\n function test_protocol_owner_frontRuns_swaps_with_higher_fees() public whenMaturityNotPassed {\n        // pre-condition\n        vm.warp(maturity - 30 days);\n        deal(address(pts[0]), alice, type(uint96).max, false); // ensure alice has enough pt\n        uint256 preBaseLptSupply = tricrypto.totalSupply();\n        uint256 ptInDesired = 100 * ONE_UNDERLYING;\n        uint256 expectedBaseLptIssued = tricrypto.calc_token_amount([ptInDesired, 0, 0], true);\n\n        // Pool owner sees swap about to occur and front runs updating fees to max value\n        vm.startPrank(owner);\n        pool.setFeeParameter("protocolFeePercent", 100);\n        vm.stopPrank();\n\n        // execute\n        vm.prank(alice);\n        uint256 underlyingOut = pool.swapPtForUnderlying(\n            0, ptInDesired, recipient, abi.encode(CallbackInputType.SwapPtForUnderlying, SwapInput(underlying, pts[0]))\n        );\n        // sanity check\n        uint256 protocolFee = SwapEventsLib.getProtocolFeeFromLastSwapEvent(pool);\n        assertGt(protocolFee, 0, "fee should be charged");\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n _require(minPrice <= price && price <= maxPrice, Errors.PRICE_INVALID);\n`. ```\n _require(minPrice <= price && price <= maxPrice, Errors.PRICE_INVALID);\n```\n

Vulnerable code:
```\n _require(minPrice <= price && price <= maxPrice, Errors.PRICE_INVALID);\n```\n
MEDIUM severity: Vulnerable function: ```\nrequire(block.timestamp >= \_d.withdrawalRequestTime + TBTCConstants.getInc. ```\nrequire(block.timestamp >= \_d.withdrawalRequestTime + TBTCConstants.getIncreaseFeeTimer(), "Fee increase not yet permitted");\n```\n

Vulnerable code:
```\nrequire(block.timestamp >= \_d.withdrawalRequestTime + TBTCConstants.getIncreaseFeeTimer(), "Fee increase not yet permitted");\n```\n
HIGH severity: Vulnerable function: ```\nslot0 = slot0_ | ((block.timestamp + LIQUIDATION_GRACE_PERIOD) << 208);\n``. ```\nslot0 = slot0_ | ((block.timestamp + LIQUIDATION_GRACE_PERIOD) << 208);\n```\n

Vulnerable code:
```\nslot0 = slot0_ | ((block.timestamp + LIQUIDATION_GRACE_PERIOD) << 208);\n```\n
HIGH severity: Vulnerable function: ```\nfunction update(\n    Account memory self,\n    uint256 currentId,\n    UFixed6 assets,\n    UF. ```\nfunction update(\n    Account memory self,\n    uint256 currentId,\n    UFixed6 assets,\n    UFixed6 shares,\n    UFixed6 deposit,\n    UFixed6 redemption\n) internal pure {\n    self.current = currentId;\n    // @audit global account will have less assets and shares than sum of local accounts\

Vulnerable code:
```\nfunction update(\n    Account memory self,\n    uint256 currentId,\n    UFixed6 assets,\n    UFixed6 shares,\n    UFixed6 deposit,\n    UFixed6 redemption\n) internal pure {\n    self.current = currentId;\n    // @audit global account will have less assets and shares than sum of local accounts\n    (self.assets, self.shares) = (self.assets.sub(assets), self.shares.sub(shares));\n    (self.deposit, self.redemption) = (self.deposit.add(deposit), self.redemption.add(redemption));\n}\n```\n
HIGH severity: Vulnerable function: ```\n    for (uint256 i; i < numRecipients; ) {\n        expectedTotalValue += a. ```\n    for (uint256 i; i < numRecipients; ) {\n        expectedTotalValue += amounts[i];\n\n        unchecked {\n            ++i;\n        }\n    }\n\n    if (msg.value != expectedTotalValue) {\n        revert INVALID_DEPOSIT();\n    }\n```\n

Vulnerable code:
```\n    for (uint256 i; i < numRecipients; ) {\n        expectedTotalValue += amounts[i];\n\n        unchecked {\n            ++i;\n        }\n    }\n\n    if (msg.value != expectedTotalValue) {\n        revert INVALID_DEPOSIT();\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n  if (token == quoteAsset || token == baseAsset || token == weth) {\n      . ```\n  if (token == quoteAsset || token == baseAsset || token == weth) {\n      revert CannotRecoverRestrictedToken(address(this));\n    }\n        token.transfer(recipient, token.balanceOf(address(this)));\n```\n

Vulnerable code:
```\n  if (token == quoteAsset || token == baseAsset || token == weth) {\n      revert CannotRecoverRestrictedToken(address(this));\n    }\n        token.transfer(recipient, token.balanceOf(address(this)));\n```\n
HIGH severity: Vulnerable function: ```\nfunc MigrateWithdrawal(withdrawal *LegacyWithdrawal, l1CrossDomainMessenger. ```\nfunc MigrateWithdrawal(withdrawal *LegacyWithdrawal, l1CrossDomainMessenger *common.Address) (*Withdrawal, error) {\n // Attempt to parse the value\n value, err := withdrawal.Value()\n if err != nil {\n  return nil, fmt.Errorf("cannot migrate withdrawal: %w", err)\n }\n\n abi, err := bindings.L

Vulnerable code:
```\nfunc MigrateWithdrawal(withdrawal *LegacyWithdrawal, l1CrossDomainMessenger *common.Address) (*Withdrawal, error) {\n // Attempt to parse the value\n value, err := withdrawal.Value()\n if err != nil {\n  return nil, fmt.Errorf("cannot migrate withdrawal: %w", err)\n }\n\n abi, err := bindings.L1CrossDomainMessengerMetaData.GetAbi()\n if err != nil {\n  return nil, err\n }\n\n // Migrated withdrawals are specified as version 0. Both the\n // L2ToL1MessagePasser and the CrossDomainMessenger use the same\n // versioning scheme. Both should be set to version 0\n versionedNonce := EncodeVersionedNonce(withdrawal.XDomainNonce, new(big.Int))\n // Encode the call to `relayMessage` on the `CrossDomainMessenger`.\n // The minGasLimit can safely be 0 here.\n data, err := abi.Pack(\n  "relayMessage",\n  versionedNonce,\n  withdrawal.XDomainSender,\n  withdrawal.XDomainTarget,\n  value,\n  new(big.Int), // <= THIS IS THE INNER GAS LIMIT BEING SET TO ZERO\n  []byte(withdrawal.XDomainData),\n )\n if err != nil {\n  return nil, fmt.Errorf("cannot abi encode relayMessage: %w", err)\n }\n\n gasLimit := MigrateWithdrawalGasLimit(data)\n\n w := NewWithdrawal(\n  versionedNonce,\n  &predeploys.L2CrossDomainMessengerAddr,\n  l1CrossDomainMessenger,\n  value,\n  new(big.Int).SetUint64(gasLimit), // <= THIS IS THE OUTER GAS LIMIT BEING SET\n  data,\n )\n return w, nil\n}\n```\n