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