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 28, 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
Emissions sent to vault with null epoch will be lost forever
Summary
When the emissions of the vault are set for a specific epoch they are immediately sent to the contract. When an epoch is null it never reclaims the emissions causing them to be lost.
function createEpochWithEmissions(
uint256 _marketId,
uint40 _epochBegin,
uint40 _epochEnd,
uint16 _withdrawalFee,
uint256 _permiumEmissions,
uint256 _collatEmissions
) public returns (uint256 epochId, address[2] memory vaults) {
// no need for onlyOwner modifier as createEpoch already has modifier
(epochId, vaults) = createEpoch(
_marketId,
_epochBegin,
_epochEnd,
_withdrawalFee
);
emissionsToken.safeTransferFrom(treasury, vaults[0], _permiumEmissions);
ICarousel(vaults[0]).setEmissions(epochId, _permiumEmissions);
emissionsToken.safeTransferFrom(treasury, vaults[1], _collatEmissions);
ICarousel(vaults[1]).setEmissions(epochId, _collatEmissions);
}
Here we see the tokens are taken when emissions are created. If there is a null epoch there is no on not claim the tokens so they are lost forever because they aren't transferred back during setting of the null epoch
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
0x52
high
Emissions sent to vault with null epoch will be lost forever
Summary
When the emissions of the vault are set for a specific epoch they are immediately sent to the contract. When an epoch is null it never reclaims the emissions causing them to be lost.
Vulnerability Detail
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Carousel/CarouselFactory.sol#L132-L153
Here we see the tokens are taken when emissions are created. If there is a null epoch there is no on not claim the tokens so they are lost forever because they aren't transferred back during setting of the null epoch
Impact
Emissions are lost when there is a null epoch
Code Snippet
CarouselFactory.sol#L132-L153
Tool used
Manual Review
Recommendation
Reclaim emissions on null epoch
Duplicate of #122
The text was updated successfully, but these errors were encountered: