tx · riQozEsCy9boF9YsGcMyGE2BLfuYxzm1oUd6zJ1zTYq 3MzUQnFjbyi1TY8hFtwGDS8n6HpvVbKui7s: -0.02000000 Waves 2020.05.09 20:12 [990918] smart account 3MzUQnFjbyi1TY8hFtwGDS8n6HpvVbKui7s > SELF 0.00000000 Waves
{ "type": 13, "id": "riQozEsCy9boF9YsGcMyGE2BLfuYxzm1oUd6zJ1zTYq", "fee": 2000000, "feeAssetId": null, "timestamp": 1589044340629, "version": 1, "sender": "3MzUQnFjbyi1TY8hFtwGDS8n6HpvVbKui7s", "senderPublicKey": "387woTgM4ga2rKA8PeeX8v5eKzZsN9pkv7QsT2veEXKV", "proofs": [ "5CNTYWF3oPs9HKqXgzAzEkopWxw6L6P89bhwvYGjdqMAnoUKooNgt7KMeYCMy356YB1TXJpnc7YVJGuga1irrFHP" ], "script": "base64:AAIDAAAAAAAAADkIARIDCgECEgMKAQISAwoBAhIDCgECEgMKAQISAwoBAhIDCgECEgMKAQISAwoBAhIDCgECEgMKAQgAAAAKAQAAAApkZWNvZGVJbnQ4AAAAAgAAAARkYXRhAAAABm9mZnNldAMJAABmAAAAAgAAAAAAAAAAAQkAAMgAAAABBQAAAARkYXRhCQAAAgAAAAECAAAALWRlY29kZSB1OCBlcnJvciwgZGF0YSBtdXN0IGJlIGF0IGxlYXN0IDEgYnl0ZQMJAABmAAAAAgUAAAAGb2Zmc2V0CQAAyAAAAAEFAAAABGRhdGEJAAACAAAAAQIAAAAjZGVjb2RlIHU4IGVycm9yLCBkZWNvZGluZyBpcyBmaW5pc2gEAAAAAngwCQAAyQAAAAIJAADKAAAAAgUAAAAEZGF0YQUAAAAGb2Zmc2V0AAAAAAAAAAABBAAAAAJ4MQkABLIAAAACCQAAywAAAAIBAAAABwAAAAAAAAAFAAAAAngwAAAAAAAAAAAAAwkAAGYAAAACAAAAAAAAAACABQAAAAJ4MQkABEwAAAACBQAAAAJ4MQkABEwAAAACCQAAZAAAAAIFAAAABm9mZnNldAAAAAAAAA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AAABBQAAAARkYXRhAAAAAAAAAAAIBQAAAAZvZmZzZXQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAGnRlc3RfY3V0X2xvbmdfYnl0ZXNfdG9faTY0CQABkQAAAAIFAAAAB2RlY29kZWQAAAAAAAAAAAAFAAAAA25pbAAAAApjb250ZXh0T2JqAQAAAAxzZXRWYWxpZGF0b3IAAAABAAAACXZhbGlkYXRvcgMJAAAAAAAAAggFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyBQAAAAR0aGlzCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAl2YWxpZGF0b3IFAAAACXZhbGlkYXRvcgUAAAADbmlsCQAAAgAAAAECAAAAIU9ubHkgb3duZXIgY2FuIHVzZSB0aGlzIGZ1bmN0aW9uLgAAAApjb250ZXh0T2JqAQAAAApyZXBvcnREYXRhAAAAAQAAAARkYXRhBAAAAAl2YWxpZGF0b3IJAAQcAAAAAgUAAAAEdGhpcwIAAAAJdmFsaWRhdG9yAwkAAAAAAAACCAgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyAAAABWJ5dGVzBQAAAAl2YWxpZGF0b3IJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAADWRhdGFfcmVwb3J0ZWQFAAAABGRhdGEFAAAAA25pbAkAAAIAAAABAgAAACVPbmx5IHZhbGlkYXRvciBjYW4gdXNlIHRoaXMgZnVuY3Rpb24uAAAAAJbG310=", "chainId": 84, "height": 990918, "spentComplexity": 0 } View: original | compacted Prev: 7xhoFceM1rEpZJ5UPSCYMu3hwGWSpSeNgk9kWNE9Hz29 Next: 2XzEnXMoMYQYEfyykAsySZh5j9UA3BSHFV9dWBQ1i7LD Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func decodeInt8 (data,offset) = if ((1 > size(data))) | |
5 | 5 | then throw("decode u8 error, data must be at least 1 byte") | |
6 | 6 | else if ((offset > size(data))) | |
7 | 7 | then throw("decode u8 error, decoding is finish") | |
8 | 8 | else { | |
9 | 9 | let x0 = take(drop(data, offset), 1) | |
10 | 10 | let x1 = toInt((base58'1111111' + x0), 0) | |
11 | 11 | if ((128 > x1)) | |
12 | 12 | then [x1, (offset + 1)] | |
13 | 13 | else [toInt((base58'Ahg1opVcGW' + x0), 0), (offset + 1)] | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func decodeInt16 (data,offset) = if ((2 > size(data))) | |
18 | 18 | then throw("decode u16 error, data must be at least 2 bytes") | |
19 | 19 | else if ((offset > size(data))) | |
20 | 20 | then throw("decode u16 error, decoding is finish") | |
21 | 21 | else { | |
22 | 22 | let x0 = drop(data, offset) | |
23 | 23 | let x1 = take(x0, 1) | |
24 | 24 | let x2 = take(drop(x0, 1), 1) | |
25 | 25 | if ((decodeInt8(x2, 0)[0] >= 0)) | |
26 | 26 | then [toInt(((base58'111111' + x2) + x1), 0), (offset + 2)] | |
27 | 27 | else [toInt(((base58'3CUsUpv9t' + x2) + x1), 0), (offset + 2)] | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func decodeInt32 (data,offset) = if ((4 > size(data))) | |
32 | 32 | then throw("decode u32 error, data must be at least 4 bytes") | |
33 | 33 | else if ((offset > size(data))) | |
34 | 34 | then throw("decode u32 error, decoding is finish") | |
35 | 35 | else { | |
36 | 36 | let x0 = drop(data, offset) | |
37 | 37 | let x1 = take(x0, 1) | |
38 | 38 | let x2 = take(drop(x0, 1), 1) | |
39 | 39 | let x3 = take(drop(x0, 2), 1) | |
40 | 40 | let x4 = take(drop(x0, 3), 1) | |
41 | 41 | if ((decodeInt8(x4, 0)[0] >= 0)) | |
42 | 42 | then [toInt(((((base58'1111' + x4) + x3) + x2) + x1), 0), (offset + 4)] | |
43 | 43 | else [toInt(((((base58'7YXq9G' + x4) + x3) + x2) + x1), 0), (offset + 4)] | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func decodeInt64 (data,offset) = if ((8 > size(data))) | |
48 | 48 | then throw("decode u32 error, data must be at least 8 bytes") | |
49 | 49 | else if ((offset > size(data))) | |
50 | 50 | then throw("decode u32 error, decoding is finish") | |
51 | 51 | else { | |
52 | 52 | let x0 = drop(data, offset) | |
53 | 53 | let x1 = take(x0, 1) | |
54 | 54 | let x2 = take(drop(x0, 1), 1) | |
55 | 55 | let x3 = take(drop(x0, 2), 1) | |
56 | 56 | let x4 = take(drop(x0, 3), 1) | |
57 | 57 | let x5 = take(drop(x0, 4), 1) | |
58 | 58 | let x6 = take(drop(x0, 5), 1) | |
59 | 59 | let x7 = take(drop(x0, 6), 1) | |
60 | 60 | let x8 = take(drop(x0, 7), 1) | |
61 | 61 | [toInt((((((((x8 + x7) + x6) + x5) + x4) + x3) + x2) + x1), 0), (offset + 8)] | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func decodeBool (data,offset) = { | |
66 | 66 | let decoded1 = decodeInt8(data, offset) | |
67 | 67 | [(decoded1[0] != 0), decoded1[1]] | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func decodeBytes32 (data,offset) = if ((32 > size(data))) | |
72 | 72 | then throw("decode bytes32 error, data must be at least 32 bytes") | |
73 | 73 | else [take(drop(data, offset), 32), (offset + 32)] | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func decodeBytes64 (data,offset) = if ((64 > size(data))) | |
77 | 77 | then throw("decode bytes64 error, data must be at least 64 bytes") | |
78 | 78 | else [take(drop(data, offset), 64), (offset + 64)] | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func decodeBytes65 (data,offset) = if ((65 > size(data))) | |
82 | 82 | then throw("decode bytes65 error, data must be at least 65 bytes") | |
83 | 83 | else [take(drop(data, offset), 65), (offset + 65)] | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func decodeBytes (data,offset) = { | |
87 | 87 | let decoded1 = decodeInt32(data, offset) | |
88 | 88 | let bytesSize = decoded1[0] | |
89 | 89 | let nextOffset = decoded1[1] | |
90 | 90 | [take(drop(data, nextOffset), bytesSize), (nextOffset + bytesSize)] | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func decodeString (data,offset) = { | |
95 | 95 | let decoded1 = decodeInt32(data, offset) | |
96 | 96 | let bytesSize = decoded1[0] | |
97 | 97 | let nextOffset = decoded1[1] | |
98 | 98 | [toUtf8String(take(drop(data, nextOffset), bytesSize)), (nextOffset + bytesSize)] | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(contextObj) | |
103 | 103 | func testDecodeInt16 (data) = { | |
104 | 104 | let offset = 0 | |
105 | 105 | let x1 = decodeInt16(data, offset) | |
106 | 106 | WriteSet([DataEntry("i16", x1[0])]) | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | ||
111 | 111 | @Callable(contextObj) | |
112 | 112 | func testDecodeInt64 (data) = { | |
113 | 113 | let offset = 0 | |
114 | 114 | let decoded = decodeInt64(data, offset) | |
115 | 115 | WriteSet([DataEntry("i64", decoded[0])]) | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(contextObj) | |
121 | 121 | func testDecodeString (data) = { | |
122 | 122 | let offset = 0 | |
123 | 123 | let decoded = decodeString(data, offset) | |
124 | 124 | WriteSet([DataEntry("string", decoded[0])]) | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | ||
129 | 129 | @Callable(contextObj) | |
130 | 130 | func testDecodeBytes (data) = { | |
131 | 131 | let offset = 0 | |
132 | 132 | let decoded = decodeBytes(data, offset) | |
133 | 133 | WriteSet([DataEntry("bytes", decoded[0])]) | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(contextObj) | |
139 | 139 | func testCryptoPrice (data) = { | |
140 | 140 | let offset = 0 | |
141 | 141 | let x1 = decodeString(data, offset) | |
142 | 142 | match x1[1] { | |
143 | 143 | case t: Int => | |
144 | 144 | let x2 = decodeInt64(data, t) | |
145 | 145 | WriteSet([DataEntry("symbol", x1[0]), DataEntry("multiplier", x2[0])]) | |
146 | 146 | case _ => | |
147 | 147 | throw("error decoding") | |
148 | 148 | } | |
149 | 149 | } | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | 153 | @Callable(contextObj) | |
154 | 154 | func testDecodeBytes32 (data) = { | |
155 | 155 | let offset = 0 | |
156 | 156 | let decoded = decodeBytes32(data, offset) | |
157 | 157 | WriteSet([DataEntry("bytes", decoded[0])]) | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | ||
162 | 162 | @Callable(contextObj) | |
163 | 163 | func testIntFromBytes (data) = WriteSet([DataEntry("bytesToInt", toInt(data, 0))]) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | ||
167 | 167 | @Callable(contextObj) | |
168 | 168 | func testStringFromBytes (data) = WriteSet([DataEntry("bytesToString", toUtf8String(data))]) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | ||
172 | 172 | @Callable(contextObj) | |
173 | 173 | func testCutLongBytes (data) = { | |
174 | 174 | let offset = 0 | |
175 | 175 | let decoded = decodeInt64(drop(data, (size(data) - 8)), offset) | |
176 | 176 | WriteSet([DataEntry("test_cut_long_bytes_to_i64", decoded[0])]) | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | ||
181 | 181 | @Callable(contextObj) | |
182 | 182 | func setValidator (validator) = if ((contextObj.caller == this)) | |
183 | 183 | then WriteSet([DataEntry("validator", validator)]) | |
184 | 184 | else throw("Only owner can use this function.") | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | ||
188 | 188 | @Callable(contextObj) | |
189 | 189 | func reportData (data) = { | |
190 | 190 | let validator = getBinary(this, "validator") | |
191 | 191 | if ((contextObj.caller.bytes == validator)) | |
192 | 192 | then WriteSet([DataEntry("data_reported", data)]) | |
193 | 193 | else throw("Only validator can use this function.") | |
194 | 194 | } | |
195 | 195 | ||
196 | 196 |
github/deemru/w8io/026f985 33.66 ms ◑