tx · 62SckJcH7hagXSmBJLcjz7ucac7xwYwkadsKCMPmzsiB 3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh: -0.04000000 Waves 2022.10.18 13:26 [2277712] smart account 3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh > SELF 0.00000000 Waves
{ "type": 13, "id": "62SckJcH7hagXSmBJLcjz7ucac7xwYwkadsKCMPmzsiB", "fee": 4000000, "feeAssetId": null, "timestamp": 1666088865740, "version": 1, "sender": "3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh", "senderPublicKey": "HiTi1JT7GQRqLNxg4yZhD1mV42y1Mv2AYvRx92JQRbwX", "proofs": [ "53kdEHCFfr47G4EwQHWDgnaAoWp19i37CmE1z9WSjZ9nacr9TgUBojHMEFEybyKyfCsJaFppamDvd8JZnuKCSEiF" ], "script": "base64:BgIvCAISBAoCAQQSBQoDCAEBEgUKAwgBARIDCgEIEgQKAggBEgUKAwgBCBIFCgMIAQhqAAZFVUxFUjgA1onPgQEABU1VTFQ2AMCEPQAGTVVMVFg2CQC2AgEAwIQ9AAVNVUxUOACAwtcvAAZNVUxUWDgJALYCAQCAwtcvAAdNVUxUWDEwCQC2AgEAgMivoCUABk1VTFQxMgCAoJSljR0AB01VTFRYMTYJALYCAQCAgIT+pt7hEQAGTVVMVDE4CQC2AgEAgICQu7rWrfANAANTRVACAl9fABFERUZBVUxUU1dBUEZFRU4yVwCIJwARREVGQVVMVFNXQVBGRUVXMk4AoJwBAAtCUlBST1RFQ1RFRACgjQYAB1dBVkVTSUQJANkEAQIFV0FWRVMBEmtleU5ldXRyaW5vQXNzZXRJZAACEW5ldXRyaW5vX2Fzc2V0X2lkAQ5rZXlOc2J0QXNzZXRJZAACDWJvbmRfYXNzZXRfaWQBDmtleVN1cmZBc3NldElkAAINc3VyZl9hc3NldF9pZAEQa2V5QmFsYW5jZUxvY2tlZAACDWJhbGFuY2VfbG9ja18BFWtleVdhdmVzTG9ja2VkQmFsYW5jZQAJ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TmV0QW1vdW50CQDMCAIJAKQDAQUKb3V0U3VyZkFtdAkAzAgCCQCkAwEFDG91dEZlZUFtb3VudAkAzAgCCQCkAwEFBXByaWNlCQDMCAIJAKQDAQUOYmxja3MyTG10UmVzZXQJAMwIAgkApAMBBQ1saW1pdE1heFdhdmVzCQDMCAIJAKQDAQUMbGltaXRNYXhVc2RuCQDMCAIJAKQDAQUPaW5BbXRUb1N1cmZQYXJ0BQNuaWwFA1NFUACxuyKe", "chainId": 84, "height": 2277712, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FQcKGnKCWEoDER6GCXaZjUchpyqSwfjdQgibexChkgaN Next: 559WAXUfSpzwTUxG4WVswqCCrr1ipb4979XiZ4yqBqRR Diff:
Old | New | Differences | |
---|---|---|---|
254 | 254 | func keyControlCfg () = "%s__controlConfig" | |
255 | 255 | ||
256 | 256 | ||
257 | - | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
257 | + | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let EULER8 = 271828182 | |
5 | 5 | ||
6 | 6 | let MULT6 = 1000000 | |
7 | 7 | ||
8 | 8 | let MULTX6 = toBigInt(1000000) | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let MULTX8 = toBigInt(100000000) | |
13 | 13 | ||
14 | 14 | let MULTX10 = toBigInt(10000000000) | |
15 | 15 | ||
16 | 16 | let MULT12 = 1000000000000 | |
17 | 17 | ||
18 | 18 | let MULTX16 = toBigInt(10000000000000000) | |
19 | 19 | ||
20 | 20 | let MULT18 = toBigInt(1000000000000000000) | |
21 | 21 | ||
22 | 22 | let SEP = "__" | |
23 | 23 | ||
24 | 24 | let DEFAULTSWAPFEEN2W = 5000 | |
25 | 25 | ||
26 | 26 | let DEFAULTSWAPFEEW2N = 20000 | |
27 | 27 | ||
28 | 28 | let BRPROTECTED = 100000 | |
29 | 29 | ||
30 | 30 | let WAVESID = fromBase58String("WAVES") | |
31 | 31 | ||
32 | 32 | func keyNeutrinoAssetId () = "neutrino_asset_id" | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func keyNsbtAssetId () = "bond_asset_id" | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keySurfAssetId () = "surf_asset_id" | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func keyBalanceLocked () = "balance_lock_" | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func keyWavesLockedBalance () = (keyBalanceLocked() + "waves") | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino") | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyMinWavesSwapAmount () = "min_waves_swap_amount" | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyMinNeutrinoSwapAmount () = "min_neutrino_swap_amount" | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func keyWavesOutFeePart () = "wavesOut_swap_feePart" | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func keyNeutrinoOutFeePart () = "neutrinoOut_swap_feePart" | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func keySwapAmountAParam () = "%s%s__config__swapAParam" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func keySwapAmountBParam () = "%s%s__config__swapBParam" | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func keyUsdnSwapAmountAParam () = "%s%s__config__usdnSwapAParam" | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func keyUsdnSwapAmountBParam () = "%s%s__config__usdnSwapBParam" | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyNsbtLockContract () = "%s__nsbtLockContract" | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyMathContract () = "%s__mathContract" | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyBalanceWavesLockInterval () = "balance_waves_lock_interval" | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyBalanceNeutrinoLockInterval () = "balance_neutrino_lock_interval" | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyPrice () = "price" | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func keyHalfLife () = "%s__halfLife" | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func keyMinLockAmount () = "%s__minLockAmount" | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy" | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func keyMinNsbtSell () = "min_nsbt_sell" | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func asAnyList (val) = match val { | |
120 | 120 | case valAnyList: List[Any] => | |
121 | 121 | valAnyList | |
122 | 122 | case _ => | |
123 | 123 | throw("fail to cast into List[Any]") | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func asInt (val) = match val { | |
128 | 128 | case valInt: Int => | |
129 | 129 | valInt | |
130 | 130 | case _ => | |
131 | 131 | throw("fail to cast into Int") | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func asString (val) = match val { | |
136 | 136 | case valStr: String => | |
137 | 137 | valStr | |
138 | 138 | case _ => | |
139 | 139 | throw("fail to cast into String") | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func asTuple2Ints (val) = match val { | |
144 | 144 | case v: (Int, Int) => | |
145 | 145 | v | |
146 | 146 | case _ => | |
147 | 147 | throw("fail to cast into Tuple2 ints") | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func asSwapParamsSTRUCT (val) = match val { | |
152 | 152 | case struct: (Int, Int, Int, Int, Int, Int, Int) => | |
153 | 153 | struct | |
154 | 154 | case _ => | |
155 | 155 | throw("fail to cast into SwapParamsSTRUCT") | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func asWithdrawResultSTRUCT (val) = match val { | |
160 | 160 | case struct: (Int, Unit, Int, Int, Int, Int, Int)|(Int, ByteVector, Int, Int, Int, Int, Int) => | |
161 | 161 | struct | |
162 | 162 | case _ => | |
163 | 163 | throw("fail to cast into WithdrawResult") | |
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func toTimestamp (start) = if ((0 > start)) | |
168 | 168 | then -1 | |
169 | 169 | else match blockInfoByHeight(start) { | |
170 | 170 | case block: BlockInfo => | |
171 | 171 | block.timestamp | |
172 | 172 | case _ => | |
173 | 173 | -1 | |
174 | 174 | } | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | let nMetricIdxPrice = 0 | |
184 | 184 | ||
185 | 185 | let nMetricIdxUsdnLockedBalance = 1 | |
186 | 186 | ||
187 | 187 | let nMetricIdxWavesLockedBalance = 2 | |
188 | 188 | ||
189 | 189 | let nMetricIdxReserve = 3 | |
190 | 190 | ||
191 | 191 | let nMetricIdxReserveInUsdn = 4 | |
192 | 192 | ||
193 | 193 | let nMetricIdxUsdnSupply = 5 | |
194 | 194 | ||
195 | 195 | let nMetricIdxSurplus = 6 | |
196 | 196 | ||
197 | 197 | let nMetricIdxSurplusPercent = 7 | |
198 | 198 | ||
199 | 199 | let nMetricIdxBR = 8 | |
200 | 200 | ||
201 | 201 | let nMetricIdxNsbtSupply = 9 | |
202 | 202 | ||
203 | 203 | let nMetricIdxMaxNsbtSupply = 10 | |
204 | 204 | ||
205 | 205 | let nMetricIdxSurfSupply = 11 | |
206 | 206 | ||
207 | 207 | let IdxControlCfgNeutrinoDapp = 1 | |
208 | 208 | ||
209 | 209 | let IdxControlCfgAuctionDapp = 2 | |
210 | 210 | ||
211 | 211 | let IdxControlCfgRpdDapp = 3 | |
212 | 212 | ||
213 | 213 | let IdxControlCfgMathDapp = 4 | |
214 | 214 | ||
215 | 215 | let IdxControlCfgLiquidationDapp = 5 | |
216 | 216 | ||
217 | 217 | let IdxControlCfgRestDapp = 6 | |
218 | 218 | ||
219 | 219 | let IdxControlCfgNodeRegistryDapp = 7 | |
220 | 220 | ||
221 | 221 | let IdxControlCfgNsbtStakingDapp = 8 | |
222 | 222 | ||
223 | 223 | let IdxControlCfgMediatorDapp = 9 | |
224 | 224 | ||
225 | 225 | let IdxControlCfgSurfStakingDapp = 10 | |
226 | 226 | ||
227 | 227 | let IdxControlCfgGnsbtControllerDapp = 11 | |
228 | 228 | ||
229 | 229 | let bFuncIdxSurf = 0 | |
230 | 230 | ||
231 | 231 | let bFuncIdxWaves = 1 | |
232 | 232 | ||
233 | 233 | let bFuncIdxUsdn = 2 | |
234 | 234 | ||
235 | 235 | let bFuncIdxReserveStart = 3 | |
236 | 236 | ||
237 | 237 | let bFuncIdxSupplyStart = 4 | |
238 | 238 | ||
239 | 239 | let bFuncIdxBRStart = 5 | |
240 | 240 | ||
241 | 241 | let bFuncIdxReserveEnd = 6 | |
242 | 242 | ||
243 | 243 | let bFuncIdxSupplyEnd = 7 | |
244 | 244 | ||
245 | 245 | let bFuncIdxBREnd = 8 | |
246 | 246 | ||
247 | 247 | let bFuncIdxRest = 9 | |
248 | 248 | ||
249 | 249 | let bFuncIdxWavesPrice = 10 | |
250 | 250 | ||
251 | 251 | func keyControlAddress () = "%s%s__config__controlAddress" | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | func keyControlCfg () = "%s__controlConfig" | |
255 | 255 | ||
256 | 256 | ||
257 | - | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
257 | + | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
264 | 264 | ||
265 | 265 | let controlCfg = readControlCfgOrFail(controlContract) | |
266 | 266 | ||
267 | 267 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
268 | 268 | ||
269 | 269 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
270 | 270 | ||
271 | 271 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
272 | 272 | ||
273 | 273 | let liquidationContract = getContractAddressOrFail(controlCfg, IdxControlCfgLiquidationDapp) | |
274 | 274 | ||
275 | 275 | let rpdContract = getContractAddressOrFail(controlCfg, IdxControlCfgRpdDapp) | |
276 | 276 | ||
277 | 277 | let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp) | |
278 | 278 | ||
279 | 279 | let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp) | |
280 | 280 | ||
281 | 281 | let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp) | |
282 | 282 | ||
283 | 283 | let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId()) | |
284 | 284 | ||
285 | 285 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
286 | 286 | ||
287 | 287 | let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId()) | |
288 | 288 | ||
289 | 289 | let nsbtAssetId = fromBase58String(nsbtAssetIdStr) | |
290 | 290 | ||
291 | 291 | let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId()) | |
292 | 292 | ||
293 | 293 | let surfAssetId = fromBase58String(surfAssetIdStr) | |
294 | 294 | ||
295 | 295 | @Callable(i) | |
296 | 296 | func reverseSwapLimitREADONLY (lim,isWavesSwap) = { | |
297 | 297 | let BR = asInt(asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))[nMetricIdxBR]) | |
298 | 298 | let gNsbt = if ((0 >= lim)) | |
299 | 299 | then 0 | |
300 | 300 | else { | |
301 | 301 | let aParamX8 = toBigInt(getIntOrFail(mathContract, if (isWavesSwap) | |
302 | 302 | then keySwapAmountAParam() | |
303 | 303 | else keyUsdnSwapAmountAParam())) | |
304 | 304 | let bParamX16 = toBigInt(getIntOrFail(mathContract, if (isWavesSwap) | |
305 | 305 | then keySwapAmountBParam() | |
306 | 306 | else keyUsdnSwapAmountBParam())) | |
307 | 307 | let limDivAX8 = if (isWavesSwap) | |
308 | 308 | then fraction(toBigInt(lim), MULTX10, aParamX8) | |
309 | 309 | else fraction(fraction(toBigInt(lim), MULTX10, aParamX8), MULTX6, toBigInt(BR)) | |
310 | 310 | let revBX16 = fraction(MULTX16, MULTX16, bParamX16) | |
311 | 311 | toInt(pow(limDivAX8, 8, revBX16, 16, 6, CEILING)) | |
312 | 312 | } | |
313 | 313 | $Tuple2(nil, gNsbt) | |
314 | 314 | } | |
315 | 315 | ||
316 | 316 | ||
317 | 317 | ||
318 | 318 | @Callable(i) | |
319 | 319 | func gnsbtInfoINTERNAL (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = { | |
320 | 320 | let userAddressOrThis = if ((userAddressStrOrEmpty != "")) | |
321 | 321 | then addressFromStringValue(userAddressStrOrEmpty) | |
322 | 322 | else this | |
323 | 323 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
324 | 324 | let gnsbtFromNsbtDiff = additionalNsbtToStakeOrZero | |
325 | 325 | let gnsbtFromSurfDiff = asInt(invoke(surfStakingContract, "gnsbtFromSurfSYSREADONLY", [additionalSurfToStakeOrZero], nil)) | |
326 | 326 | let gNsbtDiff = (gnsbtFromNsbtDiff + gnsbtFromSurfDiff) | |
327 | 327 | let swapParamsTuple = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil)) | |
328 | 328 | let blcks2LmtReset = swapParamsTuple._3 | |
329 | 329 | let gnsbtAmt = swapParamsTuple._4 | |
330 | 330 | let gnsbtAmtTotal = swapParamsTuple._5 | |
331 | 331 | let limitMaxWaves = swapParamsTuple._6 | |
332 | 332 | let limitMaxUsdn = swapParamsTuple._7 | |
333 | 333 | let swapParamsTupleNEW = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, gNsbtDiff], nil)) | |
334 | 334 | let blcks2LmtResetNEW = swapParamsTupleNEW._3 | |
335 | 335 | let gnsbtAmtNEW = swapParamsTupleNEW._4 | |
336 | 336 | let gnsbtAmtTotalNEW = swapParamsTupleNEW._5 | |
337 | 337 | let limitMaxWavesNEW = swapParamsTupleNEW._6 | |
338 | 338 | let limitMaxUsdnNEW = swapParamsTupleNEW._7 | |
339 | 339 | let nsbtBalance = if ((userAddressStrOrEmpty != "")) | |
340 | 340 | then assetBalance(userAddressOrThis, nsbtAssetId) | |
341 | 341 | else 0 | |
342 | 342 | let surfBalance = if ((userAddressStrOrEmpty != "")) | |
343 | 343 | then assetBalance(userAddressOrThis, surfAssetId) | |
344 | 344 | else 0 | |
345 | 345 | let nsbtBalanceDiff = if ((additionalNsbtToStakeOrZero >= 0)) | |
346 | 346 | then additionalNsbtToStakeOrZero | |
347 | 347 | else { | |
348 | 348 | let nsbtUnstakingData = asAnyList(invoke(nsbtStakingContract, "nsbtUnstakingSYSREADONLY", [userAddressStrOrEmpty, (-1 * additionalNsbtToStakeOrZero)], nil)) | |
349 | 349 | let nsbtReceiveAmount = asInt(nsbtUnstakingData[2]) | |
350 | 350 | let result = -(nsbtReceiveAmount) | |
351 | 351 | result | |
352 | 352 | } | |
353 | 353 | let nsbtBalanceNew = (nsbtBalance - nsbtBalanceDiff) | |
354 | 354 | let surfBalanceNew = (surfBalance - additionalSurfToStakeOrZero) | |
355 | 355 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStrOrEmpty, additionalNsbtToStakeOrZero, additionalSurfToStakeOrZero], nil)) | |
356 | 356 | let gnsbtUser = asInt(gnsbtData[0]) | |
357 | 357 | let gnsbtTotal = asInt(gnsbtData[1]) | |
358 | 358 | let nsbtData = asAnyList(gnsbtData[2]) | |
359 | 359 | let surfData = asAnyList(gnsbtData[3]) | |
360 | 360 | let vpEffectiveHeight = asInt(gnsbtData[4]) | |
361 | 361 | let vpEffectiveHeightNEW = asInt(gnsbtData[5]) | |
362 | 362 | let gnsbtAmtFromNsbt = asInt(nsbtData[2]) | |
363 | 363 | let gnsbtAmtFromSurf = asInt(surfData[2]) | |
364 | 364 | let gnsbtAmtFromNsbtNEW = (gnsbtAmtFromNsbt + gnsbtFromNsbtDiff) | |
365 | 365 | let gnsbtAmtFromSurfNEW = (gnsbtAmtFromSurf + gnsbtFromSurfDiff) | |
366 | 366 | let gnsbtFromNsbtTotal = asInt(nsbtData[3]) | |
367 | 367 | let gnsbtFromSurfTotal = asInt(surfData[3]) | |
368 | 368 | let gnsbtFromSurfActiveTotal = 0 | |
369 | 369 | let gnsbtFromSurfFrozenTotal = gnsbtFromSurfTotal | |
370 | 370 | let gnsbtFromNsbtTotalNEW = (gnsbtFromNsbtTotal + gnsbtFromNsbtDiff) | |
371 | 371 | let gnsbtFromSurfTotalNEW = (gnsbtFromSurfTotal + gnsbtFromSurfDiff) | |
372 | 372 | let gnsbtFromSurfFrozenTotalNEW = gnsbtFromSurfTotalNEW | |
373 | 373 | let votingPower = fraction(gnsbtAmtFromNsbt, MULT8, (gnsbtFromNsbtTotal + gnsbtFromSurfActiveTotal)) | |
374 | 374 | let votingPowerNew = fraction(gnsbtAmtFromNsbtNEW, MULT8, (gnsbtFromNsbtTotalNEW + gnsbtFromSurfActiveTotal)) | |
375 | 375 | let votingPowerMax = fraction((gnsbtAmtFromNsbt + gnsbtAmtFromSurf), MULT8, ((gnsbtFromNsbtTotal + gnsbtFromSurfActiveTotal) + gnsbtFromSurfFrozenTotal)) | |
376 | 376 | let votingPowerMaxNew = fraction((gnsbtAmtFromNsbtNEW + gnsbtAmtFromSurfNEW), MULT8, ((gnsbtFromNsbtTotalNEW + gnsbtFromSurfActiveTotal) + gnsbtFromSurfFrozenTotalNEW)) | |
377 | 377 | let votingPowerEta = if ((vpEffectiveHeight == 0)) | |
378 | 378 | then height | |
379 | 379 | else vpEffectiveHeight | |
380 | 380 | let votingPowerEtaNew = if ((vpEffectiveHeightNEW == 0)) | |
381 | 381 | then height | |
382 | 382 | else vpEffectiveHeightNEW | |
383 | 383 | $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]) | |
384 | 384 | } | |
385 | 385 | ||
386 | 386 | ||
387 | 387 | ||
388 | 388 | @Callable(i) | |
389 | 389 | func gnsbtInfoREADONLY (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = { | |
390 | 390 | let gnsbtInfoDATA = asAnyList(invoke(this, "gnsbtInfoINTERNAL", [userAddressStrOrEmpty, additionalNsbtToStakeOrZero, additionalSurfToStakeOrZero], nil)) | |
391 | 391 | $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)) | |
392 | 392 | } | |
393 | 393 | ||
394 | 394 | ||
395 | 395 | ||
396 | 396 | @Callable(i) | |
397 | 397 | func rewardInfoREADONLY (userAddressStrOrEmpty) = { | |
398 | 398 | let rewardsData = asAnyList(invoke(gnsbtControllerContract, "gnsbtRewardsSYSREADONLY", [userAddressStrOrEmpty], nil)) | |
399 | 399 | $Tuple2(nil, makeString(["%s%s", asString(rewardsData[0]), asString(rewardsData[1])], SEP)) | |
400 | 400 | } | |
401 | 401 | ||
402 | 402 | ||
403 | 403 | ||
404 | 404 | @Callable(i) | |
405 | 405 | func mergeNsbtREADONLY (userAddressMandatory,newAmount) = { | |
406 | 406 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressMandatory, newAmount], nil)) | |
407 | 407 | let amount0 = asInt(nsbtData[0]) | |
408 | 408 | let startHeight = if ((0 >= amount0)) | |
409 | 409 | then -1 | |
410 | 410 | else asInt(nsbtData[2]) | |
411 | 411 | let startTimestamp = toTimestamp(startHeight) | |
412 | 412 | let startHeightNew = if ((0 >= newAmount)) | |
413 | 413 | then startHeight | |
414 | 414 | else { | |
415 | 415 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
416 | 416 | asInt(invoke(mathContract, "mergeStakesREADONLY", [amount0, startHeight, newAmount, height, halfLife], nil)) | |
417 | 417 | } | |
418 | 418 | let startTimestampNew = toTimestamp(startHeightNew) | |
419 | 419 | $Tuple2(nil, makeString(["%d%d%d%d", toString(startHeight), toString(startTimestamp), toString(startHeightNew), toString(startTimestampNew)], SEP)) | |
420 | 420 | } | |
421 | 421 | ||
422 | 422 | ||
423 | 423 | ||
424 | 424 | @Callable(i) | |
425 | 425 | func swapLimitCalculatorREADONLY (userAddressStrOpt,limitWanted,assetIdStr) = { | |
426 | 426 | let gNsbtCurrent = if ((userAddressStrOpt == "")) | |
427 | 427 | then 0 | |
428 | 428 | else asInt(asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil))._4) | |
429 | 429 | let limitWantedUsdn = if ((assetIdStr == "WAVES")) | |
430 | 430 | then convertWavesToNeutrino(limitWanted, getIntegerValue(controlContract, keyPrice())) | |
431 | 431 | else limitWanted | |
432 | 432 | let gNsbtNeeded = asInt(invoke(this, "reverseSwapLimitREADONLY", [limitWantedUsdn, (assetIdStr == "WAVES")], nil)) | |
433 | 433 | let gNsbtDelta = (gNsbtNeeded - gNsbtCurrent) | |
434 | 434 | $Tuple2(nil, makeString(["%s%s", toString(gNsbtCurrent), toString(gNsbtDelta)], SEP)) | |
435 | 435 | } | |
436 | 436 | ||
437 | 437 | ||
438 | 438 | ||
439 | 439 | @Callable(i) | |
440 | 440 | func swapInfoREADONLY (userAddressStrOrEmpty,amount,assetIdStr) = { | |
441 | 441 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
442 | 442 | let price = asInt(neutrinoMetrics[nMetricIdxPrice]) | |
443 | 443 | let swapParamsTuple = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil)) | |
444 | 444 | let blcks2LmtReset = swapParamsTuple._3 | |
445 | 445 | let limitMaxWaves = swapParamsTuple._6 | |
446 | 446 | let limitMaxUsdn = swapParamsTuple._7 | |
447 | 447 | let assetId = fromBase58String(assetIdStr) | |
448 | 448 | let swapType = if ((assetId == WAVESID)) | |
449 | 449 | then "waves" | |
450 | 450 | else if ((assetId == neutrinoAssetId)) | |
451 | 451 | then "neutrino" | |
452 | 452 | else throw(("Can't swap assetId=" + assetIdStr)) | |
453 | 453 | let withdrawTuple = asWithdrawResultSTRUCT(invoke(neutrinoContract, "calcWithdrawResultSYSREADONLY", [swapType, amount, price], nil)) | |
454 | 454 | let outNetAmount = withdrawTuple._1 | |
455 | 455 | let outAssetId = withdrawTuple._2 | |
456 | 456 | let outSurfAmt = withdrawTuple._3 | |
457 | 457 | let inAmtToSurfPart = withdrawTuple._4 | |
458 | 458 | let unleaseAmt = withdrawTuple._5 | |
459 | 459 | let outFeeAmount = withdrawTuple._6 | |
460 | 460 | let outAmtGross = withdrawTuple._7 | |
461 | 461 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(outNetAmount), toString(outSurfAmt), toString(outFeeAmount), toString(price), toString(blcks2LmtReset), toString(limitMaxWaves), toString(limitMaxUsdn), toString(inAmtToSurfPart)], SEP)) | |
462 | 462 | } | |
463 | 463 | ||
464 | 464 |
github/deemru/w8io/026f985 45.02 ms ◑