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