feat: Implemented getPoolIds

This commit is contained in:
domenicodev
2023-12-13 18:13:30 +01:00
parent b8794fd3a4
commit d9a1102c32

View File

@@ -61,7 +61,14 @@ contract IntegralSwapAdapter is ISwapAdapter {
override
returns (bytes32[] memory ids)
{
revert NotImplemented("IntegralSwapAdapter.getPoolIds");
uint256 endIdx = offset + limit;
if (endIdx > factory.allPairsLength()) {
endIdx = factory.allPairsLength();
}
ids = new bytes32[](endIdx - offset);
for (uint256 i = 0; i < ids.length; i++) {
ids[i] = bytes20(factory.allPairs(offset + i));
}
}
}