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

ak1 - DepositReceipt_Base.sol#L21 : HEARTBEAT_TIME gap is too huge #256

Open
github-actions bot opened this issue Dec 11, 2022 · 3 comments
Open

ak1 - DepositReceipt_Base.sol#L21 : HEARTBEAT_TIME gap is too huge #256

github-actions bot opened this issue Dec 11, 2022 · 3 comments

Comments

@github-actions
Copy link

ak1

medium

DepositReceipt_Base.sol#L21 : HEARTBEAT_TIME gap is too huge

Summary

HEARTBEAT_TIME = 24 hours could not be safe. The oracle data still be stale one.

Vulnerability Detail

oracle is using the HEARTBEAT_TIME as 24 hours. Since the price of oracle could vary in the time gap of 3 hours, using 24 hours could be still dangerous.

Impact

Stale data used. Front runnable issue.

Code Snippet

https://github.com/sherlock-audit/2022-11-isomorph/blob/main/contracts/Velo-Deposit-Tokens/contracts/DepositReceipt_Base.sol#L21

Tool used

Manual Review

Recommendation

Use 3 hours as hearbeat.

@kree-dotcom
Copy link

kree-dotcom commented Dec 14, 2022

3 hours as recommended by the auditor does not seem sufficient. Some Optimism price feeds such as ETH/USD and OP/USD have Heartbeats of 1200s or 20min. Currently we cannot find a method to fetch this via the oracle address and it looks like the Heartbeat sensitivity would have to be set per deployment of the depositReceipt.

@kree-dotcom
Copy link

Fixed, kree-dotcom/Velo-Deposit-Tokens@398f40c

HEARTBEAT_TIME is now an immutable var that is set by the deployer for each instance of a depositReceipt.

@IAm0x52
Copy link
Collaborator

IAm0x52 commented Jan 7, 2023

Fixes look good. HEARTBEAT_TIME changed to an immutable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants