tx · Creg6rvoHACzGUhn5W9rarf6NDGJSJmTC2hZnwEoCKyT 3N28mjf56ZDzhGpFQVgFTuA6U6snixN1F4F: -0.03000000 Waves 2024.10.07 20:29 [3316722] smart account 3N28mjf56ZDzhGpFQVgFTuA6U6snixN1F4F > SELF 0.00000000 Waves
{ "type": 13, "id": "Creg6rvoHACzGUhn5W9rarf6NDGJSJmTC2hZnwEoCKyT", "fee": 3000000, "feeAssetId": null, "timestamp": 1728322179981, "version": 2, "chainId": 84, "sender": "3N28mjf56ZDzhGpFQVgFTuA6U6snixN1F4F", "senderPublicKey": "7BHuSdyDnrkksxAzJUPKg1XQ4gFK21M7zrbLh6Evj6zf", "proofs": [ "526JBJnoDysmGDNE9DsaBHer9ahgw6cMvpihw4iQkpUuPPbRasNdXVJSfTu9G9oB35qatCTeBgA6dDJ5kpi23wYq" ], "script": "base64:BgJDCAISBQoDCAgBEgASBgoECAgICBIDCgEIEgMKAQQSABIDCgEBEgASAwoBBBIECgIIARIFCgMEAQgSABIHCgUIAQEICD0ACXN0YXJ0VHNNcwCgy9Cb5jEBF2NhbGN1bGF0ZURheXNTaW5jZVN0YXJ0AAQEZGlmZgkAZQIIBQlsYXN0QmxvY2sJdGltZXN0YW1wBQlzdGFydFRzTXMECmRheXNQYXNzZWQJAGkCBQRkaWZmCQBoAgCAowUA6AcFCmRheXNQYXNzZWQBCmFzSW50VHVwbGUBBXZhbHVlBAckbWF0Y2gwBQV2YWx1ZQMJAAECBQckbWF0Y2gwAgooSW50LCBJbnQpBANpbnQFByRtYXRjaDAFA2ludAkAAgECH1dyb25nIHR5cGUsIGV4cGVjdGVkOiBUdXBsZSBJbnQBFHN0YXRpY0tleV9lZ2dBc3NldElkAAIRc3RhdGljX2VnZ0Fzc2V0SWQBFnN0YXRpY0tleV9zcGljZUFzc2V0SWQAAhNzdGF0aWNfc3BpY2VBc3NldElkARVzdGF0aWNLZXlfcGV0ZUFzc2V0SWQAAhJzdGF0aWNfcGV0ZUFzc2V0SWQB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CAUCdHgGcHJvb2ZzAAIFCWZpcnN0VXNlcgABAAAEEHNlY29uZFVzZXJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQpzZWNvbmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQpzZWNvbmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQpzZWNvbmRVc2VyAAEAAAQPdGhpcmRVc2VyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUJdGhpcmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQl0aGlyZFVzZXIAAQMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFCXRoaXJkVXNlcgABAAAED3NpZ25hdHVyZXNDb3VudAkAZAIJAGQCBQ9maXJzdFVzZXJTaWduZWQFEHNlY29uZFVzZXJTaWduZWQFD3RoaXJkVXNlclNpZ25lZAQHJG1hdGNoMAUCdHgJAGcCBQ9zaWduYXR1cmVzQ291bnQAAnHcupc=", "height": 3316722, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 4ThP26WYewaxaQvhM2gDz4FoN2eou7CpX5YBFJeMPGX4 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let startTsMs = 1711065540000 | |
5 | + | ||
6 | + | func calculateDaysSinceStart () = { | |
7 | + | let diff = (lastBlock.timestamp - startTsMs) | |
8 | + | let daysPassed = (diff / (86400 * 1000)) | |
9 | + | daysPassed | |
10 | + | } | |
11 | + | ||
12 | + | ||
13 | + | func asIntTuple (value) = match value { | |
14 | + | case int: (Int, Int) => | |
15 | + | int | |
16 | + | case _ => | |
17 | + | throw("Wrong type, expected: Tuple Int") | |
18 | + | } | |
19 | + | ||
20 | + | ||
21 | + | func staticKey_eggAssetId () = "static_eggAssetId" | |
22 | + | ||
23 | + | ||
24 | + | func staticKey_spiceAssetId () = "static_spiceAssetId" | |
25 | + | ||
26 | + | ||
27 | + | func staticKey_peteAssetId () = "static_peteAssetId" | |
28 | + | ||
29 | + | ||
30 | + | func staticKey_mutantFarmingAddress () = "static_mutantFarmingAddress" | |
31 | + | ||
32 | + | ||
33 | + | func staticKey_felineFarmingAddress () = "static_felineStakingAddress" | |
34 | + | ||
35 | + | ||
36 | + | func getOracleAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, "static_oracle"), "oracle not found!")), "could not parse oracle") | |
37 | + | ||
38 | + | ||
39 | + | func getFeesAccount () = addressFromStringValue(valueOrErrorMessage(getString(getOracleAddress(), "static_feeAggregator"), "static_feeAggregator not found!")) | |
40 | + | ||
41 | + | ||
42 | + | func getNodeAccount () = addressFromStringValue(valueOrErrorMessage(getString(getOracleAddress(), "static_nodeAddress"), "node_address not found!")) | |
43 | + | ||
44 | + | ||
45 | + | func getMutantFarmingAccount () = addressFromStringValue(valueOrErrorMessage(getString(getOracleAddress(), staticKey_mutantFarmingAddress()), (staticKey_mutantFarmingAddress() + " not found!"))) | |
46 | + | ||
47 | + | ||
48 | + | func getFelineFarmingAccount () = addressFromStringValue(valueOrErrorMessage(getString(getOracleAddress(), staticKey_felineFarmingAddress()), (staticKey_felineFarmingAddress() + " not found!"))) | |
49 | + | ||
50 | + | ||
51 | + | func getSpiceAssetId () = valueOrErrorMessage(getString(getOracleAddress(), staticKey_spiceAssetId()), (staticKey_spiceAssetId() + " not found!")) | |
52 | + | ||
53 | + | ||
54 | + | func getEggAssetId () = valueOrErrorMessage(getString(getOracleAddress(), staticKey_eggAssetId()), (staticKey_eggAssetId() + " not found!")) | |
55 | + | ||
56 | + | ||
57 | + | func getPeteAssetId () = valueOrErrorMessage(getString(getOracleAddress(), staticKey_peteAssetId()), (staticKey_peteAssetId() + " not found!")) | |
58 | + | ||
59 | + | ||
60 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
61 | + | case b: Int => | |
62 | + | b | |
63 | + | case _ => | |
64 | + | 0 | |
65 | + | } | |
66 | + | ||
67 | + | ||
68 | + | func tryGetBinary (key) = match getBinary(this, key) { | |
69 | + | case b: ByteVector => | |
70 | + | b | |
71 | + | case _ => | |
72 | + | base58'' | |
73 | + | } | |
74 | + | ||
75 | + | ||
76 | + | func tryGetString (key) = match getString(this, key) { | |
77 | + | case b: String => | |
78 | + | b | |
79 | + | case _ => | |
80 | + | "" | |
81 | + | } | |
82 | + | ||
83 | + | ||
84 | + | func getAssetString (assetId) = match assetId { | |
85 | + | case b: ByteVector => | |
86 | + | toBase58String(b) | |
87 | + | case _ => | |
88 | + | "WAVES" | |
89 | + | } | |
90 | + | ||
91 | + | ||
92 | + | func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES")) | |
93 | + | then unit | |
94 | + | else fromBase58String(assetIdStr) | |
95 | + | ||
96 | + | ||
97 | + | func addAssetBytesToList (accum,item) = (accum ++ [getAssetBytes(item)]) | |
98 | + | ||
99 | + | ||
100 | + | func addAssetWeightToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_weight"))]) | |
101 | + | ||
102 | + | ||
103 | + | func addAssetDecimalsToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_decimals"))]) | |
104 | + | ||
105 | + | ||
106 | + | func addAssetScaleToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_scale"))]) | |
107 | + | ||
108 | + | ||
109 | + | func addIntToList (accum,item) = (accum ++ [parseIntValue(item)]) | |
110 | + | ||
111 | + | ||
112 | + | func reveneuForDayByAssetOut (day,assetId) = ((("reveneu_day_" + assetId) + "_") + toString(day)) | |
113 | + | ||
114 | + | ||
115 | + | func volumeForDayByIn (day,assetId) = ((("volume_day_" + assetId) + "_") + toString(day)) | |
116 | + | ||
117 | + | ||
118 | + | let T = tryGetInteger("static_tokensAmount") | |
119 | + | ||
120 | + | let assetIds = { | |
121 | + | let $l = split(tryGetString("static_tokenIds"), ",") | |
122 | + | let $s = size($l) | |
123 | + | let $acc0 = nil | |
124 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
125 | + | then $a | |
126 | + | else addAssetBytesToList($a, $l[$i]) | |
127 | + | ||
128 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
129 | + | then $a | |
130 | + | else throw("List size exceeds 10") | |
131 | + | ||
132 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
133 | + | } | |
134 | + | ||
135 | + | let AssetsWeights = { | |
136 | + | let $l = assetIds | |
137 | + | let $s = size($l) | |
138 | + | let $acc0 = nil | |
139 | + | func $f1_1 ($a,$i) = if (($i >= $s)) | |
140 | + | then $a | |
141 | + | else addAssetWeightToList($a, $l[$i]) | |
142 | + | ||
143 | + | func $f1_2 ($a,$i) = if (($i >= $s)) | |
144 | + | then $a | |
145 | + | else throw("List size exceeds 10") | |
146 | + | ||
147 | + | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
148 | + | } | |
149 | + | ||
150 | + | let Decimals = { | |
151 | + | let $l = assetIds | |
152 | + | let $s = size($l) | |
153 | + | let $acc0 = nil | |
154 | + | func $f2_1 ($a,$i) = if (($i >= $s)) | |
155 | + | then $a | |
156 | + | else addAssetDecimalsToList($a, $l[$i]) | |
157 | + | ||
158 | + | func $f2_2 ($a,$i) = if (($i >= $s)) | |
159 | + | then $a | |
160 | + | else throw("List size exceeds 10") | |
161 | + | ||
162 | + | $f2_2($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
163 | + | } | |
164 | + | ||
165 | + | let Scales = { | |
166 | + | let $l = assetIds | |
167 | + | let $s = size($l) | |
168 | + | let $acc0 = nil | |
169 | + | func $f3_1 ($a,$i) = if (($i >= $s)) | |
170 | + | then $a | |
171 | + | else addAssetScaleToList($a, $l[$i]) | |
172 | + | ||
173 | + | func $f3_2 ($a,$i) = if (($i >= $s)) | |
174 | + | then $a | |
175 | + | else throw("List size exceeds 10") | |
176 | + | ||
177 | + | $f3_2($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($f3_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
178 | + | } | |
179 | + | ||
180 | + | let stakeId = tryGetString("last_stake_id") | |
181 | + | ||
182 | + | let Fee = tryGetInteger("static_fee") | |
183 | + | ||
184 | + | let AssetsWeightsDecimals = 2 | |
185 | + | ||
186 | + | let Scale = 10000 | |
187 | + | ||
188 | + | let Scale8 = 100000000 | |
189 | + | ||
190 | + | let FeeScale = 10000 | |
191 | + | ||
192 | + | let PoolTokenDecimals = 8 | |
193 | + | ||
194 | + | let PoolTokenScale = pow(10, 0, PoolTokenDecimals, 0, 0, HALFUP) | |
195 | + | ||
196 | + | let earnedAssets = assetIds | |
197 | + | ||
198 | + | func burnFees () = if ((tryGetString("static_oracle") != "")) | |
199 | + | then match getBoolean(getOracleAddress(), ("amm_burn_" + toString(this))) { | |
200 | + | case x: Boolean => | |
201 | + | x | |
202 | + | case _ => | |
203 | + | false | |
204 | + | } | |
205 | + | else false | |
206 | + | ||
207 | + | ||
208 | + | func isShutdown () = { | |
209 | + | let shutdown = if ((tryGetString("static_oracle") != "")) | |
210 | + | then match getBoolean(getOracleAddress(), "amm_shutdown") { | |
211 | + | case x: Boolean => | |
212 | + | x | |
213 | + | case _ => | |
214 | + | false | |
215 | + | } | |
216 | + | else false | |
217 | + | let shutdown2 = match getBoolean(this, "is_shutdown") { | |
218 | + | case x: Boolean => | |
219 | + | x | |
220 | + | case _ => | |
221 | + | false | |
222 | + | } | |
223 | + | if (shutdown) | |
224 | + | then true | |
225 | + | else shutdown2 | |
226 | + | } | |
227 | + | ||
228 | + | ||
229 | + | func canUpdate () = if ((tryGetString("static_oracle") != "")) | |
230 | + | then match getBoolean(getOracleAddress(), "amm_tx") { | |
231 | + | case x: Boolean => | |
232 | + | x | |
233 | + | case _ => | |
234 | + | true | |
235 | + | } | |
236 | + | else true | |
237 | + | ||
238 | + | ||
239 | + | func getCurrentTokenBalance (tokenType) = { | |
240 | + | let tokenId = getAssetString(assetIds[tokenType]) | |
241 | + | tryGetInteger((("global_" + tokenId) + "_balance")) | |
242 | + | } | |
243 | + | ||
244 | + | ||
245 | + | func calculatePIssued (amount,tokenId) = { | |
246 | + | let Psupply = tryGetInteger("global_poolToken_amount") | |
247 | + | let Balance = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
248 | + | fraction(amount, Psupply, Balance, DOWN) | |
249 | + | } | |
250 | + | ||
251 | + | ||
252 | + | func getMinPIssued (payments) = { | |
253 | + | func handler (accum,current) = { | |
254 | + | let PIssued = calculatePIssued(current.amount, current.assetId) | |
255 | + | if ((PIssued == 0)) | |
256 | + | then throw("one of the tokens amounts is too low") | |
257 | + | else if (if ((accum == 0)) | |
258 | + | then true | |
259 | + | else (accum > PIssued)) | |
260 | + | then PIssued | |
261 | + | else accum | |
262 | + | } | |
263 | + | ||
264 | + | let minPIssed = { | |
265 | + | let $l = payments | |
266 | + | let $s = size($l) | |
267 | + | let $acc0 = 0 | |
268 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
269 | + | then $a | |
270 | + | else handler($a, $l[$i]) | |
271 | + | ||
272 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
273 | + | then $a | |
274 | + | else throw("List size exceeds 10") | |
275 | + | ||
276 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
277 | + | } | |
278 | + | minPIssed | |
279 | + | } | |
280 | + | ||
281 | + | ||
282 | + | func checkTokensValidity (payments) = { | |
283 | + | func handler1 (accum,payment) = (accum ++ [payment.assetId]) | |
284 | + | ||
285 | + | let ids = { | |
286 | + | let $l = payments | |
287 | + | let $s = size($l) | |
288 | + | let $acc0 = nil | |
289 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
290 | + | then $a | |
291 | + | else handler1($a, $l[$i]) | |
292 | + | ||
293 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
294 | + | then $a | |
295 | + | else throw("List size exceeds 10") | |
296 | + | ||
297 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
298 | + | } | |
299 | + | if ((ids == ids)) | |
300 | + | then { | |
301 | + | func handler2 (accum,assetId) = if ((indexOf(ids, assetId) != unit)) | |
302 | + | then (accum + 1) | |
303 | + | else throw(("asset not attached: " + getAssetString(assetId))) | |
304 | + | ||
305 | + | let checks = { | |
306 | + | let $l = assetIds | |
307 | + | let $s = size($l) | |
308 | + | let $acc0 = 0 | |
309 | + | func $f5_1 ($a,$i) = if (($i >= $s)) | |
310 | + | then $a | |
311 | + | else handler2($a, $l[$i]) | |
312 | + | ||
313 | + | func $f5_2 ($a,$i) = if (($i >= $s)) | |
314 | + | then $a | |
315 | + | else throw("List size exceeds 10") | |
316 | + | ||
317 | + | $f5_2($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
318 | + | } | |
319 | + | if ((checks == checks)) | |
320 | + | then true | |
321 | + | else throw("Strict value is not equal to itself.") | |
322 | + | } | |
323 | + | else throw("Strict value is not equal to itself.") | |
324 | + | } | |
325 | + | ||
326 | + | ||
327 | + | func stakeUnstake (stake,amount,assetId) = if (if ((assetId == "WAVES")) | |
328 | + | then (amount > 0) | |
329 | + | else false) | |
330 | + | then { | |
331 | + | let leasingAmount = valueOrElse(getInteger(this, "leasing_amount"), 0) | |
332 | + | let newLeaseAmount = if (stake) | |
333 | + | then (leasingAmount + amount) | |
334 | + | else (leasingAmount - amount) | |
335 | + | let newLease = Lease(getNodeAccount(), newLeaseAmount) | |
336 | + | let newLeaseId = calculateLeaseId(newLease) | |
337 | + | let data = [newLease, StringEntry("last_stake_id", toBase58String(newLeaseId)), IntegerEntry("leasing_amount", newLeaseAmount)] | |
338 | + | if ((stakeId != "")) | |
339 | + | then ([LeaseCancel(fromBase58String(stakeId))] ++ data) | |
340 | + | else data | |
341 | + | } | |
342 | + | else nil | |
343 | + | ||
344 | + | ||
345 | + | func handlePoolTokensAdd (PIssued,payments,userAddress,needChange) = { | |
346 | + | func getTokenPaymentAmount (tokenId) = { | |
347 | + | func handler (accum,payment) = if ((payment.assetId == tokenId)) | |
348 | + | then payment.amount | |
349 | + | else accum | |
350 | + | ||
351 | + | let $l = payments | |
352 | + | let $s = size($l) | |
353 | + | let $acc0 = 0 | |
354 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
355 | + | then $a | |
356 | + | else handler($a, $l[$i]) | |
357 | + | ||
358 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
359 | + | then $a | |
360 | + | else throw("List size exceeds 10") | |
361 | + | ||
362 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
363 | + | } | |
364 | + | ||
365 | + | func handleTokenChange (accum,tokenId) = { | |
366 | + | let Bk = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
367 | + | let PSupply = tryGetInteger("global_poolToken_amount") | |
368 | + | let tokenDecimals = tryGetInteger((("static_" + getAssetString(tokenId)) + "_scale")) | |
369 | + | let DkTemp = fraction((fraction((PSupply + PIssued), tokenDecimals, PSupply, CEILING) - tokenDecimals), Bk, tokenDecimals, CEILING) | |
370 | + | let paymentAmount = getTokenPaymentAmount(tokenId) | |
371 | + | let Dk = min([DkTemp, paymentAmount]) | |
372 | + | let toReturn = ((if ((paymentAmount != 0)) | |
373 | + | then paymentAmount | |
374 | + | else 0) - Dk) | |
375 | + | let t = if (if (needChange) | |
376 | + | then (toReturn > 0) | |
377 | + | else false) | |
378 | + | then [ScriptTransfer(userAddress, toReturn, tokenId)] | |
379 | + | else nil | |
380 | + | let stakeUnstakeData = if ((getAssetString(tokenId) == "WAVES")) | |
381 | + | then stakeUnstake(true, Dk, "WAVES") | |
382 | + | else nil | |
383 | + | (((accum ++ t) ++ stakeUnstakeData) ++ [IntegerEntry((("global_" + getAssetString(tokenId)) + "_balance"), (Bk + Dk))]) | |
384 | + | } | |
385 | + | ||
386 | + | let $l = assetIds | |
387 | + | let $s = size($l) | |
388 | + | let $acc0 = nil | |
389 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
390 | + | then $a | |
391 | + | else handleTokenChange($a, $l[$i]) | |
392 | + | ||
393 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
394 | + | then $a | |
395 | + | else throw("List size exceeds 10") | |
396 | + | ||
397 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
398 | + | } | |
399 | + | ||
400 | + | ||
401 | + | func handlePoolTokensRedeem (PRedeemed,userAddress) = { | |
402 | + | func handleTokenRedeem (accum,tokenId) = { | |
403 | + | let Bk = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
404 | + | let PSupply = tryGetInteger("global_poolToken_amount") | |
405 | + | let tokenDecimals = tryGetInteger((("static_" + getAssetString(tokenId)) + "_scale")) | |
406 | + | let amount = toInt(fraction((toBigInt(Scale8) - fraction(toBigInt((PSupply - PRedeemed)), toBigInt(Scale8), toBigInt(PSupply), CEILING)), toBigInt(Bk), toBigInt(Scale8), DOWN)) | |
407 | + | let stakeUnstakeData = if ((getAssetString(tokenId) == "WAVES")) | |
408 | + | then stakeUnstake(false, amount, "WAVES") | |
409 | + | else nil | |
410 | + | ((accum ++ stakeUnstakeData) ++ [IntegerEntry((("global_" + getAssetString(tokenId)) + "_balance"), (Bk - amount)), ScriptTransfer(userAddress, amount, tokenId)]) | |
411 | + | } | |
412 | + | ||
413 | + | let $l = assetIds | |
414 | + | let $s = size($l) | |
415 | + | let $acc0 = nil | |
416 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
417 | + | then $a | |
418 | + | else handleTokenRedeem($a, $l[$i]) | |
419 | + | ||
420 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
421 | + | then $a | |
422 | + | else throw("List size exceeds 10") | |
423 | + | ||
424 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
425 | + | } | |
426 | + | ||
427 | + | ||
428 | + | func calculateOutAmount (AmountIn,assetIn,assetOut,BalanceIn,BalanceOut) = { | |
429 | + | let IndexIn = value(indexOf(assetIds, assetIn)) | |
430 | + | let IndexOut = value(indexOf(assetIds, assetOut)) | |
431 | + | if ((IndexIn == IndexOut)) | |
432 | + | then throw("wrong tokens pair") | |
433 | + | else fraction(BalanceOut, ((Scale8 * Scale8) - toInt(pow(fraction(toBigInt(BalanceIn), toBigInt((Scale8 * Scale8)), toBigInt((BalanceIn + AmountIn)), HALFUP), 16, toBigInt(fraction(AssetsWeights[IndexIn], 10000, AssetsWeights[IndexOut])), 4, 16, CEILING))), (Scale8 * Scale8), DOWN) | |
434 | + | } | |
435 | + | ||
436 | + | ||
437 | + | func calculateMinToGet (asset1,asset2,amountToSwap) = { | |
438 | + | let kBalanceA = (("global_" + asset1) + "_balance") | |
439 | + | let A_asset_balance = getIntegerValue(this, kBalanceA) | |
440 | + | let kBalanceB = (("global_" + asset2) + "_balance") | |
441 | + | let B_asset_balance = getIntegerValue(this, kBalanceB) | |
442 | + | let toGet = calculateOutAmount(amountToSwap, getAssetBytes(asset1), getAssetBytes(asset2), A_asset_balance, B_asset_balance) | |
443 | + | let feeAmount = fraction(toGet, Fee, FeeScale) | |
444 | + | if ((feeAmount == feeAmount)) | |
445 | + | then { | |
446 | + | let cleanAmountOut = (toGet - feeAmount) | |
447 | + | if ((cleanAmountOut == cleanAmountOut)) | |
448 | + | then cleanAmountOut | |
449 | + | else throw("Strict value is not equal to itself.") | |
450 | + | } | |
451 | + | else throw("Strict value is not equal to itself.") | |
452 | + | } | |
453 | + | ||
454 | + | ||
455 | + | func getTokenBalance (assetId) = match assetId { | |
456 | + | case t: ByteVector => | |
457 | + | assetBalance(this, t) | |
458 | + | case _ => | |
459 | + | wavesBalance(this).regular | |
460 | + | } | |
461 | + | ||
462 | + | ||
463 | + | func calculateCurrentAssetInterest (assetId,assetIdStr,aBalance,tokenEarningsLastCheck) = { | |
464 | + | let totalStaked = tryGetInteger("global_indexStaked") | |
465 | + | let tokenBalanceLastCheck = tokenEarningsLastCheck | |
466 | + | let currentBalanceDelta = (getTokenBalance(assetId) - aBalance) | |
467 | + | let currentTokenEarnings = if ((currentBalanceDelta > tokenBalanceLastCheck)) | |
468 | + | then currentBalanceDelta | |
469 | + | else tokenBalanceLastCheck | |
470 | + | let newEarnings = (currentTokenEarnings - tokenBalanceLastCheck) | |
471 | + | let newInterest = if ((totalStaked == 0)) | |
472 | + | then 0 | |
473 | + | else fraction(newEarnings, Scale8, totalStaked) | |
474 | + | let lastCheckInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest")) | |
475 | + | (lastCheckInterest + newInterest) | |
476 | + | } | |
477 | + | ||
478 | + | ||
479 | + | func claimResult (address) = { | |
480 | + | let addressStr = toString(address) | |
481 | + | let shareAmount = tryGetInteger((addressStr + "_indexStaked")) | |
482 | + | func handler (accum,assetId) = { | |
483 | + | let assetIdStr = getAssetString(assetId) | |
484 | + | let aBalance = tryGetInteger((("global_" + getAssetString(assetId)) + "_balance")) | |
485 | + | let tokenEarningsLastCheck = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_earnings")) | |
486 | + | let currentTokenInterest = calculateCurrentAssetInterest(assetId, assetIdStr, aBalance, tokenEarningsLastCheck) | |
487 | + | let currentTokenEarnings = max([tokenEarningsLastCheck, (getTokenBalance(assetId) - aBalance)]) | |
488 | + | let rewardAmount = fraction(shareAmount, (currentTokenInterest - tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"))), Scale8) | |
489 | + | let transfer = if ((rewardAmount == 0)) | |
490 | + | then nil | |
491 | + | else [ScriptTransfer(address, rewardAmount, assetId)] | |
492 | + | let claimed = tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_claimed")) | |
493 | + | ((accum ++ transfer) ++ [IntegerEntry((("global_lastCheck_" + assetIdStr) + "_earnings"), (currentTokenEarnings - rewardAmount)), IntegerEntry((("global_lastCheck_" + assetIdStr) + "_interest"), currentTokenInterest), IntegerEntry((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"), currentTokenInterest), IntegerEntry((((addressStr + "_lastCheck_") + assetIdStr) + "_claimed"), (claimed + rewardAmount))]) | |
494 | + | } | |
495 | + | ||
496 | + | let accum = { | |
497 | + | let $l = earnedAssets | |
498 | + | let $s = size($l) | |
499 | + | let $acc0 = nil | |
500 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
501 | + | then $a | |
502 | + | else handler($a, $l[$i]) | |
503 | + | ||
504 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
505 | + | then $a | |
506 | + | else throw("List size exceeds 10") | |
507 | + | ||
508 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
509 | + | } | |
510 | + | (accum ++ [IntegerEntry((addressStr + "_lastClaim"), lastBlock.timestamp)]) | |
511 | + | } | |
512 | + | ||
513 | + | ||
514 | + | func indexStakeResult (addressStr,amount) = { | |
515 | + | let li = claimResult(addressFromStringValue(addressStr)) | |
516 | + | (li ++ [IntegerEntry((addressStr + "_indexStaked"), (tryGetInteger((addressStr + "_indexStaked")) + amount)), IntegerEntry("global_indexStaked", (tryGetInteger("global_indexStaked") + amount))]) | |
517 | + | } | |
518 | + | ||
519 | + | ||
520 | + | func sum (accum,n) = (accum + parseIntValue(n)) | |
521 | + | ||
522 | + | ||
523 | + | func setOracleAddressAndInitiate (address) = [StringEntry("static_oracle", address)] | |
524 | + | ||
525 | + | ||
526 | + | func isTestEnv () = { | |
527 | + | let testenv = match getBoolean(this, "TESTENV") { | |
528 | + | case x: Boolean => | |
529 | + | x | |
530 | + | case _ => | |
531 | + | false | |
532 | + | } | |
533 | + | testenv | |
534 | + | } | |
535 | + | ||
536 | + | ||
537 | + | @Callable(i) | |
538 | + | func readOnlyFunc (asset1,asset2,amountToSwap) = { | |
539 | + | let amountOut = calculateMinToGet(asset1, asset2, amountToSwap) | |
540 | + | [IntegerEntry("DEBUG", amountOut)] | |
541 | + | } | |
542 | + | ||
543 | + | ||
544 | + | ||
545 | + | @Callable(i) | |
546 | + | func topUpFunds () = if ((size(i.payments) != 1)) | |
547 | + | then throw("Wrong payments attached!") | |
548 | + | else { | |
549 | + | let payment = i.payments[0] | |
550 | + | let asset = payment.assetId | |
551 | + | if ((indexOf(assetIds, asset) == unit)) | |
552 | + | then throw("Not supported assetId") | |
553 | + | else { | |
554 | + | let amount = payment.amount | |
555 | + | let aBalance = tryGetInteger((("global_" + getAssetString(asset)) + "_balance")) | |
556 | + | let day = calculateDaysSinceStart() | |
557 | + | let reveneu = tryGetInteger(reveneuForDayByAssetOut(day, getAssetString(asset))) | |
558 | + | [IntegerEntry((("global_" + getAssetString(asset)) + "_balance"), (aBalance + amount)), IntegerEntry("days_since_apy", day), IntegerEntry(reveneuForDayByAssetOut(day, getAssetString(asset)), (reveneu + amount))] | |
559 | + | } | |
560 | + | } | |
561 | + | ||
562 | + | ||
563 | + | ||
564 | + | @Callable(i) | |
565 | + | func preInit (assetIdsStr,assetWeightsStr,baseTokenIdStr,poolDomain) = if ((this != i.caller)) | |
566 | + | then throw("admin only") | |
567 | + | else if ((size(poolDomain) > 13)) | |
568 | + | then throw("too large pool domain") | |
569 | + | else { | |
570 | + | let assetIdsStrLi = split(assetIdsStr, ",") | |
571 | + | let assetIdsLi = { | |
572 | + | let $l = assetIdsStrLi | |
573 | + | let $s = size($l) | |
574 | + | let $acc0 = nil | |
575 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
576 | + | then $a | |
577 | + | else addAssetBytesToList($a, $l[$i]) | |
578 | + | ||
579 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
580 | + | then $a | |
581 | + | else throw("List size exceeds 10") | |
582 | + | ||
583 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
584 | + | } | |
585 | + | let assetWeightsStrLi = split(assetWeightsStr, ",") | |
586 | + | let assetWeightsSum = { | |
587 | + | let $l = assetWeightsStrLi | |
588 | + | let $s = size($l) | |
589 | + | let $acc0 = 0 | |
590 | + | func $f5_1 ($a,$i) = if (($i >= $s)) | |
591 | + | then $a | |
592 | + | else sum($a, $l[$i]) | |
593 | + | ||
594 | + | func $f5_2 ($a,$i) = if (($i >= $s)) | |
595 | + | then $a | |
596 | + | else throw("List size exceeds 10") | |
597 | + | ||
598 | + | $f5_2($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($f5_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
599 | + | } | |
600 | + | func addTokenDataEntries (accum,assetNum) = if ((assetNum >= size(assetIdsLi))) | |
601 | + | then accum | |
602 | + | else { | |
603 | + | let assetDecimals = match assetIdsLi[assetNum] { | |
604 | + | case x: ByteVector => | |
605 | + | value(assetInfo(assetIdsLi[assetNum])).decimals | |
606 | + | case _ => | |
607 | + | 8 | |
608 | + | } | |
609 | + | (accum ++ [IntegerEntry((("static_" + assetIdsStrLi[assetNum]) + "_scale"), pow(10, 0, assetDecimals, 0, 0, DOWN)), IntegerEntry((("static_" + assetIdsStrLi[assetNum]) + "_decimals"), assetDecimals), IntegerEntry((("static_" + assetIdsStrLi[assetNum]) + "_weight"), value(parseInt(assetWeightsStrLi[assetNum])))]) | |
610 | + | } | |
611 | + | ||
612 | + | if ((assetWeightsSum != 100)) | |
613 | + | then throw("sum of token weights must be equal to 100") | |
614 | + | else ({ | |
615 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
616 | + | let $s = size($l) | |
617 | + | let $acc0 = nil | |
618 | + | func $f6_1 ($a,$i) = if (($i >= $s)) | |
619 | + | then $a | |
620 | + | else addTokenDataEntries($a, $l[$i]) | |
621 | + | ||
622 | + | func $f6_2 ($a,$i) = if (($i >= $s)) | |
623 | + | then $a | |
624 | + | else throw("List size exceeds 10") | |
625 | + | ||
626 | + | $f6_2($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($f6_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
627 | + | } ++ [StringEntry("static_tokenIds", assetIdsStr), StringEntry("static_tokenWeights", assetWeightsStr), IntegerEntry("static_tokensAmount", size(assetIdsLi)), StringEntry("static_poolDomain", poolDomain), StringEntry("static_baseTokenId", baseTokenIdStr), IntegerEntry("static_fee", 100)]) | |
628 | + | } | |
629 | + | ||
630 | + | ||
631 | + | ||
632 | + | @Callable(i) | |
633 | + | func init (oracle) = { | |
634 | + | func prepareList () = { | |
635 | + | func handler (accum,n) = (accum ++ [IntegerEntry((("global_" + getAssetString(n.assetId)) + "_balance"), n.amount)]) | |
636 | + | ||
637 | + | let $l = i.payments | |
638 | + | let $s = size($l) | |
639 | + | let $acc0 = nil | |
640 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
641 | + | then $a | |
642 | + | else handler($a, $l[$i]) | |
643 | + | ||
644 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
645 | + | then $a | |
646 | + | else throw("List size exceeds 10") | |
647 | + | ||
648 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
649 | + | } | |
650 | + | ||
651 | + | func calculatePoolTokensAmount (payments) = { | |
652 | + | func handler (accum,pmt) = { | |
653 | + | let assetId = pmt.assetId | |
654 | + | func handler2 (accum,n) = if ((n == assetId)) | |
655 | + | then value(indexOf(assetIds, n)) | |
656 | + | else accum | |
657 | + | ||
658 | + | let Token = { | |
659 | + | let $l = assetIds | |
660 | + | let $s = size($l) | |
661 | + | let $acc0 = 1 | |
662 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
663 | + | then $a | |
664 | + | else handler2($a, $l[$i]) | |
665 | + | ||
666 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
667 | + | then $a | |
668 | + | else throw("List size exceeds 10") | |
669 | + | ||
670 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
671 | + | } | |
672 | + | fraction(accum, pow(pmt.amount, Decimals[Token], AssetsWeights[Token], AssetsWeightsDecimals, 8, FLOOR), Scale8) | |
673 | + | } | |
674 | + | ||
675 | + | let $l = payments | |
676 | + | let $s = size($l) | |
677 | + | let $acc0 = PoolTokenScale | |
678 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
679 | + | then $a | |
680 | + | else handler($a, $l[$i]) | |
681 | + | ||
682 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
683 | + | then $a | |
684 | + | else throw("List size exceeds 10") | |
685 | + | ||
686 | + | $f4_2($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($f4_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
687 | + | } | |
688 | + | ||
689 | + | if ((tryGetInteger("global_wasInited") > 0)) | |
690 | + | then throw("pool already inited") | |
691 | + | else { | |
692 | + | let initialPoolTokens = calculatePoolTokensAmount(i.payments) | |
693 | + | if ((initialPoolTokens == 0)) | |
694 | + | then throw("you need a bigger tokens amount to launch the pool") | |
695 | + | else { | |
696 | + | let poolTokenIssue = Issue(("WD " + tryGetString("static_poolDomain")), "WD pool token", initialPoolTokens, PoolTokenDecimals, true, unit, 0) | |
697 | + | let poolTokenId = calculateAssetId(poolTokenIssue) | |
698 | + | ((prepareList() ++ [poolTokenIssue, IntegerEntry("global_poolToken_amount", initialPoolTokens), IntegerEntry("global_wasInited", 1), BinaryEntry("global_poolToken_id", poolTokenId), StringEntry("static_poolToken_idStr", getAssetString(poolTokenId)), ScriptTransfer(i.caller, initialPoolTokens, poolTokenId)]) ++ setOracleAddressAndInitiate(oracle)) | |
699 | + | } | |
700 | + | } | |
701 | + | } | |
702 | + | ||
703 | + | ||
704 | + | ||
705 | + | @Callable(i) | |
706 | + | func generateIndex (needChange) = if ((size(i.payments) != T)) | |
707 | + | then throw(("you need to attach all pool tokens. amount of pool tokens: " + toString(T))) | |
708 | + | else if (!(checkTokensValidity(i.payments))) | |
709 | + | then throw("wrong assets attached") | |
710 | + | else { | |
711 | + | let PIssued = getMinPIssued(i.payments) | |
712 | + | let reissue = Reissue(getBinaryValue("global_poolToken_id"), PIssued, true) | |
713 | + | let result = handlePoolTokensAdd(PIssued, i.payments, i.originCaller, needChange) | |
714 | + | $Tuple2((result ++ [reissue, ScriptTransfer(i.caller, PIssued, tryGetBinary("global_poolToken_id")), IntegerEntry("global_poolToken_amount", (tryGetInteger("global_poolToken_amount") + PIssued))]), PIssued) | |
715 | + | } | |
716 | + | ||
717 | + | ||
718 | + | ||
719 | + | @Callable(i) | |
720 | + | func stakeIndex () = { | |
721 | + | let addressStr = toString(i.originCaller) | |
722 | + | let pmt = i.payments[0] | |
723 | + | if ((value(pmt.assetId) != tryGetBinary("global_poolToken_id"))) | |
724 | + | then throw("wrong asset attached") | |
725 | + | else indexStakeResult(addressStr, pmt.amount) | |
726 | + | } | |
727 | + | ||
728 | + | ||
729 | + | ||
730 | + | @Callable(i) | |
731 | + | func unstakeIndex (shareAmount) = { | |
732 | + | let addressStr = toString(i.originCaller) | |
733 | + | let shareAvailable = tryGetInteger((addressStr + "_indexStaked")) | |
734 | + | if ((shareAmount > shareAvailable)) | |
735 | + | then throw("you don't have index tokens available") | |
736 | + | else (claimResult(i.originCaller) ++ [IntegerEntry((addressStr + "_indexStaked"), (shareAvailable - shareAmount)), IntegerEntry("global_indexStaked", (tryGetInteger("global_indexStaked") - shareAmount)), ScriptTransfer(i.caller, shareAmount, getBinaryValue("global_poolToken_id"))]) | |
737 | + | } | |
738 | + | ||
739 | + | ||
740 | + | ||
741 | + | @Callable(i) | |
742 | + | func claimIndexRewards () = claimResult(i.caller) | |
743 | + | ||
744 | + | ||
745 | + | ||
746 | + | @Callable(i) | |
747 | + | func redeemIndex (sendToOrigin) = { | |
748 | + | let pmt = i.payments[0] | |
749 | + | if ((pmt.assetId != tryGetBinary("global_poolToken_id"))) | |
750 | + | then throw("please attach pool share token") | |
751 | + | else { | |
752 | + | let PRedeemed = pmt.amount | |
753 | + | let result = handlePoolTokensRedeem(PRedeemed, if (sendToOrigin) | |
754 | + | then i.originCaller | |
755 | + | else i.caller) | |
756 | + | (result ++ [Burn(tryGetBinary("global_poolToken_id"), PRedeemed), IntegerEntry("global_poolToken_amount", (tryGetInteger("global_poolToken_amount") - PRedeemed))]) | |
757 | + | } | |
758 | + | } | |
759 | + | ||
760 | + | ||
761 | + | ||
762 | + | @Callable(i) | |
763 | + | func swap (assetOut,minimum) = if (isShutdown()) | |
764 | + | then throw("Pool is currently shutdown") | |
765 | + | else { | |
766 | + | let pmt = value(i.payments[0]) | |
767 | + | let AmountIn = value(i.payments[0].amount) | |
768 | + | let AssetIn = pmt.assetId | |
769 | + | let invokeSwap = asIntTuple(reentrantInvoke(this, "swapInternal", [assetOut, minimum, AmountIn, getAssetString(AssetIn), toString(i.caller)], nil)) | |
770 | + | if ((invokeSwap == invokeSwap)) | |
771 | + | then { | |
772 | + | let cleanAmountOut = invokeSwap._1 | |
773 | + | if ((cleanAmountOut == cleanAmountOut)) | |
774 | + | then { | |
775 | + | let feeAmount = invokeSwap._2 | |
776 | + | if ((feeAmount == feeAmount)) | |
777 | + | then { | |
778 | + | let feesManagement = if (if (burnFees()) | |
779 | + | then (assetOut != "WAVES") | |
780 | + | else false) | |
781 | + | then [Burn(value(getAssetBytes(assetOut)), fraction(feeAmount, 2, 4)), IntegerEntry((("global_" + assetOut) + "_burned"), (tryGetInteger((("global_" + assetOut) + "_burned")) + fraction(feeAmount, 2, 4)))] | |
782 | + | else if ((assetOut == getPeteAssetId())) | |
783 | + | then { | |
784 | + | let topup2 = invoke(getFelineFarmingAccount(), "topUpReward", nil, [AttachedPayment(fromBase58String(getPeteAssetId()), fraction(feeAmount, 1, 4))]) | |
785 | + | if ((topup2 == topup2)) | |
786 | + | then [ScriptTransfer(getFeesAccount(), fraction(feeAmount, 1, 4), getAssetBytes(assetOut))] | |
787 | + | else throw("Strict value is not equal to itself.") | |
788 | + | } | |
789 | + | else [ScriptTransfer(getFeesAccount(), fraction(feeAmount, 2, 4), getAssetBytes(assetOut))] | |
790 | + | if ((feesManagement == feesManagement)) | |
791 | + | then $Tuple2(feesManagement, cleanAmountOut) | |
792 | + | else throw("Strict value is not equal to itself.") | |
793 | + | } | |
794 | + | else throw("Strict value is not equal to itself.") | |
795 | + | } | |
796 | + | else throw("Strict value is not equal to itself.") | |
797 | + | } | |
798 | + | else throw("Strict value is not equal to itself.") | |
799 | + | } | |
800 | + | ||
801 | + | ||
802 | + | ||
803 | + | @Callable(i) | |
804 | + | func internal (stake,amount,assetId) = if ((i.caller != this)) | |
805 | + | then throw("Not allowed") | |
806 | + | else stakeUnstake(stake, amount, assetId) | |
807 | + | ||
808 | + | ||
809 | + | ||
810 | + | @Callable(i) | |
811 | + | func stakeAll () = stakeUnstake(true, (tryGetInteger("global_WAVES_balance") - tryGetInteger("leasing_amount")), "WAVES") | |
812 | + | ||
813 | + | ||
814 | + | ||
815 | + | @Callable(i) | |
816 | + | func swapInternal (assetOut,minimum,AmountIn,AssetIn,caller) = if ((i.caller != this)) | |
817 | + | then throw("You cant call this directly") | |
818 | + | else { | |
819 | + | let AssetOut = getAssetBytes(assetOut) | |
820 | + | let day = calculateDaysSinceStart() | |
821 | + | let reveneu = tryGetInteger(reveneuForDayByAssetOut(day, assetOut)) | |
822 | + | let AssetInBalance = tryGetInteger((("global_" + AssetIn) + "_balance")) | |
823 | + | if ((AssetInBalance == AssetInBalance)) | |
824 | + | then { | |
825 | + | let AssetOutBalance = tryGetInteger((("global_" + assetOut) + "_balance")) | |
826 | + | if ((AssetOutBalance == AssetOutBalance)) | |
827 | + | then { | |
828 | + | let AmountOut = calculateOutAmount(AmountIn, getAssetBytes(AssetIn), AssetOut, AssetInBalance, AssetOutBalance) | |
829 | + | if ((AmountOut == AmountOut)) | |
830 | + | then { | |
831 | + | let feeAmount = fraction(AmountOut, Fee, FeeScale) | |
832 | + | if ((feeAmount == feeAmount)) | |
833 | + | then { | |
834 | + | let cleanAmountOut = (AmountOut - feeAmount) | |
835 | + | if ((cleanAmountOut == cleanAmountOut)) | |
836 | + | then if ((minimum > cleanAmountOut)) | |
837 | + | then throw(("amount to recieve is lower than given one: " + toString(cleanAmountOut))) | |
838 | + | else if ((0 > (AssetOutBalance - AmountOut))) | |
839 | + | then throw("contract is out of reserves") | |
840 | + | else if ((AssetOut == getAssetBytes(AssetIn))) | |
841 | + | then throw("this swap is not allowed") | |
842 | + | else { | |
843 | + | let volumeKey = volumeForDayByIn(day, AssetIn) | |
844 | + | let volume = tryGetInteger(volumeKey) | |
845 | + | let newBalanceIn = (AssetInBalance + AmountIn) | |
846 | + | if ((newBalanceIn == newBalanceIn)) | |
847 | + | then { | |
848 | + | let stake = reentrantInvoke(this, "internal", [true, AmountIn, AssetIn], nil) | |
849 | + | if ((stake == stake)) | |
850 | + | then { | |
851 | + | let newBalanceOut = (AssetOutBalance - AmountOut) | |
852 | + | if ((newBalanceOut == newBalanceOut)) | |
853 | + | then { | |
854 | + | let unstake = reentrantInvoke(this, "internal", [false, (cleanAmountOut + fraction(feeAmount, 3, 4)), assetOut], nil) | |
855 | + | if ((unstake == unstake)) | |
856 | + | then $Tuple2([IntegerEntry((("global_" + assetOut) + "_balance"), (newBalanceOut + fraction(feeAmount, 1, 4))), ScriptTransfer(addressFromStringValue(caller), cleanAmountOut, AssetOut), IntegerEntry((("global_" + AssetIn) + "_balance"), newBalanceIn), IntegerEntry("days_since_apy", day), IntegerEntry(reveneuForDayByAssetOut(day, assetOut), (reveneu + feeAmount)), IntegerEntry(volumeKey, (volume + AmountIn))], $Tuple2(cleanAmountOut, feeAmount)) | |
857 | + | else throw("Strict value is not equal to itself.") | |
858 | + | } | |
859 | + | else throw("Strict value is not equal to itself.") | |
860 | + | } | |
861 | + | else throw("Strict value is not equal to itself.") | |
862 | + | } | |
863 | + | else throw("Strict value is not equal to itself.") | |
864 | + | } | |
865 | + | else throw("Strict value is not equal to itself.") | |
866 | + | } | |
867 | + | else throw("Strict value is not equal to itself.") | |
868 | + | } | |
869 | + | else throw("Strict value is not equal to itself.") | |
870 | + | } | |
871 | + | else throw("Strict value is not equal to itself.") | |
872 | + | } | |
873 | + | else throw("Strict value is not equal to itself.") | |
874 | + | } | |
875 | + | ||
876 | + | ||
877 | + | @Verifier(tx) | |
878 | + | func verify () = if (isTestEnv()) | |
879 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
880 | + | else { | |
881 | + | let firstUser = base58'6TdaXEfhnjYquvPf3yV7MFxt2CbgFmaqsvGwkKfXtKi4' | |
882 | + | let secondUser = base58'7DsP2WaMLocbHuUxux7pbXRjTrrZ1TFQPsi5QumS3gr8' | |
883 | + | let thirdUser = base58'BpFWP3p3JgYrrP45xfrKzeMcWMEXoinj4FVPPkUiA8D3' | |
884 | + | let firstUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], firstUser)) | |
885 | + | then 1 | |
886 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[1], firstUser)) | |
887 | + | then 1 | |
888 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[2], firstUser)) | |
889 | + | then 1 | |
890 | + | else 0 | |
891 | + | let secondUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], secondUser)) | |
892 | + | then 1 | |
893 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[1], secondUser)) | |
894 | + | then 1 | |
895 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[2], secondUser)) | |
896 | + | then 1 | |
897 | + | else 0 | |
898 | + | let thirdUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], thirdUser)) | |
899 | + | then 1 | |
900 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[1], thirdUser)) | |
901 | + | then 1 | |
902 | + | else if (sigVerify(tx.bodyBytes, tx.proofs[2], thirdUser)) | |
903 | + | then 1 | |
904 | + | else 0 | |
905 | + | let signaturesCount = ((firstUserSigned + secondUserSigned) + thirdUserSigned) | |
906 | + | match tx { | |
907 | + | case _ => | |
908 | + | (signaturesCount >= 2) | |
909 | + | } | |
910 | + | } | |
911 | + |
github/deemru/w8io/026f985 40.14 ms ◑