Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

AlexCzm - Users can avoid paying depositFee #463

Closed
sherlock-admin opened this issue Mar 27, 2023 · 0 comments
Closed

AlexCzm - Users can avoid paying depositFee #463

sherlock-admin opened this issue Mar 27, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 27, 2023

AlexCzm

high

Users can avoid paying depositFee

Summary

Users can deposit in queue (passing epochId == 0) and and call mintDepositInQueue in same transaction to avoid paying any fees.

Vulnerability Detail

When using the Carousel an user can choose to make a direct deposit (eg. in the next available epoch id) or a queue deposit, pushing the deposit information into depositQueue.
When epochId != 0 a depositFee is paid to treasury.
But when epoch id == 0 depositQueue is updated. Calling mintDepositInQueue will mint the corresponding shares to the rightful depositors. No deposit fee is paid to treasury.

An user can deposit to epoch 0 and in same transaction to call mintDepositInQueue to ensure no deposit fee is paid and he receive back the relayerFee.

Impact

Protocol will not receive the deposit fees.

Code Snippet

https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L470-L501

https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L310-L355

Tool used

Manual Review

Recommendation

Direct deposit fee is calculated linearly between time of epoch creation and epoch starting. Since queue depositors have no informational advantage a fixed % fee for epoch 0 deposits can be applied in this case.

Duplicate of #75

@github-actions github-actions bot closed this as completed Apr 3, 2023
@github-actions github-actions bot added High A valid High severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Apr 3, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant