tx · 7Y2YBguTGHyXmEUHTZgbTFtoRukTvNPfUiwjesLCxf2s 3NAg879tKUJh949h21umkwiaRQhwZftz1BE: -0.05000000 Waves 2019.09.03 16:53 [659894] smart account 3NAg879tKUJh949h21umkwiaRQhwZftz1BE > SELF 0.00000000 Waves
{ "type": 13, "id": "7Y2YBguTGHyXmEUHTZgbTFtoRukTvNPfUiwjesLCxf2s", "fee": 5000000, "feeAssetId": null, "timestamp": 1567518915458, "version": 1, "sender": "3NAg879tKUJh949h21umkwiaRQhwZftz1BE", "senderPublicKey": "BqY2jhkQCcbidtQdQZu6f9RV3AkFAS8VPToHxwYu1KdJ", "proofs": [ "4uKuxPtq5m8JnFMhCDsRJMuVneQefre5xFNwAR2e1NLDDTFdfNGFqb2riMJA5hUGZzk2oRgvPCtLtfwSPUPDzavw" ], "script": "base64:AAIDAAAAAAAAAAAAAAAUAAAAAAN3dnMAAAAAAAX14QAAAAAAFHRpY2tlckFsbG93ZWRMZXR0ZXJzAgAAABpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWgAAAAANdGlja2VyRXhhbXBsZQIAAAADQlRDAAAAAA90aWNrZXJNaW5MZW5ndGgAAAAAAAAAAAEAAAAAD3RpY2tlck1heExlbmd0aAAAAAAAAAAABgAAAAAWZGVzY3JpcHRpb25VcGRhdGVQcmljZQkAAGgAAAACAAAAAAAAAAABBQAAAAN3dnMAAAAAD2xpbmtVcGRhdGVQcmljZQkAAGgAAAACAAAAAAAAAAABBQAAAAN3dnMAAAAAEXRpY2tlclVwZGF0ZVByaWNlCQAAaAAAAAIAAAAAAAAAAAIFAAAAA3d2cwAAAAAcdGlja2VyQ2F0YWxvZ3VlT3JhY2xlQWRkcmVzcwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABAgAAACMzTXhIeFc1VldxNEtyV2NiaEZmeEtyYWZYbTRtTDZyWkhmagAAAAAYdG9rZW5SYXRpbmdPcmFjbGVBZGRyZXNzCQEAAAAcQGV4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2aWNlIGNhbiBvbmx5IGJlIHBhaWQgaW4gd2F2ZXMAAAAAHdsF2Q==", "chainId": 84, "height": 659894, "spentComplexity": 0 } View: original | compacted Prev: 6PhuUpNa9j7NF6xGXe35tR3Pxh4ScukzJ6u1Y2rY9Kts Next: DVu3TitB8GhonEtmF4yZ91Xh9z5dqcFbKBVNxybsuymJ Diff:
Old | New | Differences | |
---|---|---|---|
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | - | func v (w) = { | |
63 | - | let x = split(w, "") | |
64 | - | let y = size(x) | |
65 | - | let z = r(b, x[0]) | |
66 | - | let A = r(b, x[1]) | |
67 | - | let B = r(b, x[2]) | |
68 | - | let C = r(b, x[3]) | |
69 | - | let D = r(b, x[4]) | |
70 | - | let E = r(b, x[5]) | |
71 | - | if ((w != "")) | |
72 | - | then if (if ((y >= d)) | |
73 | - | then (e >= y) | |
62 | + | func v (w) = if (if ((w == "WAVES")) | |
63 | + | then true | |
64 | + | else (w == "")) | |
65 | + | then unit | |
66 | + | else fromBase58String(w) | |
67 | + | ||
68 | + | ||
69 | + | func x (y) = { | |
70 | + | let z = split(y, "") | |
71 | + | let A = size(z) | |
72 | + | let B = r(b, z[0]) | |
73 | + | let C = r(b, z[1]) | |
74 | + | let D = r(b, z[2]) | |
75 | + | let E = r(b, z[3]) | |
76 | + | let F = r(b, z[4]) | |
77 | + | let G = r(b, z[5]) | |
78 | + | if ((y != "")) | |
79 | + | then if (if ((A >= d)) | |
80 | + | then (e >= A) | |
74 | 81 | else false) | |
75 | - | then if ((1 == | |
76 | - | then | |
77 | - | else if ((2 == | |
78 | - | then if ( | |
79 | - | then | |
82 | + | then if ((1 == A)) | |
83 | + | then B | |
84 | + | else if ((2 == A)) | |
85 | + | then if (B) | |
86 | + | then C | |
80 | 87 | else false | |
81 | - | else if ((3 == | |
82 | - | then if (if ( | |
83 | - | then | |
88 | + | else if ((3 == A)) | |
89 | + | then if (if (B) | |
90 | + | then C | |
84 | 91 | else false) | |
85 | - | then | |
92 | + | then D | |
86 | 93 | else false | |
87 | - | else if ((4 == | |
88 | - | then if (if (if ( | |
89 | - | then | |
94 | + | else if ((4 == A)) | |
95 | + | then if (if (if (B) | |
96 | + | then C | |
90 | 97 | else false) | |
91 | - | then | |
98 | + | then D | |
92 | 99 | else false) | |
93 | - | then | |
100 | + | then E | |
94 | 101 | else false | |
95 | - | else if ((5 == y)) | |
96 | - | then if (if (if (if (z) | |
97 | - | then A | |
98 | - | else false) | |
99 | - | then B | |
100 | - | else false) | |
102 | + | else if ((5 == A)) | |
103 | + | then if (if (if (if (B) | |
101 | 104 | then C | |
102 | 105 | else false) | |
103 | 106 | then D | |
107 | + | else false) | |
108 | + | then E | |
109 | + | else false) | |
110 | + | then F | |
104 | 111 | else false | |
105 | - | else if ((6 == y)) | |
106 | - | then if (if (if (if (if (z) | |
107 | - | then A | |
108 | - | else false) | |
109 | - | then B | |
110 | - | else false) | |
112 | + | else if ((6 == A)) | |
113 | + | then if (if (if (if (if (B) | |
111 | 114 | then C | |
112 | 115 | else false) | |
113 | 116 | then D | |
114 | 117 | else false) | |
115 | 118 | then E | |
119 | + | else false) | |
120 | + | then F | |
121 | + | else false) | |
122 | + | then G | |
116 | 123 | else false | |
117 | 124 | else false | |
118 | 125 | else false | |
120 | 127 | } | |
121 | 128 | ||
122 | 129 | ||
123 | - | func | |
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | ( | |
130 | + | func H (w) = { | |
131 | + | let I = (("assetRating_" + w) + "_1") | |
132 | + | let J = p(j, I) | |
133 | + | let K = p(j, "assetRating_1") | |
134 | + | (J >= K) | |
128 | 135 | } | |
129 | 136 | ||
130 | 137 | ||
131 | - | func | |
132 | - | let | |
133 | - | let | |
134 | - | let | |
135 | - | ( | |
138 | + | func L (w) = { | |
139 | + | let M = "assetWeight" | |
140 | + | let N = p(j, M) | |
141 | + | let O = p(j, "assetWeight") | |
142 | + | (N >= O) | |
136 | 143 | } | |
137 | 144 | ||
138 | 145 | ||
139 | - | func | |
140 | - | let | |
141 | - | let | |
142 | - | let | |
143 | - | ( | |
146 | + | func P (w) = { | |
147 | + | let Q = "assetVotes" | |
148 | + | let R = p(j, Q) | |
149 | + | let S = p(j, "assetVotes") | |
150 | + | (R >= S) | |
144 | 151 | } | |
145 | 152 | ||
146 | 153 | ||
147 | - | func | |
148 | - | then | |
154 | + | func T (w) = if (if (H(w)) | |
155 | + | then L(w) | |
149 | 156 | else false) | |
150 | - | then | |
157 | + | then P(w) | |
151 | 158 | else false | |
152 | 159 | ||
153 | 160 | ||
161 | + | func U (w) = { | |
162 | + | let n = assetInfo(fromBase58String(w)) | |
163 | + | if ($isInstanceOf(n, "Asset")) | |
164 | + | then { | |
165 | + | let V = n | |
166 | + | V | |
167 | + | } | |
168 | + | else unit | |
169 | + | } | |
170 | + | ||
171 | + | ||
154 | 172 | @Callable(q) | |
155 | - | func updateTicker (G,T,w) = { | |
156 | - | let U = extract(q.payment) | |
157 | - | let V = toBase58String(q.caller.bytes) | |
158 | - | let W = ((("issuerTicker_" + "<") + G) + ">") | |
159 | - | let X = k(i, w) | |
160 | - | if (!(isDefined(U.assetId))) | |
161 | - | then if ((U.amount >= h)) | |
162 | - | then if ((V == T)) | |
163 | - | then if (S(G)) | |
164 | - | then if ((X == unit)) | |
165 | - | then if (v(w)) | |
166 | - | then WriteSet([DataEntry(W, w)]) | |
173 | + | func updateTicker (w,y) = { | |
174 | + | let W = extract(q.payment) | |
175 | + | let X = toBase58String(q.caller.bytes) | |
176 | + | let Y = ((("issuerTicker_" + "<") + w) + ">") | |
177 | + | let Z = k(i, y) | |
178 | + | let aa = toString(valueOrErrorMessage(assetInfo(fromBase58String(w)), "there is no asset with such id").issuer) | |
179 | + | if (!(isDefined(W.assetId))) | |
180 | + | then if ((W.amount >= h)) | |
181 | + | then if ((X == aa)) | |
182 | + | then if (T(w)) | |
183 | + | then if ((Z == unit)) | |
184 | + | then if (x(y)) | |
185 | + | then WriteSet([DataEntry(Y, y)]) | |
167 | 186 | else throw("error#5. Ticker should consist of 1-6 capital Latin characters.") | |
168 | 187 | else throw("error#4. Asset with such ticker is already exist") | |
169 | 188 | else throw("error#3. Too little rating") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 100000000 | |
5 | 5 | ||
6 | 6 | let b = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
7 | 7 | ||
8 | 8 | let c = "BTC" | |
9 | 9 | ||
10 | 10 | let d = 1 | |
11 | 11 | ||
12 | 12 | let e = 6 | |
13 | 13 | ||
14 | 14 | let f = (1 * a) | |
15 | 15 | ||
16 | 16 | let g = (1 * a) | |
17 | 17 | ||
18 | 18 | let h = (2 * a) | |
19 | 19 | ||
20 | 20 | let i = addressFromStringValue("3MxHxW5VWq4KrWcbhFfxKrafXm4mL6rZHfj") | |
21 | 21 | ||
22 | 22 | let j = addressFromStringValue("3NADqHoLMbMTfXdP2TeBBSx5mQXePVj3KZm") | |
23 | 23 | ||
24 | 24 | func k (l,m) = { | |
25 | 25 | let n = getString(l, m) | |
26 | 26 | if ($isInstanceOf(n, "String")) | |
27 | 27 | then { | |
28 | 28 | let o = n | |
29 | 29 | o | |
30 | 30 | } | |
31 | 31 | else unit | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func p (l,m) = { | |
36 | 36 | let n = getInteger(l, m) | |
37 | 37 | if ($isInstanceOf(n, "Int")) | |
38 | 38 | then { | |
39 | 39 | let q = n | |
40 | 40 | q | |
41 | 41 | } | |
42 | 42 | else 0 | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func r (s,t) = { | |
47 | 47 | let n = indexOf(s, t) | |
48 | 48 | if ($isInstanceOf(n, "Int")) | |
49 | 49 | then { | |
50 | 50 | let u = n | |
51 | 51 | true | |
52 | 52 | } | |
53 | 53 | else if ($isInstanceOf(n, "Unit")) | |
54 | 54 | then { | |
55 | 55 | let u = n | |
56 | 56 | false | |
57 | 57 | } | |
58 | 58 | else throw() | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | - | func v (w) = { | |
63 | - | let x = split(w, "") | |
64 | - | let y = size(x) | |
65 | - | let z = r(b, x[0]) | |
66 | - | let A = r(b, x[1]) | |
67 | - | let B = r(b, x[2]) | |
68 | - | let C = r(b, x[3]) | |
69 | - | let D = r(b, x[4]) | |
70 | - | let E = r(b, x[5]) | |
71 | - | if ((w != "")) | |
72 | - | then if (if ((y >= d)) | |
73 | - | then (e >= y) | |
62 | + | func v (w) = if (if ((w == "WAVES")) | |
63 | + | then true | |
64 | + | else (w == "")) | |
65 | + | then unit | |
66 | + | else fromBase58String(w) | |
67 | + | ||
68 | + | ||
69 | + | func x (y) = { | |
70 | + | let z = split(y, "") | |
71 | + | let A = size(z) | |
72 | + | let B = r(b, z[0]) | |
73 | + | let C = r(b, z[1]) | |
74 | + | let D = r(b, z[2]) | |
75 | + | let E = r(b, z[3]) | |
76 | + | let F = r(b, z[4]) | |
77 | + | let G = r(b, z[5]) | |
78 | + | if ((y != "")) | |
79 | + | then if (if ((A >= d)) | |
80 | + | then (e >= A) | |
74 | 81 | else false) | |
75 | - | then if ((1 == | |
76 | - | then | |
77 | - | else if ((2 == | |
78 | - | then if ( | |
79 | - | then | |
82 | + | then if ((1 == A)) | |
83 | + | then B | |
84 | + | else if ((2 == A)) | |
85 | + | then if (B) | |
86 | + | then C | |
80 | 87 | else false | |
81 | - | else if ((3 == | |
82 | - | then if (if ( | |
83 | - | then | |
88 | + | else if ((3 == A)) | |
89 | + | then if (if (B) | |
90 | + | then C | |
84 | 91 | else false) | |
85 | - | then | |
92 | + | then D | |
86 | 93 | else false | |
87 | - | else if ((4 == | |
88 | - | then if (if (if ( | |
89 | - | then | |
94 | + | else if ((4 == A)) | |
95 | + | then if (if (if (B) | |
96 | + | then C | |
90 | 97 | else false) | |
91 | - | then | |
98 | + | then D | |
92 | 99 | else false) | |
93 | - | then | |
100 | + | then E | |
94 | 101 | else false | |
95 | - | else if ((5 == y)) | |
96 | - | then if (if (if (if (z) | |
97 | - | then A | |
98 | - | else false) | |
99 | - | then B | |
100 | - | else false) | |
102 | + | else if ((5 == A)) | |
103 | + | then if (if (if (if (B) | |
101 | 104 | then C | |
102 | 105 | else false) | |
103 | 106 | then D | |
107 | + | else false) | |
108 | + | then E | |
109 | + | else false) | |
110 | + | then F | |
104 | 111 | else false | |
105 | - | else if ((6 == y)) | |
106 | - | then if (if (if (if (if (z) | |
107 | - | then A | |
108 | - | else false) | |
109 | - | then B | |
110 | - | else false) | |
112 | + | else if ((6 == A)) | |
113 | + | then if (if (if (if (if (B) | |
111 | 114 | then C | |
112 | 115 | else false) | |
113 | 116 | then D | |
114 | 117 | else false) | |
115 | 118 | then E | |
119 | + | else false) | |
120 | + | then F | |
121 | + | else false) | |
122 | + | then G | |
116 | 123 | else false | |
117 | 124 | else false | |
118 | 125 | else false | |
119 | 126 | else false | |
120 | 127 | } | |
121 | 128 | ||
122 | 129 | ||
123 | - | func | |
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | ( | |
130 | + | func H (w) = { | |
131 | + | let I = (("assetRating_" + w) + "_1") | |
132 | + | let J = p(j, I) | |
133 | + | let K = p(j, "assetRating_1") | |
134 | + | (J >= K) | |
128 | 135 | } | |
129 | 136 | ||
130 | 137 | ||
131 | - | func | |
132 | - | let | |
133 | - | let | |
134 | - | let | |
135 | - | ( | |
138 | + | func L (w) = { | |
139 | + | let M = "assetWeight" | |
140 | + | let N = p(j, M) | |
141 | + | let O = p(j, "assetWeight") | |
142 | + | (N >= O) | |
136 | 143 | } | |
137 | 144 | ||
138 | 145 | ||
139 | - | func | |
140 | - | let | |
141 | - | let | |
142 | - | let | |
143 | - | ( | |
146 | + | func P (w) = { | |
147 | + | let Q = "assetVotes" | |
148 | + | let R = p(j, Q) | |
149 | + | let S = p(j, "assetVotes") | |
150 | + | (R >= S) | |
144 | 151 | } | |
145 | 152 | ||
146 | 153 | ||
147 | - | func | |
148 | - | then | |
154 | + | func T (w) = if (if (H(w)) | |
155 | + | then L(w) | |
149 | 156 | else false) | |
150 | - | then | |
157 | + | then P(w) | |
151 | 158 | else false | |
152 | 159 | ||
153 | 160 | ||
161 | + | func U (w) = { | |
162 | + | let n = assetInfo(fromBase58String(w)) | |
163 | + | if ($isInstanceOf(n, "Asset")) | |
164 | + | then { | |
165 | + | let V = n | |
166 | + | V | |
167 | + | } | |
168 | + | else unit | |
169 | + | } | |
170 | + | ||
171 | + | ||
154 | 172 | @Callable(q) | |
155 | - | func updateTicker (G,T,w) = { | |
156 | - | let U = extract(q.payment) | |
157 | - | let V = toBase58String(q.caller.bytes) | |
158 | - | let W = ((("issuerTicker_" + "<") + G) + ">") | |
159 | - | let X = k(i, w) | |
160 | - | if (!(isDefined(U.assetId))) | |
161 | - | then if ((U.amount >= h)) | |
162 | - | then if ((V == T)) | |
163 | - | then if (S(G)) | |
164 | - | then if ((X == unit)) | |
165 | - | then if (v(w)) | |
166 | - | then WriteSet([DataEntry(W, w)]) | |
173 | + | func updateTicker (w,y) = { | |
174 | + | let W = extract(q.payment) | |
175 | + | let X = toBase58String(q.caller.bytes) | |
176 | + | let Y = ((("issuerTicker_" + "<") + w) + ">") | |
177 | + | let Z = k(i, y) | |
178 | + | let aa = toString(valueOrErrorMessage(assetInfo(fromBase58String(w)), "there is no asset with such id").issuer) | |
179 | + | if (!(isDefined(W.assetId))) | |
180 | + | then if ((W.amount >= h)) | |
181 | + | then if ((X == aa)) | |
182 | + | then if (T(w)) | |
183 | + | then if ((Z == unit)) | |
184 | + | then if (x(y)) | |
185 | + | then WriteSet([DataEntry(Y, y)]) | |
167 | 186 | else throw("error#5. Ticker should consist of 1-6 capital Latin characters.") | |
168 | 187 | else throw("error#4. Asset with such ticker is already exist") | |
169 | 188 | else throw("error#3. Too little rating") | |
170 | 189 | else throw("error#2. Only asset issuer can update asset ticker") | |
171 | 190 | else throw("error#2. Insufficient payment for asset ticker update service.") | |
172 | 191 | else throw("error#1. The service can only be paid in waves") | |
173 | 192 | } | |
174 | 193 | ||
175 | 194 |
github/deemru/w8io/169f3d6 73.29 ms ◑