tx · AhMRn3xgDQy3hRKexBofpG3TL1LGHrJioNsXtkz854QP 3MwuT7L3uHgGLNHwJEeewRKY5gWMAubjRem: -0.01000000 Waves 2019.06.22 14:32 [553187] smart account 3MwuT7L3uHgGLNHwJEeewRKY5gWMAubjRem > SELF 0.00000000 Waves
{ "type": 13, "id": "AhMRn3xgDQy3hRKexBofpG3TL1LGHrJioNsXtkz854QP", "fee": 1000000, "feeAssetId": null, "timestamp": 1561203170973, "version": 1, "sender": "3MwuT7L3uHgGLNHwJEeewRKY5gWMAubjRem", "senderPublicKey": "4gFTnWxxxBwjT188DTkTQqh6ufD7tUPYAPiYFSBxBGWQ", "proofs": [ "4MQ32bojWo1onsWDKGWaJVp6fTgqdqjXgFF3MhMsZCGatCMnKvaBbGt4R2nteLNKGf39LH8sRu56PTgaY2A9uLwS" ], "script": "base64:AAIDAAAAAAAAAAAAAAAPAAAAAAhJZHhQcmljZQAAAAAAAAAAAAAAAAAJSWR4QW1vdW50AAAAAAAAAAABAAAAAAxJZHhUcmFkZVBhaXIAAAAAAAAAAAIAAAAADElkeE9yZGVyVHlwZQAAAAAAAAAAAwAAAAAJSWR4U2VuZGVyAAAAAAAAAAAEAAAAAApJZHhBc3NldElkAAAAAAAAAAAFAAAAAANCVVkCAAAAA0JVWQAAAAAEU0VMTAIAAAAEU0VMTAEAAAAZUmVtb3ZlVW5kZXJzY29yZUlmUHJlc2VudAAAAAEAAAAJcmVtYWluaW5nAwkAAGYAAAACCQABMQAAAAEFAAAACXJlbWFpbmluZwAAAAAAAAAAAAkAATAAAAACBQAAAAlyZW1haW5pbmcAAAAAAAAAAAEFAAAACXJlbWFpbmluZwEAAAAPRm9ybWF0RGF0YVBhcmFtAAAAAQAAAAFwBAAAAAFzCQABMQAAAAEFAAAAAXADCQAAAAAAAAIFAAAAAXMAAAAAAAAAAAAJAAACAAAAAQIAAAAlUGFyYW1ldGVyIHNpemUgbXVzdCBiZSBncmVhdGVyIHRoZW4gMAMJAABmAAAAAgUAAAAB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gkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAZhc3NldDECAAAAAS8FAAAACnByaWNlQXNzZXQFAAAACXRyYWlkUGFpcgUAAAADbmlsAAAAAJHJjS8=", "chainId": 84, "height": 553187, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = 0 | |
5 | + | ||
6 | + | let b = 1 | |
7 | + | ||
8 | + | let c = 2 | |
9 | + | ||
10 | + | let d = 3 | |
11 | + | ||
12 | + | let e = 4 | |
13 | + | ||
14 | + | let f = 5 | |
15 | + | ||
16 | + | let g = "BUY" | |
17 | + | ||
18 | + | let h = "SELL" | |
19 | + | ||
20 | + | func i (j) = if ((size(j) > 0)) | |
21 | + | then drop(j, 1) | |
22 | + | else j | |
23 | + | ||
24 | + | ||
25 | + | func k (l) = { | |
26 | + | let m = size(l) | |
27 | + | if ((m == 0)) | |
28 | + | then throw("Parameter size must be greater then 0") | |
29 | + | else if ((m > 99)) | |
30 | + | then throw("Parameter size must be less then 100") | |
31 | + | else if ((10 > m)) | |
32 | + | then (("0" + toString(m)) + l) | |
33 | + | else (toString(m) + l) | |
34 | + | } | |
35 | + | ||
36 | + | ||
37 | + | func n (j) = { | |
38 | + | let m = size(j) | |
39 | + | if ((m > 0)) | |
40 | + | then { | |
41 | + | let o = parseIntValue(take(j, 2)) | |
42 | + | let p = take(drop(j, 2), o) | |
43 | + | let q = drop(j, (o + 2)) | |
44 | + | let r = i(q) | |
45 | + | [p, r] | |
46 | + | } | |
47 | + | else throw("Empty string was passed into parseNextAttribute func") | |
48 | + | } | |
49 | + | ||
50 | + | ||
51 | + | func s (t,u,v,w,x,y) = { | |
52 | + | let z = ((((((((((k(t) + "_") + k(u)) + "_") + k(v)) + "_") + k(toString(w))) + "_") + k(toString(x))) + "_") + k(y)) | |
53 | + | z | |
54 | + | } | |
55 | + | ||
56 | + | ||
57 | + | func A (B) = { | |
58 | + | let C = n(B) | |
59 | + | let u = n(C[1]) | |
60 | + | let v = n(u[1]) | |
61 | + | let w = n(v[1]) | |
62 | + | let x = n(w[1]) | |
63 | + | let y = n(x[1]) | |
64 | + | [w[0], x[0], C[0], v[0], u[0], y[0]] | |
65 | + | } | |
66 | + | ||
67 | + | ||
68 | + | func D (E) = if ((E == 0)) | |
69 | + | then 1 | |
70 | + | else if ((E == 1)) | |
71 | + | then 10 | |
72 | + | else if ((E == 2)) | |
73 | + | then 100 | |
74 | + | else if ((E == 3)) | |
75 | + | then 1000 | |
76 | + | else if ((E == 4)) | |
77 | + | then 10000 | |
78 | + | else if ((E == 5)) | |
79 | + | then 100000 | |
80 | + | else if ((E == 6)) | |
81 | + | then 1000000 | |
82 | + | else if ((E == 7)) | |
83 | + | then 10000000 | |
84 | + | else if ((E == 8)) | |
85 | + | then 100000000 | |
86 | + | else if ((E == 9)) | |
87 | + | then 1000000000 | |
88 | + | else if ((E == 10)) | |
89 | + | then 10000000000 | |
90 | + | else if ((E == 11)) | |
91 | + | then 100000000000 | |
92 | + | else if ((E == 12)) | |
93 | + | then 1000000000000 | |
94 | + | else throw("Pow10 more then 12 is not supported") | |
95 | + | ||
96 | + | ||
97 | + | func F (y) = if (if ((y == "WAVES")) | |
98 | + | then true | |
99 | + | else (y == "")) | |
100 | + | then unit | |
101 | + | else fromBase58String(y) | |
102 | + | ||
103 | + | ||
104 | + | @Callable(G) | |
105 | + | func order (y,w) = { | |
106 | + | let H = extract(G.payment) | |
107 | + | let I = if (isDefined(H.assetId)) | |
108 | + | then toBase58String(value(H.assetId)) | |
109 | + | else "WAVES" | |
110 | + | let J = getString(this, ((y + "/") + I)) | |
111 | + | let K = getString(this, ((I + "/") + y)) | |
112 | + | let t = if (isDefined(J)) | |
113 | + | then value(J) | |
114 | + | else if (isDefined(K)) | |
115 | + | then value(K) | |
116 | + | else throw("Traiding for that assets is not supported") | |
117 | + | let v = if (isDefined(J)) | |
118 | + | then g | |
119 | + | else h | |
120 | + | let L = s(t, toBase58String(G.caller.bytes), v, w, H.amount, y) | |
121 | + | WriteSet([DataEntry(toBase58String(G.transactionId), L)]) | |
122 | + | } | |
123 | + | ||
124 | + | ||
125 | + | ||
126 | + | @Callable(G) | |
127 | + | func matchOrders (M,N) = { | |
128 | + | let O = A(getStringValue(this, M)) | |
129 | + | let P = A(getStringValue(this, N)) | |
130 | + | if ((O[c] != P[c])) | |
131 | + | then throw("Trying to match orders from different trading pairs") | |
132 | + | else if ((O[d] == P[d])) | |
133 | + | then throw("Trying to match orders of the same type") | |
134 | + | else { | |
135 | + | let Q = (O[d] == h) | |
136 | + | let R = if (Q) | |
137 | + | then O | |
138 | + | else P | |
139 | + | let S = if (!(Q)) | |
140 | + | then O | |
141 | + | else P | |
142 | + | let T = parseIntValue(R[a]) | |
143 | + | let U = parseIntValue(S[a]) | |
144 | + | let V = parseIntValue(R[b]) | |
145 | + | let W = parseIntValue(S[b]) | |
146 | + | if ((T > U)) | |
147 | + | then throw("Orders are not match by price") | |
148 | + | else { | |
149 | + | let X = T | |
150 | + | let Y = if ((S[f] == "WAVES")) | |
151 | + | then 8 | |
152 | + | else value(assetInfo(value(F(S[f])))).decimals | |
153 | + | let Z = if ((R[f] == "WAVES")) | |
154 | + | then 8 | |
155 | + | else value(assetInfo(value(F(R[f])))).decimals | |
156 | + | let aa = ((W * D(Y)) / X) | |
157 | + | let ab = V | |
158 | + | let ac = if ((aa >= ab)) | |
159 | + | then ab | |
160 | + | else aa | |
161 | + | let ad = ((ac * X) / D(Y)) | |
162 | + | let ae = s(S[c], S[e], S[d], U, (W - ad), S[f]) | |
163 | + | let af = s(R[c], R[e], R[d], T, (V - ac), R[f]) | |
164 | + | ScriptResult(WriteSet([DataEntry(if (!(Q)) | |
165 | + | then M | |
166 | + | else N, ae), DataEntry(if (Q) | |
167 | + | then M | |
168 | + | else N, af)]), TransferSet([ScriptTransfer(addressFromStringValue(S[e]), ac, F(S[f])), ScriptTransfer(addressFromStringValue(R[e]), ad, F(R[f]))])) | |
169 | + | } | |
170 | + | } | |
171 | + | } | |
172 | + | ||
173 | + | ||
174 | + | ||
175 | + | @Callable(G) | |
176 | + | func registerTraidPair (ag,ah,t) = WriteSet([DataEntry(((ag + "/") + ah), t)]) | |
177 | + | ||
178 | + |
github/deemru/w8io/169f3d6 26.95 ms ◑