diff --git a/backend/canisters/airdrop_bot/CHANGELOG.md b/backend/canisters/airdrop_bot/CHANGELOG.md index 909c771f52..332af0d144 100644 --- a/backend/canisters/airdrop_bot/CHANGELOG.md +++ b/backend/canisters/airdrop_bot/CHANGELOG.md @@ -8,3 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Add Airdrop Bot ([#6088](https://github.com/open-chat-labs/open-chat/pull/6088)) + +### Changed + +- Ensure users can't win multiple lottery prizes in a single draw ([#6187](https://github.com/open-chat-labs/open-chat/pull/6187)) diff --git a/backend/canisters/airdrop_bot/impl/src/model/airdrops.rs b/backend/canisters/airdrop_bot/impl/src/model/airdrops.rs index 877453ff20..bb58e8b7ae 100644 --- a/backend/canisters/airdrop_bot/impl/src/model/airdrops.rs +++ b/backend/canisters/airdrop_bot/impl/src/model/airdrops.rs @@ -162,6 +162,9 @@ impl Airdrops { let winner = ticket_holders.remove(winning_ticket); + // Ensure the same user can't win multiple times + ticket_holders.retain(|u| *u != winner); + lottery_winners.push(( winner, Prize {