@@ -29,7 +29,7 @@ contract EpochManager is Governed {
29
29
event EpochLengthUpdate (uint256 indexed epoch , uint256 epochLength );
30
30
31
31
/**
32
- * @dev Contract Constructor
32
+ * @dev Contract Constructor.
33
33
* @param _epochLength Epoch length in blocks
34
34
*/
35
35
constructor (uint256 _epochLength ) public {
@@ -43,7 +43,7 @@ contract EpochManager is Governed {
43
43
}
44
44
45
45
/**
46
- * @dev Set the epoch length
46
+ * @dev Set the epoch length.
47
47
* @notice Set epoch length to `_epochLength` blocks
48
48
* @param _epochLength Epoch length in blocks
49
49
*/
@@ -59,7 +59,7 @@ contract EpochManager is Governed {
59
59
}
60
60
61
61
/**
62
- * @dev Run a new epoch, should be called once at the start of any epoch
62
+ * @dev Run a new epoch, should be called once at the start of any epoch.
63
63
* @notice Perform state changes for the current epoch
64
64
*/
65
65
function runEpoch () external {
@@ -74,23 +74,23 @@ contract EpochManager is Governed {
74
74
}
75
75
76
76
/**
77
- * @dev Return true if the current epoch has already run
77
+ * @dev Return true if the current epoch has already run.
78
78
* @return Return true if epoch has run
79
79
*/
80
80
function isCurrentEpochRun () public view returns (bool ) {
81
81
return lastRunEpoch == currentEpoch ();
82
82
}
83
83
84
84
/**
85
- * @dev Return current block number
85
+ * @dev Return current block number.
86
86
* @return Block number
87
87
*/
88
88
function blockNum () public view returns (uint256 ) {
89
89
return block .number ;
90
90
}
91
91
92
92
/**
93
- * @dev Return blockhash for a block
93
+ * @dev Return blockhash for a block.
94
94
* @return BlockHash for `_block` number
95
95
*/
96
96
function blockHash (uint256 _block ) public view returns (bytes32 ) {
@@ -106,41 +106,41 @@ contract EpochManager is Governed {
106
106
}
107
107
108
108
/**
109
- * @dev Return the current epoch, it may have not been run yet
109
+ * @dev Return the current epoch, it may have not been run yet.
110
110
* @return The current epoch based on epoch length
111
111
*/
112
112
function currentEpoch () public view returns (uint256 ) {
113
113
return lastLengthUpdateEpoch.add (epochsSinceUpdate ());
114
114
}
115
115
116
116
/**
117
- * @dev Return block where the current epoch started
117
+ * @dev Return block where the current epoch started.
118
118
* @return The block number when the current epoch started
119
119
*/
120
120
function currentEpochBlock () public view returns (uint256 ) {
121
121
return lastLengthUpdateBlock.add (epochsSinceUpdate ().mul (epochLength));
122
122
}
123
123
124
124
/**
125
- * @dev Return the number of blocks that passed since current epoch started
125
+ * @dev Return the number of blocks that passed since current epoch started.
126
126
* @return Blocks that passed since start of epoch
127
127
*/
128
128
function currentEpochBlockSinceStart () public view returns (uint256 ) {
129
129
return blockNum () - currentEpochBlock ();
130
130
}
131
131
132
132
/**
133
- * @dev Return the number of epoch that passed since another epoch
133
+ * @dev Return the number of epoch that passed since another epoch.
134
134
* @param _epoch Epoch to use as since epoch value
135
135
* @return Number of epochs and current epoch
136
136
*/
137
- function epochsSince (uint256 _epoch ) public view returns (uint256 , uint256 ) {
137
+ function epochsSince (uint256 _epoch ) public view returns (uint256 ) {
138
138
uint256 epoch = currentEpoch ();
139
- return ( _epoch < epoch ? epoch.sub (_epoch) : 0 , epoch) ;
139
+ return _epoch < epoch ? epoch.sub (_epoch) : 0 ;
140
140
}
141
141
142
142
/**
143
- * @dev Return number of epochs passed since last epoch length update
143
+ * @dev Return number of epochs passed since last epoch length update.
144
144
* @return The number of epoch that passed since last epoch length update
145
145
*/
146
146
function epochsSinceUpdate () public view returns (uint256 ) {
0 commit comments