Skip to content

Commit

Permalink
rename EPOCH_DEFAULT to EPOCH_NOT_INITIALIZED
Browse files Browse the repository at this point in the history
  • Loading branch information
Jun1on committed Jun 5, 2024
1 parent 5082779 commit 80e8e28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/hooks/examples/LimitOrder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 80e8e28

Please sign in to comment.