Skip to content

Commit

Permalink
fix: netscape
Browse files Browse the repository at this point in the history
  • Loading branch information
GitGuru7 committed Dec 20, 2023
1 parent 066450f commit 05d1962
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions contracts/TimeManagerV5.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract TimeManagerV5 {
function() view returns (uint256) private _getCurrentSlot;

/**
* @param timeBased_ A boolean indicating whether the contract is based on time or block.
* @param timeBased_ A boolean indicating whether the contract is based on time or block
* If timeBased is true than blocksPerYear_ param is ignored as blocksOrSecondsPerYear is set to SECONDS_PER_YEAR
* @param blocksPerYear_ The number of blocks per year
*/
Expand All @@ -27,7 +27,7 @@ contract TimeManagerV5 {
revert("Invalid blocks per year");
}
if (timeBased_ && blocksPerYear_ != 0) {
revert("Invalid time based");
revert("Invalid time based configuration");
}

isTimeBased = timeBased_;
Expand All @@ -44,15 +44,15 @@ contract TimeManagerV5 {
}

/**
* @notice Returns the current timestamp in seconds
* @dev Returns the current timestamp in seconds
* @return The current timestamp
*/
function _getBlockTimestamp() private view returns (uint256) {
return block.timestamp;
}

/**
* @notice Returns the current block number
* @dev Returns the current block number
* @return The current block number
*/
function _getBlockNumber() private view returns (uint256) {
Expand Down
13 changes: 7 additions & 6 deletions contracts/TimeManagerV8.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ abstract contract TimeManagerV8 {
error InvalidBlocksPerYear();

/// @notice Thrown when time based but blocks per year is provided
error InvalidTimeBased();
error InvalidTimeBasedConfiguration();

/**
* @param timeBased_ A boolean indicating whether the contract is based on time or block.
* @param timeBased_ A boolean indicating whether the contract is based on time or block
* If timeBased is true than blocksPerYear_ param is ignored as blocksOrSecondsPerYear is set to SECONDS_PER_YEAR
* @param blocksPerYear_ The number of blocks per year
* @custom:error InvalidBlocksPerYear is thrown if blocksPerYear entered is zero
* @custom:error InvalidBlocksPerYear is thrown if blocksPerYear entered is zero and timeBased is false
* @custom:error InvalidTimeBasedConfiguration is thrown if blocksPerYear entered is non zero and timeBased is true
* @custom:oz-upgrades-unsafe-allow constructor
*/
constructor(bool timeBased_, uint256 blocksPerYear_) {
Expand All @@ -32,7 +33,7 @@ abstract contract TimeManagerV8 {
}

if (timeBased_ && blocksPerYear_ != 0) {
revert InvalidTimeBased();
revert InvalidTimeBasedConfiguration();
}

isTimeBased = timeBased_;
Expand All @@ -49,15 +50,15 @@ abstract contract TimeManagerV8 {
}

/**
* @notice Returns the current timestamp in seconds
* @dev Returns the current timestamp in seconds
* @return The current timestamp
*/
function _getBlockTimestamp() private view returns (uint256) {
return block.timestamp;
}

/**
* @notice Returns the current block number
* @dev Returns the current block number
* @return The current block number
*/
function _getBlockNumber() private view returns (uint256) {
Expand Down

0 comments on commit 05d1962

Please sign in to comment.