diff --git a/contracts/events/src/event_ops.rs b/contracts/events/src/event_ops.rs index 54ab7d6..e3315ab 100644 --- a/contracts/events/src/event_ops.rs +++ b/contracts/events/src/event_ops.rs @@ -734,7 +734,9 @@ pub fn select_winners( .ok_or(Error::InvalidDistribution)? as i128; let amount = base_escrow.saturating_mul(percent) / 100_i128; - let anchor_idx = existing_count + (idx as u32); + let anchor_idx = existing_count + .checked_add(idx as u32) + .ok_or(Error::TooManyContributors)?; storage::append_winner( env, event_id,