-
Notifications
You must be signed in to change notification settings - Fork 1
hickuphh3 - depositFee
can be bypassed via deposit queue
#75
Comments
This is a valid issue. We will apply depositFee to all mints (queue and direct). However, given that queue has the potential to affect when users's shares are minted because of FILO, min deposit has to be raised for the queue, to make it substantially harder to DDoS the queue. Minimizing DDoS queue deposits will lead to queue deposits getting the least fees as relayers can mint from the first second the epoch is created. |
fix PR: Y2K-Finance/Earthquake#126 |
@IAm0x52 to elaborate on this issue: relayers are incentivized to mint the depositQueue from the second a new epoch is created to extract the most amount of relayerFees. In fact Y2K will have a build in relayerInfra into the deployment process. The assumption is, that queueDeposit users will pay a minimal Fee. The attack factor of the queue beeing to long leading to prolonged queue deposit executions will be mitigated by adding a significant deposit requirement for queue deposits. These measures will mitigate high deposit Fees for Queue deposits as well as prevent late direct depositors using the queue to evade the depositFee. |
Bringing in this discussion from Discord: 0x52
3xHarry
|
Fix looks good. enlistInRollover now applies a minimum deposit requirement |
hickuphh3
medium
depositFee
can be bypassed via deposit queueSummary
The deposit fee can be circumvented by a queue deposit +
mintDepositInQueue()
call in the same transaction.Vulnerability Detail
A deposit fee is charged and increases linearly within the deposit window. However, this fee can be avoided if one deposits into the queue instead, then mints his deposit in the queue.
POC
Assume non-zero
depositFee
, valid epoch_id = 1
. At epoch end, instead of callingdeposit(1, _assets, 0xAlice)
, Alice writes a contract that performsdeposit(0,_assets,0xAlice)
+mintDepositInQueue(1,1)
to mint her deposit in the same tx (her deposit gets processed first because FILO system) . She pockets therelayerFee
, essentially paying zero fees instead of incurring thedepositFee
.Impact
Loss of protocol fee revenue.
Code Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L494-L500
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L332-L333
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L354
Tool used
Manual Review
Recommendation
Because of the FILO system, charging the dynamic deposit fee will be unfair to queue deposits as they're reliant on relayers to mint their deposits for them. Consider taking a proportion of the relayer fee.
The text was updated successfully, but these errors were encountered: