Skip to content

Commit

Permalink
Merge pull request #63 from Tenderize/nv/graph-audit-remediation
Browse files Browse the repository at this point in the history
Graph: in unlockMaturity, rename tokensLockedUntil to unlockBlock
  • Loading branch information
kyriediculous authored Sep 26, 2023
2 parents 84d7764 + ff8716e commit 69cc6ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/adapters/GraphAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ contract GraphAdapter is Adapter {
Unlock memory unlock = $.unlocks[unlockID];
uint256 THAWING_PERIOD = GRAPH.thawingPeriod();
// if userEpoch == currentEpoch, it is yet to unlock
// => unlockTime + thawingPeriod
// => unlockBlock + thawingPeriod
// if userEpoch == currentEpoch - 1, it is processing
// => unlockTime
// => unlockBlock
// if userEpoch < currentEpoch - 1, it has been processed
// => 0
uint256 tokensLockedUntil = $.lastEpochUnlockedAt + THAWING_PERIOD;
uint256 unlockBlock = $.lastEpochUnlockedAt + THAWING_PERIOD;
if (unlock.epoch == $.currentEpoch) {
return THAWING_PERIOD + tokensLockedUntil;
return THAWING_PERIOD + unlockBlock;
} else if (unlock.epoch == $.currentEpoch - 1) {
return tokensLockedUntil;
return unlockBlock;
} else {
return 0;
}
Expand Down

0 comments on commit 69cc6ef

Please sign in to comment.