tx · 5tvS7VAUjvwuKqerD7NfKzHXJmbkGhdbbVotGRcYYAK3

3N5tfoZp5GbnEUEAyDWCmmjga5HzjXsEQYc:  -0.01000000 Waves

2020.09.15 16:40 [1178467] smart account 3N5tfoZp5GbnEUEAyDWCmmjga5HzjXsEQYc > SELF 0.00000000 Waves

{ "type": 13, "id": "5tvS7VAUjvwuKqerD7NfKzHXJmbkGhdbbVotGRcYYAK3", "fee": 1000000, "feeAssetId": null, "timestamp": 1600177265910, "version": 1, "sender": "3N5tfoZp5GbnEUEAyDWCmmjga5HzjXsEQYc", "senderPublicKey": "6MkpE9AJLFB8Hmka2ZhMmsuAsq2D49KudgE164EtYs9A", "proofs": [ "2WAqD7Yh1ieyDvFM96mTUgegiZBKp7smCi75emJyCD76uwe1CbVMsxzzNmrie2rPU78PQmEdw6VmMLw7ErEymzYx" ], "script": "base64:AAIDAAAAAAAAACsIARIHCgUICAgICBIHCgUBAQEBBBIDCgEIEgUKAwgICBIAEgASAwoBCBIAAAAAOgAAAAAHQlVMTEtleQIAAAAGQlVMTElkAAAAAAdCRUFSS2V5AgAAAAZCRUFSSWQAAAAADG1haW5Ub2tlbktleQIAAAALbWFpblRva2VuSWQAAAAAEmlzc3VlUGVyY2VudGlsZUtleQIAAAAPaXNzdWVQZXJjZW50aWxlAAAAABNyZWRlZW1QZXJjZW50aWxlS2V5AgAAABByZWRlZW1QZXJjZW50aWxlAAAAAAttaW5Jc3N1ZUtleQIAAAAIbWluSXNzdWUAAAAADG1pblJlZGVlbUtleQIAAAAJbWluUmVkZWVtAAAAABB3aGl0ZWxpc3RPbmx5S2V5AgAAAA13aGl0ZWxpc3RPbmx5AAAAAAtvcmFjbGVQS0tleQIAAAAGb3JhY2xlAAAAABFsYXN0UHJpY2VJbmRleEtleQIAAAALcHJpY2VfaW5kZXgAAAAAEHByaWNlSW5kZXhQcmVmaXgCAAAADHByaWNlX2luZGV4XwAAAAARcHJpY2VIZWlnaHRQcmVmaXgCAAAABnByaWNlXwAAA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IBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPZGFlbW9uUHVibGljS2V5BAAAAAtmZWVzQ29ycmVjdAMJAAAAAAAAAggFAAAAAnR4AAAACmZlZUFzc2V0SWQFAAAABHVuaXQJAABnAAAAAgAAAAAAAA9CQAgFAAAAAnR4AAAAA2ZlZQcEAAAAC2RhcHBDb3JyZWN0CQAAAAAAAAIIBQAAAAJ0eAAAAARkQXBwBQAAAApycGRBZGRyZXNzBAAAAAZ1bmxvY2sJAAAAAAAAAggFAAAAAnR4AAAACGZ1bmN0aW9uAgAAAA51bmxvY2tOZXV0cmlubwQAAAAEbG9jawMDCQAAAAAAAAIIBQAAAAJ0eAAAAAhmdW5jdGlvbgIAAAAObG9ja05ldXRyaW5vU1AJAAAAAAAAAgkAAZEAAAACCAUAAAACdHgAAAAEYXJncwAAAAAAAAAAAAUAAAAOc3Rha2luZ0FkZHJlc3MHCQAAZgAAAAIJAQAAAAx3YXZlc0JhbGFuY2UAAAABBQAAAAR0aGlzAAAAAAAF9eEABwQAAAALZnVuY0NvcnJlY3QDBQAAAARsb2NrBgUAAAAGdW5sb2NrAwMDBQAAAA9zaWduZWRDb3JyZWN0bHkFAAAAC2ZlZXNDb3JyZWN0BwUAAAALZGFwcENvcnJlY3QHBQAAAAtmdW5jQ29ycmVjdAcHAwUAAAALYWRtaW5BY3Rpb24GBQAAAA1zdGFraW5nQWN0aW9uoSRBOg==", "chainId": 84, "height": 1178467, "applicationStatus": "succeeded", "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+let BULLKey = "BULLId"
5+
6+let BEARKey = "BEARId"
7+
8+let mainTokenKey = "mainTokenId"
9+
10+let issuePercentileKey = "issuePercentile"
11+
12+let redeemPercentileKey = "redeemPercentile"
13+
14+let minIssueKey = "minIssue"
15+
16+let minRedeemKey = "minRedeem"
17+
18+let whitelistOnlyKey = "whitelistOnly"
19+
20+let oraclePKKey = "oracle"
21+
22+let lastPriceIndexKey = "price_index"
23+
24+let priceIndexPrefix = "price_index_"
25+
26+let priceHeightPrefix = "price_"
27+
28+let oracleCurrentPriceIndexKey = "price_index"
29+
30+let lastRebalancePriceIndexKey = "lastSettlementPriceId"
31+
32+let bullCollateralKey = "bullCollateral"
33+
34+let bearCollateralKey = "bearCollateral"
35+
36+let bullCirculationKey = "bullCirculation"
37+
38+let bearCirculationKey = "bearCirculation"
39+
40+let whitelistKey = "issueWhiteList"
41+
42+let whitelist = valueOrErrorMessage(getString(this, whitelistKey), "no bullCollateralKey")
43+
44+let bullCol = valueOrErrorMessage(getInteger(this, bullCollateralKey), "no bullCollateralKey")
45+
46+let bearCol = valueOrErrorMessage(getInteger(this, bearCollateralKey), "no bearCollateralKey")
47+
48+let bullCirc = valueOrErrorMessage(getInteger(this, bullCirculationKey), "no bullCirculationKey")
49+
50+let bearCirc = valueOrErrorMessage(getInteger(this, bearCirculationKey), "no bearCirculationKey")
51+
52+let BULL = valueOrErrorMessage(getString(this, BULLKey), "no BULLKey")
53+
54+let BEAR = valueOrErrorMessage(getString(this, BEARKey), "no BEARKey")
55+
56+let mainToken = valueOrErrorMessage(getString(this, mainTokenKey), "no mainTokenKey")
57+
58+let issuePercentile = valueOrErrorMessage(getInteger(this, issuePercentileKey), "no issuePercentileKey")
59+
60+let redeemPercentile = valueOrErrorMessage(getInteger(this, redeemPercentileKey), "no redeemPercentileKey")
61+
62+let minIssue = valueOrErrorMessage(getInteger(this, minIssueKey), "no minIssueKey")
63+
64+let minRedeem = valueOrErrorMessage(getInteger(this, minRedeemKey), "no minRedeemKey")
65+
66+let whitelistOnly = valueOrErrorMessage(getBoolean(this, whitelistOnlyKey), "no whitelistOnlyKey")
67+
68+let oracle = valueOrErrorMessage(addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, oraclePKKey), "no oraclePKKey"))), "bad oracle address")
69+
70+let rebalancedPriceIndex = valueOrErrorMessage(getInteger(this, lastRebalancePriceIndexKey), "no last rebalance price")
71+
72+let oraclePriceIndex = valueOrErrorMessage(getInteger(oracle, lastPriceIndexKey), ((("bad oracle data at " + toString(oracle)) + ": no integer at ") + lastPriceIndexKey))
73+
74+let headPointerKey = "headPointer"
75+
76+let tailPointerKey = "tailPointer"
77+
78+let queueSizeKey = "queueSize"
79+
80+let queueSize = match getInteger(this, queueSizeKey) {
81+ case i: Int =>
82+ i
83+ case _ =>
84+ 0
85+}
86+
87+let headPointer = match getString(this, headPointerKey) {
88+ case s: String =>
89+ s
90+ case _ =>
91+ ""
92+}
93+
94+let tailPointer = match getString(this, tailPointerKey) {
95+ case s: String =>
96+ s
97+ case _ =>
98+ ""
99+}
100+
101+let feesAccumulatedKey = "feesAccumulated"
102+
103+let feesAccumulated = match getInteger(this, feesAccumulatedKey) {
104+ case i: Int =>
105+ i
106+ case _ =>
107+ 0
108+}
109+
110+let ISSUE = "ISSUE"
111+
112+let REDEEM = "REDEEM"
113+
114+let feeAddrKey = "feeAddress"
115+
116+let stakingAddrKey = "stakingAddress"
117+
118+let daemonPubKeyKey = "daemonPublicKey"
119+
120+let feeAddress = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, feeAddrKey), "no feeAddress")), "bad feeAddress")
121+
122+let stakingAddress = valueOrErrorMessage(getString(this, stakingAddrKey), "no stakingAddress")
123+
124+let daemonPublicKey = fromBase58String(valueOrErrorMessage(getString(this, daemonPubKeyKey), "no daemonPublicKey"))
125+
126+let rpdAddress = addressFromString("3PNikM6yp4NqcSU8guxQtmR5onr2D4e8yTJ")
127+
128+let pubKeyAdminsList = ["ura", "5ZXe82RRASU7qshXM2J9JNYhqJ9GWYjjVq2gwUV5Naz9", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
129+
130+func buildNewItem (action,amt,token,priceIndex,invoker) = (((((((((action + "|") + toString(amt)) + "|") + token) + "|") + toString(priceIndex)) + "|") + invoker) + "|")
131+
132+
133+func validateEnqueue (inv) = if ((inv.caller == this))
134+ then throw("can't do")
135+ else {
136+ func errorMessage (got) = throw(((((("only BULL(" + BULL) + ") or BEAR(") + BEAR) + ") tokens are accepted, received: ") + got))
137+
138+ if (!(isDefined(inv.payment)))
139+ then errorMessage("no attached payment")
140+ else {
141+ let assetId = toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "waves are not accepted here"))
142+ if (if ((assetId != BEAR))
143+ then (assetId != BULL)
144+ else false)
145+ then errorMessage(assetId)
146+ else {
147+ let attachedAmount = value(inv.payment).amount
148+ let col = if ((assetId == BEAR))
149+ then bearCol
150+ else bullCol
151+ let circ = if ((assetId == BEAR))
152+ then bearCirc
153+ else bullCirc
154+ let estimated = fraction(col, attachedAmount, circ)
155+ if ((minRedeem > estimated))
156+ then throw((((((((((("Attached payment too small. Min redeem amount is " + toString((minRedeem / 1000000))) + " USDN, ") + "attached amount: ") + toString(attachedAmount)) + ", col: ") + toString(col)) + ", circ: ") + toString(circ)) + ", estimated: ") + toString(estimated)))
157+ else unit
158+ }
159+ }
160+ }
161+
162+
163+func enqueue (id,action,amt,token,priceIndex,invoker) = {
164+ let increaseQueueSize = DataEntry(queueSizeKey, (queueSize + 1))
165+ let itm = buildNewItem(action, amt, token, priceIndex, invoker)
166+ if ((queueSize == 0))
167+ then WriteSet([DataEntry(headPointerKey, id), DataEntry(tailPointerKey, id), DataEntry(id, itm), increaseQueueSize])
168+ else {
169+ let prevId = valueOrErrorMessage(getString(this, tailPointerKey), "can't get tail pointer")
170+ let prevItm = split(valueOrErrorMessage(getString(this, prevId), "can't resolve pointer"), "|")
171+ let updatedPrevItm = ((((((((((prevItm[0] + "|") + prevItm[1]) + "|") + prevItm[2]) + "|") + prevItm[3]) + "|") + prevItm[4]) + "|") + id)
172+ WriteSet([DataEntry(prevId, updatedPrevItm), DataEntry(id, itm), DataEntry(tailPointerKey, id), increaseQueueSize])
173+ }
174+ }
175+
176+
177+func dequeue () = if ((queueSize == 0))
178+ then throw("nothing to settle")
179+ else {
180+ func collectFee (fees) = DataEntry(feesAccumulatedKey, (feesAccumulated + fees))
181+
182+ let decreaseQueueSize = DataEntry(queueSizeKey, (queueSize - 1))
183+ let isLastElement = (headPointer == tailPointer)
184+ let overwriteTail = DataEntry(tailPointerKey, "")
185+ let data = split(valueOrErrorMessage(getString(this, headPointer), "bad head pointer"), "|")
186+ let action = data[0]
187+ let amt = parseIntValue(data[1])
188+ let token = data[2]
189+ let priceIndex = parseIntValue(data[3])
190+ let invoker = addressFromStringValue(data[4])
191+ let next = data[5]
192+ if ((rebalancedPriceIndex > priceIndex))
193+ then throw(((("corrupt state, rebalancedPriceIndex=" + toString(rebalancedPriceIndex)) + ", request price id=") + toString(priceIndex)))
194+ else if ((priceIndex > rebalancedPriceIndex))
195+ then throw("can't dequeue, too early, rebalance first")
196+ else if ((action == ISSUE))
197+ then {
198+ let feeSize = fraction(amt, issuePercentile, 10000)
199+ let addedCollateral = (amt - feeSize)
200+ if ((token == BULL))
201+ then {
202+ let addedToCirculation = fraction(bullCirc, addedCollateral, bullCol)
203+ let items = [DataEntry(bullCollateralKey, (bullCol + addedCollateral)), DataEntry(bullCirculationKey, (bullCirc + addedToCirculation)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize]
204+ ScriptResult(WriteSet(if (isLastElement)
205+ then overwriteTail :: items
206+ else items), TransferSet([ScriptTransfer(invoker, addedToCirculation, fromBase58String(BULL))]))
207+ }
208+ else if ((token == BEAR))
209+ then {
210+ let addedToCirculation = fraction(bearCirc, addedCollateral, bearCol)
211+ let items = [DataEntry(bearCollateralKey, (bearCol + addedCollateral)), DataEntry(bearCirculationKey, (bearCirc + addedToCirculation)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize]
212+ ScriptResult(WriteSet(if (isLastElement)
213+ then overwriteTail :: items
214+ else items), TransferSet([ScriptTransfer(invoker, addedToCirculation, fromBase58String(BEAR))]))
215+ }
216+ else throw("bad token id")
217+ }
218+ else if ((action == REDEEM))
219+ then {
220+ let removedTokens = amt
221+ if ((token == BULL))
222+ then {
223+ let removedCollateral = fraction(bullCol, removedTokens, bullCirc)
224+ let feeSize = fraction(removedCollateral, redeemPercentile, 10000)
225+ let payout = if ((removedCollateral > feeSize))
226+ then (removedCollateral - feeSize)
227+ else 0
228+ let items = [DataEntry(bullCollateralKey, (bullCol - removedCollateral)), DataEntry(bullCirculationKey, (bullCirc - removedTokens)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize]
229+ ScriptResult(WriteSet(if (isLastElement)
230+ then overwriteTail :: items
231+ else items), TransferSet([ScriptTransfer(invoker, payout, fromBase58String(mainToken))]))
232+ }
233+ else if ((token == BEAR))
234+ then {
235+ let removedCollateral = fraction(bearCol, removedTokens, bearCirc)
236+ let feeSize = fraction(removedCollateral, redeemPercentile, 10000)
237+ let payout = if ((removedCollateral > feeSize))
238+ then (removedCollateral - feeSize)
239+ else 0
240+ let items = [DataEntry(bearCollateralKey, (bearCol - removedCollateral)), DataEntry(bearCirculationKey, (bearCirc - removedTokens)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize]
241+ ScriptResult(WriteSet(if (isLastElement)
242+ then overwriteTail :: items
243+ else items), TransferSet([ScriptTransfer(invoker, payout, fromBase58String(mainToken))]))
244+ }
245+ else throw("bad token id")
246+ }
247+ else throw(("bad action: " + action))
248+ }
249+
250+
251+func rebalance () = {
252+ func LV (v,p0,p1) = {
253+ let denom = 100
254+ let pmax = ((if ((p1 > p0))
255+ then p1
256+ else p0) / denom)
257+ let pmin = ((if ((p0 > p1))
258+ then p1
259+ else p0) / denom)
260+ let a = (pmin * pmin)
261+ let b = (((9 * pmax) * pmax) - ((15 * pmax) * pmin))
262+ fraction(v, ((6 * a) + b), ((7 * a) + b))
263+ }
264+
265+ let settledPriceIndex = valueOrErrorMessage(getInteger(this, lastRebalancePriceIndexKey), "inconsistent data")
266+ let unsettledPriceIndex = (settledPriceIndex + 1)
267+ let settledPriceHeight = valueOrErrorMessage(getInteger(oracle, ("price_index_" + toString(settledPriceIndex))), "bad oracle data for settled price height")
268+ let settledPrice = valueOrErrorMessage(getInteger(oracle, ("price_" + toString(settledPriceHeight))), "bad oracle data for price")
269+ let nextPriceHeight = valueOrErrorMessage(getInteger(oracle, ("price_index_" + toString(unsettledPriceIndex))), "no next price height")
270+ let nextPrice = valueOrErrorMessage(getInteger(oracle, ("price_" + toString(nextPriceHeight))), "no next price")
271+ let minVol = if ((bearCol > bullCol))
272+ then bullCol
273+ else bearCol
274+ let redist = LV(minVol, settledPrice, nextPrice)
275+ if ((nextPrice > settledPrice))
276+ then WriteSet([DataEntry(bullCollateralKey, (bullCol + redist)), DataEntry(bearCollateralKey, (bearCol - redist)), DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
277+ else if ((settledPrice > nextPrice))
278+ then WriteSet([DataEntry(bullCollateralKey, (bullCol - redist)), DataEntry(bearCollateralKey, (bearCol + redist)), DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
279+ else WriteSet([DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
280+ }
281+
282+
283+@Callable(inv)
284+func init (bullId,bearId,mainTokenId,oraclePK,whitelisted) = if (isDefined(getString(this, BULLKey)))
285+ then throw("already initialized")
286+ else if (!(isDefined(inv.payment)))
287+ then throw("neutrino payment required")
288+ else if ((toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "neutrino payment required")) != mainTokenId))
289+ then throw("payment not in neutrino")
290+ else {
291+ let totalOwnedMainToken = value(inv.payment).amount
292+ let bulls = (totalOwnedMainToken / 2)
293+ let bears = (totalOwnedMainToken - bulls)
294+ if (if ((bears == 0))
295+ then true
296+ else (bulls == 0))
297+ then throw("can't init balances")
298+ else {
299+ let oracleCurrentPriceIndex = valueOrErrorMessage(getInteger(valueOrErrorMessage(addressFromPublicKey(fromBase58String(oraclePK)), "bad oracle address"), lastPriceIndexKey), "can't find last oracle price index")
300+ ScriptResult(WriteSet([DataEntry(BULLKey, bullId), DataEntry(BEARKey, bearId), DataEntry(mainTokenKey, mainTokenId), DataEntry(oraclePKKey, oraclePK), DataEntry(bullCollateralKey, bulls), DataEntry(bearCollateralKey, bears), DataEntry(bullCirculationKey, bulls), DataEntry(bearCirculationKey, bears), DataEntry(lastRebalancePriceIndexKey, oracleCurrentPriceIndex), DataEntry(whitelistKey, whitelisted), DataEntry(issuePercentileKey, 0), DataEntry(redeemPercentileKey, 0), DataEntry(minIssueKey, 0), DataEntry(minRedeemKey, 0), DataEntry(whitelistOnlyKey, true)]), TransferSet([ScriptTransfer(inv.caller, bulls, fromBase58String(bullId)), ScriptTransfer(inv.caller, bears, fromBase58String(bearId))]))
301+ }
302+ }
303+
304+
305+
306+@Callable(i)
307+func setParams (iP,rP,mI,mR,wl) = if ((i.caller != this))
308+ then throw("only self can change whitelist")
309+ else WriteSet([DataEntry(issuePercentileKey, iP), DataEntry(redeemPercentileKey, rP), DataEntry(minIssueKey, mI), DataEntry(minRedeemKey, mR), DataEntry(whitelistOnlyKey, wl)])
310+
311+
312+
313+@Callable(i)
314+func setWhitelist (l) = if ((i.caller != this))
315+ then throw("only self can change whitelist")
316+ else WriteSet([DataEntry(whitelistKey, l)])
317+
318+
319+
320+@Callable(i)
321+func setAddresses (feeAddr,stakingAddr,daemonPK) = if ((i.caller != this))
322+ then throw("only self can change feeAcc addresses")
323+ else WriteSet([DataEntry(feeAddrKey, feeAddr), DataEntry(stakingAddrKey, stakingAddr), DataEntry(daemonPubKeyKey, daemonPK)])
324+
325+
326+
327+@Callable(i)
328+func withdrawFee () = ScriptResult(WriteSet([DataEntry(feesAccumulatedKey, 0)]), TransferSet([ScriptTransfer(feeAddress, feesAccumulated, fromBase58String(mainToken))]))
329+
330+
331+
332+@Callable(inv)
333+func requestRedeem () = if ((validateEnqueue(inv) == unit))
334+ then {
335+ let assetId = toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "waves are not accepted here"))
336+ enqueue(toBase58String(inv.transactionId), REDEEM, value(inv.payment).amount, assetId, (oraclePriceIndex + 1), toString(inv.caller))
337+ }
338+ else throw("doesn't happen")
339+
340+
341+
342+@Callable(inv)
343+func requestIssue (tokenId) = if ((inv.caller == this))
344+ then throw("can't do")
345+ else if (if (whitelistOnly)
346+ then !(isDefined(indexOf(whitelist, toString(inv.caller))))
347+ else false)
348+ then throw("only whitelisted can do")
349+ else {
350+ let errorMessage = throw((((((("only BULL(" + BULL) + ") or BEAR(") + BEAR) + ") tokens are available in exchange for USDN(") + mainToken) + ")"))
351+ if (if ((tokenId != BULL))
352+ then (tokenId != BEAR)
353+ else false)
354+ then errorMessage
355+ else if (!(isDefined(inv.payment)))
356+ then errorMessage
357+ else if ((value(inv.payment).assetId != fromBase58String(mainToken)))
358+ then errorMessage
359+ else if ((minIssue > value(inv.payment).amount))
360+ then throw((("Attached payment too small. Min required: " + toString((minIssue / 1000000))) + " USDN"))
361+ else enqueue(toBase58String(inv.transactionId), ISSUE, value(inv.payment).amount, tokenId, (oraclePriceIndex + 1), toString(inv.caller))
362+ }
363+
364+
365+
366+@Callable(inv)
367+func settle () = {
368+ let queueEmpty = (headPointer == "")
369+ let canRebalance = (oraclePriceIndex > rebalancedPriceIndex)
370+ if (queueEmpty)
371+ then if (canRebalance)
372+ then rebalance()
373+ else throw("[OK] all done, carry on")
374+ else {
375+ let data = split(valueOrErrorMessage(getString(this, headPointer), "bad head pointer"), "|")
376+ let priceIndex = parseIntValue(data[3])
377+ if ((priceIndex > rebalancedPriceIndex))
378+ then if (canRebalance)
379+ then rebalance()
380+ else throw("[OK] need to wait")
381+ else if ((priceIndex == rebalancedPriceIndex))
382+ then dequeue()
383+ else throw("corrupt data, future price id already rebalanced")
384+ }
385+ }
386+
387+
388+@Verifier(tx)
389+func verify () = {
390+ let adminAction = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
391+ then 1
392+ else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
393+ then 1
394+ else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
395+ then 1
396+ else 0)) >= 1)
397+ let stakingAction = match tx {
398+ case tx: InvokeScriptTransaction =>
399+ let signedCorrectly = sigVerify(tx.bodyBytes, tx.proofs[0], daemonPublicKey)
400+ let feesCorrect = if ((tx.feeAssetId == unit))
401+ then (1000000 >= tx.fee)
402+ else false
403+ let dappCorrect = (tx.dApp == rpdAddress)
404+ let unlock = (tx.function == "unlockNeutrino")
405+ let lock = if (if ((tx.function == "lockNeutrinoSP"))
406+ then (tx.args[0] == stakingAddress)
407+ else false)
408+ then (wavesBalance(this) > 100000000)
409+ else false
410+ let funcCorrect = if (lock)
411+ then true
412+ else unlock
413+ if (if (if (signedCorrectly)
414+ then feesCorrect
415+ else false)
416+ then dappCorrect
417+ else false)
418+ then funcCorrect
419+ else false
420+ case _ =>
421+ false
422+ }
423+ if (adminAction)
424+ then true
425+ else stakingAction
426+ }
427+

github/deemru/w8io/026f985 
48.87 ms