tx · 71YJEweK67rjxvvDYer71kh5dJn9obugja5EL5Y9MFZK

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

2021.09.12 19:31 [1700079] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves

{ "type": 13, "id": "71YJEweK67rjxvvDYer71kh5dJn9obugja5EL5Y9MFZK", "fee": 1000000, "feeAssetId": null, "timestamp": 1631464312426, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "2yPL7ZtySGoZLAiPhq3Z1nbdES2zW3bqvJTwMob91WkJxTvVUENHQPaB44Pn2tZNS6x1aRm2vw4kzYZBq7HsBthb" ], "script": "base64:AAIFAAAAAAAAAA0IAhIJCgcYGBERGAIBAAAACQAAAAAHZGlnaXRzOAAAAAAAAAAACAAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAdzY2FsZTEyAAAAAOjUpRAAAAAAAAVhbHBoYQAAAAAAAAAAMgAAAAALYWxwaGFEaWdpdHMAAAAAAAAAAAIAAAAABGJldGEAAAAAAAK954ABAAAACHNrZXduZXNzAAAAAgAAAAF4AAAAAXkJAABpAAAAAgkAAGkAAAACCQAAZAAAAAIJAABrAAAAAwUAAAAHc2NhbGUxMgUAAAABeAUAAAABeQkAAGsAAAADBQAAAAdzY2FsZTEyBQAAAAF5BQAAAAF4AAAAAAAAAAACAAAAAAAAACcQAQAAAA1pbnZhcmlhbnRDYWxjAAAAAgAAAAF4AAAAAXkEAAAAAnNrCQEAAAAIc2tld25lc3MAAAACBQAAAAF4BQAAAAF5CQAAZAAAAAIJAABrAAAAAwkAAGQAAAACBQAAAAF4BQAAAAF5BQAAAAZzY2FsZTgJAABsAAAABgUAAAACc2sFAAAAB2RpZ2l0czgFAAAABWFscGhhBQAAAAthbHBoYURpZ2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XzMEAAAAD2Ftb3VudFRvUmVjaWV2ZQkAA/AAAAACBQAAAAR0aGlzBQAAAA5yZWNlaXZlQXNzZXRJZAMDCQAAAAAAAAIFAAAAD2V4Y2hhbmdlQ291bnRlcgUAAAALcm91dGluZ1NpemUJAABnAAAAAgUAAAAPYW1vdW50VG9SZWNpZXZlBQAAABJtaW5BbW91bnRUb1JlY2VpdmUHCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAPYW1vdW50VG9SZWNpZXZlBQAAAA5yZWNlaXZlQXNzZXRJZAUAAAADbmlsCQAAAgAAAAECAAAAPnJvdXRpbmcgIT0gcm91dGluZ1NpemUgb3IgYW1vdW50VG9SZWNpZXZlIDwgbWluQW1vdW50VG9SZWNlaXZlAAAAAMSJpY4=", "height": 1700079, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5P6aTYNSWLn5uR8Kfe2bFgf3t8qgtJMmgaixhRfNCX7w Next: 6CoGrzaJZUahx98SML7CJY5yK3uZfPXFx43PPhmbJ4tU Diff:
OldNewDifferences
5454 }
5555 else throw("Incorrect exchange type")
5656 if (true)
57- then throw(toString(getFrom2TradeWithFee))
57+ then throw(((toString(getFrom2TradeWithFee) + " ") + toString(minAmountToReceive)))
5858 else if ((getFrom2TradeWithFee >= minAmountToReceive))
5959 then true
6060 else false
6363
6464 @Callable(i)
6565 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,receiveAssetId,minAmountToReceive) = {
66- let $t035133587 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
67- let pmtAmount = $t035133587._1
68- let pmtAssetId = $t035133587._2
66+ let $t035503624 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
67+ let pmtAmount = $t035503624._1
68+ let pmtAssetId = $t035503624._2
6969 if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
7070 then throw("Check transaction possibilty: declined")
7171 else {
7272 let routingSize = size(exchangers)
7373 func exchangeFold (accumulated,exchanger) = {
74- let $t038863949 = accumulated
75- let exchangeCounter = $t038863949._1
76- let amountsWithFee = $t038863949._2
77- let assetsIdSend = $t038863949._3
74+ let $t039233986 = accumulated
75+ let exchangeCounter = $t039233986._1
76+ let amountsWithFee = $t039233986._2
77+ let assetsIdSend = $t039233986._3
7878 if ((exchangeCounter == 0))
7979 then {
8080 let exchangerAddress = addressFromStringValue(exchanger)
8686 if ((inv == inv))
8787 then match inv {
8888 case inv: (Int, ByteVector) =>
89- let $t046454683 = inv
90- let amountWithFee = $t046454683._1
91- let assetIdSend = $t046454683._2
89+ let $t046824720 = inv
90+ let amountWithFee = $t046824720._1
91+ let assetIdSend = $t046824720._2
9292 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
9393 case _ =>
9494 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
100100 else false)
101101 then {
102102 let exchangerAddress = addressFromStringValue(exchanger)
103- let $t050295095 = $Tuple2(assetsIdSend, amountsWithFee)
104- let pmtAssetIdRout = $t050295095._1
105- let pmtAmountRout = $t050295095._2
103+ let $t050665132 = $Tuple2(assetsIdSend, amountsWithFee)
104+ let pmtAssetIdRout = $t050665132._1
105+ let pmtAmountRout = $t050665132._2
106106 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
107107 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
108108 else if ((exchangersType[exchangeCounter] == "flat"))
111111 if ((inv == inv))
112112 then match inv {
113113 case inv: (Int, ByteVector) =>
114- let $t057005738 = inv
115- let amountWithFee = $t057005738._1
116- let assetIdSend = $t057005738._2
114+ let $t057375775 = inv
115+ let amountWithFee = $t057375775._1
116+ let assetIdSend = $t057375775._2
117117 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
118118 case _ =>
119119 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
123123 else accumulated
124124 }
125125
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
126+ let $t060136114 = {
127+ let $list60656114 = exchangers
128+ let $size60656114 = size($list60656114)
129+ let $acc060656114 = $Tuple3(0, 0, base58'')
130+ if (($size60656114 == 0))
131+ then $acc060656114
132132 else {
133- let $acc160286077 = exchangeFold($acc060286077, $list60286077[0])
134- if (($size60286077 == 1))
135- then $acc160286077
133+ let $acc160656114 = exchangeFold($acc060656114, $list60656114[0])
134+ if (($size60656114 == 1))
135+ then $acc160656114
136136 else {
137- let $acc260286077 = exchangeFold($acc160286077, $list60286077[1])
138- if (($size60286077 == 2))
139- then $acc260286077
137+ let $acc260656114 = exchangeFold($acc160656114, $list60656114[1])
138+ if (($size60656114 == 2))
139+ then $acc260656114
140140 else {
141- let $acc360286077 = exchangeFold($acc260286077, $list60286077[2])
142- if (($size60286077 == 3))
143- then $acc360286077
141+ let $acc360656114 = exchangeFold($acc260656114, $list60656114[2])
142+ if (($size60656114 == 3))
143+ then $acc360656114
144144 else {
145- let $acc460286077 = exchangeFold($acc360286077, $list60286077[3])
145+ let $acc460656114 = exchangeFold($acc360656114, $list60656114[3])
146146 throw("List size exceed 3")
147147 }
148148 }
149149 }
150150 }
151151 }
152- let exchangeCounter = $t059766077._1
153- let amountsWithFee = $t059766077._2
154- let assetsIdSend = $t059766077._3
152+ let exchangeCounter = $t060136114._1
153+ let amountsWithFee = $t060136114._2
154+ let assetsIdSend = $t060136114._3
155155 let amountToRecieve = assetBalance(this, receiveAssetId)
156156 if (if ((exchangeCounter == routingSize))
157157 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")
5656 if (true)
57- then throw(toString(getFrom2TradeWithFee))
57+ then throw(((toString(getFrom2TradeWithFee) + " ") + toString(minAmountToReceive)))
5858 else if ((getFrom2TradeWithFee >= minAmountToReceive))
5959 then true
6060 else false
6161 }
6262
6363
6464 @Callable(i)
6565 func routingTrade (exchangers,exchangersType,args1,args2,routingAssetsKeys,receiveAssetId,minAmountToReceive) = {
66- let $t035133587 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
67- let pmtAmount = $t035133587._1
68- let pmtAssetId = $t035133587._2
66+ let $t035503624 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
67+ let pmtAmount = $t035503624._1
68+ let pmtAssetId = $t035503624._2
6969 if (!(checkPossibilty(pmtAmount, minAmountToReceive, exchangers, exchangersType, routingAssetsKeys, args1, args2)))
7070 then throw("Check transaction possibilty: declined")
7171 else {
7272 let routingSize = size(exchangers)
7373 func exchangeFold (accumulated,exchanger) = {
74- let $t038863949 = accumulated
75- let exchangeCounter = $t038863949._1
76- let amountsWithFee = $t038863949._2
77- let assetsIdSend = $t038863949._3
74+ let $t039233986 = accumulated
75+ let exchangeCounter = $t039233986._1
76+ let amountsWithFee = $t039233986._2
77+ let assetsIdSend = $t039233986._3
7878 if ((exchangeCounter == 0))
7979 then {
8080 let exchangerAddress = addressFromStringValue(exchanger)
8181 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
8282 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
8383 else if ((exchangersType[exchangeCounter] == "flat"))
8484 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
8585 else throw("Incorrect exchange type")
8686 if ((inv == inv))
8787 then match inv {
8888 case inv: (Int, ByteVector) =>
89- let $t046454683 = inv
90- let amountWithFee = $t046454683._1
91- let assetIdSend = $t046454683._2
89+ let $t046824720 = inv
90+ let amountWithFee = $t046824720._1
91+ let assetIdSend = $t046824720._2
9292 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
9393 case _ =>
9494 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
9595 }
9696 else throw("Strict value is not equal to itself.")
9797 }
9898 else if (if ((exchangeCounter > 0))
9999 then (routingSize > exchangeCounter)
100100 else false)
101101 then {
102102 let exchangerAddress = addressFromStringValue(exchanger)
103- let $t050295095 = $Tuple2(assetsIdSend, amountsWithFee)
104- let pmtAssetIdRout = $t050295095._1
105- let pmtAmountRout = $t050295095._2
103+ let $t050665132 = $Tuple2(assetsIdSend, amountsWithFee)
104+ let pmtAssetIdRout = $t050665132._1
105+ let pmtAmountRout = $t050665132._2
106106 let inv = if ((exchangersType[exchangeCounter] == "cpmm"))
107107 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
108108 else if ((exchangersType[exchangeCounter] == "flat"))
109109 then invoke(exchangerAddress, "exchange", [args1[exchangeCounter], args2[exchangeCounter]], [AttachedPayment(pmtAssetIdRout, pmtAmountRout)])
110110 else throw("Incorrect exchange type")
111111 if ((inv == inv))
112112 then match inv {
113113 case inv: (Int, ByteVector) =>
114- let $t057005738 = inv
115- let amountWithFee = $t057005738._1
116- let assetIdSend = $t057005738._2
114+ let $t057375775 = inv
115+ let amountWithFee = $t057375775._1
116+ let assetIdSend = $t057375775._2
117117 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
118118 case _ =>
119119 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
120120 }
121121 else throw("Strict value is not equal to itself.")
122122 }
123123 else accumulated
124124 }
125125
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
126+ let $t060136114 = {
127+ let $list60656114 = exchangers
128+ let $size60656114 = size($list60656114)
129+ let $acc060656114 = $Tuple3(0, 0, base58'')
130+ if (($size60656114 == 0))
131+ then $acc060656114
132132 else {
133- let $acc160286077 = exchangeFold($acc060286077, $list60286077[0])
134- if (($size60286077 == 1))
135- then $acc160286077
133+ let $acc160656114 = exchangeFold($acc060656114, $list60656114[0])
134+ if (($size60656114 == 1))
135+ then $acc160656114
136136 else {
137- let $acc260286077 = exchangeFold($acc160286077, $list60286077[1])
138- if (($size60286077 == 2))
139- then $acc260286077
137+ let $acc260656114 = exchangeFold($acc160656114, $list60656114[1])
138+ if (($size60656114 == 2))
139+ then $acc260656114
140140 else {
141- let $acc360286077 = exchangeFold($acc260286077, $list60286077[2])
142- if (($size60286077 == 3))
143- then $acc360286077
141+ let $acc360656114 = exchangeFold($acc260656114, $list60656114[2])
142+ if (($size60656114 == 3))
143+ then $acc360656114
144144 else {
145- let $acc460286077 = exchangeFold($acc360286077, $list60286077[3])
145+ let $acc460656114 = exchangeFold($acc360656114, $list60656114[3])
146146 throw("List size exceed 3")
147147 }
148148 }
149149 }
150150 }
151151 }
152- let exchangeCounter = $t059766077._1
153- let amountsWithFee = $t059766077._2
154- let assetsIdSend = $t059766077._3
152+ let exchangeCounter = $t060136114._1
153+ let amountsWithFee = $t060136114._2
154+ let assetsIdSend = $t060136114._3
155155 let amountToRecieve = assetBalance(this, receiveAssetId)
156156 if (if ((exchangeCounter == routingSize))
157157 then (amountToRecieve >= minAmountToReceive)
158158 else false)
159159 then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)]
160160 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
161161 }
162162 }
163163
164164

github/deemru/w8io/026f985 
46.32 ms