tx · Etm5MQN1TzsssDx3HaSNwdHysxHzgFXEhZNvUD4ysCCG

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

2021.08.31 23:47 [1683017] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves

{ "type": 13, "id": "Etm5MQN1TzsssDx3HaSNwdHysxHzgFXEhZNvUD4ysCCG", "fee": 1000000, "feeAssetId": null, "timestamp": 1630442837787, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "4JsoaKZCkTGWqELJmqa8A5FCtNtY6d6q5X7nWTtCaTCTc8aj7AeD5ArXtunAABjwm4z8LP9fLhoPGjDWAzXwLpgw" ], "script": "base64:AAIFAAAAAAAAAl4IAhIGCgQYEQIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGhQKAmE0Eg5yZWNlaXZlQXNzZXRJZBoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE2Egtyb3V0aW5nU2l6ZRoSCgJhNxIMZXhjaGFuZ2VGb2xkGhEKAmE4EgthY2N1bXVsYXRlZBoPCgJhORIJZXhjaGFuZ2VyGg8KAmIxEgkkdDA5MzU5OTgaFQoCYjISD2V4Y2hhbmdlQ291bnRlchoUCgJiMxIOYW1vdW50c1dpdGhGZWUaEgoCYjQSDGFzc2V0c0lkU2VuZBoWCgJiNRIQZXhjaGFuZ2VyQWRkcmVzcxoRCgJiNhILJHQwMTExODExOTIaDwoCYjcSCXBtdEFtb3VudBoQCgJiOBIKcG10QXNzZXRJZBoJCgJiORIDaW52Gg0KAmMxEgckbWF0Y2gwGhEKAmMyEgskdDAxNDIwMTQ1OBoTCgJjMxINYW1vdW50V2l0aEZlZRoRCgJjNBILYXNzZXRJZFNlbmQaEQoCYz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jNQAAAAJfMQQAAAACYjMIBQAAAAJjNQAAAAJfMgQAAAACYjQIBQAAAAJjNQAAAAJfMwQAAAACZDQJAAPwAAAAAgUAAAAEdGhpcwUAAAACYTQDAwkAAAAAAAACBQAAAAJiMgUAAAACYTYJAABnAAAAAgUAAAACZDQFAAAAAmE1BwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAACYTEAAAAGY2FsbGVyBQAAAAJkNAUAAAACYTQFAAAAA25pbAkAAAIAAAABAgAAAD5yb3V0aW5nICE9IHJvdXRpbmdTaXplIG9yIGFtb3VudFRvUmVjaWV2ZSA8IG1pbkFtb3VudFRvUmVjZWl2ZQAAAADKbOyP", "height": 1683017, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H6NAZNDdryr85MZdYetmrYRfHGyL2AQYJr9CPTm5HBMN Next: Eex18D8BYFBPnqRLQKrg5yMj4Wow2uSkap5XsGFEsLK6 Diff:
OldNewDifferences
3333 else if (if ((exchangeCounter > 0))
3434 then (routingSize > exchangeCounter)
3535 else false)
36- then {
37- let exchangerAddress = addressFromStringValue(exchanger)
38- let $t018041943 = $Tuple2(assetsIdSend, amountsWithFee)
39- let pmtAssetId = $t018041943._1
40- let pmtAmount = $t018041943._2
41- let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
42- if ((inv == inv))
43- then match inv {
44- case inv: (Int, ByteVector) =>
45- let $t021712209 = inv
46- let amountWithFee = $t021712209._1
47- let assetIdSend = $t021712209._2
48- $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
49- case _ =>
50- throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
51- }
52- else throw("Strict value is not equal to itself.")
53- }
36+ then throw(((toBase58String(assetsIdSend) + " ") + toString(amountsWithFee)))
5437 else accumulated
5538 }
5639
57- let $t024472548 = {
58- let $list24992548 = exchangers
59- let $size24992548 = size($list24992548)
60- let $acc024992548 = $Tuple3(0, 0, base58'')
61- if (($size24992548 == 0))
62- then $acc024992548
40+ let $t025982699 = {
41+ let $list26502699 = exchangers
42+ let $size26502699 = size($list26502699)
43+ let $acc026502699 = $Tuple3(0, 0, base58'')
44+ if (($size26502699 == 0))
45+ then $acc026502699
6346 else {
64- let $acc124992548 = exchangeFold($acc024992548, $list24992548[0])
65- if (($size24992548 == 1))
66- then $acc124992548
47+ let $acc126502699 = exchangeFold($acc026502699, $list26502699[0])
48+ if (($size26502699 == 1))
49+ then $acc126502699
6750 else {
68- let $acc224992548 = exchangeFold($acc124992548, $list24992548[1])
69- if (($size24992548 == 2))
70- then $acc224992548
51+ let $acc226502699 = exchangeFold($acc126502699, $list26502699[1])
52+ if (($size26502699 == 2))
53+ then $acc226502699
7154 else {
72- let $acc324992548 = exchangeFold($acc224992548, $list24992548[2])
73- if (($size24992548 == 3))
74- then $acc324992548
55+ let $acc326502699 = exchangeFold($acc226502699, $list26502699[2])
56+ if (($size26502699 == 3))
57+ then $acc326502699
7558 else {
76- let $acc424992548 = exchangeFold($acc324992548, $list24992548[3])
59+ let $acc426502699 = exchangeFold($acc326502699, $list26502699[3])
7760 throw("List size exceed 3")
7861 }
7962 }
8063 }
8164 }
8265 }
83- let exchangeCounter = $t024472548._1
84- let amountsWithFee = $t024472548._2
85- let assetsIdSend = $t024472548._3
66+ let exchangeCounter = $t025982699._1
67+ let amountsWithFee = $t025982699._2
68+ let assetsIdSend = $t025982699._3
8669 let amountToRecieve = assetBalance(this, receiveAssetId)
8770 if (if ((exchangeCounter == routingSize))
8871 then (amountToRecieve >= minAmountToReceive)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func routingTrade (exchangers,args,receiveAssetId,minAmountToReceive) = {
88 let routingSize = size(exchangers)
99 func exchangeFold (accumulated,exchanger) = {
1010 let $t0935998 = accumulated
1111 let exchangeCounter = $t0935998._1
1212 let amountsWithFee = $t0935998._2
1313 let assetsIdSend = $t0935998._3
1414 if ((exchangeCounter == 0))
1515 then {
1616 let exchangerAddress = addressFromStringValue(exchanger)
1717 let $t011181192 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
1818 let pmtAmount = $t011181192._1
1919 let pmtAssetId = $t011181192._2
2020 let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
2121 if ((inv == inv))
2222 then match inv {
2323 case inv: (Int, ByteVector) =>
2424 let $t014201458 = inv
2525 let amountWithFee = $t014201458._1
2626 let assetIdSend = $t014201458._2
2727 $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
2828 case _ =>
2929 throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
3030 }
3131 else throw("Strict value is not equal to itself.")
3232 }
3333 else if (if ((exchangeCounter > 0))
3434 then (routingSize > exchangeCounter)
3535 else false)
36- then {
37- let exchangerAddress = addressFromStringValue(exchanger)
38- let $t018041943 = $Tuple2(assetsIdSend, amountsWithFee)
39- let pmtAssetId = $t018041943._1
40- let pmtAmount = $t018041943._2
41- let inv = invoke(exchangerAddress, "exchange", [args[exchangeCounter]], [AttachedPayment(pmtAssetId, pmtAmount)])
42- if ((inv == inv))
43- then match inv {
44- case inv: (Int, ByteVector) =>
45- let $t021712209 = inv
46- let amountWithFee = $t021712209._1
47- let assetIdSend = $t021712209._2
48- $Tuple3((exchangeCounter + 1), amountWithFee, assetIdSend)
49- case _ =>
50- throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
51- }
52- else throw("Strict value is not equal to itself.")
53- }
36+ then throw(((toBase58String(assetsIdSend) + " ") + toString(amountsWithFee)))
5437 else accumulated
5538 }
5639
57- let $t024472548 = {
58- let $list24992548 = exchangers
59- let $size24992548 = size($list24992548)
60- let $acc024992548 = $Tuple3(0, 0, base58'')
61- if (($size24992548 == 0))
62- then $acc024992548
40+ let $t025982699 = {
41+ let $list26502699 = exchangers
42+ let $size26502699 = size($list26502699)
43+ let $acc026502699 = $Tuple3(0, 0, base58'')
44+ if (($size26502699 == 0))
45+ then $acc026502699
6346 else {
64- let $acc124992548 = exchangeFold($acc024992548, $list24992548[0])
65- if (($size24992548 == 1))
66- then $acc124992548
47+ let $acc126502699 = exchangeFold($acc026502699, $list26502699[0])
48+ if (($size26502699 == 1))
49+ then $acc126502699
6750 else {
68- let $acc224992548 = exchangeFold($acc124992548, $list24992548[1])
69- if (($size24992548 == 2))
70- then $acc224992548
51+ let $acc226502699 = exchangeFold($acc126502699, $list26502699[1])
52+ if (($size26502699 == 2))
53+ then $acc226502699
7154 else {
72- let $acc324992548 = exchangeFold($acc224992548, $list24992548[2])
73- if (($size24992548 == 3))
74- then $acc324992548
55+ let $acc326502699 = exchangeFold($acc226502699, $list26502699[2])
56+ if (($size26502699 == 3))
57+ then $acc326502699
7558 else {
76- let $acc424992548 = exchangeFold($acc324992548, $list24992548[3])
59+ let $acc426502699 = exchangeFold($acc326502699, $list26502699[3])
7760 throw("List size exceed 3")
7861 }
7962 }
8063 }
8164 }
8265 }
83- let exchangeCounter = $t024472548._1
84- let amountsWithFee = $t024472548._2
85- let assetsIdSend = $t024472548._3
66+ let exchangeCounter = $t025982699._1
67+ let amountsWithFee = $t025982699._2
68+ let assetsIdSend = $t025982699._3
8669 let amountToRecieve = assetBalance(this, receiveAssetId)
8770 if (if ((exchangeCounter == routingSize))
8871 then (amountToRecieve >= minAmountToReceive)
8972 else false)
9073 then [ScriptTransfer(i.caller, amountToRecieve, receiveAssetId)]
9174 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
9275 }
9376
9477

github/deemru/w8io/026f985 
40.25 ms