tx · 5J9AgoehVbjdbsJyy1CByt7Rwv2BgsGyCQNLymU9TTgT

3NC8bDSrGwMMns6n2mYd5TrSEkPAZPepGEX:  -0.01000000 Waves

2019.11.26 18:25 [782414] smart account 3NC8bDSrGwMMns6n2mYd5TrSEkPAZPepGEX > SELF 0.00000000 Waves

{ "type": 13, "id": "5J9AgoehVbjdbsJyy1CByt7Rwv2BgsGyCQNLymU9TTgT", "fee": 1000000, "feeAssetId": null, "timestamp": 1574782000071, "version": 1, "sender": "3NC8bDSrGwMMns6n2mYd5TrSEkPAZPepGEX", "senderPublicKey": "2jWihACLrvCBedhHPsZnkGC3kKxb619iK1EDjzj4zYoA", "proofs": [ "5e9FCFVMhko78qkiWmZqLb9o2TAK4cTgs27xPGKfALbzwVnA4uXobYmMpocE9djTWxVnS2q78GZVWHnY7iHBLoju" ], "script": "base64:AAIDAAAAAAAAABMIARIAEgASBAoCCAESABIDCgEIAAAASgEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAAAxnZXRCb29sQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBsAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAB0Jvb2xlYW4EAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEHAQAAABhnZXROdW1iZXJCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc3MAAAADa2V5BA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AAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleXpnN6I=", "chainId": 84, "height": 782414, "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 = 10
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 NodeOracleProviderKey = "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+func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block))
98+
99+
100+func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index))
101+
102+
103+let BalanceLocedkKey = "balance_lock_"
104+
105+let WavesLockedBalanceKey = (BalanceLocedkKey + "waves")
106+
107+let NeutrinoLockedBalanceKey = (BalanceLocedkKey + "neutrino")
108+
109+func getRPDSnapshotContractBalanceKey (count,assetId) = ((((RPDBalanceKey + "_") + toBase58String(assetId)) + "_") + toString(count))
110+
111+
112+func getCancelLeaseTxReserveFeeKey (hash) = (("cancel_lease_tx_reserve_fee" + "_") + hash)
113+
114+
115+func getWavesLockedBalanceKey (owner) = ((WavesLockedBalanceKey + "_") + owner)
116+
117+
118+func getNeutrinoLockedBalanceKey (owner) = ((NeutrinoLockedBalanceKey + "_") + owner)
119+
120+
121+func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner)
122+
123+
124+func getRPDProfitKey (count) = (("rpd_profit" + "_") + toString(count))
125+
126+
127+func convertNeutrinoToWaves (amount,price) = ((((amount * 100) / price) * WAVELET) / PAULI)
128+
129+
130+func convertWavesToNeutrino (amount,price) = ((((amount * price) / 100) * PAULI) / WAVELET)
131+
132+
133+func convertNeutrinoToBond (amount) = (amount / PAULI)
134+
135+
136+func convertBondToNeutrino (amount) = (amount * PAULI)
137+
138+
139+func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price))
140+
141+
142+let neutrinoLockedBalance = getNumberByKey(NeutrinoLockedBalanceKey)
143+
144+let wavesLockedBalance = getNumberByKey(WavesLockedBalanceKey)
145+
146+let liquidationContract = getStringByKey(LiquidationContractKey)
147+
148+let neutrinoAssetIdString = getStringByKey(NeutrinoAssetIdKey)
149+
150+let neutrinoAssetId = fromBase58String(neutrinoAssetIdString)
151+
152+let auctionContract = getStringByKey(AuctionContractKey)
153+
154+let rpdContract = getStringByKey(RPDContractKey)
155+
156+let controlContract = getStringByKey(ContolContractKey)
157+
158+let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
159+
160+let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey)
161+
162+let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey)
163+
164+let nodeOracleProvider = getStringByKey(NodeOracleProviderKey)
165+
166+let balanceWavesLockInterval = getNumberByKey(BalanceWavesLockIntervalKey)
167+
168+let balanceNeutrinoLockInterval = getNumberByKey(BalanceNeutrinoLockIntervalKey)
169+
170+let minWavesSwapAmount = getNumberByKey(MinWavesSwapAmountKey)
171+
172+let minNeutrinoSwapAmount = getNumberByKey(MinNeutrinoSwapAmountKey)
173+
174+let reserve = (wavesBalance(this) - wavesLockedBalance)
175+
176+let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey))
177+
178+let bondSupply = (extract(assetInfo(bondAssetId)).quantity - assetBalance(this, bondAssetId))
179+
180+let neutrinoSupply = ((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(this, neutrinoAssetId)) + neutrinoLockedBalance)
181+
182+let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply)
183+
184+let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice))
185+
186+func getRPDContractBalance (assetId) = getNumberByAddressAndKey(rpdContract, getRPDContractBalanceKey(assetId))
187+
188+
189+func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block))
190+
191+
192+func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index))
193+
194+
195+func getCancelLeaseTxReserveFee (hash) = getNumberByKey(getCancelLeaseTxReserveFeeKey(hash))
196+
197+
198+func getWavesLockedBalance (owner) = getNumberByKey(getWavesLockedBalanceKey(owner))
199+
200+
201+func getNeutrinoLockedBalance (owner) = getNumberByKey(getNeutrinoLockedBalanceKey(owner))
202+
203+
204+func getUnlockBalanceBlock (owner) = getNumberByKey(getBalanceUnlockBlockKey(owner))
205+
206+
207+func getRPDProfit (count) = getNumberByKey(getRPDProfitKey(count))
208+
209+
210+@Callable(i)
211+func swapWavesToNeutrino () = {
212+ let pmt = extract(i.payment)
213+ let account = toString(i.caller)
214+ if ((minWavesSwapAmount > pmt.amount))
215+ then throw((("The specified Waves amount is less than the required minimum of " + toString(minWavesSwapAmount)) + " wavelets."))
216+ else if (isDefined(pmt.assetId))
217+ then throw("Only Waves token is allowed for swapping.")
218+ else if (isBlocked)
219+ then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
220+ else if ((getUnlockBalanceBlock(account) > height))
221+ then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks"))
222+ else if (if ((getNeutrinoLockedBalance(account) != 0))
223+ then true
224+ else (getWavesLockedBalance(account) != 0))
225+ then throw("please withdraw locked funds first")
226+ else WriteSet([DataEntry(getWavesLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceWavesLockInterval)), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance + pmt.amount))])
227+ }
228+
229+
230+
231+@Callable(i)
232+func swapNeutrinoToWaves () = {
233+ let pmt = extract(i.payment)
234+ let account = toString(i.caller)
235+ if ((minNeutrinoSwapAmount > pmt.amount))
236+ then throw((("The specified Neutrino amount is less than the required minimum of " + toString(minNeutrinoSwapAmount)) + " Neutrino cents."))
237+ else if (isBlocked)
238+ then throw("The contract is blocked by EMERGENCY SHUTDOWN. Please wait for reactivation by emergency oracles.")
239+ else if ((pmt.assetId != neutrinoAssetId))
240+ then throw("Only appropriate Neutrino tokens are allowed for swapping.")
241+ else if ((getUnlockBalanceBlock(account) > height))
242+ then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks"))
243+ else if (if ((getNeutrinoLockedBalance(account) != 0))
244+ then true
245+ else (getWavesLockedBalance(account) != 0))
246+ then throw("please withdraw locked funds first")
247+ else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceNeutrinoLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))])
248+ }
249+
250+
251+
252+@Callable(i)
253+func withdraw (account,index) = {
254+ let unlockHeight = getUnlockBalanceBlock(account)
255+ let userWavesLockedBalance = getWavesLockedBalance(account)
256+ let userNeutrinoLockedBalance = getNeutrinoLockedBalance(account)
257+ let indexHeight = getHeightPriceByIndex(index)
258+ let prevIndexHeight = getHeightPriceByIndex((index - 1))
259+ let priceByIndex = getPriceHistory(indexHeight)
260+ let neutrinoAmount = convertWavesToNeutrino(userWavesLockedBalance, priceByIndex)
261+ let wavesAmount = convertNeutrinoToWaves(userNeutrinoLockedBalance, priceByIndex)
262+ if (isBlocked)
263+ then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
264+ else if ((unlockHeight > height))
265+ then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw WAVES funds"))
266+ else if (if (if ((index > priceIndex))
267+ then true
268+ else (unlockHeight > indexHeight))
269+ then true
270+ else if ((prevIndexHeight != 0))
271+ then (prevIndexHeight >= unlockHeight)
272+ else false)
273+ then throw("invalid price history index")
274+ else if (if ((0 >= neutrinoAmount))
275+ then (0 >= wavesAmount)
276+ else false)
277+ then throw("balance equals zero")
278+ 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)]))
279+ }
280+
281+
282+
283+@Callable(i)
284+func transferToAuction () = {
285+ let deficitBondAmount = (convertNeutrinoToBond(deficit) - assetBalance(addressFromStringValue(auctionContract), bondAssetId))
286+ let surplusBond = (convertNeutrinoToBond(surplus) - assetBalance(addressFromStringValue(auctionContract), neutrinoAssetId))
287+ if (isBlocked)
288+ then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
289+ else if (if ((deficitBondAmount >= ((convertNeutrinoToBond(neutrinoSupply) * DEFICITOFFSET) / 100)))
290+ then (deficitBondAmount > 0)
291+ else false)
292+ then TransferSet([ScriptTransfer(addressFromStringValue(auctionContract), deficitBondAmount, bondAssetId)])
293+ else if ((surplusBond > 0))
294+ then TransferSet([ScriptTransfer(addressFromStringValue(liquidationContract), convertBondToNeutrino(surplusBond), neutrinoAssetId)])
295+ else throw(((((("bond were generated or do not need it. Deficit:" + toString(deficitBondAmount)) + "|") + toString(((neutrinoSupply * DEFICITOFFSET) / 100))) + ". Surplus:") + toString(surplusBond)))
296+ }
297+
298+
299+
300+@Callable(i)
301+func transfer (account) = {
302+ let pmt = extract(i.payment)
303+ TransferSet([ScriptTransfer(addressFromStringValue(account), pmt.amount, pmt.assetId)])
304+ }
305+
306+
307+@Verifier(tx)
308+func verify () = {
309+ let id = toBase58String(tx.id)
310+ match tx {
311+ case leasingTx: LeaseCancelTransaction|LeaseTransaction =>
312+ if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
313+ then (addressFromString(nodeOracleProvider) == addressFromPublicKey(tx.senderPublicKey))
314+ else false
315+ case _ =>
316+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
317+ }
318+ }
319+

github/deemru/w8io/169f3d6 
29.72 ms