tx · G46ViLSiKU6e4w5gUBU1GYAeXTfKKXuACsM2rWxXquz3 3MqnjEXWG6rvvRo2UDYRANN8iWLks7snDwj: -0.01000000 Waves 2021.12.14 16:35 [1833993] smart account 3MqnjEXWG6rvvRo2UDYRANN8iWLks7snDwj > SELF 0.00000000 Waves
{ "type": 13, "id": "G46ViLSiKU6e4w5gUBU1GYAeXTfKKXuACsM2rWxXquz3", "fee": 1000000, "feeAssetId": null, "timestamp": 1639488932880, "version": 2, "chainId": 84, "sender": "3MqnjEXWG6rvvRo2UDYRANN8iWLks7snDwj", "senderPublicKey": "2XLAeeTTE4mSghbTZDq9wZiJkuqmdgCCAw4uy1QgYGtK", "proofs": [ "4TZwCR5Yijb4ewUQYGJgXhTSE88dr1RVsGJnSvQDVg1iaffDynBjTD4T96KypF5XZvamcLKT1tv7JescbML9W7dR" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQgAAAAIAAAAAAltYXN0ZXJhZHICAAAAIzNOOGtGVHppU3B6N1NvZG9SeEsyWDkxTFlWc0F4aVAxaUNVAAAAAAZzZXBhcmMCAAAAAXwAAAAABnNlcGFycgkAASwAAAACBQAAAAZzZXBhcmMFAAAABnNlcGFyYwAAAAAJaW5jcnByaWNlAAAAAAAAAAAhAAAAAAlpbml0cHJpY2UCAAAABjEwMDAwMAAAAAAJbWFzdGVyZmVlAAAAAAAAAAABAAAAAAV0b2tlbgUAAAAEdW5pdAAAAAAJc3Rha2VyYXRlAAAAAAAAAAABAAAAAgAAAAFpAQAAAAVyZXNldAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAACmludGVyZXN0aWQAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAACmxhc3RwYWlkaWQAAAAAAAAAAAAFAAAAA25pbAAAAAFpAQAAAAVwYWludAAAAAEAAAAFaWRhdGEEAAAAAmN0BAAAAAckbWF0Y2gwCQAD7QAAAAEFAAAABmhlaWdodAMJAAAB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AACGVycm9ycG10AgAAAAEgBQAAAAplcnJvcnRva2VuAgAAAAEgBQAAAAtlcnJvcmVub3VnaAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACXBtdGFtb3VudAgJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAHYXNzZXRJZAUAAAADbmlsCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgUAAAAMY2FsbGVyQWRyZXNzAgAAAAZfZXJyb3IJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAACGVycm9ycG10AgAAAAEgBQAAAAplcnJvcnRva2VuAgAAAAEgBQAAAAtlcnJvcmVub3VnaAIAAAABIAUAAAAIZXJyb3J1cmwFAAAAA25pbAAAAACY4IFj", "height": 1833993, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GExCmL9zpM3zikquBWTfh8sgjoQAMMu4jZZ279ZMdYaX Next: CAopTGHyJu92Xc7X8EJ8SmqEsZy6xRAKMw851gK1PPsr Diff:
Old | New | Differences | |
---|---|---|---|
116 | 116 | if (if (pmtenough) | |
117 | 117 | then urlcorrect | |
118 | 118 | else false) | |
119 | - | then [StringEntry(all[0][0], all[0][1] | |
119 | + | then [StringEntry(all[0][0], all[0][1]), ScriptTransfer(i.caller, ((pmtamount - payment) - servicefee), token), ScriptTransfer(Address(fromBase58String(masteradr)), servicefee, token), DeleteEntry((callerAdress + "_error"))] | |
120 | 120 | else if (havepmt) | |
121 | 121 | then [StringEntry((callerAdress + "_error"), ((((errorpmt + " ") + errortoken) + " ") + errorenough)), ScriptTransfer(i.caller, pmtamount, i.payments[0].assetId)] | |
122 | 122 | else [StringEntry((callerAdress + "_error"), ((((((errorpmt + " ") + errortoken) + " ") + errorenough) + " ") + errorurl))] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let masteradr = "3N8kFTziSpz7SodoRxK2X91LYVsAxiP1iCU" | |
5 | 5 | ||
6 | 6 | let separc = "|" | |
7 | 7 | ||
8 | 8 | let separr = (separc + separc) | |
9 | 9 | ||
10 | 10 | let incrprice = 33 | |
11 | 11 | ||
12 | 12 | let initprice = "100000" | |
13 | 13 | ||
14 | 14 | let masterfee = 1 | |
15 | 15 | ||
16 | 16 | let token = unit | |
17 | 17 | ||
18 | 18 | let stakerate = 1 | |
19 | 19 | ||
20 | 20 | @Callable(i) | |
21 | 21 | func reset () = [IntegerEntry("interestid", 0), IntegerEntry("lastpaidid", 0)] | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(i) | |
26 | 26 | func paint (idata) = { | |
27 | 27 | let ct = match blockInfoByHeight(height) { | |
28 | 28 | case block: BlockInfo => | |
29 | 29 | block.timestamp | |
30 | 30 | case _ => | |
31 | 31 | 0 | |
32 | 32 | } | |
33 | 33 | let currenttime = parseIntValue(toString(ct)) | |
34 | 34 | let callerAdress = toBase58String(i.caller.bytes) | |
35 | 35 | let reqdata = split(idata, separr) | |
36 | 36 | let color = if ((size(reqdata) > 1)) | |
37 | 37 | then reqdata[1] | |
38 | 38 | else "0" | |
39 | 39 | let url = if ((size(reqdata) > 2)) | |
40 | 40 | then reqdata[2] | |
41 | 41 | else "" | |
42 | 42 | let urlcorrect = if ((indexOf(url, separc) == unit)) | |
43 | 43 | then true | |
44 | 44 | else false | |
45 | 45 | let pixxy = if ((size(reqdata) > 0)) | |
46 | 46 | then split(reqdata[0], separc) | |
47 | 47 | else nil | |
48 | 48 | let number = min([28, size(pixxy)]) | |
49 | 49 | let emptycommand = ["--", "--", masteradr, "0", "0"] | |
50 | 50 | let newrecord = [callerAdress, initprice, toString(currenttime), color, url] | |
51 | 51 | func validxy (j) = match parseInt(pixxy[j]) { | |
52 | 52 | case a: Int => | |
53 | 53 | if (if ((parseIntValue(pixxy[j]) > -1)) | |
54 | 54 | then (1000 > parseIntValue(pixxy[j])) | |
55 | 55 | else false) | |
56 | 56 | then parseIntValue(pixxy[j]) | |
57 | 57 | else -1 | |
58 | 58 | case _ => | |
59 | 59 | -1 | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | func getrecord (j) = match getString(pixxy[j]) { | |
63 | 63 | case a: String => | |
64 | 64 | getStringValue(pixxy[j]) | |
65 | 65 | case _ => | |
66 | 66 | "" | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | func command (j) = if (if ((j > (number - 1))) | |
70 | 70 | then true | |
71 | 71 | else (0 > validxy(j))) | |
72 | 72 | then emptycommand | |
73 | 73 | else if ((getrecord(j) == "")) | |
74 | 74 | then [pixxy[j], makeString(newrecord, separc), masteradr, initprice] | |
75 | 75 | else { | |
76 | 76 | let oldrecord = split(getStringValue(pixxy[j]), separc) | |
77 | 77 | let price = parseIntValue(oldrecord[1]) | |
78 | 78 | let stakeinterest = (((price * (currenttime - parseIntValue(oldrecord[2]))) * stakerate) % 360000000) | |
79 | 79 | let oldowner = oldrecord[0] | |
80 | 80 | [pixxy[j], makeString([callerAdress, toString(((price * (100 + incrprice)) % 100)), toString(currenttime), color, url], separc), oldowner, toString(price), toString((stakeinterest + price))] | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | let all = [command(0), command(1), command(2), command(3), command(4), command(5), command(6), command(7), command(8), command(9), command(10), command(11), command(12), command(13), command(14), command(15), command(16), command(17), command(18), command(19), command(20), command(21), command(22), command(23), command(24), command(25), command(26), command(27)] | |
84 | 84 | let payment = parseIntValue(all[0][3]) | |
85 | 85 | let servicefee = fraction(payment, masterfee, 100) | |
86 | 86 | let havepmt = if ((size(i.payments) == 1)) | |
87 | 87 | then true | |
88 | 88 | else false | |
89 | 89 | let pmtamount = if (havepmt) | |
90 | 90 | then i.payments[0].amount | |
91 | 91 | else 0 | |
92 | 92 | let tokencorrect = if (havepmt) | |
93 | 93 | then if ((i.payments[0].assetId == token)) | |
94 | 94 | then true | |
95 | 95 | else false | |
96 | 96 | else false | |
97 | 97 | let pmtenough = if (if (tokencorrect) | |
98 | 98 | then (pmtamount >= (payment + servicefee)) | |
99 | 99 | else false) | |
100 | 100 | then true | |
101 | 101 | else false | |
102 | 102 | let errorpmt = if (!(havepmt)) | |
103 | 103 | then (("Attached payment is required: " + toString((payment + servicefee))) + "; ") | |
104 | 104 | else "" | |
105 | 105 | let errortoken = if (!(tokencorrect)) | |
106 | 106 | then "works with tokens only; " | |
107 | 107 | else "" | |
108 | 108 | let errorenough = if (!(pmtenough)) | |
109 | 109 | then (((("you give: " + toString(pmtamount)) + ", but deal needs: ") + toString((payment + servicefee))) + "; ") | |
110 | 110 | else "" | |
111 | 111 | let errorurl = if (!(urlcorrect)) | |
112 | 112 | then "url is incorrect; " | |
113 | 113 | else "" | |
114 | 114 | let interestid = getIntegerValue("interestid") | |
115 | 115 | let interestidnext = (interestid + 1) | |
116 | 116 | if (if (pmtenough) | |
117 | 117 | then urlcorrect | |
118 | 118 | else false) | |
119 | - | then [StringEntry(all[0][0], all[0][1] | |
119 | + | then [StringEntry(all[0][0], all[0][1]), ScriptTransfer(i.caller, ((pmtamount - payment) - servicefee), token), ScriptTransfer(Address(fromBase58String(masteradr)), servicefee, token), DeleteEntry((callerAdress + "_error"))] | |
120 | 120 | else if (havepmt) | |
121 | 121 | then [StringEntry((callerAdress + "_error"), ((((errorpmt + " ") + errortoken) + " ") + errorenough)), ScriptTransfer(i.caller, pmtamount, i.payments[0].assetId)] | |
122 | 122 | else [StringEntry((callerAdress + "_error"), ((((((errorpmt + " ") + errortoken) + " ") + errorenough) + " ") + errorurl))] | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 |
github/deemru/w8io/026f985 37.59 ms ◑