Skip to content

Commit 684a40a

Browse files
committed
draft: update MultiVotes
1 parent 35210ef commit 684a40a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

contracts/governance/utils/IMultiVotes.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import {IVotes} from "./IVotes.sol";
88
* @dev Common interface for {ERC20MultiVotes} and other {MultiVotes}-enabled contracts.
99
*/
1010
interface IMultiVotes is IVotes {
11-
1211
/**
13-
* @dev Invalid, start should be equal or smaller than end.
14-
*/
12+
* @dev Invalid, start should be equal or smaller than end.
13+
*/
1514
error StartIsBiggerThanEnd(uint256 start, uint256 end);
1615

1716
/**

contracts/governance/utils/MultiVotes.sol

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,14 @@ abstract contract MultiVotes is Votes, IMultiVotes {
6161
* NOTE: Order may unexpectedly change if called in different transactions.
6262
* Trust the returned array only if you obtain it within a single transaction.
6363
*/
64-
function multiDelegates(address account, uint256 start, uint256 end) public view virtual returns (address[] memory) {
64+
function multiDelegates(
65+
address account,
66+
uint256 start,
67+
uint256 end
68+
) public view virtual returns (address[] memory) {
6569
uint256 maxLength = _delegatesList[account].length;
6670
require(end >= start, StartIsBiggerThanEnd(start, end));
67-
if(start >= maxLength) {
71+
if (start >= maxLength) {
6872
address[] memory empty = new address[](0);
6973
return empty;
7074
}
@@ -75,7 +79,7 @@ abstract contract MultiVotes is Votes, IMultiVotes {
7579
uint256 length = (end + 1) - start;
7680
address[] memory list = new address[](length);
7781

78-
for(uint256 i; i < length; i++) {
82+
for (uint256 i; i < length; i++) {
7983
list[i] = _delegatesList[account][start + i];
8084
}
8185

0 commit comments

Comments
 (0)