tx · HExcxCk2Sadz9hQTGvPfRDis2evKqESvkLzztrYmPfTQ 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.08.29 23:01 [2732439] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "HExcxCk2Sadz9hQTGvPfRDis2evKqESvkLzztrYmPfTQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1693339316213, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "2ZqWZqPAiXdcqLGzZVZsQdXo4FvXTCPiNsjTAn2p246rxMAYaNUso6FL8hYEqzVyxNg2w1xmHEeESdWZgUt67Nvs" ], "script": "base64:BgIOCAISABIAEgASABIAEgAOAAl3YXZlczFMSWQJAQdBZGRyZXNzAQEgsfXkVqM/0+6J9kArnDxMgAk2oJh4WqfkxR9uWw/pRoUACXdhdmVzM0xJZAkBB0FkZHJlc3MBASB3Vww16jaU307TFdx6AQCZu00QR9cMiqtX4etxi+C4ZAAJd2F2ZXM1TElkCQEHQWRkcmVzcwEBIBtGaJJlOVgU0G5tRCLl1N4g5dbuu+aJfhfESzP16GakAAZ1c2RuSWQBIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AANhcnIJAMwIAgABCQDMCAIAAgkAzAgCAAMJAMwIAgAECQDMCAIABQUDbmlsAARhcnIyCQDMCAIAAQkAzAgCAAIFA25pbAAEYXJyMwkAzAgCAAEJAMwIAgACCQDMCAIAAwUDbmlsAQNzdW0CAWEBYgkA/AcECQERQGV4dHJOYXRpdmUoMTA2MikBAiMzTjNEblZmZm5VeVp0ejJNUmJrNVU3Z2lOMTEyV2VtcE1OZAIGYm9ycm93CQDMCAICLDI1RkVxRWpSa3FLNnlDa2lUN0x6NlNBWXo3Z1VGQ3R4Z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GVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5rskayA==", "height": 2732439, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9kBJohuSW8s7Cw5zdDv2EC5qaatBJJ2ZLwRtMsu5Boti Next: Fz6LGpE3GGRJfP6AVycXBdpF2w85tr82uQWoSoYEEBXj Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let c = Address(base58'2qUH6Nh6cgC8dxj8fwH3bTJi261PNr5nMQKRbBXBuwmM') | |
9 | 9 | ||
10 | - | let d = | |
10 | + | let d = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
11 | 11 | ||
12 | - | let e = [1, 2] | |
12 | + | let e = [1, 2, 3, 4, 5] | |
13 | 13 | ||
14 | - | let f = [1, 2 | |
14 | + | let f = [1, 2] | |
15 | 15 | ||
16 | - | func g (h,i) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
16 | + | let g = [1, 2, 3] | |
17 | + | ||
18 | + | func h (i,j) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
17 | 19 | ||
18 | 20 | ||
19 | - | func | |
20 | - | then wavesBalance( | |
21 | - | else assetBalance( | |
21 | + | func k (l,m) = if ((l == "WAVES")) | |
22 | + | then wavesBalance(m).available | |
23 | + | else assetBalance(m, fromBase58String(l)) | |
22 | 24 | ||
23 | 25 | ||
24 | - | func | |
26 | + | func n (l) = if ((l == "WAVES")) | |
25 | 27 | then 2 | |
26 | 28 | else throw("Error") | |
27 | 29 | ||
28 | 30 | ||
29 | - | func | |
31 | + | func o () = 2000000 | |
30 | 32 | ||
31 | 33 | ||
32 | - | func | |
34 | + | func p () = 3000000 | |
33 | 35 | ||
34 | 36 | ||
35 | - | func | |
37 | + | func q () = 1200000 | |
36 | 38 | ||
37 | 39 | ||
38 | - | func | |
40 | + | func r () = 2000000 | |
39 | 41 | ||
40 | 42 | ||
41 | - | @Callable( | |
42 | - | func mintWaves3L_v1 () = if (if ((size( | |
43 | + | @Callable(s) | |
44 | + | func mintWaves3L_v1 () = if (if ((size(s.payments) != 1)) | |
43 | 45 | then true | |
44 | - | else ( | |
46 | + | else (s.payments[0].amount == 0)) | |
45 | 47 | then throw("1 payment has to be attached") | |
46 | 48 | else { | |
47 | - | let | |
48 | - | let | |
49 | - | let | |
50 | - | let | |
51 | - | if (( | |
49 | + | let m = toString(s.caller) | |
50 | + | let t = s.payments[0].amount | |
51 | + | let u = ((t / o()) * 100000000) | |
52 | + | let v = k("WAVES", s.caller) | |
53 | + | if ((v > u)) | |
52 | 54 | then { | |
53 | - | let | |
54 | - | if (( | |
55 | + | let w = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, u)]) | |
56 | + | if ((w == w)) | |
55 | 57 | then { | |
56 | - | func | |
57 | - | let | |
58 | - | if (( | |
59 | - | then ( | |
58 | + | func x (y,z) = { | |
59 | + | let A = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", t], nil) | |
60 | + | if ((A == A)) | |
61 | + | then (y + z) | |
60 | 62 | else throw("Strict value is not equal to itself.") | |
61 | 63 | } | |
62 | 64 | ||
63 | - | let | |
64 | - | let | |
65 | - | let | |
66 | - | let | |
67 | - | let | |
68 | - | func | |
69 | - | then | |
70 | - | else | |
65 | + | let B = [t, t, t] | |
66 | + | let C = { | |
67 | + | let D = B | |
68 | + | let E = size(D) | |
69 | + | let F = 0 | |
70 | + | func G (H,I) = if ((I >= E)) | |
71 | + | then H | |
72 | + | else x(H, D[I]) | |
71 | 73 | ||
72 | - | func | |
73 | - | then | |
74 | + | func J (H,I) = if ((I >= E)) | |
75 | + | then H | |
74 | 76 | else throw("List size exceeds 3") | |
75 | 77 | ||
76 | - | | |
78 | + | J(G(G(G(F, 0), 1), 2), 3) | |
77 | 79 | } | |
78 | - | let | |
79 | - | [IntegerEntry(( | |
80 | + | let K = ((C / q()) * 1000000) | |
81 | + | [IntegerEntry((m + "_gave_USDN"), t), IntegerEntry((m + "_deposited_WAVES"), u), IntegerEntry(((m + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), C), IntegerEntry((m + "_received_WAVES3L"), K), ScriptTransfer(s.caller, K, base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM')] | |
80 | 82 | } | |
81 | 83 | else throw("Strict value is not equal to itself.") | |
82 | 84 | } | |
85 | 87 | ||
86 | 88 | ||
87 | 89 | ||
88 | - | @Callable( | |
89 | - | func redeemWaves3L_v1 () = if (if ((size( | |
90 | + | @Callable(s) | |
91 | + | func redeemWaves3L_v1 () = if (if ((size(s.payments) != 1)) | |
90 | 92 | then true | |
91 | - | else ( | |
93 | + | else (s.payments[0].amount == 0)) | |
92 | 94 | then throw("1 payment has to be attached") | |
93 | 95 | else { | |
94 | - | let | |
95 | - | let | |
96 | - | let | |
97 | - | [IntegerEntry(( | |
96 | + | let m = toString(s.caller) | |
97 | + | let L = s.payments[0].amount | |
98 | + | let M = (L * (r() / 1000000)) | |
99 | + | [IntegerEntry((m + "_redeemed_WAVES3L"), L), IntegerEntry((m + "_received_USDN"), M), ScriptTransfer(s.caller, M, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
98 | 100 | } | |
99 | 101 | ||
100 | 102 | ||
101 | 103 | ||
102 | - | @Callable( | |
103 | - | func mintWaves3L_v2 () = if (if ((size( | |
104 | + | @Callable(s) | |
105 | + | func mintWaves3L_v2 () = if (if ((size(s.payments) != 1)) | |
104 | 106 | then true | |
105 | - | else ( | |
107 | + | else (s.payments[0].amount == 0)) | |
106 | 108 | then throw("1 payment has to be attached") | |
107 | 109 | else { | |
108 | - | let | |
109 | - | let | |
110 | - | let | |
111 | - | let | |
112 | - | let | |
113 | - | if (( | |
110 | + | let m = toString(s.caller) | |
111 | + | let t = s.payments[0].amount | |
112 | + | let u = ((t / 2000000) * 100000000) | |
113 | + | let v = k("WAVES", s.caller) | |
114 | + | let N = ((3 - 1) * o()) | |
115 | + | if ((t >= N)) | |
114 | 116 | then { | |
115 | - | let | |
116 | - | if (( | |
117 | + | let w = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, u)]) | |
118 | + | if ((w == w)) | |
117 | 119 | then { | |
118 | - | func | |
119 | - | let | |
120 | - | if (( | |
121 | - | then ( | |
120 | + | func x (y,z) = { | |
121 | + | let A = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", t], nil) | |
122 | + | if ((A == A)) | |
123 | + | then (y + z) | |
122 | 124 | else throw("Strict value is not equal to itself.") | |
123 | 125 | } | |
124 | 126 | ||
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | let | |
129 | - | let | |
130 | - | func | |
131 | - | then | |
132 | - | else | |
127 | + | let B = [t, t, t] | |
128 | + | let C = { | |
129 | + | let D = B | |
130 | + | let E = size(D) | |
131 | + | let F = 0 | |
132 | + | func G (H,I) = if ((I >= E)) | |
133 | + | then H | |
134 | + | else x(H, D[I]) | |
133 | 135 | ||
134 | - | func | |
135 | - | then | |
136 | + | func J (H,I) = if ((I >= E)) | |
137 | + | then H | |
136 | 138 | else throw("List size exceeds 3") | |
137 | 139 | ||
138 | - | | |
140 | + | J(G(G(G(F, 0), 1), 2), 3) | |
139 | 141 | } | |
140 | - | let | |
141 | - | [IntegerEntry(( | |
142 | + | let O = ((C / o()) * 100000000) | |
143 | + | [IntegerEntry((m + "_gave_USDN"), t), IntegerEntry((m + "_deposited_WAVES"), u), IntegerEntry(((m + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), C), IntegerEntry((m + "_received_WAVES3L"), 1000000), ScriptTransfer(s.caller, 1000000, base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM')] | |
142 | 144 | } | |
143 | 145 | else throw("Strict value is not equal to itself.") | |
144 | 146 | } | |
147 | 149 | ||
148 | 150 | ||
149 | 151 | ||
150 | - | @Callable( | |
151 | - | func redeemWaves3L_v2 () = if (if ((size( | |
152 | + | @Callable(s) | |
153 | + | func redeemWaves3L_v2 () = if (if ((size(s.payments) != 1)) | |
152 | 154 | then true | |
153 | - | else ( | |
155 | + | else (s.payments[0].amount == 0)) | |
154 | 156 | then throw("1 payment has to be attached") | |
155 | 157 | else { | |
156 | - | let | |
157 | - | let | |
158 | - | let | |
159 | - | [IntegerEntry(( | |
158 | + | let m = toString(s.caller) | |
159 | + | let L = 6 | |
160 | + | let M = (((L * (p() / 1000000)) - 4) * 1000000) | |
161 | + | [IntegerEntry((m + "_redeemed_WAVES3L"), L), IntegerEntry((m + "_received_USDN"), M), ScriptTransfer(s.caller, M, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
160 | 162 | } | |
161 | 163 | ||
162 | 164 | ||
163 | - | @Verifier(O) | |
164 | - | func P () = sigVerify(O.bodyBytes, O.proofs[0], O.senderPublicKey) | |
165 | + | ||
166 | + | @Callable(s) | |
167 | + | func long3 () = if (if ((size(s.payments) != 1)) | |
168 | + | then true | |
169 | + | else (s.payments[0].amount == 0)) | |
170 | + | then throw("1 payment has to be attached") | |
171 | + | else { | |
172 | + | let P = s.payments[0].amount | |
173 | + | let Q = invoke(addressFromStringValue("3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA"), "swapToWaves", nil, [AttachedPayment(d, P)]) | |
174 | + | if ((Q == Q)) | |
175 | + | then { | |
176 | + | let R = Q | |
177 | + | if ($isInstanceOf(R, "Int")) | |
178 | + | then { | |
179 | + | let S = R | |
180 | + | let T = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, S)]) | |
181 | + | if ((T == T)) | |
182 | + | then { | |
183 | + | let U = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((P * 75) / 100)], nil) | |
184 | + | if ((U == U)) | |
185 | + | then { | |
186 | + | func x (y,z) = (y + z) | |
187 | + | ||
188 | + | let B = [1, 1, 1] | |
189 | + | let C = { | |
190 | + | let D = B | |
191 | + | let E = size(D) | |
192 | + | let F = 0 | |
193 | + | func G (H,I) = if ((I >= E)) | |
194 | + | then H | |
195 | + | else x(H, D[I]) | |
196 | + | ||
197 | + | func J (H,I) = if ((I >= E)) | |
198 | + | then H | |
199 | + | else throw("List size exceeds 5") | |
200 | + | ||
201 | + | J(G(G(G(G(G(F, 0), 1), 2), 3), 4), 5) | |
202 | + | } | |
203 | + | nil | |
204 | + | } | |
205 | + | else throw("Strict value is not equal to itself.") | |
206 | + | } | |
207 | + | else throw("Strict value is not equal to itself.") | |
208 | + | } | |
209 | + | else throw("Incorrect invoke result") | |
210 | + | } | |
211 | + | else throw("Strict value is not equal to itself.") | |
212 | + | } | |
213 | + | ||
214 | + | ||
215 | + | ||
216 | + | @Callable(s) | |
217 | + | func long3test () = if (if ((size(s.payments) != 1)) | |
218 | + | then true | |
219 | + | else (s.payments[0].amount == 0)) | |
220 | + | then throw("1 payment has to be attached") | |
221 | + | else { | |
222 | + | let P = s.payments[0].amount | |
223 | + | let Q = invoke(addressFromStringValue("3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA"), "swapToWaves", nil, [AttachedPayment(d, P)]) | |
224 | + | if ((Q == Q)) | |
225 | + | then { | |
226 | + | let R = Q | |
227 | + | if ($isInstanceOf(R, "Int")) | |
228 | + | then { | |
229 | + | let S = R | |
230 | + | [IntegerEntry("Returned_SwappedAmount", S)] | |
231 | + | } | |
232 | + | else throw("Incorrect invoke result") | |
233 | + | } | |
234 | + | else throw("Strict value is not equal to itself.") | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | @Verifier(V) | |
239 | + | func W () = sigVerify(V.bodyBytes, V.proofs[0], V.senderPublicKey) | |
165 | 240 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = Address(base58'CygdaJKZfxRrHyYMwkNdz9ZgSD5FpJLtk5s5B4q1DKV6') | |
5 | 5 | ||
6 | 6 | let b = Address(base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM') | |
7 | 7 | ||
8 | 8 | let c = Address(base58'2qUH6Nh6cgC8dxj8fwH3bTJi261PNr5nMQKRbBXBuwmM') | |
9 | 9 | ||
10 | - | let d = | |
10 | + | let d = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
11 | 11 | ||
12 | - | let e = [1, 2] | |
12 | + | let e = [1, 2, 3, 4, 5] | |
13 | 13 | ||
14 | - | let f = [1, 2 | |
14 | + | let f = [1, 2] | |
15 | 15 | ||
16 | - | func g (h,i) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
16 | + | let g = [1, 2, 3] | |
17 | + | ||
18 | + | func h (i,j) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
17 | 19 | ||
18 | 20 | ||
19 | - | func | |
20 | - | then wavesBalance( | |
21 | - | else assetBalance( | |
21 | + | func k (l,m) = if ((l == "WAVES")) | |
22 | + | then wavesBalance(m).available | |
23 | + | else assetBalance(m, fromBase58String(l)) | |
22 | 24 | ||
23 | 25 | ||
24 | - | func | |
26 | + | func n (l) = if ((l == "WAVES")) | |
25 | 27 | then 2 | |
26 | 28 | else throw("Error") | |
27 | 29 | ||
28 | 30 | ||
29 | - | func | |
31 | + | func o () = 2000000 | |
30 | 32 | ||
31 | 33 | ||
32 | - | func | |
34 | + | func p () = 3000000 | |
33 | 35 | ||
34 | 36 | ||
35 | - | func | |
37 | + | func q () = 1200000 | |
36 | 38 | ||
37 | 39 | ||
38 | - | func | |
40 | + | func r () = 2000000 | |
39 | 41 | ||
40 | 42 | ||
41 | - | @Callable( | |
42 | - | func mintWaves3L_v1 () = if (if ((size( | |
43 | + | @Callable(s) | |
44 | + | func mintWaves3L_v1 () = if (if ((size(s.payments) != 1)) | |
43 | 45 | then true | |
44 | - | else ( | |
46 | + | else (s.payments[0].amount == 0)) | |
45 | 47 | then throw("1 payment has to be attached") | |
46 | 48 | else { | |
47 | - | let | |
48 | - | let | |
49 | - | let | |
50 | - | let | |
51 | - | if (( | |
49 | + | let m = toString(s.caller) | |
50 | + | let t = s.payments[0].amount | |
51 | + | let u = ((t / o()) * 100000000) | |
52 | + | let v = k("WAVES", s.caller) | |
53 | + | if ((v > u)) | |
52 | 54 | then { | |
53 | - | let | |
54 | - | if (( | |
55 | + | let w = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, u)]) | |
56 | + | if ((w == w)) | |
55 | 57 | then { | |
56 | - | func | |
57 | - | let | |
58 | - | if (( | |
59 | - | then ( | |
58 | + | func x (y,z) = { | |
59 | + | let A = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", t], nil) | |
60 | + | if ((A == A)) | |
61 | + | then (y + z) | |
60 | 62 | else throw("Strict value is not equal to itself.") | |
61 | 63 | } | |
62 | 64 | ||
63 | - | let | |
64 | - | let | |
65 | - | let | |
66 | - | let | |
67 | - | let | |
68 | - | func | |
69 | - | then | |
70 | - | else | |
65 | + | let B = [t, t, t] | |
66 | + | let C = { | |
67 | + | let D = B | |
68 | + | let E = size(D) | |
69 | + | let F = 0 | |
70 | + | func G (H,I) = if ((I >= E)) | |
71 | + | then H | |
72 | + | else x(H, D[I]) | |
71 | 73 | ||
72 | - | func | |
73 | - | then | |
74 | + | func J (H,I) = if ((I >= E)) | |
75 | + | then H | |
74 | 76 | else throw("List size exceeds 3") | |
75 | 77 | ||
76 | - | | |
78 | + | J(G(G(G(F, 0), 1), 2), 3) | |
77 | 79 | } | |
78 | - | let | |
79 | - | [IntegerEntry(( | |
80 | + | let K = ((C / q()) * 1000000) | |
81 | + | [IntegerEntry((m + "_gave_USDN"), t), IntegerEntry((m + "_deposited_WAVES"), u), IntegerEntry(((m + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), C), IntegerEntry((m + "_received_WAVES3L"), K), ScriptTransfer(s.caller, K, base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM')] | |
80 | 82 | } | |
81 | 83 | else throw("Strict value is not equal to itself.") | |
82 | 84 | } | |
83 | 85 | else throw("Not enough WAVES to deposit!") | |
84 | 86 | } | |
85 | 87 | ||
86 | 88 | ||
87 | 89 | ||
88 | - | @Callable( | |
89 | - | func redeemWaves3L_v1 () = if (if ((size( | |
90 | + | @Callable(s) | |
91 | + | func redeemWaves3L_v1 () = if (if ((size(s.payments) != 1)) | |
90 | 92 | then true | |
91 | - | else ( | |
93 | + | else (s.payments[0].amount == 0)) | |
92 | 94 | then throw("1 payment has to be attached") | |
93 | 95 | else { | |
94 | - | let | |
95 | - | let | |
96 | - | let | |
97 | - | [IntegerEntry(( | |
96 | + | let m = toString(s.caller) | |
97 | + | let L = s.payments[0].amount | |
98 | + | let M = (L * (r() / 1000000)) | |
99 | + | [IntegerEntry((m + "_redeemed_WAVES3L"), L), IntegerEntry((m + "_received_USDN"), M), ScriptTransfer(s.caller, M, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
98 | 100 | } | |
99 | 101 | ||
100 | 102 | ||
101 | 103 | ||
102 | - | @Callable( | |
103 | - | func mintWaves3L_v2 () = if (if ((size( | |
104 | + | @Callable(s) | |
105 | + | func mintWaves3L_v2 () = if (if ((size(s.payments) != 1)) | |
104 | 106 | then true | |
105 | - | else ( | |
107 | + | else (s.payments[0].amount == 0)) | |
106 | 108 | then throw("1 payment has to be attached") | |
107 | 109 | else { | |
108 | - | let | |
109 | - | let | |
110 | - | let | |
111 | - | let | |
112 | - | let | |
113 | - | if (( | |
110 | + | let m = toString(s.caller) | |
111 | + | let t = s.payments[0].amount | |
112 | + | let u = ((t / 2000000) * 100000000) | |
113 | + | let v = k("WAVES", s.caller) | |
114 | + | let N = ((3 - 1) * o()) | |
115 | + | if ((t >= N)) | |
114 | 116 | then { | |
115 | - | let | |
116 | - | if (( | |
117 | + | let w = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, u)]) | |
118 | + | if ((w == w)) | |
117 | 119 | then { | |
118 | - | func | |
119 | - | let | |
120 | - | if (( | |
121 | - | then ( | |
120 | + | func x (y,z) = { | |
121 | + | let A = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", t], nil) | |
122 | + | if ((A == A)) | |
123 | + | then (y + z) | |
122 | 124 | else throw("Strict value is not equal to itself.") | |
123 | 125 | } | |
124 | 126 | ||
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | let | |
129 | - | let | |
130 | - | func | |
131 | - | then | |
132 | - | else | |
127 | + | let B = [t, t, t] | |
128 | + | let C = { | |
129 | + | let D = B | |
130 | + | let E = size(D) | |
131 | + | let F = 0 | |
132 | + | func G (H,I) = if ((I >= E)) | |
133 | + | then H | |
134 | + | else x(H, D[I]) | |
133 | 135 | ||
134 | - | func | |
135 | - | then | |
136 | + | func J (H,I) = if ((I >= E)) | |
137 | + | then H | |
136 | 138 | else throw("List size exceeds 3") | |
137 | 139 | ||
138 | - | | |
140 | + | J(G(G(G(F, 0), 1), 2), 3) | |
139 | 141 | } | |
140 | - | let | |
141 | - | [IntegerEntry(( | |
142 | + | let O = ((C / o()) * 100000000) | |
143 | + | [IntegerEntry((m + "_gave_USDN"), t), IntegerEntry((m + "_deposited_WAVES"), u), IntegerEntry(((m + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), C), IntegerEntry((m + "_received_WAVES3L"), 1000000), ScriptTransfer(s.caller, 1000000, base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM')] | |
142 | 144 | } | |
143 | 145 | else throw("Strict value is not equal to itself.") | |
144 | 146 | } | |
145 | 147 | else throw("Not enough WAVES to deposit!") | |
146 | 148 | } | |
147 | 149 | ||
148 | 150 | ||
149 | 151 | ||
150 | - | @Callable( | |
151 | - | func redeemWaves3L_v2 () = if (if ((size( | |
152 | + | @Callable(s) | |
153 | + | func redeemWaves3L_v2 () = if (if ((size(s.payments) != 1)) | |
152 | 154 | then true | |
153 | - | else ( | |
155 | + | else (s.payments[0].amount == 0)) | |
154 | 156 | then throw("1 payment has to be attached") | |
155 | 157 | else { | |
156 | - | let | |
157 | - | let | |
158 | - | let | |
159 | - | [IntegerEntry(( | |
158 | + | let m = toString(s.caller) | |
159 | + | let L = 6 | |
160 | + | let M = (((L * (p() / 1000000)) - 4) * 1000000) | |
161 | + | [IntegerEntry((m + "_redeemed_WAVES3L"), L), IntegerEntry((m + "_received_USDN"), M), ScriptTransfer(s.caller, M, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
160 | 162 | } | |
161 | 163 | ||
162 | 164 | ||
163 | - | @Verifier(O) | |
164 | - | func P () = sigVerify(O.bodyBytes, O.proofs[0], O.senderPublicKey) | |
165 | + | ||
166 | + | @Callable(s) | |
167 | + | func long3 () = if (if ((size(s.payments) != 1)) | |
168 | + | then true | |
169 | + | else (s.payments[0].amount == 0)) | |
170 | + | then throw("1 payment has to be attached") | |
171 | + | else { | |
172 | + | let P = s.payments[0].amount | |
173 | + | let Q = invoke(addressFromStringValue("3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA"), "swapToWaves", nil, [AttachedPayment(d, P)]) | |
174 | + | if ((Q == Q)) | |
175 | + | then { | |
176 | + | let R = Q | |
177 | + | if ($isInstanceOf(R, "Int")) | |
178 | + | then { | |
179 | + | let S = R | |
180 | + | let T = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, S)]) | |
181 | + | if ((T == T)) | |
182 | + | then { | |
183 | + | let U = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((P * 75) / 100)], nil) | |
184 | + | if ((U == U)) | |
185 | + | then { | |
186 | + | func x (y,z) = (y + z) | |
187 | + | ||
188 | + | let B = [1, 1, 1] | |
189 | + | let C = { | |
190 | + | let D = B | |
191 | + | let E = size(D) | |
192 | + | let F = 0 | |
193 | + | func G (H,I) = if ((I >= E)) | |
194 | + | then H | |
195 | + | else x(H, D[I]) | |
196 | + | ||
197 | + | func J (H,I) = if ((I >= E)) | |
198 | + | then H | |
199 | + | else throw("List size exceeds 5") | |
200 | + | ||
201 | + | J(G(G(G(G(G(F, 0), 1), 2), 3), 4), 5) | |
202 | + | } | |
203 | + | nil | |
204 | + | } | |
205 | + | else throw("Strict value is not equal to itself.") | |
206 | + | } | |
207 | + | else throw("Strict value is not equal to itself.") | |
208 | + | } | |
209 | + | else throw("Incorrect invoke result") | |
210 | + | } | |
211 | + | else throw("Strict value is not equal to itself.") | |
212 | + | } | |
213 | + | ||
214 | + | ||
215 | + | ||
216 | + | @Callable(s) | |
217 | + | func long3test () = if (if ((size(s.payments) != 1)) | |
218 | + | then true | |
219 | + | else (s.payments[0].amount == 0)) | |
220 | + | then throw("1 payment has to be attached") | |
221 | + | else { | |
222 | + | let P = s.payments[0].amount | |
223 | + | let Q = invoke(addressFromStringValue("3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA"), "swapToWaves", nil, [AttachedPayment(d, P)]) | |
224 | + | if ((Q == Q)) | |
225 | + | then { | |
226 | + | let R = Q | |
227 | + | if ($isInstanceOf(R, "Int")) | |
228 | + | then { | |
229 | + | let S = R | |
230 | + | [IntegerEntry("Returned_SwappedAmount", S)] | |
231 | + | } | |
232 | + | else throw("Incorrect invoke result") | |
233 | + | } | |
234 | + | else throw("Strict value is not equal to itself.") | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | @Verifier(V) | |
239 | + | func W () = sigVerify(V.bodyBytes, V.proofs[0], V.senderPublicKey) | |
165 | 240 |
github/deemru/w8io/169f3d6 80.99 ms ◑