Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\nstakingContext.auraRewardPool.withdrawAndUnwrap(bptClaim, false);\n```\n. ```\nstakingContext.auraRewardPool.withdrawAndUnwrap(bptClaim, false);\n```\n

Vulnerable code:
```\nstakingContext.auraRewardPool.withdrawAndUnwrap(bptClaim, false);\n```\n
MEDIUM severity: Vulnerable function: ```\n    function getEthPrice() internal view returns (uint) {\n        (, int answer,, uint updated. ```\n    function getEthPrice() internal view returns (uint) {\n        (, int answer,, uint updatedAt,) =\n            ethUsdPriceFeed.latestRoundData();\n\n        if (block.timestamp - updatedAt >= 86400)\n            revert Errors.StalePrice(address(0), address(ethUsdPriceFeed));\n\n        if (

Vulnerable code:
```\n    function getEthPrice() internal view returns (uint) {\n        (, int answer,, uint updatedAt,) =\n            ethUsdPriceFeed.latestRoundData();\n\n        if (block.timestamp - updatedAt >= 86400)\n            revert Errors.StalePrice(address(0), address(ethUsdPriceFeed));\n\n        if (answer <= 0)\n            revert Errors.NegativePrice(address(0), address(ethUsdPriceFeed));\n\n        return uint(answer);\n    }\n```\n
HIGH severity: Vulnerable function: ```\nFile: contracts\OperatorTokenomics\SponsorshipPolicies\VoteKickPolicy.sol\n    function _endVot. ```\nFile: contracts\OperatorTokenomics\SponsorshipPolicies\VoteKickPolicy.sol\n    function _endVote(address target) internal {\n        address flagger = flaggerAddress[target];\n        bool flaggerIsGone = stakedWei[flagger] == 0;\n        bool targetIsGone = stakedWei[target] == 0;\n        uin

Vulnerable code:
```\nFile: contracts\OperatorTokenomics\SponsorshipPolicies\VoteKickPolicy.sol\n    function _endVote(address target) internal {\n        address flagger = flaggerAddress[target];\n        bool flaggerIsGone = stakedWei[flagger] == 0;\n        bool targetIsGone = stakedWei[target] == 0;\n        uint reviewerCount = reviewers[target].length;\n        // release stake locks before vote resolution so that slashings and kickings during resolution aren't affected\n        // if either the flagger or the target has forceUnstaked or been kicked, the lockedStakeWei was moved to forfeitedStakeWei\n        if (flaggerIsGone) {\n            forfeitedStakeWei -= flagStakeWei[target];\n        } else {\n            lockedStakeWei[flagger] -= flagStakeWei[target];\n        }\n        if (targetIsGone) {\n            forfeitedStakeWei -= targetStakeAtRiskWei[target];\n        } else {\n            lockedStakeWei[target] -= targetStakeAtRiskWei[target]; //@audit revert after forceUnstake() => stake() again\n        }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction matchOrders(\n    LibOrder.Order memory leftOrder,\n    LibOrder.Order memory rightOrd. ```\nfunction matchOrders(\n    LibOrder.Order memory leftOrder,\n    LibOrder.Order memory rightOrder,\n    bytes memory leftSignature,\n    bytes memory rightSignature\n)\n```\n

Vulnerable code:
```\nfunction matchOrders(\n    LibOrder.Order memory leftOrder,\n    LibOrder.Order memory rightOrder,\n    bytes memory leftSignature,\n    bytes memory rightSignature\n)\n```\n
HIGH severity: Vulnerable function: ```\nfunction \_beforeTokenTransfer(\n    address operator,\n    address from,\n    address to,\n   . ```\nfunction \_beforeTokenTransfer(\n    address operator,\n    address from,\n    address to,\n    uint256[] memory ids,\n    uint256[] memory amounts,\n    bytes memory data\n) internal virtual override {\n    for (uint256 i = 0; i < ids.length; i++) {\n        if (FortaStakingUtils.isActive(ids[

Vulnerable code:
```\nfunction \_beforeTokenTransfer(\n    address operator,\n    address from,\n    address to,\n    uint256[] memory ids,\n    uint256[] memory amounts,\n    bytes memory data\n) internal virtual override {\n    for (uint256 i = 0; i < ids.length; i++) {\n        if (FortaStakingUtils.isActive(ids[i])) {\n            uint8 subjectType = FortaStakingUtils.subjectTypeOfShares(ids[i]);\n            if (subjectType == DELEGATOR\_NODE\_RUNNER\_SUBJECT && to != address(0) && from != address(0)) {\n                \_allocator.didTransferShares(ids[i], subjectType, from, to, amounts[i]);\n            }\n```\n
MEDIUM severity: Vulnerable function: ```\n    for (uint256 i = 0; i < rewardTokens.length; i++) {\n        uint256 re. ```\n    for (uint256 i = 0; i < rewardTokens.length; i++) {\n        uint256 rewards = _doCutRewardsFee(rewardTokens[i]);\n        _ensureApprove(rewardTokens[i], address(swapRouter), rewards);\n        swapRouter.swapExactTokensForTokens(\n            rewards,\n            0,\n            swapPath

Vulnerable code:
```\n    for (uint256 i = 0; i < rewardTokens.length; i++) {\n        uint256 rewards = _doCutRewardsFee(rewardTokens[i]);\n        _ensureApprove(rewardTokens[i], address(swapRouter), rewards);\n        swapRouter.swapExactTokensForTokens(\n            rewards,\n            0,\n            swapPath[i],\n            address(this),\n            type(uint256).max\n        );\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _swapPTsForTarget(\n    address adapter,\n    uint256 maturity,\n    uint256 ptBal,\n . ```\nfunction _swapPTsForTarget(\n    address adapter,\n    uint256 maturity,\n    uint256 ptBal,\n    PermitData calldata permit\n) internal returns (uint256 tBal) {\n    _transferFrom(permit, divider.pt(adapter, maturity), ptBal);\n\n    if (divider.mscale(adapter, maturity) > 0) {\n        tBal =

Vulnerable code:
```\nfunction _swapPTsForTarget(\n    address adapter,\n    uint256 maturity,\n    uint256 ptBal,\n    PermitData calldata permit\n) internal returns (uint256 tBal) {\n    _transferFrom(permit, divider.pt(adapter, maturity), ptBal);\n\n    if (divider.mscale(adapter, maturity) > 0) {\n        tBal = divider.redeem(adapter, maturity, ptBal); <- @audit-issue always tries to redeem even if restricted\n    } else {\n        tBal = _balancerSwap(\n            divider.pt(adapter, maturity),\n            Adapter(adapter).target(),\n            ptBal,\n            BalancerPool(spaceFactory.pools(adapter, maturity)).getPoolId(),\n            0,\n            payable(address(this))\n        );\n    }\n}\n```\n
HIGH severity: Vulnerable function: ```\nfunction setVerifierAddress(address \_newVerifierAddress, uint256 \_proofType) external onlyRol. ```\nfunction setVerifierAddress(address \_newVerifierAddress, uint256 \_proofType) external onlyRole(DEFAULT\_ADMIN\_ROLE) {\n if (\_newVerifierAddress == address(0)) {\n revert ZeroAddressNotAllowed();\n }\n verifiers[\_proofType] = \_newVerifierAddress;\n}\n```\n

Vulnerable code:
```\nfunction setVerifierAddress(address \_newVerifierAddress, uint256 \_proofType) external onlyRole(DEFAULT\_ADMIN\_ROLE) {\n if (\_newVerifierAddress == address(0)) {\n revert ZeroAddressNotAllowed();\n }\n verifiers[\_proofType] = \_newVerifierAddress;\n}\n```\n
HIGH severity: Vulnerable function: ```\nfunction sendFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint _amount, a. ```\nfunction sendFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint _amount, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) public payable virtual override {\n    _send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaym

Vulnerable code:
```\nfunction sendFrom(address _from, uint16 _dstChainId, bytes calldata _toAddress, uint _amount, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) public payable virtual override {\n    _send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n/\*\*\n \* @dev returns true if the converter is active, false otherwise\n \*\n \* @return true. ```\n/\*\*\n \* @dev returns true if the converter is active, false otherwise\n \*\n \* @return true if the converter is active, false otherwise\n\*/\nfunction isActive() public view virtual override returns (bool) {\n    return anchor.owner() == address(this);\n}\n```\n

Vulnerable code:
```\n/\*\*\n \* @dev returns true if the converter is active, false otherwise\n \*\n \* @return true if the converter is active, false otherwise\n\*/\nfunction isActive() public view virtual override returns (bool) {\n    return anchor.owner() == address(this);\n}\n```\n
HIGH severity: Vulnerable function: ```\n    bool isToken0Weth;\n    _permit2Add(params_, amount0, amount1, token0, . ```\n    bool isToken0Weth;\n    _permit2Add(params_, amount0, amount1, token0, token1);\n\n    _addLiquidity(\n        params_.addData.vault,\n        amount0,\n        amount1,\n        sharesReceived,\n        params_.addData.gauge,\n        params_.addData.receiver,\n        token0,\n        tok

Vulnerable code:
```\n    bool isToken0Weth;\n    _permit2Add(params_, amount0, amount1, token0, token1);\n\n    _addLiquidity(\n        params_.addData.vault,\n        amount0,\n        amount1,\n        sharesReceived,\n        params_.addData.gauge,\n        params_.addData.receiver,\n        token0,\n        token1\n    );\n\n    if (msg.value > 0) {\n        if (isToken0Weth && msg.value > amount0) {\n            payable(msg.sender).sendValue(msg.value - amount0);\n        } else if (!isToken0Weth && msg.value > amount1) {\n            payable(msg.sender).sendValue(msg.value - amount1);\n        }\n    }\n```\n
HIGH severity: Vulnerable function: ```\nif (\_isPurchased[delegationId]) {\n    address holder = delegation.holder;. ```\nif (\_isPurchased[delegationId]) {\n    address holder = delegation.holder;\n    \_totalDelegated[holder] += delegation.amount;\n    if (\_totalDelegated[holder] >= \_purchased[holder]) {\n        purchasedToUnlocked(holder);\n    }\n```\n

Vulnerable code:
```\nif (\_isPurchased[delegationId]) {\n    address holder = delegation.holder;\n    \_totalDelegated[holder] += delegation.amount;\n    if (\_totalDelegated[holder] >= \_purchased[holder]) {\n        purchasedToUnlocked(holder);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: wfCashLogic.sol\n    /// @dev Sells an fCash share back on the Notional AMM\n    function. ```\nFile: wfCashLogic.sol\n    /// @dev Sells an fCash share back on the Notional AMM\n    function _sellfCash(\n        address receiver,\n        uint256 fCashToSell,\n        uint32 maxImpliedRate\n    ) private returns (uint256 tokensTransferred) {\n        (IERC20 token, bool isETH) = getToken

Vulnerable code:
```\nFile: wfCashLogic.sol\n    /// @dev Sells an fCash share back on the Notional AMM\n    function _sellfCash(\n        address receiver,\n        uint256 fCashToSell,\n        uint32 maxImpliedRate\n    ) private returns (uint256 tokensTransferred) {\n        (IERC20 token, bool isETH) = getToken(true); \n        uint256 balanceBefore = isETH ? WETH.balanceOf(address(this)) : token.balanceOf(address(this)); \n        uint16 currencyId = getCurrencyId(); \n\n        (uint256 initialCashBalance, uint256 fCashBalance) = getBalances(); \n        bool hasInsufficientfCash = fCashBalance < fCashToSell; \n\n        uint256 primeCashToWithdraw; \n        if (hasInsufficientfCash) {\n            // If there is insufficient fCash, calculate how much prime cash would be purchased if the\n            // given fCash amount would be sold and that will be how much the wrapper will withdraw and\n            // send to the receiver. Since fCash always sells at a discount to underlying prior to maturity,\n            // the wrapper is guaranteed to have sufficient cash to send to the account.\n            (/* */, primeCashToWithdraw, /* */, /* */) = NotionalV2.getPrincipalFromfCashBorrow( \n                currencyId,\n                fCashToSell, \n                getMaturity(),\n                0, \n                block.timestamp\n            ); \n            // If this is zero then it signifies that the trade will fail.\n            require(primeCashToWithdraw > 0, "Redeem Failed"); \n\n            // Re-write the fCash to sell to the entire fCash balance.\n            fCashToSell = fCashBalance;\n        }\n```\n
MEDIUM severity: Vulnerable function: ```\n    if (obtainedPremium > premium) {\n        baseToken.safeTransferFrom(ad. ```\n    if (obtainedPremium > premium) {\n        baseToken.safeTransferFrom(address(this), msg.sender, obtainedPremium - premium);\n    }\n```\n

Vulnerable code:
```\n    if (obtainedPremium > premium) {\n        baseToken.safeTransferFrom(address(this), msg.sender, obtainedPremium - premium);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction importScore(address \_worker)\nexternal override\n{\n require(!m\_v3\_scoreImported[\_. ```\nfunction importScore(address \_worker)\nexternal override\n{\n require(!m\_v3\_scoreImported[\_worker], "score-already-imported");\n m\_workerScores[\_worker] = m\_workerScores[\_worker].max(m\_v3\_iexecHub.viewScore(\_worker));\n m\_v3\_scoreImported[\_worker] = true;\n}\n```\n

Vulnerable code:
```\nfunction importScore(address \_worker)\nexternal override\n{\n require(!m\_v3\_scoreImported[\_worker], "score-already-imported");\n m\_workerScores[\_worker] = m\_workerScores[\_worker].max(m\_v3\_iexecHub.viewScore(\_worker));\n m\_v3\_scoreImported[\_worker] = true;\n}\n```\n
HIGH severity: Vulnerable function: ```\nrouter = ISwapRouter(\_router);\nuint256 amountOut;\nuint256 swap;\nif(swap. ```\nrouter = ISwapRouter(\_router);\nuint256 amountOut;\nuint256 swap;\nif(swapAmount < 0) {\n    //swap token1 for token0\n\n    swap = uint256(swapAmount \* -1);\n    IHypervisor(pos).token1().transferFrom(msg.sender, address(this), deposit1+swap);\n    amountOut = router.exactInput(\n        ISw

Vulnerable code:
```\nrouter = ISwapRouter(\_router);\nuint256 amountOut;\nuint256 swap;\nif(swapAmount < 0) {\n    //swap token1 for token0\n\n    swap = uint256(swapAmount \* -1);\n    IHypervisor(pos).token1().transferFrom(msg.sender, address(this), deposit1+swap);\n    amountOut = router.exactInput(\n        ISwapRouter.ExactInputParams(\n            path,\n            address(this),\n            block.timestamp + swapLife,\n            swap,\n            deposit0\n        )\n    );\n}\nelse{\n    //swap token1 for token0\n    swap = uint256(swapAmount);\n    IHypervisor(pos).token0().transferFrom(msg.sender, address(this), deposit0+swap);\n\n    amountOut = router.exactInput(\n        ISwapRouter.ExactInputParams(\n            path,\n            address(this),\n            block.timestamp + swapLife,\n            swap,\n            deposit1\n        )\n    );     \n}\n```\n
HIGH severity: Vulnerable function: ```\n\_addL2MerkleRoots(\_finalizationData.l2MerkleRoots, \_finalizationData.l2M. ```\n\_addL2MerkleRoots(\_finalizationData.l2MerkleRoots, \_finalizationData.l2MerkleTreesDepth);\n\_anchorL2MessagingBlocks(\_finalizationData.l2MessagingBlocksOffsets, lastFinalizedBlock);\n```\n

Vulnerable code:
```\n\_addL2MerkleRoots(\_finalizationData.l2MerkleRoots, \_finalizationData.l2MerkleTreesDepth);\n\_anchorL2MessagingBlocks(\_finalizationData.l2MessagingBlocksOffsets, lastFinalizedBlock);\n```\n
HIGH severity: Vulnerable function: ```\nif (to != address(this)) {\n    _updateFeeRewards(to);\n}\n```\n. ```\nif (to != address(this)) {\n    _updateFeeRewards(to);\n}\n```\n

Vulnerable code:
```\nif (to != address(this)) {\n    _updateFeeRewards(to);\n}\n```\n
HIGH severity: Vulnerable function: ```\ncontract LybraWstETHVault is LybraPeUSDVaultBase {\n Ilido immutable lido;\n //WstETH = 0x7f39C. ```\ncontract LybraWstETHVault is LybraPeUSDVaultBase {\n Ilido immutable lido;\n //WstETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n //Lido = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n constructor(address \_lido, address \_asset, address \_oracle, address \_config) LybraPeUSDVaultBase(\_ass

Vulnerable code:
```\ncontract LybraWstETHVault is LybraPeUSDVaultBase {\n Ilido immutable lido;\n //WstETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n //Lido = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n constructor(address \_lido, address \_asset, address \_oracle, address \_config) LybraPeUSDVaultBase(\_asset, \_oracle, \_config) {\n lido = Ilido(\_lido);\n }\n\n function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, "DNL");\n uint256 sharesAmount = lido.submit{value: msg.value}(address(configurator));\n require(sharesAmount != 0, "ZERO\_DEPOSIT");\n lido.approve(address(collateralAsset), msg.value);\n uint256 wstETHAmount = IWstETH(address(collateralAsset)).wrap(msg.value);\n depositedAsset[msg.sender] += wstETHAmount;\n if (mintAmount > 0) {\n \_mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,wstETHAmount, block.timestamp);\n }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction governorAddPoolMultiplier(\n uint256 \_pid,\n uint64 lockLength,\n uint64 newRewardsMu. ```\nfunction governorAddPoolMultiplier(\n uint256 \_pid,\n uint64 lockLength,\n uint64 newRewardsMultiplier\n) external onlyGovernor {\n PoolInfo storage pool = poolInfo[\_pid];\n uint256 currentMultiplier = rewardMultipliers[\_pid][lockLength];\n // if the new multplier is less than the current mu

Vulnerable code:
```\nfunction governorAddPoolMultiplier(\n uint256 \_pid,\n uint64 lockLength,\n uint64 newRewardsMultiplier\n) external onlyGovernor {\n PoolInfo storage pool = poolInfo[\_pid];\n uint256 currentMultiplier = rewardMultipliers[\_pid][lockLength];\n // if the new multplier is less than the current multiplier,\n // then, you need to unlock the pool to allow users to withdraw\n if (newRewardsMultiplier < currentMultiplier) {\n pool.unlocked = true;\n }\n rewardMultipliers[\_pid][lockLength] = newRewardsMultiplier;\n\n emit LogPoolMultiplier(\_pid, lockLength, newRewardsMultiplier);\n}\n```\n
HIGH severity: Vulnerable function: ```\nFile: Curve2TokenConvexHelper.sol\n    function _executeSettlement(\n        StrategyContext ca. ```\nFile: Curve2TokenConvexHelper.sol\n    function _executeSettlement(\n        StrategyContext calldata strategyContext,\n        Curve2TokenPoolContext calldata poolContext,\n        uint256 maturity,\n        uint256 poolClaimToSettle,\n        uint256 redeemStrategyTokenAmount,\n        Redeem

Vulnerable code:
```\nFile: Curve2TokenConvexHelper.sol\n    function _executeSettlement(\n        StrategyContext calldata strategyContext,\n        Curve2TokenPoolContext calldata poolContext,\n        uint256 maturity,\n        uint256 poolClaimToSettle,\n        uint256 redeemStrategyTokenAmount,\n        RedeemParams memory params\n    ) private {\n        (uint256 spotPrice, uint256 oraclePrice) = poolContext._getSpotPriceAndOraclePrice(strategyContext);\n\n        /// @notice params.minPrimary and params.minSecondary are not required to be passed in by the caller\n        /// for this strategy vault\n        (params.minPrimary, params.minSecondary) = poolContext.basePool._getMinExitAmounts({\n            strategyContext: strategyContext,\n            oraclePrice: oraclePrice,\n            spotPrice: spotPrice,\n            poolClaim: poolClaimToSettle\n        });\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: VaultAccountAction.sol\n    function exitVault(\n        address account,\n        addres. ```\nFile: VaultAccountAction.sol\n    function exitVault(\n        address account,\n        address vault,\n        address receiver,\n        uint256 vaultSharesToRedeem,\n        uint256 lendAmount,\n        uint32 minLendRate,\n        bytes calldata exitVaultData\n    ) external payable overri

Vulnerable code:
```\nFile: VaultAccountAction.sol\n    function exitVault(\n        address account,\n        address vault,\n        address receiver,\n        uint256 vaultSharesToRedeem,\n        uint256 lendAmount,\n        uint32 minLendRate,\n        bytes calldata exitVaultData\n    ) external payable override nonReentrant returns (uint256 underlyingToReceiver) {\n..SNIP..\n        // If insufficient strategy tokens are redeemed (or if it is set to zero), then\n        // redeem with debt repayment will recover the repayment from the account's wallet\n        // directly.\n        underlyingToReceiver = underlyingToReceiver.add(vaultConfig.redeemWithDebtRepayment(\n            vaultAccount, receiver, vaultSharesToRedeem, exitVaultData\n        ));\n```\n
MEDIUM severity: Vulnerable function: ```\nTransferUtils.sol\n    function _transferERC20(address token, address to, uint256 amount) inter. ```\nTransferUtils.sol\n    function _transferERC20(address token, address to, uint256 amount) internal {\n        IERC20 erc20 = IERC20(token);\n        require(erc20 != IERC20(address(0)), "Token Address is not an ERC20");\n        uint256 initialBalance = erc20.balanceOf(to);\n        require(erc

Vulnerable code:
```\nTransferUtils.sol\n    function _transferERC20(address token, address to, uint256 amount) internal {\n        IERC20 erc20 = IERC20(token);\n        require(erc20 != IERC20(address(0)), "Token Address is not an ERC20");\n        uint256 initialBalance = erc20.balanceOf(to);\n        require(erc20.transfer(to, amount), "ERC20 Transfer failed");//@audit-issue will revert for USDT\n        uint256 balance = erc20.balanceOf(to);\n        require(balance >= (initialBalance + amount), "ERC20 Balance check failed");\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction enableValidator(uint validatorId) external checkValidatorExists(validatorId) onlyOwner. ```\nfunction enableValidator(uint validatorId) external checkValidatorExists(validatorId) onlyOwner {\n    trustedValidators[validatorId] = true;\n}\n\nfunction disableValidator(uint validatorId) external checkValidatorExists(validatorId) onlyOwner {\n    trustedValidators[validatorId] = false;\n}\

Vulnerable code:
```\nfunction enableValidator(uint validatorId) external checkValidatorExists(validatorId) onlyOwner {\n    trustedValidators[validatorId] = true;\n}\n\nfunction disableValidator(uint validatorId) external checkValidatorExists(validatorId) onlyOwner {\n    trustedValidators[validatorId] = false;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function mint(address r, uint256 s) external override returns (uint256) {\n        if (bloc. ```\n    function mint(address r, uint256 s) external override returns (uint256) {\n        if (block.timestamp > maturity) {\n            revert Exception(\n                21,\n                block.timestamp,\n                maturity,\n                address(0),\n                address(0)\n   

Vulnerable code:
```\n    function mint(address r, uint256 s) external override returns (uint256) {\n        if (block.timestamp > maturity) {\n            revert Exception(\n                21,\n                block.timestamp,\n                maturity,\n                address(0),\n                address(0)\n            );\n        }\n        uint128 assets = Cast.u128(previewMint(s));\n        Safe.transferFrom(\n            IERC20(underlying),\n            msg.sender,\n            address(this),\n            assets\n        );\n        // consider the hardcoded slippage limit, 4626 compliance requires no minimum param.\n        uint128 returned = IMarketPlace(marketplace).sellUnderlying(\n            underlying,\n            maturity,\n            assets,\n            assets - (assets / 100)\n        );\n        _transfer(address(this), r, returned);\n        return returned;\n    }\n```\n