Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocializingPool: method returns startBlock as 1 for cycle 1. #201

Open
manoj9april opened this issue Jul 24, 2023 · 1 comment
Open

SocializingPool: method returns startBlock as 1 for cycle 1. #201

manoj9april opened this issue Jul 24, 2023 · 1 comment
Assignees

Comments

@manoj9april
Copy link

SocializingPool.sol::getRewardCycleDetails
function getRewardCycleDetails(uint256 _index) public view returns (uint256 _startBlock, uint256 _endBlock)

The above read method returns startBlock, endBlock given index
For the past cycles, i.e. the cycles for which rewards merkle data has already been submitted,
The startBlock is calculated as below

// past cycles
if (rewardsDataMap[_index].reportingBlockNumber != 0) {
    _startBlock = rewardsDataMap[_index - 1].reportingBlockNumber + 1;
    _endBlock = rewardsDataMap[_index].reportingBlockNumber;
    return (_startBlock, _endBlock);
}

For cycle = 1,
rewardsDataMap[_index - 1].reportingBlockNumber is 0.
Hence startBlock is returned as 1.
From next cycle onwards, startBlock would be calculated properly.

But we have checked, this method is not used anywhere in our contracts.

@manoj9april manoj9april self-assigned this Jul 24, 2023
@galacticminter
Copy link

We can clean up this code in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@galacticminter @manoj9april and others