You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
sherlock-admin opened this issue
Mar 27, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
All emission tokens for an epoch will be effectively burnt if there are no stakers during that epoch (null epoch).
Code Snippet
See above
Tool used
Manual Review
Recommendation
If finalTVL is 0 for an epoch (no stakers). Return all emissions for that epoch to treasury:
Add to Carousel.sol:
function resolveEpoch(uint256_id)
externaloverride(VaultV2)
{
super.resolveEpoch(_id);
// null epoch, no stakers, hand back emissionsif(finalTVL[_id] ==0) {
emissionsToken.safeTransfer(treasury,emissions[_id]);
}
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
immeas
high
emissions for null epochs are lost
Summary
Emissions are sent to the vaults upon epoch creation. If no one stakes in the vault during the epoch the emissions in that vault will be lost.
Vulnerability Detail
When creating an epoch for Carousel the owner has the choice to add emissions for that epoch, that are distributed to stakers:
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/CarouselFactory.sol#L148-L152
These emissions are then locked to that epoch:
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L591-L597
If no one stakes in the vault during this epoch (null epoch) these emission tokens will be lost in the contract forever as there are no shares to split them with:
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/Carousel.sol#L630-L636
Impact
All emission tokens for an epoch will be effectively burnt if there are no stakers during that epoch (null epoch).
Code Snippet
See above
Tool used
Manual Review
Recommendation
If
finalTVL
is0
for an epoch (no stakers). Return all emissions for that epoch totreasury
:Add to
Carousel.sol
:Duplicate of #122
The text was updated successfully, but these errors were encountered: