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