From 6efd17fadbca941d00633d5f5f56b66da02db1d2 Mon Sep 17 00:00:00 2001 From: Ron Turetzky Date: Sat, 29 Nov 2025 21:49:48 -0500 Subject: [PATCH] fix: include current cycle in getCurrentVotingPower Change getCurrentVotingPower to calculate voting power from previousCycleStartingBlock to block.number instead of just to lastClaimedBlockNumber. This ensures users who hold BREAD in the current cycle have their voting power counted. --- src/YieldDistributor.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/YieldDistributor.sol b/src/YieldDistributor.sol index 369e148..136f1bf 100644 --- a/src/YieldDistributor.sol +++ b/src/YieldDistributor.sol @@ -139,8 +139,8 @@ contract YieldDistributor is IYieldDistributor, Ownable2StepUpgradeable, VotingM * @return uint256 The voting power of the user */ function getCurrentVotingPower(address _account) public view returns (uint256) { - return this.getVotingPowerForPeriod(BREAD, previousCycleStartingBlock, lastClaimedBlockNumber, _account) - + this.getVotingPowerForPeriod(BUTTERED_BREAD, previousCycleStartingBlock, lastClaimedBlockNumber, _account); + return this.getVotingPowerForPeriod(BREAD, previousCycleStartingBlock, block.number, _account) + + this.getVotingPowerForPeriod(BUTTERED_BREAD, previousCycleStartingBlock, block.number, _account); } /// @notice Get the current accumulated voting power for a user