tx · DtB2uW6ojynU8kDkS4o3zdecs2Tdr8ZJCyqkh6kD1M6s 3MydqRdWHFcvU4ZogmgkGNHt8fqYiCRazbn: -0.10000000 Waves 2020.03.31 09:45 [933276] smart account 3MydqRdWHFcvU4ZogmgkGNHt8fqYiCRazbn > SELF 0.00000000 Waves
{ "type": 13, "id": "DtB2uW6ojynU8kDkS4o3zdecs2Tdr8ZJCyqkh6kD1M6s", "fee": 10000000, "feeAssetId": null, "timestamp": 1585637115962, "version": 1, "sender": "3MydqRdWHFcvU4ZogmgkGNHt8fqYiCRazbn", "senderPublicKey": "J4hU7VqLs2JAJXwFnjicQ97XShyZEqt8REC8fJHkTdKd", "proofs": [ "2A7BtKnGpELdNsUX7QF1Qtj48XPAbm72d5h5q3Z5SWJikF49BN38xStUHDDzYtv7BM8AmgLehaUDkyM5DPdirQmM" ], "script": "base64:AAIDAAAAAAAAABcIARIAEgASBAoCCAESABIDCgEIEgASAAAAAEoBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAMZ2V0Qm9vbEJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQbAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBwEAAAAYZ2V0TnVtYmVyQnlBZGRyZXNzQW5kS2V5AAAAAgAA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QFAAAAA25pbAAAAAAtKXGW", "chainId": 84, "height": 933276, "spentComplexity": 0 } View: original | compacted Prev: 7sEuyHSs2uPQgXtLc1yTm5NHTKpEpa7XR8JwjNCAXnuX Next: 2oDporH6otQhMpZgmFFZ2sirPJeYQ95reFbg7Piwcrvr Diff:
Old | New | Differences | |
---|---|---|---|
322 | 322 | let account = toString(i.caller) | |
323 | 323 | if ((minNeutrinoSwapAmount > pmt.amount)) | |
324 | 324 | then throw((("The specified Neutrino amount is less than the required minimum of " + toString(minNeutrinoSwapAmount)) + " Neutrino cents.")) | |
325 | - | else if (isBlocked) | |
326 | - | then throw("The contract is blocked by EMERGENCY SHUTDOWN. Please wait for reactivation by emergency oracles.") | |
327 | - | else if ((pmt.assetId != neutrinoAssetId)) | |
328 | - | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
329 | - | else if ((getUnlockBalanceBlock(account) > height)) | |
330 | - | then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks")) | |
331 | - | else if (if ((getNeutrinoLockedBalance(account) != 0)) | |
332 | - | then true | |
333 | - | else (getWavesLockedBalance(account) != 0)) | |
334 | - | then throw("please withdraw locked funds first") | |
335 | - | else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceNeutrinoLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))]) | |
325 | + | else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceNeutrinoLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))]) | |
336 | 326 | } | |
337 | 327 | ||
338 | 328 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | 5 | case a: Int => | |
6 | 6 | a | |
7 | 7 | case _ => | |
8 | 8 | 0 | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getStringByKey (key) = match getString(this, key) { | |
13 | 13 | case a: String => | |
14 | 14 | a | |
15 | 15 | case _ => | |
16 | 16 | "" | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getBoolByKey (key) = match getBoolean(this, key) { | |
21 | 21 | case a: Boolean => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | false | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) { | |
29 | 29 | case a: Int => | |
30 | 30 | a | |
31 | 31 | case _ => | |
32 | 32 | 0 | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func getStringByAddressAndKey (address,key) = match getString(addressFromStringValue(address), key) { | |
37 | 37 | case a: String => | |
38 | 38 | a | |
39 | 39 | case _ => | |
40 | 40 | "" | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getBoolByAddressAndKey (address,key) = match getBoolean(addressFromStringValue(address), key) { | |
45 | 45 | case a: Boolean => | |
46 | 46 | a | |
47 | 47 | case _ => | |
48 | 48 | false | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | let SENDTXEXPIRE = 30 | |
53 | 53 | ||
54 | 54 | let LISTSPLITSYMBOL = "_" | |
55 | 55 | ||
56 | 56 | let LISTDATASYMBOL = "+" | |
57 | 57 | ||
58 | 58 | let WAVELET = 100000000 | |
59 | 59 | ||
60 | 60 | let PAULI = 1000000 | |
61 | 61 | ||
62 | 62 | let DEFICITOFFSET = 5 | |
63 | 63 | ||
64 | 64 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
65 | 65 | ||
66 | 66 | let BondAssetIdKey = "bond_asset_id" | |
67 | 67 | ||
68 | 68 | let AuctionContractKey = "auction_contract" | |
69 | 69 | ||
70 | 70 | let LiquidationContractKey = "liquidation_contract" | |
71 | 71 | ||
72 | 72 | let RPDContractKey = "rpd_contract" | |
73 | 73 | ||
74 | 74 | let ContolContractKey = "control_contract" | |
75 | 75 | ||
76 | 76 | let BalanceWavesLockIntervalKey = "balance_waves_lock_interval" | |
77 | 77 | ||
78 | 78 | let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval" | |
79 | 79 | ||
80 | 80 | let MinWavesSwapAmountKey = "min_waves_swap_amount" | |
81 | 81 | ||
82 | 82 | let MinNeutrinoSwapAmountKey = "min_neutrino_swap_amount" | |
83 | 83 | ||
84 | 84 | let NodeOracleProviderPubKeyKey = "node_oracle_provider" | |
85 | 85 | ||
86 | 86 | let RPDBalanceKey = "rpd_balance" | |
87 | 87 | ||
88 | 88 | func getRPDContractBalanceKey (assetId) = ((RPDBalanceKey + "_") + toBase58String(assetId)) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | let PriceKey = "price" | |
92 | 92 | ||
93 | 93 | let PriceIndexKey = "price_index" | |
94 | 94 | ||
95 | 95 | let IsBlockedKey = "is_blocked" | |
96 | 96 | ||
97 | 97 | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index)) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | let BalanceLockedkKey = "balance_lock_" | |
104 | 104 | ||
105 | 105 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
106 | 106 | ||
107 | 107 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
108 | 108 | ||
109 | 109 | func getRPDSnapshotContractBalanceKey (count,assetId) = ((((RPDBalanceKey + "_") + toBase58String(assetId)) + "_") + toString(count)) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func getCancelLeaseTxReserveFeeKey (hash) = (("cancel_lease_tx_reserve_fee" + "_") + hash) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func getWavesLockedBalanceKey (owner) = ((WavesLockedBalanceKey + "_") + owner) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func getNeutrinoLockedBalanceKey (owner) = ((NeutrinoLockedBalanceKey + "_") + owner) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getRPDProfitKey (count) = (("rpd_profit" + "_") + toString(count)) | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | let liquidationContract = getStringByKey(LiquidationContractKey) | |
140 | 140 | ||
141 | 141 | let neutrinoAssetIdString = getStringByKey(NeutrinoAssetIdKey) | |
142 | 142 | ||
143 | 143 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
144 | 144 | ||
145 | 145 | let auctionContract = getStringByKey(AuctionContractKey) | |
146 | 146 | ||
147 | 147 | let rpdContract = getStringByKey(RPDContractKey) | |
148 | 148 | ||
149 | 149 | let controlContract = getStringByKey(ContolContractKey) | |
150 | 150 | ||
151 | 151 | let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey) | |
152 | 152 | ||
153 | 153 | let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey) | |
154 | 154 | ||
155 | 155 | let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey)) | |
156 | 156 | ||
157 | 157 | let balanceWavesLockInterval = getNumberByKey(BalanceWavesLockIntervalKey) | |
158 | 158 | ||
159 | 159 | let balanceNeutrinoLockInterval = getNumberByKey(BalanceNeutrinoLockIntervalKey) | |
160 | 160 | ||
161 | 161 | let minWavesSwapAmount = getNumberByKey(MinWavesSwapAmountKey) | |
162 | 162 | ||
163 | 163 | let minNeutrinoSwapAmount = getNumberByKey(MinNeutrinoSwapAmountKey) | |
164 | 164 | ||
165 | 165 | let bondAssetId = fromBase58String("Qh28HvUAcFboD1GsAcyURQjNW6mdpuGvXVgFS9e3CzC") | |
166 | 166 | ||
167 | 167 | let deprecatedBondAssetId = fromBase58String("EyizrdEpB9yuh45Zv3f2UfxKLjcecrmvcq5DSP9fEwum") | |
168 | 168 | ||
169 | 169 | let neutrinoContract = this | |
170 | 170 | ||
171 | 171 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
172 | 172 | ||
173 | 173 | let neutrinoLockedBalance = getNumberByKey(NeutrinoLockedBalanceKey) | |
174 | 174 | ||
175 | 175 | let wavesLockedBalance = getNumberByKey(WavesLockedBalanceKey) | |
176 | 176 | ||
177 | 177 | let reserve = (wavesBalance(neutrinoContract) - wavesLockedBalance) | |
178 | 178 | ||
179 | 179 | let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
180 | 180 | ||
181 | 181 | let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply) | |
182 | 182 | ||
183 | 183 | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
184 | 184 | ||
185 | 185 | func getRPDContractBalance (assetId) = getNumberByAddressAndKey(rpdContract, getRPDContractBalanceKey(assetId)) | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block)) | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index)) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func getCancelLeaseTxReserveFee (hash) = getNumberByKey(getCancelLeaseTxReserveFeeKey(hash)) | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func getWavesLockedBalance (owner) = getNumberByKey(getWavesLockedBalanceKey(owner)) | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func getNeutrinoLockedBalance (owner) = getNumberByKey(getNeutrinoLockedBalanceKey(owner)) | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func getUnlockBalanceBlock (owner) = getNumberByKey(getBalanceUnlockBlockKey(owner)) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func getRPDProfit (count) = getNumberByKey(getRPDProfitKey(count)) | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | @Callable(i) | |
210 | 210 | func swapWavesToNeutrino () = { | |
211 | 211 | let pmt = extract(i.payment) | |
212 | 212 | let account = toString(i.caller) | |
213 | 213 | if ((minWavesSwapAmount > pmt.amount)) | |
214 | 214 | then throw((("The specified Waves amount is less than the required minimum of " + toString(minWavesSwapAmount)) + " wavelets.")) | |
215 | 215 | else if (isDefined(pmt.assetId)) | |
216 | 216 | then throw("Only Waves token is allowed for swapping.") | |
217 | 217 | else if (isBlocked) | |
218 | 218 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
219 | 219 | else if ((getUnlockBalanceBlock(account) > height)) | |
220 | 220 | then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks")) | |
221 | 221 | else if (if ((getNeutrinoLockedBalance(account) != 0)) | |
222 | 222 | then true | |
223 | 223 | else (getWavesLockedBalance(account) != 0)) | |
224 | 224 | then throw("please withdraw locked funds first") | |
225 | 225 | else WriteSet([DataEntry(getWavesLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceWavesLockInterval)), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance + pmt.amount))]) | |
226 | 226 | } | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | ||
230 | 230 | @Callable(i) | |
231 | 231 | func swapNeutrinoToWaves () = { | |
232 | 232 | let pmt = extract(i.payment) | |
233 | 233 | let account = toString(i.caller) | |
234 | 234 | if ((minNeutrinoSwapAmount > pmt.amount)) | |
235 | 235 | then throw((("The specified Neutrino amount is less than the required minimum of " + toString(minNeutrinoSwapAmount)) + " Neutrino cents.")) | |
236 | 236 | else if (isBlocked) | |
237 | 237 | then throw("The contract is blocked by EMERGENCY SHUTDOWN. Please wait for reactivation by emergency oracles.") | |
238 | 238 | else if ((pmt.assetId != neutrinoAssetId)) | |
239 | 239 | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
240 | 240 | else if ((getUnlockBalanceBlock(account) > height)) | |
241 | 241 | then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks")) | |
242 | 242 | else if (if ((getNeutrinoLockedBalance(account) != 0)) | |
243 | 243 | then true | |
244 | 244 | else (getWavesLockedBalance(account) != 0)) | |
245 | 245 | then throw("please withdraw locked funds first") | |
246 | 246 | else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceNeutrinoLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))]) | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | ||
251 | 251 | @Callable(i) | |
252 | 252 | func withdraw (account,index) = { | |
253 | 253 | let unlockHeight = getUnlockBalanceBlock(account) | |
254 | 254 | let userWavesLockedBalance = getWavesLockedBalance(account) | |
255 | 255 | let userNeutrinoLockedBalance = getNeutrinoLockedBalance(account) | |
256 | 256 | let indexHeight = getHeightPriceByIndex(index) | |
257 | 257 | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
258 | 258 | let priceByIndex = getPriceHistory(indexHeight) | |
259 | 259 | let neutrinoAmount = convertWavesToNeutrino(userWavesLockedBalance, priceByIndex) | |
260 | 260 | let wavesAmount = convertNeutrinoToWaves(userNeutrinoLockedBalance, priceByIndex) | |
261 | 261 | if (isBlocked) | |
262 | 262 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
263 | 263 | else if ((unlockHeight > height)) | |
264 | 264 | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw WAVES funds")) | |
265 | 265 | else if (if (if ((index > priceIndex)) | |
266 | 266 | then true | |
267 | 267 | else (unlockHeight > indexHeight)) | |
268 | 268 | then true | |
269 | 269 | else if ((prevIndexHeight != 0)) | |
270 | 270 | then (prevIndexHeight >= unlockHeight) | |
271 | 271 | else false) | |
272 | 272 | then throw(((((((((("invalid price history index: index=" + toString(index)) + " priceIndex=") + toString(priceIndex)) + " indexHeight=") + toString(indexHeight)) + " unlockHeight=") + toString(unlockHeight)) + " prevIndexHeight=") + toString(prevIndexHeight))) | |
273 | 273 | else if (if ((0 >= neutrinoAmount)) | |
274 | 274 | then (0 >= wavesAmount) | |
275 | 275 | else false) | |
276 | 276 | then throw("balance equals zero") | |
277 | 277 | else ScriptResult(WriteSet([DataEntry(getWavesLockedBalanceKey(account), 0), DataEntry(getNeutrinoLockedBalanceKey(account), 0), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance - userWavesLockedBalance)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance - userNeutrinoLockedBalance))]), TransferSet([ScriptTransfer(addressFromStringValue(account), wavesAmount, unit), ScriptTransfer(addressFromStringValue(account), neutrinoAmount, neutrinoAssetId)])) | |
278 | 278 | } | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | ||
282 | 282 | @Callable(i) | |
283 | 283 | func transferToAuction () = { | |
284 | 284 | let deficitBondAmount = (deficit - assetBalance(addressFromStringValue(auctionContract), bondAssetId)) | |
285 | 285 | let minDeficit = fraction(neutrinoSupply, DEFICITOFFSET, 100) | |
286 | 286 | let surplusWithLiquidation = (surplus - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
287 | 287 | if (isBlocked) | |
288 | 288 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
289 | 289 | else if (if ((deficitBondAmount > minDeficit)) | |
290 | 290 | then (deficitBondAmount > 0) | |
291 | 291 | else false) | |
292 | 292 | then TransferSet([ScriptTransfer(addressFromStringValue(auctionContract), deficitBondAmount, bondAssetId)]) | |
293 | 293 | else if ((surplusWithLiquidation >= (1 * PAULI))) | |
294 | 294 | then TransferSet([ScriptTransfer(addressFromStringValue(liquidationContract), surplusWithLiquidation, neutrinoAssetId)]) | |
295 | 295 | else throw(((((((("bond were generated or do not need it. Deficit:" + toString(deficitBondAmount)) + "|") + toString(minDeficit)) + ". Surplus:") + toString(surplusWithLiquidation)) + "|") + toString(surplus))) | |
296 | 296 | } | |
297 | 297 | ||
298 | 298 | ||
299 | 299 | ||
300 | 300 | @Callable(i) | |
301 | 301 | func transfer (account) = { | |
302 | 302 | let pmt = extract(i.payment) | |
303 | 303 | TransferSet([ScriptTransfer(addressFromStringValue(account), pmt.amount, pmt.assetId)]) | |
304 | 304 | } | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | ||
308 | 308 | @Callable(i) | |
309 | 309 | func migrationUSDNB2NSBTSwap () = { | |
310 | 310 | let pmt = extract(i.payment) | |
311 | 311 | let account = i.caller | |
312 | 312 | if ((deprecatedBondAssetId != pmt.assetId)) | |
313 | 313 | then throw("error: attempt to swap not USDNB tokens") | |
314 | 314 | else TransferSet([ScriptTransfer(account, (pmt.amount * PAULI), bondAssetId)]) | |
315 | 315 | } | |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | 319 | @Callable(i) | |
320 | 320 | func testTransfer () = { | |
321 | 321 | let pmt = extract(i.payment) | |
322 | 322 | let account = toString(i.caller) | |
323 | 323 | if ((minNeutrinoSwapAmount > pmt.amount)) | |
324 | 324 | then throw((("The specified Neutrino amount is less than the required minimum of " + toString(minNeutrinoSwapAmount)) + " Neutrino cents.")) | |
325 | - | else if (isBlocked) | |
326 | - | then throw("The contract is blocked by EMERGENCY SHUTDOWN. Please wait for reactivation by emergency oracles.") | |
327 | - | else if ((pmt.assetId != neutrinoAssetId)) | |
328 | - | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
329 | - | else if ((getUnlockBalanceBlock(account) > height)) | |
330 | - | then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks")) | |
331 | - | else if (if ((getNeutrinoLockedBalance(account) != 0)) | |
332 | - | then true | |
333 | - | else (getWavesLockedBalance(account) != 0)) | |
334 | - | then throw("please withdraw locked funds first") | |
335 | - | else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceNeutrinoLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))]) | |
325 | + | else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceNeutrinoLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))]) | |
336 | 326 | } | |
337 | 327 | ||
338 | 328 |
github/deemru/w8io/169f3d6 41.81 ms ◑