The explorer is out of sync. The last synced block is 524 hours ago. Current block height: explorer: 2206528 / node: 2541487 / ref: 2492275

Program puzzle_raffle_v001.aleo

Program ID
puzzle_raffle_v001.aleo
Owner signature
sign1yukxz394wjxg8nn5zcg9d9k86w9jyuj7rfyhpsreqf56mwuju5psa2mty8mxfc3nwjealz7aa8ld0hll0f5pakjg54ztq3jfer6jvq83pk4czw3pjwdx8pk0axyudpykaqe5v3rff4cxjcl8gjclhql6p97xk9sehmz40hsl4tzrh7tq05g30mf5szq09729ynva68jd0rjsy3p7j3z
Times called
17
Similar programs
Imports
-
Mappings
entries (u64 -> address)
total_entries (u64 -> u64)
winner (address -> u32)
Structs
PrivateKey
Records
Prize
AuditPrize
AuditPrizeToWinner
Functions
-
Transitions
mint_prize(u128, u128) -> (Prize, AuditPrize)
add_one_raffle_entry(public address) -> () finalize(address)
add_two_raffle_entries(public address) -> () finalize(address)
add_three_raffle_entries(public address) -> () finalize(address)
add_four_raffle_entries(public address) -> () finalize(address)
add_five_raffle_entries(public address) -> () finalize(address)
add_six_raffle_entries(public address) -> () finalize(address)
add_seven_raffle_entries(public address) -> () finalize(address)
add_eight_raffle_entries(public address) -> () finalize(address)
add_nine_raffle_entries(public address) -> () finalize(address)
add_ten_raffle_entries(public address) -> () finalize(address)
add_eleven_raffle_entries(public address) -> () finalize(address)
add_twelve_raffle_entries(public address) -> () finalize(address)
add_thirteen_raffle_entries(public address) -> () finalize(address)
add_fourteen_raffle_entries(public address) -> () finalize(address)
add_fifteen_raffle_entries(public address) -> () finalize(address)
draw_winner() -> ()
send_prize_to_winner(public address, Prize) -> (Prize, AuditPrizeToWinner)
Program Source Code (Aleo Instruction) Upload Leo source

program puzzle_raffle_v001.aleo;

struct PrivateKey:
    pk_pt1 as u128;
    pk_pt2 as u128;

record Prize:
    owner as address.private;
    private_key as PrivateKey.private;

record AuditPrize:
    owner as address.private;
    minter as address.private;
    private_key as PrivateKey.private;

record AuditPrizeToWinner:
    owner as address.private;
    winner as address.private;
    private_key as PrivateKey.private;

mapping entries:
    key as u64.public;
    value as address.public;

mapping total_entries:
    key as u64.public;
    value as u64.public;

mapping winner:
    key as address.public;
    value as u32.public;

function mint_prize:
    input r0 as u128.private;
    input r1 as u128.private;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    cast r0 r1 into r2 as PrivateKey;
    cast aleo1fan3jt83xvs5m4pqppmeghv4ypsan5aq4clwt4hnfv8pq90evqqq4dj6p6 r2 into r3 as Prize.record;
    cast r0 r1 into r4 as PrivateKey;
    cast aleo1fan3jt83xvs5m4pqppmeghv4ypsan5aq4clwt4hnfv8pq90evqqq4dj6p6 aleo1fan3jt83xvs5m4pqppmeghv4ypsan5aq4clwt4hnfv8pq90evqqq4dj6p6 r4 into r5 as AuditPrize.record;
    output r3 as Prize.record;
    output r5 as AuditPrize.record;

function add_one_raffle_entry:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_one_raffle_entry r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_one_raffle_entry.future;
finalize add_one_raffle_entry:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r2 into total_entries[0u64];

function add_two_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_two_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_two_raffle_entries.future;
finalize add_two_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r3 into total_entries[0u64];

function add_three_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_three_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_three_raffle_entries.future;
finalize add_three_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r4 into total_entries[0u64];

function add_four_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_four_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_four_raffle_entries.future;
finalize add_four_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r5 into total_entries[0u64];

function add_five_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_five_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_five_raffle_entries.future;
finalize add_five_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r6 into total_entries[0u64];

function add_six_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_six_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_six_raffle_entries.future;
finalize add_six_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r7 into total_entries[0u64];

function add_seven_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_seven_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_seven_raffle_entries.future;
finalize add_seven_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r8 into total_entries[0u64];

