tx · HTMNnfxYyTVQ1qEdjrx4LeaSMeHrb12hZRVPDZZXmGdQ 3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn: -0.02700000 Waves 2023.06.27 18:19 [2641238] smart account 3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn > SELF 0.00000000 Waves
{ "type": 13, "id": "HTMNnfxYyTVQ1qEdjrx4LeaSMeHrb12hZRVPDZZXmGdQ", "fee": 2700000, "feeAssetId": null, "timestamp": 1687879115746, "version": 2, "chainId": 84, "sender": "3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn", "senderPublicKey": "6oJuynzr7rKRYRDWhDrENciDLidQuVGfe82pK7hr5nev", "proofs": [ "4ybEkjyWim88iJJkVavPCVnwobGTgZ3BRhrbeR1yzbcNa8VWWDCHoPz9Zyjb4G6bioknUZAimkUVqqjbMYQcv5du" ], "script": "base64:BgIuCAISCAoGCAgICAgBEgASABIDCgEEEgASAwoBARIAEgMKAQgSAwoBBBIECgIIATMAC3VzZG5Bc3NldElkASC2JinDBPXOU5GkDkt1JC9kjFGx+t+vVCm9SNIdKrKq0QANcHV6emxlQXNzZXRJZAEg8Rr+Jf72mTj0aSrE3+ES1keyxsoOujcJr3dtH46i5WMAC3VzZHRBc3NldElkASAelAcTUnahJZX9yGGogl8Qf986Tym7/JpGP1r9Nk+fkQAOdXNkdFBwdEFzc2V0SWQBIFWx2J9yh4Lv5eNbjawFq2XemkOhLxa7BfMat4el8cUYAA51c2RuQXNzZXRJZFN0cgIsREcyeEZrUGREd0tVb0JrekdBaFF0THBTR3pmWExpQ1lQRXplS0gyQWQyNHAAEHB1enpsZUFzc2V0SWRTdHICLEhFQjhRYXc5eHJXcFdzOHRIc2lBVFlHQldEQnRQMlM3a2NQQUxyTXU0M0FTAA51c2R0QXNzZXRJZFN0cgIsMzROOVljRUVUTFduOTNxWVE2NEVzUDF4ODl0U3J1SlU0NFJyRU1TWFhFUEoAEXVzZHRQcHRBc3NldElkU3RyAiw2bVd3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CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUJQW1vdW50T3V0BQhBc3NldE91dAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQERQGV4dHJOYXRpdmUoMTA2MikBCQEMdHJ5R2V0U3RyaW5nAQIQc3RhdGljX3Bvb2xPd25lcgUKY3JlYXRvckZlZQULZmVlQXNzZXRPdXQJAMwIAgkBDEludGVnZXJFbnRyeQICFGdsb2JhbF9lYXJuZWRCeU93bmVyCQBkAgkBDXRyeUdldEludGVnZXIBAhRnbG9iYWxfZWFybmVkQnlPd25lcgUKY3JlYXRvckZlZQkAzAgCCQEMSW50ZWdlckVudHJ5AgINZ2xvYmFsX3ZvbHVtZQkAZAIJAQ10cnlHZXRJbnRlZ2VyAQINZ2xvYmFsX3ZvbHVtZQUMdm9sdW1lVXBkYXRlBQNuaWwDCQAAAgUMc3Rha2luZ1RvcFVwBQR1bml0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQUMZmVlQ29sbGVjdG9yBQtwcm90b2NvbEZlZQULZmVlQXNzZXRPdXQFA25pbAUDbmlsBQlBbW91bnRPdXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkAAwkBCmlzU2h1dGRvd24ABwMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkGCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQxtYXN0ZXJQdWJLZXli4way", "height": 2641238, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CrqJi2WVLN7hz63z5HdxsxR8xRiizvpU1S23Nqu8nH1Z Next: EfbaQqEWLNEwVx1dPfgWBZEkNWg7J1dAcxh8XsEUxBRR Diff:
Old | New | Differences | |
---|---|---|---|
372 | 372 | let IndexIn = value(indexOf(assetIds, assetIn)) | |
373 | 373 | let IndexOut = value(indexOf(assetIds, assetOut)) | |
374 | 374 | if ((IndexIn == IndexOut)) | |
375 | - | then | |
375 | + | then AmountIn | |
376 | 376 | 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) | |
377 | 377 | } | |
378 | 378 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdnAssetId = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
5 | 5 | ||
6 | 6 | let puzzleAssetId = base58'HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS' | |
7 | 7 | ||
8 | 8 | let usdtAssetId = base58'34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ' | |
9 | 9 | ||
10 | 10 | let usdtPptAssetId = base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
11 | 11 | ||
12 | 12 | let usdnAssetIdStr = "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" | |
13 | 13 | ||
14 | 14 | let puzzleAssetIdStr = "HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS" | |
15 | 15 | ||
16 | 16 | let usdtAssetIdStr = "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" | |
17 | 17 | ||
18 | 18 | let usdtPptAssetIdStr = "6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63" | |
19 | 19 | ||
20 | 20 | let parentPoolAddress = Address(base58'3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy') | |
21 | 21 | ||
22 | 22 | let masterAddress = Address(base58'3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy') | |
23 | 23 | ||
24 | 24 | let masterPubKey = base58'4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU' | |
25 | 25 | ||
26 | 26 | let feeCollector = base58'3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy' | |
27 | 27 | ||
28 | 28 | let stakingContract = base58'3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy' | |
29 | 29 | ||
30 | 30 | let controlContract = base58'3MzEbuBV9st5CMYSdFJgaeSZL5zcaDMjhjR' | |
31 | 31 | ||
32 | 32 | func tryGetInteger (key) = match getInteger(this, key) { | |
33 | 33 | case b: Int => | |
34 | 34 | b | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func tryGetBinary (key) = match getBinary(this, key) { | |
41 | 41 | case b: ByteVector => | |
42 | 42 | b | |
43 | 43 | case _ => | |
44 | 44 | base58'' | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func tryGetString (key) = match getString(this, key) { | |
49 | 49 | case b: String => | |
50 | 50 | b | |
51 | 51 | case _ => | |
52 | 52 | "" | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getAssetString (assetId) = match assetId { | |
57 | 57 | case b: ByteVector => | |
58 | 58 | toBase58String(b) | |
59 | 59 | case _ => | |
60 | 60 | "WAVES" | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES")) | |
65 | 65 | then unit | |
66 | 66 | else fromBase58String(assetIdStr) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func addAssetBytesToList (accum,item) = (accum :+ getAssetBytes(item)) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func addAssetWeightToList (accum,item) = (accum :+ tryGetInteger((("static_" + getAssetString(item)) + "_weight"))) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func addAssetDecimalsToList (accum,item) = (accum :+ tryGetInteger((("static_" + getAssetString(item)) + "_decimals"))) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func addAssetScaleToList (accum,item) = (accum :+ tryGetInteger((("static_" + getAssetString(item)) + "_scale"))) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func addIntToList (accum,item) = (accum :+ parseIntValue(item)) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | let T = tryGetInteger("static_tokensAmount") | |
85 | 85 | ||
86 | 86 | let assetIds = { | |
87 | 87 | let $l = split(tryGetString("static_tokenIds"), ",") | |
88 | 88 | let $s = size($l) | |
89 | 89 | let $acc0 = nil | |
90 | 90 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
91 | 91 | then $a | |
92 | 92 | else addAssetBytesToList($a, $l[$i]) | |
93 | 93 | ||
94 | 94 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
95 | 95 | then $a | |
96 | 96 | else throw("List size exceeds 10") | |
97 | 97 | ||
98 | 98 | $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) | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | let AssetsWeights = { | |
102 | 102 | let $l = assetIds | |
103 | 103 | let $s = size($l) | |
104 | 104 | let $acc0 = nil | |
105 | 105 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
106 | 106 | then $a | |
107 | 107 | else addAssetWeightToList($a, $l[$i]) | |
108 | 108 | ||
109 | 109 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
110 | 110 | then $a | |
111 | 111 | else throw("List size exceeds 10") | |
112 | 112 | ||
113 | 113 | $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) | |
114 | 114 | } | |
115 | 115 | ||
116 | 116 | let Decimals = { | |
117 | 117 | let $l = assetIds | |
118 | 118 | let $s = size($l) | |
119 | 119 | let $acc0 = nil | |
120 | 120 | func $f2_1 ($a,$i) = if (($i >= $s)) | |
121 | 121 | then $a | |
122 | 122 | else addAssetDecimalsToList($a, $l[$i]) | |
123 | 123 | ||
124 | 124 | func $f2_2 ($a,$i) = if (($i >= $s)) | |
125 | 125 | then $a | |
126 | 126 | else throw("List size exceeds 10") | |
127 | 127 | ||
128 | 128 | $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) | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | let Scales = { | |
132 | 132 | let $l = assetIds | |
133 | 133 | let $s = size($l) | |
134 | 134 | let $acc0 = nil | |
135 | 135 | func $f3_1 ($a,$i) = if (($i >= $s)) | |
136 | 136 | then $a | |
137 | 137 | else addAssetScaleToList($a, $l[$i]) | |
138 | 138 | ||
139 | 139 | func $f3_2 ($a,$i) = if (($i >= $s)) | |
140 | 140 | then $a | |
141 | 141 | else throw("List size exceeds 10") | |
142 | 142 | ||
143 | 143 | $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) | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | let Fee = tryGetInteger("static_fee") | |
147 | 147 | ||
148 | 148 | let AssetsWeightsDecimals = 4 | |
149 | 149 | ||
150 | 150 | let Scale = 10000 | |
151 | 151 | ||
152 | 152 | let Scale8 = 100000000 | |
153 | 153 | ||
154 | 154 | let FeeScale = 10000 | |
155 | 155 | ||
156 | 156 | let PoolTokenDecimals = 8 | |
157 | 157 | ||
158 | 158 | let PoolTokenScale = pow(10, 0, PoolTokenDecimals, 0, 0, HALFUP) | |
159 | 159 | ||
160 | 160 | let earnedAssets = assetIds | |
161 | 161 | ||
162 | 162 | func isShutdown () = match getBoolean(Address(controlContract), "is_shutdown") { | |
163 | 163 | case x: Boolean => | |
164 | 164 | x | |
165 | 165 | case _ => | |
166 | 166 | false | |
167 | 167 | } | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func getCurrentTokenBalance (tokenType) = { | |
171 | 171 | let tokenId = getAssetString(assetIds[tokenType]) | |
172 | 172 | tryGetInteger((("global_" + tokenId) + "_balance")) | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func calculatePIssued (amount,tokenId) = { | |
177 | 177 | let Psupply = tryGetInteger("global_poolToken_amount") | |
178 | 178 | let Balance = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
179 | 179 | fraction(amount, Psupply, Balance, DOWN) | |
180 | 180 | } | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func getMinPIssued (payments) = { | |
184 | 184 | func handler (accum,current) = { | |
185 | 185 | let PIssued = calculatePIssued(current.amount, current.assetId) | |
186 | 186 | if ((PIssued == 0)) | |
187 | 187 | then throw("one of the tokens amounts is too low") | |
188 | 188 | else if (if ((accum == 0)) | |
189 | 189 | then true | |
190 | 190 | else (accum > PIssued)) | |
191 | 191 | then PIssued | |
192 | 192 | else accum | |
193 | 193 | } | |
194 | 194 | ||
195 | 195 | let $l = payments | |
196 | 196 | let $s = size($l) | |
197 | 197 | let $acc0 = 0 | |
198 | 198 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
199 | 199 | then $a | |
200 | 200 | else handler($a, $l[$i]) | |
201 | 201 | ||
202 | 202 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
203 | 203 | then $a | |
204 | 204 | else throw("List size exceeds 10") | |
205 | 205 | ||
206 | 206 | $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) | |
207 | 207 | } | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | func calculateUsdnValue (assetId,amount,aBalance,givenUsdnBalance) = { | |
211 | 211 | let usdnInPool = indexOf(assetIds, usdnAssetId) | |
212 | 212 | let puzzleInPool = indexOf(assetIds, puzzleAssetId) | |
213 | 213 | let usdtInPool = indexOf(assetIds, usdtAssetId) | |
214 | 214 | let wavesInPool = indexOf(assetIds, unit) | |
215 | 215 | let assetWeight = tryGetInteger((("static_" + getAssetString(assetId)) + "_weight")) | |
216 | 216 | let feeAssetStr = tryGetString("static_feeToken") | |
217 | 217 | if ((feeAssetStr == puzzleAssetIdStr)) | |
218 | 218 | then { | |
219 | 219 | let puzzleWeight = AssetsWeights[value(indexOf(assetIds, puzzleAssetId))] | |
220 | 220 | let puzzleBalance = tryGetInteger((("global_" + puzzleAssetIdStr) + "_balance")) | |
221 | 221 | let amountInPuzzle = fraction(amount, (puzzleBalance / puzzleWeight), (aBalance / assetWeight)) | |
222 | 222 | let puzzlePrice = getIntegerValue(parentPoolAddress, "global_lastPuzzlePrice") | |
223 | 223 | fraction((amountInPuzzle * puzzlePrice), 1, Scale8) | |
224 | 224 | } | |
225 | 225 | else if ((feeAssetStr == usdtAssetIdStr)) | |
226 | 226 | then { | |
227 | 227 | let usdtWeight = AssetsWeights[value(usdtInPool)] | |
228 | 228 | let usdtBalance = tryGetInteger((("global_" + usdtAssetIdStr) + "_balance")) | |
229 | 229 | fraction(amount, (usdtBalance / usdtWeight), (aBalance / assetWeight)) | |
230 | 230 | } | |
231 | 231 | else if ((feeAssetStr == usdnAssetIdStr)) | |
232 | 232 | then { | |
233 | 233 | let usdnWeight = AssetsWeights[value(indexOf(assetIds, usdnAssetId))] | |
234 | 234 | let usdnBalance = match givenUsdnBalance { | |
235 | 235 | case x: Int => | |
236 | 236 | givenUsdnBalance | |
237 | 237 | case _ => | |
238 | 238 | tryGetInteger((("global_" + getAssetString(usdnAssetId)) + "_balance")) | |
239 | 239 | } | |
240 | 240 | fraction(amount, (value(usdnBalance) / usdnWeight), (aBalance / assetWeight)) | |
241 | 241 | } | |
242 | 242 | else { | |
243 | 243 | let wavesWeight = 3000 | |
244 | 244 | let wBalance = (tryGetInteger("global_WAVES_balance") / 50) | |
245 | 245 | fraction(amount, (wBalance / wavesWeight), (aBalance / assetWeight)) | |
246 | 246 | } | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func checkTokensValidity (payments) = { | |
251 | 251 | func handler1 (accum,payment) = (accum :+ payment.assetId) | |
252 | 252 | ||
253 | 253 | let ids = { | |
254 | 254 | let $l = payments | |
255 | 255 | let $s = size($l) | |
256 | 256 | let $acc0 = nil | |
257 | 257 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
258 | 258 | then $a | |
259 | 259 | else handler1($a, $l[$i]) | |
260 | 260 | ||
261 | 261 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
262 | 262 | then $a | |
263 | 263 | else throw("List size exceeds 10") | |
264 | 264 | ||
265 | 265 | $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) | |
266 | 266 | } | |
267 | 267 | if ((ids == ids)) | |
268 | 268 | then { | |
269 | 269 | func handler2 (accum,assetId) = if ((indexOf(ids, assetId) != unit)) | |
270 | 270 | then (accum + 1) | |
271 | 271 | else throw(("asset not attached: " + getAssetString(assetId))) | |
272 | 272 | ||
273 | 273 | let checks = { | |
274 | 274 | let $l = assetIds | |
275 | 275 | let $s = size($l) | |
276 | 276 | let $acc0 = 0 | |
277 | 277 | func $f5_1 ($a,$i) = if (($i >= $s)) | |
278 | 278 | then $a | |
279 | 279 | else handler2($a, $l[$i]) | |
280 | 280 | ||
281 | 281 | func $f5_2 ($a,$i) = if (($i >= $s)) | |
282 | 282 | then $a | |
283 | 283 | else throw("List size exceeds 10") | |
284 | 284 | ||
285 | 285 | $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) | |
286 | 286 | } | |
287 | 287 | if ((checks == checks)) | |
288 | 288 | then true | |
289 | 289 | else throw("Strict value is not equal to itself.") | |
290 | 290 | } | |
291 | 291 | else throw("Strict value is not equal to itself.") | |
292 | 292 | } | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func handlePoolTokensAdd (PIssued,payments,userAddress,needChange) = { | |
296 | 296 | func getTokenPaymentAmount (tokenId) = { | |
297 | 297 | func handler (accum,payment) = if ((payment.assetId == tokenId)) | |
298 | 298 | then payment.amount | |
299 | 299 | else accum | |
300 | 300 | ||
301 | 301 | let $l = payments | |
302 | 302 | let $s = size($l) | |
303 | 303 | let $acc0 = 0 | |
304 | 304 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
305 | 305 | then $a | |
306 | 306 | else handler($a, $l[$i]) | |
307 | 307 | ||
308 | 308 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
309 | 309 | then $a | |
310 | 310 | else throw("List size exceeds 10") | |
311 | 311 | ||
312 | 312 | $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) | |
313 | 313 | } | |
314 | 314 | ||
315 | 315 | func handleTokenChange (accum,tokenId) = { | |
316 | 316 | let Bk = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
317 | 317 | let PSupply = tryGetInteger("global_poolToken_amount") | |
318 | 318 | let tokenDecimals = tryGetInteger((("static_" + getAssetString(tokenId)) + "_scale")) | |
319 | 319 | let Dk = fraction((fraction((PSupply + PIssued), tokenDecimals, PSupply, CEILING) - tokenDecimals), Bk, tokenDecimals, CEILING) | |
320 | 320 | let paymentAmount = getTokenPaymentAmount(tokenId) | |
321 | 321 | let toReturn = ((if ((paymentAmount != 0)) | |
322 | 322 | then paymentAmount | |
323 | 323 | else 0) - Dk) | |
324 | 324 | let t = if (if (needChange) | |
325 | 325 | then (toReturn > 0) | |
326 | 326 | else false) | |
327 | 327 | then [ScriptTransfer(userAddress, toReturn, tokenId)] | |
328 | 328 | else nil | |
329 | 329 | ((accum ++ t) :+ IntegerEntry((("global_" + getAssetString(tokenId)) + "_balance"), (Bk + Dk))) | |
330 | 330 | } | |
331 | 331 | ||
332 | 332 | let $l = assetIds | |
333 | 333 | let $s = size($l) | |
334 | 334 | let $acc0 = nil | |
335 | 335 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
336 | 336 | then $a | |
337 | 337 | else handleTokenChange($a, $l[$i]) | |
338 | 338 | ||
339 | 339 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
340 | 340 | then $a | |
341 | 341 | else throw("List size exceeds 10") | |
342 | 342 | ||
343 | 343 | $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) | |
344 | 344 | } | |
345 | 345 | ||
346 | 346 | ||
347 | 347 | func handlePoolTokensRedeem (PRedeemed,userAddress) = { | |
348 | 348 | func handleTokenRedeem (accum,tokenId) = { | |
349 | 349 | let Bk = tryGetInteger((("global_" + getAssetString(tokenId)) + "_balance")) | |
350 | 350 | let PSupply = tryGetInteger("global_poolToken_amount") | |
351 | 351 | let tokenDecimals = tryGetInteger((("static_" + getAssetString(tokenId)) + "_scale")) | |
352 | 352 | let amount = toInt(fraction((toBigInt(Scale8) - fraction(toBigInt((PSupply - PRedeemed)), toBigInt(Scale8), toBigInt(PSupply), CEILING)), toBigInt(Bk), toBigInt(Scale8), DOWN)) | |
353 | 353 | ((accum :+ IntegerEntry((("global_" + getAssetString(tokenId)) + "_balance"), (Bk - amount))) :+ ScriptTransfer(userAddress, amount, tokenId)) | |
354 | 354 | } | |
355 | 355 | ||
356 | 356 | let $l = assetIds | |
357 | 357 | let $s = size($l) | |
358 | 358 | let $acc0 = nil | |
359 | 359 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
360 | 360 | then $a | |
361 | 361 | else handleTokenRedeem($a, $l[$i]) | |
362 | 362 | ||
363 | 363 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
364 | 364 | then $a | |
365 | 365 | else throw("List size exceeds 10") | |
366 | 366 | ||
367 | 367 | $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) | |
368 | 368 | } | |
369 | 369 | ||
370 | 370 | ||
371 | 371 | func calculateOutAmount (AmountIn,assetIn,assetOut,BalanceIn,BalanceOut) = { | |
372 | 372 | let IndexIn = value(indexOf(assetIds, assetIn)) | |
373 | 373 | let IndexOut = value(indexOf(assetIds, assetOut)) | |
374 | 374 | if ((IndexIn == IndexOut)) | |
375 | - | then | |
375 | + | then AmountIn | |
376 | 376 | 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) | |
377 | 377 | } | |
378 | 378 | ||
379 | 379 | ||
380 | 380 | func getTokenBalance (assetId) = match assetId { | |
381 | 381 | case t: ByteVector => | |
382 | 382 | assetBalance(this, t) | |
383 | 383 | case _ => | |
384 | 384 | wavesBalance(this).available | |
385 | 385 | } | |
386 | 386 | ||
387 | 387 | ||
388 | 388 | func calculateCurrentAssetInterest (assetId,assetIdStr,aBalance,tokenEarningsLastCheck) = { | |
389 | 389 | let totalStaked = tryGetInteger("global_indexStaked") | |
390 | 390 | let tokenBalanceLastCheck = tokenEarningsLastCheck | |
391 | 391 | let currentBalanceDelta = (getTokenBalance(assetId) - aBalance) | |
392 | 392 | let currentTokenEarnings = if ((currentBalanceDelta > tokenBalanceLastCheck)) | |
393 | 393 | then currentBalanceDelta | |
394 | 394 | else tokenBalanceLastCheck | |
395 | 395 | let newEarnings = (currentTokenEarnings - tokenBalanceLastCheck) | |
396 | 396 | let newInterest = if ((totalStaked == 0)) | |
397 | 397 | then 0 | |
398 | 398 | else fraction(newEarnings, Scale8, totalStaked) | |
399 | 399 | let lastCheckInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest")) | |
400 | 400 | (lastCheckInterest + newInterest) | |
401 | 401 | } | |
402 | 402 | ||
403 | 403 | ||
404 | 404 | func claimResult (address) = { | |
405 | 405 | let addressStr = toString(address) | |
406 | 406 | let puzzleAmount = tryGetInteger((addressStr + "_indexStaked")) | |
407 | 407 | func handler (accum,assetId) = { | |
408 | 408 | let assetIdStr = getAssetString(assetId) | |
409 | 409 | let aBalance = tryGetInteger((("global_" + getAssetString(assetId)) + "_balance")) | |
410 | 410 | let tokenEarningsLastCheck = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_earnings")) | |
411 | 411 | let currentTokenInterest = calculateCurrentAssetInterest(assetId, assetIdStr, aBalance, tokenEarningsLastCheck) | |
412 | 412 | let currentTokenEarnings = max([tokenEarningsLastCheck, (getTokenBalance(assetId) - aBalance)]) | |
413 | 413 | let rewardAmount = fraction(puzzleAmount, (currentTokenInterest - tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"))), Scale8) | |
414 | 414 | let transfer = if ((rewardAmount == 0)) | |
415 | 415 | then nil | |
416 | 416 | else [ScriptTransfer(address, rewardAmount, assetId)] | |
417 | 417 | $Tuple2(((accum._1 ++ transfer) ++ [IntegerEntry((("global_lastCheck_" + assetIdStr) + "_earnings"), (currentTokenEarnings - rewardAmount)), IntegerEntry((("global_lastCheck_" + assetIdStr) + "_interest"), currentTokenInterest), IntegerEntry((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"), currentTokenInterest)]), (accum._2 + calculateUsdnValue(assetId, rewardAmount, aBalance, unit))) | |
418 | 418 | } | |
419 | 419 | ||
420 | 420 | let accum = { | |
421 | 421 | let $l = earnedAssets | |
422 | 422 | let $s = size($l) | |
423 | 423 | let $acc0 = $Tuple2(nil, 0) | |
424 | 424 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
425 | 425 | then $a | |
426 | 426 | else handler($a, $l[$i]) | |
427 | 427 | ||
428 | 428 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
429 | 429 | then $a | |
430 | 430 | else throw("List size exceeds 10") | |
431 | 431 | ||
432 | 432 | $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) | |
433 | 433 | } | |
434 | 434 | $Tuple2((accum._1 ++ [IntegerEntry((addressStr + "_claimedRewardValue"), (tryGetInteger((addressStr + "_claimedRewardValue")) + accum._2)), IntegerEntry((addressStr + "_lastClaim"), lastBlock.timestamp)]), accum._2) | |
435 | 435 | } | |
436 | 436 | ||
437 | 437 | ||
438 | 438 | func indexStakeResult (addressStr,amount) = { | |
439 | 439 | let li = claimResult(addressFromStringValue(addressStr))._1 | |
440 | 440 | (li ++ [IntegerEntry((addressStr + "_indexStaked"), (tryGetInteger((addressStr + "_indexStaked")) + amount)), IntegerEntry("global_indexStaked", (tryGetInteger("global_indexStaked") + amount))]) | |
441 | 441 | } | |
442 | 442 | ||
443 | 443 | ||
444 | 444 | func sum (accum,n) = (accum + parseIntValue(n)) | |
445 | 445 | ||
446 | 446 | ||
447 | 447 | @Callable(i) | |
448 | 448 | func preInit (assetIdsStr,assetWeightsStr,baseTokenIdStr,poolDomain,poolOwner,fee) = { | |
449 | 449 | let poolOwnerAddress = Address(fromBase58String(poolOwner)) | |
450 | 450 | if (isShutdown()) | |
451 | 451 | then throw("contract is on stop") | |
452 | 452 | else if ((this != i.caller)) | |
453 | 453 | then throw("admin only") | |
454 | 454 | else if ((size(poolDomain) > 13)) | |
455 | 455 | then throw("too large pool domain") | |
456 | 456 | else if (if ((50 > fee)) | |
457 | 457 | then true | |
458 | 458 | else (fee > 500)) | |
459 | 459 | then throw("fee value must be between 50 and 500 (0.5-5%)") | |
460 | 460 | else if (if (if (if (if ((indexOf(assetIdsStr, puzzleAssetIdStr) == unit)) | |
461 | 461 | then (indexOf(assetIdsStr, usdnAssetIdStr) == unit) | |
462 | 462 | else false) | |
463 | 463 | then (indexOf(assetIdsStr, usdtAssetIdStr) == unit) | |
464 | 464 | else false) | |
465 | 465 | then (indexOf(assetIdsStr, "WAVES") == unit) | |
466 | 466 | else false) | |
467 | 467 | then (indexOf(assetIdsStr, usdtPptAssetIdStr) == unit) | |
468 | 468 | else false) | |
469 | 469 | then throw("pool must have USDT-WXG, USDT-PPT, USDN, WAVES or PUZZLE in the composition") | |
470 | 470 | else { | |
471 | 471 | let assetIdsStrLi = split(assetIdsStr, ",") | |
472 | 472 | let assetIdsLi = { | |
473 | 473 | let $l = assetIdsStrLi | |
474 | 474 | let $s = size($l) | |
475 | 475 | let $acc0 = nil | |
476 | 476 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
477 | 477 | then $a | |
478 | 478 | else addAssetBytesToList($a, $l[$i]) | |
479 | 479 | ||
480 | 480 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
481 | 481 | then $a | |
482 | 482 | else throw("List size exceeds 10") | |
483 | 483 | ||
484 | 484 | $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) | |
485 | 485 | } | |
486 | 486 | let assetWeightsStrLi = split(assetWeightsStr, ",") | |
487 | 487 | let assetWeightsSum = { | |
488 | 488 | let $l = assetWeightsStrLi | |
489 | 489 | let $s = size($l) | |
490 | 490 | let $acc0 = 0 | |
491 | 491 | func $f5_1 ($a,$i) = if (($i >= $s)) | |
492 | 492 | then $a | |
493 | 493 | else sum($a, $l[$i]) | |
494 | 494 | ||
495 | 495 | func $f5_2 ($a,$i) = if (($i >= $s)) | |
496 | 496 | then $a | |
497 | 497 | else throw("List size exceeds 10") | |
498 | 498 | ||
499 | 499 | $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) | |
500 | 500 | } | |
501 | 501 | let feeAssetStr = if ((indexOf(assetIdsStr, usdnAssetIdStr) != unit)) | |
502 | 502 | then usdnAssetIdStr | |
503 | 503 | else if ((indexOf(assetIdsStr, "WAVES") != unit)) | |
504 | 504 | then "WAVES" | |
505 | 505 | else if ((indexOf(assetIdsStr, usdtAssetIdStr) != unit)) | |
506 | 506 | then usdtAssetIdStr | |
507 | 507 | else if ((indexOf(assetIdsStr, puzzleAssetIdStr) != unit)) | |
508 | 508 | then puzzleAssetIdStr | |
509 | 509 | else usdtPptAssetIdStr | |
510 | 510 | func addTokenDataEntries (accum,assetNum) = if ((assetNum >= size(assetIdsLi))) | |
511 | 511 | then accum | |
512 | 512 | else { | |
513 | 513 | let assetDecimals = match assetIdsLi[assetNum] { | |
514 | 514 | case x: ByteVector => | |
515 | 515 | value(assetInfo(x)).decimals | |
516 | 516 | case _ => | |
517 | 517 | 8 | |
518 | 518 | } | |
519 | 519 | (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])))]) | |
520 | 520 | } | |
521 | 521 | ||
522 | 522 | if ((assetWeightsSum != 10000)) | |
523 | 523 | then throw("sum of token weights must be equal to 10000") | |
524 | 524 | else ({ | |
525 | 525 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
526 | 526 | let $s = size($l) | |
527 | 527 | let $acc0 = nil | |
528 | 528 | func $f6_1 ($a,$i) = if (($i >= $s)) | |
529 | 529 | then $a | |
530 | 530 | else addTokenDataEntries($a, $l[$i]) | |
531 | 531 | ||
532 | 532 | func $f6_2 ($a,$i) = if (($i >= $s)) | |
533 | 533 | then $a | |
534 | 534 | else throw("List size exceeds 10") | |
535 | 535 | ||
536 | 536 | $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) | |
537 | 537 | } ++ [StringEntry("static_tokenIds", assetIdsStr), StringEntry("static_feeToken", feeAssetStr), StringEntry("static_tokenWeights", assetWeightsStr), IntegerEntry("static_tokensAmount", size(assetIdsLi)), StringEntry("static_poolDomain", poolDomain), StringEntry("static_baseTokenId", baseTokenIdStr), StringEntry("static_poolOwner", poolOwner), IntegerEntry("static_fee", fee)]) | |
538 | 538 | } | |
539 | 539 | } | |
540 | 540 | ||
541 | 541 | ||
542 | 542 | ||
543 | 543 | @Callable(i) | |
544 | 544 | func deInit () = if ((i.caller != this)) | |
545 | 545 | then throw("admin only") | |
546 | 546 | else [IntegerEntry("global_wasInited", 0)] | |
547 | 547 | ||
548 | 548 | ||
549 | 549 | ||
550 | 550 | @Callable(i) | |
551 | 551 | func init () = { | |
552 | 552 | func prepareList () = { | |
553 | 553 | func handler (accum,n) = (accum :+ IntegerEntry((("global_" + getAssetString(n.assetId)) + "_balance"), n.amount)) | |
554 | 554 | ||
555 | 555 | let $l = i.payments | |
556 | 556 | let $s = size($l) | |
557 | 557 | let $acc0 = nil | |
558 | 558 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
559 | 559 | then $a | |
560 | 560 | else handler($a, $l[$i]) | |
561 | 561 | ||
562 | 562 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
563 | 563 | then $a | |
564 | 564 | else throw("List size exceeds 10") | |
565 | 565 | ||
566 | 566 | $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) | |
567 | 567 | } | |
568 | 568 | ||
569 | 569 | func calculatePoolTokensAmount (payments) = { | |
570 | 570 | func handler (accum,pmt) = { | |
571 | 571 | let assetId = pmt.assetId | |
572 | 572 | func handler2 (accum,n) = if ((n == assetId)) | |
573 | 573 | then value(indexOf(assetIds, n)) | |
574 | 574 | else accum | |
575 | 575 | ||
576 | 576 | let Token = { | |
577 | 577 | let $l = assetIds | |
578 | 578 | let $s = size($l) | |
579 | 579 | let $acc0 = 1 | |
580 | 580 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
581 | 581 | then $a | |
582 | 582 | else handler2($a, $l[$i]) | |
583 | 583 | ||
584 | 584 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
585 | 585 | then $a | |
586 | 586 | else throw("List size exceeds 10") | |
587 | 587 | ||
588 | 588 | $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) | |
589 | 589 | } | |
590 | 590 | fraction(accum, pow(pmt.amount, Decimals[Token], AssetsWeights[Token], AssetsWeightsDecimals, 8, FLOOR), Scale8) | |
591 | 591 | } | |
592 | 592 | ||
593 | 593 | let $l = payments | |
594 | 594 | let $s = size($l) | |
595 | 595 | let $acc0 = PoolTokenScale | |
596 | 596 | func $f4_1 ($a,$i) = if (($i >= $s)) | |
597 | 597 | then $a | |
598 | 598 | else handler($a, $l[$i]) | |
599 | 599 | ||
600 | 600 | func $f4_2 ($a,$i) = if (($i >= $s)) | |
601 | 601 | then $a | |
602 | 602 | else throw("List size exceeds 10") | |
603 | 603 | ||
604 | 604 | $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) | |
605 | 605 | } | |
606 | 606 | ||
607 | 607 | if (isShutdown()) | |
608 | 608 | then throw("contract is on stop") | |
609 | 609 | else if ((tryGetInteger("global_wasInited") > 0)) | |
610 | 610 | then throw("pool already inited") | |
611 | 611 | else { | |
612 | 612 | let initialPoolTokens = calculatePoolTokensAmount(i.payments) | |
613 | 613 | if ((initialPoolTokens == 0)) | |
614 | 614 | then throw("you need a bigger tokens amount to launch the pool") | |
615 | 615 | else { | |
616 | 616 | let poolTokenIssue = Issue(("PZ " + tryGetString("static_poolDomain")), "Puzzle Swap: pool index token", initialPoolTokens, PoolTokenDecimals, true, unit, 0) | |
617 | 617 | let poolTokenId = calculateAssetId(poolTokenIssue) | |
618 | 618 | (prepareList() ++ [poolTokenIssue, IntegerEntry("global_poolToken_amount", initialPoolTokens), IntegerEntry("global_wasInited", 1), BinaryEntry("global_poolToken_id", poolTokenId), StringEntry("static_poolToken_idStr", getAssetString(poolTokenId)), IntegerEntry((toString(i.caller) + "_indexStaked"), initialPoolTokens), IntegerEntry("global_indexStaked", initialPoolTokens)]) | |
619 | 619 | } | |
620 | 620 | } | |
621 | 621 | } | |
622 | 622 | ||
623 | 623 | ||
624 | 624 | ||
625 | 625 | @Callable(i) | |
626 | 626 | func generateIndex (needChange) = if (isShutdown()) | |
627 | 627 | then throw("contract is on stop") | |
628 | 628 | else if ((size(i.payments) != T)) | |
629 | 629 | then throw(("you need to attach all pool tokens. amount of pool tokens: " + toString(T))) | |
630 | 630 | else if (!(checkTokensValidity(i.payments))) | |
631 | 631 | then throw("wrong assets attached") | |
632 | 632 | else { | |
633 | 633 | let PIssued = getMinPIssued(i.payments) | |
634 | 634 | let reissue = Reissue(getBinaryValue("global_poolToken_id"), PIssued, true) | |
635 | 635 | let result = handlePoolTokensAdd(PIssued, i.payments, i.originCaller, needChange) | |
636 | 636 | $Tuple2((result ++ [reissue, ScriptTransfer(i.caller, PIssued, tryGetBinary("global_poolToken_id")), IntegerEntry("global_poolToken_amount", (tryGetInteger("global_poolToken_amount") + PIssued))]), PIssued) | |
637 | 637 | } | |
638 | 638 | ||
639 | 639 | ||
640 | 640 | ||
641 | 641 | @Callable(i) | |
642 | 642 | func stakeIndex () = { | |
643 | 643 | let addressStr = toString(i.originCaller) | |
644 | 644 | let pmt = i.payments[0] | |
645 | 645 | if (isShutdown()) | |
646 | 646 | then throw("contract is on stop") | |
647 | 647 | else if ((value(pmt.assetId) != tryGetBinary("global_poolToken_id"))) | |
648 | 648 | then throw("wrong asset attached") | |
649 | 649 | else indexStakeResult(addressStr, pmt.amount) | |
650 | 650 | } | |
651 | 651 | ||
652 | 652 | ||
653 | 653 | ||
654 | 654 | @Callable(i) | |
655 | 655 | func unstakeIndex (puzzleAmount) = { | |
656 | 656 | let addressStr = toString(i.originCaller) | |
657 | 657 | let puzzleAvailable = tryGetInteger((addressStr + "_indexStaked")) | |
658 | 658 | if (isShutdown()) | |
659 | 659 | then throw("contract is on stop") | |
660 | 660 | else if ((puzzleAmount > puzzleAvailable)) | |
661 | 661 | then throw("you don't have index tokens available") | |
662 | 662 | else (claimResult(i.originCaller)._1 ++ [IntegerEntry((addressStr + "_indexStaked"), (puzzleAvailable - puzzleAmount)), IntegerEntry("global_indexStaked", (tryGetInteger("global_indexStaked") - puzzleAmount)), ScriptTransfer(i.caller, puzzleAmount, getBinaryValue("global_poolToken_id"))]) | |
663 | 663 | } | |
664 | 664 | ||
665 | 665 | ||
666 | 666 | ||
667 | 667 | @Callable(i) | |
668 | 668 | func claimIndexRewards () = if (isShutdown()) | |
669 | 669 | then throw("contract is on stop") | |
670 | 670 | else claimResult(i.caller) | |
671 | 671 | ||
672 | 672 | ||
673 | 673 | ||
674 | 674 | @Callable(i) | |
675 | 675 | func evaluateClaim (user) = $Tuple2(nil, claimResult(addressFromStringValue(user))._2) | |
676 | 676 | ||
677 | 677 | ||
678 | 678 | ||
679 | 679 | @Callable(i) | |
680 | 680 | func redeemIndex (sendToOrigin) = { | |
681 | 681 | let pmt = i.payments[0] | |
682 | 682 | if ((pmt.assetId != tryGetBinary("global_poolToken_id"))) | |
683 | 683 | then throw("please attach pool share token") | |
684 | 684 | else if (isShutdown()) | |
685 | 685 | then throw("contract is on stop") | |
686 | 686 | else { | |
687 | 687 | let PRedeemed = pmt.amount | |
688 | 688 | let result = handlePoolTokensRedeem(PRedeemed, if (sendToOrigin) | |
689 | 689 | then i.originCaller | |
690 | 690 | else i.caller) | |
691 | 691 | (result ++ [Burn(tryGetBinary("global_poolToken_id"), PRedeemed), IntegerEntry("global_poolToken_amount", (tryGetInteger("global_poolToken_amount") - PRedeemed))]) | |
692 | 692 | } | |
693 | 693 | } | |
694 | 694 | ||
695 | 695 | ||
696 | 696 | ||
697 | 697 | @Callable(i) | |
698 | 698 | func swap (assetOut,minimum) = if ((size(i.payments) != 1)) | |
699 | 699 | then throw("please attach exactly one payment") | |
700 | 700 | else { | |
701 | 701 | let pmt = value(i.payments[0]) | |
702 | 702 | let AmountIn = value(i.payments[0].amount) | |
703 | 703 | let AssetIn = pmt.assetId | |
704 | 704 | let AssetOut = getAssetBytes(assetOut) | |
705 | 705 | let feeAssetOutStr = tryGetString("static_feeToken") | |
706 | 706 | let feeAssetOut = if ((feeAssetOutStr == "")) | |
707 | 707 | then usdnAssetId | |
708 | 708 | else getAssetBytes(feeAssetOutStr) | |
709 | 709 | let AssetInBalance = tryGetInteger((("global_" + getAssetString(AssetIn)) + "_balance")) | |
710 | 710 | let AssetOutBalance = tryGetInteger((("global_" + assetOut) + "_balance")) | |
711 | 711 | let feeAmountIn = fraction(AmountIn, Fee, FeeScale) | |
712 | 712 | let cleanAmountIn = (AmountIn - feeAmountIn) | |
713 | 713 | let AmountOut = calculateOutAmount(cleanAmountIn, AssetIn, AssetOut, AssetInBalance, AssetOutBalance) | |
714 | 714 | let AssetOutBalance2 = (AssetOutBalance - AmountOut) | |
715 | 715 | let AssetInBalance2 = (AssetInBalance + cleanAmountIn) | |
716 | 716 | let feeAssetOutBalance = if ((feeAssetOut == AssetIn)) | |
717 | 717 | then AssetInBalance2 | |
718 | 718 | else if ((feeAssetOut == AssetOut)) | |
719 | 719 | then AssetOutBalance2 | |
720 | 720 | else tryGetInteger((("global_" + getAssetString(feeAssetOut)) + "_balance")) | |
721 | 721 | let feeAmountOut = calculateOutAmount(feeAmountIn, AssetIn, feeAssetOut, AssetInBalance, feeAssetOutBalance) | |
722 | 722 | if ((minimum > AmountOut)) | |
723 | 723 | then throw("amount to recieve is lower than given one") | |
724 | 724 | else if ((AssetOut == AssetIn)) | |
725 | 725 | then throw("this swap is not allowed") | |
726 | 726 | else if ((0 > (AssetOutBalance - AmountOut))) | |
727 | 727 | then throw("contract is out of reserves") | |
728 | 728 | else if (isShutdown()) | |
729 | 729 | then throw("contract is on stop") | |
730 | 730 | else { | |
731 | 731 | let creatorFee = fraction(feeAmountOut, 1, 10) | |
732 | 732 | let protocolFee = fraction(feeAmountOut, 4, 10) | |
733 | 733 | let stakingTopUp = if (if ((feeAssetOut == usdnAssetId)) | |
734 | 734 | then true | |
735 | 735 | else (feeAssetOut == puzzleAssetId)) | |
736 | 736 | then reentrantInvoke(Address(stakingContract), "topUpReward", nil, [AttachedPayment(feeAssetOut, protocolFee)]) | |
737 | 737 | else unit | |
738 | 738 | if ((stakingTopUp == stakingTopUp)) | |
739 | 739 | then { | |
740 | 740 | let newBalanceIn = AssetInBalance2 | |
741 | 741 | let newBalanceOut = (AssetOutBalance2 - (if ((AssetOut == feeAssetOut)) | |
742 | 742 | then feeAmountOut | |
743 | 743 | else 0)) | |
744 | 744 | let newBalanceFeeAsset = if (if ((feeAssetOut != AssetIn)) | |
745 | 745 | then (feeAssetOut != AssetOut) | |
746 | 746 | else false) | |
747 | 747 | then (feeAssetOutBalance - feeAmountOut) | |
748 | 748 | else unit | |
749 | 749 | let assetInChange = IntegerEntry((("global_" + getAssetString(AssetIn)) + "_balance"), newBalanceIn) | |
750 | 750 | let assetOutChange = IntegerEntry((("global_" + assetOut) + "_balance"), newBalanceOut) | |
751 | 751 | let feeAssetOutChange = if ((newBalanceFeeAsset != unit)) | |
752 | 752 | then IntegerEntry((("global_" + getAssetString(feeAssetOut)) + "_balance"), value(newBalanceFeeAsset)) | |
753 | 753 | else StringEntry("hello", "world") | |
754 | 754 | let volumeUpdate = calculateUsdnValue(AssetIn, AmountIn, AssetInBalance, feeAssetOutBalance) | |
755 | 755 | $Tuple2(([assetOutChange, assetInChange, feeAssetOutChange, ScriptTransfer(i.caller, AmountOut, AssetOut), ScriptTransfer(addressFromStringValue(tryGetString("static_poolOwner")), creatorFee, feeAssetOut), IntegerEntry("global_earnedByOwner", (tryGetInteger("global_earnedByOwner") + creatorFee)), IntegerEntry("global_volume", (tryGetInteger("global_volume") + volumeUpdate))] ++ (if ((stakingTopUp == unit)) | |
756 | 756 | then [ScriptTransfer(Address(feeCollector), protocolFee, feeAssetOut)] | |
757 | 757 | else nil)), AmountOut) | |
758 | 758 | } | |
759 | 759 | else throw("Strict value is not equal to itself.") | |
760 | 760 | } | |
761 | 761 | } | |
762 | 762 | ||
763 | 763 | ||
764 | 764 | @Verifier(tx) | |
765 | 765 | func verify () = if (isShutdown()) | |
766 | 766 | then false | |
767 | 767 | else if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
768 | 768 | then true | |
769 | 769 | else sigVerify(tx.bodyBytes, tx.proofs[0], masterPubKey) | |
770 | 770 |
github/deemru/w8io/169f3d6 77.92 ms ◑