tx · 7ib7q42TFXW558nKYQh6sBRzhboEFcXwPij2wocAhD61 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N: -0.02000000 Waves 2021.01.22 19:16 [1364903] smart account 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N > SELF 0.00000000 Waves
{ "type": 13, "id": "7ib7q42TFXW558nKYQh6sBRzhboEFcXwPij2wocAhD61", "fee": 2000000, "feeAssetId": null, "timestamp": 1611332173954, "version": 1, "sender": "3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N", "senderPublicKey": "4bj7YXaphTC4Ldx7DqqMmrTjNshRtw1yNsej2XXZcAzS", "proofs": [ "37nsoknN6BqYbVdFTjQmDKrfmJifCswGWjMzNY9uY5sZSkxHAaRRdLqxLdhtEE63YVsHSo6gQMbr4HjjmMmywvYP", "2T2hmJfih59hX8jevUrxJHjDNL3ZT5ingZLhDqLTNM7QjYvEDYF1DjF2jv1sA6WK2aMTDW9chY7xd8LAqQ7nXSef", "5EznK9R5BtUspQwx3Vmco31Ti9u7qUcU2R3djEDoef6NeJz2Dqkm5UQmUPcmkG3MGGu11V4sCWv6maNsr8Yt3vDv" ], "script": "base64:AAIEAAAAAAAAAAkIAhIAEgMKAQgAAABKAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5BwEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzQW5kS2V5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UJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAAD2/UC0g==", "chainId": 84, "height": 1364903, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Er48URK6xZ8SZK2657Gw37FNVN1WN4Ptgk2up7Jk7HNa Next: none Diff:
Old | New | Differences | |
---|---|---|---|
121 | 121 | ||
122 | 122 | let ad = c(y) | |
123 | 123 | ||
124 | - | let ae = | |
124 | + | let ae = value(assetInfo(T)).quantity | |
125 | 125 | ||
126 | - | let af = (( | |
126 | + | let af = (ae - assetBalance(this, T)) | |
127 | 127 | ||
128 | - | let ag = (((1850 * 1000) * i) + ae) | |
129 | - | ||
130 | - | func ah (ai) = a(B(ai)) | |
128 | + | func ag (ah) = a(B(ah)) | |
131 | 129 | ||
132 | 130 | ||
133 | - | func | |
131 | + | func ai (ah) = a(C(ah)) | |
134 | 132 | ||
135 | 133 | ||
136 | - | func | |
134 | + | func aj (ah) = c(D(ah)) | |
137 | 135 | ||
138 | 136 | ||
139 | - | func | |
137 | + | func ak (ah) = c(F(ah)) | |
140 | 138 | ||
141 | 139 | ||
142 | - | func | |
140 | + | func al (ah) = a(G(ah)) | |
143 | 141 | ||
144 | 142 | ||
145 | - | func | |
143 | + | func am (ah) = c(H(ah)) | |
146 | 144 | ||
147 | 145 | ||
148 | - | func | |
146 | + | func an (ah) = c(I(ah)) | |
149 | 147 | ||
150 | 148 | ||
151 | - | func | |
149 | + | func ao (ap) = fraction((100 + ap), V, 100) | |
152 | 150 | ||
153 | 151 | ||
154 | - | func | |
152 | + | func aq (L) = ((k * k) / L) | |
155 | 153 | ||
156 | 154 | ||
157 | - | func | |
155 | + | func ar (as,at) = fraction(as, (i * k), at) | |
158 | 156 | ||
159 | 157 | ||
160 | - | func | |
158 | + | func au (A,av,aw,ax,ay,az,L) = [IntegerEntry(B(A), L), IntegerEntry(C(A), av), IntegerEntry(G(A), aw), StringEntry(D(A), ax), IntegerEntry(E(A), height), StringEntry(F(A), ay), IntegerEntry(("debug_order_currentPrice_" + A), V), IntegerEntry(z(A), az)] | |
161 | 159 | ||
162 | 160 | ||
163 | - | func aB (aC,aD,aE,aF,aG,aH,aI,aJ) = { | |
164 | - | let aK = ap(aF) | |
165 | - | let aL = (aH - aE) | |
166 | - | let aM = N(aL, aK) | |
167 | - | let aN = O(aM, aK) | |
168 | - | let aO = (ab >= aF) | |
169 | - | if (!(aO)) | |
170 | - | then throw(("innapropriate roi: " + toString(aF))) | |
171 | - | else if ((aN == 0)) | |
172 | - | then throw("cannot fill order at the moment") | |
173 | - | else { | |
174 | - | let aP = (aL - aN) | |
175 | - | let aQ = if (aJ) | |
176 | - | then av(aC, aH, (aE + aN), toBase58String(aI.bytes), r, aF, V) | |
177 | - | else [IntegerEntry(G(aC), (aE + aN)), StringEntry(F(aC), r), StringEntry(H(aD), ""), StringEntry(y, aD)] | |
178 | - | (aQ ++ [ScriptTransfer(aI, aM, T), ScriptTransfer(P, aN, unit), ScriptTransfer(aI, aP, unit)]) | |
179 | - | } | |
161 | + | let aA = 0 | |
162 | + | ||
163 | + | let aB = 1 | |
164 | + | ||
165 | + | let aC = 2 | |
166 | + | ||
167 | + | let aD = 3 | |
168 | + | ||
169 | + | let aE = 4 | |
170 | + | ||
171 | + | let aF = 5 | |
172 | + | ||
173 | + | let aG = 6 | |
174 | + | ||
175 | + | func aH (aI,aJ,L,aK,aL) = { | |
176 | + | let aM = 271828100 | |
177 | + | let aN = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
178 | + | let aO = valueOrElse(getInteger(this, "nsbtCurveParam_b"), ((3 * i) / 10)) | |
179 | + | let aP = M(aI, L) | |
180 | + | let aQ = fraction(aP, l, aJ) | |
181 | + | let aR = (aN * (aQ - (1 * l))) | |
182 | + | let aS = pow(aM, m, aR, m, m, DOWN) | |
183 | + | let aT = fraction(aO, aS, i) | |
184 | + | [aN, aO, aP, aQ, aR, aS, aT] | |
180 | 185 | } | |
181 | 186 | ||
182 | 187 | ||
183 | - | func aR (aA,L,aS,aT,aJ) = { | |
184 | - | let aU = value(aT.payments[0]) | |
185 | - | let aV = toBase58String(aT.transactionId) | |
186 | - | if (U) | |
187 | - | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
188 | - | else if ((n > aU.amount)) | |
189 | - | then throw(("min order total equals " + toString(n))) | |
190 | - | else if ((aA > o)) | |
191 | - | then throw("max setOrder ROI is 95%") | |
192 | - | else if ((0 > aA)) | |
193 | - | then throw("can't place order with negative roi") | |
194 | - | else if ((aA == 0)) | |
195 | - | then throw("roi should not be equal to 0") | |
196 | - | else if (isDefined(aU.assetId)) | |
197 | - | then throw("can use waves only") | |
198 | - | else if ((ak(aV) != "")) | |
199 | - | then throw("order exists") | |
200 | - | else if (if ((aS != "")) | |
201 | - | then (al(aS) != q) | |
202 | - | else false) | |
203 | - | then throw("prev order status is not new") | |
204 | - | else { | |
205 | - | let aW = (aS == "") | |
206 | - | let ay = toString(aT.caller) | |
207 | - | let aX = if (aW) | |
208 | - | then ad | |
209 | - | else ao(aS) | |
210 | - | let aY = a(z(aX)) | |
211 | - | let aZ = if (if ((aX != "")) | |
212 | - | then (aA >= aY) | |
213 | - | else false) | |
214 | - | then true | |
215 | - | else false | |
216 | - | let ba = a(z(aS)) | |
217 | - | let bb = if (if ((aS != "")) | |
218 | - | then (ba > aA) | |
219 | - | else false) | |
220 | - | then true | |
221 | - | else false | |
222 | - | if (if (aZ) | |
223 | - | then true | |
224 | - | else bb) | |
225 | - | then throw(((("invalid order isPrevOrderError:" + toString(bb)) + " isNextOrderError:") + toString(aZ))) | |
226 | - | else if (if (aW) | |
227 | - | then (ab >= aA) | |
228 | - | else false) | |
229 | - | then aB(aV, aX, 0, aA, L, aU.amount, aT.caller, true) | |
230 | - | else if (aJ) | |
231 | - | then throw("Instant order couldn't be added into waiting queue") | |
232 | - | else ([StringEntry(H(aV), aS), StringEntry(I(aV), aX), StringEntry(I(aS), if ((aS == "")) | |
233 | - | then "" | |
234 | - | else aV), StringEntry(H(aX), if ((aX == "")) | |
235 | - | then "" | |
236 | - | else aV), StringEntry(y, if (if ((ad == "")) | |
237 | - | then true | |
238 | - | else (ad == aX)) | |
239 | - | then aV | |
240 | - | else ad)] ++ av(aV, aU.amount, 0, ay, q, aA, L)) | |
241 | - | } | |
188 | + | func aU (aI,aJ,L,aK,aL,aV) = { | |
189 | + | let aW = aH(aI, aJ, L, aK, aL) | |
190 | + | let aT = aW[aG] | |
191 | + | let aX = M(aV, L) | |
192 | + | let aY = fraction(aT, aK, i) | |
193 | + | let aZ = fraction(aY, i, (aK - aL)) | |
194 | + | let ba = (fraction(aX, l, i) + fraction(aZ, aK, i)) | |
195 | + | let bb = fraction(aY, l, ba) | |
196 | + | let bc = fraction(bb, aK, l) | |
197 | + | let bd = ((aK - aL) - bc) | |
198 | + | [bd, aX, aI, aJ, aK, aL, aW[aA], aW[aB], aW[aC], L, aW[aD], aW[aE], aW[aF], aT, aY, aZ, ba, bb, bc] | |
242 | 199 | } | |
243 | 200 | ||
244 | 201 | ||
245 | - | let bc = 0 | |
246 | - | ||
247 | - | let bd = 1 | |
248 | - | ||
249 | - | let be = 2 | |
250 | - | ||
251 | - | let bf = 3 | |
252 | - | ||
253 | - | let bg = 4 | |
254 | - | ||
255 | - | let bh = 5 | |
256 | - | ||
257 | - | let bi = 6 | |
258 | - | ||
259 | - | func bj (bk,bl,L,bm,bn) = { | |
260 | - | let bo = 271828100 | |
261 | - | let bp = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
262 | - | let bq = valueOrElse(getInteger(this, "nsbtCurveParam_b"), ((3 * i) / 10)) | |
263 | - | let br = M(bk, L) | |
264 | - | let bs = fraction(br, l, bl) | |
265 | - | let bt = (bp * (bs - (1 * l))) | |
266 | - | let bu = pow(bo, m, bt, m, m, DOWN) | |
267 | - | let bv = fraction(bq, bu, i) | |
268 | - | [bp, bq, br, bs, bt, bu, bv] | |
269 | - | } | |
202 | + | func be (bf,bg) = (((((((((((((((((((((((((((((((((((((((bf + "[nsbtAmountRaw=") + toString(bg[0])) + " usdnPayment=") + toString(bg[1])) + " wRaw=") + toString(bg[2])) + " uRaw=") + toString(bg[3])) + " mRaw=") + toString(bg[4])) + " sRaw=") + toString(bg[5])) + " nsbtCurveParam_a=") + toString(bg[6])) + " nsbtCurveParam_b=") + toString(bg[7])) + " wReservesInUsdn=") + toString(bg[8])) + " price=") + toString(bg[9])) + " multBR=") + toString(bg[10])) + " multPower=") + toString(bg[11])) + " multExpInPower=") + toString(bg[12])) + " multK=") + toString(bg[13])) + " multStepM1=") + toString(bg[14])) + " multStep2=") + toString(bg[15])) + " multStepM3=") + toString(bg[16])) + " multStep4=") + toString(bg[17])) + " stepM5=") + toString(bg[18])) + "]") | |
270 | 203 | ||
271 | 204 | ||
272 | - | func bw (bk,bl,L,bm,bn,bx) = { | |
273 | - | let by = bj(bk, bl, L, bm, bn) | |
274 | - | let bv = by[bi] | |
275 | - | let bz = M(bx, L) | |
276 | - | let bA = fraction(bv, bm, i) | |
277 | - | let bB = fraction(bA, i, (bm - bn)) | |
278 | - | let bC = (fraction(bz, l, i) + fraction(bB, bm, i)) | |
279 | - | let bD = fraction(bA, l, bC) | |
280 | - | let bE = fraction(bD, bm, l) | |
281 | - | let bF = ((bm - bn) - bE) | |
282 | - | [bF, bz, bk, bl, bm, bn, by[bc], by[bd], by[be], L, by[bf], by[bg], by[bh], bv, bA, bB, bC, bD, bE] | |
283 | - | } | |
284 | - | ||
285 | - | ||
286 | - | func bG (bH,bI) = (((((((((((((((((((((((((((((((((((((((bH + "[nsbtAmountRaw=") + toString(bI[0])) + " usdnPayment=") + toString(bI[1])) + " wRaw=") + toString(bI[2])) + " uRaw=") + toString(bI[3])) + " mRaw=") + toString(bI[4])) + " sRaw=") + toString(bI[5])) + " nsbtCurveParam_a=") + toString(bI[6])) + " nsbtCurveParam_b=") + toString(bI[7])) + " wReservesInUsdn=") + toString(bI[8])) + " price=") + toString(bI[9])) + " multBR=") + toString(bI[10])) + " multPower=") + toString(bI[11])) + " multExpInPower=") + toString(bI[12])) + " multK=") + toString(bI[13])) + " multStepM1=") + toString(bI[14])) + " multStep2=") + toString(bI[15])) + " multStepM3=") + toString(bI[16])) + " multStep4=") + toString(bI[17])) + " stepM5=") + toString(bI[18])) + "]") | |
287 | - | ||
288 | - | ||
289 | - | func bJ (bK) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (!(isDefined(transferTransactionById(fromBase58String("PdLw5JK5ppfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))) | |
290 | - | then !(isDefined(transferTransactionById(fromBase58String("adLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
291 | - | else false) | |
292 | - | then !(isDefined(transferTransactionById(fromBase58String("sdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
293 | - | else false) | |
294 | - | then !(isDefined(transferTransactionById(fromBase58String("ddLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
295 | - | else false) | |
296 | - | then !(isDefined(transferTransactionById(fromBase58String("fdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
297 | - | else false) | |
298 | - | then !(isDefined(transferTransactionById(fromBase58String("gdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
299 | - | else false) | |
300 | - | then !(isDefined(transferTransactionById(fromBase58String("hdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
301 | - | else false) | |
302 | - | then !(isDefined(transferTransactionById(fromBase58String("jdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
303 | - | else false) | |
304 | - | then !(isDefined(transferTransactionById(fromBase58String("kdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
305 | - | else false) | |
306 | - | then !(isDefined(transferTransactionById(fromBase58String("rdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
307 | - | else false) | |
308 | - | then !(isDefined(transferTransactionById(fromBase58String("tdLq5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
309 | - | else false) | |
310 | - | then !(isDefined(transferTransactionById(fromBase58String("tdLy5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
311 | - | else false) | |
312 | - | then !(isDefined(transferTransactionById(fromBase58String("tdLu5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
313 | - | else false) | |
314 | - | then !(isDefined(transferTransactionById(fromBase58String("tdLh5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
315 | - | else false) | |
316 | - | then !(isDefined(transferTransactionById(fromBase58String("1dL4JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
317 | - | else false) | |
318 | - | then !(isDefined(transferTransactionById(fromBase58String("2dL25JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
319 | - | else false) | |
320 | - | then !(isDefined(transferTransactionById(fromBase58String("3dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
321 | - | else false) | |
322 | - | then !(isDefined(transferTransactionById(fromBase58String("4dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
323 | - | else false) | |
324 | - | then !(isDefined(transferTransactionById(fromBase58String("5dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
325 | - | else false) | |
326 | - | then !(isDefined(transferTransactionById(fromBase58String("6dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
327 | - | else false) | |
328 | - | then !(isDefined(transferTransactionById(fromBase58String("7dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
329 | - | else false) | |
330 | - | then !(isDefined(transferTransactionById(fromBase58String("8dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
331 | - | else false) | |
332 | - | then !(isDefined(transferTransactionById(fromBase58String("91L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
333 | - | else false) | |
334 | - | then !(isDefined(transferTransactionById(fromBase58String("92L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
335 | - | else false) | |
336 | - | then !(isDefined(transferTransactionById(fromBase58String("93L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
337 | - | else false) | |
338 | - | then !(isDefined(transferTransactionById(fromBase58String("94L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
339 | - | else false | |
340 | - | ||
341 | - | ||
342 | - | func bL () = { | |
343 | - | let by = bj(X, Z, V, af, ag) | |
344 | - | let bv = by[bi] | |
345 | - | let bM = fraction(af, l, (af - ag)) | |
346 | - | let bB = fraction(bM, bM, l) | |
347 | - | let bN = fraction(bv, bB, l) | |
348 | - | let bO = fraction(bN, i, l) | |
349 | - | let bP = fraction(bO, i, V) | |
350 | - | $Tuple2(IntegerEntry("nsbt2usdnPrice", bO), IntegerEntry("nsbt2wavesPrice", bP)) | |
351 | - | } | |
352 | - | ||
353 | - | ||
354 | - | @Callable(bK) | |
355 | - | func nsbtPriceREST () = { | |
356 | - | let bQ = bL() | |
357 | - | let bO = bQ._1.value | |
358 | - | let bP = bQ._2.value | |
359 | - | let bR = makeString(["startNsbtPriceREST", toString(bO), toString(bP), "endNsbtPriceREST"], "__") | |
360 | - | throw(bR) | |
361 | - | } | |
362 | - | ||
363 | - | ||
364 | - | ||
365 | - | @Callable(bK) | |
205 | + | @Callable(bh) | |
366 | 206 | func buyNsbt () = { | |
367 | - | let | |
368 | - | let | |
369 | - | let | |
370 | - | let | |
207 | + | let bi = value(bh.payments[0]) | |
208 | + | let bj = bi.amount | |
209 | + | let bk = bj | |
210 | + | let bl = bh.caller | |
371 | 211 | if (U) | |
372 | 212 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
373 | - | else if (isDefined( | |
213 | + | else if (isDefined(bi.assetId)) | |
374 | 214 | then throw("can use waves only") | |
375 | - | else if (((10 * h) > | |
215 | + | else if (((10 * h) > bj)) | |
376 | 216 | then throw("min 10 waves expected") | |
377 | 217 | else { | |
378 | - | let bI = bw(X, Z, V, af, ag, bT) | |
379 | - | let bV = bI[0] | |
380 | - | let bW = as(bT, bV) | |
381 | - | let aA = (fraction(ar(bW), 100, V) - 100) | |
382 | - | (av(toBase58String(bK.transactionId), bS, bS, toString(bU), r, aA, bW) ++ [ScriptTransfer(bU, bV, T), ScriptTransfer(P, bT, unit), StringEntry("debug_curveResult", bG("curveResult", bI)), IntegerEntry("tmp_issuedNsbt_2", (ae + bV))]) | |
218 | + | let bg = aU(X, Z, V, ae, af, bk) | |
219 | + | let bm = bg[0] | |
220 | + | if ((0 >= bm)) | |
221 | + | then throw("nsbtAmount <= 0") | |
222 | + | else { | |
223 | + | let bn = ar(bk, bm) | |
224 | + | let az = 0 | |
225 | + | (au(toBase58String(bh.transactionId), bj, bj, toString(bl), r, az, bn) ++ [ScriptTransfer(bl, bm, T), ScriptTransfer(P, bk, unit), StringEntry("debug_curveResult", be("curveResult", bg))]) | |
226 | + | } | |
383 | 227 | } | |
384 | 228 | } | |
385 | 229 | ||
386 | 230 | ||
387 | 231 | ||
388 | - | @Callable(bK) | |
389 | - | func instantBuyNsbtOrFail (bX) = { | |
390 | - | let aU = value(bK.payments[0]) | |
391 | - | let aA = ab | |
392 | - | if ((bX > aA)) | |
393 | - | then throw(((("Current maxRoi=" + toString(aA)) + " is less then passed parameter noLessThenRoi=") + toString(bX))) | |
394 | - | else { | |
395 | - | let aK = ap(aA) | |
396 | - | aR(aA, ar(aK), "", bK, true) | |
397 | - | } | |
232 | + | @Callable(bh) | |
233 | + | func cancelOrder (A) = { | |
234 | + | let ax = aj(A) | |
235 | + | let K = (ai(A) - al(A)) | |
236 | + | let bo = toString(bh.caller) | |
237 | + | let bp = an(A) | |
238 | + | let bq = am(A) | |
239 | + | if ((ak(A) != q)) | |
240 | + | then throw("invalid order status") | |
241 | + | else [StringEntry(y, if ((ad == A)) | |
242 | + | then bp | |
243 | + | else ad), StringEntry(I(bq), bp), StringEntry(H(bp), bq), StringEntry(F(A), p), ScriptTransfer(bh.caller, K, unit)] | |
398 | 244 | } | |
399 | 245 | ||
400 | 246 | ||
401 | - | ||
402 | - | @Callable(bK) | |
403 | - | func addBuyBondOrder (L,aS) = { | |
404 | - | let aU = value(bK.payments[0]) | |
405 | - | let aK = ar(L) | |
406 | - | if ((0 >= L)) | |
407 | - | then throw("price less zero") | |
408 | - | else aR(fraction((aK - V), 100, V), L, aS, bK, false) | |
409 | - | } | |
410 | - | ||
411 | - | ||
412 | - | ||
413 | - | @Callable(bK) | |
414 | - | func cancelOrder (A) = { | |
415 | - | let ay = ak(A) | |
416 | - | let K = (aj(A) - am(A)) | |
417 | - | let bY = toString(bK.caller) | |
418 | - | let aX = ao(A) | |
419 | - | let aS = an(A) | |
420 | - | if (U) | |
421 | - | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
422 | - | else if ((ay != bY)) | |
423 | - | then throw("permission denied") | |
424 | - | else if ((al(A) != q)) | |
425 | - | then throw("invalid order status") | |
426 | - | else [StringEntry(y, if ((ad == A)) | |
427 | - | then aX | |
428 | - | else ad), StringEntry(I(aS), aX), StringEntry(H(aX), aS), StringEntry(F(A), p), ScriptTransfer(bK.caller, K, unit)] | |
429 | - | } | |
430 | - | ||
431 | - | ||
432 | - | ||
433 | - | @Callable(bK) | |
434 | - | func sellBond () = if (U) | |
435 | - | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
436 | - | else if ((ad == "")) | |
437 | - | then throw("empty orderbook") | |
438 | - | else { | |
439 | - | let aX = ao(ad) | |
440 | - | let bZ = am(ad) | |
441 | - | let ca = ah(ad) | |
442 | - | let aA = a(z(ad)) | |
443 | - | let cb = aj(ad) | |
444 | - | let aI = Address(fromBase58String(ak(ad))) | |
445 | - | aB(ad, aX, bZ, aA, ca, cb, aI, false) | |
446 | - | } | |
447 | - | ||
448 | - | ||
449 | - | @Verifier(cc) | |
450 | - | func cd () = { | |
451 | - | let ce = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
452 | - | let cf = ((((if (sigVerify(cc.bodyBytes, cc.proofs[0], fromBase58String(ce[0]))) | |
247 | + | @Verifier(br) | |
248 | + | func bs () = { | |
249 | + | let bt = ["GJdLSaLiv5K7xuejac8mcRcHoyo3dPrESrvktG3a6MAR", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
250 | + | let bu = ((((if (sigVerify(br.bodyBytes, br.proofs[0], fromBase58String(bt[0]))) | |
453 | 251 | then 1 | |
454 | - | else 0) + (if (sigVerify( | |
252 | + | else 0) + (if (sigVerify(br.bodyBytes, br.proofs[1], fromBase58String(bt[1]))) | |
455 | 253 | then 1 | |
456 | - | else 0)) + (if (sigVerify( | |
254 | + | else 0)) + (if (sigVerify(br.bodyBytes, br.proofs[2], fromBase58String(bt[2]))) | |
457 | 255 | then 1 | |
458 | - | else 0)) + (if (sigVerify( | |
256 | + | else 0)) + (if (sigVerify(br.bodyBytes, br.proofs[3], fromBase58String(bt[3]))) | |
459 | 257 | then 2 | |
460 | 258 | else 0)) | |
461 | - | ( | |
259 | + | (bu >= 3) | |
462 | 260 | } | |
463 | 261 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = valueOrElse(getInteger(this, b), 0) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func c (b) = valueOrElse(getString(this, b), "") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func d (e,b) = valueOrElse(getBoolean(e, b), false) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func f (e,b) = valueOrElse(getString(e, b), "") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func g (e,b) = valueOrElse(getInteger(e, b), 0) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | let h = 100000000 | |
20 | 20 | ||
21 | 21 | let i = 1000000 | |
22 | 22 | ||
23 | 23 | let j = 6 | |
24 | 24 | ||
25 | 25 | let k = 1000000 | |
26 | 26 | ||
27 | 27 | let l = 100000000 | |
28 | 28 | ||
29 | 29 | let m = 8 | |
30 | 30 | ||
31 | 31 | let n = (10 * h) | |
32 | 32 | ||
33 | 33 | let o = 95 | |
34 | 34 | ||
35 | 35 | let p = "canceled" | |
36 | 36 | ||
37 | 37 | let q = "new" | |
38 | 38 | ||
39 | 39 | let r = "filled" | |
40 | 40 | ||
41 | 41 | let s = "price" | |
42 | 42 | ||
43 | 43 | let t = "bond_asset_id" | |
44 | 44 | ||
45 | 45 | let u = "neutrino_asset_id" | |
46 | 46 | ||
47 | 47 | let v = "balance_lock_" | |
48 | 48 | ||
49 | 49 | let w = (v + "waves") | |
50 | 50 | ||
51 | 51 | let x = (v + "neutrino") | |
52 | 52 | ||
53 | 53 | let y = "order_first" | |
54 | 54 | ||
55 | 55 | func z (A) = ("debug_order_roi_" + A) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func B (A) = ("order_price_" + A) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func C (A) = ("order_total_" + A) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func D (A) = ("order_owner_" + A) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func E (A) = ("order_height_" + A) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func F (A) = ("order_status_" + A) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func G (A) = ("order_filled_total_" + A) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func H (A) = ("order_prev_" + A) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func I (A) = ("order_next_" + A) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func J (K,L) = fraction(fraction(K, k, L), h, i) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func M (K,L) = fraction(fraction(K, L, k), i, h) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func N (K,L) = M(K, L) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func O (K,L) = J(K, L) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | let P = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we') | |
95 | 95 | ||
96 | 96 | let Q = Address(base58'3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx') | |
97 | 97 | ||
98 | 98 | let R = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62') | |
99 | 99 | ||
100 | 100 | let S = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
101 | 101 | ||
102 | 102 | let T = base58'BGhPYquXSK6UYjnPLEn94gFhetp4Jvf7toekEY4x1VDH' | |
103 | 103 | ||
104 | 104 | let U = d(Q, "is_blocked") | |
105 | 105 | ||
106 | 106 | let V = g(Q, s) | |
107 | 107 | ||
108 | 108 | let W = g(P, x) | |
109 | 109 | ||
110 | 110 | let X = (wavesBalance(P).regular - g(P, w)) | |
111 | 111 | ||
112 | 112 | let Y = M(X, V) | |
113 | 113 | ||
114 | 114 | let Z = (((W + value(assetInfo(S)).quantity) - assetBalance(P, S)) - assetBalance(R, S)) | |
115 | 115 | ||
116 | 116 | let aa = (Z - Y) | |
117 | 117 | ||
118 | 118 | let ab = fraction(aa, 100, Z) | |
119 | 119 | ||
120 | 120 | let ac = fraction(Y, l, Z) | |
121 | 121 | ||
122 | 122 | let ad = c(y) | |
123 | 123 | ||
124 | - | let ae = | |
124 | + | let ae = value(assetInfo(T)).quantity | |
125 | 125 | ||
126 | - | let af = (( | |
126 | + | let af = (ae - assetBalance(this, T)) | |
127 | 127 | ||
128 | - | let ag = (((1850 * 1000) * i) + ae) | |
129 | - | ||
130 | - | func ah (ai) = a(B(ai)) | |
128 | + | func ag (ah) = a(B(ah)) | |
131 | 129 | ||
132 | 130 | ||
133 | - | func | |
131 | + | func ai (ah) = a(C(ah)) | |
134 | 132 | ||
135 | 133 | ||
136 | - | func | |
134 | + | func aj (ah) = c(D(ah)) | |
137 | 135 | ||
138 | 136 | ||
139 | - | func | |
137 | + | func ak (ah) = c(F(ah)) | |
140 | 138 | ||
141 | 139 | ||
142 | - | func | |
140 | + | func al (ah) = a(G(ah)) | |
143 | 141 | ||
144 | 142 | ||
145 | - | func | |
143 | + | func am (ah) = c(H(ah)) | |
146 | 144 | ||
147 | 145 | ||
148 | - | func | |
146 | + | func an (ah) = c(I(ah)) | |
149 | 147 | ||
150 | 148 | ||
151 | - | func | |
149 | + | func ao (ap) = fraction((100 + ap), V, 100) | |
152 | 150 | ||
153 | 151 | ||
154 | - | func | |
152 | + | func aq (L) = ((k * k) / L) | |
155 | 153 | ||
156 | 154 | ||
157 | - | func | |
155 | + | func ar (as,at) = fraction(as, (i * k), at) | |
158 | 156 | ||
159 | 157 | ||
160 | - | func | |
158 | + | func au (A,av,aw,ax,ay,az,L) = [IntegerEntry(B(A), L), IntegerEntry(C(A), av), IntegerEntry(G(A), aw), StringEntry(D(A), ax), IntegerEntry(E(A), height), StringEntry(F(A), ay), IntegerEntry(("debug_order_currentPrice_" + A), V), IntegerEntry(z(A), az)] | |
161 | 159 | ||
162 | 160 | ||
163 | - | func aB (aC,aD,aE,aF,aG,aH,aI,aJ) = { | |
164 | - | let aK = ap(aF) | |
165 | - | let aL = (aH - aE) | |
166 | - | let aM = N(aL, aK) | |
167 | - | let aN = O(aM, aK) | |
168 | - | let aO = (ab >= aF) | |
169 | - | if (!(aO)) | |
170 | - | then throw(("innapropriate roi: " + toString(aF))) | |
171 | - | else if ((aN == 0)) | |
172 | - | then throw("cannot fill order at the moment") | |
173 | - | else { | |
174 | - | let aP = (aL - aN) | |
175 | - | let aQ = if (aJ) | |
176 | - | then av(aC, aH, (aE + aN), toBase58String(aI.bytes), r, aF, V) | |
177 | - | else [IntegerEntry(G(aC), (aE + aN)), StringEntry(F(aC), r), StringEntry(H(aD), ""), StringEntry(y, aD)] | |
178 | - | (aQ ++ [ScriptTransfer(aI, aM, T), ScriptTransfer(P, aN, unit), ScriptTransfer(aI, aP, unit)]) | |
179 | - | } | |
161 | + | let aA = 0 | |
162 | + | ||
163 | + | let aB = 1 | |
164 | + | ||
165 | + | let aC = 2 | |
166 | + | ||
167 | + | let aD = 3 | |
168 | + | ||
169 | + | let aE = 4 | |
170 | + | ||
171 | + | let aF = 5 | |
172 | + | ||
173 | + | let aG = 6 | |
174 | + | ||
175 | + | func aH (aI,aJ,L,aK,aL) = { | |
176 | + | let aM = 271828100 | |
177 | + | let aN = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
178 | + | let aO = valueOrElse(getInteger(this, "nsbtCurveParam_b"), ((3 * i) / 10)) | |
179 | + | let aP = M(aI, L) | |
180 | + | let aQ = fraction(aP, l, aJ) | |
181 | + | let aR = (aN * (aQ - (1 * l))) | |
182 | + | let aS = pow(aM, m, aR, m, m, DOWN) | |
183 | + | let aT = fraction(aO, aS, i) | |
184 | + | [aN, aO, aP, aQ, aR, aS, aT] | |
180 | 185 | } | |
181 | 186 | ||
182 | 187 | ||
183 | - | func aR (aA,L,aS,aT,aJ) = { | |
184 | - | let aU = value(aT.payments[0]) | |
185 | - | let aV = toBase58String(aT.transactionId) | |
186 | - | if (U) | |
187 | - | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
188 | - | else if ((n > aU.amount)) | |
189 | - | then throw(("min order total equals " + toString(n))) | |
190 | - | else if ((aA > o)) | |
191 | - | then throw("max setOrder ROI is 95%") | |
192 | - | else if ((0 > aA)) | |
193 | - | then throw("can't place order with negative roi") | |
194 | - | else if ((aA == 0)) | |
195 | - | then throw("roi should not be equal to 0") | |
196 | - | else if (isDefined(aU.assetId)) | |
197 | - | then throw("can use waves only") | |
198 | - | else if ((ak(aV) != "")) | |
199 | - | then throw("order exists") | |
200 | - | else if (if ((aS != "")) | |
201 | - | then (al(aS) != q) | |
202 | - | else false) | |
203 | - | then throw("prev order status is not new") | |
204 | - | else { | |
205 | - | let aW = (aS == "") | |
206 | - | let ay = toString(aT.caller) | |
207 | - | let aX = if (aW) | |
208 | - | then ad | |
209 | - | else ao(aS) | |
210 | - | let aY = a(z(aX)) | |
211 | - | let aZ = if (if ((aX != "")) | |
212 | - | then (aA >= aY) | |
213 | - | else false) | |
214 | - | then true | |
215 | - | else false | |
216 | - | let ba = a(z(aS)) | |
217 | - | let bb = if (if ((aS != "")) | |
218 | - | then (ba > aA) | |
219 | - | else false) | |
220 | - | then true | |
221 | - | else false | |
222 | - | if (if (aZ) | |
223 | - | then true | |
224 | - | else bb) | |
225 | - | then throw(((("invalid order isPrevOrderError:" + toString(bb)) + " isNextOrderError:") + toString(aZ))) | |
226 | - | else if (if (aW) | |
227 | - | then (ab >= aA) | |
228 | - | else false) | |
229 | - | then aB(aV, aX, 0, aA, L, aU.amount, aT.caller, true) | |
230 | - | else if (aJ) | |
231 | - | then throw("Instant order couldn't be added into waiting queue") | |
232 | - | else ([StringEntry(H(aV), aS), StringEntry(I(aV), aX), StringEntry(I(aS), if ((aS == "")) | |
233 | - | then "" | |
234 | - | else aV), StringEntry(H(aX), if ((aX == "")) | |
235 | - | then "" | |
236 | - | else aV), StringEntry(y, if (if ((ad == "")) | |
237 | - | then true | |
238 | - | else (ad == aX)) | |
239 | - | then aV | |
240 | - | else ad)] ++ av(aV, aU.amount, 0, ay, q, aA, L)) | |
241 | - | } | |
188 | + | func aU (aI,aJ,L,aK,aL,aV) = { | |
189 | + | let aW = aH(aI, aJ, L, aK, aL) | |
190 | + | let aT = aW[aG] | |
191 | + | let aX = M(aV, L) | |
192 | + | let aY = fraction(aT, aK, i) | |
193 | + | let aZ = fraction(aY, i, (aK - aL)) | |
194 | + | let ba = (fraction(aX, l, i) + fraction(aZ, aK, i)) | |
195 | + | let bb = fraction(aY, l, ba) | |
196 | + | let bc = fraction(bb, aK, l) | |
197 | + | let bd = ((aK - aL) - bc) | |
198 | + | [bd, aX, aI, aJ, aK, aL, aW[aA], aW[aB], aW[aC], L, aW[aD], aW[aE], aW[aF], aT, aY, aZ, ba, bb, bc] | |
242 | 199 | } | |
243 | 200 | ||
244 | 201 | ||
245 | - | let bc = 0 | |
246 | - | ||
247 | - | let bd = 1 | |
248 | - | ||
249 | - | let be = 2 | |
250 | - | ||
251 | - | let bf = 3 | |
252 | - | ||
253 | - | let bg = 4 | |
254 | - | ||
255 | - | let bh = 5 | |
256 | - | ||
257 | - | let bi = 6 | |
258 | - | ||
259 | - | func bj (bk,bl,L,bm,bn) = { | |
260 | - | let bo = 271828100 | |
261 | - | let bp = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
262 | - | let bq = valueOrElse(getInteger(this, "nsbtCurveParam_b"), ((3 * i) / 10)) | |
263 | - | let br = M(bk, L) | |
264 | - | let bs = fraction(br, l, bl) | |
265 | - | let bt = (bp * (bs - (1 * l))) | |
266 | - | let bu = pow(bo, m, bt, m, m, DOWN) | |
267 | - | let bv = fraction(bq, bu, i) | |
268 | - | [bp, bq, br, bs, bt, bu, bv] | |
269 | - | } | |
202 | + | func be (bf,bg) = (((((((((((((((((((((((((((((((((((((((bf + "[nsbtAmountRaw=") + toString(bg[0])) + " usdnPayment=") + toString(bg[1])) + " wRaw=") + toString(bg[2])) + " uRaw=") + toString(bg[3])) + " mRaw=") + toString(bg[4])) + " sRaw=") + toString(bg[5])) + " nsbtCurveParam_a=") + toString(bg[6])) + " nsbtCurveParam_b=") + toString(bg[7])) + " wReservesInUsdn=") + toString(bg[8])) + " price=") + toString(bg[9])) + " multBR=") + toString(bg[10])) + " multPower=") + toString(bg[11])) + " multExpInPower=") + toString(bg[12])) + " multK=") + toString(bg[13])) + " multStepM1=") + toString(bg[14])) + " multStep2=") + toString(bg[15])) + " multStepM3=") + toString(bg[16])) + " multStep4=") + toString(bg[17])) + " stepM5=") + toString(bg[18])) + "]") | |
270 | 203 | ||
271 | 204 | ||
272 | - | func bw (bk,bl,L,bm,bn,bx) = { | |
273 | - | let by = bj(bk, bl, L, bm, bn) | |
274 | - | let bv = by[bi] | |
275 | - | let bz = M(bx, L) | |
276 | - | let bA = fraction(bv, bm, i) | |
277 | - | let bB = fraction(bA, i, (bm - bn)) | |
278 | - | let bC = (fraction(bz, l, i) + fraction(bB, bm, i)) | |
279 | - | let bD = fraction(bA, l, bC) | |
280 | - | let bE = fraction(bD, bm, l) | |
281 | - | let bF = ((bm - bn) - bE) | |
282 | - | [bF, bz, bk, bl, bm, bn, by[bc], by[bd], by[be], L, by[bf], by[bg], by[bh], bv, bA, bB, bC, bD, bE] | |
283 | - | } | |
284 | - | ||
285 | - | ||
286 | - | func bG (bH,bI) = (((((((((((((((((((((((((((((((((((((((bH + "[nsbtAmountRaw=") + toString(bI[0])) + " usdnPayment=") + toString(bI[1])) + " wRaw=") + toString(bI[2])) + " uRaw=") + toString(bI[3])) + " mRaw=") + toString(bI[4])) + " sRaw=") + toString(bI[5])) + " nsbtCurveParam_a=") + toString(bI[6])) + " nsbtCurveParam_b=") + toString(bI[7])) + " wReservesInUsdn=") + toString(bI[8])) + " price=") + toString(bI[9])) + " multBR=") + toString(bI[10])) + " multPower=") + toString(bI[11])) + " multExpInPower=") + toString(bI[12])) + " multK=") + toString(bI[13])) + " multStepM1=") + toString(bI[14])) + " multStep2=") + toString(bI[15])) + " multStepM3=") + toString(bI[16])) + " multStep4=") + toString(bI[17])) + " stepM5=") + toString(bI[18])) + "]") | |
287 | - | ||
288 | - | ||
289 | - | func bJ (bK) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (!(isDefined(transferTransactionById(fromBase58String("PdLw5JK5ppfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k"))))) | |
290 | - | then !(isDefined(transferTransactionById(fromBase58String("adLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
291 | - | else false) | |
292 | - | then !(isDefined(transferTransactionById(fromBase58String("sdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
293 | - | else false) | |
294 | - | then !(isDefined(transferTransactionById(fromBase58String("ddLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
295 | - | else false) | |
296 | - | then !(isDefined(transferTransactionById(fromBase58String("fdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
297 | - | else false) | |
298 | - | then !(isDefined(transferTransactionById(fromBase58String("gdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
299 | - | else false) | |
300 | - | then !(isDefined(transferTransactionById(fromBase58String("hdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
301 | - | else false) | |
302 | - | then !(isDefined(transferTransactionById(fromBase58String("jdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
303 | - | else false) | |
304 | - | then !(isDefined(transferTransactionById(fromBase58String("kdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
305 | - | else false) | |
306 | - | then !(isDefined(transferTransactionById(fromBase58String("rdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
307 | - | else false) | |
308 | - | then !(isDefined(transferTransactionById(fromBase58String("tdLq5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
309 | - | else false) | |
310 | - | then !(isDefined(transferTransactionById(fromBase58String("tdLy5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
311 | - | else false) | |
312 | - | then !(isDefined(transferTransactionById(fromBase58String("tdLu5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
313 | - | else false) | |
314 | - | then !(isDefined(transferTransactionById(fromBase58String("tdLh5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
315 | - | else false) | |
316 | - | then !(isDefined(transferTransactionById(fromBase58String("1dL4JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
317 | - | else false) | |
318 | - | then !(isDefined(transferTransactionById(fromBase58String("2dL25JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
319 | - | else false) | |
320 | - | then !(isDefined(transferTransactionById(fromBase58String("3dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
321 | - | else false) | |
322 | - | then !(isDefined(transferTransactionById(fromBase58String("4dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
323 | - | else false) | |
324 | - | then !(isDefined(transferTransactionById(fromBase58String("5dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
325 | - | else false) | |
326 | - | then !(isDefined(transferTransactionById(fromBase58String("6dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
327 | - | else false) | |
328 | - | then !(isDefined(transferTransactionById(fromBase58String("7dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
329 | - | else false) | |
330 | - | then !(isDefined(transferTransactionById(fromBase58String("8dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
331 | - | else false) | |
332 | - | then !(isDefined(transferTransactionById(fromBase58String("91L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
333 | - | else false) | |
334 | - | then !(isDefined(transferTransactionById(fromBase58String("92L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
335 | - | else false) | |
336 | - | then !(isDefined(transferTransactionById(fromBase58String("93L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
337 | - | else false) | |
338 | - | then !(isDefined(transferTransactionById(fromBase58String("94L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
339 | - | else false | |
340 | - | ||
341 | - | ||
342 | - | func bL () = { | |
343 | - | let by = bj(X, Z, V, af, ag) | |
344 | - | let bv = by[bi] | |
345 | - | let bM = fraction(af, l, (af - ag)) | |
346 | - | let bB = fraction(bM, bM, l) | |
347 | - | let bN = fraction(bv, bB, l) | |
348 | - | let bO = fraction(bN, i, l) | |
349 | - | let bP = fraction(bO, i, V) | |
350 | - | $Tuple2(IntegerEntry("nsbt2usdnPrice", bO), IntegerEntry("nsbt2wavesPrice", bP)) | |
351 | - | } | |
352 | - | ||
353 | - | ||
354 | - | @Callable(bK) | |
355 | - | func nsbtPriceREST () = { | |
356 | - | let bQ = bL() | |
357 | - | let bO = bQ._1.value | |
358 | - | let bP = bQ._2.value | |
359 | - | let bR = makeString(["startNsbtPriceREST", toString(bO), toString(bP), "endNsbtPriceREST"], "__") | |
360 | - | throw(bR) | |
361 | - | } | |
362 | - | ||
363 | - | ||
364 | - | ||
365 | - | @Callable(bK) | |
205 | + | @Callable(bh) | |
366 | 206 | func buyNsbt () = { | |
367 | - | let | |
368 | - | let | |
369 | - | let | |
370 | - | let | |
207 | + | let bi = value(bh.payments[0]) | |
208 | + | let bj = bi.amount | |
209 | + | let bk = bj | |
210 | + | let bl = bh.caller | |
371 | 211 | if (U) | |
372 | 212 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
373 | - | else if (isDefined( | |
213 | + | else if (isDefined(bi.assetId)) | |
374 | 214 | then throw("can use waves only") | |
375 | - | else if (((10 * h) > | |
215 | + | else if (((10 * h) > bj)) | |
376 | 216 | then throw("min 10 waves expected") | |
377 | 217 | else { | |
378 | - | let bI = bw(X, Z, V, af, ag, bT) | |
379 | - | let bV = bI[0] | |
380 | - | let bW = as(bT, bV) | |
381 | - | let aA = (fraction(ar(bW), 100, V) - 100) | |
382 | - | (av(toBase58String(bK.transactionId), bS, bS, toString(bU), r, aA, bW) ++ [ScriptTransfer(bU, bV, T), ScriptTransfer(P, bT, unit), StringEntry("debug_curveResult", bG("curveResult", bI)), IntegerEntry("tmp_issuedNsbt_2", (ae + bV))]) | |
218 | + | let bg = aU(X, Z, V, ae, af, bk) | |
219 | + | let bm = bg[0] | |
220 | + | if ((0 >= bm)) | |
221 | + | then throw("nsbtAmount <= 0") | |
222 | + | else { | |
223 | + | let bn = ar(bk, bm) | |
224 | + | let az = 0 | |
225 | + | (au(toBase58String(bh.transactionId), bj, bj, toString(bl), r, az, bn) ++ [ScriptTransfer(bl, bm, T), ScriptTransfer(P, bk, unit), StringEntry("debug_curveResult", be("curveResult", bg))]) | |
226 | + | } | |
383 | 227 | } | |
384 | 228 | } | |
385 | 229 | ||
386 | 230 | ||
387 | 231 | ||
388 | - | @Callable(bK) | |
389 | - | func instantBuyNsbtOrFail (bX) = { | |
390 | - | let aU = value(bK.payments[0]) | |
391 | - | let aA = ab | |
392 | - | if ((bX > aA)) | |
393 | - | then throw(((("Current maxRoi=" + toString(aA)) + " is less then passed parameter noLessThenRoi=") + toString(bX))) | |
394 | - | else { | |
395 | - | let aK = ap(aA) | |
396 | - | aR(aA, ar(aK), "", bK, true) | |
397 | - | } | |
232 | + | @Callable(bh) | |
233 | + | func cancelOrder (A) = { | |
234 | + | let ax = aj(A) | |
235 | + | let K = (ai(A) - al(A)) | |
236 | + | let bo = toString(bh.caller) | |
237 | + | let bp = an(A) | |
238 | + | let bq = am(A) | |
239 | + | if ((ak(A) != q)) | |
240 | + | then throw("invalid order status") | |
241 | + | else [StringEntry(y, if ((ad == A)) | |
242 | + | then bp | |
243 | + | else ad), StringEntry(I(bq), bp), StringEntry(H(bp), bq), StringEntry(F(A), p), ScriptTransfer(bh.caller, K, unit)] | |
398 | 244 | } | |
399 | 245 | ||
400 | 246 | ||
401 | - | ||
402 | - | @Callable(bK) | |
403 | - | func addBuyBondOrder (L,aS) = { | |
404 | - | let aU = value(bK.payments[0]) | |
405 | - | let aK = ar(L) | |
406 | - | if ((0 >= L)) | |
407 | - | then throw("price less zero") | |
408 | - | else aR(fraction((aK - V), 100, V), L, aS, bK, false) | |
409 | - | } | |
410 | - | ||
411 | - | ||
412 | - | ||
413 | - | @Callable(bK) | |
414 | - | func cancelOrder (A) = { | |
415 | - | let ay = ak(A) | |
416 | - | let K = (aj(A) - am(A)) | |
417 | - | let bY = toString(bK.caller) | |
418 | - | let aX = ao(A) | |
419 | - | let aS = an(A) | |
420 | - | if (U) | |
421 | - | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
422 | - | else if ((ay != bY)) | |
423 | - | then throw("permission denied") | |
424 | - | else if ((al(A) != q)) | |
425 | - | then throw("invalid order status") | |
426 | - | else [StringEntry(y, if ((ad == A)) | |
427 | - | then aX | |
428 | - | else ad), StringEntry(I(aS), aX), StringEntry(H(aX), aS), StringEntry(F(A), p), ScriptTransfer(bK.caller, K, unit)] | |
429 | - | } | |
430 | - | ||
431 | - | ||
432 | - | ||
433 | - | @Callable(bK) | |
434 | - | func sellBond () = if (U) | |
435 | - | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
436 | - | else if ((ad == "")) | |
437 | - | then throw("empty orderbook") | |
438 | - | else { | |
439 | - | let aX = ao(ad) | |
440 | - | let bZ = am(ad) | |
441 | - | let ca = ah(ad) | |
442 | - | let aA = a(z(ad)) | |
443 | - | let cb = aj(ad) | |
444 | - | let aI = Address(fromBase58String(ak(ad))) | |
445 | - | aB(ad, aX, bZ, aA, ca, cb, aI, false) | |
446 | - | } | |
447 | - | ||
448 | - | ||
449 | - | @Verifier(cc) | |
450 | - | func cd () = { | |
451 | - | let ce = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
452 | - | let cf = ((((if (sigVerify(cc.bodyBytes, cc.proofs[0], fromBase58String(ce[0]))) | |
247 | + | @Verifier(br) | |
248 | + | func bs () = { | |
249 | + | let bt = ["GJdLSaLiv5K7xuejac8mcRcHoyo3dPrESrvktG3a6MAR", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
250 | + | let bu = ((((if (sigVerify(br.bodyBytes, br.proofs[0], fromBase58String(bt[0]))) | |
453 | 251 | then 1 | |
454 | - | else 0) + (if (sigVerify( | |
252 | + | else 0) + (if (sigVerify(br.bodyBytes, br.proofs[1], fromBase58String(bt[1]))) | |
455 | 253 | then 1 | |
456 | - | else 0)) + (if (sigVerify( | |
254 | + | else 0)) + (if (sigVerify(br.bodyBytes, br.proofs[2], fromBase58String(bt[2]))) | |
457 | 255 | then 1 | |
458 | - | else 0)) + (if (sigVerify( | |
256 | + | else 0)) + (if (sigVerify(br.bodyBytes, br.proofs[3], fromBase58String(bt[3]))) | |
459 | 257 | then 2 | |
460 | 258 | else 0)) | |
461 | - | ( | |
259 | + | (bu >= 3) | |
462 | 260 | } | |
463 | 261 |
github/deemru/w8io/169f3d6 107.95 ms ◑