tx · BhtDQohiKkmDXtbykyPeSSUBVRmUDQsXJLhTrce6GdcZ 3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW: -0.01400000 Waves 2021.04.02 15:01 [1464797] smart account 3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW > SELF 0.00000000 Waves
{ "type": 13, "id": "BhtDQohiKkmDXtbykyPeSSUBVRmUDQsXJLhTrce6GdcZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1617364964580, "version": 2, "chainId": 84, "sender": "3N5Xd7QVQZWntaJwha9Kg42is626GUPjtUW", "senderPublicKey": "DfbjpZJBbZwnUKysUkxCbWTE1ZWuoUb6Y6BZdu5iAE8j", "proofs": [ "2UmukAFyMLQ2hWJz8jhFTutjwEesFXFQgA7BaSWLiHoTEZKtKVDyW9ZT9R5dDgjpkER5pkvau3JdcpWYCV8oLuux" ], "script": "base64:AAIEAAAAAAAAABkIAhIAEgMKAQESABIDCgEBEgASABIDCgEBAAAAMwAAAAAHdmVyc2lvbgIAAAAFMS4wLjAAAAAACmtleVZlcnNpb24CAAAAB3ZlcnNpb24AAAAACWtleUFjdGl2ZQIAAAAGYWN0aXZlAAAAAAtrZXlBc3NldElkQQIAAAAKQV9hc3NldF9pZAAAAAALa2V5QXNzZXRJZEICAAAACkJfYXNzZXRfaWQAAAAAC2tleUJhbGFuY2VBAgAAAA9BX2Fzc2V0X2JhbGFuY2UAAAAAC2tleUJhbGFuY2VCAgAAAA9CX2Fzc2V0X2JhbGFuY2UAAAAAD2tleVNoYXJlQXNzZXRJZAIAAAAOc2hhcmVfYXNzZXRfaWQAAAAAE2tleVNoYXJlQXNzZXRTdXBwbHkCAAAAEnNoYXJlX2Fzc2V0X3N1cHBseQAAAAANa2V5Q29tbWlzc2lvbgIAAAAKY29tbWlzc2lvbgAAAAAba2V5Q29tbWlzc2lvblNjYWxlRGVsaW1pdGVyAgAAABpjb21taXNzaW9uX3NjYWxlX2RlbGltaXRlcgAAAAAIa2V5Q2F1c2UCAAAADn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AAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAMYWRtaW5QdWJLZXkyBgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADGFkbWluUHViS2V5MwYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAABJhZG1pblB1YktleVN0YWtpbmcDBQAAABNjYWxsVGFrZUludG9BY2NvdW50BgUAAAALY2FsbFN0YWtpbmcJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5tf5rZA==", "height": 1464797, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2KpywD9ZTExTSbp5XBeFruo52nGKsGDiWJJeNNgifsH9 Next: 3Hy5xeUQU913zh36UtTvQFyYANpC5RcEyJ4ssSX8tEHs Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = " | |
4 | + | let a = "1.0.0" | |
5 | 5 | ||
6 | 6 | let b = "version" | |
7 | 7 | ||
23 | 23 | ||
24 | 24 | let k = "commission_scale_delimiter" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "shutdown_cause" | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
29 | 29 | ||
30 | - | let n = base58' | |
30 | + | let n = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
31 | 31 | ||
32 | - | let o = base58' | |
32 | + | let o = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
33 | 33 | ||
34 | - | let p = base58' | |
34 | + | let p = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
35 | 35 | ||
36 | - | let q = base58' | |
36 | + | let q = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
37 | 37 | ||
38 | - | let r = base58' | |
38 | + | let r = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
39 | 39 | ||
40 | - | let s = Address(base58' | |
40 | + | let s = Address(base58'3N6q7sCGSSLBUXDdjBdYGTJbZGZfhhh8cNg') | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = (9 * value(value(assetInfo(t)).minSponsoredFee)) | |
45 | 45 | ||
46 | - | let v = ( | |
46 | + | let v = getBooleanValue(this, c) | |
47 | 47 | ||
48 | - | let w = | |
48 | + | let w = getStringValue(this, d) | |
49 | 49 | ||
50 | - | let x = getStringValue(this, | |
50 | + | let x = getStringValue(this, e) | |
51 | 51 | ||
52 | - | let y = getStringValue(this, e) | |
52 | + | let y = if ((w == "WAVES")) | |
53 | + | then unit | |
54 | + | else fromBase58String(w) | |
53 | 55 | ||
54 | 56 | let z = if ((x == "WAVES")) | |
55 | 57 | then unit | |
56 | 58 | else fromBase58String(x) | |
57 | 59 | ||
58 | - | let A = if ((y == "WAVES")) | |
59 | - | then unit | |
60 | - | else fromBase58String(y) | |
61 | - | ||
62 | - | let B = { | |
63 | - | let C = z | |
64 | - | if ($isInstanceOf(C, "ByteVector")) | |
60 | + | let A = { | |
61 | + | let B = y | |
62 | + | if ($isInstanceOf(B, "ByteVector")) | |
65 | 63 | then { | |
66 | - | let | |
67 | - | value(assetInfo( | |
64 | + | let C = B | |
65 | + | value(assetInfo(C)).name | |
68 | 66 | } | |
69 | - | else if ($isInstanceOf( | |
67 | + | else if ($isInstanceOf(B, "Unit")) | |
70 | 68 | then { | |
71 | - | let | |
69 | + | let D = B | |
72 | 70 | "WAVES" | |
73 | 71 | } | |
74 | 72 | else throw("Match error") | |
75 | 73 | } | |
76 | 74 | ||
77 | - | let | |
78 | - | let | |
79 | - | if ($isInstanceOf( | |
75 | + | let E = { | |
76 | + | let B = z | |
77 | + | if ($isInstanceOf(B, "ByteVector")) | |
80 | 78 | then { | |
81 | - | let | |
82 | - | value(assetInfo( | |
79 | + | let C = B | |
80 | + | value(assetInfo(C)).name | |
83 | 81 | } | |
84 | - | else if ($isInstanceOf( | |
82 | + | else if ($isInstanceOf(B, "Unit")) | |
85 | 83 | then { | |
86 | - | let | |
84 | + | let D = B | |
87 | 85 | "WAVES" | |
88 | 86 | } | |
89 | 87 | else throw("Match error") | |
90 | 88 | } | |
91 | 89 | ||
92 | - | let | |
90 | + | let F = getIntegerValue(this, f) | |
93 | 91 | ||
94 | - | let | |
92 | + | let G = getIntegerValue(this, g) | |
95 | 93 | ||
96 | - | let | |
94 | + | let H = fromBase58String(getStringValue(this, h)) | |
97 | 95 | ||
98 | - | let | |
96 | + | let I = getIntegerValue(this, i) | |
99 | 97 | ||
100 | - | let | |
98 | + | let J = 3000 | |
101 | 99 | ||
102 | - | let | |
100 | + | let K = 1200 | |
103 | 101 | ||
104 | - | let | |
102 | + | let L = 1000000 | |
105 | 103 | ||
106 | - | let N = 1000000 | |
104 | + | let M = 1000 | |
105 | + | ||
106 | + | let N = 100000000 | |
107 | 107 | ||
108 | 108 | let O = 1000 | |
109 | 109 | ||
110 | - | let P = | |
110 | + | let P = 8 | |
111 | 111 | ||
112 | - | let Q = 1000000000000 | |
113 | - | ||
114 | - | let R = 1000 | |
115 | - | ||
116 | - | let S = 8 | |
117 | - | ||
118 | - | let T = 50 | |
119 | - | ||
120 | - | let U = 100 | |
121 | - | ||
122 | - | let V = 90000000 | |
123 | - | ||
124 | - | let W = 110000000 | |
125 | - | ||
126 | - | let X = 50 | |
127 | - | ||
128 | - | let Y = 2 | |
129 | - | ||
130 | - | let Z = 46000000 | |
131 | - | ||
132 | - | func aa (ab) = { | |
133 | - | let C = ab | |
134 | - | if ($isInstanceOf(C, "ByteVector")) | |
112 | + | func Q (R) = { | |
113 | + | let B = R | |
114 | + | if ($isInstanceOf(B, "ByteVector")) | |
135 | 115 | then { | |
136 | - | let | |
137 | - | assetBalance(this, | |
116 | + | let C = B | |
117 | + | assetBalance(this, C) | |
138 | 118 | } | |
139 | - | else if ($isInstanceOf( | |
119 | + | else if ($isInstanceOf(B, "Unit")) | |
140 | 120 | then { | |
141 | - | let | |
121 | + | let D = B | |
142 | 122 | wavesBalance(this).available | |
143 | 123 | } | |
144 | 124 | else throw("Match error") | |
145 | 125 | } | |
146 | 126 | ||
147 | 127 | ||
148 | - | let | |
149 | - | let | |
150 | - | if ($isInstanceOf( | |
128 | + | let S = { | |
129 | + | let B = getInteger(s, ((("rpd_balance_" + toBase58String(t)) + "_") + toString(this))) | |
130 | + | if ($isInstanceOf(B, "Int")) | |
151 | 131 | then { | |
152 | - | let | |
153 | - | | |
132 | + | let T = B | |
133 | + | T | |
154 | 134 | } | |
155 | - | else if ($isInstanceOf( | |
135 | + | else if ($isInstanceOf(B, "Unit")) | |
156 | 136 | then { | |
157 | - | let | |
137 | + | let U = B | |
158 | 138 | 0 | |
159 | 139 | } | |
160 | 140 | else throw("Match error") | |
161 | 141 | } | |
162 | 142 | ||
163 | - | let | |
164 | - | then | |
143 | + | let V = (F - (if ((y == t)) | |
144 | + | then S | |
165 | 145 | else 0)) | |
166 | 146 | ||
167 | - | let | |
168 | - | then | |
147 | + | let W = (G - (if ((z == t)) | |
148 | + | then S | |
169 | 149 | else 0)) | |
170 | 150 | ||
171 | - | let | |
172 | - | then | |
151 | + | let X = (Q(y) + (if ((y == t)) | |
152 | + | then S | |
173 | 153 | else 0)) | |
174 | 154 | ||
175 | - | let | |
176 | - | then | |
155 | + | let Y = (Q(z) + (if ((z == t)) | |
156 | + | then S | |
177 | 157 | else 0)) | |
178 | 158 | ||
179 | - | let | |
180 | - | then ( | |
159 | + | let Z = if ((X >= F)) | |
160 | + | then (Y >= G) | |
181 | 161 | else false | |
182 | 162 | ||
183 | - | func ak (al,am) = (((fraction(Q, al, am) + fraction(Q, am, al)) / 2) / 10000) | |
184 | - | ||
185 | - | ||
186 | - | func an (al,am) = { | |
187 | - | let ao = ak(al, am) | |
188 | - | (fraction((al + am), P, pow(ao, S, X, Y, S, UP)) + (2 * fraction(pow(fraction(al, am, P), 0, 5, 1, (S / 2), DOWN), pow((ao - Z), S, X, Y, S, DOWN), P))) | |
189 | - | } | |
190 | - | ||
191 | - | ||
192 | - | func ap (aq,ar,as,at) = { | |
193 | - | let au = (P - ((P * 1) / 10000000)) | |
194 | - | let av = (aq - ar) | |
195 | - | let al = (G + as) | |
196 | - | let am = (H + as) | |
197 | - | let aw = if ((at == z)) | |
198 | - | then an(al, (H - aq)) | |
199 | - | else if ((at == A)) | |
200 | - | then an((G - aq), am) | |
201 | - | else throw("Wrong asset in payment") | |
202 | - | let ax = fraction(P, K, aw) | |
203 | - | func ay (az,aA) = if ((az == -1)) | |
163 | + | func aa (R) = { | |
164 | + | let B = R | |
165 | + | if ($isInstanceOf(B, "ByteVector")) | |
204 | 166 | then { | |
205 | - | let aB = (aq - ((aA * av) / 5)) | |
206 | - | let aC = if ((at == z)) | |
207 | - | then an(al, (H - aB)) | |
208 | - | else an((G - aB), am) | |
209 | - | if ((aC > K)) | |
210 | - | then aB | |
211 | - | else -1 | |
167 | + | let C = B | |
168 | + | let ab = toBase58String(C) | |
169 | + | let ac = valueOrErrorMessage(assetInfo(C), (("Asset " + ab) + " doesn't exist")) | |
170 | + | $Tuple3(ab, ac.name, ac.decimals) | |
212 | 171 | } | |
213 | - | else az | |
214 | - | ||
215 | - | let aD = { | |
216 | - | let aE = [1, 2, 3, 4, 5] | |
217 | - | let aF = size(aE) | |
218 | - | let aG = -1 | |
219 | - | if ((aF == 0)) | |
220 | - | then aG | |
221 | - | else { | |
222 | - | let aH = ay(aG, aE[0]) | |
223 | - | if ((aF == 1)) | |
224 | - | then aH | |
225 | - | else { | |
226 | - | let aI = ay(aH, aE[1]) | |
227 | - | if ((aF == 2)) | |
228 | - | then aI | |
229 | - | else { | |
230 | - | let aJ = ay(aI, aE[2]) | |
231 | - | if ((aF == 3)) | |
232 | - | then aJ | |
233 | - | else { | |
234 | - | let aK = ay(aJ, aE[3]) | |
235 | - | if ((aF == 4)) | |
236 | - | then aK | |
237 | - | else { | |
238 | - | let aL = ay(aK, aE[4]) | |
239 | - | if ((aF == 5)) | |
240 | - | then aL | |
241 | - | else { | |
242 | - | let aM = ay(aL, aE[5]) | |
243 | - | throw("List size exceed 5") | |
244 | - | } | |
245 | - | } | |
246 | - | } | |
247 | - | } | |
248 | - | } | |
249 | - | } | |
250 | - | } | |
251 | - | if ((0 > aD)) | |
252 | - | then throw("something went wrong while working with amountToSend") | |
253 | - | else if (if ((ax > au)) | |
254 | - | then (aw > K) | |
255 | - | else false) | |
256 | - | then aq | |
257 | - | else aD | |
258 | - | } | |
259 | - | ||
260 | - | ||
261 | - | func aN (ab) = { | |
262 | - | let C = ab | |
263 | - | if ($isInstanceOf(C, "ByteVector")) | |
264 | - | then { | |
265 | - | let D = C | |
266 | - | let aO = toBase58String(D) | |
267 | - | let aP = valueOrErrorMessage(assetInfo(D), (("Asset " + aO) + " doesn't exist")) | |
268 | - | $Tuple3(aO, aP.name, aP.decimals) | |
269 | - | } | |
270 | - | else if ($isInstanceOf(C, "Unit")) | |
172 | + | else if ($isInstanceOf(B, "Unit")) | |
271 | 173 | then { | |
272 | - | let | |
174 | + | let D = B | |
273 | 175 | $Tuple3("WAVES", "WAVES", 8) | |
274 | 176 | } | |
275 | 177 | else throw("Match error") | |
276 | 178 | } | |
277 | 179 | ||
278 | 180 | ||
279 | - | func | |
181 | + | func ad (ae) = [BooleanEntry(c, false), StringEntry(l, ae)] | |
280 | 182 | ||
281 | 183 | ||
282 | - | func | |
184 | + | func af (ag,R) = if ((R == t)) | |
283 | 185 | then { | |
284 | - | let | |
285 | - | if ((0 >= | |
286 | - | then throw((((("Insufficient amount " + toString( | |
287 | - | else | |
186 | + | let ah = (ag - u) | |
187 | + | if ((0 >= ah)) | |
188 | + | then throw((((("Insufficient amount " + toString(ag)) + " to deduct staking fee ") + toString(u)) + " USD-N")) | |
189 | + | else ah | |
288 | 190 | } | |
289 | - | else | |
191 | + | else ag | |
290 | 192 | ||
291 | 193 | ||
292 | - | func | |
194 | + | func ai (ag,aj,ak) = throw((((((((("Insufficient DApp balance to pay " + toString(ag)) + " ") + ak) + " due to staking. Available: ") + toString(aj)) + " ") + ak) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
293 | 195 | ||
294 | 196 | ||
295 | - | func | |
197 | + | func al (am,an) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(am)) + " ") + A) + " and ") + toString(an)) + " ") + E) + " due to staking. Available: ") + toString(V)) + " ") + A) + " and ") + toString(W)) + " ") + E) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
296 | 198 | ||
297 | 199 | ||
298 | - | func aX () = throw("Only admin can call this function") | |
299 | - | ||
300 | - | ||
301 | - | func aY () = throw(((("Incorrect assets attached. Expected: " + x) + " and ") + y)) | |
302 | - | ||
303 | - | ||
304 | - | func aZ (ba,bb,bc) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(ba)) + ": ") + toString(bb)) + " ") + B) + ", ") + toString(bc)) + " ") + F)) | |
305 | - | ||
306 | - | ||
307 | - | func bd (aT,be,bf) = throw((((((((("Insufficient DApp balance to pay " + toString(aT)) + " ") + bf) + " due to staking. Available: ") + toString(be)) + " ") + bf) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
308 | - | ||
309 | - | ||
310 | - | func bg (bb,bc) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(bb)) + " ") + B) + " and ") + toString(bc)) + " ") + F) + " due to staking. Available: ") + toString(af)) + " ") + B) + " and ") + toString(ag)) + " ") + F) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
311 | - | ||
312 | - | ||
313 | - | func bh () = aQ(((((((((((((((("Suspicious state. Actual balances: " + toString(G)) + " ") + B) + ", ") + toString(H)) + " ") + F) + ". State: ") + toString(aa(z))) + " ") + B) + ", ") + toString(aa(A))) + " ") + F)) | |
314 | - | ||
315 | - | ||
316 | - | @Callable(bi) | |
200 | + | @Callable(ao) | |
317 | 201 | func init () = { | |
318 | - | let | |
319 | - | let | |
320 | - | let | |
321 | - | let | |
322 | - | let | |
323 | - | let | |
324 | - | let | |
325 | - | let | |
326 | - | let | |
327 | - | let | |
328 | - | let | |
329 | - | let | |
330 | - | let | |
331 | - | let | |
202 | + | let ap = $Tuple2(ao.payments[0].amount, ao.payments[0].assetId) | |
203 | + | let aq = ap._1 | |
204 | + | let ar = ap._2 | |
205 | + | let as = $Tuple2(ao.payments[1].amount, ao.payments[1].assetId) | |
206 | + | let at = as._1 | |
207 | + | let au = as._2 | |
208 | + | let av = aa(ar) | |
209 | + | let aw = av._1 | |
210 | + | let ax = av._2 | |
211 | + | let ay = av._3 | |
212 | + | let az = aa(au) | |
213 | + | let aA = az._1 | |
214 | + | let aB = az._2 | |
215 | + | let aC = az._3 | |
332 | 216 | if (isDefined(getBoolean(this, c))) | |
333 | - | then | |
334 | - | else if (( | |
217 | + | then throw("DApp is already active") | |
218 | + | else if ((ar == au)) | |
335 | 219 | then throw("Assets must be different") | |
336 | 220 | else { | |
337 | - | let bx = ((("s" + take(br, 7)) + "_") + take(bv, 7)) | |
338 | - | let by = ((((("ShareToken of SwopFi protocol for " + br) + " and ") + bv) + " at address ") + toString(this)) | |
339 | - | let bz = ((bs + bw) / 2) | |
340 | - | let bA = fraction(pow(bk, bs, 5, 1, bs, HALFDOWN), pow(bn, bw, 5, 1, bw, HALFDOWN), pow(10, 0, bz, 0, 0, HALFDOWN)) | |
341 | - | let bB = Issue(bx, by, bA, bz, true) | |
342 | - | let bC = calculateAssetId(bB) | |
343 | - | let bD = an(bk, bn) | |
344 | - | [StringEntry(b, a), BooleanEntry(c, true), StringEntry(d, bq), StringEntry(e, bu), IntegerEntry(f, bk), IntegerEntry(g, bn), IntegerEntry(l, bD), IntegerEntry(j, L), IntegerEntry(k, N), bB, StringEntry(h, toBase58String(bC)), IntegerEntry(i, bA), ScriptTransfer(bi.caller, bA, bC)] | |
221 | + | let aD = ((("s" + take(ax, 7)) + "_") + take(aB, 7)) | |
222 | + | let aE = ((((("ShareToken of SwopFi protocol for " + ax) + " and ") + aB) + " at address ") + toString(this)) | |
223 | + | let aF = ((ay + aC) / 2) | |
224 | + | let aG = fraction(pow(aq, ay, 5, 1, ay, HALFDOWN), pow(at, aC, 5, 1, aC, HALFDOWN), pow(10, 0, aF, 0, 0, HALFDOWN)) | |
225 | + | let aH = Issue(aD, aE, aG, aF, true) | |
226 | + | let aI = calculateAssetId(aH) | |
227 | + | [StringEntry(b, a), BooleanEntry(c, true), StringEntry(d, aw), StringEntry(e, aA), IntegerEntry(f, aq), IntegerEntry(g, at), IntegerEntry(j, J), IntegerEntry(k, L), aH, StringEntry(h, toBase58String(aI)), IntegerEntry(i, aG), ScriptTransfer(ao.caller, aG, aI)] | |
345 | 228 | } | |
346 | 229 | } | |
347 | 230 | ||
348 | 231 | ||
349 | 232 | ||
350 | - | @Callable(bi) | |
351 | - | func replenishWithTwoTokens (bE) = { | |
352 | - | let bl = bi.payments[0].assetId | |
353 | - | let bo = bi.payments[1].assetId | |
354 | - | let bk = aS(bi.payments[0].amount, bl) | |
355 | - | let bn = aS(bi.payments[1].amount, bo) | |
356 | - | let bF = fraction(fraction(P, G, bk), O, fraction(P, H, bn)) | |
357 | - | let bG = fraction(P, bk, G) | |
358 | - | let bH = fraction(P, bn, H) | |
359 | - | let bI = fraction(min([bG, bH]), J, P) | |
360 | - | let bD = an((G + bk), (H + bn)) | |
361 | - | if (!(w)) | |
362 | - | then aW() | |
363 | - | else if (if ((0 > bE)) | |
233 | + | @Callable(ao) | |
234 | + | func replenishWithTwoTokens (aJ) = { | |
235 | + | let ar = ao.payments[0].assetId | |
236 | + | let au = ao.payments[1].assetId | |
237 | + | let aq = af(ao.payments[0].amount, ar) | |
238 | + | let at = af(ao.payments[1].amount, au) | |
239 | + | let aK = fraction(fraction(F, N, aq), M, fraction(G, N, at)) | |
240 | + | let aL = fraction(aq, N, F) | |
241 | + | let aM = fraction(at, N, G) | |
242 | + | let aN = fraction(min([aL, aM]), I, N) | |
243 | + | if (!(v)) | |
244 | + | then throw("DApp is inactive at this moment") | |
245 | + | else if (if ((0 > aJ)) | |
364 | 246 | then true | |
365 | - | else ( | |
366 | - | then throw("Slippage tolerance must be | |
367 | - | else if ((size( | |
247 | + | else (aJ > O)) | |
248 | + | then throw(((("Slippage tolerance must be between 0 and " + toString(O)) + " inclusively. Actual: ") + toString(aJ))) | |
249 | + | else if ((size(ao.payments) != 2)) | |
368 | 250 | then throw("Two attached assets expected") | |
369 | - | else if (if (( | |
251 | + | else if (if ((ar != y)) | |
370 | 252 | then true | |
371 | - | else ( | |
372 | - | then | |
373 | - | else if (if (((( | |
253 | + | else (au != z)) | |
254 | + | then throw(((("Incorrect assets attached. Expected: " + w) + " and ") + x)) | |
255 | + | else if (if ((((M * (O - aJ)) / O) > aK)) | |
374 | 256 | then true | |
375 | - | else ( | |
257 | + | else (aK > ((M * (O + aJ)) / O))) | |
376 | 258 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
377 | - | else if (( | |
259 | + | else if ((aN == 0)) | |
378 | 260 | then throw("Too small amount to replenish") | |
379 | - | else if (!( | |
380 | - | then | |
381 | - | else [IntegerEntry(f, ( | |
261 | + | else if (!(Z)) | |
262 | + | then ad(((((((((((((((("Suspicious state. Actual balances: " + toString(F)) + " ") + A) + ", ") + toString(G)) + " ") + E) + ". State: ") + toString(Q(y))) + " ") + A) + ", ") + toString(Q(z))) + " ") + E)) | |
263 | + | else [IntegerEntry(f, (F + aq)), IntegerEntry(g, (G + at)), IntegerEntry(i, (I + aN)), Reissue(H, aN, true), ScriptTransfer(ao.caller, aN, H)] | |
382 | 264 | } | |
383 | 265 | ||
384 | 266 | ||
385 | 267 | ||
386 | - | @Callable(bi) | |
387 | - | func replenishWithOneToken (bJ,bK) = { | |
388 | - | let bL = $Tuple2(bi.payments[0].amount, bi.payments[0].assetId) | |
389 | - | let bM = bL._1 | |
390 | - | let bN = bL._2 | |
391 | - | let bO = 5000000 | |
392 | - | let bP = 50000000 | |
393 | - | let bQ = if ((bP > bM)) | |
394 | - | then 100000 | |
395 | - | else 1 | |
396 | - | let bR = (P - ((P * bQ) / 10000000)) | |
397 | - | let bS = (P + ((P * bQ) / 10000000)) | |
398 | - | let bT = (P - ((P * 1) / 10000000)) | |
399 | - | let bU = (P + ((P * 1) / 10000000)) | |
400 | - | if (!(w)) | |
401 | - | then aW() | |
402 | - | else if ((bO > bM)) | |
403 | - | then throw((((("Payment amount " + toString(bM)) + " does not exceed the minimum amount of ") + toString(bO)) + " tokens")) | |
404 | - | else if ((size(bi.payments) != 1)) | |
405 | - | then throw("One attached payment expected") | |
406 | - | else if (!(aj)) | |
407 | - | then bh() | |
408 | - | else if (if ((bN != z)) | |
409 | - | then (bN != A) | |
410 | - | else false) | |
411 | - | then aY() | |
412 | - | else { | |
413 | - | let bV = if ((bN == z)) | |
414 | - | then $Tuple7((bM - bJ), bK, (G + bJ), (H - bK), an((G + bM), H), (G + bM), H) | |
415 | - | else $Tuple7(bK, (bM - bJ), (G - bK), (H + bJ), an(G, (H + bM)), G, (H + bM)) | |
416 | - | let bW = bV._1 | |
417 | - | let bX = bV._2 | |
418 | - | let bY = bV._3 | |
419 | - | let bZ = bV._4 | |
420 | - | let bD = bV._5 | |
421 | - | let ca = bV._6 | |
422 | - | let cb = bV._7 | |
423 | - | let cc = if ((bN == z)) | |
424 | - | then IntegerEntry(f, ca) | |
425 | - | else IntegerEntry(g, cb) | |
426 | - | let aw = an(bY, bZ) | |
427 | - | let ax = fraction(P, K, aw) | |
428 | - | let cd = (fraction((P * P), bY, bZ) / fraction(P, bW, bX)) | |
429 | - | let ce = fraction((ca + cb), T, (2 * U)) | |
430 | - | if (if ((bT >= ax)) | |
431 | - | then true | |
432 | - | else (K > aw)) | |
433 | - | then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
434 | - | else if (if ((bR > cd)) | |
435 | - | then true | |
436 | - | else (cd > bS)) | |
437 | - | then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect") | |
438 | - | else if (if ((ce > ca)) | |
439 | - | then true | |
440 | - | else (ce > cb)) | |
441 | - | then aZ(ce, ca, cb) | |
442 | - | else { | |
443 | - | let bG = fraction(aS(bW, z), P, bY) | |
444 | - | let bH = fraction(aS(bX, A), P, bZ) | |
445 | - | let bI = fraction(min([bG, bH]), J, P) | |
446 | - | [Reissue(I, bI, true), ScriptTransfer(bi.caller, bI, I), IntegerEntry(i, (J + bI)), cc, IntegerEntry(l, bD)] | |
447 | - | } | |
448 | - | } | |
268 | + | @Callable(ao) | |
269 | + | func withdraw () = { | |
270 | + | let aO = $Tuple2(ao.payments[0].amount, ao.payments[0].assetId) | |
271 | + | let aP = aO._1 | |
272 | + | let aQ = aO._2 | |
273 | + | let aR = af(fraction(aP, F, I), y) | |
274 | + | let aS = af(fraction(aP, G, I), z) | |
275 | + | if (!(v)) | |
276 | + | then throw("DApp is inactive at this moment") | |
277 | + | else if ((size(ao.payments) != 1)) | |
278 | + | then throw("One attached payment expected") | |
279 | + | else if ((aQ != H)) | |
280 | + | then throw(("Incorrect asset attached. Expected: " + toBase58String(H))) | |
281 | + | else if (!(Z)) | |
282 | + | then ad(((((((((((((((("Suspicious state. Actual balances: " + toString(F)) + " ") + A) + ", ") + toString(G)) + " ") + E) + ". State: ") + toString(Q(y))) + " ") + A) + ", ") + toString(Q(z))) + " ") + E)) | |
283 | + | else if (if ((aR > V)) | |
284 | + | then true | |
285 | + | else (aS > W)) | |
286 | + | then al(aR, aS) | |
287 | + | else [IntegerEntry(f, (F - aR)), IntegerEntry(g, (G - aS)), IntegerEntry(i, (I - aP)), Burn(H, aP), ScriptTransfer(ao.caller, aR, y), ScriptTransfer(ao.caller, aS, z)] | |
449 | 288 | } | |
450 | 289 | ||
451 | 290 | ||
452 | 291 | ||
453 | - | @Callable(bi) | |
454 | - | func withdraw () = { | |
455 | - | let cf = $Tuple2(bi.payments[0].amount, bi.payments[0].assetId) | |
456 | - | let bM = cf._1 | |
457 | - | let bN = cf._2 | |
458 | - | let cg = aS(fraction(bM, G, J), z) | |
459 | - | let ch = aS(fraction(bM, H, J), A) | |
460 | - | let bD = an((G - cg), (H - ch)) | |
461 | - | if (!(w)) | |
462 | - | then aW() | |
463 | - | else if ((size(bi.payments) != 1)) | |
464 | - | then throw("One attached payment expected") | |
465 | - | else if ((bN != I)) | |
466 | - | then throw(("Incorrect asset attached. Expected: " + toBase58String(I))) | |
467 | - | else if (!(aj)) | |
468 | - | then bh() | |
469 | - | else if (if ((cg > af)) | |
470 | - | then true | |
471 | - | else (ch > ag)) | |
472 | - | then bg(cg, ch) | |
473 | - | else [IntegerEntry(f, (G - cg)), IntegerEntry(g, (H - ch)), IntegerEntry(i, (J - bM)), IntegerEntry(l, bD), Burn(I, bM), ScriptTransfer(bi.caller, cg, z), ScriptTransfer(bi.caller, ch, A)] | |
292 | + | @Callable(ao) | |
293 | + | func exchange (aT) = { | |
294 | + | let aU = $Tuple2(ao.payments[0].amount, ao.payments[0].assetId) | |
295 | + | let aP = aU._1 | |
296 | + | let aQ = aU._2 | |
297 | + | func aV (aW,aX) = { | |
298 | + | let aY = fraction(aX, aP, (aP + aW)) | |
299 | + | let aZ = fraction(aY, (L - J), L) | |
300 | + | let ba = fraction(aY, K, L) | |
301 | + | if ((aT > aZ)) | |
302 | + | then throw(((("Calculated amount to receive " + toString(aZ)) + " is less than specified minimum ") + toString(aT))) | |
303 | + | else $Tuple3(aY, aZ, ba) | |
304 | + | } | |
305 | + | ||
306 | + | if (!(v)) | |
307 | + | then throw("DApp is inactive at this moment") | |
308 | + | else if ((0 >= aT)) | |
309 | + | then throw(("Minimal amount to receive must be positive. Actual: " + toString(aT))) | |
310 | + | else if ((size(ao.payments) != 1)) | |
311 | + | then throw("One attached payment expected") | |
312 | + | else if (!(Z)) | |
313 | + | then ad(((((((((((((((("Suspicious state. Actual balances: " + toString(F)) + " ") + A) + ", ") + toString(G)) + " ") + E) + ". State: ") + toString(Q(y))) + " ") + A) + ", ") + toString(Q(z))) + " ") + E)) | |
314 | + | else if ((aQ == y)) | |
315 | + | then { | |
316 | + | let bb = z | |
317 | + | let bc = aV(F, G) | |
318 | + | let aY = bc._1 | |
319 | + | let aZ = bc._2 | |
320 | + | let ba = bc._3 | |
321 | + | let bd = (F + aP) | |
322 | + | let be = ((G - aZ) - ba) | |
323 | + | if (if (if ((y == t)) | |
324 | + | then (S >= bd) | |
325 | + | else false) | |
326 | + | then true | |
327 | + | else if ((z == t)) | |
328 | + | then (S >= be) | |
329 | + | else false) | |
330 | + | then ai(aZ, W, E) | |
331 | + | else [IntegerEntry(f, bd), IntegerEntry(g, be), ScriptTransfer(ao.caller, aZ, bb), ScriptTransfer(r, ba, bb)] | |
332 | + | } | |
333 | + | else if ((aQ == z)) | |
334 | + | then { | |
335 | + | let bb = y | |
336 | + | let bf = aV(G, F) | |
337 | + | let aY = bf._1 | |
338 | + | let aZ = bf._2 | |
339 | + | let ba = bf._3 | |
340 | + | let bd = ((F - aZ) - ba) | |
341 | + | let be = (G + aP) | |
342 | + | if (if (if ((y == t)) | |
343 | + | then (S >= bd) | |
344 | + | else false) | |
345 | + | then true | |
346 | + | else if ((z == t)) | |
347 | + | then (S >= be) | |
348 | + | else false) | |
349 | + | then ai(aZ, V, A) | |
350 | + | else [IntegerEntry(f, bd), IntegerEntry(g, be), ScriptTransfer(ao.caller, aZ, bb), ScriptTransfer(r, ba, bb)] | |
351 | + | } | |
352 | + | else throw(((("Incorrect asset attached. Expected: " + w) + " or ") + x)) | |
474 | 353 | } | |
475 | 354 | ||
476 | 355 | ||
477 | 356 | ||
478 | - | @Callable(bi) | |
479 | - | func exchange (ci,cj) = { | |
480 | - | let ck = $Tuple2(bi.payments[0].amount, bi.payments[0].assetId) | |
481 | - | let bM = ck._1 | |
482 | - | let bN = ck._2 | |
483 | - | if (!(w)) | |
484 | - | then aW() | |
485 | - | else if ((0 >= ci)) | |
486 | - | then throw(("Estimated amount must be positive. Actual: " + toString(ci))) | |
487 | - | else if ((cj > ci)) | |
488 | - | then throw(((("Minimal amount can't be greater than estimated. Estimated: " + toString(ci)) + ". Minimal: ") + toString(cj))) | |
489 | - | else if ((size(bi.payments) != 1)) | |
490 | - | then throw("One attached payment expected") | |
491 | - | else if (!(aj)) | |
492 | - | then bh() | |
493 | - | else if (if ((bN != z)) | |
494 | - | then (bN != A) | |
495 | - | else false) | |
496 | - | then aY() | |
497 | - | else if ((10000000 > bM)) | |
498 | - | then throw("Only swap of 10.000000 or more tokens is allowed") | |
499 | - | else if (if ((V > fraction(P, cj, bM))) | |
500 | - | then true | |
501 | - | else (fraction(P, ci, bM) > W)) | |
502 | - | then throw("Incorrect args and pmt ratio") | |
503 | - | else { | |
504 | - | let cl = if ((bN == z)) | |
505 | - | then A | |
506 | - | else z | |
507 | - | let aT = ap(ci, cj, bM, bN) | |
508 | - | let cm = fraction(aT, M, N) | |
509 | - | let cn = fraction(aT, (N - L), N) | |
510 | - | let co = if ((bN == z)) | |
511 | - | then $Tuple2((G + bM), ((H - cn) - cm)) | |
512 | - | else $Tuple2(((G - cn) - cm), (H + bM)) | |
513 | - | let ca = co._1 | |
514 | - | let cb = co._2 | |
515 | - | let ce = fraction((ca + cb), T, (2 * U)) | |
516 | - | if (if ((ce > ca)) | |
517 | - | then true | |
518 | - | else (ce > cb)) | |
519 | - | then aZ(ce, ca, cb) | |
520 | - | else if (if (if ((z == u)) | |
521 | - | then (cl == z) | |
522 | - | else false) | |
523 | - | then (ac >= ca) | |
524 | - | else false) | |
525 | - | then bd(cn, af, B) | |
526 | - | else if (if (if ((A == u)) | |
527 | - | then (cl == A) | |
528 | - | else false) | |
529 | - | then (ac >= cb) | |
530 | - | else false) | |
531 | - | then bd(cn, ag, F) | |
532 | - | else [IntegerEntry(f, ca), IntegerEntry(g, cb), IntegerEntry(l, an(ca, cb)), ScriptTransfer(bi.caller, cn, cl), ScriptTransfer(s, cm, cl)] | |
533 | - | } | |
357 | + | @Callable(ao) | |
358 | + | func shutdown () = if (!(v)) | |
359 | + | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, l), "the cause wasn't specified"))) | |
360 | + | else if (!(containsElement([m, n, o, p], ao.callerPublicKey))) | |
361 | + | then throw("Only admin can call this function") | |
362 | + | else ad("Paused by admin") | |
363 | + | ||
364 | + | ||
365 | + | ||
366 | + | @Callable(ao) | |
367 | + | func activate () = if (v) | |
368 | + | then throw("DApp is already active") | |
369 | + | else if (!(containsElement([m, n, o, p], ao.callerPublicKey))) | |
370 | + | then throw("Only admin can call this function") | |
371 | + | else [BooleanEntry(c, true), DeleteEntry(l)] | |
372 | + | ||
373 | + | ||
374 | + | ||
375 | + | @Callable(ao) | |
376 | + | func takeIntoAccountExtraFunds (bg) = { | |
377 | + | let bh = (X - F) | |
378 | + | let bi = (Y - G) | |
379 | + | let bj = (bh - (if ((y == t)) | |
380 | + | then bg | |
381 | + | else 0)) | |
382 | + | let bk = (bi - (if ((z == t)) | |
383 | + | then bg | |
384 | + | else 0)) | |
385 | + | if (!(v)) | |
386 | + | then throw("DApp is inactive at this moment") | |
387 | + | else if ((ao.caller != this)) | |
388 | + | then throw("Only the DApp itself can call this function") | |
389 | + | else if ((0 > bg)) | |
390 | + | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(bg))) | |
391 | + | else if (if ((0 > bh)) | |
392 | + | then true | |
393 | + | else (0 > bi)) | |
394 | + | then ad("Enroll amount negative") | |
395 | + | else if (if ((0 > bj)) | |
396 | + | then true | |
397 | + | else (0 > bk)) | |
398 | + | then throw("Too large amountLeave") | |
399 | + | else [IntegerEntry(f, (F + bj)), IntegerEntry(g, (G + bk)), IntegerEntry(("last_income_" + w), bj), IntegerEntry(("last_income_" + x), bk)] | |
534 | 400 | } | |
535 | 401 | ||
536 | 402 | ||
537 | - | ||
538 | - | @Callable(bi) | |
539 | - | func shutdown () = if (!(w)) | |
540 | - | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, m), "the cause wasn't specified"))) | |
541 | - | else if (!(containsElement([n, o, p, q], bi.callerPublicKey))) | |
542 | - | then aX() | |
543 | - | else aQ("Paused by admin") | |
544 | - | ||
545 | - | ||
546 | - | ||
547 | - | @Callable(bi) | |
548 | - | func activate () = if (w) | |
549 | - | then aV() | |
550 | - | else if (!(containsElement([n, o, p, q], bi.callerPublicKey))) | |
551 | - | then aX() | |
552 | - | else [BooleanEntry(c, true), DeleteEntry(m)] | |
553 | - | ||
554 | - | ||
555 | - | ||
556 | - | @Callable(bi) | |
557 | - | func takeIntoAccountExtraFunds (cp) = { | |
558 | - | let cq = (ah - G) | |
559 | - | let cr = (ai - H) | |
560 | - | let cs = (cq - (if ((z == u)) | |
561 | - | then cp | |
562 | - | else 0)) | |
563 | - | let ct = (cr - (if ((A == u)) | |
564 | - | then cp | |
565 | - | else 0)) | |
566 | - | if (!(w)) | |
567 | - | then aW() | |
568 | - | else if ((bi.caller != this)) | |
569 | - | then aX() | |
570 | - | else if ((0 > cp)) | |
571 | - | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(cp))) | |
572 | - | else if (if ((0 > cq)) | |
573 | - | then true | |
574 | - | else (0 > cr)) | |
575 | - | then aQ("Enroll amount negative") | |
576 | - | else if (if ((0 > cs)) | |
577 | - | then true | |
578 | - | else (0 > ct)) | |
579 | - | then throw("Too large amountLeave") | |
580 | - | else [IntegerEntry(f, (G + cs)), IntegerEntry(g, (H + ct)), IntegerEntry(("last_income_" + x), cs), IntegerEntry(("last_income_" + y), ct)] | |
581 | - | } | |
582 | - | ||
583 | - | ||
584 | - | @Verifier(cu) | |
585 | - | func cv () = { | |
586 | - | let C = cu | |
587 | - | if ($isInstanceOf(C, "InvokeScriptTransaction")) | |
403 | + | @Verifier(bl) | |
404 | + | func bm () = { | |
405 | + | let B = bl | |
406 | + | if ($isInstanceOf(B, "InvokeScriptTransaction")) | |
588 | 407 | then { | |
589 | - | let | |
590 | - | let | |
591 | - | then ( | |
408 | + | let bn = B | |
409 | + | let bo = if ((bn.dApp == this)) | |
410 | + | then (bn.function == "takeIntoAccountExtraFunds") | |
592 | 411 | else false | |
593 | - | let | |
594 | - | then if (if (if (( | |
595 | - | then (size( | |
412 | + | let bp = if ((bn.dApp == s)) | |
413 | + | then if (if (if ((bn.function == "lockNeutrino")) | |
414 | + | then (size(bn.payments) == 1) | |
596 | 415 | else false) | |
597 | - | then ( | |
416 | + | then (bn.payments[0].assetId == t) | |
598 | 417 | else false) | |
599 | 418 | then true | |
600 | - | else if (( | |
601 | - | then (size( | |
419 | + | else if ((bn.function == "unlockNeutrino")) | |
420 | + | then (size(bn.payments) == 0) | |
602 | 421 | else false | |
603 | 422 | else false | |
604 | - | let | |
423 | + | let bq = if (if (if (sigVerify(bl.bodyBytes, bl.proofs[0], m)) | |
605 | 424 | then true | |
606 | - | else sigVerify( | |
425 | + | else sigVerify(bl.bodyBytes, bl.proofs[0], n)) | |
607 | 426 | then true | |
608 | - | else sigVerify( | |
427 | + | else sigVerify(bl.bodyBytes, bl.proofs[0], o)) | |
609 | 428 | then true | |
610 | - | else sigVerify( | |
611 | - | if ( | |
429 | + | else sigVerify(bl.bodyBytes, bl.proofs[0], q) | |
430 | + | if (bo) | |
612 | 431 | then true | |
613 | - | else | |
432 | + | else bp | |
614 | 433 | } | |
615 | - | else sigVerify( | |
434 | + | else sigVerify(bl.bodyBytes, bl.proofs[0], bl.senderPublicKey) | |
616 | 435 | } | |
617 | 436 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = " | |
4 | + | let a = "1.0.0" | |
5 | 5 | ||
6 | 6 | let b = "version" | |
7 | 7 | ||
8 | 8 | let c = "active" | |
9 | 9 | ||
10 | 10 | let d = "A_asset_id" | |
11 | 11 | ||
12 | 12 | let e = "B_asset_id" | |
13 | 13 | ||
14 | 14 | let f = "A_asset_balance" | |
15 | 15 | ||
16 | 16 | let g = "B_asset_balance" | |
17 | 17 | ||
18 | 18 | let h = "share_asset_id" | |
19 | 19 | ||
20 | 20 | let i = "share_asset_supply" | |
21 | 21 | ||
22 | 22 | let j = "commission" | |
23 | 23 | ||
24 | 24 | let k = "commission_scale_delimiter" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "shutdown_cause" | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
29 | 29 | ||
30 | - | let n = base58' | |
30 | + | let n = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
31 | 31 | ||
32 | - | let o = base58' | |
32 | + | let o = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
33 | 33 | ||
34 | - | let p = base58' | |
34 | + | let p = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
35 | 35 | ||
36 | - | let q = base58' | |
36 | + | let q = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
37 | 37 | ||
38 | - | let r = base58' | |
38 | + | let r = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
39 | 39 | ||
40 | - | let s = Address(base58' | |
40 | + | let s = Address(base58'3N6q7sCGSSLBUXDdjBdYGTJbZGZfhhh8cNg') | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = (9 * value(value(assetInfo(t)).minSponsoredFee)) | |
45 | 45 | ||
46 | - | let v = ( | |
46 | + | let v = getBooleanValue(this, c) | |
47 | 47 | ||
48 | - | let w = | |
48 | + | let w = getStringValue(this, d) | |
49 | 49 | ||
50 | - | let x = getStringValue(this, | |
50 | + | let x = getStringValue(this, e) | |
51 | 51 | ||
52 | - | let y = getStringValue(this, e) | |
52 | + | let y = if ((w == "WAVES")) | |
53 | + | then unit | |
54 | + | else fromBase58String(w) | |
53 | 55 | ||
54 | 56 | let z = if ((x == "WAVES")) | |
55 | 57 | then unit | |
56 | 58 | else fromBase58String(x) | |
57 | 59 | ||
58 | - | let A = if ((y == "WAVES")) | |
59 | - | then unit | |
60 | - | else fromBase58String(y) | |
61 | - | ||
62 | - | let B = { | |
63 | - | let C = z | |
64 | - | if ($isInstanceOf(C, "ByteVector")) | |
60 | + | let A = { | |
61 | + | let B = y | |
62 | + | if ($isInstanceOf(B, "ByteVector")) | |
65 | 63 | then { | |
66 | - | let | |
67 | - | value(assetInfo( | |
64 | + | let C = B | |
65 | + | value(assetInfo(C)).name | |
68 | 66 | } | |
69 | - | else if ($isInstanceOf( | |
67 | + | else if ($isInstanceOf(B, "Unit")) | |
70 | 68 | then { | |
71 | - | let | |
69 | + | let D = B | |
72 | 70 | "WAVES" | |
73 | 71 | } | |
74 | 72 | else throw("Match error") | |
75 | 73 | } | |
76 | 74 | ||
77 | - | let | |
78 | - | let | |
79 | - | if ($isInstanceOf( | |
75 | + | let E = { | |
76 | + | let B = z | |
77 | + | if ($isInstanceOf(B, "ByteVector")) | |
80 | 78 | then { | |
81 | - | let | |
82 | - | value(assetInfo( | |
79 | + | let C = B | |
80 | + | value(assetInfo(C)).name | |
83 | 81 | } | |
84 | - | else if ($isInstanceOf( | |
82 | + | else if ($isInstanceOf(B, "Unit")) | |
85 | 83 | then { | |
86 | - | let | |
84 | + | let D = B | |
87 | 85 | "WAVES" | |
88 | 86 | } | |
89 | 87 | else throw("Match error") | |
90 | 88 | } | |
91 | 89 | ||
92 | - | let | |
90 | + | let F = getIntegerValue(this, f) | |
93 | 91 | ||
94 | - | let | |
92 | + | let G = getIntegerValue(this, g) | |
95 | 93 | ||
96 | - | let | |
94 | + | let H = fromBase58String(getStringValue(this, h)) | |
97 | 95 | ||
98 | - | let | |
96 | + | let I = getIntegerValue(this, i) | |
99 | 97 | ||
100 | - | let | |
98 | + | let J = 3000 | |
101 | 99 | ||
102 | - | let | |
100 | + | let K = 1200 | |
103 | 101 | ||
104 | - | let | |
102 | + | let L = 1000000 | |
105 | 103 | ||
106 | - | let N = 1000000 | |
104 | + | let M = 1000 | |
105 | + | ||
106 | + | let N = 100000000 | |
107 | 107 | ||
108 | 108 | let O = 1000 | |
109 | 109 | ||
110 | - | let P = | |
110 | + | let P = 8 | |
111 | 111 | ||
112 | - | let Q = 1000000000000 | |
113 | - | ||
114 | - | let R = 1000 | |
115 | - | ||
116 | - | let S = 8 | |
117 | - | ||
118 | - | let T = 50 | |
119 | - | ||
120 | - | let U = 100 | |
121 | - | ||
122 | - | let V = 90000000 | |
123 | - | ||
124 | - | let W = 110000000 | |
125 | - | ||
126 | - | let X = 50 | |
127 | - | ||
128 | - | let Y = 2 | |
129 | - | ||
130 | - | let Z = 46000000 | |
131 | - | ||
132 | - | func aa (ab) = { | |
133 | - | let C = ab | |
134 | - | if ($isInstanceOf(C, "ByteVector")) | |
112 | + | func Q (R) = { | |
113 | + | let B = R | |
114 | + | if ($isInstanceOf(B, "ByteVector")) | |
135 | 115 | then { | |
136 | - | let | |
137 | - | assetBalance(this, | |
116 | + | let C = B | |
117 | + | assetBalance(this, C) | |
138 | 118 | } | |
139 | - | else if ($isInstanceOf( | |
119 | + | else if ($isInstanceOf(B, "Unit")) | |
140 | 120 | then { | |
141 | - | let | |
121 | + | let D = B | |
142 | 122 | wavesBalance(this).available | |
143 | 123 | } | |
144 | 124 | else throw("Match error") | |
145 | 125 | } | |
146 | 126 | ||
147 | 127 | ||
148 | - | let | |
149 | - | let | |
150 | - | if ($isInstanceOf( | |
128 | + | let S = { | |
129 | + | let B = getInteger(s, ((("rpd_balance_" + toBase58String(t)) + "_") + toString(this))) | |
130 | + | if ($isInstanceOf(B, "Int")) | |
151 | 131 | then { | |
152 | - | let | |
153 | - | | |
132 | + | let T = B | |
133 | + | T | |
154 | 134 | } | |
155 | - | else if ($isInstanceOf( | |
135 | + | else if ($isInstanceOf(B, "Unit")) | |
156 | 136 | then { | |
157 | - | let | |
137 | + | let U = B | |
158 | 138 | 0 | |
159 | 139 | } | |
160 | 140 | else throw("Match error") | |
161 | 141 | } | |
162 | 142 | ||
163 | - | let | |
164 | - | then | |
143 | + | let V = (F - (if ((y == t)) | |
144 | + | then S | |
165 | 145 | else 0)) | |
166 | 146 | ||
167 | - | let | |
168 | - | then | |
147 | + | let W = (G - (if ((z == t)) | |
148 | + | then S | |
169 | 149 | else 0)) | |
170 | 150 | ||
171 | - | let | |
172 | - | then | |
151 | + | let X = (Q(y) + (if ((y == t)) | |
152 | + | then S | |
173 | 153 | else 0)) | |
174 | 154 | ||
175 | - | let | |
176 | - | then | |
155 | + | let Y = (Q(z) + (if ((z == t)) | |
156 | + | then S | |
177 | 157 | else 0)) | |
178 | 158 | ||
179 | - | let | |
180 | - | then ( | |
159 | + | let Z = if ((X >= F)) | |
160 | + | then (Y >= G) | |
181 | 161 | else false | |
182 | 162 | ||
183 | - | func ak (al,am) = (((fraction(Q, al, am) + fraction(Q, am, al)) / 2) / 10000) | |
184 | - | ||
185 | - | ||
186 | - | func an (al,am) = { | |
187 | - | let ao = ak(al, am) | |
188 | - | (fraction((al + am), P, pow(ao, S, X, Y, S, UP)) + (2 * fraction(pow(fraction(al, am, P), 0, 5, 1, (S / 2), DOWN), pow((ao - Z), S, X, Y, S, DOWN), P))) | |
189 | - | } | |
190 | - | ||
191 | - | ||
192 | - | func ap (aq,ar,as,at) = { | |
193 | - | let au = (P - ((P * 1) / 10000000)) | |
194 | - | let av = (aq - ar) | |
195 | - | let al = (G + as) | |
196 | - | let am = (H + as) | |
197 | - | let aw = if ((at == z)) | |
198 | - | then an(al, (H - aq)) | |
199 | - | else if ((at == A)) | |
200 | - | then an((G - aq), am) | |
201 | - | else throw("Wrong asset in payment") | |
202 | - | let ax = fraction(P, K, aw) | |
203 | - | func ay (az,aA) = if ((az == -1)) | |
163 | + | func aa (R) = { | |
164 | + | let B = R | |
165 | + | if ($isInstanceOf(B, "ByteVector")) | |
204 | 166 | then { | |
205 | - | let aB = (aq - ((aA * av) / 5)) | |
206 | - | let aC = if ((at == z)) | |
207 | - | then an(al, (H - aB)) | |
208 | - | else an((G - aB), am) | |
209 | - | if ((aC > K)) | |
210 | - | then aB | |
211 | - | else -1 | |
167 | + | let C = B | |
168 | + | let ab = toBase58String(C) | |
169 | + | let ac = valueOrErrorMessage(assetInfo(C), (("Asset " + ab) + " doesn't exist")) | |
170 | + | $Tuple3(ab, ac.name, ac.decimals) | |
212 | 171 | } | |
213 | - | else az | |
214 | - | ||
215 | - | let aD = { | |
216 | - | let aE = [1, 2, 3, 4, 5] | |
217 | - | let aF = size(aE) | |
218 | - | let aG = -1 | |
219 | - | if ((aF == 0)) | |
220 | - | then aG | |
221 | - | else { | |
222 | - | let aH = ay(aG, aE[0]) | |
223 | - | if ((aF == 1)) | |
224 | - | then aH | |
225 | - | else { | |
226 | - | let aI = ay(aH, aE[1]) | |
227 | - | if ((aF == 2)) | |
228 | - | then aI | |
229 | - | else { | |
230 | - | let aJ = ay(aI, aE[2]) | |
231 | - | if ((aF == 3)) | |
232 | - | then aJ | |
233 | - | else { | |
234 | - | let aK = ay(aJ, aE[3]) | |
235 | - | if ((aF == 4)) | |
236 | - | then aK | |
237 | - | else { | |
238 | - | let aL = ay(aK, aE[4]) | |
239 | - | if ((aF == 5)) | |
240 | - | then aL | |
241 | - | else { | |
242 | - | let aM = ay(aL, aE[5]) | |
243 | - | throw("List size exceed 5") | |
244 | - | } | |
245 | - | } | |
246 | - | } | |
247 | - | } | |
248 | - | } | |
249 | - | } | |
250 | - | } | |
251 | - | if ((0 > aD)) | |
252 | - | then throw("something went wrong while working with amountToSend") | |
253 | - | else if (if ((ax > au)) | |
254 | - | then (aw > K) | |
255 | - | else false) | |
256 | - | then aq | |
257 | - | else aD | |
258 | - | } | |
259 | - | ||
260 | - | ||
261 | - | func aN (ab) = { | |
262 | - | let C = ab | |
263 | - | if ($isInstanceOf(C, "ByteVector")) | |
264 | - | then { | |
265 | - | let D = C | |
266 | - | let aO = toBase58String(D) | |
267 | - | let aP = valueOrErrorMessage(assetInfo(D), (("Asset " + aO) + " doesn't exist")) | |
268 | - | $Tuple3(aO, aP.name, aP.decimals) | |
269 | - | } | |
270 | - | else if ($isInstanceOf(C, "Unit")) | |
172 | + | else if ($isInstanceOf(B, "Unit")) | |
271 | 173 | then { | |
272 | - | let | |
174 | + | let D = B | |
273 | 175 | $Tuple3("WAVES", "WAVES", 8) | |
274 | 176 | } | |
275 | 177 | else throw("Match error") | |
276 | 178 | } | |
277 | 179 | ||
278 | 180 | ||
279 | - | func | |
181 | + | func ad (ae) = [BooleanEntry(c, false), StringEntry(l, ae)] | |
280 | 182 | ||
281 | 183 | ||
282 | - | func | |
184 | + | func af (ag,R) = if ((R == t)) | |
283 | 185 | then { | |
284 | - | let | |
285 | - | if ((0 >= | |
286 | - | then throw((((("Insufficient amount " + toString( | |
287 | - | else | |
186 | + | let ah = (ag - u) | |
187 | + | if ((0 >= ah)) | |
188 | + | then throw((((("Insufficient amount " + toString(ag)) + " to deduct staking fee ") + toString(u)) + " USD-N")) | |
189 | + | else ah | |
288 | 190 | } | |
289 | - | else | |
191 | + | else ag | |
290 | 192 | ||
291 | 193 | ||
292 | - | func | |
194 | + | func ai (ag,aj,ak) = throw((((((((("Insufficient DApp balance to pay " + toString(ag)) + " ") + ak) + " due to staking. Available: ") + toString(aj)) + " ") + ak) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
293 | 195 | ||
294 | 196 | ||
295 | - | func | |
197 | + | func al (am,an) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(am)) + " ") + A) + " and ") + toString(an)) + " ") + E) + " due to staking. Available: ") + toString(V)) + " ") + A) + " and ") + toString(W)) + " ") + E) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
296 | 198 | ||
297 | 199 | ||
298 | - | func aX () = throw("Only admin can call this function") | |
299 | - | ||
300 | - | ||
301 | - | func aY () = throw(((("Incorrect assets attached. Expected: " + x) + " and ") + y)) | |
302 | - | ||
303 | - | ||
304 | - | func aZ (ba,bb,bc) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(ba)) + ": ") + toString(bb)) + " ") + B) + ", ") + toString(bc)) + " ") + F)) | |
305 | - | ||
306 | - | ||
307 | - | func bd (aT,be,bf) = throw((((((((("Insufficient DApp balance to pay " + toString(aT)) + " ") + bf) + " due to staking. Available: ") + toString(be)) + " ") + bf) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
308 | - | ||
309 | - | ||
310 | - | func bg (bb,bc) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(bb)) + " ") + B) + " and ") + toString(bc)) + " ") + F) + " due to staking. Available: ") + toString(af)) + " ") + B) + " and ") + toString(ag)) + " ") + F) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
311 | - | ||
312 | - | ||
313 | - | func bh () = aQ(((((((((((((((("Suspicious state. Actual balances: " + toString(G)) + " ") + B) + ", ") + toString(H)) + " ") + F) + ". State: ") + toString(aa(z))) + " ") + B) + ", ") + toString(aa(A))) + " ") + F)) | |
314 | - | ||
315 | - | ||
316 | - | @Callable(bi) | |
200 | + | @Callable(ao) | |
317 | 201 | func init () = { | |
318 | - | let | |
319 | - | let | |
320 | - | let | |
321 | - | let | |
322 | - | let | |
323 | - | let | |
324 | - | let | |
325 | - | let | |
326 | - | let | |
327 | - | let | |
328 | - | let | |
329 | - | let | |
330 | - | let | |
331 | - | let | |
202 | + | let ap = $Tuple2(ao.payments[0].amount, ao.payments[0].assetId) | |
203 | + | let aq = ap._1 | |
204 | + | let ar = ap._2 | |
205 | + | let as = $Tuple2(ao.payments[1].amount, ao.payments[1].assetId) | |
206 | + | let at = as._1 | |
207 | + | let au = as._2 | |
208 | + | let av = aa(ar) | |
209 | + | let aw = av._1 | |
210 | + | let ax = av._2 | |
211 | + | let ay = av._3 | |
212 | + | let az = aa(au) | |
213 | + | let aA = az._1 | |
214 | + | let aB = az._2 | |
215 | + | let aC = az._3 | |
332 | 216 | if (isDefined(getBoolean(this, c))) | |
333 | - | then | |
334 | - | else if (( | |
217 | + | then throw("DApp is already active") | |
218 | + | else if ((ar == au)) | |
335 | 219 | then throw("Assets must be different") | |
336 | 220 | else { | |
337 | - | let bx = ((("s" + take(br, 7)) + "_") + take(bv, 7)) | |
338 | - | let by = ((((("ShareToken of SwopFi protocol for " + br) + " and ") + bv) + " at address ") + toString(this)) | |
339 | - | let bz = ((bs + bw) / 2) | |
340 | - | let bA = fraction(pow(bk, bs, 5, 1, bs, HALFDOWN), pow(bn, bw, 5, 1, bw, HALFDOWN), pow(10, 0, bz, 0, 0, HALFDOWN)) | |
341 | - | let bB = Issue(bx, by, bA, bz, true) | |
342 | - | let bC = calculateAssetId(bB) | |
343 | - | let bD = an(bk, bn) | |
344 | - | [StringEntry(b, a), BooleanEntry(c, true), StringEntry(d, bq), StringEntry(e, bu), IntegerEntry(f, bk), IntegerEntry(g, bn), IntegerEntry(l, bD), IntegerEntry(j, L), IntegerEntry(k, N), bB, StringEntry(h, toBase58String(bC)), IntegerEntry(i, bA), ScriptTransfer(bi.caller, bA, bC)] | |
221 | + | let aD = ((("s" + take(ax, 7)) + "_") + take(aB, 7)) | |
222 | + | let aE = ((((("ShareToken of SwopFi protocol for " + ax) + " and ") + aB) + " at address ") + toString(this)) | |
223 | + | let aF = ((ay + aC) / 2) | |
224 | + | let aG = fraction(pow(aq, ay, 5, 1, ay, HALFDOWN), pow(at, aC, 5, 1, aC, HALFDOWN), pow(10, 0, aF, 0, 0, HALFDOWN)) | |
225 | + | let aH = Issue(aD, aE, aG, aF, true) | |
226 | + | let aI = calculateAssetId(aH) | |
227 | + | [StringEntry(b, a), BooleanEntry(c, true), StringEntry(d, aw), StringEntry(e, aA), IntegerEntry(f, aq), IntegerEntry(g, at), IntegerEntry(j, J), IntegerEntry(k, L), aH, StringEntry(h, toBase58String(aI)), IntegerEntry(i, aG), ScriptTransfer(ao.caller, aG, aI)] | |
345 | 228 | } | |
346 | 229 | } | |
347 | 230 | ||
348 | 231 | ||
349 | 232 | ||
350 | - | @Callable(bi) | |
351 | - | func replenishWithTwoTokens (bE) = { | |
352 | - | let bl = bi.payments[0].assetId | |
353 | - | let bo = bi.payments[1].assetId | |
354 | - | let bk = aS(bi.payments[0].amount, bl) | |
355 | - | let bn = aS(bi.payments[1].amount, bo) | |
356 | - | let bF = fraction(fraction(P, G, bk), O, fraction(P, H, bn)) | |
357 | - | let bG = fraction(P, bk, G) | |
358 | - | let bH = fraction(P, bn, H) | |
359 | - | let bI = fraction(min([bG, bH]), J, P) | |
360 | - | let bD = an((G + bk), (H + bn)) | |
361 | - | if (!(w)) | |
362 | - | then aW() | |
363 | - | else if (if ((0 > bE)) | |
233 | + | @Callable(ao) | |
234 | + | func replenishWithTwoTokens (aJ) = { | |
235 | + | let ar = ao.payments[0].assetId | |
236 | + | let au = ao.payments[1].assetId | |
237 | + | let aq = af(ao.payments[0].amount, ar) | |
238 | + | let at = af(ao.payments[1].amount, au) | |
239 | + | let aK = fraction(fraction(F, N, aq), M, fraction(G, N, at)) | |
240 | + | let aL = fraction(aq, N, F) | |
241 | + | let aM = fraction(at, N, G) | |
242 | + | let aN = fraction(min([aL, aM]), I, N) | |
243 | + | if (!(v)) | |
244 | + | then throw("DApp is inactive at this moment") | |
245 | + | else if (if ((0 > aJ)) | |
364 | 246 | then true | |
365 | - | else ( | |
366 | - | then throw("Slippage tolerance must be | |
367 | - | else if ((size( | |
247 | + | else (aJ > O)) | |
248 | + | then throw(((("Slippage tolerance must be between 0 and " + toString(O)) + " inclusively. Actual: ") + toString(aJ))) | |
249 | + | else if ((size(ao.payments) != 2)) | |
368 | 250 | then throw("Two attached assets expected") | |
369 | - | else if (if (( | |
251 | + | else if (if ((ar != y)) | |
370 | 252 | then true | |
371 | - | else ( | |
372 | - | then | |
373 | - | else if (if (((( | |
253 | + | else (au != z)) | |
254 | + | then throw(((("Incorrect assets attached. Expected: " + w) + " and ") + x)) | |
255 | + | else if (if ((((M * (O - aJ)) / O) > aK)) | |
374 | 256 | then true | |
375 | - | else ( | |
257 | + | else (aK > ((M * (O + aJ)) / O))) | |
376 | 258 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
377 | - | else if (( | |
259 | + | else if ((aN == 0)) | |
378 | 260 | then throw("Too small amount to replenish") | |
379 | - | else if (!( | |
380 | - | then | |
381 | - | else [IntegerEntry(f, ( | |
261 | + | else if (!(Z)) | |
262 | + | then ad(((((((((((((((("Suspicious state. Actual balances: " + toString(F)) + " ") + A) + ", ") + toString(G)) + " ") + E) + ". State: ") + toString(Q(y))) + " ") + A) + ", ") + toString(Q(z))) + " ") + E)) | |
263 | + | else [IntegerEntry(f, (F + aq)), IntegerEntry(g, (G + at)), IntegerEntry(i, (I + aN)), Reissue(H, aN, true), ScriptTransfer(ao.caller, aN, H)] | |
382 | 264 | } | |
383 | 265 | ||
384 | 266 | ||
385 | 267 | ||
386 | - | @Callable(bi) | |
387 | - | func replenishWithOneToken (bJ,bK) = { | |
388 | - | let bL = $Tuple2(bi.payments[0].amount, bi.payments[0].assetId) | |
389 | - | let bM = bL._1 | |
390 | - | let bN = bL._2 | |
391 | - | let bO = 5000000 | |
392 | - | let bP = 50000000 | |
393 | - | let bQ = if ((bP > bM)) | |
394 | - | then 100000 | |
395 | - | else 1 | |
396 | - | let bR = (P - ((P * bQ) / 10000000)) | |
397 | - | let bS = (P + ((P * bQ) / 10000000)) | |
398 | - | let bT = (P - ((P * 1) / 10000000)) | |
399 | - | let bU = (P + ((P * 1) / 10000000)) | |
400 | - | if (!(w)) | |
401 | - | then aW() | |
402 | - | else if ((bO > bM)) | |
403 | - | then throw((((("Payment amount " + toString(bM)) + " does not exceed the minimum amount of ") + toString(bO)) + " tokens")) | |
404 | - | else if ((size(bi.payments) != 1)) | |
405 | - | then throw("One attached payment expected") | |
406 | - | else if (!(aj)) | |
407 | - | then bh() | |
408 | - | else if (if ((bN != z)) | |
409 | - | then (bN != A) | |
410 | - | else false) | |
411 | - | then aY() | |
412 | - | else { | |
413 | - | let bV = if ((bN == z)) | |
414 | - | then $Tuple7((bM - bJ), bK, (G + bJ), (H - bK), an((G + bM), H), (G + bM), H) | |
415 | - | else $Tuple7(bK, (bM - bJ), (G - bK), (H + bJ), an(G, (H + bM)), G, (H + bM)) | |
416 | - | let bW = bV._1 | |
417 | - | let bX = bV._2 | |
418 | - | let bY = bV._3 | |
419 | - | let bZ = bV._4 | |
420 | - | let bD = bV._5 | |
421 | - | let ca = bV._6 | |
422 | - | let cb = bV._7 | |
423 | - | let cc = if ((bN == z)) | |
424 | - | then IntegerEntry(f, ca) | |
425 | - | else IntegerEntry(g, cb) | |
426 | - | let aw = an(bY, bZ) | |
427 | - | let ax = fraction(P, K, aw) | |
428 | - | let cd = (fraction((P * P), bY, bZ) / fraction(P, bW, bX)) | |
429 | - | let ce = fraction((ca + cb), T, (2 * U)) | |
430 | - | if (if ((bT >= ax)) | |
431 | - | then true | |
432 | - | else (K > aw)) | |
433 | - | then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
434 | - | else if (if ((bR > cd)) | |
435 | - | then true | |
436 | - | else (cd > bS)) | |
437 | - | then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect") | |
438 | - | else if (if ((ce > ca)) | |
439 | - | then true | |
440 | - | else (ce > cb)) | |
441 | - | then aZ(ce, ca, cb) | |
442 | - | else { | |
443 | - | let bG = fraction(aS(bW, z), P, bY) | |
444 | - | let bH = fraction(aS(bX, A), P, bZ) | |
445 | - | let bI = fraction(min([bG, bH]), J, P) | |
446 | - | [Reissue(I, bI, true), ScriptTransfer(bi.caller, bI, I), IntegerEntry(i, (J + bI)), cc, IntegerEntry(l, bD)] | |
447 | - | } | |
448 | - | } | |
268 | + | @Callable(ao) | |
269 | + | func withdraw () = { | |
270 | + | let aO = $Tuple2(ao.payments[0].amount, ao.payments[0].assetId) | |
271 | + | let aP = aO._1 | |
272 | + | let aQ = aO._2 | |
273 | + | let aR = af(fraction(aP, F, I), y) | |
274 | + | let aS = af(fraction(aP, G, I), z) | |
275 | + | if (!(v)) | |
276 | + | then throw("DApp is inactive at this moment") | |
277 | + | else if ((size(ao.payments) != 1)) | |
278 | + | then throw("One attached payment expected") | |
279 | + | else if ((aQ != H)) | |
280 | + | then throw(("Incorrect asset attached. Expected: " + toBase58String(H))) | |
281 | + | else if (!(Z)) | |
282 | + | then ad(((((((((((((((("Suspicious state. Actual balances: " + toString(F)) + " ") + A) + ", ") + toString(G)) + " ") + E) + ". State: ") + toString(Q(y))) + " ") + A) + ", ") + toString(Q(z))) + " ") + E)) | |
283 | + | else if (if ((aR > V)) | |
284 | + | then true | |
285 | + | else (aS > W)) | |
286 | + | then al(aR, aS) | |
287 | + | else [IntegerEntry(f, (F - aR)), IntegerEntry(g, (G - aS)), IntegerEntry(i, (I - aP)), Burn(H, aP), ScriptTransfer(ao.caller, aR, y), ScriptTransfer(ao.caller, aS, z)] | |
449 | 288 | } | |
450 | 289 | ||
451 | 290 | ||
452 | 291 | ||
453 | - | @Callable(bi) | |
454 | - | func withdraw () = { | |
455 | - | let cf = $Tuple2(bi.payments[0].amount, bi.payments[0].assetId) | |
456 | - | let bM = cf._1 | |
457 | - | let bN = cf._2 | |
458 | - | let cg = aS(fraction(bM, G, J), z) | |
459 | - | let ch = aS(fraction(bM, H, J), A) | |
460 | - | let bD = an((G - cg), (H - ch)) | |
461 | - | if (!(w)) | |
462 | - | then aW() | |
463 | - | else if ((size(bi.payments) != 1)) | |
464 | - | then throw("One attached payment expected") | |
465 | - | else if ((bN != I)) | |
466 | - | then throw(("Incorrect asset attached. Expected: " + toBase58String(I))) | |
467 | - | else if (!(aj)) | |
468 | - | then bh() | |
469 | - | else if (if ((cg > af)) | |
470 | - | then true | |
471 | - | else (ch > ag)) | |
472 | - | then bg(cg, ch) | |
473 | - | else [IntegerEntry(f, (G - cg)), IntegerEntry(g, (H - ch)), IntegerEntry(i, (J - bM)), IntegerEntry(l, bD), Burn(I, bM), ScriptTransfer(bi.caller, cg, z), ScriptTransfer(bi.caller, ch, A)] | |
292 | + | @Callable(ao) | |
293 | + | func exchange (aT) = { | |
294 | + | let aU = $Tuple2(ao.payments[0].amount, ao.payments[0].assetId) | |
295 | + | let aP = aU._1 | |
296 | + | let aQ = aU._2 | |
297 | + | func aV (aW,aX) = { | |
298 | + | let aY = fraction(aX, aP, (aP + aW)) | |
299 | + | let aZ = fraction(aY, (L - J), L) | |
300 | + | let ba = fraction(aY, K, L) | |
301 | + | if ((aT > aZ)) | |
302 | + | then throw(((("Calculated amount to receive " + toString(aZ)) + " is less than specified minimum ") + toString(aT))) | |
303 | + | else $Tuple3(aY, aZ, ba) | |
304 | + | } | |
305 | + | ||
306 | + | if (!(v)) | |
307 | + | then throw("DApp is inactive at this moment") | |
308 | + | else if ((0 >= aT)) | |
309 | + | then throw(("Minimal amount to receive must be positive. Actual: " + toString(aT))) | |
310 | + | else if ((size(ao.payments) != 1)) | |
311 | + | then throw("One attached payment expected") | |
312 | + | else if (!(Z)) | |
313 | + | then ad(((((((((((((((("Suspicious state. Actual balances: " + toString(F)) + " ") + A) + ", ") + toString(G)) + " ") + E) + ". State: ") + toString(Q(y))) + " ") + A) + ", ") + toString(Q(z))) + " ") + E)) | |
314 | + | else if ((aQ == y)) | |
315 | + | then { | |
316 | + | let bb = z | |
317 | + | let bc = aV(F, G) | |
318 | + | let aY = bc._1 | |
319 | + | let aZ = bc._2 | |
320 | + | let ba = bc._3 | |
321 | + | let bd = (F + aP) | |
322 | + | let be = ((G - aZ) - ba) | |
323 | + | if (if (if ((y == t)) | |
324 | + | then (S >= bd) | |
325 | + | else false) | |
326 | + | then true | |
327 | + | else if ((z == t)) | |
328 | + | then (S >= be) | |
329 | + | else false) | |
330 | + | then ai(aZ, W, E) | |
331 | + | else [IntegerEntry(f, bd), IntegerEntry(g, be), ScriptTransfer(ao.caller, aZ, bb), ScriptTransfer(r, ba, bb)] | |
332 | + | } | |
333 | + | else if ((aQ == z)) | |
334 | + | then { | |
335 | + | let bb = y | |
336 | + | let bf = aV(G, F) | |
337 | + | let aY = bf._1 | |
338 | + | let aZ = bf._2 | |
339 | + | let ba = bf._3 | |
340 | + | let bd = ((F - aZ) - ba) | |
341 | + | let be = (G + aP) | |
342 | + | if (if (if ((y == t)) | |
343 | + | then (S >= bd) | |
344 | + | else false) | |
345 | + | then true | |
346 | + | else if ((z == t)) | |
347 | + | then (S >= be) | |
348 | + | else false) | |
349 | + | then ai(aZ, V, A) | |
350 | + | else [IntegerEntry(f, bd), IntegerEntry(g, be), ScriptTransfer(ao.caller, aZ, bb), ScriptTransfer(r, ba, bb)] | |
351 | + | } | |
352 | + | else throw(((("Incorrect asset attached. Expected: " + w) + " or ") + x)) | |
474 | 353 | } | |
475 | 354 | ||
476 | 355 | ||
477 | 356 | ||
478 | - | @Callable(bi) | |
479 | - | func exchange (ci,cj) = { | |
480 | - | let ck = $Tuple2(bi.payments[0].amount, bi.payments[0].assetId) | |
481 | - | let bM = ck._1 | |
482 | - | let bN = ck._2 | |
483 | - | if (!(w)) | |
484 | - | then aW() | |
485 | - | else if ((0 >= ci)) | |
486 | - | then throw(("Estimated amount must be positive. Actual: " + toString(ci))) | |
487 | - | else if ((cj > ci)) | |
488 | - | then throw(((("Minimal amount can't be greater than estimated. Estimated: " + toString(ci)) + ". Minimal: ") + toString(cj))) | |
489 | - | else if ((size(bi.payments) != 1)) | |
490 | - | then throw("One attached payment expected") | |
491 | - | else if (!(aj)) | |
492 | - | then bh() | |
493 | - | else if (if ((bN != z)) | |
494 | - | then (bN != A) | |
495 | - | else false) | |
496 | - | then aY() | |
497 | - | else if ((10000000 > bM)) | |
498 | - | then throw("Only swap of 10.000000 or more tokens is allowed") | |
499 | - | else if (if ((V > fraction(P, cj, bM))) | |
500 | - | then true | |
501 | - | else (fraction(P, ci, bM) > W)) | |
502 | - | then throw("Incorrect args and pmt ratio") | |
503 | - | else { | |
504 | - | let cl = if ((bN == z)) | |
505 | - | then A | |
506 | - | else z | |
507 | - | let aT = ap(ci, cj, bM, bN) | |
508 | - | let cm = fraction(aT, M, N) | |
509 | - | let cn = fraction(aT, (N - L), N) | |
510 | - | let co = if ((bN == z)) | |
511 | - | then $Tuple2((G + bM), ((H - cn) - cm)) | |
512 | - | else $Tuple2(((G - cn) - cm), (H + bM)) | |
513 | - | let ca = co._1 | |
514 | - | let cb = co._2 | |
515 | - | let ce = fraction((ca + cb), T, (2 * U)) | |
516 | - | if (if ((ce > ca)) | |
517 | - | then true | |
518 | - | else (ce > cb)) | |
519 | - | then aZ(ce, ca, cb) | |
520 | - | else if (if (if ((z == u)) | |
521 | - | then (cl == z) | |
522 | - | else false) | |
523 | - | then (ac >= ca) | |
524 | - | else false) | |
525 | - | then bd(cn, af, B) | |
526 | - | else if (if (if ((A == u)) | |
527 | - | then (cl == A) | |
528 | - | else false) | |
529 | - | then (ac >= cb) | |
530 | - | else false) | |
531 | - | then bd(cn, ag, F) | |
532 | - | else [IntegerEntry(f, ca), IntegerEntry(g, cb), IntegerEntry(l, an(ca, cb)), ScriptTransfer(bi.caller, cn, cl), ScriptTransfer(s, cm, cl)] | |
533 | - | } | |
357 | + | @Callable(ao) | |
358 | + | func shutdown () = if (!(v)) | |
359 | + | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, l), "the cause wasn't specified"))) | |
360 | + | else if (!(containsElement([m, n, o, p], ao.callerPublicKey))) | |
361 | + | then throw("Only admin can call this function") | |
362 | + | else ad("Paused by admin") | |
363 | + | ||
364 | + | ||
365 | + | ||
366 | + | @Callable(ao) | |
367 | + | func activate () = if (v) | |
368 | + | then throw("DApp is already active") | |
369 | + | else if (!(containsElement([m, n, o, p], ao.callerPublicKey))) | |
370 | + | then throw("Only admin can call this function") | |
371 | + | else [BooleanEntry(c, true), DeleteEntry(l)] | |
372 | + | ||
373 | + | ||
374 | + | ||
375 | + | @Callable(ao) | |
376 | + | func takeIntoAccountExtraFunds (bg) = { | |
377 | + | let bh = (X - F) | |
378 | + | let bi = (Y - G) | |
379 | + | let bj = (bh - (if ((y == t)) | |
380 | + | then bg | |
381 | + | else 0)) | |
382 | + | let bk = (bi - (if ((z == t)) | |
383 | + | then bg | |
384 | + | else 0)) | |
385 | + | if (!(v)) | |
386 | + | then throw("DApp is inactive at this moment") | |
387 | + | else if ((ao.caller != this)) | |
388 | + | then throw("Only the DApp itself can call this function") | |
389 | + | else if ((0 > bg)) | |
390 | + | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(bg))) | |
391 | + | else if (if ((0 > bh)) | |
392 | + | then true | |
393 | + | else (0 > bi)) | |
394 | + | then ad("Enroll amount negative") | |
395 | + | else if (if ((0 > bj)) | |
396 | + | then true | |
397 | + | else (0 > bk)) | |
398 | + | then throw("Too large amountLeave") | |
399 | + | else [IntegerEntry(f, (F + bj)), IntegerEntry(g, (G + bk)), IntegerEntry(("last_income_" + w), bj), IntegerEntry(("last_income_" + x), bk)] | |
534 | 400 | } | |
535 | 401 | ||
536 | 402 | ||
537 | - | ||
538 | - | @Callable(bi) | |
539 | - | func shutdown () = if (!(w)) | |
540 | - | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, m), "the cause wasn't specified"))) | |
541 | - | else if (!(containsElement([n, o, p, q], bi.callerPublicKey))) | |
542 | - | then aX() | |
543 | - | else aQ("Paused by admin") | |
544 | - | ||
545 | - | ||
546 | - | ||
547 | - | @Callable(bi) | |
548 | - | func activate () = if (w) | |
549 | - | then aV() | |
550 | - | else if (!(containsElement([n, o, p, q], bi.callerPublicKey))) | |
551 | - | then aX() | |
552 | - | else [BooleanEntry(c, true), DeleteEntry(m)] | |
553 | - | ||
554 | - | ||
555 | - | ||
556 | - | @Callable(bi) | |
557 | - | func takeIntoAccountExtraFunds (cp) = { | |
558 | - | let cq = (ah - G) | |
559 | - | let cr = (ai - H) | |
560 | - | let cs = (cq - (if ((z == u)) | |
561 | - | then cp | |
562 | - | else 0)) | |
563 | - | let ct = (cr - (if ((A == u)) | |
564 | - | then cp | |
565 | - | else 0)) | |
566 | - | if (!(w)) | |
567 | - | then aW() | |
568 | - | else if ((bi.caller != this)) | |
569 | - | then aX() | |
570 | - | else if ((0 > cp)) | |
571 | - | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(cp))) | |
572 | - | else if (if ((0 > cq)) | |
573 | - | then true | |
574 | - | else (0 > cr)) | |
575 | - | then aQ("Enroll amount negative") | |
576 | - | else if (if ((0 > cs)) | |
577 | - | then true | |
578 | - | else (0 > ct)) | |
579 | - | then throw("Too large amountLeave") | |
580 | - | else [IntegerEntry(f, (G + cs)), IntegerEntry(g, (H + ct)), IntegerEntry(("last_income_" + x), cs), IntegerEntry(("last_income_" + y), ct)] | |
581 | - | } | |
582 | - | ||
583 | - | ||
584 | - | @Verifier(cu) | |
585 | - | func cv () = { | |
586 | - | let C = cu | |
587 | - | if ($isInstanceOf(C, "InvokeScriptTransaction")) | |
403 | + | @Verifier(bl) | |
404 | + | func bm () = { | |
405 | + | let B = bl | |
406 | + | if ($isInstanceOf(B, "InvokeScriptTransaction")) | |
588 | 407 | then { | |
589 | - | let | |
590 | - | let | |
591 | - | then ( | |
408 | + | let bn = B | |
409 | + | let bo = if ((bn.dApp == this)) | |
410 | + | then (bn.function == "takeIntoAccountExtraFunds") | |
592 | 411 | else false | |
593 | - | let | |
594 | - | then if (if (if (( | |
595 | - | then (size( | |
412 | + | let bp = if ((bn.dApp == s)) | |
413 | + | then if (if (if ((bn.function == "lockNeutrino")) | |
414 | + | then (size(bn.payments) == 1) | |
596 | 415 | else false) | |
597 | - | then ( | |
416 | + | then (bn.payments[0].assetId == t) | |
598 | 417 | else false) | |
599 | 418 | then true | |
600 | - | else if (( | |
601 | - | then (size( | |
419 | + | else if ((bn.function == "unlockNeutrino")) | |
420 | + | then (size(bn.payments) == 0) | |
602 | 421 | else false | |
603 | 422 | else false | |
604 | - | let | |
423 | + | let bq = if (if (if (sigVerify(bl.bodyBytes, bl.proofs[0], m)) | |
605 | 424 | then true | |
606 | - | else sigVerify( | |
425 | + | else sigVerify(bl.bodyBytes, bl.proofs[0], n)) | |
607 | 426 | then true | |
608 | - | else sigVerify( | |
427 | + | else sigVerify(bl.bodyBytes, bl.proofs[0], o)) | |
609 | 428 | then true | |
610 | - | else sigVerify( | |
611 | - | if ( | |
429 | + | else sigVerify(bl.bodyBytes, bl.proofs[0], q) | |
430 | + | if (bo) | |
612 | 431 | then true | |
613 | - | else | |
432 | + | else bp | |
614 | 433 | } | |
615 | - | else sigVerify( | |
434 | + | else sigVerify(bl.bodyBytes, bl.proofs[0], bl.senderPublicKey) | |
616 | 435 | } | |
617 | 436 |
github/deemru/w8io/169f3d6 114.43 ms ◑