Deposit isn't check for minimum share token received (In case of slippage) #167
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-07-swivel/blob/daf72892d8a8d6eaa43b9e7d1924ccb0e612ee3c/Swivel/Swivel.sol#L706-L729
Vulnerability details
Impact
Deposit isn't check for minimum share token received (In case of slippage).
Proof of Concept
https://github.com/code-423n4/2022-07-swivel/blob/daf72892d8a8d6eaa43b9e7d1924ccb0e612ee3c/Swivel/Swivel.sol#L706-L729
It only check that fund is deposited successfully but doesn't check that the received share token is enough or not. If one of this protocol can be sandwiched, the fund will be lost to the MEV bot.
Tools Used
Manual review
Recommended Mitigation Steps
Add share token address and minimum share received to the input and perform check at the end to require different in balance to be greater than minimum share.
The text was updated successfully, but these errors were encountered: