Program power_up.aleo
Program ID
power_up.aleo
Deployment transaction
Times called
8
Similar programs
0
Program Structure
Imports
-
Mappings
-
Structs
DiceData
Sum
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
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;