tx · 9HbGXYy6qCuQohGBSwGiCJnLMwTkEp1trcLNwoTWcsnz

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

2021.08.08 18:49 [1649571] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves

{ "type": 13, "id": "9HbGXYy6qCuQohGBSwGiCJnLMwTkEp1trcLNwoTWcsnz", "fee": 1000000, "feeAssetId": null, "timestamp": 1628437774643, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "4zosapN59jXxbbvENaxMfUtUMs51Pw8DEWheHhSfzWvmP3JDmuUaVx6BpKMgerxUZJn4RQ9LfLp5Carrn9KPJNWw" ], "script": "base64:AAIFAAAAAAAAAgsIAhIGCgQYERIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGg4KAmE0Eghhc3NldFBheRoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGg8KAmE2EgkkdDA2MjQ2OTkaDwoCYTcSCXBtdEFtb3VudBoQCgJhOBIKcG10QXNzZXRJZBoRCgJhORILcm91dGluZ1NpemUaEgoCYjESDGV4Y2hhbmdlRm9sZBoRCgJiMhILYWNjdW11bGF0ZWQaDwoCYjMSCWV4Y2hhbmdlchoWCgJiNBIQZXhjaGFuZ2VyQWRkcmVzcxoHCgJiNRIBYRoNCgJiNhIHJG1hdGNoMBoHCgJiNxIBdBoHCgJiOBIBdRoJCgJiORIDaW52Gg0KAmMxEgdyb3V0aW5nGhMKAmMyEg0kbGlzdDEzNjgxNDA0GhMKAmMzEg0kc2l6ZTEzNjgxNDA0GhMKAmM0Eg0kYWNjMDEzNjgxNDA0GhMKAmM1Eg0kYWNjMTEzNjgxNDA0GhMKAmM2Eg0kYWNjMjEzNjgxNDA0GhMKAmM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us": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5pGjXFkyxGep1K38YdPhbKvjEhUDAdXR9fsdUUPwg2hz Next: 9RP3MsCPgfNRGrnAJijcGx9TRrCg943VaE7Jf2J4zExc Diff:
OldNewDifferences
1212 func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated))
1313 then {
1414 let exchangerAddress = addressFromStringValue(exchanger)
15- let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(unit, 100000)])
15+ let a = match pmtAssetId {
16+ case t: ByteVector =>
17+ t
18+ case u: Unit =>
19+ u
20+ case _ =>
21+ throw("Match error")
22+ }
23+ let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(a, 100000)])
1624 if ((inv == inv))
1725 then (accumulated + 1)
1826 else throw("Strict value is not equal to itself.")
2028 else accumulated
2129
2230 let routing = {
23- let $list12471283 = exchangers
24- let $size12471283 = size($list12471283)
25- let $acc012471283 = 0
26- if (($size12471283 == 0))
27- then $acc012471283
31+ let $list13681404 = exchangers
32+ let $size13681404 = size($list13681404)
33+ let $acc013681404 = 0
34+ if (($size13681404 == 0))
35+ then $acc013681404
2836 else {
29- let $acc112471283 = exchangeFold($acc012471283, $list12471283[0])
30- if (($size12471283 == 1))
31- then $acc112471283
37+ let $acc113681404 = exchangeFold($acc013681404, $list13681404[0])
38+ if (($size13681404 == 1))
39+ then $acc113681404
3240 else {
33- let $acc212471283 = exchangeFold($acc112471283, $list12471283[1])
34- if (($size12471283 == 2))
35- then $acc212471283
41+ let $acc213681404 = exchangeFold($acc113681404, $list13681404[1])
42+ if (($size13681404 == 2))
43+ then $acc213681404
3644 else {
37- let $acc312471283 = exchangeFold($acc212471283, $list12471283[2])
38- if (($size12471283 == 3))
39- then $acc312471283
45+ let $acc313681404 = exchangeFold($acc213681404, $list13681404[2])
46+ if (($size13681404 == 3))
47+ then $acc313681404
4048 else {
41- let $acc412471283 = exchangeFold($acc312471283, $list12471283[3])
42- if (($size12471283 == 4))
43- then $acc412471283
49+ let $acc413681404 = exchangeFold($acc313681404, $list13681404[3])
50+ if (($size13681404 == 4))
51+ then $acc413681404
4452 else {
45- let $acc512471283 = exchangeFold($acc412471283, $list12471283[4])
46- if (($size12471283 == 5))
47- then $acc512471283
53+ let $acc513681404 = exchangeFold($acc413681404, $list13681404[4])
54+ if (($size13681404 == 5))
55+ then $acc513681404
4856 else {
49- let $acc612471283 = exchangeFold($acc512471283, $list12471283[5])
57+ let $acc613681404 = exchangeFold($acc513681404, $list13681404[5])
5058 throw("List size exceed 5")
5159 }
5260 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func routingTrade (exchangers,args,assetPay,minAmountToReceive) = {
88 let $t0624699 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
99 let pmtAmount = $t0624699._1
1010 let pmtAssetId = $t0624699._2
1111 let routingSize = size(exchangers)
1212 func exchangeFold (accumulated,exchanger) = if ((routingSize > accumulated))
1313 then {
1414 let exchangerAddress = addressFromStringValue(exchanger)
15- let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(unit, 100000)])
15+ let a = match pmtAssetId {
16+ case t: ByteVector =>
17+ t
18+ case u: Unit =>
19+ u
20+ case _ =>
21+ throw("Match error")
22+ }
23+ let inv = invoke(exchangerAddress, "exchange", [args[accumulated]], [AttachedPayment(a, 100000)])
1624 if ((inv == inv))
1725 then (accumulated + 1)
1826 else throw("Strict value is not equal to itself.")
1927 }
2028 else accumulated
2129
2230 let routing = {
23- let $list12471283 = exchangers
24- let $size12471283 = size($list12471283)
25- let $acc012471283 = 0
26- if (($size12471283 == 0))
27- then $acc012471283
31+ let $list13681404 = exchangers
32+ let $size13681404 = size($list13681404)
33+ let $acc013681404 = 0
34+ if (($size13681404 == 0))
35+ then $acc013681404
2836 else {
29- let $acc112471283 = exchangeFold($acc012471283, $list12471283[0])
30- if (($size12471283 == 1))
31- then $acc112471283
37+ let $acc113681404 = exchangeFold($acc013681404, $list13681404[0])
38+ if (($size13681404 == 1))
39+ then $acc113681404
3240 else {
33- let $acc212471283 = exchangeFold($acc112471283, $list12471283[1])
34- if (($size12471283 == 2))
35- then $acc212471283
41+ let $acc213681404 = exchangeFold($acc113681404, $list13681404[1])
42+ if (($size13681404 == 2))
43+ then $acc213681404
3644 else {
37- let $acc312471283 = exchangeFold($acc212471283, $list12471283[2])
38- if (($size12471283 == 3))
39- then $acc312471283
45+ let $acc313681404 = exchangeFold($acc213681404, $list13681404[2])
46+ if (($size13681404 == 3))
47+ then $acc313681404
4048 else {
41- let $acc412471283 = exchangeFold($acc312471283, $list12471283[3])
42- if (($size12471283 == 4))
43- then $acc412471283
49+ let $acc413681404 = exchangeFold($acc313681404, $list13681404[3])
50+ if (($size13681404 == 4))
51+ then $acc413681404
4452 else {
45- let $acc512471283 = exchangeFold($acc412471283, $list12471283[4])
46- if (($size12471283 == 5))
47- then $acc512471283
53+ let $acc513681404 = exchangeFold($acc413681404, $list13681404[4])
54+ if (($size13681404 == 5))
55+ then $acc513681404
4856 else {
49- let $acc612471283 = exchangeFold($acc512471283, $list12471283[5])
57+ let $acc613681404 = exchangeFold($acc513681404, $list13681404[5])
5058 throw("List size exceed 5")
5159 }
5260 }
5361 }
5462 }
5563 }
5664 }
5765 }
5866 if ((routing == routingSize))
5967 then {
6068 let ammountToRecieve = assetBalance(this, assetPay[(routingSize - 1)])
6169 [ScriptTransfer(i.caller, ammountToRecieve, assetPay[(routingSize - 1)])]
6270 }
6371 else nil
6472 }
6573
6674

github/deemru/w8io/026f985 
32.39 ms