Skip to content

Commit

Permalink
add dev comments
Browse files Browse the repository at this point in the history
  • Loading branch information
trmid committed Sep 14, 2023
1 parent 5eeb106 commit b7d1b1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/LiquidationPair.sol
Expand Up @@ -508,13 +508,16 @@ contract LiquidationPair is ILiquidationPair {
}

/// @notice Computes the start time of the given auction period
/// @dev `period_` must be at least 1, since this is the first active period.
/// @param period_ The auction period, in terms of number of periods since firstPeriodStartsAt
/// @return The start timestamp of the given period
function _getPeriodStart(uint256 period_) internal view returns (uint256) {
return firstPeriodStartsAt + (period_ - 1) * periodLength;
}

/// @notice Computes the current auction period
/// @dev This will return `0` if the current time is before `firstPeriodStartsAt`.
/// @dev The first active auction period is `1`. (i.e. when the timestamp is at `firstPeriodStartsAt`, this function will return `1`)
/// @return the current period
function _computePeriod() internal view returns (uint256) {
if (block.timestamp < firstPeriodStartsAt) {
Expand Down

0 comments on commit b7d1b1f

Please sign in to comment.