tx · FJDmXpXbiARPnxxjfckzubLMHrKVkdmtQaFFo9GQBUm4 3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX: -0.01000000 Waves 2021.12.12 20:42 [1831356] smart account 3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX > SELF 0.00000000 Waves
{ "type": 13, "id": "FJDmXpXbiARPnxxjfckzubLMHrKVkdmtQaFFo9GQBUm4", "fee": 1000000, "feeAssetId": null, "timestamp": 1639330950719, "version": 2, "chainId": 84, "sender": "3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX", "senderPublicKey": "HUca7AqRs4Zs9sU1AFcufmBC4XpT4sN79aFScNRT4LxQ", "proofs": [ "zAk2FxNdau4tJmHUXJfn25EdUcCkVQvvkgGY3hABQVxQiUgNGQJuzb6zUN9evSDt8QGEnmEiF83uS8dwe6ZJVqx" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQgSAAAAAAQAAAAABXRva2VuAQAAACBBnzWWCs70cIUM5mG9HWuiijbbYxygzkmiC2w+lmxHmwAAAAAGdG9rZW5kAAAAAAAF9eEAAAAAAAdhaXJkcm9wCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUX+pzJtA2DV6Pr0xhS8z4foIVUAfq2c0IAAAAAAp0ZWFtQWRyZXNzCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUACYJT8ivNONGpFPWk1FdqVPAxApBcmLaAAAAAwAAAAFpAQAAAAVyZXNldAAAAAAJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAVidXJudAAAAAAAAAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAHZHJvcHBlZAAAAAAAAAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAFc29sZDEAAAAAA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AAB25ld2RhdGEDCQAAAAAAAAIFAAAADmNhbGxlckJ1eWxldmVsAAAAAAAAAAAACQABLAAAAAIJAAGRAAAAAgUAAAAIZGF0YXJlY3MAAAAAAAAAAAACAAAACHxib3VnaHQxAwkAAAAAAAACBQAAAA5jYWxsZXJCdXlsZXZlbAAAAAAAAAAAAQkAASwAAAACCQABkQAAAAIFAAAACGRhdGFyZWNzAAAAAAAAAAAAAgAAABB8Ym91Z2h0MXxib3VnaHQyAgAAAAAEAAAABGRlYWwDAwMFAAAACWJhbGFuY2VvawUAAAAMY2FsbGVyQ2FuQnV5BwUAAAAFcG10b2sHBgcDBQAAAARkZWFsCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwUAAAAHbmV3ZGF0YQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAp0ZWFtQWRyZXNzBQAAAAtjYWxsZXJQcmljZQUAAAAEdW5pdAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAxjYWxsZXJBZHJlc3MFAAAACnNlbGxhbW91bnQFAAAABXRva2VuCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAZfZXJyb3IFAAAAA25pbAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwIAAAAGX2Vycm9yBQAAAARtZXNzBQAAAANuaWwAAAAAP1AA6A==", "height": 1831356, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3m6Bc7ohHMZoqk32h7X4u7KgAQRJpKcABXZNzsF8KCTd Next: 8xBh1FFSKYyeY4PaQzjJstuNoVfPiYBDrYe5em7MT18B Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let token = base58' | |
4 | + | let token = base58'5RAJjzoFWEqp7TJTHsnGRiJG6xFG2VgpscRpNPrgGu9L' | |
5 | 5 | ||
6 | 6 | let tokend = 100000000 | |
7 | 7 | ||
21 | 21 | let trid = fromBase58String(id58) | |
22 | 22 | let callerAdress = Address(i.caller.bytes) | |
23 | 23 | let deadline = 1639310400000 | |
24 | - | let burndeadline = | |
24 | + | let burndeadline = 1639332000000 | |
25 | 25 | let currenttime = match blockInfoByHeight(height) { | |
26 | 26 | case block: BlockInfo => | |
27 | 27 | block.timestamp | |
32 | 32 | let burnamount = if (if ((currenttime > burndeadline)) | |
33 | 33 | then (getStringValue("burningstage") == "waiting") | |
34 | 34 | else false) | |
35 | - | then | |
35 | + | then balance | |
36 | 36 | else 0 | |
37 | 37 | let isenough = if ((balance > dropamount)) | |
38 | 38 | then true | |
83 | 83 | else "")))))))) | |
84 | 84 | else "can`t find transaction" | |
85 | 85 | if ((burnamount > 0)) | |
86 | - | then [StringEntry(toBase58String(i.caller.bytes), | |
86 | + | then [StringEntry((toBase58String(i.caller.bytes) + "_error"), (("airdrop ended: " + toString(getIntegerValue("burnt"))) + " burnt")), Burn(token, burnamount), StringEntry("burningstage", "them all burnt"), IntegerEntry("burnt", (getIntegerValue("burnt") + burnamount))] | |
87 | 87 | else if (isprooved) | |
88 | 88 | then [ScriptTransfer(callerAdress, dropamount, token), ScriptTransfer(teamAdress, teamgift, token), StringEntry(toBase58String(i.caller.bytes), result), IntegerEntry("dropped", (getIntegerValue("dropped") + dropamount)), IntegerEntry("teamgift", (getIntegerValue("teamgift") + teamgift)), DeleteEntry((toBase58String(i.caller.bytes) + "_error"))] | |
89 | 89 | else [StringEntry((toBase58String(i.caller.bytes) + "_error"), result)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let token = base58' | |
4 | + | let token = base58'5RAJjzoFWEqp7TJTHsnGRiJG6xFG2VgpscRpNPrgGu9L' | |
5 | 5 | ||
6 | 6 | let tokend = 100000000 | |
7 | 7 | ||
8 | 8 | let airdrop = Address(base58'3MxfEq17wZjAWQfckWycU9o4oTkvf9nfNQX') | |
9 | 9 | ||
10 | 10 | let teamAdress = Address(base58'3MovsLjXpJr9HD2vBqmAf7Gze6jwuRxX1fX') | |
11 | 11 | ||
12 | 12 | @Callable(i) | |
13 | 13 | func reset () = [DeleteEntry(toBase58String(i.caller.bytes)), IntegerEntry("burnt", 0), IntegerEntry("dropped", 0), IntegerEntry("sold1", 0), IntegerEntry("sold2", 0), IntegerEntry("teamgift", 0), IntegerEntry("issued", (1000000000 * 100000000)), StringEntry("burningstage", "waiting"), DeleteEntry((toBase58String(i.caller.bytes) + "_error"))] | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | ||
17 | 17 | @Callable(i) | |
18 | 18 | func free (id58) = { | |
19 | 19 | let dropamount = (1000 * tokend) | |
20 | 20 | let teamgift = (10 * tokend) | |
21 | 21 | let trid = fromBase58String(id58) | |
22 | 22 | let callerAdress = Address(i.caller.bytes) | |
23 | 23 | let deadline = 1639310400000 | |
24 | - | let burndeadline = | |
24 | + | let burndeadline = 1639332000000 | |
25 | 25 | let currenttime = match blockInfoByHeight(height) { | |
26 | 26 | case block: BlockInfo => | |
27 | 27 | block.timestamp | |
28 | 28 | case _ => | |
29 | 29 | throw("Can't find block") | |
30 | 30 | } | |
31 | 31 | let balance = assetBalance(airdrop, token) | |
32 | 32 | let burnamount = if (if ((currenttime > burndeadline)) | |
33 | 33 | then (getStringValue("burningstage") == "waiting") | |
34 | 34 | else false) | |
35 | - | then | |
35 | + | then balance | |
36 | 36 | else 0 | |
37 | 37 | let isenough = if ((balance > dropamount)) | |
38 | 38 | then true | |
39 | 39 | else false | |
40 | 40 | if ((isenough == isenough)) | |
41 | 41 | then { | |
42 | 42 | let trexists = match transferTransactionById(trid) { | |
43 | 43 | case ttx: TransferTransaction => | |
44 | 44 | true | |
45 | 45 | case _ => | |
46 | 46 | false | |
47 | 47 | } | |
48 | 48 | let trtime = match transferTransactionById(trid) { | |
49 | 49 | case ttx: TransferTransaction => | |
50 | 50 | ttx.timestamp | |
51 | 51 | case _ => | |
52 | 52 | 9999999999999 | |
53 | 53 | } | |
54 | 54 | let trsender = match transferTransactionById(trid) { | |
55 | 55 | case ttx: TransferTransaction => | |
56 | 56 | ttx.sender | |
57 | 57 | case _ => | |
58 | 58 | airdrop | |
59 | 59 | } | |
60 | 60 | let received = if ((take(valueOrElse(getString(toBase58String(i.caller.bytes)), ""), 8) == "received")) | |
61 | 61 | then true | |
62 | 62 | else false | |
63 | 63 | let isprooved = if (if (if (if ((trtime > deadline)) | |
64 | 64 | then true | |
65 | 65 | else (callerAdress != trsender)) | |
66 | 66 | then true | |
67 | 67 | else received) | |
68 | 68 | then true | |
69 | 69 | else !(isenough)) | |
70 | 70 | then false | |
71 | 71 | else true | |
72 | 72 | let result = if (trexists) | |
73 | 73 | then if ((trtime > deadline)) | |
74 | 74 | then ("transaction is out of time range: " + toString(trtime)) | |
75 | 75 | else ("" + (if ((callerAdress != trsender)) | |
76 | 76 | then ((("it is incorrect sender: " + toString(callerAdress)) + " / ") + toString(trsender)) | |
77 | 77 | else ("" + (if (received) | |
78 | 78 | then getStringValue(toBase58String(i.caller.bytes)) | |
79 | 79 | else ("" + (if (isprooved) | |
80 | 80 | then "received" | |
81 | 81 | else ("" + (if (!(isenough)) | |
82 | 82 | then (("airdrop ended: " + toString(getIntegerValue("burnt"))) + " burnt") | |
83 | 83 | else "")))))))) | |
84 | 84 | else "can`t find transaction" | |
85 | 85 | if ((burnamount > 0)) | |
86 | - | then [StringEntry(toBase58String(i.caller.bytes), | |
86 | + | then [StringEntry((toBase58String(i.caller.bytes) + "_error"), (("airdrop ended: " + toString(getIntegerValue("burnt"))) + " burnt")), Burn(token, burnamount), StringEntry("burningstage", "them all burnt"), IntegerEntry("burnt", (getIntegerValue("burnt") + burnamount))] | |
87 | 87 | else if (isprooved) | |
88 | 88 | then [ScriptTransfer(callerAdress, dropamount, token), ScriptTransfer(teamAdress, teamgift, token), StringEntry(toBase58String(i.caller.bytes), result), IntegerEntry("dropped", (getIntegerValue("dropped") + dropamount)), IntegerEntry("teamgift", (getIntegerValue("teamgift") + teamgift)), DeleteEntry((toBase58String(i.caller.bytes) + "_error"))] | |
89 | 89 | else [StringEntry((toBase58String(i.caller.bytes) + "_error"), result)] | |
90 | 90 | } | |
91 | 91 | else throw("Strict value is not equal to itself.") | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(i) | |
97 | 97 | func buy () = { | |
98 | 98 | let currenttime = match blockInfoByHeight(height) { | |
99 | 99 | case block: BlockInfo => | |
100 | 100 | block.timestamp | |
101 | 101 | case _ => | |
102 | 102 | throw("Can't find block") | |
103 | 103 | } | |
104 | 104 | let balance = assetBalance(airdrop, token) | |
105 | 105 | let sellamount = (1000 * tokend) | |
106 | 106 | let price1 = (1 * 100000000) | |
107 | 107 | let price2 = (2 * 100000000) | |
108 | 108 | let callerAdress = Address(i.caller.bytes) | |
109 | 109 | let balanceok = if ((balance >= sellamount)) | |
110 | 110 | then true | |
111 | 111 | else false | |
112 | 112 | let callerData = valueOrElse(getString(toBase58String(i.caller.bytes)), "") | |
113 | 113 | let callerReceived = if ((take(callerData, 8) == "received")) | |
114 | 114 | then true | |
115 | 115 | else false | |
116 | 116 | let callerBuylevel = if (if (callerReceived) | |
117 | 117 | then (size(split(callerData, "|")) == 1) | |
118 | 118 | else false) | |
119 | 119 | then 0 | |
120 | 120 | else if (if (callerReceived) | |
121 | 121 | then (size(split(callerData, "|")) == 2) | |
122 | 122 | else false) | |
123 | 123 | then 1 | |
124 | 124 | else 99 | |
125 | 125 | let callerCanBuy = if (if (callerReceived) | |
126 | 126 | then if ((callerBuylevel == 0)) | |
127 | 127 | then true | |
128 | 128 | else (callerBuylevel == 1) | |
129 | 129 | else false) | |
130 | 130 | then true | |
131 | 131 | else false | |
132 | 132 | let callerPrice = if ((callerBuylevel == 0)) | |
133 | 133 | then price1 | |
134 | 134 | else if ((callerBuylevel == 1)) | |
135 | 135 | then price2 | |
136 | 136 | else 0 | |
137 | 137 | let pmtok = if ((size(i.payments) == 1)) | |
138 | 138 | then if (if (!(isDefined(i.payments[0].assetId))) | |
139 | 139 | then (i.payments[0].amount >= callerPrice) | |
140 | 140 | else false) | |
141 | 141 | then true | |
142 | 142 | else false | |
143 | 143 | else false | |
144 | 144 | let mess = if (!(callerCanBuy)) | |
145 | 145 | then "not prooved for buy" | |
146 | 146 | else ("" + (if (!(pmtok)) | |
147 | 147 | then "not enough payment" | |
148 | 148 | else ("" + (if (!(balanceok)) | |
149 | 149 | then "ballance empty " | |
150 | 150 | else "")))) | |
151 | 151 | let datarecs = split(callerData, "|") | |
152 | 152 | let newdata = if ((callerBuylevel == 0)) | |
153 | 153 | then (datarecs[0] + "|bought1") | |
154 | 154 | else if ((callerBuylevel == 1)) | |
155 | 155 | then (datarecs[0] + "|bought1|bought2") | |
156 | 156 | else "" | |
157 | 157 | let deal = if (if (if (balanceok) | |
158 | 158 | then callerCanBuy | |
159 | 159 | else false) | |
160 | 160 | then pmtok | |
161 | 161 | else false) | |
162 | 162 | then true | |
163 | 163 | else false | |
164 | 164 | if (deal) | |
165 | 165 | then [StringEntry(toBase58String(i.caller.bytes), newdata), ScriptTransfer(teamAdress, callerPrice, unit), ScriptTransfer(callerAdress, sellamount, token), DeleteEntry((toBase58String(i.caller.bytes) + "_error"))] | |
166 | 166 | else [StringEntry((toBase58String(i.caller.bytes) + "_error"), mess)] | |
167 | 167 | } | |
168 | 168 | ||
169 | 169 |
github/deemru/w8io/026f985 62.85 ms ◑