tx · CCgS19BncMyg3z4D12fLnUpD59MDxyqpYXppA6947wYg 3MpLKSQezEyHJk8jn9ikzAaaGuRzy5STBLZ: -0.01900000 Waves 2024.11.09 00:28 [3363023] smart account 3MpLKSQezEyHJk8jn9ikzAaaGuRzy5STBLZ > SELF 0.00000000 Waves
{ "type": 13, "id": "CCgS19BncMyg3z4D12fLnUpD59MDxyqpYXppA6947wYg", "fee": 1900000, "feeAssetId": null, "timestamp": 1731101335330, "version": 2, "chainId": 84, "sender": "3MpLKSQezEyHJk8jn9ikzAaaGuRzy5STBLZ", "senderPublicKey": "GhefFZdofgfUzRS6kfAZpyXdgER7eYvz5umnwJW1MWtc", "proofs": [ "Dwbou2usMVbEErK3L1QYx16UBYsKEPD1WuhTp7VxiQiLdS5ikukCnGqgjXPoSHKj1BjxRCgPwfhPtw6852fUusd" ], "script": "base64:BgIkCAISAwoBCBIAEgMKAQgSBQoDCAgBEgYKBAgIAQESAwoBCBIAPQEUdHJ5R2V0U3RyaW5nRXh0ZXJuYWwCB2FkZHJlc3MDa2V5BAckbWF0Y2gwCQCdCAIFB2FkZHJlc3MFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAWEFByRtYXRjaDAFAWECAAEVdHJ5R2V0SW50ZWdlckV4dGVybmFsAgdhZGRyZXNzA2tleQQHJG1hdGNoMAkAmggCBQdhZGRyZXNzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAABDXRyeUdldEJvb2xlYW4BA2tleQQHJG1hdGNoMAkAoAgBBQNrZXkDCQABAgUHJG1hdGNoMAIHQm9vbGVhbgQBYgUHJG1hdGNoMAUBYgcBDHRyeUdldFN0cmluZwEDa2V5CQEUdHJ5R2V0U3RyaW5nRXh0ZXJuYWwCBQR0aGlzBQNrZXkBCWFzQm9vbGVhbgEFdmFsdWUEByRtYXRjaDAFBXZhbHVlAwkAAQIFByRtYXRjaDACB0Jvb2xlYW4EB2Jvb2xlYW4FByRtYXRjaD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pcnN0VXNlcgABAAAEEHNlY29uZFVzZXJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQpzZWNvbmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQpzZWNvbmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQpzZWNvbmRVc2VyAAEAAAQPdGhpcmRVc2VyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUJdGhpcmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQl0aGlyZFVzZXIAAQMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFCXRoaXJkVXNlcgABAAAED3NpZ25hdHVyZXNDb3VudAkAZAIJAGQCBQ9maXJzdFVzZXJTaWduZWQFEHNlY29uZFVzZXJTaWduZWQFD3RoaXJkVXNlclNpZ25lZAQHJG1hdGNoMAUCdHgJAGcCBQ9zaWduYXR1cmVzQ291bnQAAsGS5QQ=", "height": 3363023, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B9FtbuU6sdRypdPrkB8ajHpb6pqoCSitfemF4saShyWA Next: none Diff:
Old | New | Differences | |
---|---|---|---|
466 | 466 | let address = toString(i.caller) | |
467 | 467 | let txId = toBase58String(i.transactionId) | |
468 | 468 | let lastIssuedDucklingTs = tryGetInteger(KGlobalIssuedTimestamp) | |
469 | - | let fiveMinInMs = ((1 * 30) * 1000) | |
469 | + | let fiveMinInMs = if (isTestEnv()) | |
470 | + | then 0 | |
471 | + | else ((1 * 30) * 1000) | |
470 | 472 | let timeDiff = (lastBlock.timestamp - (lastIssuedDucklingTs + fiveMinInMs)) | |
471 | 473 | if (if ((lastIssuedDucklingTs > 0)) | |
472 | 474 | then (0 > timeDiff) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func tryGetStringExternal (address,key) = match getString(address, key) { | |
5 | 5 | case a: String => | |
6 | 6 | a | |
7 | 7 | case _ => | |
8 | 8 | "" | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func tryGetIntegerExternal (address,key) = match getInteger(address, key) { | |
13 | 13 | case b: Int => | |
14 | 14 | b | |
15 | 15 | case _ => | |
16 | 16 | 0 | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func tryGetBoolean (key) = match getBoolean(key) { | |
21 | 21 | case b: Boolean => | |
22 | 22 | b | |
23 | 23 | case _ => | |
24 | 24 | false | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func tryGetString (key) = tryGetStringExternal(this, key) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func asBoolean (value) = match value { | |
32 | 32 | case boolean: Boolean => | |
33 | 33 | boolean | |
34 | 34 | case _ => | |
35 | 35 | throw("BDA: wrong type, expected: Boolean") | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func staticKey_oracleAddress () = "static_oracleAddress" | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func staticKey_ducklingPrice () = "static_ducklingPrice" | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func staticKey_eggAssetId () = "static_eggAssetId" | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func staticKey_spiceAssetId () = "static_spiceAssetId" | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func staticKey_rebirthAddress () = "static_rebirthAddress" | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func staticKey_incubatorAddress () = "static_incubatorAddress" | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func staticKey_couponsAddress () = "static_couponsAddress" | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func staticKey_burnAddress () = "static_burnAddress" | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func staticKey_refContractAddress () = "static_refContractAddress" | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func staticKey_backendPubKey () = "static_backendPubKey" | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func staticKey_extraFee () = "static_extraFee" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func staticKey_feeAggregator () = "static_feeAggregator" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func staticKey_turtleStakingAddress () = "static_turtleStakingAddress" | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func staticKey_mutantFarmingAddress () = "static_mutantFarmingAddress" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func staticKey_canineRebirthAddress () = "static_canineRebirthAddress" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func staticKey_felineRebirthAddress () = "static_felineRebirthAddress" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func getOracle () = Address(fromBase58String(tryGetString(staticKey_oracleAddress()))) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func getDucklingPrice () = tryGetIntegerExternal(getOracle(), staticKey_ducklingPrice()) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func getEggAssetId () = fromBase58String(tryGetStringExternal(getOracle(), staticKey_eggAssetId())) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func getSpiceAssetId () = fromBase58String(tryGetStringExternal(getOracle(), staticKey_spiceAssetId())) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getRebirthAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_rebirthAddress()))) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func getIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_incubatorAddress()))) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func getCouponsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_couponsAddress()))) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func getBurnAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_burnAddress()))) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getRefContractAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_refContractAddress()))) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getFeeAggregator () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_feeAggregator()))) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getTurtleStakingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_turtleStakingAddress()))) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func getMutantFarmingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_mutantFarmingAddress()))) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func getCanineRebirthAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_canineRebirthAddress()))) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getFelineRebirthAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_felineRebirthAddress()))) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | let backendPubKey = fromBase58String(getStringValue(getOracle(), staticKey_backendPubKey())) | |
130 | 130 | ||
131 | 131 | let DUCKLINGPRICE = 100000000 | |
132 | 132 | ||
133 | 133 | let percentGrowthPrecision = 10000000000000000 | |
134 | 134 | ||
135 | 135 | let oneSpicePrecsion = 100000000000000 | |
136 | 136 | ||
137 | 137 | let KGlobalIssuedTimestamp = "global_issued_timestamp" | |
138 | 138 | ||
139 | 139 | let DUCKLINGPRICEOLD = 80000000 | |
140 | 140 | ||
141 | 141 | let percentGrowthPrecisionOld = 10000000000000000 | |
142 | 142 | ||
143 | 143 | func checkAdditionalPayment (payment) = if (isDefined(payment.assetId)) | |
144 | 144 | then throw("BDCAP: Please attach waves") | |
145 | 145 | else { | |
146 | 146 | let feeAmount = getIntegerValue(getOracle(), staticKey_extraFee()) | |
147 | 147 | if ((payment.amount != feeAmount)) | |
148 | 148 | then throw((("BDCAP: Please attach exactly " + toString(feeAmount)) + " amount of wavelets")) | |
149 | 149 | else [ScriptTransfer(getFeeAggregator(), feeAmount, unit)] | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func keyTotalFeedOld (ducklingId) = (("duckling_" + ducklingId) + "_feed") | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func keyTotalFeed (ducklingId) = (("duckling_" + ducklingId) + "_feed_spice") | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func keyTotalFeedUser (address) = (("user_" + address) + "_feed") | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func keyAddressNonce (address) = (("address_" + address) + "_nonce") | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func keyDucklingLevel (ducklingId) = (("duckling_" + ducklingId) + "_level") | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func keyDucklingGrown (ducklingId) = (("duckling_" + ducklingId) + "_grown") | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func keyStartPercentage (ducklingId) = (("duckling_" + ducklingId) + "_startPercentage") | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func keyOwner (ducklingId) = (("duckling_" + ducklingId) + "_owner") | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func keyBlacklisted (ducklingId) = (("duckling_" + ducklingId) + "_blacklisted") | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func keyAmountOfAdultDuckling () = "adult_ducklings" | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func tryGetInteger (key) = { | |
184 | 184 | let val = match getInteger(this, key) { | |
185 | 185 | case b: Int => | |
186 | 186 | b | |
187 | 187 | case _ => | |
188 | 188 | 0 | |
189 | 189 | } | |
190 | 190 | val | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func getBool (key) = match getBoolean(this, key) { | |
195 | 195 | case b: Boolean => | |
196 | 196 | b | |
197 | 197 | case _ => | |
198 | 198 | false | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func isTestEnv () = getBool("TESTENV") | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func getDucklingPercentage (ducklingId) = { | |
206 | 206 | let percentageDuckling = tryGetInteger(keyStartPercentage(ducklingId)) | |
207 | 207 | let base = if ((percentageDuckling != 0)) | |
208 | 208 | then percentageDuckling | |
209 | 209 | else 5 | |
210 | 210 | toBigInt((base * oneSpicePrecsion)) | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func getCurrentLevelBigInt (ducklingId) = { | |
215 | 215 | let kDuckLevel = keyDucklingLevel(ducklingId) | |
216 | 216 | match getString(kDuckLevel) { | |
217 | 217 | case s: String => | |
218 | 218 | parseBigIntValue(s) | |
219 | 219 | case _ => | |
220 | 220 | match getBoolean((("duckling_" + ducklingId) + "_issuedByFeedCall")) { | |
221 | 221 | case b: Boolean => | |
222 | 222 | if (if ((b == true)) | |
223 | 223 | then (tryGetInteger(keyStartPercentage(ducklingId)) == 0) | |
224 | 224 | else false) | |
225 | 225 | then toBigInt(0) | |
226 | 226 | else getDucklingPercentage(ducklingId) | |
227 | 227 | case _ => | |
228 | 228 | getDucklingPercentage(ducklingId) | |
229 | 229 | } | |
230 | 230 | } | |
231 | 231 | } | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func calculateNewDucklingLevel (ducklingId,paymentAmount) = { | |
235 | 235 | let currentTs = lastBlock.timestamp | |
236 | 236 | let growth = (fraction(toBigInt(paymentAmount), toBigInt(percentGrowthPrecision), toBigInt(DUCKLINGPRICE)) / toBigInt(100)) | |
237 | 237 | let currentLevel = getCurrentLevelBigInt(ducklingId) | |
238 | 238 | let newLevel = (currentLevel + growth) | |
239 | 239 | let result = toString(newLevel) | |
240 | 240 | $Tuple2(result, [("currentLevel=" + toString(currentLevel)), ("newLevel=" + toString(newLevel)), ("growth=" + toString(growth))]) | |
241 | 241 | } | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func getBackendProof (maxFeedAmount,userNonce,address) = makeString([toString(maxFeedAmount), toString(userNonce), address], ";") | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func asInt (value) = match value { | |
248 | 248 | case int: Int => | |
249 | 249 | int | |
250 | 250 | case _ => | |
251 | 251 | throw("BAI: wrong type, expected: Int") | |
252 | 252 | } | |
253 | 253 | ||
254 | 254 | ||
255 | 255 | @Callable(i) | |
256 | 256 | func configureOracle (oracle) = if ((i.caller != this)) | |
257 | 257 | then throw("BCO: admin only") | |
258 | 258 | else [StringEntry(staticKey_oracleAddress(), oracle)] | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | ||
262 | 262 | @Callable(i) | |
263 | 263 | func calculateDucklingPriceTwoDecimals () = { | |
264 | 264 | let x = tryGetInteger(keyAmountOfAdultDuckling()) | |
265 | 265 | let price = max([(1900 + pow(x, 0, 6, 1, 2, HALFUP)), 10000]) | |
266 | 266 | $Tuple2([StringEntry("DEBUG_PRICE", toString(price))], price) | |
267 | 267 | } | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | ||
271 | 271 | @Callable(i) | |
272 | 272 | func buyDuckling (refererAddress) = { | |
273 | 273 | let feeValidate = checkAdditionalPayment(i.payments[0]) | |
274 | 274 | if ((feeValidate == feeValidate)) | |
275 | 275 | then { | |
276 | 276 | let exactPrice = getDucklingPrice() | |
277 | 277 | if ((50000000 > exactPrice)) | |
278 | 278 | then throw("BBD: Invalid price from oracle!") | |
279 | 279 | else { | |
280 | 280 | let amountPaidByCoupons = asInt(invoke(getCouponsAddress(), "useCoupons", [exactPrice], nil)) | |
281 | 281 | if ((amountPaidByCoupons == amountPaidByCoupons)) | |
282 | 282 | then { | |
283 | 283 | let leftToPay = (exactPrice - amountPaidByCoupons) | |
284 | 284 | let payment = if ((leftToPay != 0)) | |
285 | 285 | then { | |
286 | 286 | let firstPayment = value(i.payments[1]) | |
287 | 287 | if ((firstPayment.assetId != getEggAssetId())) | |
288 | 288 | then throw(("BBD: You can attach only EGG tokens with the following asset id: " + toBase58String(getEggAssetId()))) | |
289 | 289 | else if ((firstPayment.amount != leftToPay)) | |
290 | 290 | then throw(("BBD: To buy a perch you currently need the following amount of EGGlets: " + toString(leftToPay))) | |
291 | 291 | else { | |
292 | 292 | let refererRewardForPerch = fraction(leftToPay, 5, 100) | |
293 | 293 | let refCall = asBoolean(invoke(getRefContractAddress(), "refPayment", [refererAddress], [AttachedPayment(getEggAssetId(), refererRewardForPerch)])) | |
294 | 294 | if ((refCall == refCall)) | |
295 | 295 | then { | |
296 | 296 | let toBurn = if (refCall) | |
297 | 297 | then (leftToPay - refererRewardForPerch) | |
298 | 298 | else leftToPay | |
299 | 299 | let burnCall = invoke(getBurnAddress(), "burnAttachedPayments", nil, [AttachedPayment(getEggAssetId(), toBurn)]) | |
300 | 300 | if ((burnCall == burnCall)) | |
301 | 301 | then leftToPay | |
302 | 302 | else throw("Strict value is not equal to itself.") | |
303 | 303 | } | |
304 | 304 | else throw("Strict value is not equal to itself.") | |
305 | 305 | } | |
306 | 306 | } | |
307 | 307 | else 0 | |
308 | 308 | if ((payment == payment)) | |
309 | 309 | then { | |
310 | 310 | let ducklingAssetId = invoke(this, "issueFreeDuckling", [toString(i.originCaller), toBase58String(i.transactionId), 0], nil) | |
311 | 311 | if ((ducklingAssetId == ducklingAssetId)) | |
312 | 312 | then feeValidate | |
313 | 313 | else throw("Strict value is not equal to itself.") | |
314 | 314 | } | |
315 | 315 | else throw("Strict value is not equal to itself.") | |
316 | 316 | } | |
317 | 317 | else throw("Strict value is not equal to itself.") | |
318 | 318 | } | |
319 | 319 | } | |
320 | 320 | else throw("Strict value is not equal to itself.") | |
321 | 321 | } | |
322 | 322 | ||
323 | 323 | ||
324 | 324 | ||
325 | 325 | @Callable(i) | |
326 | 326 | func issueFreeDuckling (address,txIdStr,percentage) = if (if (if (if ((i.caller != this)) | |
327 | 327 | then (i.caller != getRebirthAddress()) | |
328 | 328 | else false) | |
329 | 329 | then (i.caller != getCanineRebirthAddress()) | |
330 | 330 | else false) | |
331 | 331 | then (i.caller != getFelineRebirthAddress()) | |
332 | 332 | else false) | |
333 | 333 | then throw("BIFD: You can't issue free duckling") | |
334 | 334 | else { | |
335 | 335 | let asset = Issue("BABY-11111111-GZ", "", 1, 0, false, unit, height) | |
336 | 336 | let assetId = calculateAssetId(asset) | |
337 | 337 | $Tuple2([StringEntry((((address + "_") + txIdStr) + "_di"), toBase58String(assetId)), IntegerEntry("stats_amount", (tryGetInteger("stats_amount") + 1)), IntegerEntry(keyStartPercentage(toBase58String(assetId)), percentage), StringEntry(keyOwner(toBase58String(assetId)), address), asset, ScriptTransfer(value(addressFromString(address)), 1, assetId)], toBase58String(assetId)) | |
338 | 338 | } | |
339 | 339 | ||
340 | 340 | ||
341 | 341 | ||
342 | 342 | @Callable(i) | |
343 | 343 | func feedDuckling (ducklingId,backendSignature,maxFeedAmount,userNonce) = { | |
344 | 344 | let feeValidate = checkAdditionalPayment(i.payments[1]) | |
345 | 345 | if ((feeValidate == feeValidate)) | |
346 | 346 | then { | |
347 | 347 | let addressString = toString(i.caller) | |
348 | 348 | let backendProof = getBackendProof(maxFeedAmount, userNonce, addressString) | |
349 | 349 | let kAddressNonce = keyAddressNonce(addressString) | |
350 | 350 | let currentNonce = tryGetInteger(kAddressNonce) | |
351 | 351 | let realDucklingId = if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey))) | |
352 | 352 | then throw("BFD: Invalid proof from backend") | |
353 | 353 | else if (if ((size(i.payments) != 2)) | |
354 | 354 | then true | |
355 | 355 | else (value(i.payments[0]).assetId != getSpiceAssetId())) | |
356 | 356 | then throw("BFD: Bad payment attached (asset[s] or amount)") | |
357 | 357 | else if (getBool(keyDucklingGrown(ducklingId))) | |
358 | 358 | then throw("BFD: Duckling is already grown") | |
359 | 359 | else if ((userNonce != (currentNonce + 1))) | |
360 | 360 | then throw(((("BFD: User Nonce should be " + toString(currentNonce)) + " + 1, while received ") + toString(userNonce))) | |
361 | 361 | else { | |
362 | 362 | let blackListed = tryGetBoolean(keyBlacklisted(ducklingId)) | |
363 | 363 | if (blackListed) | |
364 | 364 | then throw("BFD: Can not feed blacklisted duckling!") | |
365 | 365 | else if ((ducklingId == "")) | |
366 | 366 | then throw("BFD: Please buy a duckling first!") | |
367 | 367 | else { | |
368 | 368 | let ducklingIdCheck = value(assetInfo(fromBase58String(ducklingId))) | |
369 | 369 | if ((assetBalance(i.caller, ducklingIdCheck.id) != 1)) | |
370 | 370 | then throw("BFD: You're not the owner of the duckling") | |
371 | 371 | else if ((ducklingIdCheck.issuer != this)) | |
372 | 372 | then throw("BFD: Cant find duckling with such id") | |
373 | 373 | else toBase58String(ducklingIdCheck.id) | |
374 | 374 | } | |
375 | 375 | } | |
376 | 376 | let currentPayment = value(i.payments[0]).amount | |
377 | 377 | let kNewLevel = keyDucklingLevel(realDucklingId) | |
378 | 378 | let kTotalFeed = keyTotalFeed(realDucklingId) | |
379 | 379 | let kTotalFeedUser = keyTotalFeedUser(addressString) | |
380 | 380 | let totalFeed = tryGetInteger(kTotalFeed) | |
381 | 381 | let totalFeedUser = tryGetInteger(kTotalFeedUser) | |
382 | 382 | let kFeedTxStats = ((("duckling_" + realDucklingId) + "_stat_") + toString(lastBlock.timestamp)) | |
383 | 383 | if ((currentPayment > maxFeedAmount)) | |
384 | 384 | then throw(("BFD: Cannot feed duckling for such amount, max feed amount is: " + toString(maxFeedAmount))) | |
385 | 385 | else { | |
386 | 386 | let calculateResults = calculateNewDucklingLevel(realDucklingId, currentPayment) | |
387 | 387 | let ducklingOwner = tryGetString(keyOwner(realDucklingId)) | |
388 | 388 | let topup = invoke(getTurtleStakingAddress(), "topUpReward", nil, [AttachedPayment(getSpiceAssetId(), (currentPayment / 2))]) | |
389 | 389 | if ((topup == topup)) | |
390 | 390 | then { | |
391 | 391 | let topup2 = invoke(getMutantFarmingAddress(), "topUpReward", ["SPICE", 0], [AttachedPayment(getSpiceAssetId(), (currentPayment / 10))]) | |
392 | 392 | if ((topup2 == topup2)) | |
393 | 393 | then { | |
394 | 394 | let recordAction = if ((currentPayment >= 1000000000)) | |
395 | 395 | then invoke(getCouponsAddress(), "recordAction", ["FEEDDUCKLING10"], nil) | |
396 | 396 | else nil | |
397 | 397 | if ((recordAction == recordAction)) | |
398 | 398 | then if (if ((ducklingOwner != toString(i.caller))) | |
399 | 399 | then !(isTestEnv()) | |
400 | 400 | else false) | |
401 | 401 | then ([BooleanEntry(keyBlacklisted(realDucklingId), true)] ++ feeValidate) | |
402 | 402 | else ([IntegerEntry(kAddressNonce, (currentNonce + 1)), IntegerEntry(kTotalFeed, (totalFeed + currentPayment)), IntegerEntry(kTotalFeedUser, (totalFeedUser + currentPayment)), IntegerEntry(kFeedTxStats, currentPayment), StringEntry(kNewLevel, calculateResults._1), StringEntry((kFeedTxStats + "_debug"), makeString(calculateResults._2, ";")), Burn(getSpiceAssetId(), ((currentPayment / 2) - (currentPayment / 10)))] ++ feeValidate) | |
403 | 403 | else throw("Strict value is not equal to itself.") | |
404 | 404 | } | |
405 | 405 | else throw("Strict value is not equal to itself.") | |
406 | 406 | } | |
407 | 407 | else throw("Strict value is not equal to itself.") | |
408 | 408 | } | |
409 | 409 | } | |
410 | 410 | else throw("Strict value is not equal to itself.") | |
411 | 411 | } | |
412 | 412 | ||
413 | 413 | ||
414 | 414 | ||
415 | 415 | @Callable(i) | |
416 | 416 | func fixLevels (ducklingIds) = if (if ((i.callerPublicKey != base58'GDxBbsDRmeY39quNrDsTXKJzFWbQVtjxHseF4ikxZ7n9')) | |
417 | 417 | then (i.caller != this) | |
418 | 418 | else false) | |
419 | 419 | then throw("BFL: Not authorized") | |
420 | 420 | else { | |
421 | 421 | let ducklingIdsList = value(split(ducklingIds, ",")) | |
422 | 422 | func handleId (acc,id) = { | |
423 | 423 | let kTotalFeed = keyTotalFeed(id) | |
424 | 424 | let totalFeed = tryGetInteger(kTotalFeed) | |
425 | 425 | let kTotalFeedOld = keyTotalFeedOld(id) | |
426 | 426 | let totalFeedOld = tryGetInteger(kTotalFeedOld) | |
427 | 427 | let kNewLevel = keyDucklingLevel(id) | |
428 | 428 | let startingLevel = match getBoolean((("duckling_" + id) + "_issuedByFeedCall")) { | |
429 | 429 | case b: Boolean => | |
430 | 430 | if (if ((b == true)) | |
431 | 431 | then (tryGetInteger(keyStartPercentage(id)) == 0) | |
432 | 432 | else false) | |
433 | 433 | then toBigInt(0) | |
434 | 434 | else getDucklingPercentage(id) | |
435 | 435 | case _ => | |
436 | 436 | getDucklingPercentage(id) | |
437 | 437 | } | |
438 | 438 | let growth = fraction(toBigInt((totalFeed / 100)), toBigInt(percentGrowthPrecision), toBigInt(DUCKLINGPRICE)) | |
439 | 439 | let growthOld = if ((totalFeedOld != 0)) | |
440 | 440 | then fraction(toBigInt(totalFeedOld), toBigInt(percentGrowthPrecisionOld), toBigInt(DUCKLINGPRICEOLD)) | |
441 | 441 | else toBigInt(0) | |
442 | 442 | (acc ++ [StringEntry(kNewLevel, toString(((startingLevel + growth) + growthOld))), StringEntry("DEBUG", ((((toString(startingLevel) + " ") + toString(growth)) + " ") + toString(growthOld)))]) | |
443 | 443 | } | |
444 | 444 | ||
445 | 445 | let $l = ducklingIdsList | |
446 | 446 | let $s = size($l) | |
447 | 447 | let $acc0 = nil | |
448 | 448 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
449 | 449 | then $a | |
450 | 450 | else handleId($a, $l[$i]) | |
451 | 451 | ||
452 | 452 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
453 | 453 | then $a | |
454 | 454 | else throw("List size exceeds 20") | |
455 | 455 | ||
456 | 456 | $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) | |
457 | 457 | } | |
458 | 458 | ||
459 | 459 | ||
460 | 460 | ||
461 | 461 | @Callable(i) | |
462 | 462 | func turnDucklingIntoDuck () = { | |
463 | 463 | let feeValidate = checkAdditionalPayment(i.payments[1]) | |
464 | 464 | if ((feeValidate == feeValidate)) | |
465 | 465 | then { | |
466 | 466 | let address = toString(i.caller) | |
467 | 467 | let txId = toBase58String(i.transactionId) | |
468 | 468 | let lastIssuedDucklingTs = tryGetInteger(KGlobalIssuedTimestamp) | |
469 | - | let fiveMinInMs = ((1 * 30) * 1000) | |
469 | + | let fiveMinInMs = if (isTestEnv()) | |
470 | + | then 0 | |
471 | + | else ((1 * 30) * 1000) | |
470 | 472 | let timeDiff = (lastBlock.timestamp - (lastIssuedDucklingTs + fiveMinInMs)) | |
471 | 473 | if (if ((lastIssuedDucklingTs > 0)) | |
472 | 474 | then (0 > timeDiff) | |
473 | 475 | else false) | |
474 | 476 | then throw((("BTD: Can issue ducklings only once per 30s, please wait for " + toString(fraction(timeDiff, 1, 1000))) + " sec.")) | |
475 | 477 | else if ((size(i.payments) != 2)) | |
476 | 478 | then throw("BTD: Bad payment attached (asset[s] or amount)") | |
477 | 479 | else if ((i.payments[0].amount != 1)) | |
478 | 480 | then throw("BTD: Please attach a nft!") | |
479 | 481 | else { | |
480 | 482 | let pmt = value(assetInfo(value(value(i.payments[0]).assetId))) | |
481 | 483 | let blackListed = tryGetBoolean(keyBlacklisted(toBase58String(pmt.id))) | |
482 | 484 | if (blackListed) | |
483 | 485 | then throw("BTD: Can not convert blacklisted duckling!") | |
484 | 486 | else { | |
485 | 487 | let adultPriceCall = asInt(invoke(this, "calculateDucklingPriceTwoDecimals", nil, nil)) | |
486 | 488 | if ((adultPriceCall == adultPriceCall)) | |
487 | 489 | then { | |
488 | 490 | let normalizedPrice = fraction(adultPriceCall, oneSpicePrecsion, 100) | |
489 | 491 | if ((toBigInt(normalizedPrice) > getCurrentLevelBigInt(toBase58String(pmt.id)))) | |
490 | 492 | then throw("BTD: Duckling is not grown yet...") | |
491 | 493 | else if ((pmt.issuer != this)) | |
492 | 494 | then throw("BTD: Can use only ducklings from this dApp") | |
493 | 495 | else { | |
494 | 496 | let call = invoke(getIncubatorAddress(), "startDuckHatching", [""], nil) | |
495 | 497 | if ((call == call)) | |
496 | 498 | then { | |
497 | 499 | let kDucklingGrown = keyDucklingGrown(toBase58String(pmt.id)) | |
498 | 500 | ([BooleanEntry(kDucklingGrown, true), IntegerEntry(KGlobalIssuedTimestamp, lastBlock.timestamp), IntegerEntry(keyAmountOfAdultDuckling(), (tryGetInteger(keyAmountOfAdultDuckling()) + 1))] ++ feeValidate) | |
499 | 501 | } | |
500 | 502 | else throw("Strict value is not equal to itself.") | |
501 | 503 | } | |
502 | 504 | } | |
503 | 505 | else throw("Strict value is not equal to itself.") | |
504 | 506 | } | |
505 | 507 | } | |
506 | 508 | } | |
507 | 509 | else throw("Strict value is not equal to itself.") | |
508 | 510 | } | |
509 | 511 | ||
510 | 512 | ||
511 | 513 | @Verifier(tx) | |
512 | 514 | func verify () = if (isTestEnv()) | |
513 | 515 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
514 | 516 | else { | |
515 | 517 | let firstUser = base58'6TdaXEfhnjYquvPf3yV7MFxt2CbgFmaqsvGwkKfXtKi4' | |
516 | 518 | let secondUser = base58'7DsP2WaMLocbHuUxux7pbXRjTrrZ1TFQPsi5QumS3gr8' | |
517 | 519 | let thirdUser = base58'BpFWP3p3JgYrrP45xfrKzeMcWMEXoinj4FVPPkUiA8D3' | |
518 | 520 | let firstUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], firstUser)) | |
519 | 521 | then 1 | |
520 | 522 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], firstUser)) | |
521 | 523 | then 1 | |
522 | 524 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], firstUser)) | |
523 | 525 | then 1 | |
524 | 526 | else 0 | |
525 | 527 | let secondUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], secondUser)) | |
526 | 528 | then 1 | |
527 | 529 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], secondUser)) | |
528 | 530 | then 1 | |
529 | 531 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], secondUser)) | |
530 | 532 | then 1 | |
531 | 533 | else 0 | |
532 | 534 | let thirdUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], thirdUser)) | |
533 | 535 | then 1 | |
534 | 536 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], thirdUser)) | |
535 | 537 | then 1 | |
536 | 538 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], thirdUser)) | |
537 | 539 | then 1 | |
538 | 540 | else 0 | |
539 | 541 | let signaturesCount = ((firstUserSigned + secondUserSigned) + thirdUserSigned) | |
540 | 542 | match tx { | |
541 | 543 | case _ => | |
542 | 544 | (signaturesCount >= 2) | |
543 | 545 | } | |
544 | 546 | } | |
545 | 547 |
github/deemru/w8io/026f985 45.18 ms ◑