Skip to content

Commit

Permalink
Double Proxy Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
vasapower committed Jul 15, 2020
1 parent 49def9f commit 23a453f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions DoubleProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ contract DoubleProxy is IDoubleProxy {

function proxies(uint256 start, uint256 offset) public override view returns(address[] memory out) {
require(start < _proxies.length, "Invalid start");
uint256 length = offset < _proxies.length ? offset : _proxies.length;
uint256 length = offset > _proxies.length ? _proxies.length : offset;
out = new address[](length);
length += start;
length = length > _proxies.length ? _proxies.length : length;
uint256 pos = 0;
for(uint256 i = start; i < length; i++) {
out[i] = _proxies[i];
out[pos++] = _proxies[i];
}
}
}

0 comments on commit 23a453f

Please sign in to comment.