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:AAIFAAAAAAAAABwIAhIHCgUBERgRGBIAEgMKAQgSBAoCAQgSABIAAAAAHQAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAADGtleUVuZEhlaWdodAIAAAAKZW5kX2hlaWdodAAAAAAPa2V5UHJpemVzUHJpY2VzAgAAAA1wcml6ZXNfcHJpY2VzAAAAAA1rZXlQcml6ZXNBSWRzAgAAABdwcml6ZXNfYWNoaWV2ZW1lbnRzX2lkcwAAAAAQa2V5UHJpemVzQW1vdW50cwIAAAANcHJpemVzX2Ftb3VudAAAAAAOa2V5TGV2ZWxQcmljZXMCAAAADGxldmVsX3ByaWNlcwAAAAAWa2V5TGV2ZWxBY2hpZXZlbW50c0lkcwIAAAAWbGV2ZWxfYWNoaWV2ZW1lbnRzX2lkcwAAAAAJa2V5U1dPUGlkAgAAAAdTV09QX2lkAAAAAA5rZXlUb3RhbEJ1cm5lZAIAAAAMdG90YWxfYnVybmVkAAAAAA1r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JAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAxhZG1pblB1YktleTMGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAASYWRtaW5QdWJLZXlTdGFraW5nBAAAAAckbWF0Y2gwBQAAAAJ0eAUAAAATbXVsdGlTaWduZWRCeUFkbWluc5d0MB0=", "height": 1797935, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3UxUiqUiW6jsexr6TYJ5nbudtUn4ehXNXhDzCFe4BvdH Next: Hua2f7BfCucfFYtafS3mFSNuAyAL5XH7BENnbNVpcMav Diff:
Old | New | Differences | |
---|---|---|---|
57 | 57 | ||
58 | 58 | let isActive = valueOrElse(getBoolean(this, keyActive), true) | |
59 | 59 | ||
60 | - | let totalBurned = valueOrElse(getInteger(this, keyTotalBurned), 0) | |
61 | - | ||
62 | 60 | func inListToStr (acc,next) = if ((acc == "")) | |
63 | 61 | then (acc + toString(next)) | |
64 | 62 | else ((acc + ",") + toString(next)) | |
67 | 65 | func inListToInt (acc,next) = (acc :+ parseIntValue(next)) | |
68 | 66 | ||
69 | 67 | ||
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 | + | } | |
71 | 74 | ||
72 | 75 | ||
73 | 76 | func calcLevel (burned) = { | |
151 | 154 | ||
152 | 155 | @Callable(i) | |
153 | 156 | func add () = { | |
154 | - | let $ | |
155 | - | let pmtAmount = $ | |
156 | - | let pmtAssetId = $ | |
157 | + | let $t035323607 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
158 | + | let pmtAmount = $t035323607._1 | |
159 | + | let pmtAssetId = $t035323607._2 | |
157 | 160 | let endHeight = valueOrElse(getInteger(this, keyEndHeight), 0) | |
158 | 161 | if (!(isActive)) | |
159 | 162 | then throw("DApp is inactive at this moment") | |
164 | 167 | else if ((pmtAssetId != swopId)) | |
165 | 168 | then throw("You can add only SWOP token") | |
166 | 169 | else { | |
170 | + | let newTotalBurned = (valueOrElse(getInteger(this, keyTotalBurned), 0) + pmtAmount) | |
167 | 171 | let userTotalBurned = valueOrElse(getInteger(this, (toString(this) + keyUserTotalBurned)), 0) | |
168 | 172 | let prizesAmounts = { | |
169 | 173 | let $l = split(getStringValue(this, keyPrizesAmounts), ",") | |
195 | 199 | } | |
196 | 200 | let prizesAchievementsIds = split(getStringValue(this, keyPrizesAIds), ",") | |
197 | 201 | let levelAchievementsIds = split(getStringValue(this, keyLevelAchievemntsIds), ",") | |
198 | - | let | |
202 | + | let res = { | |
199 | 203 | let $l = prizesPrices | |
200 | 204 | let $s = size($l) | |
201 | - | let $acc0 = nil | |
205 | + | let $acc0 = $Tuple2(newTotalBurned, nil) | |
202 | 206 | func 1 ($a,$i) = if (($i >= $s)) | |
203 | 207 | then $a | |
204 | 208 | else calcPrizesAmounts($a, $l[$i]) | |
209 | 213 | ||
210 | 214 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
211 | 215 | } | |
216 | + | let newPrizesAmounts = res._2 | |
212 | 217 | let newPrizesAmountsStr = { | |
213 | 218 | let $l = newPrizesAmounts | |
214 | 219 | let $s = size($l) | |
268 | 273 | let inv5 = if ((oldLevel != newLevel)) | |
269 | 274 | then invoke(achievements, "add", [levelAchievementsIds[(newLevel - 1)], 1], nil) | |
270 | 275 | else 0 | |
271 | - | [IntegerEntry(keyTotalBurned, | |
276 | + | [IntegerEntry(keyTotalBurned, newTotalBurned), IntegerEntry((toString(i.caller) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)] | |
272 | 277 | } | |
273 | 278 | else throw("Strict value is not equal to itself.") | |
274 | 279 | } |
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 | 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 | 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 | - | let totalBurned = valueOrElse(getInteger(this, keyTotalBurned), 0) | |
61 | - | ||
62 | 60 | func inListToStr (acc,next) = if ((acc == "")) | |
63 | 61 | then (acc + toString(next)) | |
64 | 62 | else ((acc + ",") + toString(next)) | |
65 | 63 | ||
66 | 64 | ||
67 | 65 | func inListToInt (acc,next) = (acc :+ parseIntValue(next)) | |
68 | 66 | ||
69 | 67 | ||
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 | + | } | |
71 | 74 | ||
72 | 75 | ||
73 | 76 | func calcLevel (burned) = { | |
74 | 77 | let levelPrices = { | |
75 | 78 | let $l = split(getStringValue(this, keyLevelPrices), ",") | |
76 | 79 | let $s = size($l) | |
77 | 80 | let $acc0 = nil | |
78 | 81 | func 1 ($a,$i) = if (($i >= $s)) | |
79 | 82 | then $a | |
80 | 83 | else inListToInt($a, $l[$i]) | |
81 | 84 | ||
82 | 85 | func 2 ($a,$i) = if (($i >= $s)) | |
83 | 86 | then $a | |
84 | 87 | else throw("List size exceeds 5") | |
85 | 88 | ||
86 | 89 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
87 | 90 | } | |
88 | 91 | if ((levelPrices[3] >= burned)) | |
89 | 92 | then 4 | |
90 | 93 | else if ((levelPrices[2] >= burned)) | |
91 | 94 | then 3 | |
92 | 95 | else if ((levelPrices[1] >= burned)) | |
93 | 96 | then 2 | |
94 | 97 | else if ((levelPrices[0] >= burned)) | |
95 | 98 | then 1 | |
96 | 99 | else 0 | |
97 | 100 | } | |
98 | 101 | ||
99 | 102 | ||
100 | 103 | @Callable(i) | |
101 | 104 | func init (endHeight,prizePrices,prizeAchievmentsIds,levelPrices,levelAchievmentsIds) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
102 | 105 | then throw("Only admin can call this function") | |
103 | 106 | else if (isDefined(getInteger(this, keyEndHeight))) | |
104 | 107 | then throw("DApp is already inited") | |
105 | 108 | else if ((height > endHeight)) | |
106 | 109 | then throw("Burning ending must be greater than current height") | |
107 | 110 | else if (if ((size(prizePrices) != 5)) | |
108 | 111 | then true | |
109 | 112 | else (size(prizeAchievmentsIds) != 5)) | |
110 | 113 | then throw("Amount of prizes achievemts lists must equal to 5") | |
111 | 114 | else if (if ((size(levelPrices) != 4)) | |
112 | 115 | then true | |
113 | 116 | else (size(levelAchievmentsIds) != 4)) | |
114 | 117 | then throw("Amount of levels lists must equal to 4") | |
115 | 118 | else { | |
116 | 119 | let prizePricesStr = { | |
117 | 120 | let $l = prizePrices | |
118 | 121 | let $s = size($l) | |
119 | 122 | let $acc0 = "" | |
120 | 123 | func 1 ($a,$i) = if (($i >= $s)) | |
121 | 124 | then $a | |
122 | 125 | else inListToStr($a, $l[$i]) | |
123 | 126 | ||
124 | 127 | func 2 ($a,$i) = if (($i >= $s)) | |
125 | 128 | then $a | |
126 | 129 | else throw("List size exceeds 5") | |
127 | 130 | ||
128 | 131 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
129 | 132 | } | |
130 | 133 | let prizeAchievmentsIdsStr = makeString(prizeAchievmentsIds, ",") | |
131 | 134 | let levelPricesStr = { | |
132 | 135 | let $l = levelPrices | |
133 | 136 | let $s = size($l) | |
134 | 137 | let $acc0 = "" | |
135 | 138 | func 1 ($a,$i) = if (($i >= $s)) | |
136 | 139 | then $a | |
137 | 140 | else inListToStr($a, $l[$i]) | |
138 | 141 | ||
139 | 142 | func 2 ($a,$i) = if (($i >= $s)) | |
140 | 143 | then $a | |
141 | 144 | else throw("List size exceeds 5") | |
142 | 145 | ||
143 | 146 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
144 | 147 | } | |
145 | 148 | let levelAchievmentsIdsStr = makeString(levelAchievmentsIds, ",") | |
146 | 149 | let prizesAmountStr = "0,0,0,0,0" | |
147 | 150 | [IntegerEntry(keyEndHeight, endHeight), StringEntry(keyPrizesPrices, prizePricesStr), StringEntry(keyPrizesAIds, prizeAchievmentsIdsStr), StringEntry(keyLevelPrices, levelPricesStr), StringEntry(keyLevelAchievemntsIds, levelAchievmentsIdsStr), StringEntry(keyPrizesAmounts, prizesAmountStr)] | |
148 | 151 | } | |
149 | 152 | ||
150 | 153 | ||
151 | 154 | ||
152 | 155 | @Callable(i) | |
153 | 156 | func add () = { | |
154 | - | let $ | |
155 | - | let pmtAmount = $ | |
156 | - | let pmtAssetId = $ | |
157 | + | let $t035323607 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
158 | + | let pmtAmount = $t035323607._1 | |
159 | + | let pmtAssetId = $t035323607._2 | |
157 | 160 | let endHeight = valueOrElse(getInteger(this, keyEndHeight), 0) | |
158 | 161 | if (!(isActive)) | |
159 | 162 | then throw("DApp is inactive at this moment") | |
160 | 163 | else if (if ((height > endHeight)) | |
161 | 164 | then true | |
162 | 165 | else (endHeight == 0)) | |
163 | 166 | then throw("Swop burning are ended or not started yet") | |
164 | 167 | else if ((pmtAssetId != swopId)) | |
165 | 168 | then throw("You can add only SWOP token") | |
166 | 169 | else { | |
170 | + | let newTotalBurned = (valueOrElse(getInteger(this, keyTotalBurned), 0) + pmtAmount) | |
167 | 171 | let userTotalBurned = valueOrElse(getInteger(this, (toString(this) + keyUserTotalBurned)), 0) | |
168 | 172 | let prizesAmounts = { | |
169 | 173 | let $l = split(getStringValue(this, keyPrizesAmounts), ",") | |
170 | 174 | let $s = size($l) | |
171 | 175 | let $acc0 = nil | |
172 | 176 | func 1 ($a,$i) = if (($i >= $s)) | |
173 | 177 | then $a | |
174 | 178 | else inListToInt($a, $l[$i]) | |
175 | 179 | ||
176 | 180 | func 2 ($a,$i) = if (($i >= $s)) | |
177 | 181 | then $a | |
178 | 182 | else throw("List size exceeds 5") | |
179 | 183 | ||
180 | 184 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
181 | 185 | } | |
182 | 186 | let prizesPrices = { | |
183 | 187 | let $l = split(getStringValue(this, keyPrizesPrices), ",") | |
184 | 188 | let $s = size($l) | |
185 | 189 | let $acc0 = nil | |
186 | 190 | func 1 ($a,$i) = if (($i >= $s)) | |
187 | 191 | then $a | |
188 | 192 | else inListToInt($a, $l[$i]) | |
189 | 193 | ||
190 | 194 | func 2 ($a,$i) = if (($i >= $s)) | |
191 | 195 | then $a | |
192 | 196 | else throw("List size exceeds 5") | |
193 | 197 | ||
194 | 198 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
195 | 199 | } | |
196 | 200 | let prizesAchievementsIds = split(getStringValue(this, keyPrizesAIds), ",") | |
197 | 201 | let levelAchievementsIds = split(getStringValue(this, keyLevelAchievemntsIds), ",") | |
198 | - | let | |
202 | + | let res = { | |
199 | 203 | let $l = prizesPrices | |
200 | 204 | let $s = size($l) | |
201 | - | let $acc0 = nil | |
205 | + | let $acc0 = $Tuple2(newTotalBurned, nil) | |
202 | 206 | func 1 ($a,$i) = if (($i >= $s)) | |
203 | 207 | then $a | |
204 | 208 | else calcPrizesAmounts($a, $l[$i]) | |
205 | 209 | ||
206 | 210 | func 2 ($a,$i) = if (($i >= $s)) | |
207 | 211 | then $a | |
208 | 212 | else throw("List size exceeds 5") | |
209 | 213 | ||
210 | 214 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
211 | 215 | } | |
216 | + | let newPrizesAmounts = res._2 | |
212 | 217 | let newPrizesAmountsStr = { | |
213 | 218 | let $l = newPrizesAmounts | |
214 | 219 | let $s = size($l) | |
215 | 220 | let $acc0 = "" | |
216 | 221 | func 1 ($a,$i) = if (($i >= $s)) | |
217 | 222 | then $a | |
218 | 223 | else inListToStr($a, $l[$i]) | |
219 | 224 | ||
220 | 225 | func 2 ($a,$i) = if (($i >= $s)) | |
221 | 226 | then $a | |
222 | 227 | else throw("List size exceeds 5") | |
223 | 228 | ||
224 | 229 | 2(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5) | |
225 | 230 | } | |
226 | 231 | let inv0 = if ((newPrizesAmounts[0] != prizesAmounts[0])) | |
227 | 232 | then { | |
228 | 233 | let achievementAmount = (newPrizesAmounts[0] - prizesAmounts[0]) | |
229 | 234 | invoke(achievements, "add", [prizesAchievementsIds[0], achievementAmount], nil) | |
230 | 235 | } | |
231 | 236 | else 0 | |
232 | 237 | if ((inv0 == inv0)) | |
233 | 238 | then { | |
234 | 239 | let inv1 = if ((newPrizesAmounts[1] != prizesAmounts[1])) | |
235 | 240 | then { | |
236 | 241 | let achievementAmount = (newPrizesAmounts[1] - prizesAmounts[1]) | |
237 | 242 | invoke(achievements, "add", [prizesAchievementsIds[1], achievementAmount], nil) | |
238 | 243 | } | |
239 | 244 | else 0 | |
240 | 245 | if ((inv1 == inv1)) | |
241 | 246 | then { | |
242 | 247 | let inv2 = if ((newPrizesAmounts[2] != prizesAmounts[2])) | |
243 | 248 | then { | |
244 | 249 | let achievementAmount = (newPrizesAmounts[2] - prizesAmounts[2]) | |
245 | 250 | invoke(achievements, "add", [prizesAchievementsIds[2], achievementAmount], nil) | |
246 | 251 | } | |
247 | 252 | else 0 | |
248 | 253 | if ((inv2 == inv2)) | |
249 | 254 | then { | |
250 | 255 | let inv3 = if ((newPrizesAmounts[3] != prizesAmounts[3])) | |
251 | 256 | then { | |
252 | 257 | let achievementAmount = (newPrizesAmounts[3] - prizesAmounts[3]) | |
253 | 258 | invoke(achievements, "add", [prizesAchievementsIds[3], achievementAmount], nil) | |
254 | 259 | } | |
255 | 260 | else 0 | |
256 | 261 | if ((inv3 == inv3)) | |
257 | 262 | then { | |
258 | 263 | let inv4 = if ((newPrizesAmounts[4] != prizesAmounts[4])) | |
259 | 264 | then { | |
260 | 265 | let achievementAmount = (newPrizesAmounts[4] - prizesAmounts[4]) | |
261 | 266 | invoke(achievements, "add", [prizesAchievementsIds[4], achievementAmount], nil) | |
262 | 267 | } | |
263 | 268 | else 0 | |
264 | 269 | if ((inv4 == inv4)) | |
265 | 270 | then { | |
266 | 271 | let oldLevel = calcLevel(userTotalBurned) | |
267 | 272 | let newLevel = calcLevel((userTotalBurned + pmtAmount)) | |
268 | 273 | let inv5 = if ((oldLevel != newLevel)) | |
269 | 274 | then invoke(achievements, "add", [levelAchievementsIds[(newLevel - 1)], 1], nil) | |
270 | 275 | else 0 | |
271 | - | [IntegerEntry(keyTotalBurned, | |
276 | + | [IntegerEntry(keyTotalBurned, newTotalBurned), IntegerEntry((toString(i.caller) + keyUserTotalBurned), (userTotalBurned + pmtAmount)), StringEntry(keyPrizesAmounts, newPrizesAmountsStr)] | |
272 | 277 | } | |
273 | 278 | else throw("Strict value is not equal to itself.") | |
274 | 279 | } | |
275 | 280 | else throw("Strict value is not equal to itself.") | |
276 | 281 | } | |
277 | 282 | else throw("Strict value is not equal to itself.") | |
278 | 283 | } | |
279 | 284 | else throw("Strict value is not equal to itself.") | |
280 | 285 | } | |
281 | 286 | else throw("Strict value is not equal to itself.") | |
282 | 287 | } | |
283 | 288 | } | |
284 | 289 | ||
285 | 290 | ||
286 | 291 | ||
287 | 292 | @Callable(i) | |
288 | 293 | func hashingRandom (hash) = if (!(isActive)) | |
289 | 294 | then throw("DApp is inactive at this moment") | |
290 | 295 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
291 | 296 | then throw("Only admin can call this function") | |
292 | 297 | else [StringEntry(keyVerifyHash, hash)] | |
293 | 298 | ||
294 | 299 | ||
295 | 300 | ||
296 | 301 | @Callable(i) | |
297 | 302 | func finalize (vrfHeight,secretWord) = { | |
298 | 303 | let savedHash = getStringValue(this, keyVerifyHash) | |
299 | 304 | let calcHash = toBase58String(sha256((toBytes(vrfHeight) + toBytes(secretWord)))) | |
300 | 305 | if (!(isActive)) | |
301 | 306 | then throw("DApp is inactive at this moment") | |
302 | 307 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
303 | 308 | then throw("Only admin can call this function") | |
304 | 309 | else if ((calcHash != savedHash)) | |
305 | 310 | then throw("vrf Height hash not matching") | |
306 | 311 | else { | |
307 | 312 | let burnAmount = getIntegerValue(this, keyTotalBurned) | |
308 | 313 | [Burn(swopId, burnAmount), IntegerEntry(keyFinalizeHeight, height)] | |
309 | 314 | } | |
310 | 315 | } | |
311 | 316 | ||
312 | 317 | ||
313 | 318 | ||
314 | 319 | @Callable(i) | |
315 | 320 | func shutdown () = if (!(isActive)) | |
316 | 321 | then throw("DApp already inactive") | |
317 | 322 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
318 | 323 | then throw("Only admin can call this function") | |
319 | 324 | else [BooleanEntry(keyActive, false)] | |
320 | 325 | ||
321 | 326 | ||
322 | 327 | ||
323 | 328 | @Callable(i) | |
324 | 329 | func activate () = if (isActive) | |
325 | 330 | then throw("DApp already active") | |
326 | 331 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
327 | 332 | then throw("Only admin can call this function") | |
328 | 333 | else [BooleanEntry(keyActive, true)] | |
329 | 334 | ||
330 | 335 | ||
331 | 336 | @Verifier(tx) | |
332 | 337 | func verify () = { | |
333 | 338 | let multiSignedByAdmins = { | |
334 | 339 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
335 | 340 | then 1 | |
336 | 341 | else 0 | |
337 | 342 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
338 | 343 | then 1 | |
339 | 344 | else 0 | |
340 | 345 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
341 | 346 | then 1 | |
342 | 347 | else 0 | |
343 | 348 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
344 | 349 | } | |
345 | 350 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
346 | 351 | then true | |
347 | 352 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
348 | 353 | then true | |
349 | 354 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
350 | 355 | then true | |
351 | 356 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking) | |
352 | 357 | match tx { | |
353 | 358 | case _ => | |
354 | 359 | multiSignedByAdmins | |
355 | 360 | } | |
356 | 361 | } | |
357 | 362 |
github/deemru/w8io/169f3d6 172.72 ms ◑