function add_eight_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_eight_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_eight_raffle_entries.future;
finalize add_eight_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r0 into entries[r8];
    add r1 8u64 into r9;
    set r9 into total_entries[0u64];

function add_nine_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_nine_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_nine_raffle_entries.future;
finalize add_nine_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r0 into entries[r8];
    add r1 8u64 into r9;
    set r0 into entries[r9];
    add r1 9u64 into r10;
    set r10 into total_entries[0u64];

function add_ten_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_ten_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_ten_raffle_entries.future;
finalize add_ten_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r0 into entries[r8];
    add r1 8u64 into r9;
    set r0 into entries[r9];
    add r1 9u64 into r10;
    set r0 into entries[r10];
    add r1 10u64 into r11;
    set r11 into total_entries[0u64];

function add_eleven_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_eleven_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_eleven_raffle_entries.future;
finalize add_eleven_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r0 into entries[r8];
    add r1 8u64 into r9;
    set r0 into entries[r9];
    add r1 9u64 into r10;
    set r0 into entries[r10];
    add r1 10u64 into r11;
    set r0 into entries[r11];
    add r1 11u64 into r12;
    set r12 into total_entries[0u64];

function add_twelve_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_twelve_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_twelve_raffle_entries.future;
finalize add_twelve_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r0 into entries[r8];
    add r1 8u64 into r9;
    set r0 into entries[r9];
    add r1 9u64 into r10;
    set r0 into entries[r10];
    add r1 10u64 into r11;
    set r0 into entries[r11];
    add r1 11u64 into r12;
    set r0 into entries[r12];
    add r1 12u64 into r13;
    set r13 into total_entries[0u64];

function add_thirteen_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_thirteen_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_thirteen_raffle_entries.future;
finalize add_thirteen_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r0 into entries[r8];
    add r1 8u64 into r9;
    set r0 into entries[r9];
    add r1 9u64 into r10;
    set r0 into entries[r10];
    add r1 10u64 into r11;
    set r0 into entries[r11];
    add r1 11u64 into r12;
    set r0 into entries[r12];
    add r1 12u64 into r13;
    set r0 into entries[r13];
    add r1 13u64 into r14;
    set r14 into total_entries[0u64];

function add_fourteen_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_fourteen_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_fourteen_raffle_entries.future;
finalize add_fourteen_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r0 into entries[r8];
    add r1 8u64 into r9;
    set r0 into entries[r9];
    add r1 9u64 into r10;
    set r0 into entries[r10];
    add r1 10u64 into r11;
    set r0 into entries[r11];
    add r1 11u64 into r12;
    set r0 into entries[r12];
    add r1 12u64 into r13;
    set r0 into entries[r13];
    add r1 13u64 into r14;
    set r0 into entries[r14];
    add r1 14u64 into r15;
    set r15 into total_entries[0u64];

function add_fifteen_raffle_entries:
    input r0 as address.public;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async add_fifteen_raffle_entries r0 into r1;
    output r1 as puzzle_raffle_v001.aleo/add_fifteen_raffle_entries.future;
finalize add_fifteen_raffle_entries:
    input r0 as address.public;
    get.or_use total_entries[0u64] 0u64 into r1;
    set r0 into entries[r1];
    add r1 1u64 into r2;
    set r0 into entries[r2];
    add r1 2u64 into r3;
    set r0 into entries[r3];
    add r1 3u64 into r4;
    set r0 into entries[r4];
    add r1 4u64 into r5;
    set r0 into entries[r5];
    add r1 5u64 into r6;
    set r0 into entries[r6];
    add r1 6u64 into r7;
    set r0 into entries[r7];
    add r1 7u64 into r8;
    set r0 into entries[r8];
    add r1 8u64 into r9;
    set r0 into entries[r9];
    add r1 9u64 into r10;
    set r0 into entries[r10];
    add r1 10u64 into r11;
    set r0 into entries[r11];
    add r1 11u64 into r12;
    set r0 into entries[r12];
    add r1 12u64 into r13;
    set r0 into entries[r13];
    add r1 13u64 into r14;
    set r0 into entries[r14];
    add r1 14u64 into r15;
    set r0 into entries[r15];
    add r1 15u64 into r16;
    set r16 into total_entries[0u64];

function draw_winner:
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    async draw_winner  into r0;
    output r0 as puzzle_raffle_v001.aleo/draw_winner.future;
