From 80e8e28512450a1f0c04298f8ad98e99d0284ef5 Mon Sep 17 00:00:00 2001 From: Junion Date: Wed, 5 Jun 2024 16:55:23 -0400 Subject: [PATCH] rename EPOCH_DEFAULT to EPOCH_NOT_INITIALIZED --- contracts/hooks/examples/LimitOrder.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/hooks/examples/LimitOrder.sol b/contracts/hooks/examples/LimitOrder.sol index 9ee7a33c..422e2f7d 100644 --- a/contracts/hooks/examples/LimitOrder.sol +++ b/contracts/hooks/examples/LimitOrder.sol @@ -57,7 +57,7 @@ contract LimitOrder is BaseHook { bytes internal constant ZERO_BYTES = bytes(""); - Epoch private constant EPOCH_DEFAULT = Epoch.wrap(0); + Epoch private constant EPOCH_NOT_INITIALIZED = Epoch.wrap(0); mapping(PoolId => int24) public tickLowerLasts; Epoch public epochNext = Epoch.wrap(1); @@ -159,7 +159,7 @@ contract LimitOrder is BaseHook { function _fillEpoch(PoolKey calldata key, int24 lower, bool zeroForOne) internal { Epoch epoch = getEpoch(key, lower, zeroForOne); - if (!epoch.equals(EPOCH_DEFAULT)) { + if (!epoch.equals(EPOCH_NOT_INITIALIZED)) { EpochInfo storage epochInfo = epochInfos[epoch]; epochInfo.filled = true; @@ -172,7 +172,7 @@ contract LimitOrder is BaseHook { epochInfo.token1Total += amount1; } - setEpoch(key, lower, zeroForOne, EPOCH_DEFAULT); + setEpoch(key, lower, zeroForOne, EPOCH_NOT_INITIALIZED); emit Fill(epoch, key, lower, zeroForOne); } @@ -233,7 +233,7 @@ contract LimitOrder is BaseHook { EpochInfo storage epochInfo; Epoch epoch = getEpoch(key, tickLower, zeroForOne); - if (epoch.equals(EPOCH_DEFAULT)) { + if (epoch.equals(EPOCH_NOT_INITIALIZED)) { unchecked { setEpoch(key, tickLower, zeroForOne, epoch = epochNext); // since epoch was just assigned the current value of epochNext,