tx · 3Mng8tXZefAVxfnYNekSVD4bHtZM8of6by7GTp2bwVYZ 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd: -0.04000000 Waves 2022.07.08 13:58 [2130636] smart account 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd > SELF 0.00000000 Waves
{ "type": 13, "id": "3Mng8tXZefAVxfnYNekSVD4bHtZM8of6by7GTp2bwVYZ", "fee": 4000000, "feeAssetId": null, "timestamp": 1657277890858, "version": 1, "sender": "3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd", "senderPublicKey": "CdnTmMHxT68Qa4MtHEnAiUhsdKTi2YkHPGn92ThinVNt", "proofs": [ "3HQ8iUNGjVfEQxVdEmbdwweNn2L394zxJo7ind7wdbkMNDSFzf6xXpVwxnYPRDrghaBcJ2yAVUhqMZKQoMBpLEcR", "29nko8oXY87BFbBErmFEBuPHTqvrehn3WJiU6UDKKWgtiuXCP3nHZ3w681FDF19hqz5WWvfvRb4yJwdziZMj4xmw", "3MDNdg4kVeJXWn1bUgYuxxCYDqgZJirxWNaNrsmgva8yTEnUCu12MC8uWxGgizTbERBH9Be1nvRfNyyrFFLKuAH3" ], "script": "base64:AAIFAAAAAAAAACcIAhIFCgMIAQESBAoCAQESABIAEgMKAQgSABIAEgASABIFCgMBAQQAAABaAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5BwEAAAAY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AB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAIAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAwkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAMAAAAAAAAAAAIAAAAAAAAAAAAJAABnAAAAAgUAAAAFY291bnQAAAAAAAAAAAPUb1Yp", "chainId": 84, "height": 2130636, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bp1n5bin2Tv2iA1xf6yFEF6fQdQwaDNyZ86VwA24DyMR Next: HVZUfbhWUgdgDGZCpNz5ARKHKaUJB3GtFpcG8k1HgQc9 Diff:
Old | New | Differences | |
---|---|---|---|
341 | 341 | ||
342 | 342 | ||
343 | 343 | @Callable(i) | |
344 | - | func buySurf ( | |
344 | + | func buySurf (averagePriceWanted,maxTolerancePerc,autoStake) = if ((size(i.payments) != 1)) | |
345 | 345 | then throw("exactly 1 payment must be attached") | |
346 | 346 | else { | |
347 | 347 | let pmt = i.payments[0] | |
362 | 362 | else { | |
363 | 363 | let surfResult = asAnyList(invoke(mathContract, "surfFunctionREADONLY", [amt, pmtAssetId], nil)) | |
364 | 364 | let surfAmount = asInt(surfResult[bFuncIdxSurf]) | |
365 | - | if ((noLessAmount > surfAmount)) | |
366 | - | then throw(((("Requested no less than " + toString(noLessAmount)) + " SURF, but can buy only ") + toString(surfAmount))) | |
365 | + | let spendWanted = fraction(averagePriceWanted, surfAmount, MULT8) | |
366 | + | let spentActual = if ((pmtAssetId == WAVESID)) | |
367 | + | then asInt(surfResult[bFuncIdxWaves]) | |
368 | + | else asInt(surfResult[bFuncIdxUsdn]) | |
369 | + | let impactPerc = fraction((spentActual - spendWanted), MULT6, spendWanted) | |
370 | + | if ((impactPerc > maxTolerancePerc)) | |
371 | + | then throw(((("Tolerance " + toString(maxTolerancePerc)) + " exceeded: ") + toString(impactPerc))) | |
367 | 372 | else { | |
368 | 373 | let transfer = if ((pmtAssetId == WAVESID)) | |
369 | 374 | then { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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 | func asAnyList (val) = match val { | |
20 | 20 | case valAnyLyst: List[Any] => | |
21 | 21 | valAnyLyst | |
22 | 22 | case _ => | |
23 | 23 | throw("fail to cast into List[Any]") | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func asString (val) = match val { | |
28 | 28 | case valStr: String => | |
29 | 29 | valStr | |
30 | 30 | case _ => | |
31 | 31 | throw("fail to cast into String") | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func asInt (val) = match val { | |
36 | 36 | case valInt: Int => | |
37 | 37 | valInt | |
38 | 38 | case _ => | |
39 | 39 | throw("fail to cast into Int") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | let SEP = "__" | |
44 | 44 | ||
45 | 45 | let MULT6 = 1000000 | |
46 | 46 | ||
47 | 47 | let MULT8 = 100000000 | |
48 | 48 | ||
49 | 49 | let MULTX16 = toBigInt(10000000000000000) | |
50 | 50 | ||
51 | 51 | let CANCELED = "canceled" | |
52 | 52 | ||
53 | 53 | let NEW = "new" | |
54 | 54 | ||
55 | 55 | let FILLED = "filled" | |
56 | 56 | ||
57 | 57 | let WAVESID = fromBase58String("WAVES") | |
58 | 58 | ||
59 | 59 | let nMetricIdxPrice = 0 | |
60 | 60 | ||
61 | 61 | let nMetricIdxUsdnLockedBalance = 1 | |
62 | 62 | ||
63 | 63 | let nMetricIdxWavesLockedBalance = 2 | |
64 | 64 | ||
65 | 65 | let nMetricIdxReserve = 3 | |
66 | 66 | ||
67 | 67 | let nMetricIdxReserveInUsdn = 4 | |
68 | 68 | ||
69 | 69 | let nMetricIdxUsdnSupply = 5 | |
70 | 70 | ||
71 | 71 | let nMetricIdxSurplus = 6 | |
72 | 72 | ||
73 | 73 | let nMetricIdxSurplusPercent = 7 | |
74 | 74 | ||
75 | 75 | let nMetricIdxBR = 8 | |
76 | 76 | ||
77 | 77 | let nMetricIdxNsbtSupply = 9 | |
78 | 78 | ||
79 | 79 | let nMetricIdxMaxNsbtSupply = 10 | |
80 | 80 | ||
81 | 81 | let nMetricIdxSurfSupply = 11 | |
82 | 82 | ||
83 | 83 | let bFuncIdxSurf = 0 | |
84 | 84 | ||
85 | 85 | let bFuncIdxWaves = 1 | |
86 | 86 | ||
87 | 87 | let bFuncIdxUsdn = 2 | |
88 | 88 | ||
89 | 89 | let bFuncIdxReserveStart = 3 | |
90 | 90 | ||
91 | 91 | let bFuncIdxSupplyStart = 4 | |
92 | 92 | ||
93 | 93 | let bFuncIdxBRStart = 5 | |
94 | 94 | ||
95 | 95 | let bFuncIdxReserveEnd = 6 | |
96 | 96 | ||
97 | 97 | let bFuncIdxSupplyEnd = 7 | |
98 | 98 | ||
99 | 99 | let bFuncIdxBREnd = 8 | |
100 | 100 | ||
101 | 101 | let bFuncIdxRestWaves = 9 | |
102 | 102 | ||
103 | 103 | let bFuncIdxRestUsdn = 10 | |
104 | 104 | ||
105 | 105 | let bFuncIdxWavesPrice = 11 | |
106 | 106 | ||
107 | 107 | let PriceKey = "price" | |
108 | 108 | ||
109 | 109 | let NsbtAssetIdKey = "bond_asset_id" | |
110 | 110 | ||
111 | 111 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
112 | 112 | ||
113 | 113 | let SurfAssetIdKey = "surf_asset_id" | |
114 | 114 | ||
115 | 115 | let BalanceLockedkKey = "balance_lock_" | |
116 | 116 | ||
117 | 117 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
118 | 118 | ||
119 | 119 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
120 | 120 | ||
121 | 121 | let FirstOrderKey = "order_first" | |
122 | 122 | ||
123 | 123 | let MathContractKey = "math_contract" | |
124 | 124 | ||
125 | 125 | let MinWavesForNsbtBuyKey = "min_waves_nsbt_buy" | |
126 | 126 | ||
127 | 127 | let MinNsbtSellKey = "min_nsbt_sell" | |
128 | 128 | ||
129 | 129 | let MinWavesForSurfBuyKey = "min_waves_surf_buy" | |
130 | 130 | ||
131 | 131 | let MinUsdnForSurfBuyKey = "min_usdn_surf_buy" | |
132 | 132 | ||
133 | 133 | func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getPrevOrderKey (orderId) = ("order_prev_" + orderId) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULTX16, toBigInt(origScaleMult)) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULTX16)) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | let neutrinoContract = Address(base58'3N9be2mwrA52WJho6DiesZkk4351GvpnWuj') | |
173 | 173 | ||
174 | 174 | let controlContract = Address(base58'3MrwvfA9VRYwhHy4NuWPQGdxCtZdhH4LMMa') | |
175 | 175 | ||
176 | 176 | let liquidationContract = Address(base58'3N24ZPUAMhFm76N3vbNiiDtFqfUnmBHTc5N') | |
177 | 177 | ||
178 | 178 | let mathContract = addressFromStringValue(getStringByKey(MathContractKey)) | |
179 | 179 | ||
180 | 180 | let neutrinoAssetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
181 | 181 | ||
182 | 182 | let nsbtAssetId = base58'F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z' | |
183 | 183 | ||
184 | 184 | let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked") | |
185 | 185 | ||
186 | 186 | let minWavesAmountNsbtBuy = valueOrElse(getInteger(this, MinWavesForNsbtBuyKey), 1000000000) | |
187 | 187 | ||
188 | 188 | let minNsbtSell = valueOrElse(getInteger(this, MinNsbtSellKey), 1000000) | |
189 | 189 | ||
190 | 190 | let minWavesAmountSurfBuy = valueOrElse(getInteger(this, MinWavesForSurfBuyKey), 100000000) | |
191 | 191 | ||
192 | 192 | let minUsdnAmountSurfBuy = valueOrElse(getInteger(this, MinUsdnForSurfBuyKey), 10000000) | |
193 | 193 | ||
194 | 194 | let firstOrder = getStringByKey(FirstOrderKey) | |
195 | 195 | ||
196 | 196 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id)) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func getReversePrice (price) = ((MULT6 * MULT6) / price) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(toBigInt(spentWavesRaw), toBigInt((MULT6 * MULT6)), toBigInt(receivedNsbtRaw)) | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func orderData (orderId,totalWavelets,filledWavelets,owner,status,roi,price,currentPrice) = [StringEntry(getOrderPriceKey(orderId), toString(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)] | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((((name + "[nsbtAmountRaw=") + toString(asInt(curveResult[0]))) + " usdnPayment=") + toString(asInt(curveResult[1]))) + " wRaw=") + toString(asInt(curveResult[2]))) + " uRaw=") + toString(asInt(curveResult[3]))) + " mRaw=") + toString(asInt(curveResult[4]))) + " sRaw=") + toString(asInt(curveResult[5]))) + " nsbtCurveParam_a=") + toString(asInt(curveResult[6]))) + " nsbtCurveParam_b=") + toString(asInt(curveResult[7]))) + " wReservesInUsdn=") + toString(asInt(curveResult[8]))) + " price=") + toString(asInt(curveResult[9]))) + " multBR=") + toString(asInt(curveResult[10]))) + " multPower=") + toString(asInt(curveResult[11]))) + " multExpInPower=") + asString(curveResult[12])) + " multK=") + asString(curveResult[13])) + " step1=") + asString(curveResult[14])) + " step2=") + asString(curveResult[15])) + " step3=") + toString(asInt(curveResult[16]))) + "]") | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func surfData (surfResult) = StringEntry("debug_surfResult", makeString(["%d%d%d%d%d%d%d%d%d%d%d", toString(asInt(surfResult[bFuncIdxSurf])), toString(asInt(surfResult[bFuncIdxWaves])), toString(asInt(surfResult[bFuncIdxUsdn])), toString(asInt(surfResult[bFuncIdxReserveStart])), toString(asInt(surfResult[bFuncIdxSupplyStart])), toString(asInt(surfResult[bFuncIdxBRStart])), toString(asInt(surfResult[bFuncIdxReserveEnd])), toString(asInt(surfResult[bFuncIdxSupplyEnd])), toString(asInt(surfResult[bFuncIdxBREnd])), toString(asInt(surfResult[bFuncIdxRestWaves])), toString(asInt(surfResult[bFuncIdxRestUsdn]))], SEP)) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | @Callable(i) | |
233 | 233 | func constructor (mathContractAddress,minWavesForNsbtBuy,minNsbtSell) = if ((i.caller != this)) | |
234 | 234 | then throw("Permission denied") | |
235 | 235 | else [StringEntry(MathContractKey, mathContractAddress), IntegerEntry(MinNsbtSellKey, minNsbtSell), IntegerEntry(MinWavesForNsbtBuyKey, minWavesForNsbtBuy)] | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | ||
239 | 239 | @Callable(i) | |
240 | 240 | func constructorV2 (minWavesForSurfBuyKey,minUsdnForSurfBuyKey) = if ((i.caller != this)) | |
241 | 241 | then throw("Permission denied") | |
242 | 242 | else { | |
243 | 243 | let issue = Issue("SURF", "Smart Utility Recapitalization Feature token", 0, 6, true, unit, 0) | |
244 | 244 | let assetId = calculateAssetId(issue) | |
245 | 245 | [issue, StringEntry(SurfAssetIdKey, toBase58String(assetId)), IntegerEntry(MinWavesForSurfBuyKey, minWavesForSurfBuyKey), IntegerEntry(MinUsdnForSurfBuyKey, minUsdnForSurfBuyKey)] | |
246 | 246 | } | |
247 | 247 | ||
248 | 248 | ||
249 | 249 | ||
250 | 250 | @Callable(i) | |
251 | 251 | func buyNsbt () = { | |
252 | 252 | let pmt = value(i.payments[0]) | |
253 | 253 | let pmtAmount = pmt.amount | |
254 | 254 | let wavesPay = pmtAmount | |
255 | 255 | if (isBlocked) | |
256 | 256 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
257 | 257 | else if (isDefined(pmt.assetId)) | |
258 | 258 | then throw("can use waves only") | |
259 | 259 | else if ((minWavesAmountNsbtBuy > pmtAmount)) | |
260 | 260 | then throw((("min " + toString((minWavesAmountNsbtBuy / MULT8))) + " waves expected")) | |
261 | 261 | else { | |
262 | 262 | let ownerAddress = i.caller | |
263 | 263 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
264 | 264 | let currentPrice = asInt(neutrinoMetrics[0]) | |
265 | 265 | let curveResult = asAnyList(invoke(mathContract, "curveFunctionREADONLY", [wavesPay], nil)) | |
266 | 266 | let nsbtAmount = asInt(curveResult[0]) | |
267 | 267 | if ((0 >= nsbtAmount)) | |
268 | 268 | then throw("nsbtAmount <= 0") | |
269 | 269 | else { | |
270 | 270 | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(wavesPay, nsbtAmount) | |
271 | 271 | let roi = 0 | |
272 | 272 | let amountLeased = invoke(neutrinoContract, "acceptWaves", nil, i.payments) | |
273 | 273 | if ((amountLeased == amountLeased)) | |
274 | 274 | then $Tuple2((orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw, currentPrice) ++ [ScriptTransfer(ownerAddress, nsbtAmount, nsbtAssetId), StringEntry("debug_curveResult", toStr("curveResult", curveResult))]), nsbtAmount) | |
275 | 275 | else throw("Strict value is not equal to itself.") | |
276 | 276 | } | |
277 | 277 | } | |
278 | 278 | } | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | ||
282 | 282 | @Callable(i) | |
283 | 283 | func sellNsbt () = if (isBlocked) | |
284 | 284 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
285 | 285 | else { | |
286 | 286 | let pmt = value(i.payments[0]) | |
287 | 287 | let pmtAmount = pmt.amount | |
288 | 288 | if ((pmt.assetId != nsbtAssetId)) | |
289 | 289 | then throw("can use NSBT only") | |
290 | 290 | else if ((minNsbtSell > pmtAmount)) | |
291 | 291 | then throw((("min " + toString((minNsbtSell / MULT6))) + " nsbt expected")) | |
292 | 292 | else { | |
293 | 293 | let newPrice = asInt(asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [-(pmtAmount)], nil))[0]) | |
294 | 294 | if ((MULT6 > newPrice)) | |
295 | 295 | then throw((("resulting nsbt price would be < 1 (" + toString(newPrice)) + " usdn)")) | |
296 | 296 | else { | |
297 | 297 | let transf = invoke(neutrinoContract, "transferUsdnToUser", [pmtAmount, toString(i.caller)], nil) | |
298 | 298 | if ((transf == transf)) | |
299 | 299 | then $Tuple2(nil, newPrice) | |
300 | 300 | else throw("Strict value is not equal to itself.") | |
301 | 301 | } | |
302 | 302 | } | |
303 | 303 | } | |
304 | 304 | ||
305 | 305 | ||
306 | 306 | ||
307 | 307 | @Callable(i) | |
308 | 308 | func cancelOrder (orderId) = { | |
309 | 309 | let owner = getOrderOwner(orderId) | |
310 | 310 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
311 | 311 | let caller = toString(i.caller) | |
312 | 312 | let nextOrder = getNextOrder(orderId) | |
313 | 313 | let prevOrder = getPrevOrder(orderId) | |
314 | 314 | if ((getOrderStatus(orderId) != NEW)) | |
315 | 315 | then throw("invalid order status") | |
316 | 316 | else [StringEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
317 | 317 | then nextOrder | |
318 | 318 | else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)] | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | ||
323 | 323 | @Callable(i) | |
324 | 324 | func minWavesAmountNsbtBuySYSREADONLY () = $Tuple2(nil, minWavesAmountNsbtBuy) | |
325 | 325 | ||
326 | 326 | ||
327 | 327 | ||
328 | 328 | @Callable(i) | |
329 | 329 | func minNsbtAmountForSellSYSREADONLY () = $Tuple2(nil, minNsbtSell) | |
330 | 330 | ||
331 | 331 | ||
332 | 332 | ||
333 | 333 | @Callable(i) | |
334 | 334 | func minWavesAmountSurfBuySYSREADONLY () = $Tuple2(nil, minWavesAmountSurfBuy) | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | ||
338 | 338 | @Callable(i) | |
339 | 339 | func minUsdnAmountSurfBuySYSREADONLY () = $Tuple2(nil, minUsdnAmountSurfBuy) | |
340 | 340 | ||
341 | 341 | ||
342 | 342 | ||
343 | 343 | @Callable(i) | |
344 | - | func buySurf ( | |
344 | + | func buySurf (averagePriceWanted,maxTolerancePerc,autoStake) = if ((size(i.payments) != 1)) | |
345 | 345 | then throw("exactly 1 payment must be attached") | |
346 | 346 | else { | |
347 | 347 | let pmt = i.payments[0] | |
348 | 348 | let amt = pmt.amount | |
349 | 349 | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
350 | 350 | if (if ((pmtAssetId != neutrinoAssetId)) | |
351 | 351 | then (pmtAssetId != WAVESID) | |
352 | 352 | else false) | |
353 | 353 | then throw("Unsupported payment asset") | |
354 | 354 | else if (if ((pmtAssetId == neutrinoAssetId)) | |
355 | 355 | then (minUsdnAmountSurfBuy > amt) | |
356 | 356 | else false) | |
357 | 357 | then throw((("min " + toString((minUsdnAmountSurfBuy / MULT6))) + " USDN expected")) | |
358 | 358 | else if (if ((pmtAssetId == WAVESID)) | |
359 | 359 | then (minWavesAmountSurfBuy > amt) | |
360 | 360 | else false) | |
361 | 361 | then throw((("min " + toString((minWavesAmountSurfBuy / MULT8))) + " WAVES expected")) | |
362 | 362 | else { | |
363 | 363 | let surfResult = asAnyList(invoke(mathContract, "surfFunctionREADONLY", [amt, pmtAssetId], nil)) | |
364 | 364 | let surfAmount = asInt(surfResult[bFuncIdxSurf]) | |
365 | - | if ((noLessAmount > surfAmount)) | |
366 | - | then throw(((("Requested no less than " + toString(noLessAmount)) + " SURF, but can buy only ") + toString(surfAmount))) | |
365 | + | let spendWanted = fraction(averagePriceWanted, surfAmount, MULT8) | |
366 | + | let spentActual = if ((pmtAssetId == WAVESID)) | |
367 | + | then asInt(surfResult[bFuncIdxWaves]) | |
368 | + | else asInt(surfResult[bFuncIdxUsdn]) | |
369 | + | let impactPerc = fraction((spentActual - spendWanted), MULT6, spendWanted) | |
370 | + | if ((impactPerc > maxTolerancePerc)) | |
371 | + | then throw(((("Tolerance " + toString(maxTolerancePerc)) + " exceeded: ") + toString(impactPerc))) | |
367 | 372 | else { | |
368 | 373 | let transfer = if ((pmtAssetId == WAVESID)) | |
369 | 374 | then { | |
370 | 375 | let restWaves = asInt(surfResult[bFuncIdxRestWaves]) | |
371 | 376 | let wavesAmt = invoke(neutrinoContract, "acceptWaves", nil, [AttachedPayment(unit, (amt - restWaves))]) | |
372 | 377 | if ((wavesAmt == wavesAmt)) | |
373 | 378 | then if ((restWaves > 0)) | |
374 | 379 | then [ScriptTransfer(i.caller, restWaves, unit)] | |
375 | 380 | else nil | |
376 | 381 | else throw("Strict value is not equal to itself.") | |
377 | 382 | } | |
378 | 383 | else { | |
379 | 384 | let restUsdn = asInt(surfResult[bFuncIdxRestUsdn]) | |
380 | 385 | if ((restUsdn > 0)) | |
381 | 386 | then [ScriptTransfer(neutrinoContract, (amt - restUsdn), neutrinoAssetId), ScriptTransfer(i.caller, restUsdn, neutrinoAssetId)] | |
382 | 387 | else [ScriptTransfer(neutrinoContract, (amt - restUsdn), neutrinoAssetId)] | |
383 | 388 | } | |
384 | 389 | let surfAssetId = fromBase58String(getStringValue(SurfAssetIdKey)) | |
385 | 390 | (transfer ++ [Reissue(surfAssetId, surfAmount, true), ScriptTransfer(i.caller, surfAmount, surfAssetId), surfData(surfResult)]) | |
386 | 391 | } | |
387 | 392 | } | |
388 | 393 | } | |
389 | 394 | ||
390 | 395 | ||
391 | 396 | @Verifier(tx) | |
392 | 397 | func verify () = { | |
393 | 398 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"], SEP) | |
394 | 399 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
395 | 400 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
396 | 401 | then 1 | |
397 | 402 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
398 | 403 | then 1 | |
399 | 404 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
400 | 405 | then 1 | |
401 | 406 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
402 | 407 | then 2 | |
403 | 408 | else 0)) | |
404 | 409 | (count >= 3) | |
405 | 410 | } | |
406 | 411 |
github/deemru/w8io/026f985 63.46 ms ◑