tx · Eex18D8BYFBPnqRLQKrg5yMj4Wow2uSkap5XsGFEsLK6
3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL: -0.01000000 Waves
2021.08.31 23:47 [1683018] smart account 3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL > SELF 0.00000000 Waves
{
"type": 13,
"id": "Eex18D8BYFBPnqRLQKrg5yMj4Wow2uSkap5XsGFEsLK6",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1630442891959,
"version": 2,
"chainId": 84,
"sender": "3N6qtbZbSPVcvJ1pk87e9ahdsZTjHN8e5mL",
"senderPublicKey": "EYAKsFBespqQveBrfmX29rsehBJrSwQ3B6yN4ADyw8Kx",
"proofs": [
"2vAcKjsuiQiCeVgYdzNXavVhKUKBtTiN27edP1hVBzqm3dsoQH9mxTFMr2uUBnB2FLBjrTwXXdyCpY9izVzWzd8"
],
"script": "base64:AAIFAAAAAAAAAoQIAhIGCgQYEQIBGgcKAmExEgFpGhAKAmEyEgpleGNoYW5nZXJzGgoKAmEzEgRhcmdzGhQKAmE0Eg5yZWNlaXZlQXNzZXRJZBoYCgJhNRISbWluQW1vdW50VG9SZWNlaXZlGhEKAmE2Egtyb3V0aW5nU2l6ZRoSCgJhNxIMZXhjaGFuZ2VGb2xkGhEKAmE4EgthY2N1bXVsYXRlZBoPCgJhORIJZXhjaGFuZ2VyGg8KAmIxEgkkdDA5MzU5OTgaFQoCYjISD2V4Y2hhbmdlQ291bnRlchoUCgJiMxIOYW1vdW50c1dpdGhGZWUaEgoCYjQSDGFzc2V0c0lkU2VuZBoWCgJiNRIQZXhjaGFuZ2VyQWRkcmVzcxoRCgJiNhILJHQwMTExODExOTIaDwoCYjcSCXBtdEFtb3VudBoQCgJiOBIKcG10QXNzZXRJZBoJCgJiORIDaW52Gg0KAmMxEgckbWF0Y2gwGhEKAmMyEgskdDAxNDIwMTQ1OBoTCgJjMxINYW1vdW50V2l0aEZlZRoRCgJjNBILYXNzZXRJZFNlbmQ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BbW91bnRUb1JlY2VpdmUAAAAANdmH4g==",
"height": 1683018,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Etm5MQN1TzsssDx3HaSNwdHysxHzgFXEhZNvUD4ysCCG
Next: CqQyoaBgcUWSLSt3WHWNGEgCK2vf4qhu17BwAtZJeQ24
Diff:
Old | New | | Differences |
---|
36 | 36 | | else if (if ((k > 0)) |
---|
37 | 37 | | then (f > k) |
---|
38 | 38 | | else false) |
---|
39 | | - | then throw(((toBase58String(m) + " ") + toString(l))) |
---|
| 39 | + | then { |
---|
| 40 | + | let n = addressFromStringValue(i) |
---|
| 41 | + | let w = $Tuple2(m, l) |
---|
| 42 | + | let q = w._1 |
---|
| 43 | + | let p = w._2 |
---|
| 44 | + | let r = invoke(n, "exchange", [c[k]], [AttachedPayment(q, p)]) |
---|
| 45 | + | if ((r == r)) |
---|
| 46 | + | then { |
---|
| 47 | + | let s = r |
---|
| 48 | + | if ($isInstanceOf(s, "(Int, ByteVector)")) |
---|
| 49 | + | then { |
---|
| 50 | + | let r = s |
---|
| 51 | + | let x = r |
---|
| 52 | + | let u = x._1 |
---|
| 53 | + | let v = x._2 |
---|
| 54 | + | $Tuple3((k + 1), u, v) |
---|
| 55 | + | } |
---|
| 56 | + | else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") |
---|
| 57 | + | } |
---|
| 58 | + | else throw("Strict value is not equal to itself.") |
---|
| 59 | + | } |
---|
40 | 60 | | else h |
---|
41 | 61 | | } |
---|
42 | 62 | | |
---|
43 | | - | let w = { |
---|
44 | | - | let x = b |
---|
45 | | - | let y = size(x) |
---|
46 | | - | let z = $Tuple3(0, 0, base58'') |
---|
47 | | - | if ((y == 0)) |
---|
48 | | - | then z |
---|
| 63 | + | let y = { |
---|
| 64 | + | let z = b |
---|
| 65 | + | let A = size(z) |
---|
| 66 | + | let B = $Tuple3(0, 0, base58'') |
---|
| 67 | + | if ((A == 0)) |
---|
| 68 | + | then B |
---|
49 | 69 | | else { |
---|
50 | | - | let A = g(z, x[0]) |
---|
51 | | - | if ((y == 1)) |
---|
52 | | - | then A |
---|
| 70 | + | let C = g(B, z[0]) |
---|
| 71 | + | if ((A == 1)) |
---|
| 72 | + | then C |
---|
53 | 73 | | else { |
---|
54 | | - | let B = g(A, x[1]) |
---|
55 | | - | if ((y == 2)) |
---|
56 | | - | then B |
---|
| 74 | + | let D = g(C, z[1]) |
---|
| 75 | + | if ((A == 2)) |
---|
| 76 | + | then D |
---|
57 | 77 | | else { |
---|
58 | | - | let C = g(B, x[2]) |
---|
59 | | - | if ((y == 3)) |
---|
60 | | - | then C |
---|
| 78 | + | let E = g(D, z[2]) |
---|
| 79 | + | if ((A == 3)) |
---|
| 80 | + | then E |
---|
61 | 81 | | else { |
---|
62 | | - | let D = g(C, x[3]) |
---|
| 82 | + | let F = g(E, z[3]) |
---|
63 | 83 | | throw("List size exceed 3") |
---|
64 | 84 | | } |
---|
65 | 85 | | } |
---|
66 | 86 | | } |
---|
67 | 87 | | } |
---|
68 | 88 | | } |
---|
69 | | - | let k = w._1 |
---|
70 | | - | let l = w._2 |
---|
71 | | - | let m = w._3 |
---|
72 | | - | let E = assetBalance(this, d) |
---|
| 89 | + | let k = y._1 |
---|
| 90 | + | let l = y._2 |
---|
| 91 | + | let m = y._3 |
---|
| 92 | + | let G = assetBalance(this, d) |
---|
73 | 93 | | if (if ((k == f)) |
---|
74 | | - | then (E >= e) |
---|
| 94 | + | then (G >= e) |
---|
75 | 95 | | else false) |
---|
76 | | - | then [ScriptTransfer(a.caller, E, d)] |
---|
| 96 | + | then [ScriptTransfer(a.caller, G, d)] |
---|
77 | 97 | | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") |
---|
78 | 98 | | } |
---|
79 | 99 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(a) |
---|
7 | 7 | | func routingTrade (b,c,d,e) = { |
---|
8 | 8 | | let f = size(b) |
---|
9 | 9 | | func g (h,i) = { |
---|
10 | 10 | | let j = h |
---|
11 | 11 | | let k = j._1 |
---|
12 | 12 | | let l = j._2 |
---|
13 | 13 | | let m = j._3 |
---|
14 | 14 | | if ((k == 0)) |
---|
15 | 15 | | then { |
---|
16 | 16 | | let n = addressFromStringValue(i) |
---|
17 | 17 | | let o = $Tuple2(a.payments[0].amount, a.payments[0].assetId) |
---|
18 | 18 | | let p = o._1 |
---|
19 | 19 | | let q = o._2 |
---|
20 | 20 | | let r = invoke(n, "exchange", [c[k]], [AttachedPayment(q, p)]) |
---|
21 | 21 | | if ((r == r)) |
---|
22 | 22 | | then { |
---|
23 | 23 | | let s = r |
---|
24 | 24 | | if ($isInstanceOf(s, "(Int, ByteVector)")) |
---|
25 | 25 | | then { |
---|
26 | 26 | | let r = s |
---|
27 | 27 | | let t = r |
---|
28 | 28 | | let u = t._1 |
---|
29 | 29 | | let v = t._2 |
---|
30 | 30 | | $Tuple3((k + 1), u, v) |
---|
31 | 31 | | } |
---|
32 | 32 | | else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") |
---|
33 | 33 | | } |
---|
34 | 34 | | else throw("Strict value is not equal to itself.") |
---|
35 | 35 | | } |
---|
36 | 36 | | else if (if ((k > 0)) |
---|
37 | 37 | | then (f > k) |
---|
38 | 38 | | else false) |
---|
39 | | - | then throw(((toBase58String(m) + " ") + toString(l))) |
---|
| 39 | + | then { |
---|
| 40 | + | let n = addressFromStringValue(i) |
---|
| 41 | + | let w = $Tuple2(m, l) |
---|
| 42 | + | let q = w._1 |
---|
| 43 | + | let p = w._2 |
---|
| 44 | + | let r = invoke(n, "exchange", [c[k]], [AttachedPayment(q, p)]) |
---|
| 45 | + | if ((r == r)) |
---|
| 46 | + | then { |
---|
| 47 | + | let s = r |
---|
| 48 | + | if ($isInstanceOf(s, "(Int, ByteVector)")) |
---|
| 49 | + | then { |
---|
| 50 | + | let r = s |
---|
| 51 | + | let x = r |
---|
| 52 | + | let u = x._1 |
---|
| 53 | + | let v = x._2 |
---|
| 54 | + | $Tuple3((k + 1), u, v) |
---|
| 55 | + | } |
---|
| 56 | + | else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") |
---|
| 57 | + | } |
---|
| 58 | + | else throw("Strict value is not equal to itself.") |
---|
| 59 | + | } |
---|
40 | 60 | | else h |
---|
41 | 61 | | } |
---|
42 | 62 | | |
---|
43 | | - | let w = { |
---|
44 | | - | let x = b |
---|
45 | | - | let y = size(x) |
---|
46 | | - | let z = $Tuple3(0, 0, base58'') |
---|
47 | | - | if ((y == 0)) |
---|
48 | | - | then z |
---|
| 63 | + | let y = { |
---|
| 64 | + | let z = b |
---|
| 65 | + | let A = size(z) |
---|
| 66 | + | let B = $Tuple3(0, 0, base58'') |
---|
| 67 | + | if ((A == 0)) |
---|
| 68 | + | then B |
---|
49 | 69 | | else { |
---|
50 | | - | let A = g(z, x[0]) |
---|
51 | | - | if ((y == 1)) |
---|
52 | | - | then A |
---|
| 70 | + | let C = g(B, z[0]) |
---|
| 71 | + | if ((A == 1)) |
---|
| 72 | + | then C |
---|
53 | 73 | | else { |
---|
54 | | - | let B = g(A, x[1]) |
---|
55 | | - | if ((y == 2)) |
---|
56 | | - | then B |
---|
| 74 | + | let D = g(C, z[1]) |
---|
| 75 | + | if ((A == 2)) |
---|
| 76 | + | then D |
---|
57 | 77 | | else { |
---|
58 | | - | let C = g(B, x[2]) |
---|
59 | | - | if ((y == 3)) |
---|
60 | | - | then C |
---|
| 78 | + | let E = g(D, z[2]) |
---|
| 79 | + | if ((A == 3)) |
---|
| 80 | + | then E |
---|
61 | 81 | | else { |
---|
62 | | - | let D = g(C, x[3]) |
---|
| 82 | + | let F = g(E, z[3]) |
---|
63 | 83 | | throw("List size exceed 3") |
---|
64 | 84 | | } |
---|
65 | 85 | | } |
---|
66 | 86 | | } |
---|
67 | 87 | | } |
---|
68 | 88 | | } |
---|
69 | | - | let k = w._1 |
---|
70 | | - | let l = w._2 |
---|
71 | | - | let m = w._3 |
---|
72 | | - | let E = assetBalance(this, d) |
---|
| 89 | + | let k = y._1 |
---|
| 90 | + | let l = y._2 |
---|
| 91 | + | let m = y._3 |
---|
| 92 | + | let G = assetBalance(this, d) |
---|
73 | 93 | | if (if ((k == f)) |
---|
74 | | - | then (E >= e) |
---|
| 94 | + | then (G >= e) |
---|
75 | 95 | | else false) |
---|
76 | | - | then [ScriptTransfer(a.caller, E, d)] |
---|
| 96 | + | then [ScriptTransfer(a.caller, G, d)] |
---|
77 | 97 | | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") |
---|
78 | 98 | | } |
---|
79 | 99 | | |
---|
80 | 100 | | |
---|