tx · FmcSShp11Jn53bLod3VWFP3PAWSSVmA5Fp2ckkNFuYAf

3N17PhN8YLq5Row4ahN1FMsN8RGBSv4zVTg:  -0.01000000 Waves

2019.12.24 16:11 [823126] smart account 3N17PhN8YLq5Row4ahN1FMsN8RGBSv4zVTg > SELF 0.00000000 Waves

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

github/deemru/w8io/026f985 
42.30 ms