tx · 3kvi8PPiuoLt2QVHA4ErwLBq8iK6G7XhNAabzn8WFvUz

3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh:  -0.04000000 Waves

2022.08.11 14:56 [2179788] smart account 3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh > SELF 0.00000000 Waves

{ "type": 13, "id": "3kvi8PPiuoLt2QVHA4ErwLBq8iK6G7XhNAabzn8WFvUz", "fee": 4000000, "feeAssetId": null, "timestamp": 1660219033863, "version": 1, "sender": "3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh", "senderPublicKey": "HiTi1JT7GQRqLNxg4yZhD1mV42y1Mv2AYvRx92JQRbwX", "proofs": [ "3SoSyv7zTkVfHMZME5E4pPVh4zRqiqoLv1M6skt2pnWjEEPyGMKSzMR7AkNixJvGCR5HSMpj9s9unWv8HruxLnTe" ], "script": "base64:BgImCAISAwoBARIFCgMIAQESBQoDCAEBEgMKAQgSBAoCCAESBAoCCAFNAAZFVUxFUjgA1onPgQEABU1VTFQ2AMCEPQAGTVVMVFg2CQC2AgEAwIQ9AAVNVUxUOACAwtcvAAZNVUxUWDgJALYCAQCAwtcvAAdNVUxUWDEwCQC2AgEAgMivoCUABk1VTFQxMgCAoJSljR0AB01VTFRYMTYJALYCAQCAgIT+pt7hEQAGTVVMVDE4CQC2AgEAgICQu7rWrfANAANTRVACAl9fAAdXQVZFU0lECQDZBAECBVdBVkVTARJrZXlOZXV0cmlub0Fzc2V0SWQAAhFuZXV0cmlub19hc3NldF9pZAEOa2V5TnNidEFzc2V0SWQAAg1ib25kX2Fzc2V0X2lkAQ5rZXlTdXJmQXNzZXRJZAACDXN1cmZfYXNzZXRfaWQBEGtleUJhbGFuY2VMb2NrZWQAAg1iYWxhbmNlX2xvY2tfARVrZXlXYXZlc0xvY2tlZEJhbGFuY2UACQCsAgIJARBrZXlCYWxhbmNlTG9ja2VkAAIFd2F2ZXMBGGtleU5ldXRyaW5vTG9ja2VkQmFsYW5jZQAJAK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RE9OTFkJAMwIAgULbGltaXRXYW50ZWQFA25pbAUDbmlsBApnTnNidERlbHRhCQBlAgULZ05zYnROZWVkZWQFDGdOc2J0Q3VycmVudAkAlAoCBQNuaWwJALkJAgkAzAgCAgQlcyVzCQDMCAIJAKQDAQUMZ05zYnRDdXJyZW50CQDMCAIJAKQDAQUKZ05zYnREZWx0YQUDbmlsBQNTRVAAabmkyg==", "chainId": 84, "height": 2179788, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8dS46fttEz7js7xeui9RhUqQLr8pvjMmbxe3uTH1h7XR Next: BPYC7byV8hCU8JMjDxPAdkkhE6HswjY57DPY4ri7CwLg Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let EULER8 = 271828182
55
66 let MULT6 = 1000000
77
88 let MULTX6 = toBigInt(1000000)
99
1010 let MULT8 = 100000000
1111
1212 let MULTX8 = toBigInt(100000000)
1313
1414 let MULTX10 = toBigInt(10000000000)
1515
1616 let MULT12 = 1000000000000
1717
1818 let MULTX16 = toBigInt(10000000000000000)
1919
2020 let MULT18 = toBigInt(1000000000000000000)
2121
2222 let SEP = "__"
2323
2424 let WAVESID = fromBase58String("WAVES")
2525
2626 func keyNeutrinoAssetId () = "neutrino_asset_id"
2727
2828
2929 func keyNsbtAssetId () = "bond_asset_id"
3030
3131
3232 func keySurfAssetId () = "surf_asset_id"
3333
3434
3535 func keyBalanceLocked () = "balance_lock_"
3636
3737
3838 func keyWavesLockedBalance () = (keyBalanceLocked() + "waves")
3939
4040
4141 func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino")
4242
4343
4444 func keyMinWavesSwapAmount () = "min_waves_swap_amount"
4545
4646
4747 func keyMinNeutrinoSwapAmount () = "min_neutrino_swap_amount"
4848
4949
5050 func keyWavesOutFeePart () = "wavesOut_swap_feePart"
5151
5252
5353 func keyNeutrinoOutFeePart () = "neutrinoOut_swap_feePart"
5454
5555
5656 func keySwapAmountAParam () = "%s%s__config__swapAParam"
5757
5858
5959 func keySwapAmountBParam () = "%s%s__config__swapBParam"
6060
6161
6262 func keyNsbtLockContract () = "%s__nsbtLockContract"
6363
6464
6565 func keyMathContract () = "%s__mathContract"
6666
6767
6868 func keyBalanceWavesLockInterval () = "balance_waves_lock_interval"
6969
7070
7171 func keyBalanceNeutrinoLockInterval () = "balance_neutrino_lock_interval"
7272
7373
7474 func keyPrice () = "price"
7575
7676
7777 func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP)
7878
7979
8080 func keyHalfLife () = "%s__halfLife"
8181
8282
8383 func keyMinLockAmount () = "%s__minLockAmount"
8484
8585
8686 func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy"
8787
8888
8989 func keyMinNsbtSell () = "min_nsbt_sell"
9090
9191
9292 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
9393
9494
9595 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
9696
9797
9898 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
9999
100100
101101 func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
102102
103103
104104 func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
105105
106106
107107 func asAnyList (val) = match val {
108108 case valAnyList: List[Any] =>
109109 valAnyList
110110 case _ =>
111111 throw("fail to cast into List[Any]")
112112 }
113113
114114
115115 func asInt (val) = match val {
116116 case valInt: Int =>
117117 valInt
118118 case _ =>
119119 throw("fail to cast into Int")
120120 }
121121
122122
123123 func asString (val) = match val {
124124 case valStr: String =>
125125 valStr
126126 case _ =>
127127 throw("fail to cast into String")
128128 }
129129
130130
131131 func asTuple2Ints (val) = match val {
132132 case v: (Int, Int) =>
133133 v
134134 case _ =>
135135 throw("fail to cast into Tuple2 ints")
136136 }
137137
138138
139139 func asSwapParamsSTRUCT (val) = match val {
140140 case struct: (Int, Int, Int, Int, Int) =>
141141 struct
142142 case _ =>
143143 throw("fail to cast into Tuple5 ints")
144144 }
145145
146146
147147 func toTimestamp (start) = if ((0 > start))
148148 then -1
149149 else match blockInfoByHeight(start) {
150150 case block: BlockInfo =>
151151 block.timestamp
152152 case _ =>
153153 -1
154154 }
155155
156156
157157 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
158158
159159
160160 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
161161
162162
163163 let IdxControlCfgNeutrinoDapp = 1
164164
165165 let IdxControlCfgAuctionDapp = 2
166166
167167 let IdxControlCfgRpdDapp = 3
168168
169169 let IdxControlCfgMathDapp = 4
170170
171171 let IdxControlCfgLiquidationDapp = 5
172172
173173 let IdxControlCfgRestDapp = 6
174174
175175 let IdxControlCfgNodeRegistryDapp = 7
176176
177177 let IdxControlCfgNsbtStakingDapp = 8
178178
179179 let IdxControlCfgMediatorDapp = 9
180180
181181 let IdxControlCfgSurfStakingDapp = 10
182182
183183 let IdxControlCfgGnsbtControllerDapp = 11
184184
185185 func keyControlAddress () = "%s%s__config__controlAddress"
186186
187187
188188 func keyControlCfg () = "%s__controlConfig"
189189
190190
191191 func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP)
192192
193193
194194 func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx)))
195195
196196
197197 let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx"))
198198
199199 let controlCfg = readControlCfgOrFail(controlContract)
200200
201201 let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp)
202202
203203 let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp)
204204
205205 let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp)
206206
207207 let liquidationContract = getContractAddressOrFail(controlCfg, IdxControlCfgLiquidationDapp)
208208
209209 let rpdContract = getContractAddressOrFail(controlCfg, IdxControlCfgRpdDapp)
210210
211211 let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp)
212212
213213 let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp)
214214
215215 let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp)
216216
217217 let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId())
218218
219219 let neutrinoAssetId = fromBase58String(neutrinoAssetIdString)
220220
221221 let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId())
222222
223223 let nsbtAssetId = fromBase58String(nsbtAssetIdStr)
224224
225225 let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId())
226226
227227 let surfAssetId = fromBase58String(surfAssetIdStr)
228228
229229 @Callable(i)
230230 func reverseSwapLimitREADONLY (lim) = {
231231 let gNsbt = if ((0 >= lim))
232232 then 0
233233 else {
234234 let aParamX8 = toBigInt(getIntOrFail(mathContract, keySwapAmountAParam()))
235235 let bParamX16 = toBigInt(getIntOrFail(mathContract, keySwapAmountBParam()))
236236 let limDivAX8 = fraction(toBigInt(lim), MULTX10, aParamX8)
237237 let revBX16 = fraction(MULTX16, MULTX16, bParamX16)
238238 toInt(pow(limDivAX8, 8, revBX16, 16, 6, CEILING))
239239 }
240240 $Tuple2(nil, gNsbt)
241241 }
242242
243243
244244
245245 @Callable(i)
246246 func gnsbtInfoINTERNAL (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = {
247247 let userAddressOrThis = if ((userAddressStrOrEmpty != ""))
248248 then addressFromStringValue(userAddressStrOrEmpty)
249249 else this
250250 let currentPrice = getIntegerValue(controlContract, keyPrice())
251251 let gnsbtFromNsbtDiff = additionalNsbtToStakeOrZero
252252 let gnsbtFromSurfDiff = asInt(invoke(surfStakingContract, "gnsbtFromSurfSYSREADONLY", [additionalSurfToStakeOrZero], nil))
253253 let gNsbtDiff = (gnsbtFromNsbtDiff + gnsbtFromSurfDiff)
254254 let swapParamsTuple = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil))
255255 let limitMaxUsdn = swapParamsTuple._1
256256 let limitSpent = swapParamsTuple._2
257257 let blcks2LmtReset = swapParamsTuple._3
258258 let gnsbtAmt = swapParamsTuple._4
259259 let gnsbtAmtTotal = swapParamsTuple._5
260260 let swapParamsTupleNEW = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, gNsbtDiff], nil))
261261 let limitMaxUsdnNEW = swapParamsTupleNEW._1
262262 let limitSpentNEW = swapParamsTupleNEW._2
263263 let blcks2LmtResetNEW = swapParamsTupleNEW._3
264264 let gnsbtAmtNEW = swapParamsTupleNEW._4
265265 let gnsbtAmtTotalNEW = swapParamsTupleNEW._5
266266 let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice)
267267 let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice)
268268 let nsbtBalance = if ((userAddressStrOrEmpty != ""))
269269 then assetBalance(userAddressOrThis, nsbtAssetId)
270270 else 0
271271 let surfBalance = if ((userAddressStrOrEmpty != ""))
272272 then assetBalance(userAddressOrThis, surfAssetId)
273273 else 0
274274 let nsbtBalanceDiff = if ((additionalNsbtToStakeOrZero >= 0))
275275 then additionalNsbtToStakeOrZero
276276 else {
277277 let nsbtUnstakingData = asAnyList(invoke(nsbtStakingContract, "nsbtUnstakingSYSREADONLY", [userAddressStrOrEmpty, (-1 * additionalNsbtToStakeOrZero)], nil))
278278 let nsbtReceiveAmount = asInt(nsbtUnstakingData[2])
279279 let result = -(nsbtReceiveAmount)
280280 result
281281 }
282282 let nsbtBalanceNew = (nsbtBalance - nsbtBalanceDiff)
283283 let surfBalanceNew = (surfBalance - additionalSurfToStakeOrZero)
284284 let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStrOrEmpty, additionalNsbtToStakeOrZero, additionalSurfToStakeOrZero], nil))
285285 let gnsbtUser = asInt(gnsbtData[0])
286286 let gnsbtTotal = asInt(gnsbtData[1])
287287 let nsbtData = asAnyList(gnsbtData[2])
288288 let surfData = asAnyList(gnsbtData[3])
289289 let vpEffectiveHeight = asInt(gnsbtData[4])
290290 let vpEffectiveHeightNEW = asInt(gnsbtData[5])
291291 let gnsbtAmtFromNsbt = asInt(nsbtData[2])
292292 let gnsbtAmtFromSurf = asInt(surfData[2])
293293 let gnsbtAmtFromNsbtNEW = (gnsbtAmtFromNsbt + gnsbtFromNsbtDiff)
294294 let gnsbtAmtFromSurfNEW = (gnsbtAmtFromSurf + gnsbtFromSurfDiff)
295295 let gnsbtFromNsbtTotal = asInt(nsbtData[3])
296296 let gnsbtFromSurfTotal = asInt(surfData[3])
297297 let gnsbtFromSurfActiveTotal = 0
298298 let gnsbtFromSurfFrozenTotal = gnsbtFromSurfTotal
299299 let gnsbtFromNsbtTotalNEW = (gnsbtFromNsbtTotal + gnsbtFromNsbtDiff)
300300 let gnsbtFromSurfTotalNEW = (gnsbtFromSurfTotal + gnsbtFromSurfDiff)
301301 let gnsbtFromSurfFrozenTotalNEW = gnsbtFromSurfTotalNEW
302302 let votingPower = fraction(gnsbtAmtFromNsbt, MULT8, (gnsbtFromNsbtTotal + gnsbtFromSurfActiveTotal))
303303 let votingPowerNew = fraction(gnsbtAmtFromNsbtNEW, MULT8, (gnsbtFromNsbtTotalNEW + gnsbtFromSurfActiveTotal))
304304 let votingPowerMax = fraction((gnsbtAmtFromNsbt + gnsbtAmtFromSurf), MULT8, ((gnsbtFromNsbtTotal + gnsbtFromSurfActiveTotal) + gnsbtFromSurfFrozenTotal))
305305 let votingPowerMaxNew = fraction((gnsbtAmtFromNsbtNEW + gnsbtAmtFromSurfNEW), MULT8, ((gnsbtFromNsbtTotalNEW + gnsbtFromSurfActiveTotal) + gnsbtFromSurfFrozenTotalNEW))
306306 let votingPowerEta = if ((vpEffectiveHeight == 0))
307307 then height
308308 else vpEffectiveHeight
309309 let votingPowerEtaNew = if ((vpEffectiveHeightNEW == 0))
310310 then height
311311 else vpEffectiveHeightNEW
312312 $Tuple2(nil, [0, nsbtBalance, surfBalance, nsbtBalanceNew, surfBalanceNew, gnsbtAmtFromNsbt, gnsbtAmtFromSurf, gnsbtAmtFromNsbtNEW, gnsbtAmtFromSurfNEW, gnsbtFromNsbtTotal, gnsbtFromSurfTotal, gnsbtFromNsbtTotalNEW, gnsbtFromSurfTotalNEW, limitMaxUsdn, limitMaxWaves, limitMaxUsdnNEW, limitMaxWavesNEW, blcks2LmtReset, blcks2LmtResetNEW, votingPower, votingPowerNew, votingPowerMax, votingPowerMaxNew, votingPowerEta, votingPowerEtaNew])
313313 }
314314
315315
316316
317317 @Callable(i)
318318 func gnsbtInfoREADONLY (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = {
319319 let gnsbtInfoDATA = asAnyList(invoke(this, "gnsbtInfoINTERNAL", [userAddressStrOrEmpty, additionalNsbtToStakeOrZero, additionalSurfToStakeOrZero], nil))
320320 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", toString(asInt(gnsbtInfoDATA[1])), toString(asInt(gnsbtInfoDATA[2])), toString(asInt(gnsbtInfoDATA[3])), toString(asInt(gnsbtInfoDATA[4])), toString(asInt(gnsbtInfoDATA[5])), toString(asInt(gnsbtInfoDATA[6])), toString(asInt(gnsbtInfoDATA[7])), toString(asInt(gnsbtInfoDATA[8])), toString(asInt(gnsbtInfoDATA[9])), toString(asInt(gnsbtInfoDATA[10])), toString(asInt(gnsbtInfoDATA[11])), toString(asInt(gnsbtInfoDATA[12])), toString(asInt(gnsbtInfoDATA[13])), toString(asInt(gnsbtInfoDATA[14])), toString(asInt(gnsbtInfoDATA[15])), toString(asInt(gnsbtInfoDATA[16])), toString(asInt(gnsbtInfoDATA[17])), toString(asInt(gnsbtInfoDATA[18])), toString(asInt(gnsbtInfoDATA[19])), toString(asInt(gnsbtInfoDATA[20])), toString(asInt(gnsbtInfoDATA[21])), toString(asInt(gnsbtInfoDATA[22])), toString(asInt(gnsbtInfoDATA[23])), toString(asInt(gnsbtInfoDATA[24]))], SEP))
321321 }
322322
323323
324324
325325 @Callable(i)
326326 func rewardInfoREADONLY (userAddressStrOrEmpty) = {
327327 let rewardsData = asAnyList(invoke(gnsbtControllerContract, "gnsbtRewardsSYSREADONLY", [userAddressStrOrEmpty], nil))
328328 $Tuple2(nil, makeString(["%s%s", asString(rewardsData[0]), asString(rewardsData[1])], SEP))
329329 }
330330
331331
332332
333333 @Callable(i)
334334 func mergeNsbtREADONLY (userAddressMandatory,newAmount) = {
335335 let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressMandatory, newAmount], nil))
336336 let amount0 = asInt(nsbtData[0])
337337 let startHeight = if ((0 >= amount0))
338338 then -1
339339 else asInt(nsbtData[2])
340340 let startTimestamp = toTimestamp(startHeight)
341341 let startHeightNew = if ((0 >= newAmount))
342342 then startHeight
343343 else {
344344 let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife())
345345 asInt(invoke(mathContract, "mergeStakesREADONLY", [amount0, startHeight, newAmount, height, halfLife], nil))
346346 }
347347 let startTimestampNew = toTimestamp(startHeightNew)
348348 $Tuple2(nil, makeString(["%d%d%d%d", toString(startHeight), toString(startTimestamp), toString(startHeightNew), toString(startTimestampNew)], SEP))
349349 }
350350
351351
352352
353353 @Callable(i)
354354 func swapLimitCalculatorREADONLY (userAddressStrOpt,limitWanted) = {
355355 let gNsbtCurrent = if ((userAddressStrOpt == ""))
356356 then 0
357357 else asInt(asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))._4)
358358 let gNsbtNeeded = asInt(invoke(this, "reverseSwapLimitREADONLY", [limitWanted], nil))
359359 let gNsbtDelta = (gNsbtNeeded - gNsbtCurrent)
360360 $Tuple2(nil, makeString(["%s%s", toString(gNsbtCurrent), toString(gNsbtDelta)], SEP))
361361 }
362362
363363

github/deemru/w8io/026f985 
53.73 ms