tx · B1ERuQyd6dbVkUuRuUWj2Ly9G1SiD7yoLkkgrxr2yM7 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd: -0.04000000 Waves 2022.08.23 14:58 [2197101] smart account 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd > SELF 0.00000000 Waves
{ "type": 13, "id": "B1ERuQyd6dbVkUuRuUWj2Ly9G1SiD7yoLkkgrxr2yM7", "fee": 4000000, "feeAssetId": null, "timestamp": 1661256048723, "version": 1, "sender": "3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd", "senderPublicKey": "CdnTmMHxT68Qa4MtHEnAiUhsdKTi2YkHPGn92ThinVNt", "proofs": [ "5rS4xZzyZFjgq2BSRsibnXKut2DqzbJbBNUkFEumxyiCHe87yx8dxHKTAjYAMcGbS76ydz7n9jdmzzi21fJEfDo6", "Cpkhn8dCdS13esJDpbKaomU6BTjdKj73VdUJASpju71XFzNSZgUAZ2ihegFvgJr61rh9Gn1zSmWejueMWiuPeKi", "5S1H9kAaMwYx69D8EsjavpBESJJ6E9LY1WFK1LqWZjzF73g658kuEvLxF39ZcVGnuv52KFY7ypg4dXLPgcytyknQ" ], "script": "base64:AAIFAAAAAAAAADIIAhIFCgMIAQESBQoDAQEIEgASABIDCgEIEgASABIAEgASBQoDAQEEEgQKAgEIEgASAAAAAG0BAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQIAAAAAAQAAABZnZXRCb29sQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAdhZGRyZXNzBQAAAANrZXk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5zTGlzdAAAAAAAAAAAAwAAAAAAAAAAAgAAAAAAAAAAAAkAAGcAAAACBQAAAAVjb3VudAAAAAAAAAAAAz0lSK0=", "chainId": 84, "height": 2197101, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Z2SgHS6pDspCAmDguJ14fuomG936f66N9ovpAFpnLEF Next: 5aknGctgaeeVJwwfxBwJpH1qaPzmT13c3PX2dZb5KfK7 Diff:
Old | New | Differences | |
---|---|---|---|
44 | 44 | case valByte: ByteVector => | |
45 | 45 | valByte | |
46 | 46 | case _ => | |
47 | - | throw("fail to cast into | |
47 | + | throw("fail to cast into ByteVector") | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
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 | - | let surfAssetId = asBytes(invoke(this, "issueSurf", [surfAmount], nil)) | |
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)]) | |
465 | 465 | ||
466 | 466 | ||
467 | 467 | @Callable(i) | |
468 | - | func issueSurf (surfAmount) = { | |
468 | + | func issueSurf (surfAmount,targetAddress) = { | |
469 | 469 | let surfAssetId = fromBase58String(getStringValue(SurfAssetIdKey)) | |
470 | - | if ((i.caller != this)) | |
471 | - | then throw("issueSurf - permission denied") | |
472 | - | else $Tuple2([Reissue(surfAssetId, surfAmount, true)], surfAssetId) | |
470 | + | if ((i.caller == this)) | |
471 | + | then $Tuple2([Reissue(surfAssetId, surfAmount, true)], surfAssetId) | |
472 | + | else if ((i.caller == neutrinoContract)) | |
473 | + | then $Tuple2([Reissue(surfAssetId, surfAmount, true), ScriptTransfer(addressFromStringValue(targetAddress), surfAmount, surfAssetId)], surfAssetId) | |
474 | + | else throw("issueSurf - permission denied") | |
473 | 475 | } | |
474 | 476 | ||
475 | 477 |
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 | func asBytes (val) = match val { | |
44 | 44 | case valByte: ByteVector => | |
45 | 45 | valByte | |
46 | 46 | case _ => | |
47 | - | throw("fail to cast into | |
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 | 148 | func readControlCfgOrFail (control) = split(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 constructor (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 | - | let surfAssetId = asBytes(invoke(this, "issueSurf", [surfAmount], nil)) | |
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 | - | func issueSurf (surfAmount) = { | |
468 | + | func issueSurf (surfAmount,targetAddress) = { | |
469 | 469 | let surfAssetId = fromBase58String(getStringValue(SurfAssetIdKey)) | |
470 | - | if ((i.caller != this)) | |
471 | - | then throw("issueSurf - permission denied") | |
472 | - | else $Tuple2([Reissue(surfAssetId, surfAmount, true)], surfAssetId) | |
470 | + | if ((i.caller == this)) | |
471 | + | then $Tuple2([Reissue(surfAssetId, surfAmount, true)], surfAssetId) | |
472 | + | else if ((i.caller == neutrinoContract)) | |
473 | + | then $Tuple2([Reissue(surfAssetId, surfAmount, true), ScriptTransfer(addressFromStringValue(targetAddress), surfAmount, surfAssetId)], surfAssetId) | |
474 | + | else throw("issueSurf - permission denied") | |
473 | 475 | } | |
474 | 476 | ||
475 | 477 | ||
476 | 478 | ||
477 | 479 | @Callable(i) | |
478 | 480 | func updateReservesAndNeutrinoSupply () = { | |
479 | 481 | func getNumberByKeyInternal (key) = match getInteger(this, key) { | |
480 | 482 | case a: Int => | |
481 | 483 | a | |
482 | 484 | case _ => | |
483 | 485 | 0 | |
484 | 486 | } | |
485 | 487 | ||
486 | 488 | let nMetrix = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
487 | 489 | let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx") | |
488 | 490 | let newIdx = (idx + 1) | |
489 | 491 | [IntegerEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), IntegerEntry("reserve", asInt(nMetrix[3])), IntegerEntry("neutrinoSupply", asInt(nMetrix[5])), IntegerEntry("reservesInUsdn", convertWavesToNeutrino(asInt(nMetrix[3]), asInt(nMetrix[0]))), IntegerEntry("deficit", -(asInt(nMetrix[6])))] | |
490 | 492 | } | |
491 | 493 | ||
492 | 494 | ||
493 | 495 | ||
494 | 496 | @Callable(i) | |
495 | 497 | func wavesBalancesVsPayment () = { | |
496 | 498 | let b = wavesBalance(this) | |
497 | 499 | [IntegerEntry("wavesBalance_available", b.available), IntegerEntry("wavesBalance_regular", b.regular), IntegerEntry("wavesBalance_generating", b.generating), IntegerEntry("wavesBalance_effective", b.effective), IntegerEntry("waves_payment", value(i.payments[0]).amount)] | |
498 | 500 | } | |
499 | 501 | ||
500 | 502 | ||
501 | 503 | @Verifier(tx) | |
502 | 504 | func verify () = { | |
503 | 505 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
504 | 506 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
505 | 507 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
506 | 508 | then 1 | |
507 | 509 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
508 | 510 | then 1 | |
509 | 511 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
510 | 512 | then 1 | |
511 | 513 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
512 | 514 | then 2 | |
513 | 515 | else 0)) | |
514 | 516 | (count >= 3) | |
515 | 517 | } | |
516 | 518 |
github/deemru/w8io/026f985 59.64 ms ◑