tx · FahA1ajcuPw4vJUJyqEyHzpCgC1tQUzF7v53FJHnBoKw 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV: -0.01000000 Waves 2021.12.12 09:17 [1830656] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves
{ "type": 13, "id": "FahA1ajcuPw4vJUJyqEyHzpCgC1tQUzF7v53FJHnBoKw", "fee": 1000000, "feeAssetId": null, "timestamp": 1639289858708, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "4ZFfFoi57XNCwgT13zbBVQ5fyiiHHsjrCqEwVNQK1chgQrAPhqZDhph9D381HNjCAt84U4qKDrmyMRx6incSqRLq" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQgSAAAAAAMAAAAABXRva2VuAQAAACDnOZgLkNAqR859hHqstm3f+W8Ysf2b79oIcjd5zepeZgAAAAAHYWlyZHJvcAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVL5fGbDUbkI0fER3ZA37DWC9GkZHGFznigAAAAAKdGVhbUFkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVAAmCU/IrzTjRqRT1pNRXalTwMQKQXJi2gAAAAMAAAABaQEAAAAFcmVzZXQAAAAACQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAFYnVybnQAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAB2Ryb3BwZWQAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAACHRlYW1naWZ0AAAAAAAAAAAACQAETAAAAAIJAQAAAAxJbnRlZ2VyR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AAAAEdW5pdAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAxjYWxsZXJBZHJlc3MFAAAACnNlbGxhbW91bnQFAAAABXRva2VuBQAAAANuaWwJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAABF9idXkFAAAABG1lc3MFAAAAA25pbAAAAAAGDQEh", "height": 1830656, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BieAafGQFz8YETNncydwoyz3jA2P4fepp5WCYzqnQaos Next: 3w3fL2YesyvAB4RMaZAySqTQsgQYJrtDUFTJPzSpFs1v Diff:
Old | New | Differences | |
---|---|---|---|
137 | 137 | then (size(split(C, "|")) == 2) | |
138 | 138 | else false) | |
139 | 139 | then 1 | |
140 | - | else | |
140 | + | else 99 | |
141 | 141 | let F = if (if (D) | |
142 | 142 | then if ((E == 0)) | |
143 | 143 | then true | |
165 | 165 | then "ballance empty " | |
166 | 166 | else "")))) | |
167 | 167 | let J = split(C, "|") | |
168 | - | let K = if (D) | |
169 | - | then J[0] | |
170 | - | else ("" + (if ((E == 0)) | |
171 | - | then "|bought1" | |
172 | - | else ("" + (if ((E == 1)) | |
173 | - | then "|bought1|bought2" | |
174 | - | else "")))) | |
168 | + | let K = if ((E == 0)) | |
169 | + | then (J[0] + "|bought1") | |
170 | + | else if ((E == 1)) | |
171 | + | then (J[0] + "|bought1|bought2") | |
172 | + | else "" | |
175 | 173 | let L = if (if (if (B) | |
176 | 174 | then F | |
177 | 175 | else false) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'GZc7eKnq2KJwqetRmUzSqr2ZaCGseDZufSocz83sUNoo' | |
5 | 5 | ||
6 | 6 | let b = Address(base58'3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV') | |
7 | 7 | ||
8 | 8 | let c = Address(base58'3MovsLjXpJr9HD2vBqmAf7Gze6jwuRxX1fX') | |
9 | 9 | ||
10 | 10 | @Callable(d) | |
11 | 11 | func reset () = [DeleteEntry(toBase58String(d.caller.bytes)), IntegerEntry("burnt", 0), IntegerEntry("dropped", 0), IntegerEntry("teamgift", 0), IntegerEntry("burningstage", 0)] | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | 15 | @Callable(d) | |
16 | 16 | func call (e) = { | |
17 | 17 | let f = { | |
18 | 18 | let g = blockInfoByHeight(height) | |
19 | 19 | if ($isInstanceOf(g, "BlockInfo")) | |
20 | 20 | then { | |
21 | 21 | let h = g | |
22 | 22 | h.timestamp | |
23 | 23 | } | |
24 | 24 | else throw("Can't find block") | |
25 | 25 | } | |
26 | 26 | let i = assetBalance(b, a) | |
27 | 27 | let j = { | |
28 | 28 | let g = getInteger("burningstage") | |
29 | 29 | if ($isInstanceOf(g, "Int")) | |
30 | 30 | then { | |
31 | 31 | let k = g | |
32 | 32 | if (if ((getIntegerValue("burningstage") == 0)) | |
33 | 33 | then (f > 1639131654752) | |
34 | 34 | else false) | |
35 | 35 | then fraction(i, 10, 100) | |
36 | 36 | else 0 | |
37 | 37 | } | |
38 | 38 | else throw("no burningstage") | |
39 | 39 | } | |
40 | 40 | let l = 1000 | |
41 | 41 | let m = 10 | |
42 | 42 | let n = fromBase58String(e) | |
43 | 43 | let o = Address(d.caller.bytes) | |
44 | 44 | let p = 1639230864311 | |
45 | 45 | let q = if ((i > l)) | |
46 | 46 | then true | |
47 | 47 | else throw("not enough") | |
48 | 48 | if ((q == q)) | |
49 | 49 | then { | |
50 | 50 | let r = { | |
51 | 51 | let g = transferTransactionById(n) | |
52 | 52 | if ($isInstanceOf(g, "TransferTransaction")) | |
53 | 53 | then { | |
54 | 54 | let s = g | |
55 | 55 | true | |
56 | 56 | } | |
57 | 57 | else false | |
58 | 58 | } | |
59 | 59 | let t = { | |
60 | 60 | let g = transferTransactionById(n) | |
61 | 61 | if ($isInstanceOf(g, "TransferTransaction")) | |
62 | 62 | then { | |
63 | 63 | let s = g | |
64 | 64 | s.timestamp | |
65 | 65 | } | |
66 | 66 | else 9999999999999 | |
67 | 67 | } | |
68 | 68 | let u = { | |
69 | 69 | let g = transferTransactionById(n) | |
70 | 70 | if ($isInstanceOf(g, "TransferTransaction")) | |
71 | 71 | then { | |
72 | 72 | let s = g | |
73 | 73 | s.sender | |
74 | 74 | } | |
75 | 75 | else b | |
76 | 76 | } | |
77 | 77 | let v = if ((take(valueOrElse(getString(toBase58String(d.caller.bytes)), ""), 8) == "received")) | |
78 | 78 | then true | |
79 | 79 | else false | |
80 | 80 | let w = if (if (if ((t > p)) | |
81 | 81 | then true | |
82 | 82 | else (o != u)) | |
83 | 83 | then true | |
84 | 84 | else v) | |
85 | 85 | then false | |
86 | 86 | else true | |
87 | 87 | let x = if (r) | |
88 | 88 | then if ((t > p)) | |
89 | 89 | then ("transaction is out of time range: " + toString(t)) | |
90 | 90 | else ("" + (if ((o != u)) | |
91 | 91 | then ((("it is incorrect sender: " + toString(o)) + " / ") + toString(u)) | |
92 | 92 | else ("" + (if (v) | |
93 | 93 | then getStringValue(toBase58String(d.caller.bytes)) | |
94 | 94 | else ("" + (if (w) | |
95 | 95 | then ("received in " + toString(f)) | |
96 | 96 | else "")))))) | |
97 | 97 | else "cant find transaction" | |
98 | 98 | if (w) | |
99 | 99 | then if ((j > 0)) | |
100 | 100 | then [ScriptTransfer(o, l, a), ScriptTransfer(c, m, a), StringEntry(toBase58String(d.caller.bytes), x), IntegerEntry("dropped", (getIntegerValue("dropped") + l)), IntegerEntry("teamgift", (getIntegerValue("teamgift") + m))] | |
101 | 101 | else [ScriptTransfer(o, l, a), ScriptTransfer(c, m, a), StringEntry(toBase58String(d.caller.bytes), x), IntegerEntry("dropped", (getIntegerValue("dropped") + l)), IntegerEntry("teamgift", (getIntegerValue("teamgift") + m))] | |
102 | 102 | else [StringEntry(toBase58String(d.caller.bytes), x)] | |
103 | 103 | } | |
104 | 104 | else throw("Strict value is not equal to itself.") | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | ||
109 | 109 | @Callable(d) | |
110 | 110 | func buy () = { | |
111 | 111 | let f = { | |
112 | 112 | let g = blockInfoByHeight(height) | |
113 | 113 | if ($isInstanceOf(g, "BlockInfo")) | |
114 | 114 | then { | |
115 | 115 | let h = g | |
116 | 116 | h.timestamp | |
117 | 117 | } | |
118 | 118 | else throw("Can't find block") | |
119 | 119 | } | |
120 | 120 | let i = assetBalance(b, a) | |
121 | 121 | let y = 1000 | |
122 | 122 | let z = (1 * 100000000) | |
123 | 123 | let A = (2 * 100000000) | |
124 | 124 | let o = Address(d.caller.bytes) | |
125 | 125 | let B = if ((i >= y)) | |
126 | 126 | then true | |
127 | 127 | else false | |
128 | 128 | let C = valueOrElse(getString(toBase58String(d.caller.bytes)), "") | |
129 | 129 | let D = if ((take(C, 8) == "received")) | |
130 | 130 | then true | |
131 | 131 | else false | |
132 | 132 | let E = if (if (D) | |
133 | 133 | then (size(split(C, "|")) == 1) | |
134 | 134 | else false) | |
135 | 135 | then 0 | |
136 | 136 | else if (if (D) | |
137 | 137 | then (size(split(C, "|")) == 2) | |
138 | 138 | else false) | |
139 | 139 | then 1 | |
140 | - | else | |
140 | + | else 99 | |
141 | 141 | let F = if (if (D) | |
142 | 142 | then if ((E == 0)) | |
143 | 143 | then true | |
144 | 144 | else (E == 1) | |
145 | 145 | else false) | |
146 | 146 | then true | |
147 | 147 | else false | |
148 | 148 | let G = if ((E == 0)) | |
149 | 149 | then z | |
150 | 150 | else if ((E == 1)) | |
151 | 151 | then A | |
152 | 152 | else 0 | |
153 | 153 | let H = if ((size(d.payments) == 1)) | |
154 | 154 | then if (if (!(isDefined(d.payments[0].assetId))) | |
155 | 155 | then (d.payments[0].amount >= G) | |
156 | 156 | else false) | |
157 | 157 | then true | |
158 | 158 | else false | |
159 | 159 | else false | |
160 | 160 | let I = if (!(F)) | |
161 | 161 | then "not prooved for buy" | |
162 | 162 | else ("" + (if (!(H)) | |
163 | 163 | then "not enough payment" | |
164 | 164 | else ("" + (if (!(B)) | |
165 | 165 | then "ballance empty " | |
166 | 166 | else "")))) | |
167 | 167 | let J = split(C, "|") | |
168 | - | let K = if (D) | |
169 | - | then J[0] | |
170 | - | else ("" + (if ((E == 0)) | |
171 | - | then "|bought1" | |
172 | - | else ("" + (if ((E == 1)) | |
173 | - | then "|bought1|bought2" | |
174 | - | else "")))) | |
168 | + | let K = if ((E == 0)) | |
169 | + | then (J[0] + "|bought1") | |
170 | + | else if ((E == 1)) | |
171 | + | then (J[0] + "|bought1|bought2") | |
172 | + | else "" | |
175 | 173 | let L = if (if (if (B) | |
176 | 174 | then F | |
177 | 175 | else false) | |
178 | 176 | then H | |
179 | 177 | else false) | |
180 | 178 | then true | |
181 | 179 | else false | |
182 | 180 | if (L) | |
183 | 181 | then [StringEntry(toBase58String(d.caller.bytes), K), ScriptTransfer(c, G, unit), ScriptTransfer(o, y, a)] | |
184 | 182 | else [StringEntry((toBase58String(d.caller.bytes) + "_buy"), I)] | |
185 | 183 | } | |
186 | 184 | ||
187 | 185 |
github/deemru/w8io/026f985 28.41 ms ◑