finalize draw_winner:
    get total_entries[0u64] into r0;
    rand.chacha into r1 as u64;
    rem r1 r0 into r2;
    get entries[r2] into r3;
    set 0u32 into winner[r3];

function send_prize_to_winner:
    input r0 as address.public;
    input r1 as Prize.record;
    assert.eq self.caller self.signer;
    assert.eq self.caller aleo1nnrfst0v0zrmv809y9l55denfldx3ryn0nmelws0ffz0hx9mxcys84jxxn;
    cast r0 r1.private_key into r2 as Prize.record;
    cast aleo1fan3jt83xvs5m4pqppmeghv4ypsan5aq4clwt4hnfv8pq90evqqq4dj6p6 r0 r1.private_key into r3 as AuditPrizeToWinner.record;
    output r2 as Prize.record;
    output r3 as AuditPrizeToWinner.record;

Block heightTimestampTransition IDFunction callState
1,811,0852024-03-30 02:02:40au16apnk96e4swpsvdm3wlskt74r7zr99ev25qlddr72znskvc3zyzqxafteuadd_one_raffle_entryAccepted
1,809,8832024-03-30 00:06:05au1c3tt0auk8dg3nwfvpww5pg7yuq33agercjt8tndhjauht5pdzs8q9znafuadd_one_raffle_entryAccepted
1,807,9982024-03-29 20:59:06au1n6scqtmekurlsvvwuyx2ua790vw5hjzpge494uaef5m4v57xhv9sc4jkl7add_one_raffle_entryAccepted
1,807,5872024-03-29 20:17:43au17gdkk8cegtmvmhx6whnkl94pe4jsffgfh2v5l2nqysv346e3659qlcr7aeadd_one_raffle_entryAccepted
1,807,4642024-03-29 20:05:46au14rs9xj3sjnaxhsxm753urc2u87spcs82tmxcd9f6qfj245n86cxqj85dv2add_one_raffle_entryAccepted
1,807,3812024-03-29 19:57:20au1hl7hcu0hyf8ukpmv263qzhahwt7xaqry5drfpu2u23qda524ns9skynxjmadd_one_raffle_entryAccepted
1,807,2752024-03-29 19:46:17au1zc3t6thn0mkqx8gxzst972thea0yjkwvwgyvtk867000phe82grq3gk5jladd_one_raffle_entryAccepted
1,807,2482024-03-29 19:43:54au1jplapdqa3z9ngureqjk8r8ehuuw0z5q4sapl720xej84382tfuzqddmmq7add_one_raffle_entryAccepted
1,807,1522024-03-29 19:34:12au1kzxwq98krv2jgmamfuvpwv9a6tv0su6n6m7nqerwvy4vdf6gu5gqsywcsxadd_one_raffle_entryAccepted
1,807,0592024-03-29 19:24:49au1jt5j3rumu5c40tdq2k9dh8c2360w6u4drm0rqj4tmfxew4enqv9qgd7v4sadd_one_raffle_entryAccepted
1,806,9812024-03-29 19:17:20au1h6j65yqye7kj5x2xtcyxx6vezf755ln400km3yff39dlx0qh4c8qql3k3yadd_one_raffle_entryAccepted
1,806,6852024-03-29 18:48:16au17mceys2ayrs02u82an2akc22cck0dv465dnlpe37wtkxa7kd25xqw7wlm6add_one_raffle_entryAccepted
1,806,6372024-03-29 18:43:18au1775dvv0c5yrhr9ewgcdp68rjq4uq07c09d55e90m7jnpvgeanu8sn3ztdnadd_one_raffle_entryAccepted
1,806,2972024-03-29 18:11:17au1gxfejcqncrnytwu27s0u9cpnyfpytpx8e7lc26n9kc9c7y9q0q8s6q9aptadd_one_raffle_entryAccepted
1,806,1922024-03-29 18:00:50au1vw90v4jddx0ck42ktjkw7u0kjj2qp6phhzg0uhjqkjzycqrykugqluleq6add_one_raffle_entryAccepted
1,804,6582024-03-29 15:31:39au10m3q0a0uyl9v3k6w9lleexavp93pt55kjl3rw6rat0wkxhl8ms9sj3aq7fmint_prizeAccepted
1,795,3982024-03-29 00:19:46au1xf590y4tx6fkskfy7jeqvttcekhkunv5rjquekugacuzslvxz5gsk2gemxadd_one_raffle_entryAccepted






Not implemented