tx · 41bKCubY3kMzrmtWrx1BwzPcbC7MJ6tfbhriM41x7VCD 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd: -0.01900000 Waves 2023.03.01 18:18 [2471169] smart account 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd > SELF 0.00000000 Waves
{ "type": 13, "id": "41bKCubY3kMzrmtWrx1BwzPcbC7MJ6tfbhriM41x7VCD", "fee": 1900000, "feeAssetId": null, "timestamp": 1677683921290, "version": 2, "chainId": 84, "sender": "3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd", "senderPublicKey": "CdnTmMHxT68Qa4MtHEnAiUhsdKTi2YkHPGn92ThinVNt", "proofs": [ "26ydS2TunCqHrpLcL5Ba6chpZmAaReVeyZGeQVoenafLQFBZm7bmzkch6gHXt7YEDfGuEPZN4iLgoCdTgdQMERsm", "2EKfSt3cTgnRtw2xfmmY13Z9ZvBDTomUQRdBQaUi3vL8g5wLCCSxE3WWYuHN8k6opx9Z239gJZfFjUBKUBqRuiHB", "613UdSZBxyfsZFJ5Mrg4npG2HpXirYQXda2WhBCuZubKnru8hKM2SoruVsqLSAvYXAUcLiLqQF5WUS51PBR447aN" ], "script": "base64:BgIuCAISBQoDCAEBEgUKAwEBCBIAEgASAwoBCBIAEgASABIAEgUKAwEBBBIECgIBCG0BDmdldE51bWJlckJ5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUDa2V5AAABDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABFmdldEJvb2xCeUFkZHJlc3NBbmRLZXkCB2FkZHJlc3MDa2V5CQELdmFsdWVPckVsc2UCCQCbCAIFB2FkZHJlc3MFA2tleQcBGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQIHYWRkcmVzcwNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUHYWRkcmVzcwUDa2V5AgABGGdldE51bWJlckJ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zdAADAAIAAAkAZwIFBWNvdW50AAMe6YIK", "height": 2471169, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F9p2EZp6KYaGKNkne7XimzcXk67u1Ee3kMrte7TrHvcQ Next: 9YdrK9ZqosM3xe1aezidgGu67UcaNPZLKGahDq49Z54 Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
145 | 145 | func keyControlCfg () = "%s__controlConfig" | |
146 | 146 | ||
147 | 147 | ||
148 | - | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
148 | + | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
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 | func asBytes (val) = match val { | |
44 | 44 | case valByte: ByteVector => | |
45 | 45 | valByte | |
46 | 46 | case _ => | |
47 | 47 | throw("fail to cast into ByteVector") | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | let SEP = "__" | |
52 | 52 | ||
53 | 53 | let MULT6 = 1000000 | |
54 | 54 | ||
55 | 55 | let MULT8 = 100000000 | |
56 | 56 | ||
57 | 57 | let MULTX10 = toBigInt(10000000000) | |
58 | 58 | ||
59 | 59 | let MULTX12 = toBigInt(1000000000000) | |
60 | 60 | ||
61 | 61 | let MULTX16 = toBigInt(10000000000000000) | |
62 | 62 | ||
63 | 63 | let CANCELED = "canceled" | |
64 | 64 | ||
65 | 65 | let NEW = "new" | |
66 | 66 | ||
67 | 67 | let FILLED = "filled" | |
68 | 68 | ||
69 | 69 | let WAVESID = fromBase58String("WAVES") | |
70 | 70 | ||
71 | 71 | let nMetricIdxPrice = 0 | |
72 | 72 | ||
73 | 73 | let nMetricIdxUsdnLockedBalance = 1 | |
74 | 74 | ||
75 | 75 | let nMetricIdxWavesLockedBalance = 2 | |
76 | 76 | ||
77 | 77 | let nMetricIdxReserve = 3 | |
78 | 78 | ||
79 | 79 | let nMetricIdxReserveInUsdn = 4 | |
80 | 80 | ||
81 | 81 | let nMetricIdxUsdnSupply = 5 | |
82 | 82 | ||
83 | 83 | let nMetricIdxSurplus = 6 | |
84 | 84 | ||
85 | 85 | let nMetricIdxSurplusPercent = 7 | |
86 | 86 | ||
87 | 87 | let nMetricIdxBR = 8 | |
88 | 88 | ||
89 | 89 | let nMetricIdxNsbtSupply = 9 | |
90 | 90 | ||
91 | 91 | let nMetricIdxMaxNsbtSupply = 10 | |
92 | 92 | ||
93 | 93 | let nMetricIdxSurfSupply = 11 | |
94 | 94 | ||
95 | 95 | let bFuncIdxSurf = 0 | |
96 | 96 | ||
97 | 97 | let bFuncIdxWaves = 1 | |
98 | 98 | ||
99 | 99 | let bFuncIdxUsdn = 2 | |
100 | 100 | ||
101 | 101 | let bFuncIdxReserveStart = 3 | |
102 | 102 | ||
103 | 103 | let bFuncIdxSupplyStart = 4 | |
104 | 104 | ||
105 | 105 | let bFuncIdxBRStart = 5 | |
106 | 106 | ||
107 | 107 | let bFuncIdxReserveEnd = 6 | |
108 | 108 | ||
109 | 109 | let bFuncIdxSupplyEnd = 7 | |
110 | 110 | ||
111 | 111 | let bFuncIdxBREnd = 8 | |
112 | 112 | ||
113 | 113 | let bFuncIdxRest = 9 | |
114 | 114 | ||
115 | 115 | let bFuncIdxWavesPrice = 10 | |
116 | 116 | ||
117 | 117 | let IdxControlCfgNeutrinoDapp = 1 | |
118 | 118 | ||
119 | 119 | let IdxControlCfgAuctionDapp = 2 | |
120 | 120 | ||
121 | 121 | let IdxControlCfgRpdDapp = 3 | |
122 | 122 | ||
123 | 123 | let IdxControlCfgMathDapp = 4 | |
124 | 124 | ||
125 | 125 | let IdxControlCfgLiquidationDapp = 5 | |
126 | 126 | ||
127 | 127 | let IdxControlCfgRestDapp = 6 | |
128 | 128 | ||
129 | 129 | let IdxControlCfgNodeRegistryDapp = 7 | |
130 | 130 | ||
131 | 131 | let IdxControlCfgNsbtStakingDapp = 8 | |
132 | 132 | ||
133 | 133 | let IdxControlCfgMediatorDapp = 9 | |
134 | 134 | ||
135 | 135 | let IdxControlCfgSurfStakingDapp = 10 | |
136 | 136 | ||
137 | 137 | let IdxControlCfgGnsbtControllerDapp = 11 | |
138 | 138 | ||
139 | 139 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func keyControlAddress () = "%s%s__config__controlAddress" | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func keyControlCfg () = "%s__controlConfig" | |
146 | 146 | ||
147 | 147 | ||
148 | - | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
148 | + | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
155 | 155 | ||
156 | 156 | let controlCfg = readControlCfgOrFail(controlContract) | |
157 | 157 | ||
158 | 158 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
159 | 159 | ||
160 | 160 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
161 | 161 | ||
162 | 162 | let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp) | |
163 | 163 | ||
164 | 164 | let PriceKey = "price" | |
165 | 165 | ||
166 | 166 | let NsbtAssetIdKey = "bond_asset_id" | |
167 | 167 | ||
168 | 168 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
169 | 169 | ||
170 | 170 | let SurfAssetIdKey = "surf_asset_id" | |
171 | 171 | ||
172 | 172 | let BalanceLockedkKey = "balance_lock_" | |
173 | 173 | ||
174 | 174 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
175 | 175 | ||
176 | 176 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
177 | 177 | ||
178 | 178 | let FirstOrderKey = "order_first" | |
179 | 179 | ||
180 | 180 | let MathContractKey = "math_contract" | |
181 | 181 | ||
182 | 182 | let MinWavesForNsbtBuyKey = "min_waves_nsbt_buy" | |
183 | 183 | ||
184 | 184 | let MinNsbtSellKey = "min_nsbt_sell" | |
185 | 185 | ||
186 | 186 | let MinWavesForSurfBuyKey = "min_waves_surf_buy" | |
187 | 187 | ||
188 | 188 | let MinUsdnForSurfBuyKey = "min_usdn_surf_buy" | |
189 | 189 | ||
190 | 190 | func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func getPrevOrderKey (orderId) = ("order_prev_" + orderId) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULTX16, toBigInt(origScaleMult)) | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULTX16)) | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | let neutrinoAssetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
230 | 230 | ||
231 | 231 | let nsbtAssetId = base58'F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z' | |
232 | 232 | ||
233 | 233 | let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked") | |
234 | 234 | ||
235 | 235 | let minWavesAmountNsbtBuy = valueOrElse(getInteger(this, MinWavesForNsbtBuyKey), 1000000000) | |
236 | 236 | ||
237 | 237 | let minNsbtSell = valueOrElse(getInteger(this, MinNsbtSellKey), 1000000) | |
238 | 238 | ||
239 | 239 | let minWavesAmountSurfBuy = valueOrElse(getInteger(this, MinWavesForSurfBuyKey), 100000000) | |
240 | 240 | ||
241 | 241 | let minUsdnAmountSurfBuy = valueOrElse(getInteger(this, MinUsdnForSurfBuyKey), 10000000) | |
242 | 242 | ||
243 | 243 | let firstOrder = getStringByKey(FirstOrderKey) | |
244 | 244 | ||
245 | 245 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id)) | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func getReversePrice (price) = ((MULT6 * MULT6) / price) | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(toBigInt(spentWavesRaw), toBigInt((MULT6 * MULT6)), toBigInt(receivedNsbtRaw)) | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | 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)] | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | 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]))) + "]") | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | 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)) | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | @Callable(i) | |
282 | 282 | func constructorV1 (mathContractAddress,minWavesForNsbtBuy,minNsbtSell) = if ((i.caller != this)) | |
283 | 283 | then throw("Permission denied") | |
284 | 284 | else [StringEntry(MathContractKey, mathContractAddress), IntegerEntry(MinNsbtSellKey, minNsbtSell), IntegerEntry(MinWavesForNsbtBuyKey, minWavesForNsbtBuy)] | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | ||
288 | 288 | @Callable(i) | |
289 | 289 | func constructorV2 (minWavesForSurfBuyKey,minUsdnForSurfBuyKey,description) = if ((i.caller != this)) | |
290 | 290 | then throw("Permission denied") | |
291 | 291 | else { | |
292 | 292 | let issue = Issue("SURF", description, 0, 6, true, unit, 0) | |
293 | 293 | let assetId = calculateAssetId(issue) | |
294 | 294 | [issue, StringEntry(SurfAssetIdKey, toBase58String(assetId)), IntegerEntry(MinWavesForSurfBuyKey, minWavesForSurfBuyKey), IntegerEntry(MinUsdnForSurfBuyKey, minUsdnForSurfBuyKey)] | |
295 | 295 | } | |
296 | 296 | ||
297 | 297 | ||
298 | 298 | ||
299 | 299 | @Callable(i) | |
300 | 300 | func buyNsbt () = { | |
301 | 301 | let pmt = value(i.payments[0]) | |
302 | 302 | let pmtAmount = pmt.amount | |
303 | 303 | let wavesPay = pmtAmount | |
304 | 304 | if (isBlocked) | |
305 | 305 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
306 | 306 | else if (isDefined(pmt.assetId)) | |
307 | 307 | then throw("can use waves only") | |
308 | 308 | else if ((minWavesAmountNsbtBuy > pmtAmount)) | |
309 | 309 | then throw((("min " + toString((minWavesAmountNsbtBuy / MULT8))) + " waves expected")) | |
310 | 310 | else { | |
311 | 311 | let ownerAddress = i.caller | |
312 | 312 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
313 | 313 | let currentPrice = asInt(neutrinoMetrics[0]) | |
314 | 314 | let curveResult = asAnyList(invoke(mathContract, "curveFunctionREADONLY", [wavesPay], nil)) | |
315 | 315 | let nsbtAmount = asInt(curveResult[0]) | |
316 | 316 | if ((0 >= nsbtAmount)) | |
317 | 317 | then throw("nsbtAmount <= 0") | |
318 | 318 | else { | |
319 | 319 | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(wavesPay, nsbtAmount) | |
320 | 320 | let roi = 0 | |
321 | 321 | let amountLeased = invoke(neutrinoContract, "acceptWaves", nil, i.payments) | |
322 | 322 | if ((amountLeased == amountLeased)) | |
323 | 323 | 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) | |
324 | 324 | else throw("Strict value is not equal to itself.") | |
325 | 325 | } | |
326 | 326 | } | |
327 | 327 | } | |
328 | 328 | ||
329 | 329 | ||
330 | 330 | ||
331 | 331 | @Callable(i) | |
332 | 332 | func sellNsbt () = if (isBlocked) | |
333 | 333 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
334 | 334 | else { | |
335 | 335 | let pmt = value(i.payments[0]) | |
336 | 336 | let pmtAmount = pmt.amount | |
337 | 337 | if ((pmt.assetId != nsbtAssetId)) | |
338 | 338 | then throw("can use NSBT only") | |
339 | 339 | else if ((minNsbtSell > pmtAmount)) | |
340 | 340 | then throw((("min " + toString((minNsbtSell / MULT6))) + " nsbt expected")) | |
341 | 341 | else { | |
342 | 342 | let newPrice = asInt(asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [-(pmtAmount)], nil))[0]) | |
343 | 343 | if ((MULT6 > newPrice)) | |
344 | 344 | then throw((("resulting nsbt price would be < 1 (" + toString(newPrice)) + " usdn)")) | |
345 | 345 | else { | |
346 | 346 | let transf = invoke(neutrinoContract, "transferUsdnToUser", [pmtAmount, toString(i.caller)], nil) | |
347 | 347 | if ((transf == transf)) | |
348 | 348 | then $Tuple2(nil, newPrice) | |
349 | 349 | else throw("Strict value is not equal to itself.") | |
350 | 350 | } | |
351 | 351 | } | |
352 | 352 | } | |
353 | 353 | ||
354 | 354 | ||
355 | 355 | ||
356 | 356 | @Callable(i) | |
357 | 357 | func cancelOrder (orderId) = { | |
358 | 358 | let owner = getOrderOwner(orderId) | |
359 | 359 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
360 | 360 | let caller = toString(i.caller) | |
361 | 361 | let nextOrder = getNextOrder(orderId) | |
362 | 362 | let prevOrder = getPrevOrder(orderId) | |
363 | 363 | if ((getOrderStatus(orderId) != NEW)) | |
364 | 364 | then throw("invalid order status") | |
365 | 365 | else [StringEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
366 | 366 | then nextOrder | |
367 | 367 | else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)] | |
368 | 368 | } | |
369 | 369 | ||
370 | 370 | ||
371 | 371 | ||
372 | 372 | @Callable(i) | |
373 | 373 | func minWavesAmountNsbtBuySYSREADONLY () = $Tuple2(nil, minWavesAmountNsbtBuy) | |
374 | 374 | ||
375 | 375 | ||
376 | 376 | ||
377 | 377 | @Callable(i) | |
378 | 378 | func minNsbtAmountForSellSYSREADONLY () = $Tuple2(nil, minNsbtSell) | |
379 | 379 | ||
380 | 380 | ||
381 | 381 | ||
382 | 382 | @Callable(i) | |
383 | 383 | func minWavesAmountSurfBuySYSREADONLY () = $Tuple2(nil, minWavesAmountSurfBuy) | |
384 | 384 | ||
385 | 385 | ||
386 | 386 | ||
387 | 387 | @Callable(i) | |
388 | 388 | func minUsdnAmountSurfBuySYSREADONLY () = $Tuple2(nil, minUsdnAmountSurfBuy) | |
389 | 389 | ||
390 | 390 | ||
391 | 391 | ||
392 | 392 | @Callable(i) | |
393 | 393 | func buySurf (averagePriceWanted,maxTolerancePerc,autoStake) = { | |
394 | 394 | let testAccounts = valueOrElse(getString(this, "testAccounts"), "") | |
395 | 395 | if (if ((testAccounts != "")) | |
396 | 396 | then !(contains(testAccounts, toString(i.caller))) | |
397 | 397 | else false) | |
398 | 398 | then throw("Be patient! Need to test in mainnet before launch.") | |
399 | 399 | else if ((size(i.payments) != 1)) | |
400 | 400 | then throw("exactly 1 payment must be attached") | |
401 | 401 | else if ((0 >= averagePriceWanted)) | |
402 | 402 | then throw("averagePriceWanted should be positive") | |
403 | 403 | else if ((0 >= maxTolerancePerc)) | |
404 | 404 | then throw("maxTolerancePerc should be positive") | |
405 | 405 | else if (isBlocked) | |
406 | 406 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
407 | 407 | else { | |
408 | 408 | let pmt = i.payments[0] | |
409 | 409 | let amt = pmt.amount | |
410 | 410 | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
411 | 411 | if (if ((pmtAssetId != neutrinoAssetId)) | |
412 | 412 | then (pmtAssetId != WAVESID) | |
413 | 413 | else false) | |
414 | 414 | then throw("Unsupported payment asset") | |
415 | 415 | else if (if ((pmtAssetId == neutrinoAssetId)) | |
416 | 416 | then (minUsdnAmountSurfBuy > amt) | |
417 | 417 | else false) | |
418 | 418 | then throw((("min " + toString((minUsdnAmountSurfBuy / MULT6))) + " USDN expected")) | |
419 | 419 | else if (if ((pmtAssetId == WAVESID)) | |
420 | 420 | then (minWavesAmountSurfBuy > amt) | |
421 | 421 | else false) | |
422 | 422 | then throw((("min " + toString((minWavesAmountSurfBuy / MULT8))) + " WAVES expected")) | |
423 | 423 | else { | |
424 | 424 | let surfResult = asAnyList(invoke(mathContract, "surfFunctionREADONLY", [amt, pmtAssetId], nil)) | |
425 | 425 | let spentWaves = asInt(surfResult[bFuncIdxWaves]) | |
426 | 426 | let spentUsdn = asInt(surfResult[bFuncIdxUsdn]) | |
427 | 427 | let surfAmount = asInt(surfResult[bFuncIdxSurf]) | |
428 | 428 | let surfAmountX6 = toBigInt(surfAmount) | |
429 | 429 | let spentActualX18 = if ((pmtAssetId == WAVESID)) | |
430 | 430 | then (toBigInt(spentWaves) * MULTX10) | |
431 | 431 | else (toBigInt(spentUsdn) * MULTX12) | |
432 | 432 | if ((spentActualX18 > ((toBigInt((maxTolerancePerc + MULT6)) * toBigInt(averagePriceWanted)) * surfAmountX6))) | |
433 | 433 | then throw((((((("Tolerance " + toString(maxTolerancePerc)) + " exceeded: spent ") + (if ((pmtAssetId == WAVESID)) | |
434 | 434 | then (toString(spentWaves) + " WAVES") | |
435 | 435 | else (toString(spentUsdn) + " USDN"))) + " for ") + toString(surfAmount)) + " SURF")) | |
436 | 436 | else { | |
437 | 437 | let rest = asInt(surfResult[bFuncIdxRest]) | |
438 | 438 | let transfer = if ((pmtAssetId == WAVESID)) | |
439 | 439 | then { | |
440 | 440 | let wavesAmt = invoke(neutrinoContract, "acceptWaves", nil, [AttachedPayment(unit, (amt - rest))]) | |
441 | 441 | if ((wavesAmt == wavesAmt)) | |
442 | 442 | then if ((rest > 0)) | |
443 | 443 | then [ScriptTransfer(i.caller, rest, unit)] | |
444 | 444 | else nil | |
445 | 445 | else throw("Strict value is not equal to itself.") | |
446 | 446 | } | |
447 | 447 | else if ((rest > 0)) | |
448 | 448 | then [ScriptTransfer(neutrinoContract, (amt - rest), neutrinoAssetId), ScriptTransfer(i.caller, rest, neutrinoAssetId)] | |
449 | 449 | else [ScriptTransfer(neutrinoContract, (amt - rest), neutrinoAssetId)] | |
450 | 450 | let surfAssetId = asBytes(invoke(this, "issueSurf", [surfAmount, ""], nil)) | |
451 | 451 | let surfAction = if (autoStake) | |
452 | 452 | then { | |
453 | 453 | let stakingInv = invoke(surfStakingContract, "stakeByOriginCaller", nil, [AttachedPayment(surfAssetId, surfAmount)]) | |
454 | 454 | if ((stakingInv == stakingInv)) | |
455 | 455 | then nil | |
456 | 456 | else throw("Strict value is not equal to itself.") | |
457 | 457 | } | |
458 | 458 | else [ScriptTransfer(i.caller, surfAmount, surfAssetId)] | |
459 | 459 | ((transfer ++ [surfData(surfResult)]) ++ surfAction) | |
460 | 460 | } | |
461 | 461 | } | |
462 | 462 | } | |
463 | 463 | } | |
464 | 464 | ||
465 | 465 | ||
466 | 466 | ||
467 | 467 | @Callable(i) | |
468 | 468 | func issueSurf (surfAmount,targetAddress) = { | |
469 | 469 | let surfAssetId = fromBase58String(getStringValue(SurfAssetIdKey)) | |
470 | 470 | if ((i.caller == this)) | |
471 | 471 | then $Tuple2([Reissue(surfAssetId, surfAmount, true)], surfAssetId) | |
472 | 472 | else if ((i.caller == neutrinoContract)) | |
473 | 473 | then $Tuple2([Reissue(surfAssetId, surfAmount, true), ScriptTransfer(addressFromStringValue(targetAddress), surfAmount, surfAssetId)], surfAssetId) | |
474 | 474 | else throw("issueSurf - permission denied") | |
475 | 475 | } | |
476 | 476 | ||
477 | 477 | ||
478 | 478 | @Verifier(tx) | |
479 | 479 | func verify () = { | |
480 | 480 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
481 | 481 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
482 | 482 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
483 | 483 | then 1 | |
484 | 484 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
485 | 485 | then 1 | |
486 | 486 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
487 | 487 | then 1 | |
488 | 488 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
489 | 489 | then 2 | |
490 | 490 | else 0)) | |
491 | 491 | (count >= 3) | |
492 | 492 | } | |
493 | 493 |
github/deemru/w8io/169f3d6 71.17 ms ◑