From 36446abbc3d4a4f7ee2fe782152f06c0a570f7f5 Mon Sep 17 00:00:00 2001 From: gallo Date: Sat, 19 Oct 2024 13:27:38 +0200 Subject: [PATCH] fix: explicitly prevent loading future epochs --- src/BribeInitiative.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/BribeInitiative.sol b/src/BribeInitiative.sol index 15b18451..f0c09f17 100644 --- a/src/BribeInitiative.sol +++ b/src/BribeInitiative.sol @@ -175,10 +175,12 @@ contract BribeInitiative is IInitiative, IBribeInitiative { } function _loadTotalLQTYAllocation(uint16 _epoch) private view returns (uint88, uint32) { + require(_epoch <= governance.epoch(), "No future Lookup"); return _decodeLQTYAllocation(totalLQTYAllocationByEpoch.items[_epoch].value); } function _loadLQTYAllocation(address _user, uint16 _epoch) private view returns (uint88, uint32) { + require(_epoch <= governance.epoch(), "No future Lookup"); return _decodeLQTYAllocation(lqtyAllocationByUserAtEpoch[_user].items[_epoch].value); }