Skip to content
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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Aleo Native Raffle #11

wants to merge 16 commits into from

Conversation

asharma13524
Copy link
Collaborator

@asharma13524 asharma13524 commented Nov 22, 2024

Summary:

Adds aleo native raffles with the following changes to the original raffle contract:

  • Adds fund -> transfers credits into the program
  • Adds send_prize_to_winner -> transfers credits from the program to a winner of the raffle

todos before merging:

  • adjust the spinner program name to original (was just used for testing raffle on testnet)
  • change the operator address back to the mainnet operator

@asharma13524 asharma13524 changed the title add initial files/fns for aleo native raffle Aleo Native Raffle Nov 22, 2024
@asharma13524 asharma13524 marked this pull request as ready for review November 22, 2024 20:18
// total number of winners
mapping winner_count: u64 => u64;

async transition kickoff_raffle (microcredits: u64) -> Future {
Copy link
Contributor

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

Mapping::set(winner, current_winner_count, winner_address);
}

async transition send_prize_to_winner (winning_address: address, winning_amt_microcredits: u64) -> Future {
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants