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

Program formation_tests_v001.aleo

Program ID
formation_tests_v001.aleo
Owner signature
sign173k2dcznema0eae30dhah2q2mp2069mpq6tvc4vy6r0y2pznyuqhsslpa54e9w0nmxwhw63uyv2eukug4znlu9xrw3cn4qc6tcx0zqg6t4ta270vkd8sjaqr9ru9ycrdcca9l8rlad44d6855720ej55qj56tcupqtrrn069wzqtvjeqsrdjx7tmlzp56dkw7ee2h96ww75q5yzr4j2
Times called
26
Similar programs
Imports
-
Mappings
players (u8 -> Player)
valid_formations (u8 -> boolean)
game_outcomes (address -> GameOutcome)
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_v001.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;

function add_player:
    input r0 as Player.private;
    async add_player r0 into r1;
    output r1 as formation_tests_v001.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_v001.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;

Block heightTimestampTransition IDFunction callState
1,716,1652024-03-13 08:09:59au1vykvy6js2u4qvncp9evkv4qa7fngd4975r2wpe5j0rw5hrenkcpqz46zw6validate_formationAccepted
1,716,0972024-03-13 08:04:21au1fzjkvy8svpdvd3xap87l8uce0fxuqz6rumjlj98q42rf4cpfmqzsfmpjfsadd_playerAccepted
1,716,0952024-03-13 08:04:12au1qfrh79g4w59p5cj8ey2llxvfccrxl3fa0jk38dfmwsfjpveeuyqqjywegaadd_playerAccepted
1,716,0932024-03-13 08:03:57au1620zqtlfrsj0ja4r0pm3fry8usqhvh0lhcj0qtu6zyytwqr7n5qswl93ljadd_playerAccepted
1,716,0912024-03-13 08:03:50au1mywf79s0xfgw9ruyklnaa9mefu5dr9rr8adskyl096n0pcxegyrsnye5qsadd_playerAccepted
1,716,0892024-03-13 08:03:40au15dgqhrjztgwpmzu7d6mv7qhvtr9gpt7vzqklexhmm6cr74r6cgxs6yu66dadd_playerAccepted
1,716,0872024-03-13 08:03:30au14xxdaulyhfh2ueze8wtlm5ppnksw2gvm6036tjvjyzl437v78y9qs40n2padd_playerAccepted
1,716,0842024-03-13 08:03:19au1vrrkajmv5d23ayt055dk9y6u2ulsh2dzrsjy7tljft4ndu0gugrqm8hdjxadd_playerAccepted
1,716,0822024-03-13 08:03:08au1w492g5d5d7yuw9900yj4mmtrg4z8dzr0qmwfmcmwywlg0ty23vzs9nh5m3add_playerAccepted
1,716,0812024-03-13 08:03:01au1lpsdj5vnfsl2fj7hchmlwka4ceg8uv9zmjmmwscpnunsqrnykv9qmff6kwadd_playerAccepted
1,716,0792024-03-13 08:02:50au1zcu429y7dwwgemkpxs8epwr5c8dk8n7z495gzq6wl9khkwz7pqzs9qree9add_playerAccepted
1,716,0762024-03-13 08:02:31au1rwdfrlwx3t3gyq9g2st85ka4hkxdszquhvur32nh04mpgenvyqzqdwx5m5add_playerAccepted
1,716,0762024-03-13 08:02:31au1xkjwlwpyu4m3jstx5fhw7680psmuccf2cg3kj5384s5mdnhugyrq3x6c2fadd_playerAccepted
1,715,3922024-03-13 07:02:59au1fug49884ylsu3rqeasn7h8jx6hmpfc5x2pd4nts26acjgmjnsc9smp94dtvalidate_formationAccepted
1,715,2762024-03-13 06:53:29au1vnxtq7gdps7cm7vupzjsrtvtnuzspss4clh5yykg8u7la49q7urs50cts0add_playerAccepted
1,715,2742024-03-13 06:53:18au1uqtcgecdvv92d8rsvmywcxafzle92qhe9m9kqfy84577cka8hq8qxaal3qadd_playerAccepted
1,715,2722024-03-13 06:53:08au15kug00mwhq0kad3mezk5lh8llxfefpqt03qqlyrapxhfmj2xzcfqg6xlfkadd_playerAccepted
1,715,2702024-03-13 06:53:00au1zzc7wess0fn7f0pe5263eht7np5nnn2l7ljey6pkh0ry689q9c8qrlhenkadd_playerAccepted
1,715,2662024-03-13 06:52:41au1ummpdvn4w64gpmfw2j49ncdhnvslajt4xqr0ha2p9qy48nqhzgqqyl2rpladd_playerAccepted
1,715,2642024-03-13 06:52:33au1nlc38r7tmd9j4j70327gvg6k5etrk54fmcmyr38rduwv3rcppurs4zj9xfadd_playerAccepted
1,715,2622024-03-13 06:52:22au1n0vhw0t0p22zfw99ewv9qjf2y9zmrp76l3jahmrta5vrlve7kyrs2f8xqxadd_playerAccepted
1,715,2602024-03-13 06:52:13au19ykawmz00xy35a6u649sxwgn4gk9l6las37459lflnh20x8h0qrq3tgn22add_playerAccepted
1,715,2572024-03-13 06:51:53au1nl89092epxy90dnygumm0jrqkh3rple0zet6pp7qg4mn2p7l4syqmmqwt6add_playerAccepted
1,715,2562024-03-13 06:51:42au1us76ezyy5vje5dar6as456wsnp93pr4ygcafpxa7k2rgvqv5fy9sa5lee2add_playerAccepted
1,715,2562024-03-13 06:51:42au12fj5c0xycr45dfm8q07t5nz9hml7jpqley4lzjmyfxhgu3l3lqrqlzmtjladd_playerAccepted
1,715,2542024-03-13 06:51:22au13h930vht8uky72fqfgzclrqe06yczvtqn4d468emcg5vpzqfxqpsnedy86add_playerAccepted






Not implemented