tx · 8cjSCdL9FmkRjwJfKBe3Pxxy8dzePZq1ar8yAu7qMPEp 3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi: -0.01400000 Waves 2022.03.22 12:31 [1974953] smart account 3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi > SELF 0.00000000 Waves
{ "type": 13, "id": "8cjSCdL9FmkRjwJfKBe3Pxxy8dzePZq1ar8yAu7qMPEp", "fee": 1400000, "feeAssetId": null, "timestamp": 1647941482111, "version": 1, "sender": "3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi", "senderPublicKey": "BwVRZtTzoCigEsffCvQ9uo7WvkoBNNGVjX4nat5X5zyQ", "proofs": [ "4EuoMbNhrWgm584a8HSGYQwGDK1ExBi37gSaMhsgkK4ZppfdkjWU2L8QVeFuU54nuB9A8JKT42ZosBsMZoDerCgt" ], "script": "base64:AAIFAAAAAAAAAC8IAhIFCgMICAgSABIDCgEIEgQKAggBEgMKAQESBgoEAQEBARIECgIBARIECgIBCAAAADsAAAAACFBSSUNFTEVUAAAAAAAAD0JAAAAAAAlNVUxUU0NBTEUAAAAAAAAAAAgAAAAAC0VVTEVSTlVNQkVSAAAAAAAQM8TWAAAAAAZzY2FsZTYAAAAAAAAPQkAAAAAADHNjYWxlNkJpZ0ludAkAATYAAAABAAAAAAAAD0JAAAAAAAZzY2FsZTgAAAAAAAX14QAAAAAADHNjYWxlOEJpZ0ludAkAATYAAAABAAAAAAAF9eEAAAAAAAdzY2FsZTEyAAAAAOjUpRAAAAAAAAdzY2FsZTE4CQABNgAAAAEADeC2s6dkAAAAAAAAA1NFUAIAAAACX18BAAAAEmtleU5ldXRyaW5vQWRkcmVzcwAAAAACAAAAHSVzJXNfX2NvbmZpZ19fbmV1dHJpbm9BZGRyZXNzAQAAABJrZXlOZXV0cmlub0Fzc2V0SWQAAAAAAgAAABFuZXV0cmlub19hc3NldF9pZAEAAAAda2V5TGlxdWlkYXRpb25Db250cmFjdEFkZHJlc3MAAAA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VpZ2h0BAAAAAFhCQEAAAAFYXNJbnQAAAABCQAD/AAAAAQFAAAADG1hdGhDb250cmFjdAIAAAAhZ2V0VW5zdGFrZUNvbWlzc2lvbkFtb3VudFJFQURPTkxZCQAETAAAAAIFAAAABmFtb3VudAkABEwAAAACBQAAAAtzdGFydEhlaWdodAkABEwAAAACBQAAAAhoYWxmTGlmZQUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAAWEFAAAAAWEJAAUUAAAAAgUAAAADbmlsCQAEuQAAAAIJAARMAAAAAgIAAAACJWQJAARMAAAAAgkAAaQAAAABBQAAAAFhBQAAAANuaWwFAAAAA1NFUAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAfJBfZA==", "chainId": 84, "height": 1974953, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GVsWocwMwvgzeNeY1PQYrnSE93bYzxifwFQDkyA6kkWF Next: 8etoW2gbCAj3LtmpzHEAWpvFbxGp9EJJ42z1zCqLrods Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PRICELET = 1000000 | |
5 | 5 | ||
6 | 6 | let MULTSCALE = 8 | |
7 | 7 | ||
8 | 8 | let EULERNUMBER = 271828182 | |
9 | 9 | ||
10 | 10 | let scale6 = 1000000 | |
11 | 11 | ||
12 | 12 | let scale6BigInt = toBigInt(1000000) | |
13 | 13 | ||
14 | 14 | let scale8 = 100000000 | |
15 | 15 | ||
16 | 16 | let scale8BigInt = toBigInt(100000000) | |
17 | 17 | ||
18 | 18 | let scale12 = 1000000000000 | |
19 | 19 | ||
20 | 20 | let scale18 = toBigInt(1000000000000000000) | |
21 | 21 | ||
22 | 22 | let SEP = "__" | |
23 | 23 | ||
24 | 24 | func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress" | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func keyNeutrinoAssetId () = "neutrino_asset_id" | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func keyLiquidationContractAddress () = "liquidation_contract" | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func keyRPDContract () = "rpd_contract" | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func keyAuctionContract () = "auction_contract" | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func keyContolContract () = "control_contract" | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func keyBondAssetId () = "bond_asset_id" | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func keyBalanceLocked () = "balance_lock_" | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func keyWavesLockedBalance () = (keyBalanceLocked() + "waves") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func keyMinWavesSwapAmount () = "min_waves_swap_amount" | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func keyMinNeutrinoSwapAmount () = "min_neutrino_swap_amount" | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func keyWavesOutFeePart () = "wavesOut_swap_feePart" | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func keyNeutrinoOutFeePart () = "neutrinoOut_swap_feePart" | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func keyNsbtLockContract () = "%s__nsbtLockContract" | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func keyMathContract () = "%s__mathContract" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyBalanceWavesLockInterval () = "balance_waves_lock_interval" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyBalanceNeutrinoLockInterval () = "balance_neutrino_lock_interval" | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyPrice () = "price" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyHalfLife () = "%s__halfLife" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyMinLockAmount () = "%s__minLockAmount" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyMinNsbtSell () = "min_nsbt_sell" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), scale8, scale6) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), scale6, scale8) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func asAnyList (val) = match val { | |
112 | 112 | case valAnyList: List[Any] => | |
113 | 113 | valAnyList | |
114 | 114 | case _ => | |
115 | 115 | throw("fail to cast into List[Any]") | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func asInt (val) = match val { | |
120 | 120 | case valInt: Int => | |
121 | 121 | valInt | |
122 | 122 | case _ => | |
123 | 123 | throw("fail to cast into Int") | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func asString (val) = match val { | |
128 | 128 | case valStr: String => | |
129 | 129 | valStr | |
130 | 130 | case _ => | |
131 | 131 | throw("fail to cast into String") | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func asTuple2Ints (val) = match val { | |
136 | 136 | case v: (Int, Int) => | |
137 | 137 | v | |
138 | 138 | case _ => | |
139 | 139 | throw("fail to cast into Tuple2 ints") | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func asSwapParamsSTRUCT (val) = match val { | |
144 | 144 | case struct: (Int, Int, Int, Int, Int) => | |
145 | 145 | struct | |
146 | 146 | case _ => | |
147 | 147 | throw("fail to cast into Int") | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress())) | |
158 | 158 | ||
159 | 159 | let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract())) | |
160 | 160 | ||
161 | 161 | let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract())) | |
162 | 162 | ||
163 | 163 | let liquidationContract = getStringOrFail(neutrinoContract, keyLiquidationContractAddress()) | |
164 | 164 | ||
165 | 165 | let rpdContract = getStringOrFail(neutrinoContract, keyRPDContract()) | |
166 | 166 | ||
167 | 167 | let mathContract = addressFromStringValue(getStringOrFail(this, keyMathContract())) | |
168 | 168 | ||
169 | 169 | let nsbtStakingContract = addressFromStringValue(getStringOrFail(this, keyNsbtLockContract())) | |
170 | 170 | ||
171 | 171 | let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId()) | |
172 | 172 | ||
173 | 173 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
174 | 174 | ||
175 | 175 | let nsbtAssetIdStr = getStringValue(neutrinoContract, keyBondAssetId()) | |
176 | 176 | ||
177 | 177 | let nsbtAssetId = fromBase58String(nsbtAssetIdStr) | |
178 | 178 | ||
179 | 179 | func minWavesForNsbtBuy () = asInt(invoke(auctionContract, "minWavesAmountNsbtBuySYSREADONLY", nil, nil)) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func minNsbtForSell () = asInt(invoke(auctionContract, "minNsbtAmountForSellSYSREADONLY", nil, nil)) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | @Callable(i) | |
186 | 186 | func constructor (neutrinoAddress,nsbtLockAddress,mathAddress) = if ((i.caller != this)) | |
187 | 187 | then throw("not authorized") | |
188 | 188 | else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), StringEntry(keyNsbtLockContract(), nsbtLockAddress), StringEntry(keyMathContract(), mathAddress)] | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | ||
192 | 192 | @Callable(i) | |
193 | 193 | func neutrinoStatsREADONLY () = { | |
194 | 194 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
195 | 195 | let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceSYSREADONLY", [0], nil)) | |
196 | 196 | let currentPrice = asInt(neutrinoMetrics[0]) | |
197 | 197 | let neutrinoLockedBalance = asInt(neutrinoMetrics[1]) | |
198 | 198 | let wavesLockedBalance = asInt(neutrinoMetrics[2]) | |
199 | 199 | let reservesInWaves = asInt(neutrinoMetrics[3]) | |
200 | 200 | let reservesInUsdn = asInt(neutrinoMetrics[4]) | |
201 | 201 | let neutrinoSupply = asInt(neutrinoMetrics[5]) | |
202 | 202 | let surplus = asInt(neutrinoMetrics[6]) | |
203 | 203 | let surplusPercent = asInt(neutrinoMetrics[7]) | |
204 | 204 | let BR = asInt(neutrinoMetrics[8]) | |
205 | 205 | let nsbtSupply = asInt(neutrinoMetrics[9]) | |
206 | 206 | let maxNsbtSupply = asInt(neutrinoMetrics[10]) | |
207 | 207 | let nsbt2usdnPrice = asInt(prices[0]) | |
208 | 208 | let nsbt2wavesPrice = asInt(prices[1]) | |
209 | 209 | let minWaves4NsbtBuy = minWavesForNsbtBuy() | |
210 | 210 | let minNsbtsell = minNsbtForSell() | |
211 | 211 | let minNsbtLockAmt = getIntOrFail(nsbtStakingContract, keyMinLockAmount()) | |
212 | 212 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", toString(currentPrice), toString(neutrinoLockedBalance), toString(wavesLockedBalance), toString(reservesInWaves), toString(reservesInUsdn), toString(neutrinoSupply), toString(surplus), toString(surplusPercent), toString(BR), toString(nsbtSupply), toString(maxNsbtSupply), toString(nsbt2usdnPrice), toString(nsbt2wavesPrice), toString(minWaves4NsbtBuy), toString(minNsbtsell), toString(minNsbtLockAmt)], SEP)) | |
213 | 213 | } | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | ||
217 | 217 | @Callable(i) | |
218 | 218 | func swapInfoREADONLY (userAddressStr) = { | |
219 | 219 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
220 | 220 | let minWavesSwapAmt = getIntegerValue(neutrinoContract, keyMinWavesSwapAmount()) | |
221 | 221 | let minUsdnSwapAmt = getIntegerValue(neutrinoContract, keyMinNeutrinoSwapAmount()) | |
222 | 222 | let waves2UsdnFee = getIntegerValue(neutrinoContract, keyWavesOutFeePart()) | |
223 | 223 | let usdn2WavesFee = getIntegerValue(neutrinoContract, keyNeutrinoOutFeePart()) | |
224 | 224 | let usdnSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceNeutrinoLockInterval()) | |
225 | 225 | let wavesSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceWavesLockInterval()) | |
226 | 226 | let $t079858146 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
227 | 227 | let swapLimitMaxUsdn = $t079858146._1 | |
228 | 228 | let swapLimitSpentUsdn = $t079858146._2 | |
229 | 229 | let blcks2LmtReset = $t079858146._3 | |
230 | 230 | let swapLimitMaxWaves = convertNeutrinoToWaves(swapLimitMaxUsdn, currentPrice) | |
231 | 231 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d", toString(currentPrice), toString(minWavesSwapAmt), toString(minUsdnSwapAmt), toString(waves2UsdnFee), toString(usdn2WavesFee), toString(usdnSwapDelayDuration), toString(wavesSwapDelayDuration), toString(blcks2LmtReset), toString(swapLimitMaxWaves), toString(swapLimitMaxUsdn), toString(swapLimitSpentUsdn)], SEP)) | |
232 | 232 | } | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | ||
236 | 236 | @Callable(i) | |
237 | 237 | func gnsbtInfoREADONLY (userAddressStrOpt,nsbtAmtDiff) = { | |
238 | 238 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
239 | 239 | let $t090629245 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, 0], nil)) | |
240 | 240 | let limitMaxUsdn = $t090629245._1 | |
241 | 241 | let limitSpent = $t090629245._2 | |
242 | 242 | let blcks2LmtReset = $t090629245._3 | |
243 | 243 | let gnsbtAmt = $t090629245._4 | |
244 | 244 | let gnsbtAmtTotal = $t090629245._5 | |
245 | 245 | let $t092499457 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil)) | |
246 | 246 | let limitMaxUsdnNEW = $t092499457._1 | |
247 | 247 | let limitSpentNEW = $t092499457._2 | |
248 | 248 | let blcks2LmtResetNEW = $t092499457._3 | |
249 | 249 | let gnsbtAmtNEW = $t092499457._4 | |
250 | 250 | let gnsbtAmtTotalNEW = $t092499457._5 | |
251 | 251 | let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice) | |
252 | 252 | let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice) | |
253 | 253 | let gnsbtShare = if ((gnsbtAmtTotal != 0)) | |
254 | 254 | then fraction((gnsbtAmt * 100), scale12, gnsbtAmtTotal) | |
255 | 255 | else 0 | |
256 | 256 | let gnsbtShareNEW = if ((gnsbtAmtTotalNEW != 0)) | |
257 | 257 | then fraction((gnsbtAmtNEW * 100), scale12, gnsbtAmtTotalNEW) | |
258 | 258 | else 0 | |
259 | 259 | let rewardInfo = asString(invoke(nsbtStakingContract, "unclaimedRewardsREADONLY", [userAddressStrOpt], nil)) | |
260 | 260 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%s", toString(gnsbtAmt), toString(gnsbtAmtNEW), toString(gnsbtShare), toString(gnsbtShareNEW), toString(limitMaxUsdn), toString(limitMaxWaves), toString(limitMaxUsdnNEW), toString(limitMaxWavesNEW), rewardInfo], SEP)) | |
261 | 261 | } | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | ||
265 | 265 | @Callable(i) | |
266 | 266 | func buyNsbtREADONLY (wavesPay) = { | |
267 | 267 | let minWavesAmountNsbtBuy = minWavesForNsbtBuy() | |
268 | 268 | if ((minWavesAmountNsbtBuy > wavesPay)) | |
269 | 269 | then throw((("min " + toString(minWavesAmountNsbtBuy)) + " waves expected")) | |
270 | 270 | else { | |
271 | 271 | let curveResult = asAnyList(invoke(mathContract, "curveFunctionREADONLY", [wavesPay], nil)) | |
272 | 272 | if ((curveResult == curveResult)) | |
273 | 273 | then { | |
274 | 274 | let nsbtAmount = asInt(curveResult[0]) | |
275 | 275 | if ((0 >= nsbtAmount)) | |
276 | 276 | then throw("nsbtAmount <= 0") | |
277 | 277 | else $Tuple2(nil, makeString(["%d", toString(nsbtAmount)], SEP)) | |
278 | 278 | } | |
279 | 279 | else throw("Strict value is not equal to itself.") | |
280 | 280 | } | |
281 | 281 | } | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | ||
285 | 285 | @Callable(i) | |
286 | 286 | func mergedStakeREADONLY (amount1,height1,amount2,height2) = { | |
287 | 287 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
288 | 288 | let h = asInt(invoke(mathContract, "mergeStakesREADONLY", [amount1, height1, amount2, height2, halfLife], nil)) | |
289 | 289 | if ((h == h)) | |
290 | 290 | then $Tuple2(nil, makeString(["%d%d", toString((amount1 + amount2)), toString(h)], SEP)) | |
291 | 291 | else throw("Strict value is not equal to itself.") | |
292 | 292 | } | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | ||
296 | 296 | @Callable(i) | |
297 | 297 | func unstakeComissionAmountByHeightREADONLY (amount,startHeight) = { | |
298 | 298 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
299 | 299 | let a = asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [amount, startHeight, halfLife], nil)) | |
300 | 300 | if ((a == a)) | |
301 | 301 | then $Tuple2(nil, makeString(["%d", toString(a)], SEP)) | |
302 | 302 | else throw("Strict value is not equal to itself.") | |
303 | 303 | } | |
304 | 304 | ||
305 | 305 | ||
306 | 306 | ||
307 | 307 | @Callable(i) | |
308 | 308 | func unstakeComissionAmountByUserREADONLY (amount,userAddress) = { | |
309 | 309 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
310 | 310 | let startHeight = valueOrElse(getInteger(nsbtStakingContract, keyLockParamStartBlock(userAddress)), height) | |
311 | 311 | let a = asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [amount, startHeight, halfLife], nil)) | |
312 | 312 | if ((a == a)) | |
313 | 313 | then $Tuple2(nil, makeString(["%d", toString(a)], SEP)) | |
314 | 314 | else throw("Strict value is not equal to itself.") | |
315 | 315 | } | |
316 | 316 | ||
317 | 317 |
github/deemru/w8io/026f985 42.64 ms ◑