tx · 2xy7nu1D54u3z7Q7asLBd1kxuxQEGWmcpncedhaLdHBZ

3N7oEUCqnxK6nSvaphxc9VbsUvNNeX4pvV6:  -0.01000000 Waves

2022.05.05 10:57 [2038138] smart account 3N7oEUCqnxK6nSvaphxc9VbsUvNNeX4pvV6 > SELF 0.00000000 Waves

{ "type": 13, "id": "2xy7nu1D54u3z7Q7asLBd1kxuxQEGWmcpncedhaLdHBZ", "fee": 1000000, "feeAssetId": null, "timestamp": 1651737490060, "version": 2, "chainId": 84, "sender": "3N7oEUCqnxK6nSvaphxc9VbsUvNNeX4pvV6", "senderPublicKey": "BUFEu7JZr2y8QBFRwA3vLU8gzDnSgD8uSz9YcHu8vog4", "proofs": [ "22hkeQRcwKuaJoF7zJRph9ZgK5Y9GR7pjyX1o1gqzf1cq4zMFM983h9zpFJC8g9LtPCwgrmacqT9acwmrwsLyG29" ], "script": "base64:AAIFAAAAAAAAABcIAhIECgIICBIGCgQICAEBEgMKAQgSAAAAAB0AAAAADnJlYmlydGhBZGRyZXNzAQAAABoBV3CRddSe63o+H/lkADDI3EZdXJpE33XC9wAAAAAQaW5jdWJhdG9yQWRkcmVzcwEAAAAaAVeMtUiffp4V1RiXjht3+wl/Z2La4W1jJUkAAAAADWJhY2tlbmRQdWJLZXkBAAAAIJ/u9pS34AlL2xW1JDjPBq7tIL/E6huecGxiSXTybOIcAAAAAA5TVEFSVFRJTUVTVEFNUAAAAAF8FwhqgAAAAAAJTEFQTEVOR1RIAAAAAAABSZcAAAAAAApFR0dBU1NFVElEAQAAACCjn39PI3JR0SziIZJiiE0MC/PqIm6B1a/8C5MXzm2xyQAAAAANRFVDS0xJTkdQUklDRQAAAAAABMS0AAAAAAAWcGVyY2VudEdyb3d0aFByZWNpc2lvbgAAI4byb8EAAAAAAAAVZXhpc3RpbmdEdWNrUHJlY2lzaW9uAAAAWvMQekAAAAAAABZLR2xvYmFsSXNzdWVkVGltZXN0YW1wAgAAABdnbG9iYWxfaXNzdWVkX3RpbWVzd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RjaGluZwkABEwAAAACAgAAAAAFAAAAA25pbAUAAAADbmlsAwkAAAAAAAACBQAAAARjYWxsBQAAAARjYWxsBAAAAA5rRHVja2xpbmdHcm93bgkBAAAAEGtleUR1Y2tsaW5nR3Jvd24AAAABCQACWAAAAAEIBQAAAANwbXQAAAACaWQJAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAIFAAAADmtEdWNrbGluZ0dyb3duBgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAWS0dsb2JhbElzc3VlZFRpbWVzdGFtcAgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRnZco8=", "height": 2038138, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let rebirthAddress = base58'3PCC6fVHNa6289DTDmcUo3RuLaFmteZZsmQ'
5+
6+let incubatorAddress = base58'3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv'
7+
8+let backendPubKey = base58'BmKAXRQy7jZm44fa1YxNQDTcAwNSb74EpQwP5CT7UHdV'
9+
10+let STARTTIMESTAMP = 1632474000000
11+
12+let LAPLENGTH = 21600000
13+
14+let EGGASSETID = base58'C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS'
15+
16+let DUCKLINGPRICE = 80000000
17+
18+let percentGrowthPrecision = 10000000000000000
19+
20+let existingDuckPrecision = 100000000000000
21+
22+let KGlobalIssuedTimestamp = "global_issued_timestamp"
23+
24+let MSINDAY = 86400000
25+
26+func keyTotalFeed (ducklingId) = (("duckling_" + ducklingId) + "_feed")
27+
28+
29+func keyDucklingFedLap (ducklingId) = (("duckling_" + ducklingId) + "_fedLap")
30+
31+
32+func keyDucklingFedTimestamp (ducklingId) = (("duckling_" + ducklingId) + "_fedTs")
33+
34+
35+func keyDucklingFedLapTimestamp (ducklingId,lap) = (((("duckling_" + ducklingId) + "_lap_") + toString(lap)) + "_fedTs")
36+
37+
38+func keyAddressFedTimestamp (address,lap,timestamp) = ((((("address_" + address) + "_lap_") + toString(lap)) + "_fedTs_") + toString(timestamp))
39+
40+
41+func keyAddressNonce (address) = (("address_" + address) + "_nonce")
42+
43+
44+func keyDucklingFedLastTimestamp (ducklingId) = (("duckling_" + ducklingId) + "_fedLastTs")
45+
46+
47+func keyDucklingLevel (ducklingId) = (("duckling_" + ducklingId) + "_level")
48+
49+
50+func keyFeedForLap (address,lap) = (((("address_" + address) + "_lap_") + toString(lap)) + "_feed")
51+
52+
53+func keyDucklingGrown (ducklingId) = (("duckling_" + ducklingId) + "_grown")
54+
55+
56+func keyStartHatchingId (ducklingId) = (("duckling_" + ducklingId) + "_grown")
57+
58+
59+func tryGetInteger (key) = {
60+ let val = match getInteger(this, key) {
61+ case b: Int =>
62+ b
63+ case _ =>
64+ 0
65+ }
66+ val
67+ }
68+
69+
70+func getBool (key) = match getBoolean(this, key) {
71+ case b: Boolean =>
72+ b
73+ case _ =>
74+ false
75+}
76+
77+
78+func getCurrentLevelBigInt (ducklingId) = {
79+ let kDuckLevel = keyDucklingLevel(ducklingId)
80+ match getString(kDuckLevel) {
81+ case s: String =>
82+ parseBigIntValue(s)
83+ case _ =>
84+ match getBoolean((("duckling_" + ducklingId) + "_issuedByFeedCall")) {
85+ case b: Boolean =>
86+ toBigInt(0)
87+ case _ =>
88+ toBigInt((20 * existingDuckPrecision))
89+ }
90+ }
91+ }
92+
93+
94+func getCurrentLap () = (((lastBlock.timestamp - STARTTIMESTAMP) / LAPLENGTH) + 1)
95+
96+
97+func getLastFedTimestamp (ducklingId) = {
98+ let lastFedTimestamp = tryGetInteger(keyDucklingFedLastTimestamp(ducklingId))
99+ if ((lastFedTimestamp > 0))
100+ then lastFedTimestamp
101+ else lastBlock.timestamp
102+ }
103+
104+
105+func calculateNewDucklingLevel (ducklingId,paymentAmount) = {
106+ let currentTs = lastBlock.timestamp
107+ let lastFedTimestampChecked = getLastFedTimestamp(ducklingId)
108+ let fedDiff = (currentTs - lastFedTimestampChecked)
109+ let penalty = toBigInt(0)
110+ let growth = fraction(toBigInt(paymentAmount), toBigInt(percentGrowthPrecision), toBigInt(DUCKLINGPRICE))
111+ let currentLevel = getCurrentLevelBigInt(ducklingId)
112+ let newLevel = ((currentLevel - penalty) + growth)
113+ let result = if ((toBigInt(0) > newLevel))
114+ then toString(growth)
115+ else toString(newLevel)
116+ $Tuple2(result, [("currentLevel=" + toString(currentLevel)), ("newLevel=" + toString(newLevel)), ("growth=" + toString(growth)), ("penalty=" + toString(penalty)), ("lastFedTs=" + toString(lastFedTimestampChecked)), ("fedDiff=" + toString(fedDiff))])
117+ }
118+
119+
120+func getBackendProof (maxFeedAmount,userNonce,address) = makeString([toString(maxFeedAmount), toString(userNonce), address], ";")
121+
122+
123+@Callable(i)
124+func issueFreeDuckling (address,txIdStr) = if (if ((i.caller != this))
125+ then (i.caller.bytes != rebirthAddress)
126+ else false)
127+ then throw("You can't issue free duckling")
128+ else {
129+ let asset = Issue("BABY-11111111-GZ", "", 1, 0, false, unit, height)
130+ let assetId = calculateAssetId(asset)
131+ $Tuple2([StringEntry((((address + "_") + txIdStr) + "_di"), toBase58String(assetId)), IntegerEntry("stats_amount", (tryGetInteger("stats_amount") + 1)), BooleanEntry((("duckling_" + toBase58String(assetId)) + "_issuedByFeedCall"), (i.caller == this)), asset, ScriptTransfer(value(addressFromString(address)), 1, assetId)], toBase58String(assetId))
132+ }
133+
134+
135+
136+@Callable(i)
137+func feedDuckling (ducklingId,backendSignature,maxFeedAmount,userNonce) = {
138+ let addressString = toString(i.caller)
139+ let backendProof = getBackendProof(maxFeedAmount, userNonce, addressString)
140+ let kAddressNonce = keyAddressNonce(addressString)
141+ let currentNonce = tryGetInteger(kAddressNonce)
142+ let realDucklingId = if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
143+ then throw("Invalid proof from backend")
144+ else if (if ((size(i.payments) != 1))
145+ then true
146+ else (value(i.payments[0]).assetId != EGGASSETID))
147+ then throw("Bad payment attached (asset[s] or amount)")
148+ else if (getBool(keyDucklingGrown(ducklingId)))
149+ then throw("Duckling is already grown")
150+ else if ((userNonce != (currentNonce + 1)))
151+ then throw(((("User Nonce should be " + toString(currentNonce)) + " + 1, while received ") + toString(userNonce)))
152+ else if ((ducklingId == ""))
153+ then {
154+ let ducklingAssetId = invoke(this, "issueFreeDuckling", [toString(i.originCaller), toBase58String(i.transactionId)], nil)
155+ if ((ducklingAssetId == ducklingAssetId))
156+ then {
157+ let id = match ducklingAssetId {
158+ case v: String =>
159+ v
160+ case _ =>
161+ throw("Can't generate NFT")
162+ }
163+ id
164+ }
165+ else throw("Strict value is not equal to itself.")
166+ }
167+ else {
168+ let ducklingIdCheck = value(assetInfo(fromBase58String(ducklingId)))
169+ if ((assetBalance(i.caller, ducklingIdCheck.id) != 1))
170+ then throw("You're not the owner of the duckling")
171+ else if ((ducklingIdCheck.issuer != this))
172+ then throw("Cant find duckling with such id")
173+ else {
174+ let ducklingIdString = toBase58String(ducklingIdCheck.id)
175+ ducklingIdString
176+ }
177+ }
178+ let kDucklingLastFedTs = keyDucklingFedLastTimestamp(ducklingId)
179+ let lastFedTs = getLastFedTimestamp(realDucklingId)
180+ let currentPayment = value(i.payments[0]).amount
181+ let kNewLevel = keyDucklingLevel(realDucklingId)
182+ let kTotalFeed = keyTotalFeed(realDucklingId)
183+ let totalFeed = tryGetInteger(kTotalFeed)
184+ let kFeedTxStats = ((("duckling_" + realDucklingId) + "_stat_") + toString(lastBlock.timestamp))
185+ let kAddressFedTimestamp = keyAddressFedTimestamp(addressString, getCurrentLap(), lastBlock.timestamp)
186+ let kDucklingFedLapTimestamp = keyDucklingFedLapTimestamp(realDucklingId, getCurrentLap())
187+ let kDucklingFedLap = keyDucklingFedLap(realDucklingId)
188+ if ((currentPayment > maxFeedAmount))
189+ then throw(("Cannot feed duckling for such amount, max feed amount is: " + toString(maxFeedAmount)))
190+ else {
191+ let calculateResults = calculateNewDucklingLevel(realDucklingId, currentPayment)
192+[IntegerEntry(kAddressNonce, (currentNonce + 1)), IntegerEntry(kDucklingLastFedTs, lastBlock.timestamp), IntegerEntry(kTotalFeed, (totalFeed + currentPayment)), IntegerEntry(kFeedTxStats, currentPayment), IntegerEntry(kAddressFedTimestamp, currentPayment), IntegerEntry(kDucklingFedLapTimestamp, currentPayment), IntegerEntry(kDucklingFedLap, getCurrentLap()), StringEntry(kNewLevel, calculateResults._1), StringEntry((kFeedTxStats + "_debug"), makeString(calculateResults._2, ";"))]
193+ }
194+ }
195+
196+
197+
198+@Callable(i)
199+func fixLevels (ducklingIds) = if ((i.callerPublicKey != base58'GDxBbsDRmeY39quNrDsTXKJzFWbQVtjxHseF4ikxZ7n9'))
200+ then throw("")
201+ else {
202+ let ducklingIdsList = value(split(ducklingIds, ","))
203+ func handleId (acc,id) = {
204+ let kTotalFeed = keyTotalFeed(id)
205+ let totalFeed = tryGetInteger(kTotalFeed)
206+ let kNewLevel = keyDucklingLevel(id)
207+ let startingLevel = match getBoolean((("duckling_" + id) + "_issuedByFeedCall")) {
208+ case b: Boolean =>
209+ if ((b == true))
210+ then toBigInt(0)
211+ else toBigInt((20 * existingDuckPrecision))
212+ case _ =>
213+ toBigInt((20 * existingDuckPrecision))
214+ }
215+ let growth = fraction(toBigInt(totalFeed), toBigInt(percentGrowthPrecision), toBigInt(DUCKLINGPRICE))
216+ (acc ++ [StringEntry(kNewLevel, toString((startingLevel + growth)))])
217+ }
218+
219+ let $list90489087 = ducklingIdsList
220+ let $size90489087 = size($list90489087)
221+ let $acc090489087 = nil
222+ if (($size90489087 == 0))
223+ then $acc090489087
224+ else {
225+ let $acc190489087 = handleId($acc090489087, $list90489087[0])
226+ if (($size90489087 == 1))
227+ then $acc190489087
228+ else {
229+ let $acc290489087 = handleId($acc190489087, $list90489087[1])
230+ if (($size90489087 == 2))
231+ then $acc290489087
232+ else {
233+ let $acc390489087 = handleId($acc290489087, $list90489087[2])
234+ if (($size90489087 == 3))
235+ then $acc390489087
236+ else {
237+ let $acc490489087 = handleId($acc390489087, $list90489087[3])
238+ if (($size90489087 == 4))
239+ then $acc490489087
240+ else {
241+ let $acc590489087 = handleId($acc490489087, $list90489087[4])
242+ if (($size90489087 == 5))
243+ then $acc590489087
244+ else {
245+ let $acc690489087 = handleId($acc590489087, $list90489087[5])
246+ if (($size90489087 == 6))
247+ then $acc690489087
248+ else {
249+ let $acc790489087 = handleId($acc690489087, $list90489087[6])
250+ if (($size90489087 == 7))
251+ then $acc790489087
252+ else {
253+ let $acc890489087 = handleId($acc790489087, $list90489087[7])
254+ if (($size90489087 == 8))
255+ then $acc890489087
256+ else {
257+ let $acc990489087 = handleId($acc890489087, $list90489087[8])
258+ if (($size90489087 == 9))
259+ then $acc990489087
260+ else {
261+ let $acc1090489087 = handleId($acc990489087, $list90489087[9])
262+ if (($size90489087 == 10))
263+ then $acc1090489087
264+ else {
265+ let $acc1190489087 = handleId($acc1090489087, $list90489087[10])
266+ if (($size90489087 == 11))
267+ then $acc1190489087
268+ else {
269+ let $acc1290489087 = handleId($acc1190489087, $list90489087[11])
270+ if (($size90489087 == 12))
271+ then $acc1290489087
272+ else {
273+ let $acc1390489087 = handleId($acc1290489087, $list90489087[12])
274+ if (($size90489087 == 13))
275+ then $acc1390489087
276+ else {
277+ let $acc1490489087 = handleId($acc1390489087, $list90489087[13])
278+ if (($size90489087 == 14))
279+ then $acc1490489087
280+ else {
281+ let $acc1590489087 = handleId($acc1490489087, $list90489087[14])
282+ if (($size90489087 == 15))
283+ then $acc1590489087
284+ else {
285+ let $acc1690489087 = handleId($acc1590489087, $list90489087[15])
286+ if (($size90489087 == 16))
287+ then $acc1690489087
288+ else {
289+ let $acc1790489087 = handleId($acc1690489087, $list90489087[16])
290+ if (($size90489087 == 17))
291+ then $acc1790489087
292+ else {
293+ let $acc1890489087 = handleId($acc1790489087, $list90489087[17])
294+ if (($size90489087 == 18))
295+ then $acc1890489087
296+ else {
297+ let $acc1990489087 = handleId($acc1890489087, $list90489087[18])
298+ if (($size90489087 == 19))
299+ then $acc1990489087
300+ else {
301+ let $acc2090489087 = handleId($acc1990489087, $list90489087[19])
302+ if (($size90489087 == 20))
303+ then $acc2090489087
304+ else {
305+ let $acc2190489087 = handleId($acc2090489087, $list90489087[20])
306+ throw("List size exceed 20")
307+ }
308+ }
309+ }
310+ }
311+ }
312+ }
313+ }
314+ }
315+ }
316+ }
317+ }
318+ }
319+ }
320+ }
321+ }
322+ }
323+ }
324+ }
325+ }
326+ }
327+ }
328+ }
329+
330+
331+
332+@Callable(i)
333+func turnDucklingIntoDuck () = {
334+ let address = toString(i.caller)
335+ let txId = toBase58String(i.transactionId)
336+ let lastIssuedDucklingTs = tryGetInteger(KGlobalIssuedTimestamp)
337+ let fiveMinInMs = ((60 * 60) * 1000)
338+ if (if ((lastIssuedDucklingTs > 0))
339+ then (fiveMinInMs > (lastBlock.timestamp - lastIssuedDucklingTs))
340+ else false)
341+ then throw(("Can issue ducklings only once per 5 minutes, please wait for " + toString((fiveMinInMs - (lastBlock.timestamp - lastIssuedDucklingTs)))))
342+ else if ((size(i.payments) != 1))
343+ then throw("Bad payment attached (asset[s] or amount)")
344+ else {
345+ let pmt = value(assetInfo(value(value(i.payments[0]).assetId)))
346+ if ((toBigInt(100) > getCurrentLevelBigInt(toBase58String(pmt.id))))
347+ then throw("Duckling is not grown yet...")
348+ else if ((pmt.issuer != this))
349+ then throw("Can use only ducklings from this dApp")
350+ else {
351+ let call = invoke(Address(incubatorAddress), "startDuckHatching", [""], nil)
352+ if ((call == call))
353+ then {
354+ let kDucklingGrown = keyDucklingGrown(toBase58String(pmt.id))
355+[BooleanEntry(kDucklingGrown, true), IntegerEntry(KGlobalIssuedTimestamp, lastBlock.timestamp)]
356+ }
357+ else throw("Strict value is not equal to itself.")
358+ }
359+ }
360+ }
361+
362+
363+@Verifier(tx)
364+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
365+

github/deemru/w8io/026f985 
29.36 ms