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:AAIFAAAAAAAAABwIAhIHCgUBERgRGBIAEgMKAQgSBAoCAQgSABIAAAAAHgAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAADGtleUVuZEhlaWdodAIAAAAKZW5kX2hlaWdodAAAAAAPa2V5UHJpemVzUHJpY2VzAgAAAA1wcml6ZXNfcHJpY2VzAAAAAA1rZXlQcml6ZXNBSWRzAgAAABdwcml6ZXNfYWNoaWV2ZW1lbnRzX2lkcwAAAAAQa2V5UHJpemVzQW1vdW50cwIAAAANcHJpemVzX2Ftb3VudAAAAAAOa2V5TGV2ZWxQcmljZXMCAAAADGxldmVsX3ByaWNlcwAAAAAWa2V5TGV2ZWxBY2hpZXZlbW50c0lkcwIAAAAWbGV2ZWxfYWNoaWV2ZW1lbnRzX2lkcwAAAAAJa2V5U1dPUGlkAgAAAAdTV09QX2lkAAAAAA5rZXlUb3RhbEJ1cm5lZAIAAAAMdG90YWxfYnVybmVkA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AAAAAAAAAAAFAAAAEmFkbWluUHViS2V5U3Rha2luZwQAAAAHJG1hdGNoMAUAAAACdHgFAAAAE211bHRpU2lnbmVkQnlBZG1pbnM4t7lL", "height": 1796207, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6qppARN7VdAA7SPQUtayCpV3EARPY6oh3nN6zn7YY5sG Next: 3UxUiqUiW6jsexr6TYJ5nbudtUn4ehXNXhDzCFe4BvdH Diff:
OldNewDifferences
77
88 let keyPrizesPrices = "prizes_prices"
99
10-let keyPrizesIds = "prizes_ids"
10+let keyPrizesAIds = "prizes_achievements_ids"
1111
1212 let keyPrizesAmounts = "prizes_amount"
1313
1414 let keyLevelPrices = "level_prices"
1515
16-let keyLevelIds = "level_ids"
16+let keyLevelAchievemntsIds = "level_achievements_ids"
1717
1818 let keySWOPid = "SWOP_id"
1919
9898
9999
100100 @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])
111123
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")
115127
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])
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])
126138
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")
130142
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- }
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+ }
137149
138150
139151
140152 @Callable(i)
141153 func add () = {
142- let $t029313006 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
143- let pmtAmount = $t029313006._1
144- let pmtAssetId = $t029313006._2
154+ let $t035453620 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
155+ let pmtAmount = $t035453620._1
156+ let pmtAssetId = $t035453620._2
145157 let endHeight = valueOrElse(getInteger(this, keyEndHeight), 0)
146158 if (!(isActive))
147159 then throw("DApp is inactive at this moment")
181193
182194 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
183195 }
184- let prizesIds = split(getStringValue(this, keyPrizesIds), ",")
185- let levelIds = split(getStringValue(this, keyLevelIds), ",")
196+ let prizesAchievementsIds = split(getStringValue(this, keyPrizesAIds), ",")
197+ let levelAchievementsIds = split(getStringValue(this, keyLevelAchievemntsIds), ",")
186198 let newPrizesAmounts = {
187199 let $l = prizesPrices
188200 let $s = size($l)
214226 let inv0 = if ((newPrizesAmounts[0] != prizesAmounts[0]))
215227 then {
216228 let achievementAmount = (newPrizesAmounts[0] - prizesAmounts[0])
217- invoke(achievements, "add", [prizesIds[0], achievementAmount], nil)
229+ invoke(achievements, "add", [prizesAchievementsIds[0], achievementAmount], nil)
218230 }
219231 else 0
220232 if ((inv0 == inv0))
222234 let inv1 = if ((newPrizesAmounts[1] != prizesAmounts[1]))
223235 then {
224236 let achievementAmount = (newPrizesAmounts[1] - prizesAmounts[1])
225- invoke(achievements, "add", [prizesIds[1], achievementAmount], nil)
237+ invoke(achievements, "add", [prizesAchievementsIds[1], achievementAmount], nil)
226238 }
227239 else 0
228240 if ((inv1 == inv1))
230242 let inv2 = if ((newPrizesAmounts[2] != prizesAmounts[2]))
231243 then {
232244 let achievementAmount = (newPrizesAmounts[2] - prizesAmounts[2])
233- invoke(achievements, "add", [prizesIds[2], achievementAmount], nil)
245+ invoke(achievements, "add", [prizesAchievementsIds[2], achievementAmount], nil)
234246 }
235247 else 0
236248 if ((inv2 == inv2))
238250 let inv3 = if ((newPrizesAmounts[3] != prizesAmounts[3]))
239251 then {
240252 let achievementAmount = (newPrizesAmounts[3] - prizesAmounts[3])
241- invoke(achievements, "add", [prizesIds[3], achievementAmount], nil)
253+ invoke(achievements, "add", [prizesAchievementsIds[3], achievementAmount], nil)
242254 }
243255 else 0
244256 if ((inv3 == inv3))
246258 let inv4 = if ((newPrizesAmounts[4] != prizesAmounts[4]))
247259 then {
248260 let achievementAmount = (newPrizesAmounts[4] - prizesAmounts[4])
249- invoke(achievements, "add", [prizesIds[4], achievementAmount], nil)
261+ invoke(achievements, "add", [prizesAchievementsIds[4], achievementAmount], nil)
250262 }
251263 else 0
252264 if ((inv4 == inv4))
254266 let oldLevel = calcLevel(userTotalBurned)
255267 let newLevel = calcLevel((userTotalBurned + pmtAmount))
256268 let inv5 = if ((oldLevel != newLevel))
257- then invoke(achievements, "add", [levelIds[(newLevel - 1)], 1], nil)
269+ then invoke(achievements, "add", [levelAchievementsIds[(newLevel - 1)], 1], nil)
258270 else 0
259271 [IntegerEntry(keyTotalBurned, (totalBurned + pmtAmount)), IntegerEntry((toString(this) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)]
260272 }
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
10-let keyPrizesIds = "prizes_ids"
10+let keyPrizesAIds = "prizes_achievements_ids"
1111
1212 let keyPrizesAmounts = "prizes_amount"
1313
1414 let keyLevelPrices = "level_prices"
1515
16-let keyLevelIds = "level_ids"
16+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
6060 let totalBurned = valueOrElse(getInteger(this, keyTotalBurned), 0)
6161
6262 func inListToStr (acc,next) = if ((acc == ""))
6363 then (acc + toString(next))
6464 else ((acc + ",") + toString(next))
6565
6666
6767 func inListToInt (acc,next) = (acc :+ parseIntValue(next))
6868
6969
7070 func calcPrizesAmounts (acc,next) = (acc :+ (totalBurned / next))
7171
7272
7373 func calcLevel (burned) = {
7474 let levelPrices = {
7575 let $l = split(getStringValue(this, keyLevelPrices), ",")
7676 let $s = size($l)
7777 let $acc0 = nil
7878 func 1 ($a,$i) = if (($i >= $s))
7979 then $a
8080 else inListToInt($a, $l[$i])
8181
8282 func 2 ($a,$i) = if (($i >= $s))
8383 then $a
8484 else throw("List size exceeds 5")
8585
8686 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
8787 }
8888 if ((levelPrices[3] >= burned))
8989 then 4
9090 else if ((levelPrices[2] >= burned))
9191 then 3
9292 else if ((levelPrices[1] >= burned))
9393 then 2
9494 else if ((levelPrices[0] >= burned))
9595 then 1
9696 else 0
9797 }
9898
9999
100100 @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])
111123
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")
115127
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])
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])
126138
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")
130142
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- }
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+ }
137149
138150
139151
140152 @Callable(i)
141153 func add () = {
142- let $t029313006 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
143- let pmtAmount = $t029313006._1
144- let pmtAssetId = $t029313006._2
154+ let $t035453620 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
155+ let pmtAmount = $t035453620._1
156+ let pmtAssetId = $t035453620._2
145157 let endHeight = valueOrElse(getInteger(this, keyEndHeight), 0)
146158 if (!(isActive))
147159 then throw("DApp is inactive at this moment")
148160 else if (if ((height > endHeight))
149161 then true
150162 else (endHeight == 0))
151163 then throw("Swop burning are ended or not started yet")
152164 else if ((pmtAssetId != swopId))
153165 then throw("You can add only SWOP token")
154166 else {
155167 let userTotalBurned = valueOrElse(getInteger(this, (toString(this) + keyUserTotalBurned)), 0)
156168 let prizesAmounts = {
157169 let $l = split(getStringValue(this, keyPrizesAmounts), ",")
158170 let $s = size($l)
159171 let $acc0 = nil
160172 func 1 ($a,$i) = if (($i >= $s))
161173 then $a
162174 else inListToInt($a, $l[$i])
163175
164176 func 2 ($a,$i) = if (($i >= $s))
165177 then $a
166178 else throw("List size exceeds 5")
167179
168180 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
169181 }
170182 let prizesPrices = {
171183 let $l = split(getStringValue(this, keyPrizesPrices), ",")
172184 let $s = size($l)
173185 let $acc0 = nil
174186 func 1 ($a,$i) = if (($i >= $s))
175187 then $a
176188 else inListToInt($a, $l[$i])
177189
178190 func 2 ($a,$i) = if (($i >= $s))
179191 then $a
180192 else throw("List size exceeds 5")
181193
182194 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
183195 }
184- let prizesIds = split(getStringValue(this, keyPrizesIds), ",")
185- let levelIds = split(getStringValue(this, keyLevelIds), ",")
196+ let prizesAchievementsIds = split(getStringValue(this, keyPrizesAIds), ",")
197+ let levelAchievementsIds = split(getStringValue(this, keyLevelAchievemntsIds), ",")
186198 let newPrizesAmounts = {
187199 let $l = prizesPrices
188200 let $s = size($l)
189201 let $acc0 = nil
190202 func 1 ($a,$i) = if (($i >= $s))
191203 then $a
192204 else calcPrizesAmounts($a, $l[$i])
193205
194206 func 2 ($a,$i) = if (($i >= $s))
195207 then $a
196208 else throw("List size exceeds 5")
197209
198210 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
199211 }
200212 let newPrizesAmountsStr = {
201213 let $l = newPrizesAmounts
202214 let $s = size($l)
203215 let $acc0 = ""
204216 func 1 ($a,$i) = if (($i >= $s))
205217 then $a
206218 else inListToStr($a, $l[$i])
207219
208220 func 2 ($a,$i) = if (($i >= $s))
209221 then $a
210222 else throw("List size exceeds 5")
211223
212224 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5)
213225 }
214226 let inv0 = if ((newPrizesAmounts[0] != prizesAmounts[0]))
215227 then {
216228 let achievementAmount = (newPrizesAmounts[0] - prizesAmounts[0])
217- invoke(achievements, "add", [prizesIds[0], achievementAmount], nil)
229+ invoke(achievements, "add", [prizesAchievementsIds[0], achievementAmount], nil)
218230 }
219231 else 0
220232 if ((inv0 == inv0))
221233 then {
222234 let inv1 = if ((newPrizesAmounts[1] != prizesAmounts[1]))
223235 then {
224236 let achievementAmount = (newPrizesAmounts[1] - prizesAmounts[1])
225- invoke(achievements, "add", [prizesIds[1], achievementAmount], nil)
237+ invoke(achievements, "add", [prizesAchievementsIds[1], achievementAmount], nil)
226238 }
227239 else 0
228240 if ((inv1 == inv1))
229241 then {
230242 let inv2 = if ((newPrizesAmounts[2] != prizesAmounts[2]))
231243 then {
232244 let achievementAmount = (newPrizesAmounts[2] - prizesAmounts[2])
233- invoke(achievements, "add", [prizesIds[2], achievementAmount], nil)
245+ invoke(achievements, "add", [prizesAchievementsIds[2], achievementAmount], nil)
234246 }
235247 else 0
236248 if ((inv2 == inv2))
237249 then {
238250 let inv3 = if ((newPrizesAmounts[3] != prizesAmounts[3]))
239251 then {
240252 let achievementAmount = (newPrizesAmounts[3] - prizesAmounts[3])
241- invoke(achievements, "add", [prizesIds[3], achievementAmount], nil)
253+ invoke(achievements, "add", [prizesAchievementsIds[3], achievementAmount], nil)
242254 }
243255 else 0
244256 if ((inv3 == inv3))
245257 then {
246258 let inv4 = if ((newPrizesAmounts[4] != prizesAmounts[4]))
247259 then {
248260 let achievementAmount = (newPrizesAmounts[4] - prizesAmounts[4])
249- invoke(achievements, "add", [prizesIds[4], achievementAmount], nil)
261+ invoke(achievements, "add", [prizesAchievementsIds[4], achievementAmount], nil)
250262 }
251263 else 0
252264 if ((inv4 == inv4))
253265 then {
254266 let oldLevel = calcLevel(userTotalBurned)
255267 let newLevel = calcLevel((userTotalBurned + pmtAmount))
256268 let inv5 = if ((oldLevel != newLevel))
257- then invoke(achievements, "add", [levelIds[(newLevel - 1)], 1], nil)
269+ then invoke(achievements, "add", [levelAchievementsIds[(newLevel - 1)], 1], nil)
258270 else 0
259271 [IntegerEntry(keyTotalBurned, (totalBurned + pmtAmount)), IntegerEntry((toString(this) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)]
260272 }
261273 else throw("Strict value is not equal to itself.")
262274 }
263275 else throw("Strict value is not equal to itself.")
264276 }
265277 else throw("Strict value is not equal to itself.")
266278 }
267279 else throw("Strict value is not equal to itself.")
268280 }
269281 else throw("Strict value is not equal to itself.")
270282 }
271283 }
272284
273285
274286
275287 @Callable(i)
276288 func hashingRandom (hash) = if (!(isActive))
277289 then throw("DApp is inactive at this moment")
278290 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
279291 then throw("Only admin can call this function")
280292 else [StringEntry(keyVerifyHash, hash)]
281293
282294
283295
284296 @Callable(i)
285297 func finalize (vrfHeight,secretWord) = {
286298 let savedHash = getStringValue(this, keyVerifyHash)
287299 let calcHash = toBase58String(sha256((toBytes(vrfHeight) + toBytes(secretWord))))
288300 if (!(isActive))
289301 then throw("DApp is inactive at this moment")
290302 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
291303 then throw("Only admin can call this function")
292304 else if ((calcHash != savedHash))
293305 then throw("vrf Height hash not matching")
294306 else {
295307 let burnAmount = getIntegerValue(this, keyTotalBurned)
296308 [Burn(swopId, burnAmount), IntegerEntry(keyFinalizeHeight, height)]
297309 }
298310 }
299311
300312
301313
302314 @Callable(i)
303315 func shutdown () = if (!(isActive))
304316 then throw("DApp already inactive")
305317 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
306318 then throw("Only admin can call this function")
307319 else [BooleanEntry(keyActive, false)]
308320
309321
310322
311323 @Callable(i)
312324 func activate () = if (isActive)
313325 then throw("DApp already active")
314326 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
315327 then throw("Only admin can call this function")
316328 else [BooleanEntry(keyActive, true)]
317329
318330
319331 @Verifier(tx)
320332 func verify () = {
321333 let multiSignedByAdmins = {
322334 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
323335 then 1
324336 else 0
325337 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
326338 then 1
327339 else 0
328340 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
329341 then 1
330342 else 0
331343 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
332344 }
333345 let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
334346 then true
335347 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2))
336348 then true
337349 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3))
338350 then true
339351 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking)
340352 match tx {
341353 case _ =>
342354 multiSignedByAdmins
343355 }
344356 }
345357

github/deemru/w8io/169f3d6 
102.03 ms