tx · 5P6aTYNSWLn5uR8Kfe2bFgf3t8qgtJMmgaixhRfNCX7w

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

2021.09.12 19:29 [1700076] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves

{ "type": 13, "id": "5P6aTYNSWLn5uR8Kfe2bFgf3t8qgtJMmgaixhRfNCX7w", "fee": 1000000, "feeAssetId": null, "timestamp": 1631464233900, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "39tXbPkKdvD3LiZ9zgdEQ1ZTdUyaxqLkmQ9TvYQxoR7JDGBKrYdModTJKeGJzasbFBBoo6ZXy4mZNBFJ8aaAH6Qm" ], "script": "base64:AAIFAAAAAAAAAA0IAhIJCgcYGBERGAIBAAAACQAAAAAHZGlnaXRzOAAAAAAAAAAACAAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAdzY2FsZTEyAAAAAOjUpRAAAAAAAAVhbHBoYQAAAAAAAAAAMgAAAAALYWxwaGFEaWdpdHMAAAAAAAAAAAIAAAAABGJldGEAAAAAAAK954ABAAAACHNrZXduZXNzAAAAAgAAAAF4AAAAAXkJAABpAAAAAgkAAGkAAAACCQAAZAAAAAIJAABrAAAAAwUAAAAHc2NhbGUxMgUAAAABeAUAAAABeQkAAGsAAAADBQAAAAdzY2FsZTEyBQAAAAF5BQAAAAF4AAAAAAAAAAACAAAAAAAAACcQAQAAAA1pbnZhcmlhbnRDYWxjAAAAAgAAAAF4AAAAAXkEAAAAAnNrCQEAAAAIc2tld25lc3MAAAACBQAAAAF4BQAAAAF5CQAAZAAAAAIJAABrAAAAAwkAAGQAAAACBQAAAAF4BQAAAAF5BQAAAAZzY2FsZTgJAABsAAAABgUAAAACc2sFAAAAB2RpZ2l0czgFAAAABWF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nRUb1JlY2lldmUJAAPwAAAAAgUAAAAEdGhpcwUAAAAOcmVjZWl2ZUFzc2V0SWQDAwkAAAAAAAACBQAAAA9leGNoYW5nZUNvdW50ZXIFAAAAC3JvdXRpbmdTaXplCQAAZwAAAAIFAAAAD2Ftb3VudFRvUmVjaWV2ZQUAAAASbWluQW1vdW50VG9SZWNlaXZlBwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAD2Ftb3VudFRvUmVjaWV2ZQUAAAAOcmVjZWl2ZUFzc2V0SWQFAAAAA25pbAkAAAIAAAABAgAAAD5yb3V0aW5nICE9IHJvdXRpbmdTaXplIG9yIGFtb3VudFRvUmVjaWV2ZSA8IG1pbkFtb3VudFRvUmVjZWl2ZQAAAADwc2eq", "height": 1700076, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EoLSyHsy6moCym4RV4mYKg7iTAZCuhgXRVzQYzRvsJBZ Next: 71YJEweK67rjxvvDYer71kh5dJn9obugja5EL5Y9MFZK Diff:
OldNewDifferences
5353 args2[1]
5454 }
5555 else throw("Incorrect exchange type")
56- if ((getFrom2TradeWithFee >= minAmountToReceive))
57- then true
58- else false
56+ if (true)
57+ then throw(toString(getFrom2TradeWithFee))
58+ else if ((getFrom2TradeWithFee >= minAmountToReceive))
59+ then true
60+ else false
5961 }
6062
6163
6264 @Callable(i)
6365 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,receiveAssetId,minAmountToReceive) = {
64- let $t034533527 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
65- let pmtAmount = $t034533527._1
66- let pmtAssetId = $t034533527._2
66+ let $t035133587 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
67+ let pmtAmount = $t035133587._1
68+ let pmtAssetId = $t035133587._2
6769 if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
6870 then throw("Check transaction possibilty: declined")
6971 else {
7072 let routingSize = size(exchangers)
7173 func exchangeFold (accumulated,exchanger) = {
72- let $t038263889 = accumulated
73- let exchangeCounter = $t038263889._1
74- let amountsWithFee = $t038263889._2
75- let assetsIdSend = $t038263889._3
74+ let $t038863949 = accumulated
75+ let exchangeCounter = $t038863949._1
76+ let amountsWithFee = $t038863949._2
77+ let assetsIdSend = $t038863949._3
7678 if ((exchangeCounter == 0))
7779 then {
7880 let exchangerAddress = addressFromStringValue(exchanger)
8486 if ((inv == inv))
8587 then match inv {
8688 case inv: (Int, ByteVector) =>
87- let $t045854623 = inv
88- let amountWithFee = $t045854623._1
89- let assetIdSend = $t045854623._2
89+ let $t046454683 = inv
90+ let amountWithFee = $t046454683._1
91+ let assetIdSend = $t046454683._2
9092 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
9193 case _ =>
9294 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
98100 else false)
99101 then {
100102 let exchangerAddress = addressFromStringValue(exchanger)
101- let $t049695035 = $Tuple2(assetsIdSend, amountsWithFee)
102- let pmtAssetIdRout = $t049695035._1
103- let pmtAmountRout = $t049695035._2
103+ let $t050295095 = $Tuple2(assetsIdSend, amountsWithFee)
104+ let pmtAssetIdRout = $t050295095._1
105+ let pmtAmountRout = $t050295095._2
104106 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
105107 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
106108 else if ((exchangersType[exchangeCounter] == "flat"))
109111 if ((inv == inv))
110112 then match inv {
111113 case inv: (Int, ByteVector) =>
112- let $t056405678 = inv
113- let amountWithFee = $t056405678._1
114- let assetIdSend = $t056405678._2
114+ let $t057005738 = inv
115+ let amountWithFee = $t057005738._1
116+ let assetIdSend = $t057005738._2
115117 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
116118 case _ =>
117119 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
121123 else accumulated
122124 }
123125
124- let $t059166017 = {
125- let $list59686017 = exchangers
126- let $size59686017 = size($list59686017)
127- let $acc059686017 = $Tuple3(0, 0, base58'')
128- if (($size59686017 == 0))
129- then $acc059686017
126+ let $t059766077 = {
127+ let $list60286077 = exchangers
128+ let $size60286077 = size($list60286077)
129+ let $acc060286077 = $Tuple3(0, 0, base58'')
130+ if (($size60286077 == 0))
131+ then $acc060286077
130132 else {
131- let $acc159686017 = exchangeFold($acc059686017, $list59686017[0])
132- if (($size59686017 == 1))
133- then $acc159686017
133+ let $acc160286077 = exchangeFold($acc060286077, $list60286077[0])
134+ if (($size60286077 == 1))
135+ then $acc160286077
134136 else {
135- let $acc259686017 = exchangeFold($acc159686017, $list59686017[1])
136- if (($size59686017 == 2))
137- then $acc259686017
137+ let $acc260286077 = exchangeFold($acc160286077, $list60286077[1])
138+ if (($size60286077 == 2))
139+ then $acc260286077
138140 else {
139- let $acc359686017 = exchangeFold($acc259686017, $list59686017[2])
140- if (($size59686017 == 3))
141- then $acc359686017
141+ let $acc360286077 = exchangeFold($acc260286077, $list60286077[2])
142+ if (($size60286077 == 3))
143+ then $acc360286077
142144 else {
143- let $acc459686017 = exchangeFold($acc359686017, $list59686017[3])
145+ let $acc460286077 = exchangeFold($acc360286077, $list60286077[3])
144146 throw("List size exceed 3")
145147 }
146148 }
147149 }
148150 }
149151 }
150- let exchangeCounter = $t059166017._1
151- let amountsWithFee = $t059166017._2
152- let assetsIdSend = $t059166017._3
152+ let exchangeCounter = $t059766077._1
153+ let amountsWithFee = $t059766077._2
154+ let assetsIdSend = $t059766077._3
153155 let amountToRecieve = assetBalance(this, receiveAssetId)
154156 if (if ((exchangeCounter == routingSize))
155157 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 invariantNew = invariantCalc((dApp1TokenPay + pmtAmount), (dApp1TokenGet - args2[0]))
4141 args2[0]
4242 }
4343 else throw("Incorrect exchange type")
4444 let getFrom2TradeWithFee = if ((exchangersType[1] == "cpmm"))
4545 then {
4646 let getFrom2Trade = fraction(dApp2TokenGet, getFrom1TradeWithFee, (getFrom1TradeWithFee + dApp2TokenPay))
4747 fraction(getFrom2Trade, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
4848 }
4949 else if ((exchangersType[1] == "flat"))
5050 then {
5151 let invariant = invariantCalc(dApp2TokenPay, dApp2TokenGet)
5252 let invariantNew = invariantCalc((dApp2TokenPay + getFrom1TradeWithFee), (dApp2TokenGet - args2[1]))
5353 args2[1]
5454 }
5555 else throw("Incorrect exchange type")
56- if ((getFrom2TradeWithFee >= minAmountToReceive))
57- then true
58- else false
56+ if (true)
57+ then throw(toString(getFrom2TradeWithFee))
58+ else if ((getFrom2TradeWithFee >= minAmountToReceive))
59+ then true
60+ else false
5961 }
6062
6163
6264 @Callable(i)
6365 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,receiveAssetId,minAmountToReceive) = {
64- let $t034533527 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
65- let pmtAmount = $t034533527._1
66- let pmtAssetId = $t034533527._2
66+ let $t035133587 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
67+ let pmtAmount = $t035133587._1
68+ let pmtAssetId = $t035133587._2
6769 if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
6870 then throw("Check transaction possibilty: declined")
6971 else {
7072 let routingSize = size(exchangers)
7173 func exchangeFold (accumulated,exchanger) = {
72- let $t038263889 = accumulated
73- let exchangeCounter = $t038263889._1
74- let amountsWithFee = $t038263889._2
75- let assetsIdSend = $t038263889._3
74+ let $t038863949 = accumulated
75+ let exchangeCounter = $t038863949._1
76+ let amountsWithFee = $t038863949._2
77+ let assetsIdSend = $t038863949._3
7678 if ((exchangeCounter == 0))
7779 then {
7880 let exchangerAddress = addressFromStringValue(exchanger)
7981 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
8082 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
8183 else if ((exchangersType[exchangeCounter] == "flat"))
8284 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
8385 else throw("Incorrect exchange type")
8486 if ((inv == inv))
8587 then match inv {
8688 case inv: (Int, ByteVector) =>
87- let $t045854623 = inv
88- let amountWithFee = $t045854623._1
89- let assetIdSend = $t045854623._2
89+ let $t046454683 = inv
90+ let amountWithFee = $t046454683._1
91+ let assetIdSend = $t046454683._2
9092 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
9193 case _ =>
9294 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
9395 }
9496 else throw("Strict value is not equal to itself.")
9597 }
9698 else if (if ((exchangeCounter > 0))
9799 then (routingSize > exchangeCounter)
98100 else false)
99101 then {
100102 let exchangerAddress = addressFromStringValue(exchanger)
101- let $t049695035 = $Tuple2(assetsIdSend, amountsWithFee)
102- let pmtAssetIdRout = $t049695035._1
103- let pmtAmountRout = $t049695035._2
103+ let $t050295095 = $Tuple2(assetsIdSend, amountsWithFee)
104+ let pmtAssetIdRout = $t050295095._1
105+ let pmtAmountRout = $t050295095._2
104106 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
105107 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
106108 else if ((exchangersType[exchangeCounter] == "flat"))
107109 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
108110 else throw("Incorrect exchange type")
109111 if ((inv == inv))
110112 then match inv {
111113 case inv: (Int, ByteVector) =>
112- let $t056405678 = inv
113- let amountWithFee = $t056405678._1
114- let assetIdSend = $t056405678._2
114+ let $t057005738 = inv
115+ let amountWithFee = $t057005738._1
116+ let assetIdSend = $t057005738._2
115117 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
116118 case _ =>
117119 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
118120 }
119121 else throw("Strict value is not equal to itself.")
120122 }
121123 else accumulated
122124 }
123125
124- let $t059166017 = {
125- let $list59686017 = exchangers
126- let $size59686017 = size($list59686017)
127- let $acc059686017 = $Tuple3(0, 0, base58'')
128- if (($size59686017 == 0))
129- then $acc059686017
126+ let $t059766077 = {
127+ let $list60286077 = exchangers
128+ let $size60286077 = size($list60286077)
129+ let $acc060286077 = $Tuple3(0, 0, base58'')
130+ if (($size60286077 == 0))
131+ then $acc060286077
130132 else {
131- let $acc159686017 = exchangeFold($acc059686017, $list59686017[0])
132- if (($size59686017 == 1))
133- then $acc159686017
133+ let $acc160286077 = exchangeFold($acc060286077, $list60286077[0])
134+ if (($size60286077 == 1))
135+ then $acc160286077
134136 else {
135- let $acc259686017 = exchangeFold($acc159686017, $list59686017[1])
136- if (($size59686017 == 2))
137- then $acc259686017
137+ let $acc260286077 = exchangeFold($acc160286077, $list60286077[1])
138+ if (($size60286077 == 2))
139+ then $acc260286077
138140 else {
139- let $acc359686017 = exchangeFold($acc259686017, $list59686017[2])
140- if (($size59686017 == 3))
141- then $acc359686017
141+ let $acc360286077 = exchangeFold($acc260286077, $list60286077[2])
142+ if (($size60286077 == 3))
143+ then $acc360286077
142144 else {
143- let $acc459686017 = exchangeFold($acc359686017, $list59686017[3])
145+ let $acc460286077 = exchangeFold($acc360286077, $list60286077[3])
144146 throw("List size exceed 3")
145147 }
146148 }
147149 }
148150 }
149151 }
150- let exchangeCounter = $t059166017._1
151- let amountsWithFee = $t059166017._2
152- let assetsIdSend = $t059166017._3
152+ let exchangeCounter = $t059766077._1
153+ let amountsWithFee = $t059766077._2
154+ let assetsIdSend = $t059766077._3
153155 let amountToRecieve = assetBalance(this, receiveAssetId)
154156 if (if ((exchangeCounter == routingSize))
155157 then (amountToRecieve >= minAmountToReceive)
156158 else false)
157159 then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)]
158160 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
159161 }
160162 }
161163
162164

github/deemru/w8io/026f985 
46.04 ms