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

Program formation_tests_v002.aleo

Program ID
formation_tests_v002.aleo
Owner signature
sign14rh7mga6lx256pjufusd9qhatw955kvrv6g72wrl7d0swxh8g5pjpeg8wpn6z8s0m7uzmju5gvkfe3l9edf6yd9ldj4t3sv4p8mnupq6t4ta270vkd8sjaqr9ru9ycrdcca9l8rlad44d6855720ej55qj56tcupqtrrn069wzqtvjeqsrdjx7tmlzp56dkw7ee2h96ww75q56svqy8
Times called
17
Similar programs
Imports
-
Mappings
players (u8 -> Player)
valid_formations (u8 -> boolean)
game_outcomes (address -> GameOutcome)
validation_details (u8 -> ValidationDetails)
Structs
GameOutcome
Player
ValidationDetails
Records
-
Functions
-
Transitions
add_player(Player) -> () finalize(Player)
validate_formation(u8, [u8; 11u32]) -> () finalize(u8, [u8; 11u32])
Program Source Code (Aleo Instruction) Upload Leo source

program formation_tests_v002.aleo;

struct GameOutcome:
    address_home as address;
    address_away as address;
    team_id_home as u8;
    team_id_away as u8;
    goals_home as u64;
    goals_away as u64;

struct Player:
    player_id as u8;
    team_id as u8;
    position as field;
    attack as u8;
    defense as u8;
    speed as u8;
    power as u8;
    stamina as u8;
    technique as u8;
    goalkeeping as u8;

struct ValidationDetails:
    amount_goalkeepers as u8;
    same_team as boolean;
    wrong_team_index as u8;

mapping players:
    key as u8.public;
    value as Player.public;

mapping valid_formations:
    key as u8.public;
    value as boolean.public;

mapping game_outcomes:
    key as address.public;
    value as GameOutcome.public;

mapping validation_details:
    key as u8.public;
    value as ValidationDetails.public;

function add_player:
    input r0 as Player.private;
    async add_player r0 into r1;
    output r1 as formation_tests_v002.aleo/add_player.future;
finalize add_player:
    input r0 as Player.public;
    set r0 into players[r0.player_id];

function validate_formation:
    input r0 as u8.private;
    input r1 as [u8; 11u32].private;
    async validate_formation r0 r1 into r2;
    output r2 as formation_tests_v002.aleo/validate_formation.future;
finalize validate_formation:
    input r0 as u8.public;
    input r1 as [u8; 11u32].public;
    get players[r1[0]] into r2;
    get players[r1[1]] into r3;
    is.eq r3.position 1field into r4;
    add 0u8 1u8 into r5;
    ternary r4 r5 0u8 into r6;
    is.neq r3.team_id r2.team_id into r7;
    ternary r7 false true into r8;
    ternary r7 1u8 0u8 into r9;
    get players[r1[2]] into r10;
    is.eq r10.position 1field into r11;
    add r6 1u8 into r12;
    ternary r11 r12 r6 into r13;
    is.neq r10.team_id r2.team_id into r14;
    ternary r14 false r8 into r15;
    ternary r14 2u8 r9 into r16;
    get players[r1[3]] into r17;
    is.eq r17.position 1field into r18;
    add r13 1u8 into r19;
    ternary r18 r19 r13 into r20;
    is.neq r17.team_id r2.team_id into r21;
    ternary r21 false r15 into r22;
    ternary r21 3u8 r16 into r23;
    get players[r1[4]] into r24;
    is.eq r24.position 1field into r25;
    add r20 1u8 into r26;
    ternary r25 r26 r20 into r27;
    is.neq r24.team_id r2.team_id into r28;
    ternary r28 false r22 into r29;
    ternary r28 4u8 r23 into r30;
    get players[r1[5]] into r31;
    is.eq r31.position 1field into r32;
    add r27 1u8 into r33;
    ternary r32 r33 r27 into r34;
    is.neq r31.team_id r2.team_id into r35;
    ternary r35 false r29 into r36;
    ternary r35 5u8 r30 into r37;
    get players[r1[6]] into r38;
    is.eq r38.position 1field into r39;
    add r34 1u8 into r40;
    ternary r39 r40 r34 into r41;
    is.neq r38.team_id r2.team_id into r42;
    ternary r42 false r36 into r43;
    ternary r42 6u8 r37 into r44;
    get players[r1[7]] into r45;
    is.eq r45.position 1field into r46;
    add r41 1u8 into r47;
    ternary r46 r47 r41 into r48;
    is.neq r45.team_id r2.team_id into r49;
    ternary r49 false r43 into r50;
    ternary r49 7u8 r44 into r51;
    get players[r1[8]] into r52;
    is.eq r52.position 1field into r53;
    add r48 1u8 into r54;
    ternary r53 r54 r48 into r55;
    is.neq r52.team_id r2.team_id into r56;
    ternary r56 false r50 into r57;
    ternary r56 8u8 r51 into r58;
    get players[r1[9]] into r59;
    is.eq r59.position 1field into r60;
    add r55 1u8 into r61;
    ternary r60 r61 r55 into r62;
    is.neq r59.team_id r2.team_id into r63;
    ternary r63 false r57 into r64;
    ternary r63 9u8 r58 into r65;
    get players[r1[10]] into r66;
    is.eq r66.position 1field into r67;
    add r62 1u8 into r68;
    ternary r67 r68 r62 into r69;
    is.neq r66.team_id r2.team_id into r70;
    ternary r70 false r64 into r71;
    ternary r70 10u8 r65 into r72;
    is.eq r69 1u8 into r73;
    and r71 r73 into r74;
    set r74 into valid_formations[r0];
    cast r69 r71 r72 into r75 as ValidationDetails;
    set r75 into validation_details[r0];

