tx · 2TSPXaAHWVq8Qor35WL4FtbCcsrQXAJWYjfQLuagGBSn 3MwFCBSWkWf9JMqmRyN5WEdoF2MCEPUB1Jx: -0.01600000 Waves 2024.10.07 20:23 [3316718] smart account 3MwFCBSWkWf9JMqmRyN5WEdoF2MCEPUB1Jx > SELF 0.00000000 Waves
{ "type": 13, "id": "2TSPXaAHWVq8Qor35WL4FtbCcsrQXAJWYjfQLuagGBSn", "fee": 1600000, "feeAssetId": null, "timestamp": 1728321847464, "version": 2, "chainId": 84, "sender": "3MwFCBSWkWf9JMqmRyN5WEdoF2MCEPUB1Jx", "senderPublicKey": "BVdzAdt4eF9ScXGp5dwKiwoMQXBwMDeVSxLhL4LT1ceu", "proofs": [ "QtyCQxbJDi9NbLTdFZhJohSWeH4RNGeScyHZUhTkjud86hAdhAATmUTEoH2g6i1eqKrvhajPmSFHnhqEb79ikX5" ], "script": "base64:BgIyCAISAwoBCBIECgIIARIDCgEIEgQKAggBEgMKAQgSBAoCCAESAwoBARIDCgEIEgMKAQg6AQlpc1Rlc3RFbnYABAd0ZXN0ZW52BAckbWF0Y2gwCQCbCAIFBHRoaXMCB1RFU1RFTlYDCQABAgUHJG1hdGNoMAIHQm9vbGVhbgQBeAUHJG1hdGNoMAUBeAcFB3Rlc3RlbnYBFHRyeUdldFN0cmluZ0V4dGVybmFsAgdhZGRyZXNzA2tleQQHJG1hdGNoMAkAnQgCBQdhZGRyZXNzBQNrZXkDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFhBQckbWF0Y2gwBQFhAgABDXRyeUdldEJvb2xlYW4BA2tleQQHJG1hdGNoMAkAoAgBBQNrZXkDCQABAgUHJG1hdGNoMAIHQm9vbGVhbgQBYgUHJG1hdGNoMAUBYgcBDHRyeUdldFN0cmluZwEDa2V5CQEUdHJ5R2V0U3RyaW5nRXh0ZXJuYWwCBQR0aGlzBQNrZXkBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABA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wIIBQJ0eAZwcm9vZnMAAAUKc2Vjb25kVXNlcgABAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUKc2Vjb25kVXNlcgABAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUKc2Vjb25kVXNlcgABAAAED3RoaXJkVXNlclNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFCXRoaXJkVXNlcgABAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUJdGhpcmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQl0aGlyZFVzZXIAAQAABA9zaWduYXR1cmVzQ291bnQJAGQCCQBkAgUPZmlyc3RVc2VyU2lnbmVkBRBzZWNvbmRVc2VyU2lnbmVkBQ90aGlyZFVzZXJTaWduZWQEByRtYXRjaDAFAnR4CQBnAgUPc2lnbmF0dXJlc0NvdW50AAJjwDzR", "height": 3316718, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: HPAhB4UqYkF3VhEhQECaCuhmiEjN8k8LhJAfg4RhvPtA Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func isTestEnv () = { | |
5 | + | let testenv = match getBoolean(this, "TESTENV") { | |
6 | + | case x: Boolean => | |
7 | + | x | |
8 | + | case _ => | |
9 | + | false | |
10 | + | } | |
11 | + | testenv | |
12 | + | } | |
13 | + | ||
14 | + | ||
15 | + | func tryGetStringExternal (address,key) = match getString(address, key) { | |
16 | + | case a: String => | |
17 | + | a | |
18 | + | case _ => | |
19 | + | "" | |
20 | + | } | |
21 | + | ||
22 | + | ||
23 | + | func tryGetBoolean (key) = match getBoolean(key) { | |
24 | + | case b: Boolean => | |
25 | + | b | |
26 | + | case _ => | |
27 | + | false | |
28 | + | } | |
29 | + | ||
30 | + | ||
31 | + | func tryGetString (key) = tryGetStringExternal(this, key) | |
32 | + | ||
33 | + | ||
34 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
35 | + | case b: Int => | |
36 | + | b | |
37 | + | case _ => | |
38 | + | 0 | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func getOracle () = Address(fromBase58String(tryGetString("static_oracleAddress"))) | |
43 | + | ||
44 | + | ||
45 | + | func staticKey_turtleStakingAddress () = "static_turtleStakingAddress" | |
46 | + | ||
47 | + | ||
48 | + | func staticKey_turtleRebirthAddress () = "static_turtleRebirthAddress" | |
49 | + | ||
50 | + | ||
51 | + | func staticKey_ropeAddress () = "static_ropeAddress" | |
52 | + | ||
53 | + | ||
54 | + | func staticKey_levelSystemAddress () = "static_levelSystemAddress" | |
55 | + | ||
56 | + | ||
57 | + | func staticKey_spiceAssetId () = "static_spiceAssetId" | |
58 | + | ||
59 | + | ||
60 | + | func staticKey_marketplace () = "static_marketplaceAddress" | |
61 | + | ||
62 | + | ||
63 | + | func staticKey_capacityAddress () = "static_capacityAddress" | |
64 | + | ||
65 | + | ||
66 | + | func staticKey_veggFarmingAddress () = "static_veggFarmingAddress" | |
67 | + | ||
68 | + | ||
69 | + | func staticKey_itemsAddress () = "static_itemsAddress" | |
70 | + | ||
71 | + | ||
72 | + | func staticKey_mutantFarmingAddress () = "static_mutantFarmingAddress" | |
73 | + | ||
74 | + | ||
75 | + | func staticKey_canineBreederAddress () = "static_canineBreederAddress" | |
76 | + | ||
77 | + | ||
78 | + | func staticKey_felineBreederAddress () = "static_felineBreederAddress" | |
79 | + | ||
80 | + | ||
81 | + | func staticKey_turtleBreederAddress () = "static_turtleBreederAddress" | |
82 | + | ||
83 | + | ||
84 | + | func getRebirthAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_rebirthAddress"))) | |
85 | + | ||
86 | + | ||
87 | + | func getIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_incubatorAddress"))) | |
88 | + | ||
89 | + | ||
90 | + | func getFarmingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_farmingAddressNew"))) | |
91 | + | ||
92 | + | ||
93 | + | func getGameDappAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_gameDappAddress"))) | |
94 | + | ||
95 | + | ||
96 | + | func getCapacityAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_capacityAddress()))) | |
97 | + | ||
98 | + | ||
99 | + | func getBurnAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_burnAddress"))) | |
100 | + | ||
101 | + | ||
102 | + | func getBabyduckAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_babyDuckAddress"))) | |
103 | + | ||
104 | + | ||
105 | + | func getBreedingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_breederAddress"))) | |
106 | + | ||
107 | + | ||
108 | + | func getMasterAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_cfMasterAddress"))) | |
109 | + | ||
110 | + | ||
111 | + | func getTurtleStakingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_turtleStakingAddress()))) | |
112 | + | ||
113 | + | ||
114 | + | func getTurtleRebirthAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_turtleRebirthAddress()))) | |
115 | + | ||
116 | + | ||
117 | + | func getRopeAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_ropeAddress()))) | |
118 | + | ||
119 | + | ||
120 | + | func getSpiceAssetId () = fromBase58String(tryGetStringExternal(getOracle(), staticKey_spiceAssetId())) | |
121 | + | ||
122 | + | ||
123 | + | func getLevelSystemAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_levelSystemAddress()))) | |
124 | + | ||
125 | + | ||
126 | + | func getMarketPlaceAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_marketplace()))) | |
127 | + | ||
128 | + | ||
129 | + | func getVeggFarmingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_veggFarmingAddress()))) | |
130 | + | ||
131 | + | ||
132 | + | func getItemsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_itemsAddress()))) | |
133 | + | ||
134 | + | ||
135 | + | func getMutantFarmingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_mutantFarmingAddress()))) | |
136 | + | ||
137 | + | ||
138 | + | func getCanineFarmingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_canineStakingAddress"))) | |
139 | + | ||
140 | + | ||
141 | + | func getFelineFarmingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_felineStakingAddress"))) | |
142 | + | ||
143 | + | ||
144 | + | func getCanineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_canineBreederAddress()))) | |
145 | + | ||
146 | + | ||
147 | + | func getFelineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_felineBreederAddress()))) | |
148 | + | ||
149 | + | ||
150 | + | func getTurtleBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_turtleBreederAddress()))) | |
151 | + | ||
152 | + | ||
153 | + | let wAccPKey = fromBase58String(valueOrErrorMessage(getString(getOracle(), "static_warsPKey"), "static_warsPKey not defined")) | |
154 | + | ||
155 | + | let scCanUseCoupons = [getRebirthAddress(), getIncubatorAddress(), getFarmingAddress(), getGameDappAddress(), getBabyduckAddress(), getBreedingAddress(), getTurtleStakingAddress(), getTurtleRebirthAddress(), getRopeAddress(), getLevelSystemAddress(), getMarketPlaceAddress(), getCapacityAddress(), getMutantFarmingAddress(), getCanineFarmingAddress(), getFelineFarmingAddress(), getCanineBreederAddress(), getFelineBreederAddress(), getTurtleBreederAddress(), this] | |
156 | + | ||
157 | + | func couponsUserSpend (user) = (user + "_spend") | |
158 | + | ||
159 | + | ||
160 | + | func couponsUserActive (user) = (user + "_active") | |
161 | + | ||
162 | + | ||
163 | + | func couponsUserActiveOld (user) = (couponsUserActive(user) + "_old") | |
164 | + | ||
165 | + | ||
166 | + | func couponsSpendOnSc (sc) = (sc + "_spend_by_using") | |
167 | + | ||
168 | + | ||
169 | + | func actionPerAddressPerUserPerDay (user,action,dappAddress,day) = (((((((dappAddress + "_") + action) + "_") + user) + "_") + day) + "_actions") | |
170 | + | ||
171 | + | ||
172 | + | func actionPerAddressPerUserLastCheckDay (user,action) = (((action + "_") + user) + "_actions_check_day") | |
173 | + | ||
174 | + | ||
175 | + | func actionPerAddressPerUserAmountInARow (user,action) = (((action + "_") + user) + "_actions_amount_in_row") | |
176 | + | ||
177 | + | ||
178 | + | func userExperience (user) = (user + "_experience") | |
179 | + | ||
180 | + | ||
181 | + | func addCouponsInternal (user,amount) = { | |
182 | + | let keyOld = couponsUserActiveOld(user) | |
183 | + | let key = couponsUserActive(user) | |
184 | + | let couponsOld = tryGetInteger(key) | |
185 | + | let coupons = (couponsOld + amount) | |
186 | + | [IntegerEntry(keyOld, couponsOld), IntegerEntry(key, coupons)] | |
187 | + | } | |
188 | + | ||
189 | + | ||
190 | + | let startTsMs = 1695427200000 | |
191 | + | ||
192 | + | func calculateDaysSinceStart () = { | |
193 | + | let diff = (lastBlock.timestamp - startTsMs) | |
194 | + | let daysPassed = (diff / (86400 * 1000)) | |
195 | + | daysPassed | |
196 | + | } | |
197 | + | ||
198 | + | ||
199 | + | func hasDoneTask7Days (day,address,actionName,rewardAmount,rewardAmountWeekly) = { | |
200 | + | let userExperienceKey = userExperience(address) | |
201 | + | let userExpTilldate = tryGetInteger(userExperienceKey) | |
202 | + | let checkDayKey = actionPerAddressPerUserLastCheckDay(address, actionName) | |
203 | + | let daysInRowKey = actionPerAddressPerUserAmountInARow(address, actionName) | |
204 | + | let lastCheckDay = tryGetInteger(checkDayKey) | |
205 | + | let daysInRow = tryGetInteger(daysInRowKey) | |
206 | + | let daysInRowUpdate = if ((lastCheckDay == (day - 1))) | |
207 | + | then (daysInRow + 1) | |
208 | + | else if (((day - 1) > lastCheckDay)) | |
209 | + | then 1 | |
210 | + | else 0 | |
211 | + | let lastCheckDayUpdate = day | |
212 | + | let reward = if ((daysInRowUpdate == 7)) | |
213 | + | then [ScriptTransfer(addressFromStringValue(address), rewardAmountWeekly, getSpiceAssetId()), IntegerEntry(daysInRowKey, 0)] | |
214 | + | else [IntegerEntry(daysInRowKey, daysInRowUpdate)] | |
215 | + | ([IntegerEntry(checkDayKey, lastCheckDayUpdate), ScriptTransfer(addressFromStringValue(address), rewardAmount, getSpiceAssetId()), IntegerEntry(userExperienceKey, (userExpTilldate + 1))] ++ reward) | |
216 | + | } | |
217 | + | ||
218 | + | ||
219 | + | func payAction (actionName,userAddress,amount,day) = { | |
220 | + | let composedKey = if (tryGetBoolean((("TASK_" + actionName) + "_EVERY"))) | |
221 | + | then actionName | |
222 | + | else ((actionName + "_") + toString(amount)) | |
223 | + | if (tryGetBoolean(("TASK_" + composedKey))) | |
224 | + | then hasDoneTask7Days(day, toString(userAddress), composedKey, tryGetInteger((("TASK_" + composedKey) + "_REWARD_DAILY")), tryGetInteger((("TASK_" + composedKey) + "_REWARD_WEEKLY"))) | |
225 | + | else nil | |
226 | + | } | |
227 | + | ||
228 | + | ||
229 | + | func recordActionInternal (actionName,addressCaller,address) = if (!(containsElement(scCanUseCoupons, addressCaller))) | |
230 | + | then throw("CRA: Only certain smart contracts can use this reward module!") | |
231 | + | else { | |
232 | + | let day = calculateDaysSinceStart() | |
233 | + | let actionKey = actionPerAddressPerUserPerDay(toString(address), actionName, toString(addressCaller), toString(day)) | |
234 | + | let totalActions = (tryGetInteger(actionKey) + 1) | |
235 | + | ([IntegerEntry(actionKey, totalActions)] ++ payAction(actionName, address, totalActions, day)) | |
236 | + | } | |
237 | + | ||
238 | + | ||
239 | + | @Callable(i) | |
240 | + | func configureOracle (oracle) = if ((i.caller != this)) | |
241 | + | then throw("CCO: admin only") | |
242 | + | else [StringEntry("static_oracleAddress", oracle)] | |
243 | + | ||
244 | + | ||
245 | + | ||
246 | + | @Callable(i) | |
247 | + | func addCoupons (user,amount) = if (if ((i.caller != this)) | |
248 | + | then (i.callerPublicKey != wAccPKey) | |
249 | + | else false) | |
250 | + | then throw("CAC: admin only") | |
251 | + | else if ((amount >= 10000000)) | |
252 | + | then (recordActionInternal("VEGG10000000", this, addressFromStringValue(user)) ++ addCouponsInternal(user, amount)) | |
253 | + | else if ((amount >= 500000)) | |
254 | + | then (recordActionInternal("VEGG500000", this, addressFromStringValue(user)) ++ addCouponsInternal(user, amount)) | |
255 | + | else addCouponsInternal(user, amount) | |
256 | + | ||
257 | + | ||
258 | + | ||
259 | + | @Callable(i) | |
260 | + | func resetCheater (user) = if (if ((i.caller != this)) | |
261 | + | then (i.callerPublicKey != wAccPKey) | |
262 | + | else false) | |
263 | + | then throw("CAC: admin only") | |
264 | + | else { | |
265 | + | let keyOld = couponsUserActiveOld(user) | |
266 | + | let key = couponsUserActive(user) | |
267 | + | let couponsOld = tryGetInteger(key) | |
268 | + | let coupons = -100000000 | |
269 | + | [IntegerEntry(keyOld, couponsOld), IntegerEntry(key, coupons)] | |
270 | + | } | |
271 | + | ||
272 | + | ||
273 | + | ||
274 | + | @Callable(i) | |
275 | + | func addCouponsFarming (user,amount) = if ((i.caller != getVeggFarmingAddress())) | |
276 | + | then throw("Method only for farming sc!") | |
277 | + | else addCouponsInternal(user, amount) | |
278 | + | ||
279 | + | ||
280 | + | ||
281 | + | @Callable(i) | |
282 | + | func addCouponsBatch (batch) = if (if ((i.caller != this)) | |
283 | + | then (i.callerPublicKey != wAccPKey) | |
284 | + | else false) | |
285 | + | then throw("CAC: admin only") | |
286 | + | else { | |
287 | + | let couponsList = split(batch, ";") | |
288 | + | func handleCoupon (acc,coupon) = { | |
289 | + | let splitArray = split(coupon, ":") | |
290 | + | let user = splitArray[0] | |
291 | + | let amount = parseIntValue(splitArray[1]) | |
292 | + | let burnCall = invoke(getBurnAddress(), "burnByInvoke", [amount], nil) | |
293 | + | if ((burnCall == burnCall)) | |
294 | + | then if ((amount >= 10000000)) | |
295 | + | then ((acc ++ recordActionInternal("VEGG10000000", this, addressFromStringValue(user))) ++ addCouponsInternal(user, amount)) | |
296 | + | else if ((amount >= 500000)) | |
297 | + | then ((acc ++ recordActionInternal("VEGG500000", this, addressFromStringValue(user))) ++ addCouponsInternal(user, amount)) | |
298 | + | else (acc ++ addCouponsInternal(user, amount)) | |
299 | + | else throw("Strict value is not equal to itself.") | |
300 | + | } | |
301 | + | ||
302 | + | let $l = couponsList | |
303 | + | let $s = size($l) | |
304 | + | let $acc0 = nil | |
305 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
306 | + | then $a | |
307 | + | else handleCoupon($a, $l[$i]) | |
308 | + | ||
309 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
310 | + | then $a | |
311 | + | else throw("List size exceeds 20") | |
312 | + | ||
313 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
314 | + | } | |
315 | + | ||
316 | + | ||
317 | + | ||
318 | + | @Callable(i) | |
319 | + | func CFRefund (recipient,amount) = { | |
320 | + | let cfAddress = getStringValue(i.caller, "CF_ADDRESS") | |
321 | + | let key = (("f_" + cfAddress) + "_stake_address") | |
322 | + | let stakeAddress = getStringValue(getMasterAddress(), key) | |
323 | + | if ((stakeAddress != toString(i.caller))) | |
324 | + | then throw("CCR: This is something fishy going on!") | |
325 | + | else addCouponsInternal(recipient, amount) | |
326 | + | } | |
327 | + | ||
328 | + | ||
329 | + | ||
330 | + | @Callable(i) | |
331 | + | func useCoupons (amountTryingToPay) = { | |
332 | + | let invokingSc = i.caller | |
333 | + | if ((0 > amountTryingToPay)) | |
334 | + | then throw("CUC: Only positive amount of money can be paid!") | |
335 | + | else if (!(containsElement(scCanUseCoupons, invokingSc))) | |
336 | + | then throw("CUC: Only certain smart contracts can use this coupon module!") | |
337 | + | else { | |
338 | + | let user = toString(i.originCaller) | |
339 | + | let keyActive = couponsUserActive(user) | |
340 | + | let availableCoupons = tryGetInteger(keyActive) | |
341 | + | if ((0 > availableCoupons)) | |
342 | + | then throw("CUC: Get rekt!") | |
343 | + | else { | |
344 | + | let leftToPay = if ((amountTryingToPay > availableCoupons)) | |
345 | + | then (amountTryingToPay - availableCoupons) | |
346 | + | else 0 | |
347 | + | let amountPaid = (amountTryingToPay - leftToPay) | |
348 | + | let availableCouponsLeft = (availableCoupons - amountPaid) | |
349 | + | if ((0 > availableCouponsLeft)) | |
350 | + | then throw("CUC: You try to overspend!") | |
351 | + | else { | |
352 | + | let keySpend = couponsUserSpend(user) | |
353 | + | let keyOld = couponsUserActiveOld(user) | |
354 | + | let keySpendSc = couponsSpendOnSc(toString(i.caller)) | |
355 | + | let topUp = invoke(getVeggFarmingAddress(), "topUpReward", [((amountPaid / 100) * 25)], nil) | |
356 | + | if ((topUp == topUp)) | |
357 | + | then { | |
358 | + | let totalSpend = (tryGetInteger(keySpend) + amountPaid) | |
359 | + | let totalSpendSc = (tryGetInteger(keySpendSc) + amountPaid) | |
360 | + | $Tuple2([IntegerEntry(keySpend, totalSpend), IntegerEntry(keyOld, availableCoupons), IntegerEntry(keyActive, availableCouponsLeft), IntegerEntry(keySpendSc, totalSpendSc)], amountPaid) | |
361 | + | } | |
362 | + | else throw("Strict value is not equal to itself.") | |
363 | + | } | |
364 | + | } | |
365 | + | } | |
366 | + | } | |
367 | + | ||
368 | + | ||
369 | + | ||
370 | + | @Callable(i) | |
371 | + | func recordAction (actionName) = recordActionInternal(actionName, i.caller, i.originCaller) | |
372 | + | ||
373 | + | ||
374 | + | ||
375 | + | @Callable(i) | |
376 | + | func increaseExp (address) = if ((i.caller != getItemsAddress())) | |
377 | + | then nil | |
378 | + | else { | |
379 | + | let userExperienceKey = userExperience(address) | |
380 | + | let userExpTilldate = tryGetInteger(userExperienceKey) | |
381 | + | [IntegerEntry(userExperienceKey, (userExpTilldate + 1))] | |
382 | + | } | |
383 | + | ||
384 | + | ||
385 | + | @Verifier(tx) | |
386 | + | func verify () = if (isTestEnv()) | |
387 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
388 | + | else { | |
389 | + | let firstUser = base58'6TdaXEfhnjYquvPf3yV7MFxt2CbgFmaqsvGwkKfXtKi4' | |
390 | + | let secondUser = base58'7DsP2WaMLocbHuUxux7pbXRjTrrZ1TFQPsi5QumS3gr8' | |
391 | + | let thirdUser = base58'BpFWP3p3JgYrrP45xfrKzeMcWMEXoinj4FVPPkUiA8D3' | |
392 | + | let firstUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], firstUser)) | |
393 | + | then 1 | |
394 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[1], firstUser)) | |
395 | + | then 1 | |
396 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[2], firstUser)) | |
397 | + | then 1 | |
398 | + | else 0 | |
399 | + | let secondUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], secondUser)) | |
400 | + | then 1 | |
401 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[1], secondUser)) | |
402 | + | then 1 | |
403 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[2], secondUser)) | |
404 | + | then 1 | |
405 | + | else 0 | |
406 | + | let thirdUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], thirdUser)) | |
407 | + | then 1 | |
408 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[1], thirdUser)) | |
409 | + | then 1 | |
410 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[2], thirdUser)) | |
411 | + | then 1 | |
412 | + | else 0 | |
413 | + | let signaturesCount = ((firstUserSigned + secondUserSigned) + thirdUserSigned) | |
414 | + | match tx { | |
415 | + | case _ => | |
416 | + | (signaturesCount >= 2) | |
417 | + | } | |
418 | + | } | |
419 | + |
github/deemru/w8io/026f985 27.34 ms ◑