Closed github-actions[bot] closed 1 year ago
See the discussion in https://github.com/sherlock-audit/2023-01-illuminate-judging/issues/16 about where slippage of this sort should be. Seem invalid
Duplicate of #16.
After further discussion with the Lead Watson and the Sponsor, this issue is not considered a duplicate of issue #16
As the contract requires compliance with ERC4626 for further external integrations, the slippage in the above function is supposed to be checked by the caller.
The only functions where a slippage check is expected by the ERC are withdraw
/redeem
as mentioned in issue 16.
Hence this issue is not considered a valid medium/high.
cccz
medium
ERC5095.mint should ensure the user received at least the amount desired
Summary
ERC5095.mint should ensure the user received at least the amount desired
Vulnerability Detail
In ERC5095.deposit, ensure that the number of PTs received by the user must be greater than the number of UToken by checking returned >= a. This is used to ensure that the user does not suffer a loss in the deposit.
However, this is not done in ERC5095.mint, which leads to the possibility that the number of PTs minted by the mint function is less than the number of UToken, thus exposing the user to losses.
Impact
It leads to the possibility that the number of PTs minted by the mint function is less than the number of UToken, thus exposing the user to losses.
Code Snippet
https://github.com/sherlock-audit/2023-01-illuminate/blob/main/src/tokens/ERC5095.sol#L199-L203 https://github.com/sherlock-audit/2023-01-illuminate/blob/main/src/tokens/ERC5095.sol#L214-L249
Tool used
Manual Review
Recommendation
Change to