tx · 9pGyseh4T9XjJJyWuLEBJfisFyLzrGo1mLFG8Cd7oHFg 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd: -0.04000000 Waves 2022.07.11 14:45 [2135034] smart account 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd > SELF 0.00000000 Waves
{ "type": 13, "id": "9pGyseh4T9XjJJyWuLEBJfisFyLzrGo1mLFG8Cd7oHFg", "fee": 4000000, "feeAssetId": null, "timestamp": 1657539969396, "version": 1, "sender": "3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd", "senderPublicKey": "CdnTmMHxT68Qa4MtHEnAiUhsdKTi2YkHPGn92ThinVNt", "proofs": [ "2D3D2ntiWsyUfxUiF4RUa6UrzAWY4HWPoxsuKszpzCj4QiCEWGX9R8C5vCj6qgnvUg8YmJp3yWkc7oMtkq6ytiU9", "67Hb4Jw1ZgYo3DfK6Ap1hEFFDFVaUTW53MNui2igRUwU63h2vGNnWmYoDgfVCvueeYikqXSfok9LzLxsZ1yRi7i1", "4VhKucmMheUW7UhUxGTLwRs6pzAUFMiUZWzoYLXUfsu2T8DW9Ab8y8E4mjwYKTd9qPd9fbm2ZBKLAEKnhmuEwNX6" ], "script": "base64:AAIFAAAAAAAAACcIAhIFCgMIAQESBAoCAQESABIAEgMKAQgSABIAEgASABIFCgMBAQQAAABaAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAHYWRkcmVzcwU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AADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAABAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADS9v/1w==", "chainId": 84, "height": 2135034, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HVZUfbhWUgdgDGZCpNz5ARKHKaUJB3GtFpcG8k1HgQc9 Next: 9xGHfnx3sPdHG1ovA4dmUP862u7CncBEBWsmn6W2wsSJ Full:
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 MULT4 = 10000 | |
46 | 46 | ||
47 | 47 | let MULT6 = 1000000 | |
48 | 48 | ||
49 | 49 | let MULT8 = 100000000 | |
50 | 50 | ||
51 | 51 | let MULTX16 = toBigInt(10000000000000000) | |
52 | 52 | ||
53 | 53 | let CANCELED = "canceled" | |
54 | 54 | ||
55 | 55 | let NEW = "new" | |
56 | 56 | ||
57 | 57 | let FILLED = "filled" | |
58 | 58 | ||
59 | 59 | let WAVESID = fromBase58String("WAVES") | |
60 | 60 | ||
61 | 61 | let nMetricIdxPrice = 0 | |
62 | 62 | ||
63 | 63 | let nMetricIdxUsdnLockedBalance = 1 | |
64 | 64 | ||
65 | 65 | let nMetricIdxWavesLockedBalance = 2 | |
66 | 66 | ||
67 | 67 | let nMetricIdxReserve = 3 | |
68 | 68 | ||
69 | 69 | let nMetricIdxReserveInUsdn = 4 | |
70 | 70 | ||
71 | 71 | let nMetricIdxUsdnSupply = 5 | |
72 | 72 | ||
73 | 73 | let nMetricIdxSurplus = 6 | |
74 | 74 | ||
75 | 75 | let nMetricIdxSurplusPercent = 7 | |
76 | 76 | ||
77 | 77 | let nMetricIdxBR = 8 | |
78 | 78 | ||
79 | 79 | let nMetricIdxNsbtSupply = 9 | |
80 | 80 | ||
81 | 81 | let nMetricIdxMaxNsbtSupply = 10 | |
82 | 82 | ||
83 | 83 | let nMetricIdxSurfSupply = 11 | |
84 | 84 | ||
85 | 85 | let bFuncIdxSurf = 0 | |
86 | 86 | ||
87 | 87 | let bFuncIdxWaves = 1 | |
88 | 88 | ||
89 | 89 | let bFuncIdxUsdn = 2 | |
90 | 90 | ||
91 | 91 | let bFuncIdxReserveStart = 3 | |
92 | 92 | ||
93 | 93 | let bFuncIdxSupplyStart = 4 | |
94 | 94 | ||
95 | 95 | let bFuncIdxBRStart = 5 | |
96 | 96 | ||
97 | 97 | let bFuncIdxReserveEnd = 6 | |
98 | 98 | ||
99 | 99 | let bFuncIdxSupplyEnd = 7 | |
100 | 100 | ||
101 | 101 | let bFuncIdxBREnd = 8 | |
102 | 102 | ||
103 | 103 | let bFuncIdxRest = 9 | |
104 | 104 | ||
105 | 105 | let bFuncIdxWavesPrice = 10 | |
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[bFuncIdxRest])), toString(asInt(surfResult[bFuncIdxWavesPrice]))], 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 | 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 | 365 | let spendWanted = fraction(averagePriceWanted, surfAmount, if ((pmtAssetId == WAVESID)) | |
366 | 366 | then MULT4 | |
367 | 367 | else MULT6) | |
368 | 368 | let spentActual = if ((pmtAssetId == WAVESID)) | |
369 | 369 | then asInt(surfResult[bFuncIdxWaves]) | |
370 | 370 | else asInt(surfResult[bFuncIdxUsdn]) | |
371 | 371 | let impactPerc = fraction((spentActual - spendWanted), MULT6, spendWanted) | |
372 | 372 | if ((impactPerc > maxTolerancePerc)) | |
373 | 373 | then throw(((("Tolerance " + toString(maxTolerancePerc)) + " exceeded: ") + toString(impactPerc))) | |
374 | 374 | else { | |
375 | 375 | let rest = asInt(surfResult[bFuncIdxRest]) | |
376 | 376 | let transfer = if ((pmtAssetId == WAVESID)) | |
377 | 377 | then { | |
378 | 378 | let wavesAmt = invoke(neutrinoContract, "acceptWaves", nil, [AttachedPayment(unit, (amt - rest))]) | |
379 | 379 | if ((wavesAmt == wavesAmt)) | |
380 | 380 | then if ((rest > 0)) | |
381 | 381 | then [ScriptTransfer(i.caller, rest, unit)] | |
382 | 382 | else nil | |
383 | 383 | else throw("Strict value is not equal to itself.") | |
384 | 384 | } | |
385 | 385 | else if ((rest > 0)) | |
386 | 386 | then [ScriptTransfer(neutrinoContract, (amt - rest), neutrinoAssetId), ScriptTransfer(i.caller, rest, neutrinoAssetId)] | |
387 | 387 | else [ScriptTransfer(neutrinoContract, (amt - rest), neutrinoAssetId)] | |
388 | 388 | let surfAssetId = fromBase58String(getStringValue(SurfAssetIdKey)) | |
389 | 389 | (transfer ++ [Reissue(surfAssetId, surfAmount, true), ScriptTransfer(i.caller, surfAmount, surfAssetId), surfData(surfResult)]) | |
390 | 390 | } | |
391 | 391 | } | |
392 | 392 | } | |
393 | 393 | ||
394 | 394 | ||
395 | 395 | @Verifier(tx) | |
396 | 396 | func verify () = { | |
397 | 397 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"], SEP) | |
398 | 398 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
399 | 399 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
400 | 400 | then 1 | |
401 | 401 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
402 | 402 | then 1 | |
403 | 403 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
404 | 404 | then 1 | |
405 | 405 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
406 | 406 | then 2 | |
407 | 407 | else 0)) | |
408 | 408 | (count >= 3) | |
409 | 409 | } | |
410 | 410 |
github/deemru/w8io/026f985 69.94 ms ◑