tx · 3V18Ah8VfcL3jsdija7PcSaYeWDpdnwjD9f5pvLwqyCY 3N5DUGD1Pwp7PDbT95caYuGsZoX6r3zFLBN: -0.01300000 Waves 2023.05.10 13:15 [2571655] smart account 3N5DUGD1Pwp7PDbT95caYuGsZoX6r3zFLBN > SELF 0.00000000 Waves
{ "type": 13, "id": "3V18Ah8VfcL3jsdija7PcSaYeWDpdnwjD9f5pvLwqyCY", "fee": 1300000, "feeAssetId": null, "timestamp": 1683713776942, "version": 2, "chainId": 84, "sender": "3N5DUGD1Pwp7PDbT95caYuGsZoX6r3zFLBN", "senderPublicKey": "2oPK8ZcQp2MAGDK7eL3Nd2PukBG1CWU3M2e3JqmC1m3g", "proofs": [ "CNJyh7KszJmc5VSVdQd5cVoC3pQmihDAJMbfwtEXcySsvpvGiechXFd8f5N4NgVPqdx7Jn1zTydvQptmzkKayyC" ], "script": "base64:BgKzBwgCEgoKCAgIAQEBAQEBEgMKAQgSAwoBCBIFCgMICAESBAoCCAgiA1NFUCITa2V5TWFuYWdlclB1YmxpY0tleSIWa2V5TWFuYWdlclZhdWx0QWRkcmVzcyIcZ2V0TWFuYWdlclZhdWx0QWRkcmVzc09yVGhpcyIHJG1hdGNoMCIBcyIQa2V5V2l0aGRyYXdEZWxheSIGYXNzZXRBIgZhc3NldEIiFWtleURlcG9zaXRGZWVQZXJtaWxsZSIWa2V5V2l0aGRyYXdGZWVQZXJtaWxsZSITa2V5TWluQW1vdW50RGVwb3NpdCITa2V5QXNzZXRzUGFpclN0YXR1cyIUa2V5TWluQW1vdW50V2l0aGRyYXciCmtleUJhbGFuY2UiC3VzZXJBZGRyZXNzIhtrZXlUb3RhbEZlZUNvbGxlY3RlZERlcG9zaXQiFGtleVByb2Nlc3NJblByb2dyZXNzIgtoZWlnaHRJbktleSIOa2V5UHJvY2Vzc0RvbmUiFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQiE21hbmFnZXJWYXVsdEFkZHJlc3MiC211c3RNYW5hZ2VyIgFpIgJ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2FsbGVyBQJhYQUBUgUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAXgBC3dpdGhkcmF3RmVlAgFoAWkEAUoJAQF3AQUBeAMJAAACBQFKBQFKBAJhZQkBC3ZhbHVlT3JFbHNlAgkAnwgBCQEBcQIFAWgFAWkAAAQCYWYJANkEAQkBBXZhbHVlAQUBaAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBAXECBQFoBQFpAAAJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAXgGY2FsbGVyBQJhZQUCYWYFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECYWcBAmFoAAQCYWkEAWUJAQF1AAMJAAECBQFlAgpCeXRlVmVjdG9yBAF6BQFlBQF6AwkAAQIFAWUCBFVuaXQIBQJhZw9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCYWcJYm9keUJ5dGVzCQCRAwIIBQJhZwZwcm9vZnMAAAUCYWlDMecp", "height": 2571655, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J5PRGpthwVJyTMa4HWDbKujLuckEJaRDYF5fHtohXyNi Next: none Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | func c () = "%s__managerVaultAddress" | |
10 | 10 | ||
11 | 11 | ||
12 | - | func d () = addressFromStringValue(getStringValue(c())) | |
12 | + | func d () = { | |
13 | + | let e = getString(c()) | |
14 | + | if ($isInstanceOf(e, "String")) | |
15 | + | then { | |
16 | + | let f = e | |
17 | + | addressFromStringValue(f) | |
18 | + | } | |
19 | + | else this | |
20 | + | } | |
13 | 21 | ||
14 | 22 | ||
15 | - | func | |
23 | + | func g (h,i) = makeString(["%s%s%s", "withdrawDelay", h, i], a) | |
16 | 24 | ||
17 | 25 | ||
18 | - | func | |
26 | + | func j (h,i) = makeString(["%s%s%s", "depositFeePermille", h, i], a) | |
19 | 27 | ||
20 | 28 | ||
21 | - | func | |
29 | + | func k (h,i) = makeString(["%s%s%s", "withdrawFeePermille", h, i], a) | |
22 | 30 | ||
23 | 31 | ||
24 | - | func | |
32 | + | func l (h,i) = makeString(["%s%s%s", "minAmountDeposit", h, i], a) | |
25 | 33 | ||
26 | 34 | ||
27 | - | func | |
35 | + | func m (h,i) = makeString(["%s%s%s", "assetsPairStatus", h, i], a) | |
28 | 36 | ||
29 | 37 | ||
30 | - | func | |
38 | + | func n (h,i) = makeString(["%s%s%s", "minAmountWithdraw", h, i], a) | |
31 | 39 | ||
32 | 40 | ||
33 | - | func | |
41 | + | func o (h,i,p) = makeString(["%s%s%s%s", "balance", h, i, p], a) | |
34 | 42 | ||
35 | 43 | ||
36 | - | func | |
44 | + | func q (h,i) = makeString(["%s%s%s%s", "totalFeeCollected", "deposit", h, i], a) | |
37 | 45 | ||
38 | 46 | ||
39 | - | func | |
47 | + | func r (p,h,i,s) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "inProgress", p, h, i, toString(s)], a) | |
40 | 48 | ||
41 | 49 | ||
42 | - | func | |
50 | + | func t (p,h,i,s) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "done", p, h, i, toString(s)], a) | |
43 | 51 | ||
44 | 52 | ||
45 | - | func | |
46 | - | let | |
47 | - | let | |
48 | - | if ($isInstanceOf( | |
53 | + | func u () = { | |
54 | + | let v = d() | |
55 | + | let e = getString(v, b()) | |
56 | + | if ($isInstanceOf(e, "String")) | |
49 | 57 | then { | |
50 | - | let | |
51 | - | fromBase58String( | |
58 | + | let f = e | |
59 | + | fromBase58String(f) | |
52 | 60 | } | |
53 | - | else if ($isInstanceOf( | |
61 | + | else if ($isInstanceOf(e, "Unit")) | |
54 | 62 | then unit | |
55 | 63 | else throw("Match error") | |
56 | 64 | } | |
58 | 66 | ||
59 | 67 | func w (x) = { | |
60 | 68 | let y = throw("Permission denied.") | |
61 | - | let | |
62 | - | if ($isInstanceOf( | |
69 | + | let e = u() | |
70 | + | if ($isInstanceOf(e, "ByteVector")) | |
63 | 71 | then { | |
64 | - | let z = | |
72 | + | let z = e | |
65 | 73 | if ((x.callerPublicKey == z)) | |
66 | 74 | then true | |
67 | 75 | else y | |
68 | 76 | } | |
69 | - | else if ($isInstanceOf( | |
77 | + | else if ($isInstanceOf(e, "Unit")) | |
70 | 78 | then if ((x.caller == this)) | |
71 | 79 | then true | |
72 | 80 | else y | |
81 | 89 | ||
82 | 90 | ||
83 | 91 | @Callable(x) | |
84 | - | func registerAsset ( | |
92 | + | func registerAsset (h,i,D,E,F,G,H,I) = { | |
85 | 93 | let J = w(x) | |
86 | 94 | if ((J == J)) | |
87 | 95 | then { | |
88 | - | let K = | |
89 | - | let L = h | |
90 | - | let M = | |
91 | - | let N = | |
92 | - | let O = | |
93 | - | let P = | |
96 | + | let K = g(h, i) | |
97 | + | let L = j(h, i) | |
98 | + | let M = k(h, i) | |
99 | + | let N = l(h, i) | |
100 | + | let O = n(h, i) | |
101 | + | let P = m(h, i) | |
94 | 102 | [IntegerEntry(K, D), IntegerEntry(L, E), IntegerEntry(M, F), IntegerEntry(N, G), IntegerEntry(O, H), IntegerEntry(P, I)] | |
95 | 103 | } | |
96 | 104 | else throw("Strict value is not equal to itself.") | |
99 | 107 | ||
100 | 108 | ||
101 | 109 | @Callable(x) | |
102 | - | func swapAssetsAToB ( | |
110 | + | func swapAssetsAToB (i) = { | |
103 | 111 | let Q = value(x.payments[0]) | |
104 | - | let | |
105 | - | let R = fromBase58String(value( | |
106 | - | let | |
107 | - | let G = valueOrErrorMessage(getInteger( | |
112 | + | let h = toBase58String(value(Q.assetId)) | |
113 | + | let R = fromBase58String(value(i)) | |
114 | + | let p = toString(x.caller) | |
115 | + | let G = valueOrErrorMessage(getInteger(l(h, i)), A("This asset pair does not exist.")) | |
108 | 116 | let S = Q.amount | |
109 | - | let E = valueOrErrorMessage(getInteger(h | |
117 | + | let E = valueOrErrorMessage(getInteger(j(h, i)), A("The deposit fee for this pair of assets is not set.")) | |
110 | 118 | let T = ((S / 1000) * E) | |
111 | - | let U = valueOrElse(getInteger( | |
112 | - | let V = valueOrElse(getInteger( | |
113 | - | let I = valueOrErrorMessage(getInteger( | |
119 | + | let U = valueOrElse(getInteger(o(h, i, p)), 0) | |
120 | + | let V = valueOrElse(getInteger(q(h, i)), 0) | |
121 | + | let I = valueOrErrorMessage(getInteger(m(h, i)), A("The asset pair status for this pair of assets is not set.")) | |
114 | 122 | let W = if ((I == 0)) | |
115 | 123 | then true | |
116 | 124 | else C("The couple's deposit is blocked.") | |
126 | 134 | then true | |
127 | 135 | else C("The final balance is less than or equal to 0.") | |
128 | 136 | if ((Z == Z)) | |
129 | - | then [IntegerEntry( | |
137 | + | then [IntegerEntry(o(h, i, p), Y), IntegerEntry(q(h, i), (V + T)), ScriptTransfer(x.caller, (S - T), R)] | |
130 | 138 | else throw("Strict value is not equal to itself.") | |
131 | 139 | } | |
132 | 140 | else throw("Strict value is not equal to itself.") | |
137 | 145 | ||
138 | 146 | ||
139 | 147 | @Callable(x) | |
140 | - | func initializationSwapAssetsBToA ( | |
148 | + | func initializationSwapAssetsBToA (h) = { | |
141 | 149 | let Q = value(x.payments[0]) | |
142 | 150 | let aa = Q.amount | |
143 | - | let | |
144 | - | let | |
145 | - | let H = valueOrErrorMessage(getInteger( | |
146 | - | let ab = (height + valueOrErrorMessage(getInteger( | |
147 | - | let U = valueOrErrorMessage(getInteger( | |
148 | - | let V = valueOrElse(getInteger( | |
149 | - | let M = | |
151 | + | let i = toBase58String(value(Q.assetId)) | |
152 | + | let p = toString(x.caller) | |
153 | + | let H = valueOrErrorMessage(getInteger(n(h, i)), A("The minimum withdrawal amount for this pair of assets is not set.")) | |
154 | + | let ab = (height + valueOrErrorMessage(getInteger(g(h, i)), A("Withdrawal delay is not set for the specified pair."))) | |
155 | + | let U = valueOrErrorMessage(getInteger(o(h, i, p)), A("This user balance does not exist.")) | |
156 | + | let V = valueOrElse(getInteger(q(h, i)), 0) | |
157 | + | let M = k(h, i) | |
150 | 158 | let F = valueOrErrorMessage(getInteger(M), A("The withdrawal fee for this pair of assets is not set.")) | |
151 | 159 | let T = ((aa / 1000) * F) | |
152 | 160 | let Y = (U - aa) | |
160 | 168 | else C("The withdraw amount is less than the minimum.") | |
161 | 169 | if ((X == X)) | |
162 | 170 | then { | |
163 | - | let ac = if ((getInteger(p | |
171 | + | let ac = if ((getInteger(r(p, h, i, ab)) == unit)) | |
164 | 172 | then true | |
165 | 173 | else C("At this height, there is already an exchange of this pair.") | |
166 | 174 | if ((ac == ac)) | |
167 | - | then [IntegerEntry( | |
175 | + | then [IntegerEntry(o(h, i, p), Y), IntegerEntry(r(p, h, i, ab), (aa - T)), IntegerEntry(q(h, i), (V + T))] | |
168 | 176 | else throw("Strict value is not equal to itself.") | |
169 | 177 | } | |
170 | 178 | else throw("Strict value is not equal to itself.") | |
175 | 183 | ||
176 | 184 | ||
177 | 185 | @Callable(x) | |
178 | - | func withdrawAsset ( | |
179 | - | let | |
180 | - | let aa = valueOrErrorMessage(getInteger(p | |
181 | - | let R = fromBase58String(value( | |
182 | - | let ad = if ((height >= | |
186 | + | func withdrawAsset (h,i,s) = { | |
187 | + | let p = toString(x.caller) | |
188 | + | let aa = valueOrErrorMessage(getInteger(r(p, h, i, s)), A("At this height, withdraw was not initialized with this pair of assets.")) | |
189 | + | let R = fromBase58String(value(h)) | |
190 | + | let ad = if ((height >= s)) | |
183 | 191 | then true | |
184 | - | else C((("Withdrawal is possible after " + toString( | |
192 | + | else C((("Withdrawal is possible after " + toString(s)) + " height or you have already withdrawn.")) | |
185 | 193 | if ((ad == ad)) | |
186 | - | then [DeleteEntry(p | |
194 | + | then [DeleteEntry(r(p, h, i, s)), IntegerEntry(t(p, h, i, s), aa), ScriptTransfer(x.caller, aa, R)] | |
187 | 195 | else throw("Strict value is not equal to itself.") | |
188 | 196 | } | |
189 | 197 | ||
190 | 198 | ||
191 | 199 | ||
192 | 200 | @Callable(x) | |
193 | - | func withdrawFee ( | |
201 | + | func withdrawFee (h,i) = { | |
194 | 202 | let J = w(x) | |
195 | 203 | if ((J == J)) | |
196 | 204 | then { | |
197 | - | let ae = valueOrElse(getInteger( | |
198 | - | let af = fromBase58String(value( | |
199 | - | [IntegerEntry( | |
205 | + | let ae = valueOrElse(getInteger(q(h, i)), 0) | |
206 | + | let af = fromBase58String(value(h)) | |
207 | + | [IntegerEntry(q(h, i), 0), ScriptTransfer(x.caller, ae, af)] | |
200 | 208 | } | |
201 | 209 | else throw("Strict value is not equal to itself.") | |
202 | 210 | } | |
205 | 213 | @Verifier(ag) | |
206 | 214 | func ah () = { | |
207 | 215 | let ai = { | |
208 | - | let | |
209 | - | if ($isInstanceOf( | |
216 | + | let e = u() | |
217 | + | if ($isInstanceOf(e, "ByteVector")) | |
210 | 218 | then { | |
211 | - | let z = | |
219 | + | let z = e | |
212 | 220 | z | |
213 | 221 | } | |
214 | - | else if ($isInstanceOf( | |
222 | + | else if ($isInstanceOf(e, "Unit")) | |
215 | 223 | then ag.senderPublicKey | |
216 | 224 | else throw("Match error") | |
217 | 225 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | func b () = "%s__managerPublicKey" | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func c () = "%s__managerVaultAddress" | |
10 | 10 | ||
11 | 11 | ||
12 | - | func d () = addressFromStringValue(getStringValue(c())) | |
12 | + | func d () = { | |
13 | + | let e = getString(c()) | |
14 | + | if ($isInstanceOf(e, "String")) | |
15 | + | then { | |
16 | + | let f = e | |
17 | + | addressFromStringValue(f) | |
18 | + | } | |
19 | + | else this | |
20 | + | } | |
13 | 21 | ||
14 | 22 | ||
15 | - | func | |
23 | + | func g (h,i) = makeString(["%s%s%s", "withdrawDelay", h, i], a) | |
16 | 24 | ||
17 | 25 | ||
18 | - | func | |
26 | + | func j (h,i) = makeString(["%s%s%s", "depositFeePermille", h, i], a) | |
19 | 27 | ||
20 | 28 | ||
21 | - | func | |
29 | + | func k (h,i) = makeString(["%s%s%s", "withdrawFeePermille", h, i], a) | |
22 | 30 | ||
23 | 31 | ||
24 | - | func | |
32 | + | func l (h,i) = makeString(["%s%s%s", "minAmountDeposit", h, i], a) | |
25 | 33 | ||
26 | 34 | ||
27 | - | func | |
35 | + | func m (h,i) = makeString(["%s%s%s", "assetsPairStatus", h, i], a) | |
28 | 36 | ||
29 | 37 | ||
30 | - | func | |
38 | + | func n (h,i) = makeString(["%s%s%s", "minAmountWithdraw", h, i], a) | |
31 | 39 | ||
32 | 40 | ||
33 | - | func | |
41 | + | func o (h,i,p) = makeString(["%s%s%s%s", "balance", h, i, p], a) | |
34 | 42 | ||
35 | 43 | ||
36 | - | func | |
44 | + | func q (h,i) = makeString(["%s%s%s%s", "totalFeeCollected", "deposit", h, i], a) | |
37 | 45 | ||
38 | 46 | ||
39 | - | func | |
47 | + | func r (p,h,i,s) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "inProgress", p, h, i, toString(s)], a) | |
40 | 48 | ||
41 | 49 | ||
42 | - | func | |
50 | + | func t (p,h,i,s) = makeString(["%s%s%s%s%s%d", "withdrawProcess", "done", p, h, i, toString(s)], a) | |
43 | 51 | ||
44 | 52 | ||
45 | - | func | |
46 | - | let | |
47 | - | let | |
48 | - | if ($isInstanceOf( | |
53 | + | func u () = { | |
54 | + | let v = d() | |
55 | + | let e = getString(v, b()) | |
56 | + | if ($isInstanceOf(e, "String")) | |
49 | 57 | then { | |
50 | - | let | |
51 | - | fromBase58String( | |
58 | + | let f = e | |
59 | + | fromBase58String(f) | |
52 | 60 | } | |
53 | - | else if ($isInstanceOf( | |
61 | + | else if ($isInstanceOf(e, "Unit")) | |
54 | 62 | then unit | |
55 | 63 | else throw("Match error") | |
56 | 64 | } | |
57 | 65 | ||
58 | 66 | ||
59 | 67 | func w (x) = { | |
60 | 68 | let y = throw("Permission denied.") | |
61 | - | let | |
62 | - | if ($isInstanceOf( | |
69 | + | let e = u() | |
70 | + | if ($isInstanceOf(e, "ByteVector")) | |
63 | 71 | then { | |
64 | - | let z = | |
72 | + | let z = e | |
65 | 73 | if ((x.callerPublicKey == z)) | |
66 | 74 | then true | |
67 | 75 | else y | |
68 | 76 | } | |
69 | - | else if ($isInstanceOf( | |
77 | + | else if ($isInstanceOf(e, "Unit")) | |
70 | 78 | then if ((x.caller == this)) | |
71 | 79 | then true | |
72 | 80 | else y | |
73 | 81 | else throw("Match error") | |
74 | 82 | } | |
75 | 83 | ||
76 | 84 | ||
77 | 85 | func A (B) = makeString(["otc_multiasset.ride:", B], " ") | |
78 | 86 | ||
79 | 87 | ||
80 | 88 | func C (B) = throw(A(B)) | |
81 | 89 | ||
82 | 90 | ||
83 | 91 | @Callable(x) | |
84 | - | func registerAsset ( | |
92 | + | func registerAsset (h,i,D,E,F,G,H,I) = { | |
85 | 93 | let J = w(x) | |
86 | 94 | if ((J == J)) | |
87 | 95 | then { | |
88 | - | let K = | |
89 | - | let L = h | |
90 | - | let M = | |
91 | - | let N = | |
92 | - | let O = | |
93 | - | let P = | |
96 | + | let K = g(h, i) | |
97 | + | let L = j(h, i) | |
98 | + | let M = k(h, i) | |
99 | + | let N = l(h, i) | |
100 | + | let O = n(h, i) | |
101 | + | let P = m(h, i) | |
94 | 102 | [IntegerEntry(K, D), IntegerEntry(L, E), IntegerEntry(M, F), IntegerEntry(N, G), IntegerEntry(O, H), IntegerEntry(P, I)] | |
95 | 103 | } | |
96 | 104 | else throw("Strict value is not equal to itself.") | |
97 | 105 | } | |
98 | 106 | ||
99 | 107 | ||
100 | 108 | ||
101 | 109 | @Callable(x) | |
102 | - | func swapAssetsAToB ( | |
110 | + | func swapAssetsAToB (i) = { | |
103 | 111 | let Q = value(x.payments[0]) | |
104 | - | let | |
105 | - | let R = fromBase58String(value( | |
106 | - | let | |
107 | - | let G = valueOrErrorMessage(getInteger( | |
112 | + | let h = toBase58String(value(Q.assetId)) | |
113 | + | let R = fromBase58String(value(i)) | |
114 | + | let p = toString(x.caller) | |
115 | + | let G = valueOrErrorMessage(getInteger(l(h, i)), A("This asset pair does not exist.")) | |
108 | 116 | let S = Q.amount | |
109 | - | let E = valueOrErrorMessage(getInteger(h | |
117 | + | let E = valueOrErrorMessage(getInteger(j(h, i)), A("The deposit fee for this pair of assets is not set.")) | |
110 | 118 | let T = ((S / 1000) * E) | |
111 | - | let U = valueOrElse(getInteger( | |
112 | - | let V = valueOrElse(getInteger( | |
113 | - | let I = valueOrErrorMessage(getInteger( | |
119 | + | let U = valueOrElse(getInteger(o(h, i, p)), 0) | |
120 | + | let V = valueOrElse(getInteger(q(h, i)), 0) | |
121 | + | let I = valueOrErrorMessage(getInteger(m(h, i)), A("The asset pair status for this pair of assets is not set.")) | |
114 | 122 | let W = if ((I == 0)) | |
115 | 123 | then true | |
116 | 124 | else C("The couple's deposit is blocked.") | |
117 | 125 | if ((W == W)) | |
118 | 126 | then { | |
119 | 127 | let X = if ((S >= G)) | |
120 | 128 | then true | |
121 | 129 | else C("The deposit amount is less than the minimum.") | |
122 | 130 | if ((X == X)) | |
123 | 131 | then { | |
124 | 132 | let Y = ((U + S) - T) | |
125 | 133 | let Z = if ((Y > 0)) | |
126 | 134 | then true | |
127 | 135 | else C("The final balance is less than or equal to 0.") | |
128 | 136 | if ((Z == Z)) | |
129 | - | then [IntegerEntry( | |
137 | + | then [IntegerEntry(o(h, i, p), Y), IntegerEntry(q(h, i), (V + T)), ScriptTransfer(x.caller, (S - T), R)] | |
130 | 138 | else throw("Strict value is not equal to itself.") | |
131 | 139 | } | |
132 | 140 | else throw("Strict value is not equal to itself.") | |
133 | 141 | } | |
134 | 142 | else throw("Strict value is not equal to itself.") | |
135 | 143 | } | |
136 | 144 | ||
137 | 145 | ||
138 | 146 | ||
139 | 147 | @Callable(x) | |
140 | - | func initializationSwapAssetsBToA ( | |
148 | + | func initializationSwapAssetsBToA (h) = { | |
141 | 149 | let Q = value(x.payments[0]) | |
142 | 150 | let aa = Q.amount | |
143 | - | let | |
144 | - | let | |
145 | - | let H = valueOrErrorMessage(getInteger( | |
146 | - | let ab = (height + valueOrErrorMessage(getInteger( | |
147 | - | let U = valueOrErrorMessage(getInteger( | |
148 | - | let V = valueOrElse(getInteger( | |
149 | - | let M = | |
151 | + | let i = toBase58String(value(Q.assetId)) | |
152 | + | let p = toString(x.caller) | |
153 | + | let H = valueOrErrorMessage(getInteger(n(h, i)), A("The minimum withdrawal amount for this pair of assets is not set.")) | |
154 | + | let ab = (height + valueOrErrorMessage(getInteger(g(h, i)), A("Withdrawal delay is not set for the specified pair."))) | |
155 | + | let U = valueOrErrorMessage(getInteger(o(h, i, p)), A("This user balance does not exist.")) | |
156 | + | let V = valueOrElse(getInteger(q(h, i)), 0) | |
157 | + | let M = k(h, i) | |
150 | 158 | let F = valueOrErrorMessage(getInteger(M), A("The withdrawal fee for this pair of assets is not set.")) | |
151 | 159 | let T = ((aa / 1000) * F) | |
152 | 160 | let Y = (U - aa) | |
153 | 161 | let Z = if ((Y >= 0)) | |
154 | 162 | then true | |
155 | 163 | else C("Swap amount fail, amount is to small.") | |
156 | 164 | if ((Z == Z)) | |
157 | 165 | then { | |
158 | 166 | let X = if ((aa >= H)) | |
159 | 167 | then true | |
160 | 168 | else C("The withdraw amount is less than the minimum.") | |
161 | 169 | if ((X == X)) | |
162 | 170 | then { | |
163 | - | let ac = if ((getInteger(p | |
171 | + | let ac = if ((getInteger(r(p, h, i, ab)) == unit)) | |
164 | 172 | then true | |
165 | 173 | else C("At this height, there is already an exchange of this pair.") | |
166 | 174 | if ((ac == ac)) | |
167 | - | then [IntegerEntry( | |
175 | + | then [IntegerEntry(o(h, i, p), Y), IntegerEntry(r(p, h, i, ab), (aa - T)), IntegerEntry(q(h, i), (V + T))] | |
168 | 176 | else throw("Strict value is not equal to itself.") | |
169 | 177 | } | |
170 | 178 | else throw("Strict value is not equal to itself.") | |
171 | 179 | } | |
172 | 180 | else throw("Strict value is not equal to itself.") | |
173 | 181 | } | |
174 | 182 | ||
175 | 183 | ||
176 | 184 | ||
177 | 185 | @Callable(x) | |
178 | - | func withdrawAsset ( | |
179 | - | let | |
180 | - | let aa = valueOrErrorMessage(getInteger(p | |
181 | - | let R = fromBase58String(value( | |
182 | - | let ad = if ((height >= | |
186 | + | func withdrawAsset (h,i,s) = { | |
187 | + | let p = toString(x.caller) | |
188 | + | let aa = valueOrErrorMessage(getInteger(r(p, h, i, s)), A("At this height, withdraw was not initialized with this pair of assets.")) | |
189 | + | let R = fromBase58String(value(h)) | |
190 | + | let ad = if ((height >= s)) | |
183 | 191 | then true | |
184 | - | else C((("Withdrawal is possible after " + toString( | |
192 | + | else C((("Withdrawal is possible after " + toString(s)) + " height or you have already withdrawn.")) | |
185 | 193 | if ((ad == ad)) | |
186 | - | then [DeleteEntry(p | |
194 | + | then [DeleteEntry(r(p, h, i, s)), IntegerEntry(t(p, h, i, s), aa), ScriptTransfer(x.caller, aa, R)] | |
187 | 195 | else throw("Strict value is not equal to itself.") | |
188 | 196 | } | |
189 | 197 | ||
190 | 198 | ||
191 | 199 | ||
192 | 200 | @Callable(x) | |
193 | - | func withdrawFee ( | |
201 | + | func withdrawFee (h,i) = { | |
194 | 202 | let J = w(x) | |
195 | 203 | if ((J == J)) | |
196 | 204 | then { | |
197 | - | let ae = valueOrElse(getInteger( | |
198 | - | let af = fromBase58String(value( | |
199 | - | [IntegerEntry( | |
205 | + | let ae = valueOrElse(getInteger(q(h, i)), 0) | |
206 | + | let af = fromBase58String(value(h)) | |
207 | + | [IntegerEntry(q(h, i), 0), ScriptTransfer(x.caller, ae, af)] | |
200 | 208 | } | |
201 | 209 | else throw("Strict value is not equal to itself.") | |
202 | 210 | } | |
203 | 211 | ||
204 | 212 | ||
205 | 213 | @Verifier(ag) | |
206 | 214 | func ah () = { | |
207 | 215 | let ai = { | |
208 | - | let | |
209 | - | if ($isInstanceOf( | |
216 | + | let e = u() | |
217 | + | if ($isInstanceOf(e, "ByteVector")) | |
210 | 218 | then { | |
211 | - | let z = | |
219 | + | let z = e | |
212 | 220 | z | |
213 | 221 | } | |
214 | - | else if ($isInstanceOf( | |
222 | + | else if ($isInstanceOf(e, "Unit")) | |
215 | 223 | then ag.senderPublicKey | |
216 | 224 | else throw("Match error") | |
217 | 225 | } | |
218 | 226 | sigVerify(ag.bodyBytes, ag.proofs[0], ai) | |
219 | 227 | } | |
220 | 228 |
github/deemru/w8io/169f3d6 79.72 ms ◑