tx · 7vd7uAYCni4sqmubcULm1FaF8rUdHedG693J7CQrEu1R

3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL:  -0.01000000 Waves

2021.08.18 11:54 [1663563] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves

{ "type": 13, "id": "7vd7uAYCni4sqmubcULm1FaF8rUdHedG693J7CQrEu1R", "fee": 1000000, "feeAssetId": null, "timestamp": 1629276915749, "version": 2, "chainId": 84, "sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL", "senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx", "proofs": [ "3XbqpXhxYWKLqb3Z9bZtPMETaU2V7wWpjh72RitDwz7R4BMAwkt3iiPPTToymvGFDAEFvnjJYfFzfkGirVVDTMNb" ], "script": "base64:AAIFAAAAAAAAAfwIAhIHCgUYERICARoHCgJhMRIBaRoQCgJhMhIKZXhjaGFuZ2VycxoKCgJhMxIEYXJncxoRCgJhNBILYXNzZXRzVG9QYXkaFQoCYTUSD2Fzc2V0VG9Vc2VyU2VuZBoYCgJhNhISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE3Egtyb3V0aW5nU2l6ZRoSCgJhOBIMZXhjaGFuZ2VGb2xkGhEKAmE5EgthY2N1bXVsYXRlZBoPCgJiMRIJZXhjaGFuZ2VyGhYKAmIyEhBleGNoYW5nZXJBZGRyZXNzGhAKAmIzEgokdDA5MzIxMDA2Gg8KAmI0EglwbXRBbW91bnQaEAoCYjUSCnBtdEFzc2V0SWQaCQoCYjYSA2ludhoNCgJiNxIHcm91dGluZxoTCgJiOBINJGxpc3QxNzU1MTc5MRoTCgJiORINJHNpemUxNzU1MTc5MRoTCgJjMRINJGFjYzAxNzU1MTc5MRoTCgJjMhINJGFjYzExNzU1MTc5MRoTCgJjMxINJGFjYzIxNzU1MTc5MRoTCgJjNBINJGFjYzMxNzU1MTc5MRoTCgJjNRINJGFj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AAAAJjNwkBAAAAAmE4AAAAAgUAAAACYzYJAAGRAAAAAgUAAAACYjgAAAAAAAAAAAUJAAACAAAAAQIAAAASTGlzdCBzaXplIGV4Y2VlZCA1BAAAAAJjOAkAA/AAAAACBQAAAAR0aGlzBQAAAAJhNQMDCQAAAAAAAAIFAAAAAmI3BQAAAAJhNwkAAGcAAAACBQAAAAJjOAUAAAACYTYHCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAJhMQAAAAZjYWxsZXIFAAAAAmM4BQAAAAJhNQUAAAADbmlsCQAAAgAAAAECAAAAPnJvdXRpbmcgIT0gcm91dGluZ1NpemUgb3IgYW1vdW50VG9SZWNpZXZlIDwgbWluQW1vdW50VG9SZWNlaXZlAAAAAGazX1w=", "height": 1663563, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 56fSfBoxrmwNmy3ibacNyMP5KRwLQMVgPVKfcZw4ykur Next: 7PBgbC1b53QzfyYZWAt9xrKrmbfxW54qmCay3kqZKRER Diff:
OldNewDifferences
7171 }
7272 }
7373 }
74- if ((p == g))
75- then {
76- let z = assetBalance(this, e)
77-[ScriptTransfer(a.caller, z, e)]
78- }
79- else nil
74+ let z = assetBalance(this, e)
75+ if (if ((p == g))
76+ then (z >= f)
77+ else false)
78+ then [ScriptTransfer(a.caller, z, e)]
79+ else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
8080 }
8181
8282
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(a)
77 func routingTrade (b,c,d,e,f) = {
88 let g = size(b)
99 func h (i,j) = if ((i == 0))
1010 then {
1111 let k = addressFromStringValue(j)
1212 let l = $Tuple2(a.payments[0].amount, a.payments[0].assetId)
1313 let m = l._1
1414 let n = l._2
1515 if ((d[0] != n))
1616 then throw("Incorrect payment and assetsToPay array")
1717 else {
1818 let o = invoke(k, "exchange", [c[i]], [AttachedPayment(n, m)])
1919 if ((o == o))
2020 then (i + 1)
2121 else throw("Strict value is not equal to itself.")
2222 }
2323 }
2424 else if (if ((i > 0))
2525 then (g > i)
2626 else false)
2727 then {
2828 let k = addressFromStringValue(j)
2929 let n = d[i]
3030 let m = assetBalance(this, n)
3131 let o = invoke(k, "exchange", [c[i]], [AttachedPayment(n, m)])
3232 if ((o == o))
3333 then (i + 1)
3434 else throw("Strict value is not equal to itself.")
3535 }
3636 else i
3737
3838 let p = {
3939 let q = b
4040 let r = size(q)
4141 let s = 0
4242 if ((r == 0))
4343 then s
4444 else {
4545 let t = h(s, q[0])
4646 if ((r == 1))
4747 then t
4848 else {
4949 let u = h(t, q[1])
5050 if ((r == 2))
5151 then u
5252 else {
5353 let v = h(u, q[2])
5454 if ((r == 3))
5555 then v
5656 else {
5757 let w = h(v, q[3])
5858 if ((r == 4))
5959 then w
6060 else {
6161 let x = h(w, q[4])
6262 if ((r == 5))
6363 then x
6464 else {
6565 let y = h(x, q[5])
6666 throw("List size exceed 5")
6767 }
6868 }
6969 }
7070 }
7171 }
7272 }
7373 }
74- if ((p == g))
75- then {
76- let z = assetBalance(this, e)
77-[ScriptTransfer(a.caller, z, e)]
78- }
79- else nil
74+ let z = assetBalance(this, e)
75+ if (if ((p == g))
76+ then (z >= f)
77+ else false)
78+ then [ScriptTransfer(a.caller, z, e)]
79+ else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
8080 }
8181
8282

github/deemru/w8io/026f985 
30.57 ms