tx · BNksmBfsvFo3wKhqhpG7cR2v3R84wAddhAmrLbQo9QCR

3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8:  -0.01000000 Waves

2022.04.04 15:44 [1993858] smart account 3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8 > SELF 0.00000000 Waves

{ "type": 13, "id": "BNksmBfsvFo3wKhqhpG7cR2v3R84wAddhAmrLbQo9QCR", "fee": 1000000, "feeAssetId": null, "timestamp": 1649076246754, "version": 2, "chainId": 84, "sender": "3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8", "senderPublicKey": "4ja2PX5eqM576zv9KGzu5Qe7M92Z3jbuSmkLPdGjK4ue", "proofs": [ "5H2KA39BePG55Qi4xAQbdnh6Tu2Wjy5uDH6pyJ2nBmbHFgqKJTcF2cJdbh9x4daa3ULbCrXaZrB7a7eKgUChu3w" ], "script": "base64:AAIFAAAAAAAAABAIAhIICgYYGBERGAESABIAAAAAIAAAAAAHa0FjdGl2ZQIAAAAGYWN0aXZlAAAAAAZrQ2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAAtrUm91dGluZ0ZlZQIAAAALcm91dGluZ19mZWUAAAAADWtBZG1pblB1YktleTECAAAAC2FkbWluX3B1Yl8xAAAAAA1rQWRtaW5QdWJLZXkyAgAAAAthZG1pbl9wdWJfMgAAAAANa0FkbWluUHViS2V5MwIAAAALYWRtaW5fcHViXzMAAAAAEGtNb25leUJveEFkZHJlc3MCAAAAEW1vbmV5X2JveF9hZGRyZXNzAAAAAA1rUG9vbEluT3JhY2xlAgAAAAVwb29sXwAAAAAHZGlnaXRzOAAAAAAAAAAACAAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAdzY2FsZTE2AAAjhvJvwQAAAAAAAAVhbHBoYQAAAAAAAAAAMgAAAAALYWxwaGFEaWdpdHMAAAAAAAAAAAIAAAAABGJldGEAABBXrPX3gAAAAAAACmNvbW1pc3Npb24AAAAAAAAAC7gAAAAAGGNvbW1pc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AAATbXVsdGlTaWduZWRCeUFkbWlucwQAAAASYWRtaW5QdWJLZXkxU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADGFkbWluUHViS2V5MQAAAAAAAAAAAQAAAAAAAAAAAAQAAAASYWRtaW5QdWJLZXkyU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEFAAAADGFkbWluUHViS2V5MgAAAAAAAAAAAQAAAAAAAAAAAAQAAAASYWRtaW5QdWJLZXkzU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIFAAAADGFkbWluUHViS2V5MwAAAAAAAAAAAQAAAAAAAAAAAAkAAGcAAAACCQAAZAAAAAIJAABkAAAAAgUAAAASYWRtaW5QdWJLZXkxU2lnbmVkBQAAABJhZG1pblB1YktleTJTaWduZWQFAAAAEmFkbWluUHViS2V5M1NpZ25lZAAAAAAAAAAAAgQAAAAHJG1hdGNoMAUAAAACdHgFAAAAE211bHRpU2lnbmVkQnlBZG1pbnMuPHkK", "height": 1993858, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: AGf5gH31wVmghTYnEYRiYE8sxUGvwXCudkWSEQALvWqj Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let kActive = "active"
5+
6+let kCause = "shutdown_cause"
7+
8+let kRoutingFee = "routing_fee"
9+
10+let kAdminPubKey1 = "admin_pub_1"
11+
12+let kAdminPubKey2 = "admin_pub_2"
13+
14+let kAdminPubKey3 = "admin_pub_3"
15+
16+let kMoneyBoxAddress = "money_box_address"
17+
18+let kPoolInOracle = "pool_"
19+
20+let digits8 = 8
21+
22+let scale8 = 100000000
23+
24+let scale16 = 10000000000000000
25+
26+let alpha = 50
27+
28+let alphaDigits = 2
29+
30+let beta = 4600000000000000
31+
32+let commission = 3000
33+
34+let commissionScaleDelimiter = 1000000
35+
36+let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
37+
38+func getBase58FromOracle (key) = match getString(oracle, key) {
39+ case string: String =>
40+ fromBase58String(string)
41+ case nothing =>
42+ throw((key + "is empty"))
43+}
44+
45+
46+let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
47+
48+let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
49+
50+let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
51+
52+let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress))
53+
54+let active = valueOrElse(getBoolean(this, kActive), true)
55+
56+let routingFee = valueOrErrorMessage(getInteger(oracle, kRoutingFee), "routing_fee is empty")
57+
58+let feeScale6 = 1000000
59+
60+func isActive () = if (active)
61+ then unit
62+ else throw("DApp is inactive at this moment")
63+
64+
65+func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
66+ then unit
67+ else throw("Only admin can call this function")
68+
69+
70+func throwIsActive () = throw("DApp is already active")
71+
72+
73+func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
74+
75+
76+func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2)
77+
78+
79+func invariantCalc (x,y) = {
80+ let sk = skewness(x, y)
81+ (fraction((x + y), scale16, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(x), toBigInt(y), toBigInt(scale8)), 0, toBigInt(5), 1, (digits8 / 2), DOWN)), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8)))
82+ }
83+
84+
85+func checkPossibility (pmtAmount,minAmountToReceive,exchangers,exchangersType,routingAssetsKeys,args1,args2) = {
86+ let dApp1TokenPay = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[0])
87+ let dApp1TokenGet = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[1])
88+ let dApp2TokenPay = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[2])
89+ let dApp2TokenGet = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[3])
90+ let getFrom1TradeWithFee = if ((exchangersType[0] == "cpmm"))
91+ then {
92+ let getFrom1TradeWithoutFee = fraction(dApp1TokenGet, pmtAmount, (pmtAmount + dApp1TokenPay))
93+ fraction(getFrom1TradeWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
94+ }
95+ else if ((exchangersType[0] == "flat"))
96+ then {
97+ let invariant = invariantCalc(dApp1TokenPay, dApp1TokenGet)
98+ let minAmountToReceive1 = args2[0]
99+ let invariantNew = invariantCalc((dApp1TokenPay + pmtAmount), (dApp1TokenGet - minAmountToReceive1))
100+ if ((invariantNew >= invariant))
101+ then minAmountToReceive1
102+ else throw("Flat contract: invariantNew < invariant")
103+ }
104+ else throw("Incorrect exchange type")
105+ let getFrom2TradeWithFee = if ((exchangersType[1] == "cpmm"))
106+ then {
107+ let getFrom2TradeWithoutFee = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay))
108+ fraction(getFrom2TradeWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
109+ }
110+ else if ((exchangersType[1] == "flat"))
111+ then {
112+ let invariant = invariantCalc(dApp2TokenPay, dApp2TokenGet)
113+ let minAmountToReceive2 = args2[1]
114+ let invariantNew = invariantCalc((dApp2TokenPay + getFrom1TradeWithFee), (dApp2TokenGet - minAmountToReceive2))
115+ if ((invariantNew >= invariant))
116+ then minAmountToReceive2
117+ else throw("Flat contract: invariantNew < invariant")
118+ }
119+ else throw("Incorrect exchange type")
120+ (getFrom2TradeWithFee >= minAmountToReceive)
121+ }
122+
123+
124+@Callable(i)
125+func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive) = valueOrElse(isActive(), {
126+ let $t052895363 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
127+ let pmtAmount = $t052895363._1
128+ let pmtAssetId = $t052895363._2
129+ if (!(checkPossibility(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
130+ then throw("Check transaction possibilty: declined")
131+ else if (if (!(isDefined(getString(oracle, (kPoolInOracle + exchangers[0])))))
132+ then true
133+ else !(isDefined(getString(oracle, (kPoolInOracle + exchangers[1])))))
134+ then throw("Pool is not in oracle")
135+ else {
136+ let routingSize = size(exchangers)
137+ func exchangeFold (accumulated,exchanger) = {
138+ let $t058675932 = accumulated
139+ let exchangeCounter = $t058675932._1
140+ let amountsWithFee = $t058675932._2
141+ let assetsIdSend = $t058675932._3
142+ let $t059456143 = if ((exchangeCounter == 0))
143+ then $Tuple2(pmtAssetId, pmtAmount)
144+ else $Tuple2(assetsIdSend, amountsWithFee)
145+ let pmtAssetIdRout = $t059456143._1
146+ let pmtAmountRout = $t059456143._2
147+ if (((if ((exchangeCounter >= 0))
148+ then (routingSize > exchangeCounter)
149+ else false) == true))
150+ then {
151+ let exchangerAddress = addressFromStringValue(exchanger)
152+ let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
153+ then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
154+ else if ((exchangersType[exchangeCounter] == "flat"))
155+ then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
156+ else throw("Incorrect exchange type")
157+ if ((inv == inv))
158+ then match inv {
159+ case inv: (Int, ByteVector) =>
160+ let $t069867024 = inv
161+ let amountWithFee = $t069867024._1
162+ let assetIdSend = $t069867024._2
163+ $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
164+ case _ =>
165+ throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
166+ }
167+ else throw("Strict value is not equal to itself.")
168+ }
169+ else accumulated
170+ }
171+
172+ let $t073047410 = {
173+ let $l = exchangers
174+ let $s = size($l)
175+ let $acc0 = $Tuple3(0, 0, base58'')
176+ func $f0_1 ($a,$i) = if (($i >= $s))
177+ then $a
178+ else exchangeFold($a, $l[$i])
179+
180+ func $f0_2 ($a,$i) = if (($i >= $s))
181+ then $a
182+ else throw("List size exceeds 3")
183+
184+ $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
185+ }
186+ let exchangeCounter = $t073047410._1
187+ let amountWithoutFee = $t073047410._2
188+ let assetIdSend = $t073047410._3
189+ let amountWithFee = fraction(amountWithoutFee, (feeScale6 - routingFee), feeScale6)
190+ if (if ((exchangeCounter == routingSize))
191+ then (amountWithFee >= minAmountToReceive)
192+ else false)
193+ then [ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, (amountWithoutFee - amountWithFee), assetIdSend)]
194+ else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
195+ }
196+ })
197+
198+
199+
200+@Callable(i)
201+func shutdown () = valueOrElse(isAdminCall(i), if (!(active))
202+ then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
203+ else suspend("Paused by admin"))
204+
205+
206+
207+@Callable(i)
208+func activate () = valueOrElse(isAdminCall(i), if (active)
209+ then throwIsActive()
210+ else [BooleanEntry(kActive, true), DeleteEntry(kCause)])
211+
212+
213+@Verifier(tx)
214+func verify () = {
215+ let multiSignedByAdmins = {
216+ let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
217+ then 1
218+ else 0
219+ let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
220+ then 1
221+ else 0
222+ let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
223+ then 1
224+ else 0
225+ (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
226+ }
227+ match tx {
228+ case _ =>
229+ multiSignedByAdmins
230+ }
231+ }
232+

github/deemru/w8io/169f3d6 
29.23 ms