tx · FbsT6VmqaRHWy7yP3pw7VdCUxikJ5Sgg9ghdr66jutu7 3MzfaHTFgjznN8zniycq5PZxaenTjwcYLXf: -0.01000000 Waves 2022.02.03 23:37 [1907919] smart account 3MzfaHTFgjznN8zniycq5PZxaenTjwcYLXf > SELF 0.00000000 Waves
{ "type": 13, "id": "FbsT6VmqaRHWy7yP3pw7VdCUxikJ5Sgg9ghdr66jutu7", "fee": 1000000, "feeAssetId": null, "timestamp": 1643920670692, "version": 2, "chainId": 84, "sender": "3MzfaHTFgjznN8zniycq5PZxaenTjwcYLXf", "senderPublicKey": "5ate1da9rhtGuHpuEAd28pTGh1GpM8SUthHy4JD2hPeL", "proofs": [ "43kUpWVfy5cjukm93FNzuhhjRcPvAPvWu3SXU4RhmcVGNQyp3Ka84ctsurkKTKzAF6QGxtm7wXYaWU3M7rsei5tm" ], "script": "base64:AAIFAAAAAAAAAYsIAhIECgIICBIDCgEIEgMKAQgSBAoCCBgSBAoCCAgSABoPCgFhEgplc3RFbkNvdXJzGhIKAWISDWNsYXNzZUVuQ291cnMaFAoBYxIPbm9kZVZhbGlkYXRyaWNlGhEKAWQSDGdldENsYXNzTmFtZRoICgFlEgNub20aDwoBZhIKcHJvZmVzc2V1choRCgFnEgx2YWxpZGVyRWxldmUaCAoBaBIDYWNjGgYKAWkSAWUaEwoBahIOc3R1ZGVudEFkZHJlc3MaEgoBaxINc3R1ZGVudFN0YXR1cxoICgFsEgNyZXMaDgoBbRIJdGVzdFZhbGlkGgYKAW4SAWkaCwoBbxIGZWxldmVzGgwKAXASB2FkZHJlc3MaCwoBcRIGY2xhc3NlGhQKAXISD2xlYXNlZEV0dWRpYW50cxoHCgFzEgIkbBoHCgF0EgIkcxoKCgF1EgUkYWNjMBoKCgF2EgUkZjBfMRoHCgF3EgIkYRoHCgF4EgIkaRoKCgF5EgUkZjBfMhoKCgF6EgVlbGV2ZQAAAAYAAAAAAWECAAAACmVzdEVuQ291cnMAAAAAAWICAAAADWNsYXNzZUVuQ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AAAXYAAAACCQEAAAABdgAAAAIJAQAAAAF2AAAAAgUAAAABdQAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAgAAAAAAAAAAAwAAAAAAAAAABAAAAAAAAAAABQAAAAAAAAAABgAAAAAAAAAABwAAAAAAAAAACAAAAAAAAAAACQAAAAAAAAAACgAAAAAAAAAACwAAAAAAAAAADAAAAAAAAAAADQAAAAAAAAAADgAAAAAAAAAADwAAAAAAAAAAEAAAAAAAAAAAEQAAAAAAAAAAEgAAAAAAAAAAEwAAAAAAAAAAFAAAAAAAAAAAFQAAAAAAAAAAFgAAAAAAAAAAFwAAAAAAAAAAGAAAAAAAAAAAGQAAAAAAAAAAGgAAAAAAAAAAGwAAAAAAAAAAHAAAAAAAAAAAHQAAAAAAAAAAHgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAAFiCQEAAAABZAAAAAIFAAAAAXEIBQAAAAFuAAAABmNhbGxlcgkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAABYQYFAAAAA25pbAAAAAFuAQAAAA9mYWlyZUFwcGVsRWxldmUAAAACAAAAAXEAAAABegkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAABFldHVkaWFudHNfYWRkcmVzcwkBAAAAAW0AAAABAgAAACwzTjdhdDY2a01TUjY2d1BrWThwdm5BY1JnNzExWEtrUm1XN19wcsOpc2VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAARYmFsYW5jZV9hdmFpbGFibGUICQAD7wAAAAEFAAAABHRoaXMAAAAJYXZhaWxhYmxlBQAAAANuaWwAAAABbgEAAAAMYXJyZXRlckNvdXJzAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAAFiAgAAAAAJAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAIFAAAAAWEHBQAAAANuaWwAAAAA5JfzCQ==", "height": 1907919, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CZ7cxcEkLnRnDmzG2tP5u19zpkmV8WzSia3oYypPhjBP Next: 99etcyaPUYB921xWLpSKUfLvqVEG29C7Cng1EeKyZPjZ Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | - | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | - | let sender = toString(tx.sender) | |
4 | - | let isProfesseur = (getString(("professeur_" + sender)) != unit) | |
5 | - | if (if (isProfesseur) | |
6 | - | then true | |
7 | - | else (this == tx.sender)) | |
8 | - | then true | |
9 | - | else { | |
10 | - | let publicProfesseur = (getString(("professeur_" + toUtf8String(tx.proofs[1]))) != unit) | |
11 | - | true | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let estEnCours = "estEnCours" | |
5 | + | ||
6 | + | let classeEnCours = "classeEnCours" | |
7 | + | ||
8 | + | let nodeValidatrice = "validatorNode" | |
9 | + | ||
10 | + | func getClassName (nom,professeur) = ((nom + "_") + toString(professeur)) | |
11 | + | ||
12 | + | ||
13 | + | func validerEleve (acc,e) = { | |
14 | + | let studentAddress = addressFromStringValue(take(e, 35)) | |
15 | + | let studentStatus = takeRight(e, (size(e) - 34)) | |
16 | + | let res = invoke(studentAddress, "validationPresence", [studentStatus, getStringValue(nodeValidatrice)], nil) | |
17 | + | if ((res == res)) | |
18 | + | then true | |
19 | + | else throw("Strict value is not equal to itself.") | |
20 | + | } | |
21 | + | ||
22 | + | ||
23 | + | func testValid (e) = { | |
24 | + | let studentAddress = addressFromStringValue(take(e, 35)) | |
25 | + | let studentStatus = takeRight(e, (size(e) - 34)) | |
26 | + | let res = invoke(studentAddress, "validationPresence", [studentStatus, getStringValue(nodeValidatrice)], nil) | |
27 | + | if ((res == res)) | |
28 | + | then toString(studentAddress) | |
29 | + | else throw("Strict value is not equal to itself.") | |
30 | + | } | |
31 | + | ||
32 | + | ||
33 | + | @Callable(i) | |
34 | + | func createOrModifyClass (nom,eleves) = [StringEntry(getClassName(nom, i.caller), eleves)] | |
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | @Callable(i) | |
39 | + | func deleteClass (nom) = [DeleteEntry(getClassName(nom, i.caller))] | |
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | @Callable(i) | |
44 | + | func ajouterValidateur (address) = [StringEntry(nodeValidatrice, address)] | |
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | @Callable(i) | |
49 | + | func faireAppel (classe,eleves) = { | |
50 | + | let leasedEtudiants = { | |
51 | + | let $l = eleves | |
52 | + | let $s = size($l) | |
53 | + | let $acc0 = nil | |
54 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
55 | + | then $a | |
56 | + | else validerEleve($a, $l[$i]) | |
57 | + | ||
58 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
59 | + | then $a | |
60 | + | else throw("List size exceeds 30") | |
61 | + | ||
62 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
12 | 63 | } | |
64 | + | [StringEntry(classeEnCours, getClassName(classe, i.caller)), BooleanEntry(estEnCours, true)] | |
65 | + | } | |
66 | + | ||
67 | + | ||
68 | + | ||
69 | + | @Callable(i) | |
70 | + | func faireAppelEleve (classe,eleve) = [StringEntry("etudiants_address", testValid("3N7at66kMSR66wPkY8pvnAcRg711XKkRmW7_présent")), IntegerEntry("balance_available", wavesBalance(this).available)] | |
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | @Callable(i) | |
75 | + | func arreterCours () = [StringEntry(classeEnCours, ""), BooleanEntry(estEnCours, false)] | |
76 | + | ||
77 | + |
github/deemru/w8io/169f3d6 26.26 ms ◑