Skip to content

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

Open
@manoj9april

Description

@manoj9april

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions