tx · hikumg7MGwM6qqCtdBnzEj3snWC3JY8JDJ7Nsh32nbE

3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd:  -0.01400000 Waves

2022.03.17 13:19 [1967807] smart account 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd > SELF 0.00000000 Waves

{ "type": 13, "id": "hikumg7MGwM6qqCtdBnzEj3snWC3JY8JDJ7Nsh32nbE", "fee": 1400000, "feeAssetId": null, "timestamp": 1647512404974, "version": 1, "sender": "3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd", "senderPublicKey": "CdnTmMHxT68Qa4MtHEnAiUhsdKTi2YkHPGn92ThinVNt", "proofs": [ "4sJvD4m6fcEoyvBbU6dX8hfsnd4WmbrMtAKywrZzNJBfecj4nPiDCUp3865AC9oja3U2zgio2rqnyD4LQkKBs6Zd", "4nPvhAV5vY78Lfwo8FQaRnwff5GC22wBEfw6PSQR5omm9KzmzipXXBAGtfCrpPoLtU8wjMZnvEMmae53VuqMio51", "49Sb8BZBqgfe6Yn7PxqTSGFq2p7SXMnBettPNYbUFpCNYwNgw8Bh2ovV1pvCeZTD5t9bqJraAA8v8JQ7Jdyw1TzH" ], "script": "base64:AAIFAAAAAAAAAA8IAhIAEgASAwoBCBIAEgAAAABDAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5BwEAAAAYZ2V0U3RyaW5nQnlBZGRyZ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AACQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAgAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAADCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAwAAAAAAAAAAAgAAAAAAAAAAAAkAAGcAAAACBQAAAAVjb3VudAAAAAAAAAAAAyBk6aA=", "chainId": 84, "height": 1967807, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7UDTRzYE5C9DH15rhdekJNeJqwyC7h4uaB7wKvzw3559 Next: HzGeDH5SVpVj39fHMsb8MDoigBoFtGjvdC5HJx8JsoKv Diff:
OldNewDifferences
197197 then throw((("min " + toString((minWavesAmountNsbtBuy / WAVELET))) + " waves expected"))
198198 else {
199199 let ownerAddress = i.caller
200- let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsMATH", nil, nil))
200+ let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
201201 if ((neutrinoMetrics == neutrinoMetrics))
202202 then {
203203 let currentPrice = asInt(neutrinoMetrics[0])
204- let reserve = asInt(neutrinoMetrics[3])
205- let neutrinoSupply = asInt(neutrinoMetrics[5])
206- let nsbtSupply = asInt(neutrinoMetrics[9])
207- let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity
208- let curveResult = asAnyList(invoke(mathContract, "curveFunctionMATH", [reserve, neutrinoSupply, currentPrice, nsbtSupplyMAX, nsbtSupply, wavesPay], nil))
204+ let curveResult = asAnyList(invoke(mathContract, "curveFunctionREADONLY", [wavesPay], nil))
209205 if ((curveResult == curveResult))
210206 then {
211207 let nsbtAmount = asInt(curveResult[0])
241237 else if ((minNsbtSell > pmtAmount))
242238 then throw((("min " + toString((minNsbtSell / PAULI))) + " nsbt expected"))
243239 else {
244- let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsMATH", nil, nil))
240+ let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
245241 if ((neutrinoMetrics == neutrinoMetrics))
246242 then {
247243 let nsbtSupply = asInt(neutrinoMetrics[10])
248- let newPrice = asInt(asAnyList(invoke(mathContract, "calcContractNsbtPriceBySupplyMATH", [(nsbtSupply - pmtAmount)], nil))[0])
244+ let newPrice = asInt(asAnyList(invoke(mathContract, "calcContractNsbtPriceBySupplyREADONLY", [(nsbtSupply - pmtAmount)], nil))[0])
249245 if ((newPrice == newPrice))
250246 then if ((PAULI > newPrice))
251247 then throw((("resulting nsbt price would be < 1 (" + toString(newPrice)) + " usdn"))
278274 }
279275
280276
277+
278+@Callable(i)
279+func minWavesAmountNsbtBuySYSREADONLY () = $Tuple2(nil, minWavesAmountNsbtBuy)
280+
281+
282+
283+@Callable(i)
284+func minNsbtAmountForSellSYSREADONLY () = $Tuple2(nil, minNsbtSell)
285+
286+
281287 @Verifier(tx)
282288 func verify () = {
283289 let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0)
55
66
77 func getStringByKey (key) = valueOrElse(getString(this, key), "")
88
99
1010 func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false)
1111
1212
1313 func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "")
1414
1515
1616 func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0)
1717
1818
1919 func asAnyList (val) = match val {
2020 case valAnyLyst: List[Any] =>
2121 valAnyLyst
2222 case _ =>
2323 throw("fail to cast into List[Any]")
2424 }
2525
2626
2727 func asString (val) = match val {
2828 case valStr: String =>
2929 valStr
3030 case _ =>
3131 throw("fail to cast into String")
3232 }
3333
3434
3535 func asInt (val) = match val {
3636 case valInt: Int =>
3737 valInt
3838 case _ =>
3939 throw("fail to cast into Int")
4040 }
4141
4242
4343 let WAVELET = 100000000
4444
4545 let PAULI = 1000000
4646
4747 let BIGPAULI = toBigInt(1000000)
4848
4949 let PRICELET = 1000000
5050
5151 let MULT = 100000000
5252
5353 let BIGMULT16 = toBigInt(10000000000000000)
5454
5555 let SCALE8 = 8
5656
5757 let SCALE16 = 16
5858
5959 let MINORDERTOTAL = (10 * WAVELET)
6060
6161 let MAXROI = 95
6262
6363 let CANCELED = "canceled"
6464
6565 let NEW = "new"
6666
6767 let FILLED = "filled"
6868
6969 let PriceKey = "price"
7070
7171 let NsbtAssetIdKey = "bond_asset_id"
7272
7373 let NeutrinoAssetIdKey = "neutrino_asset_id"
7474
7575 let BalanceLockedkKey = "balance_lock_"
7676
7777 let WavesLockedBalanceKey = (BalanceLockedkKey + "waves")
7878
7979 let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino")
8080
8181 let FirstOrderKey = "order_first"
8282
8383 let MathContractKey = "math_contract"
8484
8585 let MinWavesForNsbtBuyKey = "min_waves_nsbt_buy"
8686
8787 let MinNsbtSellKey = "min_nsbt_sell"
8888
8989 func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId)
9090
9191
9292 func getOrderPriceKey (orderId) = ("order_price_" + orderId)
9393
9494
9595 func getOrderTotalKey (orderId) = ("order_total_" + orderId)
9696
9797
9898 func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
9999
100100
101101 func getOrderHeightKey (orderId) = ("order_height_" + orderId)
102102
103103
104104 func getOrderStatusKey (orderId) = ("order_status_" + orderId)
105105
106106
107107 func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
108108
109109
110110 func getPrevOrderKey (orderId) = ("order_prev_" + orderId)
111111
112112
113113 func getNextOrderKey (orderId) = ("order_next_" + orderId)
114114
115115
116116 func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
117117
118118
119119 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
120120
121121
122122 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
123123
124124
125125 func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price)
126126
127127
128128 func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult))
129129
130130
131131 func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16))
132132
133133
134134 let neutrinoContract = Address(base58'3N9be2mwrA52WJho6DiesZkk4351GvpnWuj')
135135
136136 let controlContract = Address(base58'3MrwvfA9VRYwhHy4NuWPQGdxCtZdhH4LMMa')
137137
138138 let liquidationContract = Address(base58'3N24ZPUAMhFm76N3vbNiiDtFqfUnmBHTc5N')
139139
140140 let mathContract = addressFromStringValue(getStringByKey(MathContractKey))
141141
142142 let neutrinoAssetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
143143
144144 let nsbtAssetId = base58'F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z'
145145
146146 let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked")
147147
148148 let minWavesAmountNsbtBuy = valueOrElse(getInteger(this, MinWavesForNsbtBuyKey), 1000000000)
149149
150150 let minNsbtSell = valueOrElse(getInteger(this, MinNsbtSellKey), 1000000)
151151
152152 let firstOrder = getStringByKey(FirstOrderKey)
153153
154154 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
155155
156156
157157 func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
158158
159159
160160 func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
161161
162162
163163 func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
164164
165165
166166 func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
167167
168168
169169 func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id))
170170
171171
172172 func getNextOrder (id) = getStringByKey(getNextOrderKey(id))
173173
174174
175175 func getReversePrice (price) = ((PRICELET * PRICELET) / price)
176176
177177
178178 func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(spentWavesRaw, (PAULI * PRICELET), receivedNsbtRaw)
179179
180180
181181 func orderData (orderId,totalWavelets,filledWavelets,owner,status,roi,price,currentPrice) = [IntegerEntry(getOrderPriceKey(orderId), price), IntegerEntry(getOrderTotalKey(orderId), totalWavelets), IntegerEntry(getOrderFilledTotalKey(orderId), filledWavelets), StringEntry(getOrderOwnerKey(orderId), owner), IntegerEntry(getOrderHeightKey(orderId), height), StringEntry(getOrderStatusKey(orderId), status), IntegerEntry(("debug_order_currentPrice_" + orderId), currentPrice), IntegerEntry(getRoiByOrderIdKey(orderId), roi)]
182182
183183
184184 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]))) + "]")
185185
186186
187187 @Callable(i)
188188 func buyNsbt () = {
189189 let pmt = value(i.payments[0])
190190 let pmtAmount = pmt.amount
191191 let wavesPay = pmtAmount
192192 if (isBlocked)
193193 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
194194 else if (isDefined(pmt.assetId))
195195 then throw("can use waves only")
196196 else if ((minWavesAmountNsbtBuy > pmtAmount))
197197 then throw((("min " + toString((minWavesAmountNsbtBuy / WAVELET))) + " waves expected"))
198198 else {
199199 let ownerAddress = i.caller
200- let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsMATH", nil, nil))
200+ let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
201201 if ((neutrinoMetrics == neutrinoMetrics))
202202 then {
203203 let currentPrice = asInt(neutrinoMetrics[0])
204- let reserve = asInt(neutrinoMetrics[3])
205- let neutrinoSupply = asInt(neutrinoMetrics[5])
206- let nsbtSupply = asInt(neutrinoMetrics[9])
207- let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity
208- let curveResult = asAnyList(invoke(mathContract, "curveFunctionMATH", [reserve, neutrinoSupply, currentPrice, nsbtSupplyMAX, nsbtSupply, wavesPay], nil))
204+ let curveResult = asAnyList(invoke(mathContract, "curveFunctionREADONLY", [wavesPay], nil))
209205 if ((curveResult == curveResult))
210206 then {
211207 let nsbtAmount = asInt(curveResult[0])
212208 if ((0 >= nsbtAmount))
213209 then throw("nsbtAmount <= 0")
214210 else if ((wavesPay > (nsbtAmount * 9223372)))
215211 then throw(((("Nsbt2Waves price exceeds MAX_INT: " + toString(wavesPay)) + "/") + toString(nsbtAmount)))
216212 else {
217213 let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(wavesPay, nsbtAmount)
218214 let roi = 0
219215 let amountLeased = invoke(neutrinoContract, "acceptWaves", nil, i.payments)
220216 if ((amountLeased == amountLeased))
221217 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)
222218 else throw("Strict value is not equal to itself.")
223219 }
224220 }
225221 else throw("Strict value is not equal to itself.")
226222 }
227223 else throw("Strict value is not equal to itself.")
228224 }
229225 }
230226
231227
232228
233229 @Callable(i)
234230 func sellNsbt () = if (isBlocked)
235231 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
236232 else {
237233 let pmt = value(i.payments[0])
238234 let pmtAmount = pmt.amount
239235 if ((pmt.assetId != nsbtAssetId))
240236 then throw("can use NSBT only")
241237 else if ((minNsbtSell > pmtAmount))
242238 then throw((("min " + toString((minNsbtSell / PAULI))) + " nsbt expected"))
243239 else {
244- let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsMATH", nil, nil))
240+ let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
245241 if ((neutrinoMetrics == neutrinoMetrics))
246242 then {
247243 let nsbtSupply = asInt(neutrinoMetrics[10])
248- let newPrice = asInt(asAnyList(invoke(mathContract, "calcContractNsbtPriceBySupplyMATH", [(nsbtSupply - pmtAmount)], nil))[0])
244+ let newPrice = asInt(asAnyList(invoke(mathContract, "calcContractNsbtPriceBySupplyREADONLY", [(nsbtSupply - pmtAmount)], nil))[0])
249245 if ((newPrice == newPrice))
250246 then if ((PAULI > newPrice))
251247 then throw((("resulting nsbt price would be < 1 (" + toString(newPrice)) + " usdn"))
252248 else {
253249 let transf = invoke(neutrinoContract, "transferUsdnToUser", [pmtAmount, toString(i.caller)], nil)
254250 if ((transf == transf))
255251 then $Tuple2(nil, newPrice)
256252 else throw("Strict value is not equal to itself.")
257253 }
258254 else throw("Strict value is not equal to itself.")
259255 }
260256 else throw("Strict value is not equal to itself.")
261257 }
262258 }
263259
264260
265261
266262 @Callable(i)
267263 func cancelOrder (orderId) = {
268264 let owner = getOrderOwner(orderId)
269265 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
270266 let caller = toString(i.caller)
271267 let nextOrder = getNextOrder(orderId)
272268 let prevOrder = getPrevOrder(orderId)
273269 if ((getOrderStatus(orderId) != NEW))
274270 then throw("invalid order status")
275271 else [StringEntry(FirstOrderKey, if ((firstOrder == orderId))
276272 then nextOrder
277273 else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)]
278274 }
279275
280276
277+
278+@Callable(i)
279+func minWavesAmountNsbtBuySYSREADONLY () = $Tuple2(nil, minWavesAmountNsbtBuy)
280+
281+
282+
283+@Callable(i)
284+func minNsbtAmountForSellSYSREADONLY () = $Tuple2(nil, minNsbtSell)
285+
286+
281287 @Verifier(tx)
282288 func verify () = {
283289 let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
284290 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
285291 then 1
286292 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
287293 then 1
288294 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
289295 then 1
290296 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
291297 then 2
292298 else 0))
293299 (count >= 3)
294300 }
295301

github/deemru/w8io/026f985 
43.84 ms