tx · AAqFiYdifbxU1vETJnpSJrELBos7g6YWGi9rgpRPuakx 3Mp5JgVSHA9iziujC9Kmnf2rCN5SYFE97yC: -0.01400000 Waves 2021.11.18 10:53 [1796207] smart account 3Mp5JgVSHA9iziujC9Kmnf2rCN5SYFE97yC > SELF 0.00000000 Waves
{ "type": 13, "id": "AAqFiYdifbxU1vETJnpSJrELBos7g6YWGi9rgpRPuakx", "fee": 1400000, "feeAssetId": null, "timestamp": 1637221994427, "version": 2, "chainId": 84, "sender": "3Mp5JgVSHA9iziujC9Kmnf2rCN5SYFE97yC", "senderPublicKey": "CSx1y2ADZAi6KvFZT2LoqQmX5qBxDVVGGZ6heDAGngHM", "proofs": [ "5kxc5nC3ssx6FHGDdnVZDeBmropnJnqoSRiat1bYZsoAnnDAodP1vRhw1R1ZJdAL6KxnyVxhr1sNsqbQa9GyE4pA", "2bj5PCSQmmZmzSVCQ5YTqU29cEMie4vXieUBWjMKYtww7UF6PDgf9e3YRkFAzPfA2QEy2qJbhi488x193S1bPqBy" ], "script": "base64:AAIFAAAAAAAAABwIAhIHCgUBERgRGBIAEgMKAQgSBAoCAQgSABIAAAAAHgAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAADGtleUVuZEhlaWdodAIAAAAKZW5kX2hlaWdodAAAAAAPa2V5UHJpemVzUHJpY2VzAgAAAA1wcml6ZXNfcHJpY2VzAAAAAA1rZXlQcml6ZXNBSWRzAgAAABdwcml6ZXNfYWNoaWV2ZW1lbnRzX2lkcwAAAAAQa2V5UHJpemVzQW1vdW50cwIAAAANcHJpemVzX2Ftb3VudAAAAAAOa2V5TGV2ZWxQcmljZXMCAAAADGxldmVsX3ByaWNlcwAAAAAWa2V5TGV2ZWxBY2hpZXZlbW50c0lkcwIAAAAWbGV2ZWxfYWNoaWV2ZW1lbnRzX2lkcwAAAAAJa2V5U1dPUGlkAgAAAAdTV09QX2lkAAAAAA5rZXlUb3RhbEJ1cm5lZAIAAAAMdG90YWxfYnVybmVkAA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AAAAAAAAAAFAAAAEmFkbWluUHViS2V5U3Rha2luZwQAAAAHJG1hdGNoMAUAAAACdHgFAAAAE211bHRpU2lnbmVkQnlBZG1pbnM4t7lL", "height": 1796207, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6qppARN7VdAA7SPQUtayCpV3EARPY6oh3nN6zn7YY5sG Next: 3UxUiqUiW6jsexr6TYJ5nbudtUn4ehXNXhDzCFe4BvdH Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let keyPrizesPrices = "prizes_prices" | |
9 | 9 | ||
10 | - | let | |
10 | + | let keyPrizesAIds = "prizes_achievements_ids" | |
11 | 11 | ||
12 | 12 | let keyPrizesAmounts = "prizes_amount" | |
13 | 13 | ||
14 | 14 | let keyLevelPrices = "level_prices" | |
15 | 15 | ||
16 | - | let | |
16 | + | let keyLevelAchievemntsIds = "level_achievements_ids" | |
17 | 17 | ||
18 | 18 | let keySWOPid = "SWOP_id" | |
19 | 19 | ||
98 | 98 | ||
99 | 99 | ||
100 | 100 | @Callable(i) | |
101 | - | func init (endHeight,prizePrices,prizeIds,levelPrices,levelIds) = if (isDefined(getInteger(this, keyEndHeight))) | |
102 | - | then throw("DApp is already inited") | |
103 | - | else { | |
104 | - | let prizePricesStr = { | |
105 | - | let $l = prizePrices | |
106 | - | let $s = size($l) | |
107 | - | let $acc0 = "" | |
108 | - | func 1 ($a,$i) = if (($i >= $s)) | |
109 | - | then $a | |
110 | - | else inListToStr($a, $l[$i]) | |
101 | + | func init (endHeight,prizePrices,prizeAchievmentsIds,levelPrices,levelAchievmentsIds) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
102 | + | then throw("Only admin can call this function") | |
103 | + | else if (isDefined(getInteger(this, keyEndHeight))) | |
104 | + | then throw("DApp is already inited") | |
105 | + | else if ((height > endHeight)) | |
106 | + | then throw("Burning ending must be greater than current height") | |
107 | + | else if (if ((size(prizePrices) != 5)) | |
108 | + | then true | |
109 | + | else (size(prizeAchievmentsIds) != 5)) | |
110 | + | then throw("Amount of prizes achievemts lists must equal to 5") | |
111 | + | else if (if ((size(levelPrices) != 4)) | |
112 | + | then true | |
113 | + | else (size(levelAchievmentsIds) != 4)) | |
114 | + | then throw("Amount of levels lists must equal to 4") | |
115 | + | else { | |
116 | + | let prizePricesStr = { | |
117 | + | let $l = prizePrices | |
118 | + | let $s = size($l) | |
119 | + | let $acc0 = "" | |
120 | + | func 1 ($a,$i) = if (($i >= $s)) | |
121 | + | then $a | |
122 | + | else inListToStr($a, $l[$i]) | |
111 | 123 | ||
112 | - | func 2 ($a,$i) = if (($i >= $s)) | |
113 | - | then $a | |
114 | - | else throw("List size exceeds 5") | |
124 | + | func 2 ($a,$i) = if (($i >= $s)) | |
125 | + | then $a | |
126 | + | else throw("List size exceeds 5") | |
115 | 127 | ||
116 | - | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
117 | - | } | |
118 | - | let | |
119 | - | let levelPricesStr = { | |
120 | - | let $l = levelPrices | |
121 | - | let $s = size($l) | |
122 | - | let $acc0 = "" | |
123 | - | func 1 ($a,$i) = if (($i >= $s)) | |
124 | - | then $a | |
125 | - | else inListToStr($a, $l[$i]) | |
128 | + | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
129 | + | } | |
130 | + | let prizeAchievmentsIdsStr = makeString(prizeAchievmentsIds, ",") | |
131 | + | let levelPricesStr = { | |
132 | + | let $l = levelPrices | |
133 | + | let $s = size($l) | |
134 | + | let $acc0 = "" | |
135 | + | func 1 ($a,$i) = if (($i >= $s)) | |
136 | + | then $a | |
137 | + | else inListToStr($a, $l[$i]) | |
126 | 138 | ||
127 | - | func 2 ($a,$i) = if (($i >= $s)) | |
128 | - | then $a | |
129 | - | else throw("List size exceeds 5") | |
139 | + | func 2 ($a,$i) = if (($i >= $s)) | |
140 | + | then $a | |
141 | + | else throw("List size exceeds 5") | |
130 | 142 | ||
131 | - | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
132 | - | } | |
133 | - | let | |
134 | - | let prizesAmountStr = "0,0,0,0,0" | |
135 | - | [IntegerEntry(keyEndHeight, endHeight), StringEntry(keyPrizesPrices, prizePricesStr), StringEntry( | |
136 | - | } | |
143 | + | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
144 | + | } | |
145 | + | let levelAchievmentsIdsStr = makeString(levelAchievmentsIds, ",") | |
146 | + | let prizesAmountStr = "0,0,0,0,0" | |
147 | + | [IntegerEntry(keyEndHeight, endHeight), StringEntry(keyPrizesPrices, prizePricesStr), StringEntry(keyPrizesAIds, prizeAchievmentsIdsStr), StringEntry(keyLevelPrices, levelPricesStr), StringEntry(keyLevelAchievemntsIds, levelAchievmentsIdsStr), StringEntry(keyPrizesAmounts, prizesAmountStr)] | |
148 | + | } | |
137 | 149 | ||
138 | 150 | ||
139 | 151 | ||
140 | 152 | @Callable(i) | |
141 | 153 | func add () = { | |
142 | - | let $ | |
143 | - | let pmtAmount = $ | |
144 | - | let pmtAssetId = $ | |
154 | + | let $t035453620 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
155 | + | let pmtAmount = $t035453620._1 | |
156 | + | let pmtAssetId = $t035453620._2 | |
145 | 157 | let endHeight = valueOrElse(getInteger(this, keyEndHeight), 0) | |
146 | 158 | if (!(isActive)) | |
147 | 159 | then throw("DApp is inactive at this moment") | |
181 | 193 | ||
182 | 194 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
183 | 195 | } | |
184 | - | let | |
185 | - | let | |
196 | + | let prizesAchievementsIds = split(getStringValue(this, keyPrizesAIds), ",") | |
197 | + | let levelAchievementsIds = split(getStringValue(this, keyLevelAchievemntsIds), ",") | |
186 | 198 | let newPrizesAmounts = { | |
187 | 199 | let $l = prizesPrices | |
188 | 200 | let $s = size($l) | |
214 | 226 | let inv0 = if ((newPrizesAmounts[0] != prizesAmounts[0])) | |
215 | 227 | then { | |
216 | 228 | let achievementAmount = (newPrizesAmounts[0] - prizesAmounts[0]) | |
217 | - | invoke(achievements, "add", [ | |
229 | + | invoke(achievements, "add", [prizesAchievementsIds[0], achievementAmount], nil) | |
218 | 230 | } | |
219 | 231 | else 0 | |
220 | 232 | if ((inv0 == inv0)) | |
222 | 234 | let inv1 = if ((newPrizesAmounts[1] != prizesAmounts[1])) | |
223 | 235 | then { | |
224 | 236 | let achievementAmount = (newPrizesAmounts[1] - prizesAmounts[1]) | |
225 | - | invoke(achievements, "add", [ | |
237 | + | invoke(achievements, "add", [prizesAchievementsIds[1], achievementAmount], nil) | |
226 | 238 | } | |
227 | 239 | else 0 | |
228 | 240 | if ((inv1 == inv1)) | |
230 | 242 | let inv2 = if ((newPrizesAmounts[2] != prizesAmounts[2])) | |
231 | 243 | then { | |
232 | 244 | let achievementAmount = (newPrizesAmounts[2] - prizesAmounts[2]) | |
233 | - | invoke(achievements, "add", [ | |
245 | + | invoke(achievements, "add", [prizesAchievementsIds[2], achievementAmount], nil) | |
234 | 246 | } | |
235 | 247 | else 0 | |
236 | 248 | if ((inv2 == inv2)) | |
238 | 250 | let inv3 = if ((newPrizesAmounts[3] != prizesAmounts[3])) | |
239 | 251 | then { | |
240 | 252 | let achievementAmount = (newPrizesAmounts[3] - prizesAmounts[3]) | |
241 | - | invoke(achievements, "add", [ | |
253 | + | invoke(achievements, "add", [prizesAchievementsIds[3], achievementAmount], nil) | |
242 | 254 | } | |
243 | 255 | else 0 | |
244 | 256 | if ((inv3 == inv3)) | |
246 | 258 | let inv4 = if ((newPrizesAmounts[4] != prizesAmounts[4])) | |
247 | 259 | then { | |
248 | 260 | let achievementAmount = (newPrizesAmounts[4] - prizesAmounts[4]) | |
249 | - | invoke(achievements, "add", [ | |
261 | + | invoke(achievements, "add", [prizesAchievementsIds[4], achievementAmount], nil) | |
250 | 262 | } | |
251 | 263 | else 0 | |
252 | 264 | if ((inv4 == inv4)) | |
254 | 266 | let oldLevel = calcLevel(userTotalBurned) | |
255 | 267 | let newLevel = calcLevel((userTotalBurned + pmtAmount)) | |
256 | 268 | let inv5 = if ((oldLevel != newLevel)) | |
257 | - | then invoke(achievements, "add", [ | |
269 | + | then invoke(achievements, "add", [levelAchievementsIds[(newLevel - 1)], 1], nil) | |
258 | 270 | else 0 | |
259 | 271 | [IntegerEntry(keyTotalBurned, (totalBurned + pmtAmount)), IntegerEntry((toString(this) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)] | |
260 | 272 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let keyActive = "active" | |
5 | 5 | ||
6 | 6 | let keyEndHeight = "end_height" | |
7 | 7 | ||
8 | 8 | let keyPrizesPrices = "prizes_prices" | |
9 | 9 | ||
10 | - | let | |
10 | + | let keyPrizesAIds = "prizes_achievements_ids" | |
11 | 11 | ||
12 | 12 | let keyPrizesAmounts = "prizes_amount" | |
13 | 13 | ||
14 | 14 | let keyLevelPrices = "level_prices" | |
15 | 15 | ||
16 | - | let | |
16 | + | let keyLevelAchievemntsIds = "level_achievements_ids" | |
17 | 17 | ||
18 | 18 | let keySWOPid = "SWOP_id" | |
19 | 19 | ||
20 | 20 | let keyTotalBurned = "total_burned" | |
21 | 21 | ||
22 | 22 | let keyVerifyHash = "verify_hash" | |
23 | 23 | ||
24 | 24 | let keyFinalizeHeight = "finalize_height" | |
25 | 25 | ||
26 | 26 | let keyUserTotalBurned = "_total_burned" | |
27 | 27 | ||
28 | 28 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
29 | 29 | ||
30 | 30 | let farming = Address(base58'3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT') | |
31 | 31 | ||
32 | 32 | let achievements = Address(base58'3N3HtdnBkqSSc16DaydiwtrMBUv3DfqKjSW') | |
33 | 33 | ||
34 | 34 | let keyAdminPubKey1 = "admin_pub_1" | |
35 | 35 | ||
36 | 36 | let keyAdminPubKey2 = "admin_pub_2" | |
37 | 37 | ||
38 | 38 | let keyAdminPubKey3 = "admin_pub_3" | |
39 | 39 | ||
40 | 40 | func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) { | |
41 | 41 | case string: String => | |
42 | 42 | fromBase58String(string) | |
43 | 43 | case nothing => | |
44 | 44 | throw("Admin public key is empty") | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | let adminPubKey1 = getAdminPub(keyAdminPubKey1) | |
49 | 49 | ||
50 | 50 | let adminPubKey2 = getAdminPub(keyAdminPubKey2) | |
51 | 51 | ||
52 | 52 | let adminPubKey3 = getAdminPub(keyAdminPubKey3) | |
53 | 53 | ||
54 | 54 | let adminPubKeyStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
55 | 55 | ||
56 | 56 | let swopId = fromBase58String(getStringValue(farming, keySWOPid)) | |
57 | 57 | ||
58 | 58 | let isActive = valueOrElse(getBoolean(this, keyActive), true) | |
59 | 59 | ||
60 | 60 | let totalBurned = valueOrElse(getInteger(this, keyTotalBurned), 0) | |
61 | 61 | ||
62 | 62 | func inListToStr (acc,next) = if ((acc == "")) | |
63 | 63 | then (acc + toString(next)) | |
64 | 64 | else ((acc + ",") + toString(next)) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func inListToInt (acc,next) = (acc :+ parseIntValue(next)) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func calcPrizesAmounts (acc,next) = (acc :+ (totalBurned / next)) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func calcLevel (burned) = { | |
74 | 74 | let levelPrices = { | |
75 | 75 | let $l = split(getStringValue(this, keyLevelPrices), ",") | |
76 | 76 | let $s = size($l) | |
77 | 77 | let $acc0 = nil | |
78 | 78 | func 1 ($a,$i) = if (($i >= $s)) | |
79 | 79 | then $a | |
80 | 80 | else inListToInt($a, $l[$i]) | |
81 | 81 | ||
82 | 82 | func 2 ($a,$i) = if (($i >= $s)) | |
83 | 83 | then $a | |
84 | 84 | else throw("List size exceeds 5") | |
85 | 85 | ||
86 | 86 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
87 | 87 | } | |
88 | 88 | if ((levelPrices[3] >= burned)) | |
89 | 89 | then 4 | |
90 | 90 | else if ((levelPrices[2] >= burned)) | |
91 | 91 | then 3 | |
92 | 92 | else if ((levelPrices[1] >= burned)) | |
93 | 93 | then 2 | |
94 | 94 | else if ((levelPrices[0] >= burned)) | |
95 | 95 | then 1 | |
96 | 96 | else 0 | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | @Callable(i) | |
101 | - | func init (endHeight,prizePrices,prizeIds,levelPrices,levelIds) = if (isDefined(getInteger(this, keyEndHeight))) | |
102 | - | then throw("DApp is already inited") | |
103 | - | else { | |
104 | - | let prizePricesStr = { | |
105 | - | let $l = prizePrices | |
106 | - | let $s = size($l) | |
107 | - | let $acc0 = "" | |
108 | - | func 1 ($a,$i) = if (($i >= $s)) | |
109 | - | then $a | |
110 | - | else inListToStr($a, $l[$i]) | |
101 | + | func init (endHeight,prizePrices,prizeAchievmentsIds,levelPrices,levelAchievmentsIds) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
102 | + | then throw("Only admin can call this function") | |
103 | + | else if (isDefined(getInteger(this, keyEndHeight))) | |
104 | + | then throw("DApp is already inited") | |
105 | + | else if ((height > endHeight)) | |
106 | + | then throw("Burning ending must be greater than current height") | |
107 | + | else if (if ((size(prizePrices) != 5)) | |
108 | + | then true | |
109 | + | else (size(prizeAchievmentsIds) != 5)) | |
110 | + | then throw("Amount of prizes achievemts lists must equal to 5") | |
111 | + | else if (if ((size(levelPrices) != 4)) | |
112 | + | then true | |
113 | + | else (size(levelAchievmentsIds) != 4)) | |
114 | + | then throw("Amount of levels lists must equal to 4") | |
115 | + | else { | |
116 | + | let prizePricesStr = { | |
117 | + | let $l = prizePrices | |
118 | + | let $s = size($l) | |
119 | + | let $acc0 = "" | |
120 | + | func 1 ($a,$i) = if (($i >= $s)) | |
121 | + | then $a | |
122 | + | else inListToStr($a, $l[$i]) | |
111 | 123 | ||
112 | - | func 2 ($a,$i) = if (($i >= $s)) | |
113 | - | then $a | |
114 | - | else throw("List size exceeds 5") | |
124 | + | func 2 ($a,$i) = if (($i >= $s)) | |
125 | + | then $a | |
126 | + | else throw("List size exceeds 5") | |
115 | 127 | ||
116 | - | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
117 | - | } | |
118 | - | let | |
119 | - | let levelPricesStr = { | |
120 | - | let $l = levelPrices | |
121 | - | let $s = size($l) | |
122 | - | let $acc0 = "" | |
123 | - | func 1 ($a,$i) = if (($i >= $s)) | |
124 | - | then $a | |
125 | - | else inListToStr($a, $l[$i]) | |
128 | + | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
129 | + | } | |
130 | + | let prizeAchievmentsIdsStr = makeString(prizeAchievmentsIds, ",") | |
131 | + | let levelPricesStr = { | |
132 | + | let $l = levelPrices | |
133 | + | let $s = size($l) | |
134 | + | let $acc0 = "" | |
135 | + | func 1 ($a,$i) = if (($i >= $s)) | |
136 | + | then $a | |
137 | + | else inListToStr($a, $l[$i]) | |
126 | 138 | ||
127 | - | func 2 ($a,$i) = if (($i >= $s)) | |
128 | - | then $a | |
129 | - | else throw("List size exceeds 5") | |
139 | + | func 2 ($a,$i) = if (($i >= $s)) | |
140 | + | then $a | |
141 | + | else throw("List size exceeds 5") | |
130 | 142 | ||
131 | - | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
132 | - | } | |
133 | - | let | |
134 | - | let prizesAmountStr = "0,0,0,0,0" | |
135 | - | [IntegerEntry(keyEndHeight, endHeight), StringEntry(keyPrizesPrices, prizePricesStr), StringEntry( | |
136 | - | } | |
143 | + | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
144 | + | } | |
145 | + | let levelAchievmentsIdsStr = makeString(levelAchievmentsIds, ",") | |
146 | + | let prizesAmountStr = "0,0,0,0,0" | |
147 | + | [IntegerEntry(keyEndHeight, endHeight), StringEntry(keyPrizesPrices, prizePricesStr), StringEntry(keyPrizesAIds, prizeAchievmentsIdsStr), StringEntry(keyLevelPrices, levelPricesStr), StringEntry(keyLevelAchievemntsIds, levelAchievmentsIdsStr), StringEntry(keyPrizesAmounts, prizesAmountStr)] | |
148 | + | } | |
137 | 149 | ||
138 | 150 | ||
139 | 151 | ||
140 | 152 | @Callable(i) | |
141 | 153 | func add () = { | |
142 | - | let $ | |
143 | - | let pmtAmount = $ | |
144 | - | let pmtAssetId = $ | |
154 | + | let $t035453620 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
155 | + | let pmtAmount = $t035453620._1 | |
156 | + | let pmtAssetId = $t035453620._2 | |
145 | 157 | let endHeight = valueOrElse(getInteger(this, keyEndHeight), 0) | |
146 | 158 | if (!(isActive)) | |
147 | 159 | then throw("DApp is inactive at this moment") | |
148 | 160 | else if (if ((height > endHeight)) | |
149 | 161 | then true | |
150 | 162 | else (endHeight == 0)) | |
151 | 163 | then throw("Swop burning are ended or not started yet") | |
152 | 164 | else if ((pmtAssetId != swopId)) | |
153 | 165 | then throw("You can add only SWOP token") | |
154 | 166 | else { | |
155 | 167 | let userTotalBurned = valueOrElse(getInteger(this, (toString(this) + keyUserTotalBurned)), 0) | |
156 | 168 | let prizesAmounts = { | |
157 | 169 | let $l = split(getStringValue(this, keyPrizesAmounts), ",") | |
158 | 170 | let $s = size($l) | |
159 | 171 | let $acc0 = nil | |
160 | 172 | func 1 ($a,$i) = if (($i >= $s)) | |
161 | 173 | then $a | |
162 | 174 | else inListToInt($a, $l[$i]) | |
163 | 175 | ||
164 | 176 | func 2 ($a,$i) = if (($i >= $s)) | |
165 | 177 | then $a | |
166 | 178 | else throw("List size exceeds 5") | |
167 | 179 | ||
168 | 180 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
169 | 181 | } | |
170 | 182 | let prizesPrices = { | |
171 | 183 | let $l = split(getStringValue(this, keyPrizesPrices), ",") | |
172 | 184 | let $s = size($l) | |
173 | 185 | let $acc0 = nil | |
174 | 186 | func 1 ($a,$i) = if (($i >= $s)) | |
175 | 187 | then $a | |
176 | 188 | else inListToInt($a, $l[$i]) | |
177 | 189 | ||
178 | 190 | func 2 ($a,$i) = if (($i >= $s)) | |
179 | 191 | then $a | |
180 | 192 | else throw("List size exceeds 5") | |
181 | 193 | ||
182 | 194 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
183 | 195 | } | |
184 | - | let | |
185 | - | let | |
196 | + | let prizesAchievementsIds = split(getStringValue(this, keyPrizesAIds), ",") | |
197 | + | let levelAchievementsIds = split(getStringValue(this, keyLevelAchievemntsIds), ",") | |
186 | 198 | let newPrizesAmounts = { | |
187 | 199 | let $l = prizesPrices | |
188 | 200 | let $s = size($l) | |
189 | 201 | let $acc0 = nil | |
190 | 202 | func 1 ($a,$i) = if (($i >= $s)) | |
191 | 203 | then $a | |
192 | 204 | else calcPrizesAmounts($a, $l[$i]) | |
193 | 205 | ||
194 | 206 | func 2 ($a,$i) = if (($i >= $s)) | |
195 | 207 | then $a | |
196 | 208 | else throw("List size exceeds 5") | |
197 | 209 | ||
198 | 210 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
199 | 211 | } | |
200 | 212 | let newPrizesAmountsStr = { | |
201 | 213 | let $l = newPrizesAmounts | |
202 | 214 | let $s = size($l) | |
203 | 215 | let $acc0 = "" | |
204 | 216 | func 1 ($a,$i) = if (($i >= $s)) | |
205 | 217 | then $a | |
206 | 218 | else inListToStr($a, $l[$i]) | |
207 | 219 | ||
208 | 220 | func 2 ($a,$i) = if (($i >= $s)) | |
209 | 221 | then $a | |
210 | 222 | else throw("List size exceeds 5") | |
211 | 223 | ||
212 | 224 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
213 | 225 | } | |
214 | 226 | let inv0 = if ((newPrizesAmounts[0] != prizesAmounts[0])) | |
215 | 227 | then { | |
216 | 228 | let achievementAmount = (newPrizesAmounts[0] - prizesAmounts[0]) | |
217 | - | invoke(achievements, "add", [ | |
229 | + | invoke(achievements, "add", [prizesAchievementsIds[0], achievementAmount], nil) | |
218 | 230 | } | |
219 | 231 | else 0 | |
220 | 232 | if ((inv0 == inv0)) | |
221 | 233 | then { | |
222 | 234 | let inv1 = if ((newPrizesAmounts[1] != prizesAmounts[1])) | |
223 | 235 | then { | |
224 | 236 | let achievementAmount = (newPrizesAmounts[1] - prizesAmounts[1]) | |
225 | - | invoke(achievements, "add", [ | |
237 | + | invoke(achievements, "add", [prizesAchievementsIds[1], achievementAmount], nil) | |
226 | 238 | } | |
227 | 239 | else 0 | |
228 | 240 | if ((inv1 == inv1)) | |
229 | 241 | then { | |
230 | 242 | let inv2 = if ((newPrizesAmounts[2] != prizesAmounts[2])) | |
231 | 243 | then { | |
232 | 244 | let achievementAmount = (newPrizesAmounts[2] - prizesAmounts[2]) | |
233 | - | invoke(achievements, "add", [ | |
245 | + | invoke(achievements, "add", [prizesAchievementsIds[2], achievementAmount], nil) | |
234 | 246 | } | |
235 | 247 | else 0 | |
236 | 248 | if ((inv2 == inv2)) | |
237 | 249 | then { | |
238 | 250 | let inv3 = if ((newPrizesAmounts[3] != prizesAmounts[3])) | |
239 | 251 | then { | |
240 | 252 | let achievementAmount = (newPrizesAmounts[3] - prizesAmounts[3]) | |
241 | - | invoke(achievements, "add", [ | |
253 | + | invoke(achievements, "add", [prizesAchievementsIds[3], achievementAmount], nil) | |
242 | 254 | } | |
243 | 255 | else 0 | |
244 | 256 | if ((inv3 == inv3)) | |
245 | 257 | then { | |
246 | 258 | let inv4 = if ((newPrizesAmounts[4] != prizesAmounts[4])) | |
247 | 259 | then { | |
248 | 260 | let achievementAmount = (newPrizesAmounts[4] - prizesAmounts[4]) | |
249 | - | invoke(achievements, "add", [ | |
261 | + | invoke(achievements, "add", [prizesAchievementsIds[4], achievementAmount], nil) | |
250 | 262 | } | |
251 | 263 | else 0 | |
252 | 264 | if ((inv4 == inv4)) | |
253 | 265 | then { | |
254 | 266 | let oldLevel = calcLevel(userTotalBurned) | |
255 | 267 | let newLevel = calcLevel((userTotalBurned + pmtAmount)) | |
256 | 268 | let inv5 = if ((oldLevel != newLevel)) | |
257 | - | then invoke(achievements, "add", [ | |
269 | + | then invoke(achievements, "add", [levelAchievementsIds[(newLevel - 1)], 1], nil) | |
258 | 270 | else 0 | |
259 | 271 | [IntegerEntry(keyTotalBurned, (totalBurned + pmtAmount)), IntegerEntry((toString(this) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)] | |
260 | 272 | } | |
261 | 273 | else throw("Strict value is not equal to itself.") | |
262 | 274 | } | |
263 | 275 | else throw("Strict value is not equal to itself.") | |
264 | 276 | } | |
265 | 277 | else throw("Strict value is not equal to itself.") | |
266 | 278 | } | |
267 | 279 | else throw("Strict value is not equal to itself.") | |
268 | 280 | } | |
269 | 281 | else throw("Strict value is not equal to itself.") | |
270 | 282 | } | |
271 | 283 | } | |
272 | 284 | ||
273 | 285 | ||
274 | 286 | ||
275 | 287 | @Callable(i) | |
276 | 288 | func hashingRandom (hash) = if (!(isActive)) | |
277 | 289 | then throw("DApp is inactive at this moment") | |
278 | 290 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
279 | 291 | then throw("Only admin can call this function") | |
280 | 292 | else [StringEntry(keyVerifyHash, hash)] | |
281 | 293 | ||
282 | 294 | ||
283 | 295 | ||
284 | 296 | @Callable(i) | |
285 | 297 | func finalize (vrfHeight,secretWord) = { | |
286 | 298 | let savedHash = getStringValue(this, keyVerifyHash) | |
287 | 299 | let calcHash = toBase58String(sha256((toBytes(vrfHeight) + toBytes(secretWord)))) | |
288 | 300 | if (!(isActive)) | |
289 | 301 | then throw("DApp is inactive at this moment") | |
290 | 302 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
291 | 303 | then throw("Only admin can call this function") | |
292 | 304 | else if ((calcHash != savedHash)) | |
293 | 305 | then throw("vrf Height hash not matching") | |
294 | 306 | else { | |
295 | 307 | let burnAmount = getIntegerValue(this, keyTotalBurned) | |
296 | 308 | [Burn(swopId, burnAmount), IntegerEntry(keyFinalizeHeight, height)] | |
297 | 309 | } | |
298 | 310 | } | |
299 | 311 | ||
300 | 312 | ||
301 | 313 | ||
302 | 314 | @Callable(i) | |
303 | 315 | func shutdown () = if (!(isActive)) | |
304 | 316 | then throw("DApp already inactive") | |
305 | 317 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
306 | 318 | then throw("Only admin can call this function") | |
307 | 319 | else [BooleanEntry(keyActive, false)] | |
308 | 320 | ||
309 | 321 | ||
310 | 322 | ||
311 | 323 | @Callable(i) | |
312 | 324 | func activate () = if (isActive) | |
313 | 325 | then throw("DApp already active") | |
314 | 326 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
315 | 327 | then throw("Only admin can call this function") | |
316 | 328 | else [BooleanEntry(keyActive, true)] | |
317 | 329 | ||
318 | 330 | ||
319 | 331 | @Verifier(tx) | |
320 | 332 | func verify () = { | |
321 | 333 | let multiSignedByAdmins = { | |
322 | 334 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
323 | 335 | then 1 | |
324 | 336 | else 0 | |
325 | 337 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
326 | 338 | then 1 | |
327 | 339 | else 0 | |
328 | 340 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
329 | 341 | then 1 | |
330 | 342 | else 0 | |
331 | 343 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
332 | 344 | } | |
333 | 345 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
334 | 346 | then true | |
335 | 347 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
336 | 348 | then true | |
337 | 349 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
338 | 350 | then true | |
339 | 351 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking) | |
340 | 352 | match tx { | |
341 | 353 | case _ => | |
342 | 354 | multiSignedByAdmins | |
343 | 355 | } | |
344 | 356 | } | |
345 | 357 |
github/deemru/w8io/169f3d6 102.03 ms ◑