tx · 5Tx9hXk2YhPaxGXQMZV8RWqFsTXJiUTdqbvUcvVxuoyW 3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi: -0.01400000 Waves 2022.03.10 13:11 [1957710] smart account 3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi > SELF 0.00000000 Waves
{ "type": 13, "id": "5Tx9hXk2YhPaxGXQMZV8RWqFsTXJiUTdqbvUcvVxuoyW", "fee": 1400000, "feeAssetId": null, "timestamp": 1646907171206, "version": 1, "sender": "3Mxd5o7PwH76ZkN8zG4xwDLubEnbkaihKzi", "senderPublicKey": "BwVRZtTzoCigEsffCvQ9uo7WvkoBNNGVjX4nat5X5zyQ", "proofs": [ "66deVrogLtsjGk7MwcNsZwqi2yVF4gkpCtR5ADhxJmGLovZgPVjmexiddxJupQ86YVujqaqQXn5NKrpHAQdCadSx" ], "script": "base64:AAIFAAAAAAAAAC4IAhIFCgMICAgSABIDCgEIEgMKAQgSAwoBARIGCgQBAQEBEgQKAgEBEgQKAgEIAAAAPAAAAAAIUFJJQ0VMRVQAAAAAAAAPQkAAAAAACU1VTFRTQ0FMRQAAAAAAAAAACAAAAAALRVVMRVJOVU1CRVIAAAAAABAzxNYAAAAABnNjYWxlNgAAAAAAAA9CQAAAAAAMc2NhbGU2QmlnSW50CQABNgAAAAEAAAAAAAAPQkAAAAAABnNjYWxlOAAAAAAABfXhAAAAAAAMc2NhbGU4QmlnSW50CQABNgAAAAEAAAAAAAX14QAAAAAAB3NjYWxlMTIAAAAA6NSlEAAAAAAAB3NjYWxlMTgJAAE2AAAAAQAN4Lazp2QAAAAAAAADU0VQAgAAAAJfXwEAAAASa2V5TmV1dHJpbm9BZGRyZXNzAAAAAAIAAAAdJXMlc19fY29uZmlnX19uZXV0cmlub0FkZHJlc3MBAAAAEmtleU5ldXRyaW5vQXNzZXRJZAAAAAACAAAAEW5ldXRyaW5vX2Fzc2V0X2lkAQAAAB1rZXlMaXF1aWRhdGlvbkNvbnRyYWN0QWRk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SBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAFpAQAAACR1bnN0YWtlQ29taXNzaW9uQW1vdW50QnlVc2VyUkVBRE9OTFkAAAACAAAABmFtb3VudAAAAAt1c2VyQWRkcmVzcwQAAAALc3RhcnRIZWlnaHQJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAATbnNidFN0YWtpbmdDb250cmFjdAkBAAAAFmtleUxvY2tQYXJhbVN0YXJ0QmxvY2sAAAABBQAAAAt1c2VyQWRkcmVzcwUAAAAGaGVpZ2h0BAAAAAFhCQEAAAAFYXNJbnQAAAABCQAD/AAAAAQFAAAADG1hdGhDb250cmFjdAIAAAAdZ2V0VW5zdGFrZUNvbWlzc2lvbkFtb3VudE1BVEgJAARMAAAAAgUAAAAGYW1vdW50CQAETAAAAAIFAAAAC3N0YXJ0SGVpZ2h0BQAAAANuaWwFAAAAA25pbAMJAAAAAAAAAgUAAAABYQUAAAABYQkABRQAAAACBQAAAANuaWwJAAS5AAAAAgkABEwAAAACAgAAAAIlZAkABEwAAAACCQABpAAAAAEFAAAAAWEFAAAAA25pbAUAAAADU0VQCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAABQ9309", "chainId": 84, "height": 1957710, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HnE1Q7LppwJ5sCNnEewKf2cgyQpK9ZC2gtoBJo6DpPeF Next: FUobVWrWarjW3TKUwg7x2vaBevKRCTP16wEYoBj81kXF Diff:
Old | New | Differences | |
---|---|---|---|
224 | 224 | let usdn2WavesFee = getIntegerValue(neutrinoContract, keyNeutrinoOutFeePart()) | |
225 | 225 | let usdnSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceNeutrinoLockInterval()) | |
226 | 226 | let wavesSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceWavesLockInterval()) | |
227 | - | let $ | |
227 | + | let $t081589237 = if ((userAddressStr == "")) | |
228 | 228 | then $Tuple4(0, 0, 0, 0) | |
229 | 229 | else { | |
230 | 230 | let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddressStr)), 0) | |
245 | 245 | } | |
246 | 246 | else throw("Strict value is not equal to itself.") | |
247 | 247 | } | |
248 | - | let quickSwapUserSpent = $ | |
249 | - | let blocks2LimitReset = $ | |
250 | - | let maxUsdnLimit = $ | |
251 | - | let maxWavesLimit = $ | |
248 | + | let quickSwapUserSpent = $t081589237._1 | |
249 | + | let blocks2LimitReset = $t081589237._2 | |
250 | + | let maxUsdnLimit = $t081589237._3 | |
251 | + | let maxWavesLimit = $t081589237._4 | |
252 | 252 | $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)) | |
253 | 253 | } | |
254 | 254 | ||
313 | 313 | ||
314 | 314 | ||
315 | 315 | @Callable(i) | |
316 | - | func unstakeComissionAmountREADONLY (amount,startHeight) = { | |
316 | + | func unstakeComissionAmountByHeightREADONLY (amount,startHeight) = { | |
317 | + | let a = asInt(invoke(mathContract, "getUnstakeComissionAmountMATH", [amount, startHeight], nil)) | |
318 | + | if ((a == a)) | |
319 | + | then $Tuple2(nil, makeString(["%d", toString(a)], SEP)) | |
320 | + | else throw("Strict value is not equal to itself.") | |
321 | + | } | |
322 | + | ||
323 | + | ||
324 | + | ||
325 | + | @Callable(i) | |
326 | + | func unstakeComissionAmountByUserREADONLY (amount,userAddress) = { | |
327 | + | let startHeight = valueOrElse(getInteger(nsbtStakingContract, keyLockParamStartBlock(userAddress)), height) | |
317 | 328 | let a = asInt(invoke(mathContract, "getUnstakeComissionAmountMATH", [amount, startHeight], nil)) | |
318 | 329 | if ((a == a)) | |
319 | 330 | then $Tuple2(nil, makeString(["%d", toString(a)], SEP)) |
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 keyQuickSwapLimitDuration () = "%s__quickSwapLimitDuration" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyBalanceWavesLockInterval () = "balance_waves_lock_interval" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyBalanceNeutrinoLockInterval () = "balance_neutrino_lock_interval" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keySwapsTimeframe () = "swaps_timeframe" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyPrice () = "price" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyLockParamTotalAmount () = makeString(["%s%s", "stats", "activeTotalLocked"], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyMinLockAmount () = "%s__minLockAmount" | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy" | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyMinNsbtSell () = "min_nsbt_sell" | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), scale8, scale6) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), scale6, scale8) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func asAnyList (val) = match val { | |
127 | 127 | case valAnyList: List[Any] => | |
128 | 128 | valAnyList | |
129 | 129 | case _ => | |
130 | 130 | throw("fail to cast into List[Any]") | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func asInt (val) = match val { | |
135 | 135 | case valInt: Int => | |
136 | 136 | valInt | |
137 | 137 | case _ => | |
138 | 138 | throw("fail to cast into Int") | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func asString (val) = match val { | |
143 | 143 | case valStr: String => | |
144 | 144 | valStr | |
145 | 145 | case _ => | |
146 | 146 | throw("fail to cast into String") | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress())) | |
157 | 157 | ||
158 | 158 | let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract())) | |
159 | 159 | ||
160 | 160 | let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract())) | |
161 | 161 | ||
162 | 162 | let liquidationContract = getStringOrFail(neutrinoContract, keyLiquidationContractAddress()) | |
163 | 163 | ||
164 | 164 | let rpdContract = getStringOrFail(neutrinoContract, keyRPDContract()) | |
165 | 165 | ||
166 | 166 | let mathContract = addressFromStringValue(getStringOrFail(this, keyMathContract())) | |
167 | 167 | ||
168 | 168 | let nsbtStakingContract = addressFromStringValue(getStringOrFail(this, keyNsbtLockContract())) | |
169 | 169 | ||
170 | 170 | let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId()) | |
171 | 171 | ||
172 | 172 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
173 | 173 | ||
174 | 174 | let nsbtAssetIdStr = getStringValue(neutrinoContract, keyBondAssetId()) | |
175 | 175 | ||
176 | 176 | let nsbtAssetId = fromBase58String(nsbtAssetIdStr) | |
177 | 177 | ||
178 | 178 | @Callable(i) | |
179 | 179 | func constructor (neutrinoAddress,nsbtLockAddress,mathAddress) = if ((i.caller != this)) | |
180 | 180 | then throw("not authorized") | |
181 | 181 | else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), StringEntry(keyNsbtLockContract(), nsbtLockAddress), StringEntry(keyMathContract(), mathAddress)] | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | ||
185 | 185 | @Callable(i) | |
186 | 186 | func neutrinoStatsREADONLY () = { | |
187 | 187 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsMATH", nil, nil)) | |
188 | 188 | if ((neutrinoMetrics == neutrinoMetrics)) | |
189 | 189 | then { | |
190 | 190 | let prices = asAnyList(invoke(mathContract, "calcContractNsbtPriceMATH", nil, nil)) | |
191 | 191 | if ((prices == prices)) | |
192 | 192 | then { | |
193 | 193 | let currentPrice = asInt(neutrinoMetrics[0]) | |
194 | 194 | let neutrinoLockedBalance = asInt(neutrinoMetrics[1]) | |
195 | 195 | let wavesLockedBalance = asInt(neutrinoMetrics[2]) | |
196 | 196 | let reservesInWaves = asInt(neutrinoMetrics[3]) | |
197 | 197 | let reservesInUsdn = asInt(neutrinoMetrics[4]) | |
198 | 198 | let neutrinoSupply = asInt(neutrinoMetrics[5]) | |
199 | 199 | let surplus = asInt(neutrinoMetrics[6]) | |
200 | 200 | let surplusPercent = asInt(neutrinoMetrics[7]) | |
201 | 201 | let BR = asInt(neutrinoMetrics[8]) | |
202 | 202 | let nsbtSupply = asInt(neutrinoMetrics[9]) | |
203 | 203 | let maxNsbtSupply = asInt(neutrinoMetrics[10]) | |
204 | 204 | let nsbt2usdnPrice = asInt(prices[0]) | |
205 | 205 | let nsbt2wavesPrice = asInt(prices[1]) | |
206 | 206 | let minWaves4NsbtBuy = getIntOrFail(auctionContract, keyMinWavesForNsbtBuy()) | |
207 | 207 | let minNsbtsell = getIntOrFail(auctionContract, keyMinNsbtSell()) | |
208 | 208 | let minNsbtLockAmt = getIntOrFail(nsbtStakingContract, keyMinLockAmount()) | |
209 | 209 | $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), toString(minNsbtsell), toString(minNsbtLockAmt)], SEP)) | |
210 | 210 | } | |
211 | 211 | else throw("Strict value is not equal to itself.") | |
212 | 212 | } | |
213 | 213 | else throw("Strict value is not equal to itself.") | |
214 | 214 | } | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | ||
218 | 218 | @Callable(i) | |
219 | 219 | func swapInfoREADONLY (userAddressStr) = { | |
220 | 220 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
221 | 221 | let minWavesSwapAmt = getIntegerValue(neutrinoContract, keyMinWavesSwapAmount()) | |
222 | 222 | let minUsdnSwapAmt = getIntegerValue(neutrinoContract, keyMinNeutrinoSwapAmount()) | |
223 | 223 | let waves2UsdnFee = getIntegerValue(neutrinoContract, keyWavesOutFeePart()) | |
224 | 224 | let usdn2WavesFee = getIntegerValue(neutrinoContract, keyNeutrinoOutFeePart()) | |
225 | 225 | let usdnSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceNeutrinoLockInterval()) | |
226 | 226 | let wavesSwapDelayDuration = getIntegerValue(neutrinoContract, keyBalanceWavesLockInterval()) | |
227 | - | let $ | |
227 | + | let $t081589237 = if ((userAddressStr == "")) | |
228 | 228 | then $Tuple4(0, 0, 0, 0) | |
229 | 229 | else { | |
230 | 230 | let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddressStr)), 0) | |
231 | 231 | let usdnLmtMax = asInt(invoke(mathContract, "calcSwapLimitMATH", [userGNsbtAmount], nil)) | |
232 | 232 | if ((usdnLmtMax == usdnLmtMax)) | |
233 | 233 | then { | |
234 | 234 | let quickSwapResetBlocks = valueOrElse(getInteger(neutrinoContract, keySwapsTimeframe()), 1440) | |
235 | 235 | let lastQuickSwapBlock = valueOrElse(getInteger(neutrinoContract, keyUserLastQuickSwapHeight(userAddressStr)), 0) | |
236 | 236 | let isNewQuickSwapPeriod = ((height - lastQuickSwapBlock) > quickSwapResetBlocks) | |
237 | 237 | let quickSwapUserSpent = if (isNewQuickSwapPeriod) | |
238 | 238 | then 0 | |
239 | 239 | else valueOrElse(getInteger(neutrinoContract, keyQuickSwapUserSpentInPeriod(userAddressStr)), 0) | |
240 | 240 | let blcks2LmtReset = if (isNewQuickSwapPeriod) | |
241 | 241 | then 0 | |
242 | 242 | else (quickSwapResetBlocks - (height - lastQuickSwapBlock)) | |
243 | 243 | let wavesLmtMax = convertNeutrinoToWaves(usdnLmtMax, currentPrice) | |
244 | 244 | $Tuple4(quickSwapUserSpent, blcks2LmtReset, usdnLmtMax, wavesLmtMax) | |
245 | 245 | } | |
246 | 246 | else throw("Strict value is not equal to itself.") | |
247 | 247 | } | |
248 | - | let quickSwapUserSpent = $ | |
249 | - | let blocks2LimitReset = $ | |
250 | - | let maxUsdnLimit = $ | |
251 | - | let maxWavesLimit = $ | |
248 | + | let quickSwapUserSpent = $t081589237._1 | |
249 | + | let blocks2LimitReset = $t081589237._2 | |
250 | + | let maxUsdnLimit = $t081589237._3 | |
251 | + | let maxWavesLimit = $t081589237._4 | |
252 | 252 | $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)) | |
253 | 253 | } | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | ||
257 | 257 | @Callable(i) | |
258 | 258 | func gnsbtInfoREADONLY (userAddressStr) = { | |
259 | 259 | let gnsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddressStr)), 0) | |
260 | 260 | let gnsbtTotal = valueOrElse(getInteger(nsbtStakingContract, keyLockParamTotalAmount()), 0) | |
261 | 261 | let gnsbtShare = fraction((gnsbtAmount * 100), scale12, gnsbtTotal) | |
262 | 262 | let claimedTotalInUsdn = 10000 | |
263 | 263 | let claimedUsdn = 10000 | |
264 | 264 | let claimedWaves = 10000 | |
265 | 265 | let unclaimedTotalInUsdn = 10000 | |
266 | 266 | let unclaimedUsdn = 10000 | |
267 | 267 | let unclaimedWaves = 10000 | |
268 | 268 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(gnsbtAmount), toString(gnsbtShare), toString(claimedTotalInUsdn), toString(claimedUsdn), toString(claimedWaves), toString(unclaimedTotalInUsdn), toString(unclaimedUsdn), toString(unclaimedWaves)], SEP)) | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | ||
273 | 273 | @Callable(i) | |
274 | 274 | func buyNsbtREADONLY (wavesPay) = { | |
275 | 275 | let minWavesAmountNsbtBuy = getIntegerValue(auctionContract, keyMinWavesForNsbtBuy()) | |
276 | 276 | if ((minWavesAmountNsbtBuy > wavesPay)) | |
277 | 277 | then throw((("min " + toString(minWavesAmountNsbtBuy)) + " waves expected")) | |
278 | 278 | else { | |
279 | 279 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsMATH", nil, nil)) | |
280 | 280 | if ((neutrinoMetrics == neutrinoMetrics)) | |
281 | 281 | then { | |
282 | 282 | let currentPrice = asInt(neutrinoMetrics[0]) | |
283 | 283 | let reserve = asInt(neutrinoMetrics[3]) | |
284 | 284 | let neutrinoSupply = asInt(neutrinoMetrics[5]) | |
285 | 285 | let nsbtSupply = asInt(neutrinoMetrics[9]) | |
286 | 286 | let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity | |
287 | 287 | let curveResult = asAnyList(invoke(mathContract, "curveFunctionMATH", [reserve, neutrinoSupply, currentPrice, nsbtSupplyMAX, nsbtSupply, wavesPay], nil)) | |
288 | 288 | if ((curveResult == curveResult)) | |
289 | 289 | then { | |
290 | 290 | let nsbtAmount = asInt(curveResult[0]) | |
291 | 291 | if ((0 >= nsbtAmount)) | |
292 | 292 | then throw("nsbtAmount <= 0") | |
293 | 293 | else if ((wavesPay > (nsbtAmount * 9223372))) | |
294 | 294 | then throw(((("Nsbt2Waves price exceeds MAX_INT: " + toString(wavesPay)) + "/") + toString(nsbtAmount))) | |
295 | 295 | else $Tuple2(nil, makeString(["%d", toString(nsbtAmount)], SEP)) | |
296 | 296 | } | |
297 | 297 | else throw("Strict value is not equal to itself.") | |
298 | 298 | } | |
299 | 299 | else throw("Strict value is not equal to itself.") | |
300 | 300 | } | |
301 | 301 | } | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | ||
305 | 305 | @Callable(i) | |
306 | 306 | func mergedStakeREADONLY (amount1,height1,amount2,height2) = { | |
307 | 307 | let h = asInt(invoke(mathContract, "mergeStakesMATH", [amount1, height1, amount2, height2], nil)) | |
308 | 308 | if ((h == h)) | |
309 | 309 | then $Tuple2(nil, makeString(["%d%d", toString((amount1 + amount2)), toString(h)], SEP)) | |
310 | 310 | else throw("Strict value is not equal to itself.") | |
311 | 311 | } | |
312 | 312 | ||
313 | 313 | ||
314 | 314 | ||
315 | 315 | @Callable(i) | |
316 | - | func unstakeComissionAmountREADONLY (amount,startHeight) = { | |
316 | + | func unstakeComissionAmountByHeightREADONLY (amount,startHeight) = { | |
317 | + | let a = asInt(invoke(mathContract, "getUnstakeComissionAmountMATH", [amount, startHeight], nil)) | |
318 | + | if ((a == a)) | |
319 | + | then $Tuple2(nil, makeString(["%d", toString(a)], SEP)) | |
320 | + | else throw("Strict value is not equal to itself.") | |
321 | + | } | |
322 | + | ||
323 | + | ||
324 | + | ||
325 | + | @Callable(i) | |
326 | + | func unstakeComissionAmountByUserREADONLY (amount,userAddress) = { | |
327 | + | let startHeight = valueOrElse(getInteger(nsbtStakingContract, keyLockParamStartBlock(userAddress)), height) | |
317 | 328 | let a = asInt(invoke(mathContract, "getUnstakeComissionAmountMATH", [amount, startHeight], nil)) | |
318 | 329 | if ((a == a)) | |
319 | 330 | then $Tuple2(nil, makeString(["%d", toString(a)], SEP)) | |
320 | 331 | else throw("Strict value is not equal to itself.") | |
321 | 332 | } | |
322 | 333 | ||
323 | 334 |
github/deemru/w8io/026f985 57.58 ms ◑