Skip to content

Commit

Permalink
Deprecate isReserveLow on L2
Browse files Browse the repository at this point in the history
  • Loading branch information
m-chrzan committed Dec 6, 2024
1 parent 682235e commit 1ec7eae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/protocol/contracts/governance/EpochRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ contract EpochRewards is
* @notice Determines if the reserve is low enough to demand a diversion from
* the community reward. Targets initial critical ratio of 2 with a linear
* decline until 25 years have passed where the critical ratio will be 1.
* @dev This function is called by L1 celo-blockchain during epoch reward
* distribution.
* @dev TODO Remove this after the L2 transition.
*/
function isReserveLow() external view returns (bool) {
function isReserveLow() external view onlyL1 returns (bool) {
// critical reserve ratio = 2 - time in second / 25 years
FixidityLib.Fraction memory timeSinceInitialization = FixidityLib.newFixed(now.sub(startTime));
FixidityLib.Fraction memory m = FixidityLib.newFixed(25 * 365 * 1 days);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,4 +1028,9 @@ contract EpochRewardsTest_isReserveLow is EpochRewardsTest {
}
}

contract EpochRewardsTest_isReserveLow_L2 is EpochRewardsTest_L2, EpochRewardsTest_isReserveLow {}
contract EpochRewardsTest_isReserveLow_L2 is EpochRewardsTest_L2 {
function test_ShouldRevert() public {
vm.expectRevert("This method is no longer supported in L2.");
epochRewards.isReserveLow();
}
}

0 comments on commit 1ec7eae

Please sign in to comment.