Submitted by WatchPug
xERC4626.sol#L65-L68
xERC4626.sol#L78-L87
storedTotalAssets is a cached value of total assets which will only include the unlockedRewards when the whole cycle ends.
This makes it possible for storedTotalAssets -= amount to revert when the withdrawal amount exceeds storedTotalAssets, as the withdrawal amount may include part of the unlockedRewards in the current cycle.
Given:
Alices shares worth 101 TRIBE at this moment, but storedTotalAssets = 100, making storedTotalAssets -= amount reverts due to underflow.
If there are no new deposits, both Alice and Bob wont be able to withdraw any of their funds until rewardsCycleEnd.
Consider changing to:
Joeysantoro (xTRIBE) confirmed, but disagreed with High severity, and commented:
0xean (judge) decreased severity to Medium and commented:
