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

ltyu - Sequencer grace period may exceed epoch end time #10

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

ltyu - Sequencer grace period may exceed epoch end time #10

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 Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 27, 2023

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 to getLatestPrice():
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

@github-actions github-actions bot closed this as completed Apr 3, 2023
@github-actions github-actions bot added Medium A valid Medium 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 Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant