tx · CjbR1ETeFWZPC3cQx17YiKhx7zzfFLXSQKqFnFXp15KC 3N9QhjBmyFRrGW5d8VQojB4wZhHmQhuvVrL: -0.01600000 Waves 2022.11.19 23:21 [2324476] smart account 3N9QhjBmyFRrGW5d8VQojB4wZhHmQhuvVrL > SELF 0.00000000 Waves
{ "type": 13, "id": "CjbR1ETeFWZPC3cQx17YiKhx7zzfFLXSQKqFnFXp15KC", "fee": 1600000, "feeAssetId": null, "timestamp": 1668889293842, "version": 2, "chainId": 84, "sender": "3N9QhjBmyFRrGW5d8VQojB4wZhHmQhuvVrL", "senderPublicKey": "BefhVEanzhrtdYfeWquaoSsMZw3BEaEZZB86Kosqw7Qb", "proofs": [ "4VbkmMtaz5YFozPxdHPijgZydhmBS1NiFEnJEUFHc4HVV3RBjxG1m7cF4BLPqSq7N5yPVAusTgsPyCPSGS6dDr3p" ], "script": "base64:AAIFAAAAAAAAACAIAhIDCgEBEgMKAQESCAoGCAgICAgIEgMKAQgSAwoBCAAAABoAAAAABWFkbWluAgAAACw3VHQ3NHI4UjdhdVRCVGQ2ckpNQTRxWXI5V0RXamMyU1VISFNyUk13OUJycwAAAAAOcmVzdWx0Q29udHJhY3QCAAAAIzNOQ25FVU5uSlh6NTdRV0FNWW5aQnUzU3FXNHR4b2cxWGVEAAAAAAxiZXRBbW91bnRLZXkCAAAAEGdsb2JhbF9iZXRBbW91bnQAAAAAC2RlYWRsaW5lS2V5AgAAABFnbG9iYWxfZGVhZGxpbmVfaAAAAAAFc2NhbGUAAAAAAAX14QAAAAAAA2ZlZQAAAAAAAAAA+gAAAAAIZmVlc2NhbGUAAAAAAAAAJxAAAAAACWtleXNHcm91cAkABEwAAAACAgAAAApHcm91cEEtMXN0CQAETAAAAAICAAAACkdyb3VwQS0ybmQJAARMAAAAAgIAAAAKR3JvdXBCLTFzdAkABEwAAAACAgAAAApHcm91cEItMm5kCQAETAAAAAICAAAACkdyb3VwQy0xc3QJAARMAAAAAgIAAAAKR3JvdXBDLTJuZ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dpbm5lcgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAACmNhbGxlckFkZHICAAAADV9GaW5hbC13aW5uZXIFAAAAA25pbAkAAAIAAAABAgAAAApPbmx5IGFkbWluAAAAAWkBAAAACWV2YWxTY29yZQAAAAEAAAAHYWRkcmVzcwQAAAAKZ3JvdXBTY29yZQkBAAAACmV2YWxHcm91cHMAAAABBQAAAAdhZGRyZXNzCQAAAgAAAAEJAAEsAAAAAgIAAAAGU2NvcmUgCQABpAAAAAEFAAAACmdyb3VwU2NvcmUAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebwIp5Q=", "height": 2324476, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6C7CHZq3ZJCasXCRd8Rz23Ctxe931gaJDe9acNAVc98i Next: Fr43DwGkze5AFahHyYtaCWcvnBp8pPxXkugQrdMyfzov Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | let fee = 250 | |
15 | 15 | ||
16 | 16 | let feescale = 10000 | |
17 | + | ||
18 | + | let keysGroup = ["GroupA-1st", "GroupA-2nd", "GroupB-1st", "GroupB-2nd", "GroupC-1st", "GroupC-2nd", "GroupD-1st", "GroupD-2nd", "GroupE-1st", "GroupE-2nd", "GroupF-1st", "GroupF-2nd", "GroupG-1st", "GroupG-2nd", "GroupH-1st", "GroupH-2nd"] | |
19 | + | ||
20 | + | let keysOcto = ["Octo1-winner", "Octo2-winner", "Octo3-winner", "Octo4-winner", "Octo5-winner", "Octo6-winner", "Octo7-winner", "Octo8-winner"] | |
21 | + | ||
22 | + | let keysQuarter = ["Quarter1-winner", "Quarter2-winner", "Quarter3-winner", "Quarter4-winner"] | |
23 | + | ||
24 | + | let keysSemi = ["Semi1-winner", "Semi2-winner"] | |
25 | + | ||
26 | + | let keysFinal = "Final-winner" | |
17 | 27 | ||
18 | 28 | func getAssetString (assetId) = match assetId { | |
19 | 29 | case b: ByteVector => | |
52 | 62 | } | |
53 | 63 | ||
54 | 64 | ||
65 | + | func tryGetResult (key) = match getString(addressFromStringValue(resultContract), key) { | |
66 | + | case s: String => | |
67 | + | s | |
68 | + | case _ => | |
69 | + | "" | |
70 | + | } | |
71 | + | ||
72 | + | ||
55 | 73 | func allow (callerPBK) = (toBase58String(callerPBK) == admin) | |
56 | 74 | ||
57 | 75 | ||
62 | 80 | ||
63 | 81 | ||
64 | 82 | func getDeadLine () = tryGetInteger(deadlineKey) | |
83 | + | ||
84 | + | ||
85 | + | func checkHandler (accum,keyStr) = { | |
86 | + | let baseKey = split(keyStr, "_")[0] | |
87 | + | (accum + (if ((tryGetResult(baseKey) == tryGetString(keyStr))) | |
88 | + | then 1 | |
89 | + | else 0)) | |
90 | + | } | |
91 | + | ||
92 | + | ||
93 | + | func combo (address,key) = ((address + "_") + key) | |
94 | + | ||
95 | + | ||
96 | + | func groupsAddressKeys (address) = [combo(address, keysGroup[0]), combo(address, keysGroup[1]), combo(address, keysGroup[2]), combo(address, keysGroup[3]), combo(address, keysGroup[4]), combo(address, keysGroup[5]), combo(address, keysGroup[6]), combo(address, keysGroup[7]), combo(address, keysGroup[8]), combo(address, keysGroup[9]), combo(address, keysGroup[10]), combo(address, keysGroup[11]), combo(address, keysGroup[12]), combo(address, keysGroup[13]), combo(address, keysGroup[14]), combo(address, keysGroup[15])] | |
97 | + | ||
98 | + | ||
99 | + | func evalGroups (address) = { | |
100 | + | let groupAddrKeys = groupsAddressKeys(address) | |
101 | + | let $l = groupAddrKeys | |
102 | + | let $s = size($l) | |
103 | + | let $acc0 = 0 | |
104 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
105 | + | then $a | |
106 | + | else checkHandler($a, $l[$i]) | |
107 | + | ||
108 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
109 | + | then $a | |
110 | + | else throw("List size exceeds 16") | |
111 | + | ||
112 | + | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
113 | + | } | |
65 | 114 | ||
66 | 115 | ||
67 | 116 | @Callable(i) | |
122 | 171 | ||
123 | 172 | ||
124 | 173 | @Callable(i) | |
125 | - | func | |
174 | + | func deleteAddress (address) = { | |
126 | 175 | let callerAddr = address | |
127 | 176 | if (allow(i.callerPublicKey)) | |
128 | 177 | then [DeleteEntry((callerAddr + "_betted")), DeleteEntry((callerAddr + "_height")), DeleteEntry((callerAddr + "_betAmount")), DeleteEntry((callerAddr + "_GroupA-1st")), DeleteEntry((callerAddr + "_GroupA-2nd")), DeleteEntry((callerAddr + "_GroupB-1st")), DeleteEntry((callerAddr + "_GroupB-2nd")), DeleteEntry((callerAddr + "_GroupC-1st")), DeleteEntry((callerAddr + "_GroupC-2nd")), DeleteEntry((callerAddr + "_GroupD-1st")), DeleteEntry((callerAddr + "_GroupD-2nd")), DeleteEntry((callerAddr + "_GroupE-1st")), DeleteEntry((callerAddr + "_GroupE-2nd")), DeleteEntry((callerAddr + "_GroupF-1st")), DeleteEntry((callerAddr + "_GroupF-2nd")), DeleteEntry((callerAddr + "_GroupG-1st")), DeleteEntry((callerAddr + "_GroupG-2nd")), DeleteEntry((callerAddr + "_GroupH-1st")), DeleteEntry((callerAddr + "_GroupH-2nd")), DeleteEntry((callerAddr + "_Octo1-winner")), DeleteEntry((callerAddr + "_Octo2-winner")), DeleteEntry((callerAddr + "_Octo3-winner")), DeleteEntry((callerAddr + "_Octo4-winner")), DeleteEntry((callerAddr + "_Octo5-winner")), DeleteEntry((callerAddr + "_Octo6-winner")), DeleteEntry((callerAddr + "_Octo7-winner")), DeleteEntry((callerAddr + "_Octo8-winner")), DeleteEntry((callerAddr + "_Quarter1-winner")), DeleteEntry((callerAddr + "_Quarter2-winner")), DeleteEntry((callerAddr + "_Quarter3-winner")), DeleteEntry((callerAddr + "_Quarter4-winner")), DeleteEntry((callerAddr + "_Semi1-winner")), DeleteEntry((callerAddr + "_Semi2-winner")), DeleteEntry((callerAddr + "_Final-winner"))] | |
129 | 178 | else throw("Only admin") | |
179 | + | } | |
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | @Callable(i) | |
184 | + | func evalScore (address) = { | |
185 | + | let groupScore = evalGroups(address) | |
186 | + | throw(("Score " + toString(groupScore))) | |
130 | 187 | } | |
131 | 188 | ||
132 | 189 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let admin = "7Tt74r8R7auTBTd6rJMA4qYr9WDWjc2SUHHSrRMw9Brs" | |
5 | 5 | ||
6 | 6 | let resultContract = "3NCnEUNnJXz57QWAMYnZBu3SqW4txog1XeD" | |
7 | 7 | ||
8 | 8 | let betAmountKey = "global_betAmount" | |
9 | 9 | ||
10 | 10 | let deadlineKey = "global_deadline_h" | |
11 | 11 | ||
12 | 12 | let scale = 100000000 | |
13 | 13 | ||
14 | 14 | let fee = 250 | |
15 | 15 | ||
16 | 16 | let feescale = 10000 | |
17 | + | ||
18 | + | let keysGroup = ["GroupA-1st", "GroupA-2nd", "GroupB-1st", "GroupB-2nd", "GroupC-1st", "GroupC-2nd", "GroupD-1st", "GroupD-2nd", "GroupE-1st", "GroupE-2nd", "GroupF-1st", "GroupF-2nd", "GroupG-1st", "GroupG-2nd", "GroupH-1st", "GroupH-2nd"] | |
19 | + | ||
20 | + | let keysOcto = ["Octo1-winner", "Octo2-winner", "Octo3-winner", "Octo4-winner", "Octo5-winner", "Octo6-winner", "Octo7-winner", "Octo8-winner"] | |
21 | + | ||
22 | + | let keysQuarter = ["Quarter1-winner", "Quarter2-winner", "Quarter3-winner", "Quarter4-winner"] | |
23 | + | ||
24 | + | let keysSemi = ["Semi1-winner", "Semi2-winner"] | |
25 | + | ||
26 | + | let keysFinal = "Final-winner" | |
17 | 27 | ||
18 | 28 | func getAssetString (assetId) = match assetId { | |
19 | 29 | case b: ByteVector => | |
20 | 30 | toBase58String(b) | |
21 | 31 | case _ => | |
22 | 32 | "WAVES" | |
23 | 33 | } | |
24 | 34 | ||
25 | 35 | ||
26 | 36 | func getAssetBytes (assetId) = if ((assetId == "WAVES")) | |
27 | 37 | then unit | |
28 | 38 | else fromBase58String(assetId) | |
29 | 39 | ||
30 | 40 | ||
31 | 41 | func tryGetInteger (key) = match getInteger(this, key) { | |
32 | 42 | case i: Int => | |
33 | 43 | i | |
34 | 44 | case _ => | |
35 | 45 | 0 | |
36 | 46 | } | |
37 | 47 | ||
38 | 48 | ||
39 | 49 | func tryGetBoolean (key) = match getBoolean(this, key) { | |
40 | 50 | case b: Boolean => | |
41 | 51 | b | |
42 | 52 | case _ => | |
43 | 53 | false | |
44 | 54 | } | |
45 | 55 | ||
46 | 56 | ||
47 | 57 | func tryGetString (key) = match getString(this, key) { | |
48 | 58 | case s: String => | |
49 | 59 | s | |
50 | 60 | case _ => | |
51 | 61 | "" | |
52 | 62 | } | |
53 | 63 | ||
54 | 64 | ||
65 | + | func tryGetResult (key) = match getString(addressFromStringValue(resultContract), key) { | |
66 | + | case s: String => | |
67 | + | s | |
68 | + | case _ => | |
69 | + | "" | |
70 | + | } | |
71 | + | ||
72 | + | ||
55 | 73 | func allow (callerPBK) = (toBase58String(callerPBK) == admin) | |
56 | 74 | ||
57 | 75 | ||
58 | 76 | func isBet (address) = tryGetBoolean((address + "_betted")) | |
59 | 77 | ||
60 | 78 | ||
61 | 79 | func getBetAmount () = tryGetInteger(betAmountKey) | |
62 | 80 | ||
63 | 81 | ||
64 | 82 | func getDeadLine () = tryGetInteger(deadlineKey) | |
83 | + | ||
84 | + | ||
85 | + | func checkHandler (accum,keyStr) = { | |
86 | + | let baseKey = split(keyStr, "_")[0] | |
87 | + | (accum + (if ((tryGetResult(baseKey) == tryGetString(keyStr))) | |
88 | + | then 1 | |
89 | + | else 0)) | |
90 | + | } | |
91 | + | ||
92 | + | ||
93 | + | func combo (address,key) = ((address + "_") + key) | |
94 | + | ||
95 | + | ||
96 | + | func groupsAddressKeys (address) = [combo(address, keysGroup[0]), combo(address, keysGroup[1]), combo(address, keysGroup[2]), combo(address, keysGroup[3]), combo(address, keysGroup[4]), combo(address, keysGroup[5]), combo(address, keysGroup[6]), combo(address, keysGroup[7]), combo(address, keysGroup[8]), combo(address, keysGroup[9]), combo(address, keysGroup[10]), combo(address, keysGroup[11]), combo(address, keysGroup[12]), combo(address, keysGroup[13]), combo(address, keysGroup[14]), combo(address, keysGroup[15])] | |
97 | + | ||
98 | + | ||
99 | + | func evalGroups (address) = { | |
100 | + | let groupAddrKeys = groupsAddressKeys(address) | |
101 | + | let $l = groupAddrKeys | |
102 | + | let $s = size($l) | |
103 | + | let $acc0 = 0 | |
104 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
105 | + | then $a | |
106 | + | else checkHandler($a, $l[$i]) | |
107 | + | ||
108 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
109 | + | then $a | |
110 | + | else throw("List size exceeds 16") | |
111 | + | ||
112 | + | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
113 | + | } | |
65 | 114 | ||
66 | 115 | ||
67 | 116 | @Callable(i) | |
68 | 117 | func setBetAmount (amount) = if (allow(i.callerPublicKey)) | |
69 | 118 | then [IntegerEntry(betAmountKey, amount)] | |
70 | 119 | else throw("Only admin") | |
71 | 120 | ||
72 | 121 | ||
73 | 122 | ||
74 | 123 | @Callable(i) | |
75 | 124 | func setDeadLine (deadlineHeight) = if (allow(i.callerPublicKey)) | |
76 | 125 | then [IntegerEntry(deadlineKey, deadlineHeight)] | |
77 | 126 | else throw("Only admin") | |
78 | 127 | ||
79 | 128 | ||
80 | 129 | ||
81 | 130 | @Callable(i) | |
82 | 131 | func makeBet (group_winners,group_second,octo_winners,quarter_winners,semi_winners,winner) = { | |
83 | 132 | let pmt = i.payments[0] | |
84 | 133 | let pmt_asset = pmt.assetId | |
85 | 134 | let pmt_amount = value(pmt.amount) | |
86 | 135 | let callerAddr = toString(i.caller) | |
87 | 136 | let betted = isBet(callerAddr) | |
88 | 137 | let deadline = getDeadLine() | |
89 | 138 | if ((deadline > height)) | |
90 | 139 | then if (!(betted)) | |
91 | 140 | then if ((getAssetString(pmt_asset) == "WAVES")) | |
92 | 141 | then { | |
93 | 142 | let betAmount = getBetAmount() | |
94 | 143 | if ((betAmount != 0)) | |
95 | 144 | then if ((pmt_amount == betAmount)) | |
96 | 145 | then { | |
97 | 146 | let groupWinners = split(group_winners, "_") | |
98 | 147 | let groupSecond = split(group_second, "_") | |
99 | 148 | let octoWinners = split(octo_winners, "_") | |
100 | 149 | let quarterWinners = split(quarter_winners, "_") | |
101 | 150 | let semiWinners = split(semi_winners, "_") | |
102 | 151 | if (if (if (if (if ((size(groupWinners) == 8)) | |
103 | 152 | then (size(groupSecond) == 8) | |
104 | 153 | else false) | |
105 | 154 | then (size(octoWinners) == 8) | |
106 | 155 | else false) | |
107 | 156 | then (size(quarterWinners) == 4) | |
108 | 157 | else false) | |
109 | 158 | then (size(semiWinners) == 2) | |
110 | 159 | else false) | |
111 | 160 | then [BooleanEntry((callerAddr + "_betted"), true), IntegerEntry((callerAddr + "_height"), height), IntegerEntry((callerAddr + "_betAmount"), pmt_amount), StringEntry((callerAddr + "_GroupA-1st"), groupWinners[0]), StringEntry((callerAddr + "_GroupA-2nd"), groupSecond[0]), StringEntry((callerAddr + "_GroupB-1st"), groupWinners[1]), StringEntry((callerAddr + "_GroupB-2nd"), groupSecond[1]), StringEntry((callerAddr + "_GroupC-1st"), groupWinners[2]), StringEntry((callerAddr + "_GroupC-2nd"), groupSecond[2]), StringEntry((callerAddr + "_GroupD-1st"), groupWinners[3]), StringEntry((callerAddr + "_GroupD-2nd"), groupSecond[3]), StringEntry((callerAddr + "_GroupE-1st"), groupWinners[4]), StringEntry((callerAddr + "_GroupE-2nd"), groupSecond[4]), StringEntry((callerAddr + "_GroupF-1st"), groupWinners[5]), StringEntry((callerAddr + "_GroupF-2nd"), groupSecond[5]), StringEntry((callerAddr + "_GroupG-1st"), groupWinners[6]), StringEntry((callerAddr + "_GroupG-2nd"), groupSecond[6]), StringEntry((callerAddr + "_GroupH-1st"), groupWinners[7]), StringEntry((callerAddr + "_GroupH-2nd"), groupSecond[7]), StringEntry((callerAddr + "_Octo1-winner"), octoWinners[0]), StringEntry((callerAddr + "_Octo2-winner"), octoWinners[1]), StringEntry((callerAddr + "_Octo3-winner"), octoWinners[2]), StringEntry((callerAddr + "_Octo4-winner"), octoWinners[3]), StringEntry((callerAddr + "_Octo5-winner"), octoWinners[4]), StringEntry((callerAddr + "_Octo6-winner"), octoWinners[5]), StringEntry((callerAddr + "_Octo7-winner"), octoWinners[6]), StringEntry((callerAddr + "_Octo8-winner"), octoWinners[7]), StringEntry((callerAddr + "_Quarter1-winner"), quarterWinners[0]), StringEntry((callerAddr + "_Quarter2-winner"), quarterWinners[1]), StringEntry((callerAddr + "_Quarter3-winner"), quarterWinners[2]), StringEntry((callerAddr + "_Quarter4-winner"), quarterWinners[3]), StringEntry((callerAddr + "_Semi1-winner"), semiWinners[0]), StringEntry((callerAddr + "_Semi2-winner"), semiWinners[1]), StringEntry((callerAddr + "_Final-winner"), winner)] | |
112 | 161 | else throw("Incorrect data arrived in arguments") | |
113 | 162 | } | |
114 | 163 | else throw((("Attach exactly " + toString(betAmount)) + " /100000000 Waves as payment")) | |
115 | 164 | else throw("Zero betAmount from contract storage") | |
116 | 165 | } | |
117 | 166 | else throw("Only Waves is allowed as payment asset to bet") | |
118 | 167 | else throw("Bet already made") | |
119 | 168 | else throw("Betting closed") | |
120 | 169 | } | |
121 | 170 | ||
122 | 171 | ||
123 | 172 | ||
124 | 173 | @Callable(i) | |
125 | - | func | |
174 | + | func deleteAddress (address) = { | |
126 | 175 | let callerAddr = address | |
127 | 176 | if (allow(i.callerPublicKey)) | |
128 | 177 | then [DeleteEntry((callerAddr + "_betted")), DeleteEntry((callerAddr + "_height")), DeleteEntry((callerAddr + "_betAmount")), DeleteEntry((callerAddr + "_GroupA-1st")), DeleteEntry((callerAddr + "_GroupA-2nd")), DeleteEntry((callerAddr + "_GroupB-1st")), DeleteEntry((callerAddr + "_GroupB-2nd")), DeleteEntry((callerAddr + "_GroupC-1st")), DeleteEntry((callerAddr + "_GroupC-2nd")), DeleteEntry((callerAddr + "_GroupD-1st")), DeleteEntry((callerAddr + "_GroupD-2nd")), DeleteEntry((callerAddr + "_GroupE-1st")), DeleteEntry((callerAddr + "_GroupE-2nd")), DeleteEntry((callerAddr + "_GroupF-1st")), DeleteEntry((callerAddr + "_GroupF-2nd")), DeleteEntry((callerAddr + "_GroupG-1st")), DeleteEntry((callerAddr + "_GroupG-2nd")), DeleteEntry((callerAddr + "_GroupH-1st")), DeleteEntry((callerAddr + "_GroupH-2nd")), DeleteEntry((callerAddr + "_Octo1-winner")), DeleteEntry((callerAddr + "_Octo2-winner")), DeleteEntry((callerAddr + "_Octo3-winner")), DeleteEntry((callerAddr + "_Octo4-winner")), DeleteEntry((callerAddr + "_Octo5-winner")), DeleteEntry((callerAddr + "_Octo6-winner")), DeleteEntry((callerAddr + "_Octo7-winner")), DeleteEntry((callerAddr + "_Octo8-winner")), DeleteEntry((callerAddr + "_Quarter1-winner")), DeleteEntry((callerAddr + "_Quarter2-winner")), DeleteEntry((callerAddr + "_Quarter3-winner")), DeleteEntry((callerAddr + "_Quarter4-winner")), DeleteEntry((callerAddr + "_Semi1-winner")), DeleteEntry((callerAddr + "_Semi2-winner")), DeleteEntry((callerAddr + "_Final-winner"))] | |
129 | 178 | else throw("Only admin") | |
179 | + | } | |
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | @Callable(i) | |
184 | + | func evalScore (address) = { | |
185 | + | let groupScore = evalGroups(address) | |
186 | + | throw(("Score " + toString(groupScore))) | |
130 | 187 | } | |
131 | 188 | ||
132 | 189 | ||
133 | 190 | @Verifier(tx) | |
134 | 191 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
135 | 192 |
github/deemru/w8io/169f3d6 42.24 ms ◑