tx · 7mJuQS8u1XieDcy1ycZm3JZ5cL7ssRP1FyK45y1HGQcw 3N9VosR3hnKXUCNNLdCynZ95d34LgMPjX5k: -0.01000000 Waves 2019.06.21 22:44 [552217] smart account 3N9VosR3hnKXUCNNLdCynZ95d34LgMPjX5k > SELF 0.00000000 Waves
{ "type": 13, "id": "7mJuQS8u1XieDcy1ycZm3JZ5cL7ssRP1FyK45y1HGQcw", "fee": 1000000, "feeAssetId": null, "timestamp": 1561146293642, "version": 1, "sender": "3N9VosR3hnKXUCNNLdCynZ95d34LgMPjX5k", "senderPublicKey": "74fk4b8sBX5G6Urd4ir7PKvsCYaVBV9LdFo15WJmssax", "proofs": [ "JwpeYvCvrNbf86XQHuTuVqJ7prAC6MuenBvbajCtWuiKRkr1hKfovaW7wnc3UBt81A38Gru4ZFzpzgbXotWMazg" ], "script": "base64:AAIDAAAAAAAAAAAAAAAOAAAAAAhJZHhQcmljZQAAAAAAAAAAAAAAAAAJSWR4QW1vdW50AAAAAAAAAAABAAAAAAxJZHhUcmFkZVBhaXIAAAAAAAAAAAIAAAAADElkeE9yZGVyVHlwZQAAAAAAAAAAAwAAAAAJSWR4U2VuZGVyAAAAAAAAAAAEAAAAAApJZHhBc3NldElkAAAAAAAAAAAFAAAAAANCVVkCAAAAA0JVWQAAAAAEU0VMTAIAAAAEU0VMTAEAAAAZUmVtb3ZlVW5kZXJzY29yZUlmUHJlc2VudAAAAAEAAAAJcmVtYWluaW5nAwkAAGYAAAACCQABMQAAAAEFAAAACXJlbWFpbmluZwAAAAAAAAAAAAkAATAAAAACBQAAAAlyZW1haW5pbmcAAAAAAAAAAAEFAAAACXJlbWFpbmluZwEAAAAPRm9ybWF0RGF0YVBhcmFtAAAAAQAAAAFwBAAAAAFzCQABMQAAAAEFAAAAAXADCQAAAAAAAAIFAAAAAXMAAAAAAAAAAAAJAAACAAAAAQIAAAAlUGFyYW1ldGVyIHNpemUgbXVzdCBiZSBncmVhdGVyIHRoZW4gMAMJAABmAAAAAgU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FbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAZhc3NldDECAAAAAS8FAAAACnByaWNlQXNzZXQFAAAACXRyYWlkUGFpcgUAAAADbmlsAAAAAGVt++M=", "chainId": 84, "height": 552217, "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 (y) = if (if ((y == "WAVES")) | |
69 | + | then true | |
70 | + | else (y == "")) | |
71 | + | then unit | |
72 | + | else fromBase58String(y) | |
73 | + | ||
74 | + | ||
75 | + | @Callable(E) | |
76 | + | func order (y,w) = { | |
77 | + | let F = extract(E.payment) | |
78 | + | let G = if (isDefined(F.assetId)) | |
79 | + | then toBase58String(value(F.assetId)) | |
80 | + | else "WAVES" | |
81 | + | let H = getString(this, ((y + "/") + G)) | |
82 | + | let I = getString(this, ((G + "/") + y)) | |
83 | + | let t = if (isDefined(H)) | |
84 | + | then value(H) | |
85 | + | else if (isDefined(I)) | |
86 | + | then value(I) | |
87 | + | else throw("Traiding for that assets is not supported") | |
88 | + | let v = if (isDefined(H)) | |
89 | + | then g | |
90 | + | else h | |
91 | + | let J = s(t, toBase58String(E.caller.bytes), v, w, F.amount, y) | |
92 | + | WriteSet([DataEntry(toBase58String(E.transactionId), J)]) | |
93 | + | } | |
94 | + | ||
95 | + | ||
96 | + | ||
97 | + | @Callable(E) | |
98 | + | func matchOrders (K,L) = { | |
99 | + | let M = getStringValue(this, K) | |
100 | + | let N = getStringValue(this, L) | |
101 | + | let O = A(M) | |
102 | + | let P = A(N) | |
103 | + | if ((O[c] != P[c])) | |
104 | + | then throw("Trying to match orders from different trading pairs") | |
105 | + | else if ((O[d] == P[d])) | |
106 | + | then throw("Trying to match orders of the same type") | |
107 | + | else { | |
108 | + | let Q = (O[d] == h) | |
109 | + | let R = if (Q) | |
110 | + | then O | |
111 | + | else P | |
112 | + | let S = if (!(Q)) | |
113 | + | then O | |
114 | + | else P | |
115 | + | let T = parseIntValue(R[a]) | |
116 | + | let U = parseIntValue(S[a]) | |
117 | + | let V = parseIntValue(R[b]) | |
118 | + | let W = parseIntValue(S[b]) | |
119 | + | if ((T > U)) | |
120 | + | then throw("Orders are not match by price") | |
121 | + | else { | |
122 | + | let X = T | |
123 | + | let Y = value(assetInfo(value(D(S[f])))).decimals | |
124 | + | let Z = ((W * Y) / X) | |
125 | + | let aa = V | |
126 | + | let ab = if ((Z >= aa)) | |
127 | + | then aa | |
128 | + | else Z | |
129 | + | let ac = (ab * X) | |
130 | + | let ad = s(S[c], S[e], S[d], U, (W - ac), S[f]) | |
131 | + | let ae = s(R[c], R[e], R[d], T, (V - ab), R[f]) | |
132 | + | ScriptResult(WriteSet([DataEntry(if (!(Q)) | |
133 | + | then K | |
134 | + | else L, ad), DataEntry(if (Q) | |
135 | + | then K | |
136 | + | else L, ae)]), TransferSet([ScriptTransfer(addressFromStringValue(S[e]), ab, D(S[f])), ScriptTransfer(addressFromStringValue(R[e]), ac, D(R[f]))])) | |
137 | + | } | |
138 | + | } | |
139 | + | } | |
140 | + | ||
141 | + | ||
142 | + | ||
143 | + | @Callable(E) | |
144 | + | func registerTraidPair (af,ag,t) = WriteSet([DataEntry(((af + "/") + ag), t)]) | |
145 | + | ||
146 | + |
github/deemru/w8io/026f985 24.66 ms ◑