tx · 3w3fL2YesyvAB4RMaZAySqTQsgQYJrtDUFTJPzSpFs1v 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV: -0.01000000 Waves 2021.12.12 10:09 [1830709] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves
{ "type": 13, "id": "3w3fL2YesyvAB4RMaZAySqTQsgQYJrtDUFTJPzSpFs1v", "fee": 1000000, "feeAssetId": null, "timestamp": 1639293030440, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "5v9RCPZkrui4jpkPCXsPF3ebigsS3UHWPo5DK4pFyyJF7BuoU5hwp6QUL8hG9AgVpF4hq3fGVnk31zt5Hkmkzwce" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgMKAQgSAAAAAAMAAAAABXRva2VuAQAAACDnOZgLkNAqR859hHqstm3f+W8Ysf2b79oIcjd5zepeZgAAAAAHYWlyZHJvcAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVL5fGbDUbkI0fER3ZA37DWC9GkZHGFznigAAAAAKdGVhbUFkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVAAmCU/IrzTjRqRT1pNRXalTwMQKQXJi2gAAAAMAAAABaQEAAAAFcmVzZXQAAAAACQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAFYnVybnQAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAB2Ryb3BwZWQAAAAAAAAAAAAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAACHRlYW1naWZ0AAAAAAAAAAAACQAETAAAAAIJAQAAAAxJbnRlZ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dFRyYW5zZmVyAAAAAwUAAAAMY2FsbGVyQWRyZXNzBQAAAApzZWxsYW1vdW50BQAAAAV0b2tlbgUAAAADbmlsCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAARfYnV5BQAAAARtZXNzBQAAAANuaWwAAAAAKUqRjg==", "height": 1830709, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FahA1ajcuPw4vJUJyqEyHzpCgC1tQUzF7v53FJHnBoKw Next: 2FGZ5SgWZntFfzCSZ26AS6hmPpYAtSaMiU8FJA1nwrFv Diff:
Old | New | Differences | |
---|---|---|---|
92 | 92 | else ("" + (if (v) | |
93 | 93 | then getStringValue(toBase58String(d.caller.bytes)) | |
94 | 94 | else ("" + (if (w) | |
95 | - | then | |
95 | + | then "received" | |
96 | 96 | else "")))))) | |
97 | - | else " | |
97 | + | else "can`t 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))] |
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 | - | then | |
95 | + | then "received" | |
96 | 96 | else "")))))) | |
97 | - | else " | |
97 | + | else "can`t 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 | 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 | 168 | let K = if ((E == 0)) | |
169 | 169 | then (J[0] + "|bought1") | |
170 | 170 | else if ((E == 1)) | |
171 | 171 | then (J[0] + "|bought1|bought2") | |
172 | 172 | else "" | |
173 | 173 | let L = if (if (if (B) | |
174 | 174 | then F | |
175 | 175 | else false) | |
176 | 176 | then H | |
177 | 177 | else false) | |
178 | 178 | then true | |
179 | 179 | else false | |
180 | 180 | if (L) | |
181 | 181 | then [StringEntry(toBase58String(d.caller.bytes), K), ScriptTransfer(c, G, unit), ScriptTransfer(o, y, a)] | |
182 | 182 | else [StringEntry((toBase58String(d.caller.bytes) + "_buy"), I)] | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 |
github/deemru/w8io/026f985 32.58 ms ◑