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