Skip to content

Commit 60375bb

Browse files
authored
Update Dashboard.sol
1 parent 5fa03c6 commit 60375bb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

darc-protocol/contracts/protocol/Dashboard/Dashboard.sol

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "../Runtime/Runtime.sol";
88
* @author DARC Team
99
* @notice The dashboard (a set of view functions) of the DARC machine state,
1010
* which is used to read the machine state, including machine state, voting state,
11-
* token informatin, plugin information, etc.
11+
* token information, plugin information, etc.
1212
*/
1313
contract Dashboard is MachineStateManager {
1414

@@ -20,14 +20,18 @@ contract Dashboard is MachineStateManager {
2020
}
2121

2222
/**
23-
* @notice Get the avaiilable token classes
23+
* @notice Get the available token classes
2424
*/
2525
function getNumberOfTokenClasses() public view returns (uint256) {
26-
uint256 i = 0;
27-
for (; i < currentMachineState.tokenList.length; i++) {
26+
uint256 i;
27+
for (; i < currentMachineState.tokenList.length;) {
2828
if (!currentMachineState.tokenList[i].bIsInitialized) {
2929
break;
3030
}
31+
32+
unchecked {
33+
++i;
34+
}
3135
}
3236
return i;
3337
}

0 commit comments

Comments
 (0)