Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\n      function _swapFarmEmissionTokens() internal { IERC20Upgradeable boo = IERC20Upgradeable(B. ```\n      function _swapFarmEmissionTokens() internal { IERC20Upgradeable boo = IERC20Upgradeable(BOO);\n            uint256 booBalance = boo.balanceOf(address(this));\n      if (booToUsdcPath.length < 2 || booBalance == 0) {\n         return;\n      }\n         boo.safeIncreaseAllowance(SPOOKY_ROU

Vulnerable code:
```\n      function _swapFarmEmissionTokens() internal { IERC20Upgradeable boo = IERC20Upgradeable(BOO);\n            uint256 booBalance = boo.balanceOf(address(this));\n      if (booToUsdcPath.length < 2 || booBalance == 0) {\n         return;\n      }\n         boo.safeIncreaseAllowance(SPOOKY_ROUTER, booBalance);\n             uint256[] memory amounts = \n      IUniswapV2Router02(SPOOKY_ROUTER).getAmountsOut(booBalance, booToUsdcPath);\n          uint256 amountOutMin = (amounts[amounts.length - 1] * MAX_SLIPPAGE) / PERCENT_DIVISOR;\n            IUniswapV2Router02(SPOOKY_ROUTER).swapExactTokensForTokensSupportingFeeOnTransferTokens( booBalance, amountOutMin, booToUsdcPath, address(this), block.timestamp );\n                }\n```\n
HIGH severity: Vulnerable function: ```\nfor (uint i = 0; i < shares.length; ++i) {\n    skaleToken.send(address(ska. ```\nfor (uint i = 0; i < shares.length; ++i) {\n    skaleToken.send(address(skaleBalances), shares[i].amount, abi.encode(shares[i].holder));\n\n    uint created = delegationController.getDelegation(shares[i].delegationId).created;\n    uint delegationStarted = timeHelpers.getNextMonthStartFromDate(

Vulnerable code:
```\nfor (uint i = 0; i < shares.length; ++i) {\n    skaleToken.send(address(skaleBalances), shares[i].amount, abi.encode(shares[i].holder));\n\n    uint created = delegationController.getDelegation(shares[i].delegationId).created;\n    uint delegationStarted = timeHelpers.getNextMonthStartFromDate(created);\n    skaleBalances.lockBounty(shares[i].holder, timeHelpers.addMonths(delegationStarted, 3));\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction sendInterests(Loan storage loan, Provision storage provision) internal returns (uint25. ```\nfunction sendInterests(Loan storage loan, Provision storage provision) internal returns (uint256 sent) {\n    uint256 interests = loan.payment.paid - loan.lent;\n    if (interests == loan.payment.minInterestsToRepay) {\n        // this is the case if the loan is repaid shortly after issuance\n 

Vulnerable code:
```\nfunction sendInterests(Loan storage loan, Provision storage provision) internal returns (uint256 sent) {\n    uint256 interests = loan.payment.paid - loan.lent;\n    if (interests == loan.payment.minInterestsToRepay) {\n        // this is the case if the loan is repaid shortly after issuance\n        // each lender gets its minimal interest, as an anti ddos measure to spam offer\n        sent = provision.amount + (interests / loan.nbOfPositions);\n    } else {\n        /* provision.amount / lent = share of the interests belonging to the lender. The parenthesis make the\n        calculus in the order that maximizes precison */\n        sent = provision.amount + (interests * (provision.amount)) / loan.lent; <- audit-issue minimal interest isn't guaranteed\n    }\n    loan.assetLent.checkedTransfer(msg.sender, sent);\n}\n```\n
HIGH severity: Vulnerable function: ```\nfunction \_stakeDAIx(address \_user, uint256 \_amount, address \_policyBookAddr) internal {\n  . ```\nfunction \_stakeDAIx(address \_user, uint256 \_amount, address \_policyBookAddr) internal {\n    require (\_amount > 0, "BMIDAIStaking: Can't stake zero tokens");\n\n    PolicyBook \_policyBook = PolicyBook(\_policyBookAddr);\n    // transfer DAI from PolicyBook to yield generator\n    daiToken

Vulnerable code:
```\nfunction \_stakeDAIx(address \_user, uint256 \_amount, address \_policyBookAddr) internal {\n    require (\_amount > 0, "BMIDAIStaking: Can't stake zero tokens");\n\n    PolicyBook \_policyBook = PolicyBook(\_policyBookAddr);\n    // transfer DAI from PolicyBook to yield generator\n    daiToken.transferFrom(\_policyBookAddr, address(defiYieldGenerator), \_amount);            \n\n    // transfer bmiDAIx from user to staking\n    \_policyBook.transferFrom(\_user, address(this), \_amount);       \n\n    \_mintNFT(\_user, \_amount, \_policyBook);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _setTransceiver(address transceiver) internal returns (uint8 index) {\n    /* snip */\. ```\nfunction _setTransceiver(address transceiver) internal returns (uint8 index) {\n    /* snip */\n    if (transceiver == address(0)) {\n        revert InvalidTransceiverZeroAddress();\n    }\n\n    if (_numTransceivers.registered >= MAX_TRANSCEIVERS) {\n        revert TooManyTransceivers();\n    

Vulnerable code:
```\nfunction _setTransceiver(address transceiver) internal returns (uint8 index) {\n    /* snip */\n    if (transceiver == address(0)) {\n        revert InvalidTransceiverZeroAddress();\n    }\n\n    if (_numTransceivers.registered >= MAX_TRANSCEIVERS) {\n        revert TooManyTransceivers();\n    }\n\n    if (transceiverInfos[transceiver].registered) {\n        transceiverInfos[transceiver].enabled = true;\n    } else {\n    /* snip */\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    function triggerRoot() external {\n        bytes32 rootCandidateAValue = rootCandidateA.val. ```\n    function triggerRoot() external {\n        bytes32 rootCandidateAValue = rootCandidateA.value;\n        if (rootCandidateAValue != rootCandidateB.value || rootCandidateAValue == bytes32(0)) revert RootCandidatesInvalid();\n        root = Root({value: rootCandidateAValue, lastUpdatedAt: bloc

Vulnerable code:
```\n    function triggerRoot() external {\n        bytes32 rootCandidateAValue = rootCandidateA.value;\n        if (rootCandidateAValue != rootCandidateB.value || rootCandidateAValue == bytes32(0)) revert RootCandidatesInvalid();\n        root = Root({value: rootCandidateAValue, lastUpdatedAt: block.timestamp});\n        emit RootChanged(msg.sender, rootCandidateAValue);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nuint256 realDebt = borrows.div(record.interestIndex == 0 ? 1e18 : record.in. ```\nuint256 realDebt = borrows.div(record.interestIndex == 0 ? 1e18 : record.interestIndex).mul(info.borrowIndex);\n```\n

Vulnerable code:
```\nuint256 realDebt = borrows.div(record.interestIndex == 0 ? 1e18 : record.interestIndex).mul(info.borrowIndex);\n```\n
MEDIUM severity: Vulnerable function: ```\nmapping(uint256 => EnumerableSetUpgradeable.AddressSet)\n        internal commitmentBorrowersLi. ```\nmapping(uint256 => EnumerableSetUpgradeable.AddressSet)\n        internal commitmentBorrowersList;\n        \nfunction updateCommitmentBorrowers(\n        uint256 _commitmentId,\n        address[] calldata _borrowerAddressList\n    ) public commitmentLender(_commitmentId) {\n        delete comm

Vulnerable code:
```\nmapping(uint256 => EnumerableSetUpgradeable.AddressSet)\n        internal commitmentBorrowersList;\n        \nfunction updateCommitmentBorrowers(\n        uint256 _commitmentId,\n        address[] calldata _borrowerAddressList\n    ) public commitmentLender(_commitmentId) {\n        delete commitmentBorrowersList[_commitmentId];\n        _addBorrowersToCommitmentAllowlist(_commitmentId, _borrowerAddressList);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _prepareTake(\n        Liquidation memory liquidation_,\n        uint256 t0Debt_,\n   . ```\nfunction _prepareTake(\n        Liquidation memory liquidation_,\n        uint256 t0Debt_,\n        uint256 collateral_,\n        uint256 inflator_\n    ) internal view returns (TakeLocalVars memory vars) {\n // rest of code// rest of code..\n        vars.auctionPrice = _auctionPrice(liquidatio

Vulnerable code:
```\nfunction _prepareTake(\n        Liquidation memory liquidation_,\n        uint256 t0Debt_,\n        uint256 collateral_,\n        uint256 inflator_\n    ) internal view returns (TakeLocalVars memory vars) {\n // rest of code// rest of code..\n        vars.auctionPrice = _auctionPrice(liquidation_.referencePrice, kickTime);\n        vars.bondFactor   = liquidation_.bondFactor;\n        vars.bpf          = _bpf(\n            vars.borrowerDebt,\n            collateral_,\n            neutralPrice,\n            liquidation_.bondFactor,\n            vars.auctionPrice\n        );\n```\n
MEDIUM severity: Vulnerable function: ```\n    function _sendPayout(\n        address recipient_,\n        uint256 payoutAmount_,\n       . ```\n    function _sendPayout(\n        address recipient_,\n        uint256 payoutAmount_,\n        Routing memory routingParams_,\n        bytes memory\n    ) internal {\n        \n        if (fromVeecode(derivativeReference) == bytes7("")) {\n            Transfer.transfer(baseToken, recipient_, p

Vulnerable code:
```\n    function _sendPayout(\n        address recipient_,\n        uint256 payoutAmount_,\n        Routing memory routingParams_,\n        bytes memory\n    ) internal {\n        \n        if (fromVeecode(derivativeReference) == bytes7("")) {\n            Transfer.transfer(baseToken, recipient_, payoutAmount_, true);\n        }\n        else {\n            \n            DerivativeModule module = DerivativeModule(_getModuleIfInstalled(derivativeReference));\n\n            Transfer.approve(baseToken, address(module), payoutAmount_);\n\n=>          module.mint(\n                recipient_,\n                address(baseToken),\n                routingParams_.derivativeParams,\n                payoutAmount_,\n                routingParams_.wrapDerivative\n            );\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction init(address accountantaddress) external {\n    require(!initialized);\n    initialize. ```\nfunction init(address accountantaddress) external {\n    require(!initialized);\n    initialized = true;\n    accountant = zAuctionAccountant(accountantaddress);\n}\n```\n

Vulnerable code:
```\nfunction init(address accountantaddress) external {\n    require(!initialized);\n    initialized = true;\n    accountant = zAuctionAccountant(accountantaddress);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction checkGasV1(bytes calldata _message)\n        public\n        view\n        returns (ui. ```\nfunction checkGasV1(bytes calldata _message)\n        public\n        view\n        returns (uint256, uint256)\n    {\n        uint256 gas1 = gasleft();\n        bytes32 versionedHash = Hashing.hashCrossDomainMessageV1(\n            0,\n            address(this),\n            address(this),\n  

Vulnerable code:
```\nfunction checkGasV1(bytes calldata _message)\n        public\n        view\n        returns (uint256, uint256)\n    {\n        uint256 gas1 = gasleft();\n        bytes32 versionedHash = Hashing.hashCrossDomainMessageV1(\n            0,\n            address(this),\n            address(this),\n            0,\n            0,\n            _message\n        );\n        uint256 gas2 = gasleft();\n        return (_message.length, (gas1 - gas2));\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function claimReward() external onlyOwner {\n        for (uint256 marketId; marketId < tota. ```\n    function claimReward() external onlyOwner {\n        for (uint256 marketId; marketId < totalMarkets; marketId++) {\n            _registrations[marketId].read().market.claimReward();\n            _registrations[marketId].read().market.reward().push(factory().owner());\n        }\n    }\n```\

Vulnerable code:
```\n    function claimReward() external onlyOwner {\n        for (uint256 marketId; marketId < totalMarkets; marketId++) {\n            _registrations[marketId].read().market.claimReward();\n            _registrations[marketId].read().market.reward().push(factory().owner());\n        }\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: StrategyUtils.sol\n    function _checkPriceLimit(\n        StrategyContext memory strateg. ```\nFile: StrategyUtils.sol\n    function _checkPriceLimit(\n        StrategyContext memory strategyContext,\n        uint256 oraclePrice,\n        uint256 poolPrice\n    ) internal pure {\n        uint256 lowerLimit = (oraclePrice * \n            (VaultConstants.VAULT_PERCENT_BASIS - strategyConte

Vulnerable code:
```\nFile: StrategyUtils.sol\n    function _checkPriceLimit(\n        StrategyContext memory strategyContext,\n        uint256 oraclePrice,\n        uint256 poolPrice\n    ) internal pure {\n        uint256 lowerLimit = (oraclePrice * \n            (VaultConstants.VAULT_PERCENT_BASIS - strategyContext.vaultSettings.oraclePriceDeviationLimitPercent)) / \n            VaultConstants.VAULT_PERCENT_BASIS;\n        uint256 upperLimit = (oraclePrice * \n            (VaultConstants.VAULT_PERCENT_BASIS + strategyContext.vaultSettings.oraclePriceDeviationLimitPercent)) / \n            VaultConstants.VAULT_PERCENT_BASIS;\n\n        if (poolPrice < lowerLimit || upperLimit < poolPrice) {\n            revert Errors.InvalidPrice(oraclePrice, poolPrice);\n        }\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction SetZauction(address zauctionaddress) external onlyAdmin{\n    zauction = zauctionaddre. ```\nfunction SetZauction(address zauctionaddress) external onlyAdmin{\n    zauction = zauctionaddress;\n    emit ZauctionSet(zauctionaddress);\n}\n```\n

Vulnerable code:
```\nfunction SetZauction(address zauctionaddress) external onlyAdmin{\n    zauction = zauctionaddress;\n    emit ZauctionSet(zauctionaddress);\n}\n```\n
HIGH severity: Vulnerable function: ```\n    function _allocate(bytes memory _data, address _sender) internal virtual override {\n      . ```\n    function _allocate(bytes memory _data, address _sender) internal virtual override {\n        …\n\n        // check that the recipient has voice credits left to allocate\n        if (!_hasVoiceCreditsLeft(voiceCreditsToAllocate, allocator.voiceCredits)) revert INVALID();\n\n        _qv_alloc

Vulnerable code:
```\n    function _allocate(bytes memory _data, address _sender) internal virtual override {\n        …\n\n        // check that the recipient has voice credits left to allocate\n        if (!_hasVoiceCreditsLeft(voiceCreditsToAllocate, allocator.voiceCredits)) revert INVALID();\n\n        _qv_allocate(allocator, recipient, recipientId, voiceCreditsToAllocate, _sender);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction emergencyShutdown() external onlyRole("emergency_shutdown") {\n    active = false;\n\n. ```\nfunction emergencyShutdown() external onlyRole("emergency_shutdown") {\n    active = false;\n\n    // If necessary, defund sDAI.\n    uint256 sdaiBalance = sdai.balanceOf(address(this));\n    if (sdaiBalance != 0) defund(sdai, sdaiBalance);\n\n    // If necessary, defund DAI.\n    uint256 daiBa

Vulnerable code:
```\nfunction emergencyShutdown() external onlyRole("emergency_shutdown") {\n    active = false;\n\n    // If necessary, defund sDAI.\n    uint256 sdaiBalance = sdai.balanceOf(address(this));\n    if (sdaiBalance != 0) defund(sdai, sdaiBalance);\n\n    // If necessary, defund DAI.\n    uint256 daiBalance = dai.balanceOf(address(this));\n    if (daiBalance != 0) defund(dai, daiBalance);\n\n    emit Deactivated();\n}\n```\n
HIGH severity: Vulnerable function: ```\n    uint256 relayerFee = _relayerFee != 0 ? _relayerFee : msg.value;\n    I. ```\n    uint256 relayerFee = _relayerFee != 0 ? _relayerFee : msg.value;\n    IConnext(connext).xcall{value: relayerFee}(\n      _destinationDomain, // _destination: Domain ID of the destination chain\n      target, // _to: address of the target contract\n      address(0), // _asset: use address ze

Vulnerable code:
```\n    uint256 relayerFee = _relayerFee != 0 ? _relayerFee : msg.value;\n    IConnext(connext).xcall{value: relayerFee}(\n      _destinationDomain, // _destination: Domain ID of the destination chain\n      target, // _to: address of the target contract\n      address(0), // _asset: use address zero for 0-value transfers\n      msg.sender, // _delegate: address that can revert or forceLocal on destination\n      0, // _amount: 0 because no funds are being transferred\n      0, // _slippage: can be anything between 0-10000 because no funds are being transferred\n      _callData // _callData: the encoded calldata to send\n    );\n  }\n```\n
HIGH severity: Vulnerable function: ```\nFile: BalancerComposableAuraVault.sol\n    function _checkPriceAndCalculateValue() internal vie. ```\nFile: BalancerComposableAuraVault.sol\n    function _checkPriceAndCalculateValue() internal view override returns (uint256) {\n        (uint256[] memory balances, uint256[] memory spotPrices) = SPOT_PRICE.getComposableSpotPrices(\n            BALANCER_POOL_ID,\n            address(BALANCER_POOL

Vulnerable code:
```\nFile: BalancerComposableAuraVault.sol\n    function _checkPriceAndCalculateValue() internal view override returns (uint256) {\n        (uint256[] memory balances, uint256[] memory spotPrices) = SPOT_PRICE.getComposableSpotPrices(\n            BALANCER_POOL_ID,\n            address(BALANCER_POOL_TOKEN),\n            PRIMARY_INDEX()\n        );\n\n        // Spot prices are returned in native decimals, convert them all to POOL_PRECISION\n        // as required in the _calculateLPTokenValue method.\n        (/* */, uint8[] memory decimals) = TOKENS();\n        for (uint256 i; i < spotPrices.length; i++) {\n            spotPrices[i] = spotPrices[i] * POOL_PRECISION() / 10 ** decimals[i];\n        }\n\n        return _calculateLPTokenValue(balances, spotPrices);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n  function afterDepositExecution(\n    bytes32 depositKey,\n    IDeposit.Props memory /* deposi. ```\n  function afterDepositExecution(\n    bytes32 depositKey,\n    IDeposit.Props memory /* depositProps */,\n    IEvent.Props memory /* eventData */\n  ) external onlyController {\n    GMXTypes.Store memory _store = vault.store();\n\n    if (\n      _store.status == GMXTypes.Status.Deposit &&\n  

Vulnerable code:
```\n  function afterDepositExecution(\n    bytes32 depositKey,\n    IDeposit.Props memory /* depositProps */,\n    IEvent.Props memory /* eventData */\n  ) external onlyController {\n    GMXTypes.Store memory _store = vault.store();\n\n    if (\n      _store.status == GMXTypes.Status.Deposit &&\n      _store.depositCache.depositKey == depositKey\n    ) {\n      vault.processDeposit();\n    } else if (\n      _store.status == GMXTypes.Status.Rebalance_Add &&\n      _store.rebalanceCache.depositKey == depositKey\n    ) {\n      vault.processRebalanceAdd();\n    } else if (\n      _store.status == GMXTypes.Status.Compound &&\n      _store.compoundCache.depositKey == depositKey\n    ) {\n      vault.processCompound();\n    } else if (\n      _store.status == GMXTypes.Status.Withdraw_Failed &&\n      _store.withdrawCache.depositKey == depositKey\n    ) {\n      vault.processWithdrawFailureLiquidityAdded();\n    } else if (_store.status == GMXTypes.Status.Resume) {\n      // This if block is to catch the Deposit callback after an\n      // emergencyResume() to set the vault status to Open\n      vault.processEmergencyResume();\n    }\n    \n\n@ > // The function does nothing as the conditions are not met\n  }\n```\n
MEDIUM severity: Vulnerable function: ```\nunction testAttack() public {\n        mockRootPrice(WSTETH, 1_123_300_000_. ```\nunction testAttack() public {\n        mockRootPrice(WSTETH, 1_123_300_000_000_000_000); //wstETH\n        mockRootPrice(CBETH, 1_034_300_000_000_000_000); //cbETH\n\n        IBalancerMetaStablePool pool = IBalancerMetaStablePool(WSTETH_CBETH_POOL);\n\n        address[] memory assets = new addr

Vulnerable code:
```\nunction testAttack() public {\n        mockRootPrice(WSTETH, 1_123_300_000_000_000_000); //wstETH\n        mockRootPrice(CBETH, 1_034_300_000_000_000_000); //cbETH\n\n        IBalancerMetaStablePool pool = IBalancerMetaStablePool(WSTETH_CBETH_POOL);\n\n        address[] memory assets = new address[](2);\n        assets[0] = WSTETH;\n        assets[1] = CBETH;\n        uint256[] memory amounts = new uint256[](2);\n        amounts[0] = 10_000 ether;\n        amounts[1] = 0;\n\n        IBalancerVault.JoinPoolRequest memory joinRequest = IBalancerVault.JoinPoolRequest({\n            assets: assets,\n            maxAmountsIn: amounts, // maxAmountsIn,\n            userData: abi.encode(\n                IBalancerVault.JoinKind.EXACT_TOKENS_IN_FOR_BPT_OUT,\n                amounts, //maxAmountsIn,\n                0\n            ),\n            fromInternalBalance: false\n        });\n\n        IBalancerVault.SingleSwap memory swapRequest = IBalancerVault.SingleSwap({\n            poolId: 0x9c6d47ff73e0f5e51be5fd53236e3f595c5793f200020000000000000000042c,\n            kind: IBalancerVault.SwapKind.GIVEN_IN,\n            assetIn: WSTETH,\n            assetOut: CBETH,\n            amount: amounts[0],\n            userData: abi.encode(\n                IBalancerVault.JoinKind.EXACT_TOKENS_IN_FOR_BPT_OUT,\n                amounts, //maxAmountsIn,\n                0\n            )\n        });\n\n        IBalancerVault.FundManagement memory funds = IBalancerVault.FundManagement({\n            sender: address(this),\n            fromInternalBalance: false,\n            recipient: payable(address(this)),\n            toInternalBalance: false\n        });\n\n        emit log_named_uint("Gas before price1", gasleft());\n        uint256 price1 = oracle.getPriceInEth(WSTETH_CBETH_POOL);\n        emit log_named_uint("price1", price1);\n        emit log_named_uint("Gas after price1 ", gasleft());\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: BaseLSTAdapter.sol\n    function prefundedDeposit() external nonReentrant returns (uint25. ```\nFile: BaseLSTAdapter.sol\n    function prefundedDeposit() external nonReentrant returns (uint256, uint256) {\n..SNIP..\n        uint256 stakeAmount;\n        unchecked {\n            stakeAmount = availableEth + queueEthCache - targetBufferEth; // non-zero, no underflow\n        }\n        // I

Vulnerable code:
```\nFile: BaseLSTAdapter.sol\n    function prefundedDeposit() external nonReentrant returns (uint256, uint256) {\n..SNIP..\n        uint256 stakeAmount;\n        unchecked {\n            stakeAmount = availableEth + queueEthCache - targetBufferEth; // non-zero, no underflow\n        }\n        // If the stake amount exceeds 95% of the available ETH, cap the stake amount.\n        // This is to prevent the buffer from being completely drained. This is not a complete solution.\n        //\n        // The condition: stakeAmount > availableEth, is equivalent to: queueEthCache > targetBufferEth\n        // Possible scenarios:\n        // - Target buffer percentage was changed to a lower value and there is a large withdrawal request pending.\n        // - There is a pending withdrawal request and the available ETH are not left in the buffer.\n        // - There is no pending withdrawal request and the available ETH are not left in the buffer.\n        uint256 maxStakeAmount = (availableEth * 95) / 100;\n        if (stakeAmount > maxStakeAmount) {\n            stakeAmount = maxStakeAmount; // max 95% of the available ETH\n        }\n\n        /// INTERACT ///\n        // Deposit into the yield source\n        // Actual amount of ETH spent may be less than the requested amount.\n        stakeAmount = _stake(stakeAmount); // stake amount can be 0\n```\n
MEDIUM severity: Vulnerable function: ```\n(\n    uint256 initialPrice,\n    uint256 scalingFactor,\n    uint256 timeC. ```\n(\n    uint256 initialPrice,\n    uint256 scalingFactor,\n    uint256 timeCoefficient,\n    uint256 bucketSize,\n    bool isDecreasing,\n    uint256 maxPrice,\n    uint256 minPrice\n) = getDecodedData(_priceAdapterConfigData);\n\nuint256 timeBucket = _timeElapsed / bucketSize;\n\nint256 expArgu

Vulnerable code:
```\n(\n    uint256 initialPrice,\n    uint256 scalingFactor,\n    uint256 timeCoefficient,\n    uint256 bucketSize,\n    bool isDecreasing,\n    uint256 maxPrice,\n    uint256 minPrice\n) = getDecodedData(_priceAdapterConfigData);\n\nuint256 timeBucket = _timeElapsed / bucketSize;\n\nint256 expArgument = int256(timeCoefficient * timeBucket);\n\nuint256 expExpression = uint256(FixedPointMathLib.expWad(expArgument));\n\nuint256 priceChange = scalingFactor * expExpression - WAD;\n```\n