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
Sequencer grace period may exceed epoch end time, causing unexpected results.
Vulnerability Detail
The mechanics of Y2K depends on 1) the strike price, and 2) the epoch periods. If the price strikes before the epoch end time, the collateral vault will pay out the premium vault. In the reverse case, if the price does not strike before the epoch end time, the collateral vault keeps the collateral (and receives the premium).
Currently, the strike price depends on Chainlink oracles, and since Y2K is deployed on L2, the Sequencer uptime.
This is problematic because if the Sequencer goes down, a grace period is given, which essentially blocks epoch resolutions. This grace period may surpass the epoch end time and results may be incorrect. For example, price strikes before epoch end time, but triggerDepeg() cannot be called since the grace period will cause it to revert, the Premium vault loses out on the payout.
Impact
This is a high impact because it breaks the main protocol mechanic: payouts at a defined period. With the addition of Sequencer grace period, incorrect results my occur. The impact is loss of trust in an insurance system due to incorrect results, e.g. Insurance buyers pay premiums, but don't get paid when a depeg event happens.
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
ltyu
high
Sequencer grace period may exceed epoch end time
Summary
Sequencer grace period may exceed epoch end time, causing unexpected results.
Vulnerability Detail
The mechanics of Y2K depends on 1) the strike price, and 2) the epoch periods. If the price strikes before the epoch end time, the collateral vault will pay out the premium vault. In the reverse case, if the price does not strike before the epoch end time, the collateral vault keeps the collateral (and receives the premium).
Currently, the strike price depends on Chainlink oracles, and since Y2K is deployed on L2, the Sequencer uptime.
This is problematic because if the Sequencer goes down, a grace period is given, which essentially blocks epoch resolutions. This grace period may surpass the epoch end time and results may be incorrect. For example, price strikes before epoch end time, but
triggerDepeg()
cannot be called since the grace period will cause it to revert, the Premium vault loses out on the payout.Impact
This is a high impact because it breaks the main protocol mechanic: payouts at a defined period. With the addition of Sequencer grace period, incorrect results my occur. The impact is loss of trust in an insurance system due to incorrect results, e.g. Insurance buyers pay premiums, but don't get paid when a depeg event happens.
Code Snippet
triggerDepeg()
attempts togetLatestPrice()
:https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Controllers/ControllerPeggedAssetV2.sol#L51-L62
Grace Period is triggered if Sequencer is down, which will revert:
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Controllers/ControllerPeggedAssetV2.sol#L273-L294
Tool used
Manual Review
Recommendation
Consider adding additional time to the epoch end if the Sequencer is down.
Duplicate of #422
The text was updated successfully, but these errors were encountered: