Skip to content

Commit

Permalink
Update Dashboard.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
0xScratch authored Dec 31, 2023
1 parent 5fa03c6 commit 60375bb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions darc-protocol/contracts/protocol/Dashboard/Dashboard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "../Runtime/Runtime.sol";
* @author DARC Team
* @notice The dashboard (a set of view functions) of the DARC machine state,
* which is used to read the machine state, including machine state, voting state,
* token informatin, plugin information, etc.
* token information, plugin information, etc.
*/
contract Dashboard is MachineStateManager {

Expand All @@ -20,14 +20,18 @@ contract Dashboard is MachineStateManager {
}

/**
* @notice Get the avaiilable token classes
* @notice Get the available token classes
*/
function getNumberOfTokenClasses() public view returns (uint256) {
uint256 i = 0;
for (; i < currentMachineState.tokenList.length; i++) {
uint256 i;
for (; i < currentMachineState.tokenList.length;) {
if (!currentMachineState.tokenList[i].bIsInitialized) {
break;
}

unchecked {
++i;
}
}
return i;
}
Expand Down

0 comments on commit 60375bb

Please sign in to comment.