tx · 7nG4pPaSdYZJTLh3NxZg67JpN81vB7MmohX14N9SSJ8C

3NC8pQxcnDTtDkhzv5Eje8qqW4qoFawLnAb:  -0.01400000 Waves

2019.09.18 10:29 [681396] smart account 3NC8pQxcnDTtDkhzv5Eje8qqW4qoFawLnAb > SELF 0.00000000 Waves

{ "type": 13, "id": "7nG4pPaSdYZJTLh3NxZg67JpN81vB7MmohX14N9SSJ8C", "fee": 1400000, "feeAssetId": null, "timestamp": 1568791793443, "version": 1, "sender": "3NC8pQxcnDTtDkhzv5Eje8qqW4qoFawLnAb", "senderPublicKey": "5vyi92HdgdTabKCQzDHGrgQ4ASjtoT3XrCUXr459sWuc", "proofs": [ "4MFXEoVYtSzMxuqjBVBH6fHY952T8ksQJ8XdAK8j2GBHEGVfgUhC5Pfcbcj8VfFrxRhHgLBj6nbeu1LUMzZVWAtm" ], "script": "base64:AAIDAAAAAAAAAAAAAAAhAAAAAAROT05FAgAAAAABAAAAGGdldE51bWJlckJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAA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xAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAQTmV1dHJpbm9Db250cmFjdAUAAAAMcmV0dXJuQW1vdW50BQAAAAtCb25kQXNzZXRJZAUAAAADbmlsAAAAAKIbP0w=", "chainId": 84, "height": 681396, "spentComplexity": 0 } View: original | compacted Prev: 89LfcTiNBMzaxjA7xgyu2xBzxas4CEJA2AMi4Sx9at9v Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = ""
55
66 func b (c,d) = {
77 let e = getInteger(addressFromStringValue(c), d)
88 if ($isInstanceOf(e, "Int"))
99 then {
1010 let f = e
1111 f
1212 }
1313 else 0
1414 }
1515
1616
1717 func g (d) = {
1818 let e = getInteger(this, d)
1919 if ($isInstanceOf(e, "Int"))
2020 then {
2121 let f = e
2222 f
2323 }
2424 else 0
2525 }
2626
2727
2828 func h (d) = {
2929 let e = getString(this, d)
3030 if ($isInstanceOf(e, "String"))
3131 then {
3232 let f = e
3333 f
3434 }
3535 else a
3636 }
3737
3838
3939 let i = "orderbook"
4040
4141 let j = "order_price_"
4242
4343 let k = "order_total_"
4444
4545 let l = "order_filled_total_"
4646
4747 let m = "order_owner_"
4848
4949 let n = "order_height_"
5050
5151 let o = "order_status_"
5252
5353 let p = "price"
5454
5555 let q = "bond_asset_id"
5656
5757 let r = "neutrino_asset_id"
5858
5959 let s = "neutrino_contract"
6060
6161 let t = h(i)
6262
6363 func u (v) = g((j + v))
6464
6565
6666 func w (v) = g((k + v))
6767
6868
6969 func x (v) = h((m + v))
7070
7171
7272 func y (v) = h((o + v))
7373
7474
7575 func z (v) = g((l + v))
7676
7777
7878 let A = fromBase58String(h(r))
7979
8080 let B = h(s)
8181
8282 let C = wavesBalance(addressFromStringValue(B))
8383
8484 let D = {
8585 let E = extract(assetInfo(A))
8686 (E.quantity - assetBalance(addressFromStringValue(B), A))
8787 }
8888
8989 let F = b(B, p)
9090
9191 let G = "_"
9292
9393 let H = fromBase58String(h(q))
9494
9595 let I = 100000000
9696
9797 let J = "canceled"
9898
9999 let K = "new"
100100
101101 let L = "filled"
102102
103103 func M (N,O) = {
104104 let P = split(t, G)
105105 let Q = (N + G)
106106 if ((O == 0))
107107 then (Q + t)
108108 else if ((O >= (size(P) - 1)))
109109 then (t + Q)
110110 else {
111111 let R = split(t, (P[O] + G))
112112 (((R[0] + Q) + (P[O] + G)) + R[1])
113113 }
114114 }
115115
116116
117117 @Callable(S)
118118 func setOrder (F,O) = {
119119 let T = extract(S.payment)
120120 let U = toBase58String(keccak256((((toBytes(F) + toBytes(T.amount)) + S.caller.bytes) + toBytes(height))))
121121 if ((T.assetId != A))
122122 then throw("can use neutrino only")
123123 else if ((0 >= F))
124124 then throw("price less zero")
125125 else if ((x(U) != a))
126126 then throw("order exists")
127127 else {
128128 let P = split(t, G)
129129 let V = if ((O == 0))
130130 then ""
131131 else P[(O - 1)]
132132 let W = u(V)
133133 let X = if (if ((V != ""))
134134 then (F > W)
135135 else false)
136136 then true
137137 else false
138138 let Y = P[O]
139139 let Z = u(Y)
140140 let aa = if ((Z >= F))
141141 then true
142142 else false
143143 if (if (X)
144144 then true
145145 else aa)
146146 then throw(((("invalid order isPrevOrderError:" + toString(aa)) + " isNextOrderError:") + toString(X)))
147147 else WriteSet([DataEntry(i, M(U, O)), DataEntry((j + U), F), DataEntry((k + U), T.amount), DataEntry((m + U), toString(S.caller)), DataEntry((n + U), height), DataEntry((o + U), K)])
148148 }
149149 }
150150
151151
152152
153153 @Callable(S)
154154 func cancelOrder (N) = {
155155 let ab = x(N)
156156 let ac = (w(N) - z(N))
157157 if ((ab != toString(S.caller)))
158158 then throw("permission denied")
159159 else {
160160 let R = split(t, (N + G))
161161 ScriptResult(WriteSet([DataEntry(i, (R[0] + R[1])), DataEntry((o + N), J)]), TransferSet([ScriptTransfer(S.caller, ac, A)]))
162162 }
163163 }
164164
165165
166166
167167 @Callable(S)
168168 func executeOrder () = {
169169 let ad = assetBalance(this, H)
170170 let ae = ((D - ((C * F) / 100)) / I)
171171 let af = if ((0 >= ae))
172172 then 0
173173 else ae
174174 let ag = if ((af >= ad))
175175 then ad
176176 else af
177177 let ah = if ((af >= ad))
178178 then 0
179179 else (ad - af)
180180 if ((ag == 0))
181181 then TransferSet([ScriptTransfer(addressFromStringValue(B), ah, H)])
182182 else {
183183 let N = split(t, G)[0]
184184 let ai = z(N)
185185 let aj = w(N)
186186 let ak = u(N)
187187 let al = x(N)
188188 let ac = ((((aj - ai) * 100) / ak) / I)
189189 let am = if ((ag >= ac))
190190 then split(t, (N + G))[1]
191191 else t
192192 let an = if ((ag >= ac))
193193 then ac
194194 else ag
195195 let ao = (((an * ak) / 100) * I)
196196 let ap = if ((ag >= ac))
197197 then L
198198 else K
199199 ScriptResult(WriteSet([DataEntry(i, am), DataEntry((l + N), (ai + ao)), DataEntry((o + N), ap)]), TransferSet([ScriptTransfer(addressFromStringValue(al), an, H), ScriptTransfer(addressFromStringValue(B), ao, A), ScriptTransfer(addressFromStringValue(B), ah, H)]))
200200 }
201201 }
202202
203203

github/deemru/w8io/026f985 
47.67 ms