Block heightTimestampTransition IDFunction callState
1,716,3642024-03-13 08:29:46au1rc6r7zdhe9j4ghzdltgaauvnxacf698ey4f0j6ksxcp6xhpnn5qsfj2m74validate_formationAccepted
1,716,3312024-03-13 08:26:04au1wy0wa87qxzl3xjhqspl6gc25md2mg09jhapr2ph5yqlkh4w5rgpq4tzswyvalidate_formationAccepted
1,716,3132024-03-13 08:23:46au1y2psu2rdtghqp2j6ghvdtm48yx5mq9ccrsqqtclr66gurltqfqpsh0dqa5add_playerAccepted
1,716,3122024-03-13 08:23:34au1ly50gafdjd7xnvr2z7sye405khq3jz0pavddcqhgtz0athhd45pqywat2xadd_playerAccepted
1,716,3122024-03-13 08:23:34au1ywmgy9rhajqrn45rgs3jrvht3g2ekcvqsprlen8dhaqtuqv2cvgsv6tq3ladd_playerAccepted
1,716,3102024-03-13 08:23:23au1y9drd34ghh9c54c9pdkv4a93hm46zn33qg4nc2xtwdn3dwxyeuzqmmdk3hadd_playerAccepted
1,716,3082024-03-13 08:23:11au1zclsuknm5lu6pwrupm98wus9pfemmzqq95ny9hm6yzkmj4dh8yrseafmxladd_playerAccepted
1,716,3062024-03-13 08:23:02au1a87l5x3tlfzfmmsna2z9m0wm3vnn228qardj5vl2pmq4gqjkvqyq4c2a8hadd_playerAccepted
1,716,3032024-03-13 08:22:48au136xyz65jep0dzk9nwzfh5z6q8ydfpjn6uq475tnxd478kl497systtq9uzadd_playerAccepted
1,716,3012024-03-13 08:22:40au1tnmxsnu04anapd26k9gzqh3hp24rwhd4ay6zd5aw2p88j4nplszswjup95add_playerAccepted
1,716,2992024-03-13 08:22:32au10cqd9yd5tg8k8ph94kaz7ztms6xlmvhyumuryg5m5v52k6hhcggs2l4qd3add_playerAccepted
1,716,2972024-03-13 08:22:20au1jzncmy228qvme953duvxkkus2648hwhu9sjrss7tvqtx2j98ygxs73r6rtadd_playerAccepted
1,716,2952024-03-13 08:22:12au19h73z5aaz7eej698dk95cyndr4pr7xxeysuft56n4cn730l97yxq922l62add_playerAccepted
1,716,2932024-03-13 08:22:01au12taglwcz2623wphvwkln2f3ccsk46l0pku80twuk4yry0sp3qcgsv28qthadd_playerAccepted
1,716,1992024-03-13 08:13:24au173tjcnsrv4t98p9m3ulzkmp7r3e30ullyl9hr0z0j0d4qm9xnufqx20ee2validate_formationRejected
1,716,1952024-03-13 08:12:57au1cj0epn6nq3am3egdd97nv4j7lu754mw4az2aucax55us73mks5xsmkpv0qvalidate_formationRejected
1,716,1612024-03-13 08:09:39au1j4xhs3jm76kwhh9k9c2kfjlf7gmqm820lyfxv2x5pvvr5hphfsxqxar9rqvalidate_formationRejected








Not implemented