tx · DT1EbBUsHk9546k8cPTECoPLn1dFiKAZn2gszBRqd319

3Mp5JgVSHA9iziujC9Kmnf2rCN5SYFE97yC:  -0.01400000 Waves

2021.11.19 15:38 [1797935] smart account 3Mp5JgVSHA9iziujC9Kmnf2rCN5SYFE97yC > SELF 0.00000000 Waves

{ "type": 13, "id": "DT1EbBUsHk9546k8cPTECoPLn1dFiKAZn2gszBRqd319", "fee": 1400000, "feeAssetId": null, "timestamp": 1637325496871, "version": 2, "chainId": 84, "sender": "3Mp5JgVSHA9iziujC9Kmnf2rCN5SYFE97yC", "senderPublicKey": "CSx1y2ADZAi6KvFZT2LoqQmX5qBxDVVGGZ6heDAGngHM", "proofs": [ "4KCvuvwSY8KoRuAqYrSgRCUEEeCRNzwv1VBbDgdFJ1nXzQSFqrmKH9hAJHrgrUfhVFp99U56dqrerU2phMLGhnm", "5hPTFbzxQKhvkx6X6tozApAhFcNXsqSACZPVyaqMUdNisaeTacGevXd87ucwJhNmdZgYkDy4gD27r2sJbhU5y866" ], "script": "base64:AAIFAAAAAAAAABwIAhIHCgUBERgRGBIAEgMKAQgSBAoCAQgSABIAAAAAHQAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAADGtleUVuZEhlaWdodAIAAAAKZW5kX2hlaWdodAAAAAAPa2V5UHJpemVzUHJpY2VzAgAAAA1wcml6ZXNfcHJpY2VzAAAAAA1rZXlQcml6ZXNBSWRzAgAAABdwcml6ZXNfYWNoaWV2ZW1lbnRzX2lkcwAAAAAQa2V5UHJpemVzQW1vdW50cwIAAAANcHJpemVzX2Ftb3VudAAAAAAOa2V5TGV2ZWxQcmljZXMCAAAADGxldmVsX3ByaWNlcwAAAAAWa2V5TGV2ZWxBY2hpZXZlbW50c0lkcwIAAAAWbGV2ZWxfYWNoaWV2ZW1lbnRzX2lkcwAAAAAJa2V5U1dPUGlkAgAAAAdTV09QX2lkAAAAAA5rZXlUb3RhbEJ1cm5lZAIAAAAMdG90YWxfYnVybmVkAAAAAA1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YJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAxhZG1pblB1YktleTMGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAASYWRtaW5QdWJLZXlTdGFraW5nBAAAAAckbWF0Y2gwBQAAAAJ0eAUAAAATbXVsdGlTaWduZWRCeUFkbWluc5d0MB0=", "height": 1797935, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3UxUiqUiW6jsexr6TYJ5nbudtUn4ehXNXhDzCFe4BvdH Next: Hua2f7BfCucfFYtafS3mFSNuAyAL5XH7BENnbNVpcMav Diff:
OldNewDifferences
5757
5858 let isActive = valueOrElse(getBoolean(this, keyActive), true)
5959
60-let totalBurned = valueOrElse(getInteger(this, keyTotalBurned), 0)
61-
6260 func inListToStr (acc,next) = if ((acc == ""))
6361 then (acc + toString(next))
6462 else ((acc + ",") + toString(next))
6765 func inListToInt (acc,next) = (acc :+ parseIntValue(next))
6866
6967
70-func calcPrizesAmounts (acc,next) = (acc :+ (totalBurned / next))
68+func calcPrizesAmounts (acc,next) = {
69+ let $t016581683 = acc
70+ let total = $t016581683._1
71+ let result = $t016581683._2
72+ $Tuple2(total, (result :+ (total / next)))
73+ }
7174
7275
7376 func calcLevel (burned) = {
151154
152155 @Callable(i)
153156 func add () = {
154- let $t035453620 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
155- let pmtAmount = $t035453620._1
156- let pmtAssetId = $t035453620._2
157+ let $t035323607 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
158+ let pmtAmount = $t035323607._1
159+ let pmtAssetId = $t035323607._2
157160 let endHeight = valueOrElse(getInteger(this, keyEndHeight), 0)
158161 if (!(isActive))
159162 then throw("DApp is inactive at this moment")
164167 else if ((pmtAssetId != swopId))
165168 then throw("You can add only SWOP token")
166169 else {
170+ let newTotalBurned = (valueOrElse(getInteger(this, keyTotalBurned), 0) + pmtAmount)
167171 let userTotalBurned = valueOrElse(getInteger(this, (toString(this) + keyUserTotalBurned)), 0)
168172 let prizesAmounts = {
169173 let $l = split(getStringValue(this, keyPrizesAmounts), ",")
195199 }
196200 let prizesAchievementsIds = split(getStringValue(this, keyPrizesAIds), ",")
197201 let levelAchievementsIds = split(getStringValue(this, keyLevelAchievemntsIds), ",")
198- let newPrizesAmounts = {
202+ let res = {
199203 let $l = prizesPrices
200204 let $s = size($l)
201- let $acc0 = nil
205+ let $acc0 = $Tuple2(newTotalBurned, nil)
202206 func 1 ($a,$i) = if (($i >= $s))
203207 then $a
204208 else calcPrizesAmounts($a, $l[$i])
209213
210214 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
211215 }
216+ let newPrizesAmounts = res._2
212217 let newPrizesAmountsStr = {
213218 let $l = newPrizesAmounts
214219 let $s = size($l)
268273 let inv5 = if ((oldLevel != newLevel))
269274 then invoke(achievements, "add", [levelAchievementsIds[(newLevel - 1)], 1], nil)
270275 else 0
271-[IntegerEntry(keyTotalBurned, (totalBurned + pmtAmount)), IntegerEntry((toString(i.caller) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)]
276+[IntegerEntry(keyTotalBurned, newTotalBurned), IntegerEntry((toString(i.caller) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)]
272277 }
273278 else throw("Strict value is not equal to itself.")
274279 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyActive = "active"
55
66 let keyEndHeight = "end_height"
77
88 let keyPrizesPrices = "prizes_prices"
99
1010 let keyPrizesAIds = "prizes_achievements_ids"
1111
1212 let keyPrizesAmounts = "prizes_amount"
1313
1414 let keyLevelPrices = "level_prices"
1515
1616 let keyLevelAchievemntsIds = "level_achievements_ids"
1717
1818 let keySWOPid = "SWOP_id"
1919
2020 let keyTotalBurned = "total_burned"
2121
2222 let keyVerifyHash = "verify_hash"
2323
2424 let keyFinalizeHeight = "finalize_height"
2525
2626 let keyUserTotalBurned = "_total_burned"
2727
2828 let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
2929
3030 let farming = Address(base58'3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT')
3131
3232 let achievements = Address(base58'3N3HtdnBkqSSc16DaydiwtrMBUv3DfqKjSW')
3333
3434 let keyAdminPubKey1 = "admin_pub_1"
3535
3636 let keyAdminPubKey2 = "admin_pub_2"
3737
3838 let keyAdminPubKey3 = "admin_pub_3"
3939
4040 func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) {
4141 case string: String =>
4242 fromBase58String(string)
4343 case nothing =>
4444 throw("Admin public key is empty")
4545 }
4646
4747
4848 let adminPubKey1 = getAdminPub(keyAdminPubKey1)
4949
5050 let adminPubKey2 = getAdminPub(keyAdminPubKey2)
5151
5252 let adminPubKey3 = getAdminPub(keyAdminPubKey3)
5353
5454 let adminPubKeyStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
5555
5656 let swopId = fromBase58String(getStringValue(farming, keySWOPid))
5757
5858 let isActive = valueOrElse(getBoolean(this, keyActive), true)
5959
60-let totalBurned = valueOrElse(getInteger(this, keyTotalBurned), 0)
61-
6260 func inListToStr (acc,next) = if ((acc == ""))
6361 then (acc + toString(next))
6462 else ((acc + ",") + toString(next))
6563
6664
6765 func inListToInt (acc,next) = (acc :+ parseIntValue(next))
6866
6967
70-func calcPrizesAmounts (acc,next) = (acc :+ (totalBurned / next))
68+func calcPrizesAmounts (acc,next) = {
69+ let $t016581683 = acc
70+ let total = $t016581683._1
71+ let result = $t016581683._2
72+ $Tuple2(total, (result :+ (total / next)))
73+ }
7174
7275
7376 func calcLevel (burned) = {
7477 let levelPrices = {
7578 let $l = split(getStringValue(this, keyLevelPrices), ",")
7679 let $s = size($l)
7780 let $acc0 = nil
7881 func 1 ($a,$i) = if (($i >= $s))
7982 then $a
8083 else inListToInt($a, $l[$i])
8184
8285 func 2 ($a,$i) = if (($i >= $s))
8386 then $a
8487 else throw("List size exceeds 5")
8588
8689 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
8790 }
8891 if ((levelPrices[3] >= burned))
8992 then 4
9093 else if ((levelPrices[2] >= burned))
9194 then 3
9295 else if ((levelPrices[1] >= burned))
9396 then 2
9497 else if ((levelPrices[0] >= burned))
9598 then 1
9699 else 0
97100 }
98101
99102
100103 @Callable(i)
101104 func init (endHeight,prizePrices,prizeAchievmentsIds,levelPrices,levelAchievmentsIds) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
102105 then throw("Only admin can call this function")
103106 else if (isDefined(getInteger(this, keyEndHeight)))
104107 then throw("DApp is already inited")
105108 else if ((height > endHeight))
106109 then throw("Burning ending must be greater than current height")
107110 else if (if ((size(prizePrices) != 5))
108111 then true
109112 else (size(prizeAchievmentsIds) != 5))
110113 then throw("Amount of prizes achievemts lists must equal to 5")
111114 else if (if ((size(levelPrices) != 4))
112115 then true
113116 else (size(levelAchievmentsIds) != 4))
114117 then throw("Amount of levels lists must equal to 4")
115118 else {
116119 let prizePricesStr = {
117120 let $l = prizePrices
118121 let $s = size($l)
119122 let $acc0 = ""
120123 func 1 ($a,$i) = if (($i >= $s))
121124 then $a
122125 else inListToStr($a, $l[$i])
123126
124127 func 2 ($a,$i) = if (($i >= $s))
125128 then $a
126129 else throw("List size exceeds 5")
127130
128131 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
129132 }
130133 let prizeAchievmentsIdsStr = makeString(prizeAchievmentsIds, ",")
131134 let levelPricesStr = {
132135 let $l = levelPrices
133136 let $s = size($l)
134137 let $acc0 = ""
135138 func 1 ($a,$i) = if (($i >= $s))
136139 then $a
137140 else inListToStr($a, $l[$i])
138141
139142 func 2 ($a,$i) = if (($i >= $s))
140143 then $a
141144 else throw("List size exceeds 5")
142145
143146 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
144147 }
145148 let levelAchievmentsIdsStr = makeString(levelAchievmentsIds, ",")
146149 let prizesAmountStr = "0,0,0,0,0"
147150 [IntegerEntry(keyEndHeight, endHeight), StringEntry(keyPrizesPrices, prizePricesStr), StringEntry(keyPrizesAIds, prizeAchievmentsIdsStr), StringEntry(keyLevelPrices, levelPricesStr), StringEntry(keyLevelAchievemntsIds, levelAchievmentsIdsStr), StringEntry(keyPrizesAmounts, prizesAmountStr)]
148151 }
149152
150153
151154
152155 @Callable(i)
153156 func add () = {
154- let $t035453620 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
155- let pmtAmount = $t035453620._1
156- let pmtAssetId = $t035453620._2
157+ let $t035323607 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
158+ let pmtAmount = $t035323607._1
159+ let pmtAssetId = $t035323607._2
157160 let endHeight = valueOrElse(getInteger(this, keyEndHeight), 0)
158161 if (!(isActive))
159162 then throw("DApp is inactive at this moment")
160163 else if (if ((height > endHeight))
161164 then true
162165 else (endHeight == 0))
163166 then throw("Swop burning are ended or not started yet")
164167 else if ((pmtAssetId != swopId))
165168 then throw("You can add only SWOP token")
166169 else {
170+ let newTotalBurned = (valueOrElse(getInteger(this, keyTotalBurned), 0) + pmtAmount)
167171 let userTotalBurned = valueOrElse(getInteger(this, (toString(this) + keyUserTotalBurned)), 0)
168172 let prizesAmounts = {
169173 let $l = split(getStringValue(this, keyPrizesAmounts), ",")
170174 let $s = size($l)
171175 let $acc0 = nil
172176 func 1 ($a,$i) = if (($i >= $s))
173177 then $a
174178 else inListToInt($a, $l[$i])
175179
176180 func 2 ($a,$i) = if (($i >= $s))
177181 then $a
178182 else throw("List size exceeds 5")
179183
180184 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
181185 }
182186 let prizesPrices = {
183187 let $l = split(getStringValue(this, keyPrizesPrices), ",")
184188 let $s = size($l)
185189 let $acc0 = nil
186190 func 1 ($a,$i) = if (($i >= $s))
187191 then $a
188192 else inListToInt($a, $l[$i])
189193
190194 func 2 ($a,$i) = if (($i >= $s))
191195 then $a
192196 else throw("List size exceeds 5")
193197
194198 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
195199 }
196200 let prizesAchievementsIds = split(getStringValue(this, keyPrizesAIds), ",")
197201 let levelAchievementsIds = split(getStringValue(this, keyLevelAchievemntsIds), ",")
198- let newPrizesAmounts = {
202+ let res = {
199203 let $l = prizesPrices
200204 let $s = size($l)
201- let $acc0 = nil
205+ let $acc0 = $Tuple2(newTotalBurned, nil)
202206 func 1 ($a,$i) = if (($i >= $s))
203207 then $a
204208 else calcPrizesAmounts($a, $l[$i])
205209
206210 func 2 ($a,$i) = if (($i >= $s))
207211 then $a
208212 else throw("List size exceeds 5")
209213
210214 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
211215 }
216+ let newPrizesAmounts = res._2
212217 let newPrizesAmountsStr = {
213218 let $l = newPrizesAmounts
214219 let $s = size($l)
215220 let $acc0 = ""
216221 func 1 ($a,$i) = if (($i >= $s))
217222 then $a
218223 else inListToStr($a, $l[$i])
219224
220225 func 2 ($a,$i) = if (($i >= $s))
221226 then $a
222227 else throw("List size exceeds 5")
223228
224229 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
225230 }
226231 let inv0 = if ((newPrizesAmounts[0] != prizesAmounts[0]))
227232 then {
228233 let achievementAmount = (newPrizesAmounts[0] - prizesAmounts[0])
229234 invoke(achievements, "add", [prizesAchievementsIds[0], achievementAmount], nil)
230235 }
231236 else 0
232237 if ((inv0 == inv0))
233238 then {
234239 let inv1 = if ((newPrizesAmounts[1] != prizesAmounts[1]))
235240 then {
236241 let achievementAmount = (newPrizesAmounts[1] - prizesAmounts[1])
237242 invoke(achievements, "add", [prizesAchievementsIds[1], achievementAmount], nil)
238243 }
239244 else 0
240245 if ((inv1 == inv1))
241246 then {
242247 let inv2 = if ((newPrizesAmounts[2] != prizesAmounts[2]))
243248 then {
244249 let achievementAmount = (newPrizesAmounts[2] - prizesAmounts[2])
245250 invoke(achievements, "add", [prizesAchievementsIds[2], achievementAmount], nil)
246251 }
247252 else 0
248253 if ((inv2 == inv2))
249254 then {
250255 let inv3 = if ((newPrizesAmounts[3] != prizesAmounts[3]))
251256 then {
252257 let achievementAmount = (newPrizesAmounts[3] - prizesAmounts[3])
253258 invoke(achievements, "add", [prizesAchievementsIds[3], achievementAmount], nil)
254259 }
255260 else 0
256261 if ((inv3 == inv3))
257262 then {
258263 let inv4 = if ((newPrizesAmounts[4] != prizesAmounts[4]))
259264 then {
260265 let achievementAmount = (newPrizesAmounts[4] - prizesAmounts[4])
261266 invoke(achievements, "add", [prizesAchievementsIds[4], achievementAmount], nil)
262267 }
263268 else 0
264269 if ((inv4 == inv4))
265270 then {
266271 let oldLevel = calcLevel(userTotalBurned)
267272 let newLevel = calcLevel((userTotalBurned + pmtAmount))
268273 let inv5 = if ((oldLevel != newLevel))
269274 then invoke(achievements, "add", [levelAchievementsIds[(newLevel - 1)], 1], nil)
270275 else 0
271-[IntegerEntry(keyTotalBurned, (totalBurned + pmtAmount)), IntegerEntry((toString(i.caller) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)]
276+[IntegerEntry(keyTotalBurned, newTotalBurned), IntegerEntry((toString(i.caller) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)]
272277 }
273278 else throw("Strict value is not equal to itself.")
274279 }
275280 else throw("Strict value is not equal to itself.")
276281 }
277282 else throw("Strict value is not equal to itself.")
278283 }
279284 else throw("Strict value is not equal to itself.")
280285 }
281286 else throw("Strict value is not equal to itself.")
282287 }
283288 }
284289
285290
286291
287292 @Callable(i)
288293 func hashingRandom (hash) = if (!(isActive))
289294 then throw("DApp is inactive at this moment")
290295 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
291296 then throw("Only admin can call this function")
292297 else [StringEntry(keyVerifyHash, hash)]
293298
294299
295300
296301 @Callable(i)
297302 func finalize (vrfHeight,secretWord) = {
298303 let savedHash = getStringValue(this, keyVerifyHash)
299304 let calcHash = toBase58String(sha256((toBytes(vrfHeight) + toBytes(secretWord))))
300305 if (!(isActive))
301306 then throw("DApp is inactive at this moment")
302307 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
303308 then throw("Only admin can call this function")
304309 else if ((calcHash != savedHash))
305310 then throw("vrf Height hash not matching")
306311 else {
307312 let burnAmount = getIntegerValue(this, keyTotalBurned)
308313 [Burn(swopId, burnAmount), IntegerEntry(keyFinalizeHeight, height)]
309314 }
310315 }
311316
312317
313318
314319 @Callable(i)
315320 func shutdown () = if (!(isActive))
316321 then throw("DApp already inactive")
317322 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
318323 then throw("Only admin can call this function")
319324 else [BooleanEntry(keyActive, false)]
320325
321326
322327
323328 @Callable(i)
324329 func activate () = if (isActive)
325330 then throw("DApp already active")
326331 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
327332 then throw("Only admin can call this function")
328333 else [BooleanEntry(keyActive, true)]
329334
330335
331336 @Verifier(tx)
332337 func verify () = {
333338 let multiSignedByAdmins = {
334339 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
335340 then 1
336341 else 0
337342 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
338343 then 1
339344 else 0
340345 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
341346 then 1
342347 else 0
343348 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
344349 }
345350 let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
346351 then true
347352 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2))
348353 then true
349354 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3))
350355 then true
351356 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking)
352357 match tx {
353358 case _ =>
354359 multiSignedByAdmins
355360 }
356361 }
357362

github/deemru/w8io/169f3d6 
40.97 ms