Skip to content

Commit

Permalink
Require signed data in OEv updates to be older than update allowance …
Browse files Browse the repository at this point in the history
…end timestamp
  • Loading branch information
bbenligiray committed Aug 1, 2024
1 parent 21a488f commit b2edb9b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contracts/api3-server-v1/Api3ServerV1OevExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ contract Api3ServerV1OevExtension is
),
"Auctioneer invalid"
);
require(
updateAllowanceEndTimestamp < block.timestamp + 1 hours,
"Timestamp not valid"
);
UpdateAllowance storage updateAllowance = dappIdToUpdateAllowance[
dappId
];
Expand Down Expand Up @@ -152,9 +156,10 @@ contract Api3ServerV1OevExtension is
"Signature mismatch"
);
// Cannot use processBeaconUpdate() here because data is not calldata
// Timestamp implicitly can't be more than 1 hours in the future due to the check in payOevBid()
require(
timestamp < block.timestamp + 1 hours,
"Timestamp not valid"
timestamp < updateAllowance.endTimestamp,
"Timestamp not allowed"
);
require(
timestamp > _dataFeeds[oevBeaconId].timestamp,
Expand Down

0 comments on commit b2edb9b

Please sign in to comment.