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