Skip to content

Commit

Permalink
Merge pull request #13 from puzzlehq/luke/731
Browse files Browse the repository at this point in the history
[731] add max entries to giveaways
  • Loading branch information
lukenewman authored Jan 6, 2025
2 parents 5309f6e + f9bec4f commit 3f5ca81
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 238 deletions.
2 changes: 1 addition & 1 deletion arcade/raffle/build/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# puzzle_giveaway_112724.aleo
# giveaway.aleo

## Build Guide

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
program puzzle_arcade_ticket_v002.aleo;
program puzzle_arcade_ticket_v001.aleo;

record PuzzleArcadeTicket:
owner as address.private;
Expand All @@ -10,10 +10,10 @@ mapping registry:

function add_program_to_registry:
input r0 as address.private;
assert.eq self.caller self.signer;
assert.eq self.caller aleo196a39wq9q8ea779cmlmff0c9pj2gl4f5e8fhjpvmufe5utuq7y8snz4h2l;
assert.eq self.caller self.signer ;
assert.eq self.caller aleo1pedhtu6akw9z68wedu8t3fgxfdh3ye2rypeqkx9cxjpr99chqvyqkjg7rw ;
async add_program_to_registry r0 into r1;
output r1 as puzzle_arcade_ticket_v002.aleo/add_program_to_registry.future;
output r1 as puzzle_arcade_ticket_v001.aleo/add_program_to_registry.future;

finalize add_program_to_registry:
input r0 as address.public;
Expand All @@ -25,18 +25,18 @@ function mint:
cast r0 r1 into r2 as PuzzleArcadeTicket.record;
async mint self.caller into r3;
output r2 as PuzzleArcadeTicket.record;
output r3 as puzzle_arcade_ticket_v002.aleo/mint.future;
output r3 as puzzle_arcade_ticket_v001.aleo/mint.future;

finalize mint:
input r0 as address.public;
get.or_use registry[r0] false into r1;
assert.eq r1 true;
assert.eq r1 true ;

function spend:
input r0 as PuzzleArcadeTicket.record;
input r1 as u64.public;
gte r0.amount r1 into r2;
assert.eq r2 true;
assert.eq r2 true ;
sub r0.amount r1 into r3;
cast r0.owner r3 into r4 as PuzzleArcadeTicket.record;
output r4 as PuzzleArcadeTicket.record;
Expand All @@ -45,9 +45,9 @@ function join:
input r0 as PuzzleArcadeTicket.record;
input r1 as PuzzleArcadeTicket.record;
gt r0.amount 0u64 into r2;
assert.eq r2 true;
assert.eq r2 true ;
gt r1.amount 0u64 into r3;
assert.eq r3 true;
assert.eq r3 true ;
add r0.amount r1.amount into r4;
cast self.signer r4 into r5 as PuzzleArcadeTicket.record;
output r5 as PuzzleArcadeTicket.record;
Expand All @@ -57,11 +57,11 @@ function join3:
input r1 as PuzzleArcadeTicket.record;
input r2 as PuzzleArcadeTicket.record;
gt r0.amount 0u64 into r3;
assert.eq r3 true;
assert.eq r3 true ;
gt r1.amount 0u64 into r4;
assert.eq r4 true;
assert.eq r4 true ;
gt r2.amount 0u64 into r5;
assert.eq r5 true;
assert.eq r5 true ;
add r0.amount r1.amount into r6;
add r6 r2.amount into r7;
cast self.signer r7 into r8 as PuzzleArcadeTicket.record;
Expand All @@ -73,13 +73,13 @@ function join4:
input r2 as PuzzleArcadeTicket.record;
input r3 as PuzzleArcadeTicket.record;
gt r0.amount 0u64 into r4;
assert.eq r4 true;
assert.eq r4 true ;
gt r1.amount 0u64 into r5;
assert.eq r5 true;
assert.eq r5 true ;
gt r2.amount 0u64 into r6;
assert.eq r6 true;
assert.eq r6 true ;
gt r3.amount 0u64 into r7;
assert.eq r7 true;
assert.eq r7 true ;
add r0.amount r1.amount into r8;
add r8 r2.amount into r9;
add r9 r3.amount into r10;
Expand All @@ -93,15 +93,15 @@ function join5:
input r3 as PuzzleArcadeTicket.record;
input r4 as PuzzleArcadeTicket.record;
gt r0.amount 0u64 into r5;
assert.eq r5 true;
assert.eq r5 true ;
gt r1.amount 0u64 into r6;
assert.eq r6 true;
assert.eq r6 true ;
gt r2.amount 0u64 into r7;
assert.eq r7 true;
assert.eq r7 true ;
gt r3.amount 0u64 into r8;
assert.eq r8 true;
assert.eq r8 true ;
gt r4.amount 0u64 into r9;
assert.eq r9 true;
assert.eq r9 true ;
add r0.amount r1.amount into r10;
add r10 r2.amount into r11;
add r11 r3.amount into r12;
Expand Down
Loading

0 comments on commit 3f5ca81

Please sign in to comment.