Skip to content

Commit 90a6a24

Browse files
committed
Avoid division by zero when totalShares is zero
1 parent 62f78b3 commit 90a6a24

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

protocol/synthetix/contracts/modules/core/RewardsManagerModule.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ contract RewardsManagerModule is IRewardsManagerModule {
357357
// No rewards are currently being distributed if the distributor doesn't exist, they are scheduled to be distributed in the future, or the distribution as already completed
358358
if (
359359
address(vault.rewards[rewardId].distributor) == address(0) ||
360+
totalShares == 0 ||
360361
vault.rewards[rewardId].start > curTime.toUint() ||
361362
vault.rewards[rewardId].start + vault.rewards[rewardId].duration <= curTime.toUint()
362363
) {

0 commit comments

Comments
 (0)