tx · 3UKHsdkxXxJbHrvg2UYRqUCd8wu4443LsRP1Fh1mUDjK 3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu: -0.01800000 Waves 2022.06.09 11:19 [2088582] smart account 3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu > SELF 0.00000000 Waves
{ "type": 13, "id": "3UKHsdkxXxJbHrvg2UYRqUCd8wu4443LsRP1Fh1mUDjK", "fee": 1800000, "feeAssetId": null, "timestamp": 1654762877817, "version": 1, "sender": "3Muw1aRbeKgLqAS264AakECyQAvDsnweHLu", "senderPublicKey": "668WwQVaWxezbvLEK3FccCSTbjst4zYAJDPrfLFRj9b9", "proofs": [ "4EPB6sRT4u5QLLseuEaoEU8zzitU87LCqMq1nn5jkczSBnYRGEQrBocr1NkmQuD37LQpkGHbErGHCfNTGHzU7QEM" ], "script": "base64:AAIFAAAAAAAAACwIAhIDCgEIEgASABIFCgMICAgSCQoHCAgICAEIARIAEgQKAggIEgMKAQgSAAAAABcAAAAAA1NFUAIAAAACX18AAAAABUVNUFRZAgAAAAAAAAAACGNvbnRyYWN0AgAAAA9scF9zdGFraW5nX3YyOiABAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAACQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAAQbWFuYWdlclB1YmxpY0tleQUAAAADbmlsBQAAAANTRVABAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAF3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5BQAAAANuaWwFAAAAA1NFUAEAAAAGa2V5VFZMAAAAAQAAAAdhc3NldElkCQAEuQAAAAIJAARMAAAAAgIAAAAEJXMlcwkABEwAAAACAgAAAAN0dmwJAARMAAAAAgUAAAAHYXNzZXRJZAUAAAADbmlsBQAAAANTRVABAAAADWtleVRWTEhpc3RvcnkAAAACAAAAB2Fzc2V0SWQAAAAGaGVpZ2h0CQA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VyUHVibGljS2V5AAAAAAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAA90YXJnZXRQdWJsaWNLZXkEAAAAByRtYXRjaDAJAQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAACcGsFAAAAByRtYXRjaDAFAAAAAnBrAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0CAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V5ZxtqPg==", "chainId": 84, "height": 2088582, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6sPeaTDqUhQpwXGNvnYT6n6xbuAnYxreRmSWLoseSPUw Next: 83rrYT3m2RtbbcvcoNRpRfxW23gZamgXrWz5iLxXbiNk Diff:
Old | New | Differences | |
---|---|---|---|
19 | 19 | func h (g,i) = makeString(["%s%s%d", "tvlHistory", g, toString(i)], a) | |
20 | 20 | ||
21 | 21 | ||
22 | - | func j (g) = makeString(["%s%s", " | |
22 | + | func j (g,i) = makeString(["%s%s%d", "topUpHistory", g, toString(i)], a) | |
23 | 23 | ||
24 | 24 | ||
25 | - | func k (g) = makeString(["%s%s", " | |
25 | + | func k (g) = makeString(["%s%s", "pendingWithdrawals", g], a) | |
26 | 26 | ||
27 | 27 | ||
28 | - | func l (g) = makeString(["%s%s", " | |
28 | + | func l (g) = makeString(["%s%s", "delayInBlocks", g], a) | |
29 | 29 | ||
30 | 30 | ||
31 | - | func m (g) = makeString(["%s%s", " | |
31 | + | func m (g) = makeString(["%s%s", "created", g], a) | |
32 | 32 | ||
33 | 33 | ||
34 | - | func n ( | |
34 | + | func n (g) = makeString(["%s%s", "assetIdToLPId", g], a) | |
35 | 35 | ||
36 | 36 | ||
37 | - | func | |
37 | + | func o (p) = makeString(["%s%s", "lpIdToAssetId", p], a) | |
38 | 38 | ||
39 | 39 | ||
40 | - | func q (g | |
40 | + | func q (g) = makeString(["%s%s", "proxyAddress", g], a) | |
41 | 41 | ||
42 | 42 | ||
43 | - | func | |
43 | + | func r (g,s,t) = makeString(["%s%s%s%s", "userWithdrawalAmount", g, s, t], a) | |
44 | 44 | ||
45 | 45 | ||
46 | - | func u () = makeString(["%s", " | |
46 | + | func u (g) = makeString(["%s%s", "otherChainAssetDecimals", g], a) | |
47 | 47 | ||
48 | 48 | ||
49 | - | func v () = { | |
50 | - | let w = getString(d()) | |
51 | - | if ($isInstanceOf(w, "String")) | |
49 | + | func v () = makeString(["%s", "assetsStoreContract"], a) | |
50 | + | ||
51 | + | ||
52 | + | func w () = { | |
53 | + | let x = getString(d()) | |
54 | + | if ($isInstanceOf(x, "String")) | |
52 | 55 | then { | |
53 | - | let | |
54 | - | fromBase58String( | |
56 | + | let y = x | |
57 | + | fromBase58String(y) | |
55 | 58 | } | |
56 | - | else if ($isInstanceOf( | |
59 | + | else if ($isInstanceOf(x, "Unit")) | |
57 | 60 | then unit | |
58 | 61 | else throw("Match error") | |
59 | 62 | } | |
60 | 63 | ||
61 | 64 | ||
62 | - | func | |
63 | - | let | |
64 | - | if ($isInstanceOf( | |
65 | + | func z () = { | |
66 | + | let x = getString(e()) | |
67 | + | if ($isInstanceOf(x, "String")) | |
65 | 68 | then { | |
66 | - | let | |
67 | - | fromBase58String( | |
69 | + | let y = x | |
70 | + | fromBase58String(y) | |
68 | 71 | } | |
69 | - | else if ($isInstanceOf( | |
72 | + | else if ($isInstanceOf(x, "Unit")) | |
70 | 73 | then unit | |
71 | 74 | else throw("Match error") | |
72 | 75 | } | |
73 | 76 | ||
74 | 77 | ||
75 | - | func | |
78 | + | func A (B) = throw((c + B)) | |
76 | 79 | ||
77 | 80 | ||
78 | - | func | |
79 | - | let | |
80 | - | let | |
81 | - | if ($isInstanceOf( | |
81 | + | func C (D) = { | |
82 | + | let E = A("permission denied") | |
83 | + | let x = w() | |
84 | + | if ($isInstanceOf(x, "ByteVector")) | |
82 | 85 | then { | |
83 | - | let | |
84 | - | if (( | |
86 | + | let F = x | |
87 | + | if ((D.callerPublicKey == F)) | |
85 | 88 | then true | |
86 | - | else | |
89 | + | else E | |
87 | 90 | } | |
88 | - | else if ($isInstanceOf( | |
89 | - | then if (( | |
91 | + | else if ($isInstanceOf(x, "Unit")) | |
92 | + | then if ((D.caller == this)) | |
90 | 93 | then true | |
91 | - | else | |
94 | + | else E | |
92 | 95 | else throw("Match error") | |
93 | 96 | } | |
94 | 97 | ||
95 | 98 | ||
96 | - | func | |
99 | + | func G () = addressFromStringValue(value(getString(v()))) | |
97 | 100 | ||
98 | 101 | ||
99 | - | func | |
100 | - | let | |
101 | - | if ( | |
102 | + | func H (D,g) = { | |
103 | + | let I = (toString(D.caller) == valueOrElse(getString(q(g)), b)) | |
104 | + | if (I) | |
102 | 105 | then true | |
103 | 106 | else { | |
104 | - | let | |
105 | - | if (( | |
107 | + | let J = C(D) | |
108 | + | if ((J == J)) | |
106 | 109 | then true | |
107 | 110 | else throw("Strict value is not equal to itself.") | |
108 | 111 | } | |
109 | 112 | } | |
110 | 113 | ||
111 | 114 | ||
112 | - | @Callable( | |
113 | - | func constructor ( | |
114 | - | let | |
115 | - | if (( | |
116 | - | then [StringEntry( | |
115 | + | @Callable(D) | |
116 | + | func constructor (G) = { | |
117 | + | let J = C(D) | |
118 | + | if ((J == J)) | |
119 | + | then [StringEntry(v(), G)] | |
117 | 120 | else throw("Strict value is not equal to itself.") | |
118 | 121 | } | |
119 | 122 | ||
120 | 123 | ||
121 | 124 | ||
122 | - | @Callable( | |
125 | + | @Callable(D) | |
123 | 126 | func put () = { | |
124 | - | let | |
125 | - | let | |
126 | - | let g = toBase58String( | |
127 | - | let | |
127 | + | let K = value(D.payments[0]) | |
128 | + | let L = value(K.assetId) | |
129 | + | let g = toBase58String(L) | |
130 | + | let M = [if ((size(D.payments) == 1)) | |
128 | 131 | then true | |
129 | - | else | |
132 | + | else A("only one payment must be attached"), if (valueOrElse(getBoolean(m(g)), false)) | |
130 | 133 | then true | |
131 | - | else | |
134 | + | else A("attached payment asset must be registered in the contract"), if ((K.amount > 0)) | |
132 | 135 | then true | |
133 | - | else | |
134 | - | if (( | |
136 | + | else A("positive amount required")] | |
137 | + | if ((M == M)) | |
135 | 138 | then { | |
136 | - | let | |
137 | - | let | |
138 | - | let | |
139 | - | let | |
140 | - | then (( | |
141 | - | else | |
142 | - | [Reissue( | |
139 | + | let N = valueOrElse(getInteger(f(g)), 0) | |
140 | + | let p = value(getString(n(g))) | |
141 | + | let O = value(assetInfo(fromBase58String(g))) | |
142 | + | let P = if ((N > 0)) | |
143 | + | then ((K.amount * O.quantity) / N) | |
144 | + | else K.amount | |
145 | + | [Reissue(O.id, P, true), ScriptTransfer(D.caller, P, O.id)] | |
143 | 146 | } | |
144 | 147 | else throw("Strict value is not equal to itself.") | |
145 | 148 | } | |
146 | 149 | ||
147 | 150 | ||
148 | 151 | ||
149 | - | @Callable( | |
152 | + | @Callable(D) | |
150 | 153 | func submitGetRequest () = { | |
151 | - | let | |
152 | - | let | |
153 | - | let | |
154 | - | let | |
155 | - | let | |
156 | - | let | |
157 | - | let | |
154 | + | let K = value(D.payments[0]) | |
155 | + | let Q = value(K.assetId) | |
156 | + | let p = toBase58String(Q) | |
157 | + | let s = toString(D.caller) | |
158 | + | let R = value(getString(o(p))) | |
159 | + | let S = K.amount | |
160 | + | let M = [if ((size(D.payments) == 1)) | |
158 | 161 | then true | |
159 | - | else | |
162 | + | else A("only one payment must be attached"), if (valueOrElse(getBoolean(m(R)), false)) | |
160 | 163 | then true | |
161 | - | else | |
164 | + | else A("attached payment asset must be registered in the contract"), if ((S > 0)) | |
162 | 165 | then true | |
163 | - | else | |
164 | - | if (( | |
166 | + | else A("positive amount to withdrawal required")] | |
167 | + | if ((M == M)) | |
165 | 168 | then { | |
166 | - | let | |
167 | - | let | |
168 | - | let | |
169 | - | let | |
170 | - | let | |
171 | - | [Burn( | |
169 | + | let T = valueOrElse(getInteger(k(R)), 0) | |
170 | + | let N = valueOrElse(getInteger(f(R)), 0) | |
171 | + | let O = value(assetInfo(Q)) | |
172 | + | let U = O.decimals | |
173 | + | let V = ((S * N) / O.quantity) | |
174 | + | [Burn(Q, S), IntegerEntry(k(R), (T + V)), IntegerEntry(r(R, s, toBase58String(D.transactionId)), V)] | |
172 | 175 | } | |
173 | 176 | else throw("Strict value is not equal to itself.") | |
174 | 177 | } | |
175 | 178 | ||
176 | 179 | ||
177 | 180 | ||
178 | - | @Callable( | |
179 | - | func executeGetRequest (g, | |
180 | - | let | |
181 | - | let | |
181 | + | @Callable(D) | |
182 | + | func executeGetRequest (g,s,W) = { | |
183 | + | let V = valueOrElse(getInteger(r(g, s, W)), 0) | |
184 | + | let M = [if (valueOrElse(getBoolean(m(g)), false)) | |
182 | 185 | then true | |
183 | - | else | |
186 | + | else A("asset must be registered in the contract"), if ((V > 0)) | |
184 | 187 | then true | |
185 | - | else | |
186 | - | if (( | |
188 | + | else A("no corresponding withdrawal request")] | |
189 | + | if ((M == M)) | |
187 | 190 | then { | |
188 | - | let | |
189 | - | [ScriptTransfer(addressFromStringValue( | |
191 | + | let T = valueOrElse(getInteger(k(g)), 0) | |
192 | + | [ScriptTransfer(addressFromStringValue(s), V, fromBase58String(g)), DeleteEntry(r(g, s, W)), IntegerEntry(k(g), (T - V))] | |
190 | 193 | } | |
191 | 194 | else throw("Strict value is not equal to itself.") | |
192 | 195 | } | |
193 | 196 | ||
194 | 197 | ||
195 | 198 | ||
196 | - | @Callable( | |
197 | - | func registerAsset (g | |
198 | - | let | |
199 | + | @Callable(D) | |
200 | + | func registerAsset (g,X,Y,Z,aa,ab,ac) = { | |
201 | + | let M = [C(D), if ((aa >= 0)) | |
199 | 202 | then true | |
200 | - | else | |
203 | + | else A("invalid delayInBlocks"), if ((addressFromString(ab) != unit)) | |
201 | 204 | then true | |
202 | - | else | |
205 | + | else A("invalid proxyAddress"), if ((valueOrElse(getBoolean(m(g)), false) == false)) | |
203 | 206 | then true | |
204 | - | else | |
205 | - | if (( | |
207 | + | else A("asset already registered")] | |
208 | + | if ((M == M)) | |
206 | 209 | then { | |
207 | - | let | |
208 | - | let | |
209 | - | let | |
210 | - | let | |
211 | - | let | |
212 | - | if (( | |
210 | + | let U = value(assetInfo(fromBase58String(g))).decimals | |
211 | + | let ad = Issue(X, Y, 1, U, true) | |
212 | + | let Q = calculateAssetId(ad) | |
213 | + | let p = toBase58String(Q) | |
214 | + | let ae = invoke(G(), "createOrUpdate", [p, Z, false], nil) | |
215 | + | if ((ae == ae)) | |
213 | 216 | then { | |
214 | - | let | |
215 | - | if (( | |
216 | - | then [BooleanEntry( | |
217 | + | let af = invoke(G(), "addLabel", [p, "DEFI"], nil) | |
218 | + | if ((af == af)) | |
219 | + | then [BooleanEntry(m(g), true), IntegerEntry(f(g), 0), IntegerEntry(h(g, height), 0), IntegerEntry(l(g), aa), StringEntry(o(p), g), StringEntry(n(g), p), StringEntry(q(g), ab), IntegerEntry(u(g), ac), ad, Burn(Q, 1)] | |
217 | 220 | else throw("Strict value is not equal to itself.") | |
218 | 221 | } | |
219 | 222 | else throw("Strict value is not equal to itself.") | |
223 | 226 | ||
224 | 227 | ||
225 | 228 | ||
226 | - | @Callable( | |
229 | + | @Callable(D) | |
227 | 230 | func topUpBalance () = { | |
228 | - | let | |
229 | - | let g = toBase58String(value( | |
230 | - | let | |
231 | - | let | |
232 | - | let | |
231 | + | let K = valueOrErrorMessage(D.payments[0], (c + "payment must be attached")) | |
232 | + | let g = toBase58String(value(K.assetId)) | |
233 | + | let ag = K.amount | |
234 | + | let T = valueOrElse(getInteger(k(g)), 0) | |
235 | + | let M = [H(D, g), if ((size(D.payments) == 1)) | |
233 | 236 | then true | |
234 | - | else | |
237 | + | else A("only one payment must be attached"), if (valueOrElse(getBoolean(m(g)), false)) | |
235 | 238 | then true | |
236 | - | else | |
239 | + | else A("attached payment asset must be registered in the contract"), if ((T != 0)) | |
237 | 240 | then true | |
238 | - | else | |
241 | + | else A("zero pendingWithdrawals, nothing to top up"), if ((T >= ag)) | |
239 | 242 | then true | |
240 | - | else "amount to top up must be less or equal than pendingWithdrawals"] | |
241 | - | if ((L == L)) | |
242 | - | then [IntegerEntry(j(g), (S - af))] | |
243 | + | else A("amount to top up must be less or equal than pendingWithdrawals"), if ((getInteger(j(g, height)) == unit)) | |
244 | + | then true | |
245 | + | else A("already have topUp in current block, wait for next block")] | |
246 | + | if ((M == M)) | |
247 | + | then [IntegerEntry(k(g), (T - ag)), IntegerEntry(j(g, height), ag)] | |
243 | 248 | else throw("Strict value is not equal to itself.") | |
244 | 249 | } | |
245 | 250 | ||
246 | 251 | ||
247 | 252 | ||
248 | - | @Callable( | |
249 | - | func setTVL (g, | |
250 | - | let | |
253 | + | @Callable(D) | |
254 | + | func setTVL (g,ah) = { | |
255 | + | let M = [H(D, g), if (valueOrElse(getBoolean(m(g)), false)) | |
251 | 256 | then true | |
252 | - | else z("asset must be registered in the contract")] | |
253 | - | if ((L == L)) | |
257 | + | else A("asset must be registered in the contract"), if ((getInteger(h(g, height)) == unit)) | |
258 | + | then true | |
259 | + | else A("already have setTVL in current block, wait for next block")] | |
260 | + | if ((M == M)) | |
254 | 261 | then { | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | let | |
259 | - | let | |
262 | + | let ai = parseBigIntValue(ah) | |
263 | + | let aj = parseBigIntValue("10") | |
264 | + | let ak = value(assetInfo(fromBase58String(g))).decimals | |
265 | + | let ac = value(getInteger(u(g))) | |
266 | + | let al = if ((ac > ak)) | |
260 | 267 | then { | |
261 | - | let | |
262 | - | ( | |
268 | + | let am = parseBigIntValue(toString((ac - ak))) | |
269 | + | (ai / pow(aj, 0, am, 0, 0, DOWN)) | |
263 | 270 | } | |
264 | - | else if (( | |
271 | + | else if ((ak > ac)) | |
265 | 272 | then { | |
266 | - | let | |
267 | - | ( | |
273 | + | let am = parseBigIntValue(toString((ak - ac))) | |
274 | + | (ai * pow(aj, 0, am, 0, 0, DOWN)) | |
268 | 275 | } | |
269 | - | else | |
270 | - | let | |
271 | - | [IntegerEntry(f(g), | |
276 | + | else ai | |
277 | + | let an = toInt(al) | |
278 | + | [IntegerEntry(f(g), an), IntegerEntry(h(g, height), an)] | |
272 | 279 | } | |
273 | 280 | else throw("Strict value is not equal to itself.") | |
274 | 281 | } | |
275 | 282 | ||
276 | 283 | ||
277 | 284 | ||
278 | - | @Callable( | |
279 | - | func setManager ( | |
280 | - | let | |
281 | - | if (( | |
285 | + | @Callable(D) | |
286 | + | func setManager (ao) = { | |
287 | + | let J = C(D) | |
288 | + | if ((J == J)) | |
282 | 289 | then { | |
283 | - | let | |
284 | - | if (( | |
285 | - | then [StringEntry(e(), | |
290 | + | let ap = fromBase58String(ao) | |
291 | + | if ((ap == ap)) | |
292 | + | then [StringEntry(e(), ao)] | |
286 | 293 | else throw("Strict value is not equal to itself.") | |
287 | 294 | } | |
288 | 295 | else throw("Strict value is not equal to itself.") | |
290 | 297 | ||
291 | 298 | ||
292 | 299 | ||
293 | - | @Callable( | |
300 | + | @Callable(D) | |
294 | 301 | func confirmManager () = { | |
295 | - | let | |
296 | - | let | |
302 | + | let aq = z() | |
303 | + | let ar = if (isDefined(aq)) | |
297 | 304 | then true | |
298 | - | else | |
299 | - | if (( | |
305 | + | else A("no pending manager") | |
306 | + | if ((ar == ar)) | |
300 | 307 | then { | |
301 | - | let | |
308 | + | let as = if ((D.callerPublicKey == value(aq))) | |
302 | 309 | then true | |
303 | - | else | |
304 | - | if (( | |
305 | - | then [StringEntry(d(), toBase58String(value( | |
310 | + | else A("you are not pending manager") | |
311 | + | if ((as == as)) | |
312 | + | then [StringEntry(d(), toBase58String(value(aq))), DeleteEntry(e())] | |
306 | 313 | else throw("Strict value is not equal to itself.") | |
307 | 314 | } | |
308 | 315 | else throw("Strict value is not equal to itself.") | |
309 | 316 | } | |
310 | 317 | ||
311 | 318 | ||
312 | - | @Verifier( | |
313 | - | func | |
314 | - | let | |
315 | - | let | |
316 | - | if ($isInstanceOf( | |
319 | + | @Verifier(at) | |
320 | + | func au () = { | |
321 | + | let av = { | |
322 | + | let x = w() | |
323 | + | if ($isInstanceOf(x, "ByteVector")) | |
317 | 324 | then { | |
318 | - | let | |
319 | - | | |
325 | + | let F = x | |
326 | + | F | |
320 | 327 | } | |
321 | - | else if ($isInstanceOf( | |
322 | - | then | |
328 | + | else if ($isInstanceOf(x, "Unit")) | |
329 | + | then at.senderPublicKey | |
323 | 330 | else throw("Match error") | |
324 | 331 | } | |
325 | - | sigVerify( | |
332 | + | sigVerify(at.bodyBytes, at.proofs[0], av) | |
326 | 333 | } | |
327 | 334 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = "" | |
7 | 7 | ||
8 | 8 | let c = "lp_staking_v2: " | |
9 | 9 | ||
10 | 10 | func d () = makeString(["%s", "managerPublicKey"], a) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func e () = makeString(["%s", "pendingManagerPublicKey"], a) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func f (g) = makeString(["%s%s", "tvl", g], a) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func h (g,i) = makeString(["%s%s%d", "tvlHistory", g, toString(i)], a) | |
20 | 20 | ||
21 | 21 | ||
22 | - | func j (g) = makeString(["%s%s", " | |
22 | + | func j (g,i) = makeString(["%s%s%d", "topUpHistory", g, toString(i)], a) | |
23 | 23 | ||
24 | 24 | ||
25 | - | func k (g) = makeString(["%s%s", " | |
25 | + | func k (g) = makeString(["%s%s", "pendingWithdrawals", g], a) | |
26 | 26 | ||
27 | 27 | ||
28 | - | func l (g) = makeString(["%s%s", " | |
28 | + | func l (g) = makeString(["%s%s", "delayInBlocks", g], a) | |
29 | 29 | ||
30 | 30 | ||
31 | - | func m (g) = makeString(["%s%s", " | |
31 | + | func m (g) = makeString(["%s%s", "created", g], a) | |
32 | 32 | ||
33 | 33 | ||
34 | - | func n ( | |
34 | + | func n (g) = makeString(["%s%s", "assetIdToLPId", g], a) | |
35 | 35 | ||
36 | 36 | ||
37 | - | func | |
37 | + | func o (p) = makeString(["%s%s", "lpIdToAssetId", p], a) | |
38 | 38 | ||
39 | 39 | ||
40 | - | func q (g | |
40 | + | func q (g) = makeString(["%s%s", "proxyAddress", g], a) | |
41 | 41 | ||
42 | 42 | ||
43 | - | func | |
43 | + | func r (g,s,t) = makeString(["%s%s%s%s", "userWithdrawalAmount", g, s, t], a) | |
44 | 44 | ||
45 | 45 | ||
46 | - | func u () = makeString(["%s", " | |
46 | + | func u (g) = makeString(["%s%s", "otherChainAssetDecimals", g], a) | |
47 | 47 | ||
48 | 48 | ||
49 | - | func v () = { | |
50 | - | let w = getString(d()) | |
51 | - | if ($isInstanceOf(w, "String")) | |
49 | + | func v () = makeString(["%s", "assetsStoreContract"], a) | |
50 | + | ||
51 | + | ||
52 | + | func w () = { | |
53 | + | let x = getString(d()) | |
54 | + | if ($isInstanceOf(x, "String")) | |
52 | 55 | then { | |
53 | - | let | |
54 | - | fromBase58String( | |
56 | + | let y = x | |
57 | + | fromBase58String(y) | |
55 | 58 | } | |
56 | - | else if ($isInstanceOf( | |
59 | + | else if ($isInstanceOf(x, "Unit")) | |
57 | 60 | then unit | |
58 | 61 | else throw("Match error") | |
59 | 62 | } | |
60 | 63 | ||
61 | 64 | ||
62 | - | func | |
63 | - | let | |
64 | - | if ($isInstanceOf( | |
65 | + | func z () = { | |
66 | + | let x = getString(e()) | |
67 | + | if ($isInstanceOf(x, "String")) | |
65 | 68 | then { | |
66 | - | let | |
67 | - | fromBase58String( | |
69 | + | let y = x | |
70 | + | fromBase58String(y) | |
68 | 71 | } | |
69 | - | else if ($isInstanceOf( | |
72 | + | else if ($isInstanceOf(x, "Unit")) | |
70 | 73 | then unit | |
71 | 74 | else throw("Match error") | |
72 | 75 | } | |
73 | 76 | ||
74 | 77 | ||
75 | - | func | |
78 | + | func A (B) = throw((c + B)) | |
76 | 79 | ||
77 | 80 | ||
78 | - | func | |
79 | - | let | |
80 | - | let | |
81 | - | if ($isInstanceOf( | |
81 | + | func C (D) = { | |
82 | + | let E = A("permission denied") | |
83 | + | let x = w() | |
84 | + | if ($isInstanceOf(x, "ByteVector")) | |
82 | 85 | then { | |
83 | - | let | |
84 | - | if (( | |
86 | + | let F = x | |
87 | + | if ((D.callerPublicKey == F)) | |
85 | 88 | then true | |
86 | - | else | |
89 | + | else E | |
87 | 90 | } | |
88 | - | else if ($isInstanceOf( | |
89 | - | then if (( | |
91 | + | else if ($isInstanceOf(x, "Unit")) | |
92 | + | then if ((D.caller == this)) | |
90 | 93 | then true | |
91 | - | else | |
94 | + | else E | |
92 | 95 | else throw("Match error") | |
93 | 96 | } | |
94 | 97 | ||
95 | 98 | ||
96 | - | func | |
99 | + | func G () = addressFromStringValue(value(getString(v()))) | |
97 | 100 | ||
98 | 101 | ||
99 | - | func | |
100 | - | let | |
101 | - | if ( | |
102 | + | func H (D,g) = { | |
103 | + | let I = (toString(D.caller) == valueOrElse(getString(q(g)), b)) | |
104 | + | if (I) | |
102 | 105 | then true | |
103 | 106 | else { | |
104 | - | let | |
105 | - | if (( | |
107 | + | let J = C(D) | |
108 | + | if ((J == J)) | |
106 | 109 | then true | |
107 | 110 | else throw("Strict value is not equal to itself.") | |
108 | 111 | } | |
109 | 112 | } | |
110 | 113 | ||
111 | 114 | ||
112 | - | @Callable( | |
113 | - | func constructor ( | |
114 | - | let | |
115 | - | if (( | |
116 | - | then [StringEntry( | |
115 | + | @Callable(D) | |
116 | + | func constructor (G) = { | |
117 | + | let J = C(D) | |
118 | + | if ((J == J)) | |
119 | + | then [StringEntry(v(), G)] | |
117 | 120 | else throw("Strict value is not equal to itself.") | |
118 | 121 | } | |
119 | 122 | ||
120 | 123 | ||
121 | 124 | ||
122 | - | @Callable( | |
125 | + | @Callable(D) | |
123 | 126 | func put () = { | |
124 | - | let | |
125 | - | let | |
126 | - | let g = toBase58String( | |
127 | - | let | |
127 | + | let K = value(D.payments[0]) | |
128 | + | let L = value(K.assetId) | |
129 | + | let g = toBase58String(L) | |
130 | + | let M = [if ((size(D.payments) == 1)) | |
128 | 131 | then true | |
129 | - | else | |
132 | + | else A("only one payment must be attached"), if (valueOrElse(getBoolean(m(g)), false)) | |
130 | 133 | then true | |
131 | - | else | |
134 | + | else A("attached payment asset must be registered in the contract"), if ((K.amount > 0)) | |
132 | 135 | then true | |
133 | - | else | |
134 | - | if (( | |
136 | + | else A("positive amount required")] | |
137 | + | if ((M == M)) | |
135 | 138 | then { | |
136 | - | let | |
137 | - | let | |
138 | - | let | |
139 | - | let | |
140 | - | then (( | |
141 | - | else | |
142 | - | [Reissue( | |
139 | + | let N = valueOrElse(getInteger(f(g)), 0) | |
140 | + | let p = value(getString(n(g))) | |
141 | + | let O = value(assetInfo(fromBase58String(g))) | |
142 | + | let P = if ((N > 0)) | |
143 | + | then ((K.amount * O.quantity) / N) | |
144 | + | else K.amount | |
145 | + | [Reissue(O.id, P, true), ScriptTransfer(D.caller, P, O.id)] | |
143 | 146 | } | |
144 | 147 | else throw("Strict value is not equal to itself.") | |
145 | 148 | } | |
146 | 149 | ||
147 | 150 | ||
148 | 151 | ||
149 | - | @Callable( | |
152 | + | @Callable(D) | |
150 | 153 | func submitGetRequest () = { | |
151 | - | let | |
152 | - | let | |
153 | - | let | |
154 | - | let | |
155 | - | let | |
156 | - | let | |
157 | - | let | |
154 | + | let K = value(D.payments[0]) | |
155 | + | let Q = value(K.assetId) | |
156 | + | let p = toBase58String(Q) | |
157 | + | let s = toString(D.caller) | |
158 | + | let R = value(getString(o(p))) | |
159 | + | let S = K.amount | |
160 | + | let M = [if ((size(D.payments) == 1)) | |
158 | 161 | then true | |
159 | - | else | |
162 | + | else A("only one payment must be attached"), if (valueOrElse(getBoolean(m(R)), false)) | |
160 | 163 | then true | |
161 | - | else | |
164 | + | else A("attached payment asset must be registered in the contract"), if ((S > 0)) | |
162 | 165 | then true | |
163 | - | else | |
164 | - | if (( | |
166 | + | else A("positive amount to withdrawal required")] | |
167 | + | if ((M == M)) | |
165 | 168 | then { | |
166 | - | let | |
167 | - | let | |
168 | - | let | |
169 | - | let | |
170 | - | let | |
171 | - | [Burn( | |
169 | + | let T = valueOrElse(getInteger(k(R)), 0) | |
170 | + | let N = valueOrElse(getInteger(f(R)), 0) | |
171 | + | let O = value(assetInfo(Q)) | |
172 | + | let U = O.decimals | |
173 | + | let V = ((S * N) / O.quantity) | |
174 | + | [Burn(Q, S), IntegerEntry(k(R), (T + V)), IntegerEntry(r(R, s, toBase58String(D.transactionId)), V)] | |
172 | 175 | } | |
173 | 176 | else throw("Strict value is not equal to itself.") | |
174 | 177 | } | |
175 | 178 | ||
176 | 179 | ||
177 | 180 | ||
178 | - | @Callable( | |
179 | - | func executeGetRequest (g, | |
180 | - | let | |
181 | - | let | |
181 | + | @Callable(D) | |
182 | + | func executeGetRequest (g,s,W) = { | |
183 | + | let V = valueOrElse(getInteger(r(g, s, W)), 0) | |
184 | + | let M = [if (valueOrElse(getBoolean(m(g)), false)) | |
182 | 185 | then true | |
183 | - | else | |
186 | + | else A("asset must be registered in the contract"), if ((V > 0)) | |
184 | 187 | then true | |
185 | - | else | |
186 | - | if (( | |
188 | + | else A("no corresponding withdrawal request")] | |
189 | + | if ((M == M)) | |
187 | 190 | then { | |
188 | - | let | |
189 | - | [ScriptTransfer(addressFromStringValue( | |
191 | + | let T = valueOrElse(getInteger(k(g)), 0) | |
192 | + | [ScriptTransfer(addressFromStringValue(s), V, fromBase58String(g)), DeleteEntry(r(g, s, W)), IntegerEntry(k(g), (T - V))] | |
190 | 193 | } | |
191 | 194 | else throw("Strict value is not equal to itself.") | |
192 | 195 | } | |
193 | 196 | ||
194 | 197 | ||
195 | 198 | ||
196 | - | @Callable( | |
197 | - | func registerAsset (g | |
198 | - | let | |
199 | + | @Callable(D) | |
200 | + | func registerAsset (g,X,Y,Z,aa,ab,ac) = { | |
201 | + | let M = [C(D), if ((aa >= 0)) | |
199 | 202 | then true | |
200 | - | else | |
203 | + | else A("invalid delayInBlocks"), if ((addressFromString(ab) != unit)) | |
201 | 204 | then true | |
202 | - | else | |
205 | + | else A("invalid proxyAddress"), if ((valueOrElse(getBoolean(m(g)), false) == false)) | |
203 | 206 | then true | |
204 | - | else | |
205 | - | if (( | |
207 | + | else A("asset already registered")] | |
208 | + | if ((M == M)) | |
206 | 209 | then { | |
207 | - | let | |
208 | - | let | |
209 | - | let | |
210 | - | let | |
211 | - | let | |
212 | - | if (( | |
210 | + | let U = value(assetInfo(fromBase58String(g))).decimals | |
211 | + | let ad = Issue(X, Y, 1, U, true) | |
212 | + | let Q = calculateAssetId(ad) | |
213 | + | let p = toBase58String(Q) | |
214 | + | let ae = invoke(G(), "createOrUpdate", [p, Z, false], nil) | |
215 | + | if ((ae == ae)) | |
213 | 216 | then { | |
214 | - | let | |
215 | - | if (( | |
216 | - | then [BooleanEntry( | |
217 | + | let af = invoke(G(), "addLabel", [p, "DEFI"], nil) | |
218 | + | if ((af == af)) | |
219 | + | then [BooleanEntry(m(g), true), IntegerEntry(f(g), 0), IntegerEntry(h(g, height), 0), IntegerEntry(l(g), aa), StringEntry(o(p), g), StringEntry(n(g), p), StringEntry(q(g), ab), IntegerEntry(u(g), ac), ad, Burn(Q, 1)] | |
217 | 220 | else throw("Strict value is not equal to itself.") | |
218 | 221 | } | |
219 | 222 | else throw("Strict value is not equal to itself.") | |
220 | 223 | } | |
221 | 224 | else throw("Strict value is not equal to itself.") | |
222 | 225 | } | |
223 | 226 | ||
224 | 227 | ||
225 | 228 | ||
226 | - | @Callable( | |
229 | + | @Callable(D) | |
227 | 230 | func topUpBalance () = { | |
228 | - | let | |
229 | - | let g = toBase58String(value( | |
230 | - | let | |
231 | - | let | |
232 | - | let | |
231 | + | let K = valueOrErrorMessage(D.payments[0], (c + "payment must be attached")) | |
232 | + | let g = toBase58String(value(K.assetId)) | |
233 | + | let ag = K.amount | |
234 | + | let T = valueOrElse(getInteger(k(g)), 0) | |
235 | + | let M = [H(D, g), if ((size(D.payments) == 1)) | |
233 | 236 | then true | |
234 | - | else | |
237 | + | else A("only one payment must be attached"), if (valueOrElse(getBoolean(m(g)), false)) | |
235 | 238 | then true | |
236 | - | else | |
239 | + | else A("attached payment asset must be registered in the contract"), if ((T != 0)) | |
237 | 240 | then true | |
238 | - | else | |
241 | + | else A("zero pendingWithdrawals, nothing to top up"), if ((T >= ag)) | |
239 | 242 | then true | |
240 | - | else "amount to top up must be less or equal than pendingWithdrawals"] | |
241 | - | if ((L == L)) | |
242 | - | then [IntegerEntry(j(g), (S - af))] | |
243 | + | else A("amount to top up must be less or equal than pendingWithdrawals"), if ((getInteger(j(g, height)) == unit)) | |
244 | + | then true | |
245 | + | else A("already have topUp in current block, wait for next block")] | |
246 | + | if ((M == M)) | |
247 | + | then [IntegerEntry(k(g), (T - ag)), IntegerEntry(j(g, height), ag)] | |
243 | 248 | else throw("Strict value is not equal to itself.") | |
244 | 249 | } | |
245 | 250 | ||
246 | 251 | ||
247 | 252 | ||
248 | - | @Callable( | |
249 | - | func setTVL (g, | |
250 | - | let | |
253 | + | @Callable(D) | |
254 | + | func setTVL (g,ah) = { | |
255 | + | let M = [H(D, g), if (valueOrElse(getBoolean(m(g)), false)) | |
251 | 256 | then true | |
252 | - | else z("asset must be registered in the contract")] | |
253 | - | if ((L == L)) | |
257 | + | else A("asset must be registered in the contract"), if ((getInteger(h(g, height)) == unit)) | |
258 | + | then true | |
259 | + | else A("already have setTVL in current block, wait for next block")] | |
260 | + | if ((M == M)) | |
254 | 261 | then { | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | let | |
259 | - | let | |
262 | + | let ai = parseBigIntValue(ah) | |
263 | + | let aj = parseBigIntValue("10") | |
264 | + | let ak = value(assetInfo(fromBase58String(g))).decimals | |
265 | + | let ac = value(getInteger(u(g))) | |
266 | + | let al = if ((ac > ak)) | |
260 | 267 | then { | |
261 | - | let | |
262 | - | ( | |
268 | + | let am = parseBigIntValue(toString((ac - ak))) | |
269 | + | (ai / pow(aj, 0, am, 0, 0, DOWN)) | |
263 | 270 | } | |
264 | - | else if (( | |
271 | + | else if ((ak > ac)) | |
265 | 272 | then { | |
266 | - | let | |
267 | - | ( | |
273 | + | let am = parseBigIntValue(toString((ak - ac))) | |
274 | + | (ai * pow(aj, 0, am, 0, 0, DOWN)) | |
268 | 275 | } | |
269 | - | else | |
270 | - | let | |
271 | - | [IntegerEntry(f(g), | |
276 | + | else ai | |
277 | + | let an = toInt(al) | |
278 | + | [IntegerEntry(f(g), an), IntegerEntry(h(g, height), an)] | |
272 | 279 | } | |
273 | 280 | else throw("Strict value is not equal to itself.") | |
274 | 281 | } | |
275 | 282 | ||
276 | 283 | ||
277 | 284 | ||
278 | - | @Callable( | |
279 | - | func setManager ( | |
280 | - | let | |
281 | - | if (( | |
285 | + | @Callable(D) | |
286 | + | func setManager (ao) = { | |
287 | + | let J = C(D) | |
288 | + | if ((J == J)) | |
282 | 289 | then { | |
283 | - | let | |
284 | - | if (( | |
285 | - | then [StringEntry(e(), | |
290 | + | let ap = fromBase58String(ao) | |
291 | + | if ((ap == ap)) | |
292 | + | then [StringEntry(e(), ao)] | |
286 | 293 | else throw("Strict value is not equal to itself.") | |
287 | 294 | } | |
288 | 295 | else throw("Strict value is not equal to itself.") | |
289 | 296 | } | |
290 | 297 | ||
291 | 298 | ||
292 | 299 | ||
293 | - | @Callable( | |
300 | + | @Callable(D) | |
294 | 301 | func confirmManager () = { | |
295 | - | let | |
296 | - | let | |
302 | + | let aq = z() | |
303 | + | let ar = if (isDefined(aq)) | |
297 | 304 | then true | |
298 | - | else | |
299 | - | if (( | |
305 | + | else A("no pending manager") | |
306 | + | if ((ar == ar)) | |
300 | 307 | then { | |
301 | - | let | |
308 | + | let as = if ((D.callerPublicKey == value(aq))) | |
302 | 309 | then true | |
303 | - | else | |
304 | - | if (( | |
305 | - | then [StringEntry(d(), toBase58String(value( | |
310 | + | else A("you are not pending manager") | |
311 | + | if ((as == as)) | |
312 | + | then [StringEntry(d(), toBase58String(value(aq))), DeleteEntry(e())] | |
306 | 313 | else throw("Strict value is not equal to itself.") | |
307 | 314 | } | |
308 | 315 | else throw("Strict value is not equal to itself.") | |
309 | 316 | } | |
310 | 317 | ||
311 | 318 | ||
312 | - | @Verifier( | |
313 | - | func | |
314 | - | let | |
315 | - | let | |
316 | - | if ($isInstanceOf( | |
319 | + | @Verifier(at) | |
320 | + | func au () = { | |
321 | + | let av = { | |
322 | + | let x = w() | |
323 | + | if ($isInstanceOf(x, "ByteVector")) | |
317 | 324 | then { | |
318 | - | let | |
319 | - | | |
325 | + | let F = x | |
326 | + | F | |
320 | 327 | } | |
321 | - | else if ($isInstanceOf( | |
322 | - | then | |
328 | + | else if ($isInstanceOf(x, "Unit")) | |
329 | + | then at.senderPublicKey | |
323 | 330 | else throw("Match error") | |
324 | 331 | } | |
325 | - | sigVerify( | |
332 | + | sigVerify(at.bodyBytes, at.proofs[0], av) | |
326 | 333 | } | |
327 | 334 |
github/deemru/w8io/026f985 115.53 ms ◑