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