Program power_up.aleo

Program ID
power_up.aleo
Times called
8
Similar programs
0
Program Structure
Imports
-
Mappings
-
Structs
DiceData
Sum
Records
PowerUp
Functions
-
Transitions
create_power_up(address, public field, u8) -> PowerUp
burn_power_up(PowerUp) -> ()
transfer_power_up(address, PowerUp) -> PowerUp
use_birds_eye(PowerUp, DiceData) -> Sum
Source code (Aleo instructions)
program power_up.aleo;

struct DiceData:
    dice_1 as u8;
    dice_2 as u8;
    dice_3 as u8;
    dice_4 as u8;
    dice_5 as u8;
    dice_6 as u8;
    dice_7 as u8;
    dice_8 as u8;
    dice_9 as u8;
    dice_10 as u8;

struct Sum:
    sum as u8;

record PowerUp:
    owner as address.private;
    gates as u64.private;
    match_id as field.private;
    power_up_id as u8.private;

function create_power_up:
    input r0 as address.private;
    input r1 as field.public;
    input r2 as u8.private;
    cast r0 0u64 r1 r2 into r3 as PowerUp.record;
    output r3 as PowerUp.record;

function burn_power_up:
    input r0 as PowerUp.record;

function transfer_power_up:
    input r0 as address.private;
    input r1 as PowerUp.record;
    cast r0 0u64 r1.match_id r1.power_up_id into r2 as PowerUp.record;
    output r2 as PowerUp.record;

function use_birds_eye:
    input r0 as PowerUp.record;
    input r1 as DiceData.private;
    assert_eq r0.power_up_id 2u8;
    add r1.dice_1 r1.dice_2 into r2;
    add r2 r1.dice_3 into r3;
    add r3 r1.dice_4 into r4;
    add r4 r1.dice_5 into r5;
    add r5 r1.dice_6 into r6;
    add r6 r1.dice_7 into r7;
    add r7 r1.dice_8 into r8;
    add r8 r1.dice_9 into r9;
    add r9 r1.dice_10 into r10;
    cast r10 into r11 as Sum;
    output r11 as Sum.private;

Recent calls

Block height Timestamp Transition ID Function call
761776 2023-03-14 14:13:55 as1kazzwhyc3kuts30xluqp2t45twqwlw0dzm4zmg3hnv7yjed7qsyqzppy9c use_birds_eye
761768 2023-03-14 14:11:59 as1hz5trnwcyxjt7jwv7r56ftqeff47a84mgav3t89rqnese6emhsyshl7zdk create_power_up
761758 2023-03-14 14:09:56 as1hvkck5938tf9t74ae69ku04sv3nr8yu9w0rzp2hjc4mqvdnl3ufq7tugav use_birds_eye
761751 2023-03-14 14:08:21 as1csu9sta2vf3dg2s86lshql0mycdy6m8ppr0w892r93uprvxzqvpsx9v5tk create_power_up
761421 2023-03-14 12:57:17 as1gfceutgufp00wm3jc9fl4vzh0rh9f3rfg38fh7lu7sx89vtetyxqqlhm2g use_birds_eye
761413 2023-03-14 12:55:38 as106ljcwaqnykqd2hayv3zfhq8vzhn9e245nu8fq08dtag7r0tggrqsvchlg create_power_up
761406 2023-03-14 12:53:58 as1xvt4szgqxv35vn2f7yvhjdzx39kj6h5q93fra5c38z4n2k8ycygs4wqqjd create_power_up
761383 2023-03-14 12:49:00 as1uankl8y82k4pdkwfg9gckd3n5gagcay45g3m0500hgstz3jjkc8qcg452m burn_power_up
761374 2023-03-14 12:47:03 as13v4t4luwe4kgcvlzdn2lcfc0dcrxd5pa5sjladcpuymleuc565ysy35f3t transfer_power_up
761365 2023-03-14 12:44:59 as1rjadek279gvzync4lhk4nq2n7juqsx92a2qqz6gk4yk3gq7r359s37g6ty create_power_up
761359 2023-03-14 12:43:42 as1hkwg9242uyk3m6e2lq2xnakkwwpcwxjp8ywm6zf4zx4j2lc9fcfq55tnty create_power_up
761330 2023-03-14 12:37:16 as1ngd3knwcs3gpyh2k7ul9p3sx89jngyqhd8dny5v2jafkd37nqygqtlrxdk transfer_power_up
761320 2023-03-14 12:35:09 as1vm2qa43pnksjdtxhrss3zw53zuhr7wk8pv63594egeul8z0z858ss0p0ax create_power_up
761282 2023-03-14 12:27:29 as1rcv66fy5cyadpc4uwz36jkmzv4qtl5semxwvre64tnxstgjwrcys27jz85 create_power_up