getPausedRegions does not return the region with the highest pausable indext
https://github.com/bosonprotocol/boson-protocol-contracts/blob/4191e9f51b46e8755278b432a992975089dc8d82/contracts/protocol/facets/PauseHandlerFacet.sol#L70-L107
The following line is not the total number of regions, but the maximum pausable region index. The region count is 1 higher. https://github.com/bosonprotocol/boson-protocol-contracts/blob/4191e9f51b46e8755278b432a992975089dc8d82/contracts/protocol/facets/PauseHandlerFacet.sol#L73
The loops below do not reach the latest element and never report if the last region is paused.
This does not affect the pausing functionality otherwise.
@zajck, you are right. Then, why don't you update like this?
uint256 totalRegions = uint256(type(BosonTypes.PausableRegion).max) + 1;
@neverm25 , yes that's the solution. In fact, we use it in the other project that the team is currently focused on - Fermion protocol, which is built on top of Boson. Its GitHub repo is not public yet, but you can read about the project here: https://www.fermionprotocol.io/
We haven't fixed this in Boson Contracts yet, since it's such a low-priority issue, but we'll do it as soon as we develop some other new features and schedule the next upgrade.
Sounds interesting. Could you share the information with me? I would like to contribute to your project.
@zajck can I create a PR for your issues?
@neverm25 sure, go ahead. Just make sure you've read the contributing section and as noted here, your PR must originate from your forked repo.
Also, when you start working on an open issue it helps us if you assign it to yourself and notify us by commenting on it.
Regarding Fermion, it will become public soon (probably in about a month), but we might give you early access since we always welcome new contributors. I'll let you know once we align on it internally.
@zajck thanks for your support. I look forward to working with you and your team.