-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aleo Native Raffle #11
base: main
Are you sure you want to change the base?
Conversation
arcade/aleo_raffle/src/main.leo
Outdated
// total number of winners | ||
mapping winner_count: u64 => u64; | ||
|
||
async transition kickoff_raffle (microcredits: u64) -> Future { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd probably just call this fund
arcade/aleo_raffle/src/main.leo
Outdated
Mapping::set(winner, current_winner_count, winner_address); | ||
} | ||
|
||
async transition send_prize_to_winner (winning_address: address, winning_amt_microcredits: u64) -> Future { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a bulk send_prizes
transition that sends all prizes? or do we run into limits there?
separately, would it make sense to have this function callable by each winner? in this scenario, we'd be able to reclaim any leftover funds after the 7-day claim window
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we technically still would be able to reclaim with the current implementation, we would use this function as well.
we could probably have a bulk send_prizes
I'm wondering about costs and limits there. I'll do some tests to see what upper limits are there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually don't think we can have a bulk send_prizes
because that would require us to have something like below which is a limit of leo today afaiu which isn't possible today.
async transition send_prize_to_winner (winning_address: address, winning_amt_microcredits: u64) -> Future {
for i: u32 in 0u32..100u32 {
let f_i: Future = credits.aleo/transfer_public(winning_address, winning_amt_microcredits);
}
}
Summary:
Adds aleo native raffles with the following changes to the original raffle contract:
fund
-> transfers credits into the programsend_prize_to_winner
-> transfers credits from the program to a winner of the raffletodos before merging: