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