Skip to content

Commit a65b203

Browse files
committed
Add in a condition to resolve initial odao claim edge case
1 parent 5b8c8f1 commit a65b203

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

contracts/contract/rewards/claims/RocketClaimTrustedNode.sol

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ contract RocketClaimTrustedNode is RocketBase, RocketClaimTrustedNodeInterface {
4343
RocketRewardsPoolInterface rewardsPool = RocketRewardsPoolInterface(getContractAddress("rocketRewardsPool"));
4444
// Get total trusted nodes for this claim interval
4545
uint256 trustedNodesClaimIntervalTotal = rewardsPool.getClaimingContractUserTotalCurrent("rocketClaimTrustedNode");
46+
// Edge case for when there are no trusted nodes in the current interval
47+
if (trustedNodesClaimIntervalTotal == 0) {
48+
// Use the number of trusted nodes in the next interval instead
49+
trustedNodesClaimIntervalTotal = rewardsPool.getClaimingContractUserTotalNext("rocketClaimTrustedNode");
50+
}
4651
// They can only claim until the next claim interval has started if they are a newly trusted node
4752
// Calculate the perc of the trusted node rewards they are entitled too
4853
return getClaimPossible(_trustedNodeAddress) && trustedNodesClaimIntervalTotal > 0 ? calcBase.div(trustedNodesClaimIntervalTotal) : 0;

0 commit comments

Comments
 (0)