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