tx · BLpFyCWpUHFNyuwHprZGidX7x6yHV8xhUR8mVANTeTAF

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

2021.09.12 19:49 [1700098] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves

{ "type": 13, "id": "BLpFyCWpUHFNyuwHprZGidX7x6yHV8xhUR8mVANTeTAF", "fee": 1000000, "feeAssetId": null, "timestamp": 1631465402293, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "3gVNEvyHTiVX9iuL4bgPck8k5jNSw7ZHSq5UbysKNSzD9EmBkoFQnfRYEw4H11C6ft1MSK3o39qaCvZ1833cwDkv" ], "script": "base64:AAIFAAAAAAAAAA0IAhIJCgcYGBERGAIBAAAACQAAAAAHZGlnaXRzOAAAAAAAAAAACAAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAdzY2FsZTEyAAAAAOjUpRAAAAAAAAVhbHBoYQAAAAAAAAAAMgAAAAALYWxwaGFEaWdpdHMAAAAAAAAAAAIAAAAABGJldGEAAAAAAAK954ABAAAACHNrZXduZXNzAAAAAgAAAAF4AAAAAXkJAABpAAAAAgkAAGkAAAACCQAAZAAAAAIJAABrAAAAAwUAAAAHc2NhbGUxMgUAAAABeAUAAAABeQkAAGsAAAADBQAAAAdzY2FsZTEyBQAAAAF5BQAAAAF4AAAAAAAAAAACAAAAAAAAACcQAQAAAA1pbnZhcmlhbnRDYWxjAAAAAgAAAAF4AAAAAXkEAAAAAnNrCQEAAAAIc2tld25lc3MAAAACBQAAAAF4BQAAAAF5CQAAZAAAAAIJAABrAAAAAwkAAGQAAAACBQAAAAF4BQAAAAF5BQAAAAZzY2FsZTgJAABsAAAABgUAAAACc2sFAAAAB2RpZ2l0czgFAAAABWFscGhhBQAAAAthbHB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xMgkAAZEAAAACBQAAAA0kbGlzdDYyNjM2MzEyAAAAAAAAAAADCQAAAgAAAAECAAAAEkxpc3Qgc2l6ZSBleGNlZWQgMwQAAAAPZXhjaGFuZ2VDb3VudGVyCAUAAAALJHQwNjIxMTYzMTIAAAACXzEEAAAADmFtb3VudHNXaXRoRmVlCAUAAAALJHQwNjIxMTYzMTIAAAACXzIEAAAADGFzc2V0c0lkU2VuZAgFAAAACyR0MDYyMTE2MzEyAAAAAl8zBAAAAA9hbW91bnRUb1JlY2lldmUJAAPwAAAAAgUAAAAEdGhpcwUAAAAOcmVjZWl2ZUFzc2V0SWQDAwkAAAAAAAACBQAAAA9leGNoYW5nZUNvdW50ZXIFAAAAC3JvdXRpbmdTaXplCQAAZwAAAAIFAAAAD2Ftb3VudFRvUmVjaWV2ZQUAAAASbWluQW1vdW50VG9SZWNlaXZlBwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAD2Ftb3VudFRvUmVjaWV2ZQUAAAAOcmVjZWl2ZUFzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAAD5yb3V0aW5nICE9IHJvdXRpbmdTaXplIG9yIGFtb3VudFRvUmVjaWV2ZSA8IG1pbkFtb3VudFRvUmVjZWl2ZQAAAABs8yVG", "height": 1700098, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3vaq6DDtiEi3KmR3cUeBf33CxsEFBV6ZjcdqoiHMd8EM Next: 7X3LFxdPQt1bxd5JsemCmswSPgD2rUyJy6aBmT426SSi Diff:
OldNewDifferences
5959 else throw("Flat contract: invariantNew < invariant")
6060 }
6161 else throw("Incorrect exchange type")
62- if (true)
63- then throw(((toString(getFrom2TradeWithFee) + " ") + toString(minAmountToReceive)))
64- else if ((getFrom2TradeWithFee >= minAmountToReceive))
65- then true
66- else false
62+ if ((getFrom2TradeWithFee >= minAmountToReceive))
63+ then true
64+ else false
6765 }
6866
6967
7068 @Callable(i)
7169 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,receiveAssetId,minAmountToReceive) = {
72- let $t038473921 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
73- let pmtAmount = $t038473921._1
74- let pmtAssetId = $t038473921._2
70+ let $t037483822 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
71+ let pmtAmount = $t037483822._1
72+ let pmtAssetId = $t037483822._2
7573 if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
7674 then throw("Check transaction possibilty: declined")
7775 else {
7876 let routingSize = size(exchangers)
7977 func exchangeFold (accumulated,exchanger) = {
80- let $t042204283 = accumulated
81- let exchangeCounter = $t042204283._1
82- let amountsWithFee = $t042204283._2
83- let assetsIdSend = $t042204283._3
78+ let $t041214184 = accumulated
79+ let exchangeCounter = $t041214184._1
80+ let amountsWithFee = $t041214184._2
81+ let assetsIdSend = $t041214184._3
8482 if ((exchangeCounter == 0))
8583 then {
8684 let exchangerAddress = addressFromStringValue(exchanger)
9290 if ((inv == inv))
9391 then match inv {
9492 case inv: (Int, ByteVector) =>
95- let $t049795017 = inv
96- let amountWithFee = $t049795017._1
97- let assetIdSend = $t049795017._2
93+ let $t048804918 = inv
94+ let amountWithFee = $t048804918._1
95+ let assetIdSend = $t048804918._2
9896 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
9997 case _ =>
10098 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
106104 else false)
107105 then {
108106 let exchangerAddress = addressFromStringValue(exchanger)
109- let $t053635429 = $Tuple2(assetsIdSend, amountsWithFee)
110- let pmtAssetIdRout = $t053635429._1
111- let pmtAmountRout = $t053635429._2
107+ let $t052645330 = $Tuple2(assetsIdSend, amountsWithFee)
108+ let pmtAssetIdRout = $t052645330._1
109+ let pmtAmountRout = $t052645330._2
112110 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
113111 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
114112 else if ((exchangersType[exchangeCounter] == "flat"))
117115 if ((inv == inv))
118116 then match inv {
119117 case inv: (Int, ByteVector) =>
120- let $t060346072 = inv
121- let amountWithFee = $t060346072._1
122- let assetIdSend = $t060346072._2
118+ let $t059355973 = inv
119+ let amountWithFee = $t059355973._1
120+ let assetIdSend = $t059355973._2
123121 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
124122 case _ =>
125123 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
129127 else accumulated
130128 }
131129
132- let $t063106411 = {
133- let $list63626411 = exchangers
134- let $size63626411 = size($list63626411)
135- let $acc063626411 = $Tuple3(0, 0, base58'')
136- if (($size63626411 == 0))
137- then $acc063626411
130+ let $t062116312 = {
131+ let $list62636312 = exchangers
132+ let $size62636312 = size($list62636312)
133+ let $acc062636312 = $Tuple3(0, 0, base58'')
134+ if (($size62636312 == 0))
135+ then $acc062636312
138136 else {
139- let $acc163626411 = exchangeFold($acc063626411, $list63626411[0])
140- if (($size63626411 == 1))
141- then $acc163626411
137+ let $acc162636312 = exchangeFold($acc062636312, $list62636312[0])
138+ if (($size62636312 == 1))
139+ then $acc162636312
142140 else {
143- let $acc263626411 = exchangeFold($acc163626411, $list63626411[1])
144- if (($size63626411 == 2))
145- then $acc263626411
141+ let $acc262636312 = exchangeFold($acc162636312, $list62636312[1])
142+ if (($size62636312 == 2))
143+ then $acc262636312
146144 else {
147- let $acc363626411 = exchangeFold($acc263626411, $list63626411[2])
148- if (($size63626411 == 3))
149- then $acc363626411
145+ let $acc362636312 = exchangeFold($acc262636312, $list62636312[2])
146+ if (($size62636312 == 3))
147+ then $acc362636312
150148 else {
151- let $acc463626411 = exchangeFold($acc363626411, $list63626411[3])
149+ let $acc462636312 = exchangeFold($acc362636312, $list62636312[3])
152150 throw("List size exceed 3")
153151 }
154152 }
155153 }
156154 }
157155 }
158- let exchangeCounter = $t063106411._1
159- let amountsWithFee = $t063106411._2
160- let assetsIdSend = $t063106411._3
156+ let exchangeCounter = $t062116312._1
157+ let amountsWithFee = $t062116312._2
158+ let assetsIdSend = $t062116312._3
161159 let amountToRecieve = assetBalance(this, receiveAssetId)
162160 if (if ((exchangeCounter == routingSize))
163161 then (amountToRecieve >= minAmountToReceive)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let digits8 = 8
55
66 let scale8 = 100000000
77
88 let scale12 = 1000000000000
99
1010 let alpha = 50
1111
1212 let alphaDigits = 2
1313
1414 let beta = 46000000
1515
1616 func skewness (x,y) = (((fraction(scale12, x, y) + fraction(scale12, y, x)) / 2) / 10000)
1717
1818
1919 func invariantCalc (x,y) = {
2020 let sk = skewness(x, y)
2121 (fraction((x + y), scale8, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(pow(fraction(x, y, scale8), 0, 5, 1, (digits8 / 2), DOWN), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8)))
2222 }
2323
2424
2525 func checkPossibilty (pmtAmount,minAmountToReceive,exchangers,exchangersType,routingAssetsKeys,args1,args2) = {
2626 let commission = 3000
2727 let commissionScaleDelimiter = 1000000
2828 let dApp1TokenPay = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[0])
2929 let dApp1TokenGet = getIntegerValue(addressFromStringValue(exchangers[0]), routingAssetsKeys[1])
3030 let dApp2TokenPay = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[2])
3131 let dApp2TokenGet = getIntegerValue(addressFromStringValue(exchangers[1]), routingAssetsKeys[3])
3232 let getFrom1TradeWithFee = if ((exchangersType[0] == "cpmm"))
3333 then {
3434 let getFrom1Trade = fraction(dApp1TokenGet, pmtAmount, (pmtAmount + dApp1TokenPay))
3535 fraction(getFrom1Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
3636 }
3737 else if ((exchangersType[0] == "flat"))
3838 then {
3939 let invariant = invariantCalc(dApp1TokenPay, dApp1TokenGet)
4040 let minAmountToReceive1 = args2[0]
4141 let invariantNew = invariantCalc((dApp1TokenPay + pmtAmount), (dApp1TokenGet - args2[0]))
4242 if ((invariantNew >= invariant))
4343 then minAmountToReceive1
4444 else throw("Flat contract: invariantNew < invariant")
4545 }
4646 else throw("Incorrect exchange type")
4747 let getFrom2TradeWithFee = if ((exchangersType[1] == "cpmm"))
4848 then {
4949 let getFrom2Trade = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay))
5050 fraction(getFrom2Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
5151 }
5252 else if ((exchangersType[1] == "flat"))
5353 then {
5454 let invariant = invariantCalc(dApp2TokenPay, dApp2TokenGet)
5555 let minAmountToReceive2 = args2[1]
5656 let invariantNew = invariantCalc((dApp2TokenPay + getFrom1TradeWithFee), (dApp2TokenGet - minAmountToReceive2))
5757 if ((invariantNew >= invariant))
5858 then minAmountToReceive2
5959 else throw("Flat contract: invariantNew < invariant")
6060 }
6161 else throw("Incorrect exchange type")
62- if (true)
63- then throw(((toString(getFrom2TradeWithFee) + " ") + toString(minAmountToReceive)))
64- else if ((getFrom2TradeWithFee >= minAmountToReceive))
65- then true
66- else false
62+ if ((getFrom2TradeWithFee >= minAmountToReceive))
63+ then true
64+ else false
6765 }
6866
6967
7068 @Callable(i)
7169 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,receiveAssetId,minAmountToReceive) = {
72- let $t038473921 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
73- let pmtAmount = $t038473921._1
74- let pmtAssetId = $t038473921._2
70+ let $t037483822 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
71+ let pmtAmount = $t037483822._1
72+ let pmtAssetId = $t037483822._2
7573 if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
7674 then throw("Check transaction possibilty: declined")
7775 else {
7876 let routingSize = size(exchangers)
7977 func exchangeFold (accumulated,exchanger) = {
80- let $t042204283 = accumulated
81- let exchangeCounter = $t042204283._1
82- let amountsWithFee = $t042204283._2
83- let assetsIdSend = $t042204283._3
78+ let $t041214184 = accumulated
79+ let exchangeCounter = $t041214184._1
80+ let amountsWithFee = $t041214184._2
81+ let assetsIdSend = $t041214184._3
8482 if ((exchangeCounter == 0))
8583 then {
8684 let exchangerAddress = addressFromStringValue(exchanger)
8785 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
8886 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
8987 else if ((exchangersType[exchangeCounter] == "flat"))
9088 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
9189 else throw("Incorrect exchange type")
9290 if ((inv == inv))
9391 then match inv {
9492 case inv: (Int, ByteVector) =>
95- let $t049795017 = inv
96- let amountWithFee = $t049795017._1
97- let assetIdSend = $t049795017._2
93+ let $t048804918 = inv
94+ let amountWithFee = $t048804918._1
95+ let assetIdSend = $t048804918._2
9896 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
9997 case _ =>
10098 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
10199 }
102100 else throw("Strict value is not equal to itself.")
103101 }
104102 else if (if ((exchangeCounter > 0))
105103 then (routingSize > exchangeCounter)
106104 else false)
107105 then {
108106 let exchangerAddress = addressFromStringValue(exchanger)
109- let $t053635429 = $Tuple2(assetsIdSend, amountsWithFee)
110- let pmtAssetIdRout = $t053635429._1
111- let pmtAmountRout = $t053635429._2
107+ let $t052645330 = $Tuple2(assetsIdSend, amountsWithFee)
108+ let pmtAssetIdRout = $t052645330._1
109+ let pmtAmountRout = $t052645330._2
112110 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
113111 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
114112 else if ((exchangersType[exchangeCounter] == "flat"))
115113 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
116114 else throw("Incorrect exchange type")
117115 if ((inv == inv))
118116 then match inv {
119117 case inv: (Int, ByteVector) =>
120- let $t060346072 = inv
121- let amountWithFee = $t060346072._1
122- let assetIdSend = $t060346072._2
118+ let $t059355973 = inv
119+ let amountWithFee = $t059355973._1
120+ let assetIdSend = $t059355973._2
123121 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
124122 case _ =>
125123 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
126124 }
127125 else throw("Strict value is not equal to itself.")
128126 }
129127 else accumulated
130128 }
131129
132- let $t063106411 = {
133- let $list63626411 = exchangers
134- let $size63626411 = size($list63626411)
135- let $acc063626411 = $Tuple3(0, 0, base58'')
136- if (($size63626411 == 0))
137- then $acc063626411
130+ let $t062116312 = {
131+ let $list62636312 = exchangers
132+ let $size62636312 = size($list62636312)
133+ let $acc062636312 = $Tuple3(0, 0, base58'')
134+ if (($size62636312 == 0))
135+ then $acc062636312
138136 else {
139- let $acc163626411 = exchangeFold($acc063626411, $list63626411[0])
140- if (($size63626411 == 1))
141- then $acc163626411
137+ let $acc162636312 = exchangeFold($acc062636312, $list62636312[0])
138+ if (($size62636312 == 1))
139+ then $acc162636312
142140 else {
143- let $acc263626411 = exchangeFold($acc163626411, $list63626411[1])
144- if (($size63626411 == 2))
145- then $acc263626411
141+ let $acc262636312 = exchangeFold($acc162636312, $list62636312[1])
142+ if (($size62636312 == 2))
143+ then $acc262636312
146144 else {
147- let $acc363626411 = exchangeFold($acc263626411, $list63626411[2])
148- if (($size63626411 == 3))
149- then $acc363626411
145+ let $acc362636312 = exchangeFold($acc262636312, $list62636312[2])
146+ if (($size62636312 == 3))
147+ then $acc362636312
150148 else {
151- let $acc463626411 = exchangeFold($acc363626411, $list63626411[3])
149+ let $acc462636312 = exchangeFold($acc362636312, $list62636312[3])
152150 throw("List size exceed 3")
153151 }
154152 }
155153 }
156154 }
157155 }
158- let exchangeCounter = $t063106411._1
159- let amountsWithFee = $t063106411._2
160- let assetsIdSend = $t063106411._3
156+ let exchangeCounter = $t062116312._1
157+ let amountsWithFee = $t062116312._2
158+ let assetsIdSend = $t062116312._3
161159 let amountToRecieve = assetBalance(this, receiveAssetId)
162160 if (if ((exchangeCounter == routingSize))
163161 then (amountToRecieve >= minAmountToReceive)
164162 else false)
165163 then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)]
166164 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
167165 }
168166 }
169167
170168

github/deemru/w8io/026f985 
53.59 ms