tx · JhGsAs6Bqp8mhbTCBfZTGwBrVWBoiJf2tHEfGdmja1n 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N: -0.02000000 Waves 2021.01.08 06:45 [1343908] smart account 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N > SELF 0.00000000 Waves
{ "type": 13, "id": "JhGsAs6Bqp8mhbTCBfZTGwBrVWBoiJf2tHEfGdmja1n", "fee": 2000000, "feeAssetId": null, "timestamp": 1610077566783, "version": 1, "sender": "3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N", "senderPublicKey": "4bj7YXaphTC4Ldx7DqqMmrTjNshRtw1yNsej2XXZcAzS", "proofs": [ "w1rRfvkcvp6YFpMd1VB5gwm4bJLK6Ub2pLeHyTgBGHyJJE5MSN2kPSi29rU7wstahznWZpP2xbJ22eG4EeVuncB", "CpXKKBkueAZrXjdoEqtgVisifSfkqbJ7bTUVZYZr1ppGq7ZQ4D3NjSpD6MQdSCsy1V9p4Z5GjRi7qjLQTCc4wTC", "4AbWBnzZFwQ8Rhp1DAjPSoDM7KA469j6kddJgPfeHDheMAhfA2dgSvuhTuRiZwHV2ETBdvm1UhjZU4ffPv2GKjv5" ], "script": "base64:AAIEAAAAAAAAABoIAhIECgIBARIDCgEBEgQKAgEIEgMKAQgSAAAAAEMBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQIAAAAAAQAAABZnZXRCb29sQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkHAQAAABhn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UAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAgAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAADCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAwAAAAAAAAAAAgAAAAAAAAAAAAkAAGcAAAACBQAAAAVjb3VudAAAAAAAAAAAA8pctQ8=", "chainId": 84, "height": 1343908, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3dg2e9q1kfuTtvoZxLHncXAahiwd2MtFK1o1X8eTCAwv Next: 2ouMhj8ivPh81KrkUmZgL4kB7fTEiErURkQn1vkfTRo3 Diff:
Old | New | Differences | |
---|---|---|---|
20 | 20 | ||
21 | 21 | let PAULI = 1000000 | |
22 | 22 | ||
23 | + | let PAULISCALE = 6 | |
24 | + | ||
23 | 25 | let PRICELET = 1000000 | |
24 | 26 | ||
25 | 27 | let MULT = 100000000 | |
26 | 28 | ||
27 | - | let | |
29 | + | let MULTSCALE = 8 | |
28 | 30 | ||
29 | 31 | let MINORDERTOTAL = (10 * WAVELET) | |
30 | 32 | ||
234 | 236 | } | |
235 | 237 | ||
236 | 238 | ||
237 | - | func curveFunction (wRaw,uRaw,price) = { | |
239 | + | func curveFunction (wRaw,uRaw,price,mRaw,sRaw,nRaw) = { | |
238 | 240 | let EXP = 271828100 | |
239 | 241 | let nsbtCurveParamA = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
240 | 242 | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
241 | 243 | let brMult = fraction(wReservesInUsdn, MULT, uRaw) | |
242 | 244 | let powerMult = (nsbtCurveParamA * (brMult - (1 * MULT))) | |
243 | - | let expInPowerMult = pow(EXP, SCALEMULT, powerMult, SCALEMULT, SCALEMULT, DOWN) | |
244 | - | let constCoeff = fraction(uRaw, PRICELET, (nsbtCurveParamA * price)) | |
245 | - | let finalResultIfPriceInUsdn = fraction(constCoeff, MULT, expInPowerMult) | |
246 | - | let finalResult = fraction(finalResultIfPriceInUsdn, price, PRICELET) | |
247 | - | $Tuple6(finalResult, wReservesInUsdn, brMult, powerMult, expInPowerMult, constCoeff) | |
245 | + | let expInPowerMult = pow(EXP, MULTSCALE, powerMult, MULTSCALE, MULTSCALE, DOWN) | |
246 | + | let lnRes1 = log(((mRaw - sRaw) - nRaw), PAULISCALE, EXP, MULTSCALE, MULTSCALE, DOWN) | |
247 | + | let lnRes0 = log((mRaw - sRaw), PAULISCALE, EXP, MULTSCALE, MULTSCALE, DOWN) | |
248 | + | let lnDiffMult = (lnRes0 - lnRes1) | |
249 | + | let lnDiffMultipliedMaxRaw = fraction(mRaw, lnDiffMult, MULT) | |
250 | + | let usdnPaymentRaw = fraction(expInPowerMult, lnDiffMultipliedMaxRaw, MULT) | |
251 | + | let wavesPayment = convertNeutrinoToWaves(usdnPaymentRaw, price) | |
252 | + | [wavesPayment, usdnPaymentRaw, wRaw, uRaw, mRaw, sRaw, nRaw, nsbtCurveParamA, wReservesInUsdn, brMult, powerMult, expInPowerMult, lnRes0, lnRes1, lnDiffMult, lnDiffMultipliedMaxRaw] | |
248 | 253 | } | |
249 | 254 | ||
250 | 255 | ||
251 | - | func toStr (name,l) = (((((((((((((name + "[finalResult=") + toString(l._1)) + "wReservesInUsdn=") + toString(l._2)) + " brMult=") + toString(l._3)) + " powerMult=") + toString(l._4)) + " expInPowerMult=") + toString(l._5)) + " constCoeff=") + toString(l._6)) + "]") | |
256 | + | func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((name + "[wavesPayment=") + toString(curveResult[0])) + " usdnPayment=") + toString(curveResult[1])) + " wRaw=") + toString(curveResult[2])) + " uRaw=") + toString(curveResult[3])) + " mRaw=") + toString(curveResult[4])) + " sRaw=") + toString(curveResult[5])) + " nRaw=") + toString(curveResult[6])) + " nsbtCurveParamA=") + toString(curveResult[7])) + " wReservesInUsdn=") + toString(curveResult[8])) + " brMult=") + toString(curveResult[9])) + " powerMult=") + toString(curveResult[10])) + " expInPowerMult=") + toString(curveResult[11])) + " lnRes0=") + toString(curveResult[12])) + " lnRes1=") + toString(curveResult[13])) + " lnDiffMult=") + toString(curveResult[14])) + " maxXlndiff=") + toString(curveResult[15])) + "]") | |
257 | + | ||
258 | + | ||
259 | + | func bigComplexity (i) = 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"))))) | |
260 | + | then !(isDefined(transferTransactionById(fromBase58String("adLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
261 | + | else false) | |
262 | + | then !(isDefined(transferTransactionById(fromBase58String("sdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
263 | + | else false) | |
264 | + | then !(isDefined(transferTransactionById(fromBase58String("ddLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
265 | + | else false) | |
266 | + | then !(isDefined(transferTransactionById(fromBase58String("fdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
267 | + | else false) | |
268 | + | then !(isDefined(transferTransactionById(fromBase58String("gdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
269 | + | else false) | |
270 | + | then !(isDefined(transferTransactionById(fromBase58String("hdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
271 | + | else false) | |
272 | + | then !(isDefined(transferTransactionById(fromBase58String("jdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
273 | + | else false) | |
274 | + | then !(isDefined(transferTransactionById(fromBase58String("kdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
275 | + | else false) | |
276 | + | then !(isDefined(transferTransactionById(fromBase58String("rdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
277 | + | else false) | |
278 | + | then !(isDefined(transferTransactionById(fromBase58String("tdLq5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
279 | + | else false) | |
280 | + | then !(isDefined(transferTransactionById(fromBase58String("tdLy5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
281 | + | else false) | |
282 | + | then !(isDefined(transferTransactionById(fromBase58String("tdLu5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
283 | + | else false) | |
284 | + | then !(isDefined(transferTransactionById(fromBase58String("tdLh5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
285 | + | else false) | |
286 | + | then !(isDefined(transferTransactionById(fromBase58String("1dL4JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
287 | + | else false) | |
288 | + | then !(isDefined(transferTransactionById(fromBase58String("2dL25JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
289 | + | else false) | |
290 | + | then !(isDefined(transferTransactionById(fromBase58String("3dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
291 | + | else false) | |
292 | + | then !(isDefined(transferTransactionById(fromBase58String("4dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
293 | + | else false) | |
294 | + | then !(isDefined(transferTransactionById(fromBase58String("5dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
295 | + | else false) | |
296 | + | then !(isDefined(transferTransactionById(fromBase58String("6dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
297 | + | else false) | |
298 | + | then !(isDefined(transferTransactionById(fromBase58String("7dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
299 | + | else false) | |
300 | + | then !(isDefined(transferTransactionById(fromBase58String("8dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
301 | + | else false) | |
302 | + | then !(isDefined(transferTransactionById(fromBase58String("91L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
303 | + | else false) | |
304 | + | then !(isDefined(transferTransactionById(fromBase58String("92L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
305 | + | else false) | |
306 | + | then !(isDefined(transferTransactionById(fromBase58String("93L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
307 | + | else false) | |
308 | + | then !(isDefined(transferTransactionById(fromBase58String("94L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
309 | + | else false | |
252 | 310 | ||
253 | 311 | ||
254 | 312 | @Callable(i) | |
255 | - | func buyNsbtInSurplus () = { | |
313 | + | func buyNsbtInSurplus (nsbtAmount,toleranceRaw) = { | |
256 | 314 | let pmt = value(i.payments[0]) | |
257 | 315 | let pmtAmount = pmt.amount | |
258 | 316 | let ownerAddress = i.caller | |
259 | 317 | if (isBlocked) | |
260 | 318 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
261 | - | else if (( | |
262 | - | then throw( | |
263 | - | else if ( | |
264 | - | then throw(" | |
319 | + | else if (isDefined(pmt.assetId)) | |
320 | + | then throw("can use waves only") | |
321 | + | else if (((10 * WAVELET) > pmtAmount)) | |
322 | + | then throw("min 10 waves expected") | |
265 | 323 | else { | |
266 | - | let f0 = curveFunction(reserve, neutrinoSupply, currentPrice) | |
267 | - | let f1 = curveFunction((reserve + pmtAmount), neutrinoSupply, currentPrice) | |
268 | - | let nsbtAmount = (f0._1 - f1._1) | |
269 | - | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(pmtAmount, nsbtAmount) | |
270 | - | let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100) | |
271 | - | (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(neutrinoContract, pmtAmount, unit), StringEntry("debug_f0", toStr("f0", f0)), StringEntry("debug_f1", toStr("f1", f1))]) | |
324 | + | let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt"), 0) | |
325 | + | let nsbtMax = ((2500 * 1000) * PAULI) | |
326 | + | let nsbtCurrent = (((1500 * 1000) * PAULI) + issuedNsbt) | |
327 | + | let curveResult = curveFunction(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent, nsbtAmount) | |
328 | + | let requiredWaves = curveResult[0] | |
329 | + | if ((requiredWaves > pmtAmount)) | |
330 | + | then throw(((("Payment amount is less then required: pmtAmount=" + toString(pmtAmount)) + " requiredWaves=") + toString(requiredWaves))) | |
331 | + | else if ((0 > toleranceRaw)) | |
332 | + | then throw("Invalid tolerance param") | |
333 | + | else { | |
334 | + | let maxAllowedPayment = fraction(requiredWaves, (toleranceRaw + PAULI), PAULI) | |
335 | + | if ((requiredWaves > maxAllowedPayment)) | |
336 | + | then throw(((("Tolerance check failed: pmtAmount=" + toString(pmtAmount)) + " maxAllowedPayment=") + toString(maxAllowedPayment))) | |
337 | + | else { | |
338 | + | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(requiredWaves, nsbtAmount) | |
339 | + | let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100) | |
340 | + | (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(ownerAddress, (pmtAmount - requiredWaves), unit), ScriptTransfer(neutrinoContract, requiredWaves, unit), StringEntry("debug_curveResult", toStr("curveResult", curveResult)), IntegerEntry("tmp_issuedNsbt", (issuedNsbt + nsbtAmount))]) | |
341 | + | } | |
342 | + | } | |
272 | 343 | } | |
273 | 344 | } | |
274 | 345 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | let WAVELET = 100000000 | |
20 | 20 | ||
21 | 21 | let PAULI = 1000000 | |
22 | 22 | ||
23 | + | let PAULISCALE = 6 | |
24 | + | ||
23 | 25 | let PRICELET = 1000000 | |
24 | 26 | ||
25 | 27 | let MULT = 100000000 | |
26 | 28 | ||
27 | - | let | |
29 | + | let MULTSCALE = 8 | |
28 | 30 | ||
29 | 31 | let MINORDERTOTAL = (10 * WAVELET) | |
30 | 32 | ||
31 | 33 | let MAXROI = 95 | |
32 | 34 | ||
33 | 35 | let CANCELED = "canceled" | |
34 | 36 | ||
35 | 37 | let NEW = "new" | |
36 | 38 | ||
37 | 39 | let FILLED = "filled" | |
38 | 40 | ||
39 | 41 | let PriceKey = "price" | |
40 | 42 | ||
41 | 43 | let BondAssetIdKey = "bond_asset_id" | |
42 | 44 | ||
43 | 45 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
44 | 46 | ||
45 | 47 | let BalanceLockedkKey = "balance_lock_" | |
46 | 48 | ||
47 | 49 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
48 | 50 | ||
49 | 51 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
50 | 52 | ||
51 | 53 | let FirstOrderKey = "order_first" | |
52 | 54 | ||
53 | 55 | func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId) | |
54 | 56 | ||
55 | 57 | ||
56 | 58 | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
57 | 59 | ||
58 | 60 | ||
59 | 61 | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
60 | 62 | ||
61 | 63 | ||
62 | 64 | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
63 | 65 | ||
64 | 66 | ||
65 | 67 | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
66 | 68 | ||
67 | 69 | ||
68 | 70 | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
69 | 71 | ||
70 | 72 | ||
71 | 73 | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
72 | 74 | ||
73 | 75 | ||
74 | 76 | func getPrevOrderKey (orderId) = ("order_prev_" + orderId) | |
75 | 77 | ||
76 | 78 | ||
77 | 79 | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
78 | 80 | ||
79 | 81 | ||
80 | 82 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
81 | 83 | ||
82 | 84 | ||
83 | 85 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
84 | 86 | ||
85 | 87 | ||
86 | 88 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
87 | 89 | ||
88 | 90 | ||
89 | 91 | func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price) | |
90 | 92 | ||
91 | 93 | ||
92 | 94 | let neutrinoContract = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we') | |
93 | 95 | ||
94 | 96 | let controlContract = Address(base58'3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx') | |
95 | 97 | ||
96 | 98 | let liquidationContract = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62') | |
97 | 99 | ||
98 | 100 | let neutrinoAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
99 | 101 | ||
100 | 102 | let bondAssetId = base58'BGhPYquXSK6UYjnPLEn94gFhetp4Jvf7toekEY4x1VDH' | |
101 | 103 | ||
102 | 104 | let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked") | |
103 | 105 | ||
104 | 106 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
105 | 107 | ||
106 | 108 | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
107 | 109 | ||
108 | 110 | let reserve = (wavesBalance(neutrinoContract).regular - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) | |
109 | 111 | ||
110 | 112 | let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice) | |
111 | 113 | ||
112 | 114 | let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
113 | 115 | ||
114 | 116 | let deficit = (neutrinoSupply - reservesInUsdn) | |
115 | 117 | ||
116 | 118 | let currentMaxRoi = fraction(deficit, 100, neutrinoSupply) | |
117 | 119 | ||
118 | 120 | let currentBrMult = fraction(reservesInUsdn, MULT, neutrinoSupply) | |
119 | 121 | ||
120 | 122 | let firstOrder = getStringByKey(FirstOrderKey) | |
121 | 123 | ||
122 | 124 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
123 | 125 | ||
124 | 126 | ||
125 | 127 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
126 | 128 | ||
127 | 129 | ||
128 | 130 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
129 | 131 | ||
130 | 132 | ||
131 | 133 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
132 | 134 | ||
133 | 135 | ||
134 | 136 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
135 | 137 | ||
136 | 138 | ||
137 | 139 | func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id)) | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
141 | 143 | ||
142 | 144 | ||
143 | 145 | func getPriceForRoi (roiPercents) = fraction((100 + roiPercents), currentPrice, 100) | |
144 | 146 | ||
145 | 147 | ||
146 | 148 | func getReversePrice (price) = ((PRICELET * PRICELET) / price) | |
147 | 149 | ||
148 | 150 | ||
149 | 151 | func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(spentWavesRaw, (PAULI * PRICELET), receivedNsbtRaw) | |
150 | 152 | ||
151 | 153 | ||
152 | 154 | func orderData (orderId,totalWavelets,filledWavelets,owner,status,roi,price) = [IntegerEntry(getOrderPriceKey(orderId), price), IntegerEntry(getOrderTotalKey(orderId), totalWavelets), IntegerEntry(getOrderFilledTotalKey(orderId), filledWavelets), StringEntry(getOrderOwnerKey(orderId), owner), IntegerEntry(getOrderHeightKey(orderId), height), StringEntry(getOrderStatusKey(orderId), status), IntegerEntry(("debug_order_currentPrice_" + orderId), currentPrice), IntegerEntry(getRoiByOrderIdKey(orderId), roi)] | |
153 | 155 | ||
154 | 156 | ||
155 | 157 | func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = { | |
156 | 158 | let priceWavesByBondCents = getPriceForRoi(pRoi) | |
157 | 159 | let remainedTotal = (pPaymentWavelets - pFilledTotal) | |
158 | 160 | let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
159 | 161 | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
160 | 162 | let nbTokensSellCondition = (currentMaxRoi >= pRoi) | |
161 | 163 | if (!(nbTokensSellCondition)) | |
162 | 164 | then throw(("innapropriate roi: " + toString(pRoi))) | |
163 | 165 | else if ((totalOrderWaveletesRequired == 0)) | |
164 | 166 | then throw("cannot fill order at the moment") | |
165 | 167 | else { | |
166 | 168 | let changeWavelets = (remainedTotal - totalOrderWaveletesRequired) | |
167 | 169 | let writeSetData = if (instantOrder) | |
168 | 170 | then orderData(pFirstOrder, pPaymentWavelets, (pFilledTotal + totalOrderWaveletesRequired), toBase58String(orderOwnerAddress.bytes), FILLED, pRoi, currentPrice) | |
169 | 171 | else [IntegerEntry(getOrderFilledTotalKey(pFirstOrder), (pFilledTotal + totalOrderWaveletesRequired)), StringEntry(getOrderStatusKey(pFirstOrder), FILLED), StringEntry(getPrevOrderKey(pNextOrder), ""), StringEntry(FirstOrderKey, pNextOrder)] | |
170 | 172 | (writeSetData ++ [ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)]) | |
171 | 173 | } | |
172 | 174 | } | |
173 | 175 | ||
174 | 176 | ||
175 | 177 | func internalAddBuyBondOrder (roi,price,prevOrder,inv,instantOrder) = { | |
176 | 178 | let pmt = value(inv.payments[0]) | |
177 | 179 | let newOrderId = toBase58String(inv.transactionId) | |
178 | 180 | if (isBlocked) | |
179 | 181 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
180 | 182 | else if ((MINORDERTOTAL > pmt.amount)) | |
181 | 183 | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
182 | 184 | else if ((roi > MAXROI)) | |
183 | 185 | then throw("max setOrder ROI is 95%") | |
184 | 186 | else if ((0 > roi)) | |
185 | 187 | then throw("can't place order with negative roi") | |
186 | 188 | else if ((roi == 0)) | |
187 | 189 | then throw("roi should not be equal to 0") | |
188 | 190 | else if (isDefined(pmt.assetId)) | |
189 | 191 | then throw("can use waves only") | |
190 | 192 | else if ((getOrderOwner(newOrderId) != "")) | |
191 | 193 | then throw("order exists") | |
192 | 194 | else if (if ((prevOrder != "")) | |
193 | 195 | then (getOrderStatus(prevOrder) != NEW) | |
194 | 196 | else false) | |
195 | 197 | then throw("prev order status is not new") | |
196 | 198 | else { | |
197 | 199 | let isNewOrderAtFirstPosition = (prevOrder == "") | |
198 | 200 | let owner = toString(inv.caller) | |
199 | 201 | let nextOrder = if (isNewOrderAtFirstPosition) | |
200 | 202 | then firstOrder | |
201 | 203 | else getNextOrder(prevOrder) | |
202 | 204 | let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder)) | |
203 | 205 | let isNextOrderError = if (if ((nextOrder != "")) | |
204 | 206 | then (roi >= nextOrderRoi) | |
205 | 207 | else false) | |
206 | 208 | then true | |
207 | 209 | else false | |
208 | 210 | let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder)) | |
209 | 211 | let isPrevOrderError = if (if ((prevOrder != "")) | |
210 | 212 | then (prevOrderRoi > roi) | |
211 | 213 | else false) | |
212 | 214 | then true | |
213 | 215 | else false | |
214 | 216 | if (if (isNextOrderError) | |
215 | 217 | then true | |
216 | 218 | else isPrevOrderError) | |
217 | 219 | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
218 | 220 | else if (if (isNewOrderAtFirstPosition) | |
219 | 221 | then (currentMaxRoi >= roi) | |
220 | 222 | else false) | |
221 | 223 | then internalSellBond(newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true) | |
222 | 224 | else if (instantOrder) | |
223 | 225 | then throw("Instant order couldn't be added into waiting queue") | |
224 | 226 | else ([StringEntry(getPrevOrderKey(newOrderId), prevOrder), StringEntry(getNextOrderKey(newOrderId), nextOrder), StringEntry(getNextOrderKey(prevOrder), if ((prevOrder == "")) | |
225 | 227 | then "" | |
226 | 228 | else newOrderId), StringEntry(getPrevOrderKey(nextOrder), if ((nextOrder == "")) | |
227 | 229 | then "" | |
228 | 230 | else newOrderId), StringEntry(FirstOrderKey, if (if ((firstOrder == "")) | |
229 | 231 | then true | |
230 | 232 | else (firstOrder == nextOrder)) | |
231 | 233 | then newOrderId | |
232 | 234 | else firstOrder)] ++ orderData(newOrderId, pmt.amount, 0, owner, NEW, roi, price)) | |
233 | 235 | } | |
234 | 236 | } | |
235 | 237 | ||
236 | 238 | ||
237 | - | func curveFunction (wRaw,uRaw,price) = { | |
239 | + | func curveFunction (wRaw,uRaw,price,mRaw,sRaw,nRaw) = { | |
238 | 240 | let EXP = 271828100 | |
239 | 241 | let nsbtCurveParamA = valueOrElse(getInteger(this, "nsbtCurveParam_a"), 3) | |
240 | 242 | let wReservesInUsdn = convertWavesToNeutrino(wRaw, price) | |
241 | 243 | let brMult = fraction(wReservesInUsdn, MULT, uRaw) | |
242 | 244 | let powerMult = (nsbtCurveParamA * (brMult - (1 * MULT))) | |
243 | - | let expInPowerMult = pow(EXP, SCALEMULT, powerMult, SCALEMULT, SCALEMULT, DOWN) | |
244 | - | let constCoeff = fraction(uRaw, PRICELET, (nsbtCurveParamA * price)) | |
245 | - | let finalResultIfPriceInUsdn = fraction(constCoeff, MULT, expInPowerMult) | |
246 | - | let finalResult = fraction(finalResultIfPriceInUsdn, price, PRICELET) | |
247 | - | $Tuple6(finalResult, wReservesInUsdn, brMult, powerMult, expInPowerMult, constCoeff) | |
245 | + | let expInPowerMult = pow(EXP, MULTSCALE, powerMult, MULTSCALE, MULTSCALE, DOWN) | |
246 | + | let lnRes1 = log(((mRaw - sRaw) - nRaw), PAULISCALE, EXP, MULTSCALE, MULTSCALE, DOWN) | |
247 | + | let lnRes0 = log((mRaw - sRaw), PAULISCALE, EXP, MULTSCALE, MULTSCALE, DOWN) | |
248 | + | let lnDiffMult = (lnRes0 - lnRes1) | |
249 | + | let lnDiffMultipliedMaxRaw = fraction(mRaw, lnDiffMult, MULT) | |
250 | + | let usdnPaymentRaw = fraction(expInPowerMult, lnDiffMultipliedMaxRaw, MULT) | |
251 | + | let wavesPayment = convertNeutrinoToWaves(usdnPaymentRaw, price) | |
252 | + | [wavesPayment, usdnPaymentRaw, wRaw, uRaw, mRaw, sRaw, nRaw, nsbtCurveParamA, wReservesInUsdn, brMult, powerMult, expInPowerMult, lnRes0, lnRes1, lnDiffMult, lnDiffMultipliedMaxRaw] | |
248 | 253 | } | |
249 | 254 | ||
250 | 255 | ||
251 | - | func toStr (name,l) = (((((((((((((name + "[finalResult=") + toString(l._1)) + "wReservesInUsdn=") + toString(l._2)) + " brMult=") + toString(l._3)) + " powerMult=") + toString(l._4)) + " expInPowerMult=") + toString(l._5)) + " constCoeff=") + toString(l._6)) + "]") | |
256 | + | func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((name + "[wavesPayment=") + toString(curveResult[0])) + " usdnPayment=") + toString(curveResult[1])) + " wRaw=") + toString(curveResult[2])) + " uRaw=") + toString(curveResult[3])) + " mRaw=") + toString(curveResult[4])) + " sRaw=") + toString(curveResult[5])) + " nRaw=") + toString(curveResult[6])) + " nsbtCurveParamA=") + toString(curveResult[7])) + " wReservesInUsdn=") + toString(curveResult[8])) + " brMult=") + toString(curveResult[9])) + " powerMult=") + toString(curveResult[10])) + " expInPowerMult=") + toString(curveResult[11])) + " lnRes0=") + toString(curveResult[12])) + " lnRes1=") + toString(curveResult[13])) + " lnDiffMult=") + toString(curveResult[14])) + " maxXlndiff=") + toString(curveResult[15])) + "]") | |
257 | + | ||
258 | + | ||
259 | + | func bigComplexity (i) = 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"))))) | |
260 | + | then !(isDefined(transferTransactionById(fromBase58String("adLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
261 | + | else false) | |
262 | + | then !(isDefined(transferTransactionById(fromBase58String("sdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
263 | + | else false) | |
264 | + | then !(isDefined(transferTransactionById(fromBase58String("ddLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
265 | + | else false) | |
266 | + | then !(isDefined(transferTransactionById(fromBase58String("fdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
267 | + | else false) | |
268 | + | then !(isDefined(transferTransactionById(fromBase58String("gdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
269 | + | else false) | |
270 | + | then !(isDefined(transferTransactionById(fromBase58String("hdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
271 | + | else false) | |
272 | + | then !(isDefined(transferTransactionById(fromBase58String("jdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
273 | + | else false) | |
274 | + | then !(isDefined(transferTransactionById(fromBase58String("kdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
275 | + | else false) | |
276 | + | then !(isDefined(transferTransactionById(fromBase58String("rdLw5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
277 | + | else false) | |
278 | + | then !(isDefined(transferTransactionById(fromBase58String("tdLq5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
279 | + | else false) | |
280 | + | then !(isDefined(transferTransactionById(fromBase58String("tdLy5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
281 | + | else false) | |
282 | + | then !(isDefined(transferTransactionById(fromBase58String("tdLu5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
283 | + | else false) | |
284 | + | then !(isDefined(transferTransactionById(fromBase58String("tdLh5JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
285 | + | else false) | |
286 | + | then !(isDefined(transferTransactionById(fromBase58String("1dL4JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
287 | + | else false) | |
288 | + | then !(isDefined(transferTransactionById(fromBase58String("2dL25JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
289 | + | else false) | |
290 | + | then !(isDefined(transferTransactionById(fromBase58String("3dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
291 | + | else false) | |
292 | + | then !(isDefined(transferTransactionById(fromBase58String("4dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
293 | + | else false) | |
294 | + | then !(isDefined(transferTransactionById(fromBase58String("5dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
295 | + | else false) | |
296 | + | then !(isDefined(transferTransactionById(fromBase58String("6dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
297 | + | else false) | |
298 | + | then !(isDefined(transferTransactionById(fromBase58String("7dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
299 | + | else false) | |
300 | + | then !(isDefined(transferTransactionById(fromBase58String("8dL95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
301 | + | else false) | |
302 | + | then !(isDefined(transferTransactionById(fromBase58String("91L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
303 | + | else false) | |
304 | + | then !(isDefined(transferTransactionById(fromBase58String("92L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
305 | + | else false) | |
306 | + | then !(isDefined(transferTransactionById(fromBase58String("93L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
307 | + | else false) | |
308 | + | then !(isDefined(transferTransactionById(fromBase58String("94L95JKdpqfSEqvmFJvchejorAkzd4BrWLvoFwvMGu5k")))) | |
309 | + | else false | |
252 | 310 | ||
253 | 311 | ||
254 | 312 | @Callable(i) | |
255 | - | func buyNsbtInSurplus () = { | |
313 | + | func buyNsbtInSurplus (nsbtAmount,toleranceRaw) = { | |
256 | 314 | let pmt = value(i.payments[0]) | |
257 | 315 | let pmtAmount = pmt.amount | |
258 | 316 | let ownerAddress = i.caller | |
259 | 317 | if (isBlocked) | |
260 | 318 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
261 | - | else if (( | |
262 | - | then throw( | |
263 | - | else if ( | |
264 | - | then throw(" | |
319 | + | else if (isDefined(pmt.assetId)) | |
320 | + | then throw("can use waves only") | |
321 | + | else if (((10 * WAVELET) > pmtAmount)) | |
322 | + | then throw("min 10 waves expected") | |
265 | 323 | else { | |
266 | - | let f0 = curveFunction(reserve, neutrinoSupply, currentPrice) | |
267 | - | let f1 = curveFunction((reserve + pmtAmount), neutrinoSupply, currentPrice) | |
268 | - | let nsbtAmount = (f0._1 - f1._1) | |
269 | - | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(pmtAmount, nsbtAmount) | |
270 | - | let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100) | |
271 | - | (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(neutrinoContract, pmtAmount, unit), StringEntry("debug_f0", toStr("f0", f0)), StringEntry("debug_f1", toStr("f1", f1))]) | |
324 | + | let issuedNsbt = valueOrElse(getInteger(this, "tmp_issuedNsbt"), 0) | |
325 | + | let nsbtMax = ((2500 * 1000) * PAULI) | |
326 | + | let nsbtCurrent = (((1500 * 1000) * PAULI) + issuedNsbt) | |
327 | + | let curveResult = curveFunction(reserve, neutrinoSupply, currentPrice, nsbtMax, nsbtCurrent, nsbtAmount) | |
328 | + | let requiredWaves = curveResult[0] | |
329 | + | if ((requiredWaves > pmtAmount)) | |
330 | + | then throw(((("Payment amount is less then required: pmtAmount=" + toString(pmtAmount)) + " requiredWaves=") + toString(requiredWaves))) | |
331 | + | else if ((0 > toleranceRaw)) | |
332 | + | then throw("Invalid tolerance param") | |
333 | + | else { | |
334 | + | let maxAllowedPayment = fraction(requiredWaves, (toleranceRaw + PAULI), PAULI) | |
335 | + | if ((requiredWaves > maxAllowedPayment)) | |
336 | + | then throw(((("Tolerance check failed: pmtAmount=" + toString(pmtAmount)) + " maxAllowedPayment=") + toString(maxAllowedPayment))) | |
337 | + | else { | |
338 | + | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(requiredWaves, nsbtAmount) | |
339 | + | let roi = (fraction(getReversePrice(nsbt2WavesPriceRaw), 100, currentPrice) - 100) | |
340 | + | (orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw) ++ [ScriptTransfer(ownerAddress, nsbtAmount, bondAssetId), ScriptTransfer(ownerAddress, (pmtAmount - requiredWaves), unit), ScriptTransfer(neutrinoContract, requiredWaves, unit), StringEntry("debug_curveResult", toStr("curveResult", curveResult)), IntegerEntry("tmp_issuedNsbt", (issuedNsbt + nsbtAmount))]) | |
341 | + | } | |
342 | + | } | |
272 | 343 | } | |
273 | 344 | } | |
274 | 345 | ||
275 | 346 | ||
276 | 347 | ||
277 | 348 | @Callable(i) | |
278 | 349 | func instantBuyNsbtOrFail (noLessThenRoi) = { | |
279 | 350 | let pmt = value(i.payments[0]) | |
280 | 351 | let roi = currentMaxRoi | |
281 | 352 | if ((noLessThenRoi > roi)) | |
282 | 353 | then throw(((("Current maxRoi=" + toString(roi)) + " is less then passed parameter noLessThenRoi=") + toString(noLessThenRoi))) | |
283 | 354 | else { | |
284 | 355 | let priceWavesByBondCents = getPriceForRoi(roi) | |
285 | 356 | internalAddBuyBondOrder(roi, getReversePrice(priceWavesByBondCents), "", i, true) | |
286 | 357 | } | |
287 | 358 | } | |
288 | 359 | ||
289 | 360 | ||
290 | 361 | ||
291 | 362 | @Callable(i) | |
292 | 363 | func addBuyBondOrder (price,prevOrder) = { | |
293 | 364 | let pmt = value(i.payments[0]) | |
294 | 365 | let priceWavesByBondCents = getReversePrice(price) | |
295 | 366 | if ((0 >= price)) | |
296 | 367 | then throw("price less zero") | |
297 | 368 | else internalAddBuyBondOrder(fraction((priceWavesByBondCents - currentPrice), 100, currentPrice), price, prevOrder, i, false) | |
298 | 369 | } | |
299 | 370 | ||
300 | 371 | ||
301 | 372 | ||
302 | 373 | @Callable(i) | |
303 | 374 | func cancelOrder (orderId) = { | |
304 | 375 | let owner = getOrderOwner(orderId) | |
305 | 376 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
306 | 377 | let caller = toString(i.caller) | |
307 | 378 | let nextOrder = getNextOrder(orderId) | |
308 | 379 | let prevOrder = getPrevOrder(orderId) | |
309 | 380 | if (isBlocked) | |
310 | 381 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
311 | 382 | else if ((owner != caller)) | |
312 | 383 | then throw("permission denied") | |
313 | 384 | else if ((getOrderStatus(orderId) != NEW)) | |
314 | 385 | then throw("invalid order status") | |
315 | 386 | else [StringEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
316 | 387 | then nextOrder | |
317 | 388 | else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)] | |
318 | 389 | } | |
319 | 390 | ||
320 | 391 | ||
321 | 392 | ||
322 | 393 | @Callable(i) | |
323 | 394 | func sellBond () = if (isBlocked) | |
324 | 395 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
325 | 396 | else if ((firstOrder == "")) | |
326 | 397 | then throw("empty orderbook") | |
327 | 398 | else { | |
328 | 399 | let nextOrder = getNextOrder(firstOrder) | |
329 | 400 | let filledTotal = getOrderFilledTotal(firstOrder) | |
330 | 401 | let orderPrice = getOrderPrice(firstOrder) | |
331 | 402 | let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder)) | |
332 | 403 | let paymentWavelets = getOrderTotal(firstOrder) | |
333 | 404 | let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder))) | |
334 | 405 | internalSellBond(firstOrder, nextOrder, filledTotal, roi, orderPrice, paymentWavelets, orderOwnerAddress, false) | |
335 | 406 | } | |
336 | 407 | ||
337 | 408 | ||
338 | 409 | @Verifier(tx) | |
339 | 410 | func verify () = { | |
340 | 411 | let pubKeyAdminsList = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
341 | 412 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
342 | 413 | then 1 | |
343 | 414 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
344 | 415 | then 1 | |
345 | 416 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
346 | 417 | then 1 | |
347 | 418 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
348 | 419 | then 2 | |
349 | 420 | else 0)) | |
350 | 421 | (count >= 3) | |
351 | 422 | } | |
352 | 423 |
github/deemru/w8io/169f3d6 59.02 ms ◑