tx · CXksnuG5MZjBFs1hmoNULx618MHV2FvZfPb5unh8q3Pm 3N7AyMYR2ovan7TNvPE9jMRTejZyXPcV9NP: -0.05000000 Waves 2021.08.23 19:52 [1671235] smart account 3N7AyMYR2ovan7TNvPE9jMRTejZyXPcV9NP > SELF 0.00000000 Waves
{ "type": 13, "id": "CXksnuG5MZjBFs1hmoNULx618MHV2FvZfPb5unh8q3Pm", "fee": 5000000, "feeAssetId": null, "timestamp": 1629737537507, "version": 2, "chainId": 84, "sender": "3N7AyMYR2ovan7TNvPE9jMRTejZyXPcV9NP", "senderPublicKey": "Go3xxijfukFnawU9Jyy1yX4dSyxKT9SYT6Tp3g6iTAjt", "proofs": [ "4gKvqEq2Y36AdonTVKcL2N1ukiDwZPB565J5zbMPBPkftksLSGj1DLwb4wSCaFZwMnvvB8Ff3FEDsHxZ7qhU3QUu" ], "script": "base64:AAIFAAAAAAAAAgQIAhIDCgEBEgQKAgEBGggKAmExEgJXVRoICgJhMhICU1caCAoCYTMSAlNVGgcKAmE0EgFXGgcKAmE1EgFVGgcKAmE2EgFTGgsKAmE3EgVhZG1pbhoMCgJhOBIGc2NhbGU4Gh4KAmE5Ehhjb21taXNzaW9uU2NhbGVEZWxpbWl0ZXIaEAoCYjESCmNvbW1pc3Npb24aCgoCYjISBGZlZXMaCgoCYjMSBGZyb20aCAoCYjQSAnRvGgoKAmI1EgRhbW50GhYKAmI2EhBhbW91bnRXaXRob3V0RmVlGhMKAmI3Eg1hbW91bnRXaXRoRmVlGgcKAmI4EgFpGgkKAmI5EgNtaW4aCQoCYzESA3BtdBoJCgJjMhIDZTFhGgkKAmMzEgNlMWIaCQoCYzQSA2UyYRoJCgJjNRIDZTJiGgkKAmM2EgNlM2EaCQoCYzcSA2UzYhoJCgJjOBIDYmJ1GgkKAmM5EgNiYncaCQoCZDESA2JicxoKCgJkMhIEZGlmdRoKCgJkMxIEZGlmcxoKCgJkNBIEZGlmdxoLCgJkNRIFc3dhcDEaCwoCZDYSBWRpZm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ljdAkAAAIAAAABAgAAAAZzdHJpY3QJAAACAAAAAQIAAAAGc3RyaWN0CQAAAgAAAAECAAAABnN0cmljdAkAAAIAAAABAgAAAAZzdHJpY3QJAAACAAAAAQIAAAAGc3RyaWN0CQAAAgAAAAECAAAABlN0cmljdAAAAAEAAAACZTMBAAAAAmU0AAAAAAkAAfQAAAADCAUAAAACZTMAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJlMwAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJlMwAAAA9zZW5kZXJQdWJsaWNLZXnTkCu3", "height": 1671235, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6YyKZtXX4M6yXYzuG4uPs8V6yMiuJKE2ib8m1mn7t6Ze Next: none Diff:
Old | New | Differences | |
---|---|---|---|
89 | 89 | let diffw = (assetBalance(this, W) - bbw) | |
90 | 90 | if ((diffw == diffw)) | |
91 | 91 | then if ((diffw > min)) | |
92 | - | then [ScriptTransfer(i.caller, diffw, pmt.assetId), StringEntry("debug", ((((("difu= " + toString(difu)) + " / difs= ") + toString(difs)) + " / difw= ") + toString(difw)))] | |
92 | + | then [ScriptTransfer(i.caller, (amnt + diffw), pmt.assetId), StringEntry("debug", ((((("difu= " + toString(difu)) + " / difs= ") + toString(difs)) + " / difw= ") + toString(difw)))] | |
93 | 93 | else throw(("diffw" + toString(diffw))) | |
94 | 94 | else throw("Strict value is not equal to itself.") | |
95 | 95 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let WU = addressFromStringValue(value("3NDD3ifAC17cLzxuYqsgXDRY9DTQ5BqmvwL")) | |
5 | 5 | ||
6 | 6 | let SW = addressFromStringValue(value("3NAzES7pSjfoHsKNumP5HRtSt3qadbqnHip")) | |
7 | 7 | ||
8 | 8 | let SU = addressFromStringValue(value("3MrBtdped4oUFs1BvLNu53Dm1AMGiTHkT9B")) | |
9 | 9 | ||
10 | 10 | let W = base58'3Tg4GRpKeek5wWAQRJKH1ucjMuKNom3f2h67WNNu6xVS' | |
11 | 11 | ||
12 | 12 | let U = base58'gAAmMoquySsX6q5EmzciFfB8RecAhZR9W1HKNntNekL' | |
13 | 13 | ||
14 | 14 | let S = base58'89G3XEYzMSztS6RPN5h2da7j43r4zgKufReZWn1MqX7g' | |
15 | 15 | ||
16 | 16 | let admin = addressFromStringValue("3N97G98bPF5ghnZ1iMmQ7tMH6MBsNZnS272") | |
17 | 17 | ||
18 | 18 | let scale8 = 100000000 | |
19 | 19 | ||
20 | 20 | let commissionScaleDelimiter = 1000000 | |
21 | 21 | ||
22 | 22 | let commission = 3000 | |
23 | 23 | ||
24 | 24 | func fees (from,to,amnt) = { | |
25 | 25 | let amountWithoutFee = fraction(to, amnt, (amnt + from)) | |
26 | 26 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
27 | 27 | (amountWithFee - 1) | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | 32 | func call1 (min) = if ((i.caller != admin)) | |
33 | 33 | then throw("only admin") | |
34 | 34 | else { | |
35 | 35 | let pmt = i.payments[0] | |
36 | 36 | let amnt = pmt.amount | |
37 | 37 | let e1a = getIntegerValue(WU, "A_asset_balance") | |
38 | 38 | if ((e1a == e1a)) | |
39 | 39 | then { | |
40 | 40 | let e1b = getIntegerValue(WU, "B_asset_balance") | |
41 | 41 | if ((e1b == e1b)) | |
42 | 42 | then { | |
43 | 43 | let e2a = getIntegerValue(SU, "A_asset_balance") | |
44 | 44 | if ((e2a == e2a)) | |
45 | 45 | then { | |
46 | 46 | let e2b = getIntegerValue(SU, "B_asset_balance") | |
47 | 47 | if ((e2b == e2b)) | |
48 | 48 | then { | |
49 | 49 | let e3a = getIntegerValue(SW, "A_asset_balance") | |
50 | 50 | if ((e3a == e3a)) | |
51 | 51 | then { | |
52 | 52 | let e3b = getIntegerValue(SW, "B_asset_balance") | |
53 | 53 | if ((e3b == e3b)) | |
54 | 54 | then { | |
55 | 55 | let bbu = assetBalance(this, U) | |
56 | 56 | if ((bbu == bbu)) | |
57 | 57 | then { | |
58 | 58 | let bbw = assetBalance(this, W) | |
59 | 59 | if ((bbw == bbw)) | |
60 | 60 | then { | |
61 | 61 | let bbs = assetBalance(this, S) | |
62 | 62 | if ((bbs == bbs)) | |
63 | 63 | then { | |
64 | 64 | let difu = fees(e1a, e1b, amnt) | |
65 | 65 | if ((difu == difu)) | |
66 | 66 | then { | |
67 | 67 | let difs = fees(e2b, e2a, difu) | |
68 | 68 | if ((difs == difs)) | |
69 | 69 | then { | |
70 | 70 | let difw = fees(e3a, e3b, difs) | |
71 | 71 | if ((difw == difw)) | |
72 | 72 | then if ((difw > (amnt + min))) | |
73 | 73 | then { | |
74 | 74 | let swap1 = invoke(WU, "exchange", [1], [AttachedPayment(W, amnt)]) | |
75 | 75 | if ((swap1 == swap1)) | |
76 | 76 | then { | |
77 | 77 | let diffu = (assetBalance(this, U) - bbu) | |
78 | 78 | if ((diffu == diffu)) | |
79 | 79 | then { | |
80 | 80 | let swap2 = invoke(SU, "exchange", [1], [AttachedPayment(U, diffu)]) | |
81 | 81 | if ((swap2 == swap2)) | |
82 | 82 | then { | |
83 | 83 | let diffs = (assetBalance(this, S) - bbs) | |
84 | 84 | if ((diffs == diffs)) | |
85 | 85 | then { | |
86 | 86 | let swap3 = invoke(SW, "exchange", [1], [AttachedPayment(S, diffs)]) | |
87 | 87 | if ((swap3 == swap3)) | |
88 | 88 | then { | |
89 | 89 | let diffw = (assetBalance(this, W) - bbw) | |
90 | 90 | if ((diffw == diffw)) | |
91 | 91 | then if ((diffw > min)) | |
92 | - | then [ScriptTransfer(i.caller, diffw, pmt.assetId), StringEntry("debug", ((((("difu= " + toString(difu)) + " / difs= ") + toString(difs)) + " / difw= ") + toString(difw)))] | |
92 | + | then [ScriptTransfer(i.caller, (amnt + diffw), pmt.assetId), StringEntry("debug", ((((("difu= " + toString(difu)) + " / difs= ") + toString(difs)) + " / difw= ") + toString(difw)))] | |
93 | 93 | else throw(("diffw" + toString(diffw))) | |
94 | 94 | else throw("Strict value is not equal to itself.") | |
95 | 95 | } | |
96 | 96 | else throw("Strict value is not equal to itself.") | |
97 | 97 | } | |
98 | 98 | else throw("Strict value is not equal to itself.") | |
99 | 99 | } | |
100 | 100 | else throw("Strict value is not equal to itself.") | |
101 | 101 | } | |
102 | 102 | else throw("Strict value is not equal to itself.") | |
103 | 103 | } | |
104 | 104 | else throw("Strict value is not equal to itself.") | |
105 | 105 | } | |
106 | 106 | else throw(((((("difu= " + toString(difu)) + " / difs= ") + toString(difs)) + " / difw= ") + toString(difw))) | |
107 | 107 | else throw("Strict value is not equal to itself.") | |
108 | 108 | } | |
109 | 109 | else throw("Strict value is not equal to itself.") | |
110 | 110 | } | |
111 | 111 | else throw("Strict value is not equal to itself.") | |
112 | 112 | } | |
113 | 113 | else throw("Strict value is not equal to itself.") | |
114 | 114 | } | |
115 | 115 | else throw("Strict value is not equal to itself.") | |
116 | 116 | } | |
117 | 117 | else throw("Strict value is not equal to itself.") | |
118 | 118 | } | |
119 | 119 | else throw("Strict value is not equal to itself.") | |
120 | 120 | } | |
121 | 121 | else throw("Strict value is not equal to itself.") | |
122 | 122 | } | |
123 | 123 | else throw("Strict value is not equal to itself.") | |
124 | 124 | } | |
125 | 125 | else throw("Strict value is not equal to itself.") | |
126 | 126 | } | |
127 | 127 | else throw("Strict value is not equal to itself.") | |
128 | 128 | } | |
129 | 129 | else throw("Strict value is not equal to itself.") | |
130 | 130 | } | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | ||
134 | 134 | @Callable(i) | |
135 | 135 | func call2 (amnt,min) = if ((i.caller != admin)) | |
136 | 136 | then throw("only admin") | |
137 | 137 | else { | |
138 | 138 | let bbu = assetBalance(this, U) | |
139 | 139 | let bbw = assetBalance(this, W) | |
140 | 140 | let bbs = assetBalance(this, S) | |
141 | 141 | if (if (if ((bbu == bbu)) | |
142 | 142 | then (bbw == bbw) | |
143 | 143 | else false) | |
144 | 144 | then (bbs == bbs) | |
145 | 145 | else false) | |
146 | 146 | then { | |
147 | 147 | let swap1 = invoke(SW, "exchange", [1], [AttachedPayment(W, (amnt * scale8))]) | |
148 | 148 | if ((swap1 == swap1)) | |
149 | 149 | then { | |
150 | 150 | let diffs = (assetBalance(this, S) - bbs) | |
151 | 151 | if ((diffs == diffs)) | |
152 | 152 | then { | |
153 | 153 | let swap2 = invoke(SU, "exchange", [1], [AttachedPayment(S, diffs)]) | |
154 | 154 | if ((swap2 == swap2)) | |
155 | 155 | then { | |
156 | 156 | let diffu = (assetBalance(this, U) - bbu) | |
157 | 157 | if ((diffu == diffu)) | |
158 | 158 | then { | |
159 | 159 | let swap3 = invoke(WU, "exchange", [1], [AttachedPayment(U, diffu)]) | |
160 | 160 | if ((swap3 == swap3)) | |
161 | 161 | then { | |
162 | 162 | let diffw = (assetBalance(this, W) - bbw) | |
163 | 163 | if ((diffw == diffw)) | |
164 | 164 | then if ((diffw > min)) | |
165 | 165 | then { | |
166 | 166 | let ok = "ok" | |
167 | 167 | [IntegerEntry("debug", diffw)] | |
168 | 168 | } | |
169 | 169 | else throw(toString(diffw)) | |
170 | 170 | else throw("strict") | |
171 | 171 | } | |
172 | 172 | else throw("strict") | |
173 | 173 | } | |
174 | 174 | else throw("strict") | |
175 | 175 | } | |
176 | 176 | else throw("strict") | |
177 | 177 | } | |
178 | 178 | else throw("strict") | |
179 | 179 | } | |
180 | 180 | else throw("strict") | |
181 | 181 | } | |
182 | 182 | else throw("Strict") | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | @Verifier(tx) | |
187 | 187 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
188 | 188 |
github/deemru/w8io/169f3d6 79.58 ms ◑