tx · 7bAZBfr61Lvz5pZo9cfvLwWrS6gT64p15xWg9STLpxtE

3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N:  -0.01500000 Waves

2024.02.05 16:41 [2963032] smart account 3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N > SELF 0.00000000 Waves

{ "type": 13, "id": "7bAZBfr61Lvz5pZo9cfvLwWrS6gT64p15xWg9STLpxtE", "fee": 1500000, "feeAssetId": null, "timestamp": 1707140492671, "version": 2, "chainId": 84, "sender": "3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N", "senderPublicKey": "41THq9VrFxHEvVGJyz2oMpJQErnSkkqJXpBypSDxa5Mv", "proofs": [ "2Yxpdk617FJg6eHCs3Z6H5r8eiaRzqxQiSDQmhEeeGhbsMDVxUVEsh5fdc3ALmDpud9qEGewTGXjoV8LiaYFWdZt" ], "script": "base64:BwIkCAISAwoBGBIDCgEYEgQKAgIYEgQKAgIYEgQKAgIYEgQKAgIYJwAHY2hhaW5JZAkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAIY2hhaW5JZFQBAVQACGNoYWluSWRXAQFXAANTRVACAl9fAAVXQVZFUwIFV0FWRVMAEGNvbnRyYWN0RmlsZW5hbWUCFXd4ZGFvX2NhbGN1bGF0b3IucmlkZQAFbXVsdDgAgMLXLwAGbXVsdDE4CQC2AgEAgICQu7rWrfANAA13YXZlc0RlY2ltYWxzAAgADHVzZHREZWNpbWFscwAGAQV0b1gxOAIHb3JpZ1ZhbA1vcmlnU2NhbGVNdWx0CQC8AgMJALYCAQUHb3JpZ1ZhbAUGbXVsdDE4CQC2AgEFDW9yaWdTY2FsZU11bHQBB2Zyb21YMTgCA3ZhbA9yZXN1bHRTY2FsZU11bHQJAKADAQkAvAIDBQN2YWwJALYCAQUPcmVzdWx0U2NhbGVNdWx0BQZtdWx0MTgBB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcw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AUHcGF5bWVudAZhbW91bnQFA25pbAUOZmFjdG9yeUFjdGlvbnMJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEFcHJpY2UCD2NhbGxlclB1YmxpY0tleQRhcmdzBA5mYWN0b3J5QWRkcmVzcwgFAWkGY2FsbGVyCQCUCgIFA25pbAgJAQljYWxjUHJpY2UBBQ5mYWN0b3J5QWRkcmVzcwJfMQFpAQpwcmljZURlYnVnAg9jYWxsZXJQdWJsaWNLZXkEYXJncwQOZmFjdG9yeUFkZHJlc3MIBQFpBmNhbGxlcgkAlAoCBQNuaWwICQEJY2FsY1ByaWNlAQUOZmFjdG9yeUFkZHJlc3MCXzIBaQEQZ2V0VHJlYXN1cnlWYWx1ZQIPY2FsbGVyUHVibGljS2V5BGFyZ3MEDmZhY3RvcnlBZGRyZXNzCAUBaQZjYWxsZXIEDXRyZWFzdXJ5VmFsdWUJAQdmcm9tWDE4AgkBEWNhbGNUcmVhc3VyeVZhbHVlAQUOZmFjdG9yeUFkZHJlc3MJAGwGAAoAAAUMdXNkdERlY2ltYWxzAAAAAAUERE9XTgkAlAoCBQNuaWwFDXRyZWFzdXJ5VmFsdWUBAnR4AQZ2ZXJpZnkACQAAAgUHY2hhaW5JZAUIY2hhaW5JZFR+i6z5", "height": 2963032, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3nBXWPNz6QUHWjdV1hXaiGmvAL1XhiWZf519u5YLSr7C Next: GLRteSBZBseBMK4jdT8CPxpfekzTAJa3UMrG4GhvU3wx Diff:
OldNewDifferences
298298 }
299299 else if (("8Q6SE2ANebufw8JuPjJVRjZD6drD8ihjNjM8xaGUSfdR" == $match0))
300300 then {
301- let price = toBigInt(100000000)
301+ let price = toX18(150000000, usdtDecimals)
302302 price
303303 }
304304 else throwErr("invalid asset id")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 7 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let chainId = take(drop(this.bytes, 1), 1)
55
66 let chainIdT = base58'2T'
77
88 let chainIdW = base58'2W'
99
1010 let SEP = "__"
1111
1212 let WAVES = "WAVES"
1313
1414 let contractFilename = "wxdao_calculator.ride"
1515
1616 let mult8 = 100000000
1717
1818 let mult18 = toBigInt(1000000000000000000)
1919
2020 let wavesDecimals = 8
2121
2222 let usdtDecimals = 6
2323
2424 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), mult18, toBigInt(origScaleMult))
2525
2626
2727 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), mult18))
2828
2929
3030 func wrapErr (s) = ((contractFilename + ": ") + s)
3131
3232
3333 func throwErr (s) = throw(wrapErr(s))
3434
3535
3636 let wxAssetId = if ((chainId == chainIdW))
3737 then base58'Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on'
3838 else if ((chainId == chainIdT))
3939 then base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc'
4040 else throwErr("invalid chain id")
4141
4242 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
4343
4444
4545 func keyStartHeightByPeriod (period) = makeString(["%s%d", "startHeight", toString(period)], SEP)
4646
4747
4848 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
4949
5050
5151 func keyTreasuryValueByPeriod (period) = makeString(["%s%d", "treasuryValue", toString(period)], SEP)
5252
5353
5454 func keySkinTotal (treasuryAddress) = ("skin_total_" + toString(treasuryAddress))
5555
5656
5757 func keyPowerConfigAddress () = "%s__powerConfigAddress"
5858
5959
6060 func powerConfigAddress (factoryAddress) = valueOrErrorMessage(match getString(factoryAddress, keyPowerConfigAddress()) {
6161 case s: String =>
6262 addressFromString(s)
6363 case _: Unit =>
6464 unit
6565 case _ =>
6666 throw("Match error")
6767 }, wrapErr("invalid power config address"))
6868
6969
7070 func keyPowerAssetId () = "powerAssetId"
7171
7272
7373 func getPowerAssetId (factoryAddress) = fromBase58String(valueOrErrorMessage(getString(powerConfigAddress(factoryAddress), keyPowerAssetId()), wrapErr("invalid power asset id")))
7474
7575
7676 func keyPowerContractAddress () = "%s__powerContractAddress"
7777
7878
7979 func powerContractAddress (factoryAddress) = valueOrErrorMessage(match getString(factoryAddress, keyPowerContractAddress()) {
8080 case s: String =>
8181 addressFromString(s)
8282 case _: Unit =>
8383 unit
8484 case _ =>
8585 throw("Match error")
8686 }, wrapErr("invalid power contract address"))
8787
8888
8989 func keyPoolsFactoryAddress () = "%s__poolsFactoryAddress"
9090
9191
9292 func getPoolsFactoryAddress (factoryAddress) = valueOrErrorMessage(match getString(factoryAddress, keyPoolsFactoryAddress()) {
9393 case s: String =>
9494 addressFromString(s)
9595 case _: Unit =>
9696 unit
9797 case _ =>
9898 throw("Match error")
9999 }, wrapErr("invalid pools factory address"))
100100
101101
102102 func keyTreasuryAddress () = "%s__treasuryAddress"
103103
104104
105105 func getTreasuryAddress (factoryAddress) = valueOrErrorMessage(match getString(factoryAddress, keyTreasuryAddress()) {
106106 case s: String =>
107107 addressFromString(s)
108108 case _: Unit =>
109109 unit
110110 case _ =>
111111 throw("Match error")
112112 }, wrapErr("invalid treasury address"))
113113
114114
115115 func keyAssets () = "%s__assets"
116116
117117
118118 func getAssetsStr (factoryAddress) = valueOrErrorMessage(getString(factoryAddress, keyAssets()), wrapErr("invalid assets"))
119119
120120
121121 func keyLpAssetId () = "%s__lpAssetId"
122122
123123
124124 func getLpAssetId (factoryAddress) = fromBase58String(valueOrErrorMessage(getString(factoryAddress, keyLpAssetId()), wrapErr("invalid lp asset id")))
125125
126126
127127 func getAssetInfoOrFail (assetId) = valueOrErrorMessage(assetInfo(assetId), wrapErr("invalid asset info"))
128128
129129
130130 func getAssetsBalances (targetAddress,assetIdList) = {
131131 func map (acc,nextAssetIdStr) = {
132132 let balance = if ((nextAssetIdStr == WAVES))
133133 then toX18(wavesBalance(targetAddress).available, pow(10, 0, wavesDecimals, 0, 0, DOWN))
134134 else {
135135 let assetId = fromBase58String(nextAssetIdStr)
136136 let assetDecimals = getAssetInfoOrFail(assetId).decimals
137137 toX18(assetBalance(targetAddress, assetId), pow(10, 0, assetDecimals, 0, 0, DOWN))
138138 }
139139 (acc :+ balance)
140140 }
141141
142142 let $l = assetIdList
143143 let $s = size($l)
144144 let $acc0 = nil
145145 func $f0_1 ($a,$i) = if (($i >= $s))
146146 then $a
147147 else map($a, $l[$i])
148148
149149 func $f0_2 ($a,$i) = if (($i >= $s))
150150 then $a
151151 else throw("List size exceeds 10")
152152
153153 $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)
154154 }
155155
156156
157157 func getAssetsPrices (poolsFactoryAddress,assetIdList) = if ((chainId == chainIdW))
158158 then {
159159 let wavesUsdtAddressStr = "3PKfrupEydU2nZAghVjZAfvCwMBkzuR1F52"
160160 let wavesUsdtPrice = parseBigIntValue({
161161 let @ = invoke(poolsFactoryAddress, "getPrice", [wavesUsdtAddressStr], nil)
162162 if ($isInstanceOf(@, "String"))
163163 then @
164164 else throw(($getType(@) + " couldn't be cast to String"))
165165 })
166166 let wavesXtnAddressStr = "3PPZWgFNRKHLvM51pwS934C8VZ7d2F4Z58g"
167167 let wavesXtnPrice = parseBigIntValue({
168168 let @ = invoke(poolsFactoryAddress, "getPrice", [wavesXtnAddressStr], nil)
169169 if ($isInstanceOf(@, "String"))
170170 then @
171171 else throw(($getType(@) + " couldn't be cast to String"))
172172 })
173173 let xtnUsdtPrice = fraction(wavesUsdtPrice, mult18, wavesXtnPrice)
174174 func map (acc,nextAssetId) = {
175175 let price = match nextAssetId {
176176 case _ =>
177177 if (("2thsACuHmzDMuNezPM32wg9a3BwUzBWDeSKakgz3cw21" == $match0))
178178 then {
179179 let pwrWavesAddressStr = "3PDi7Qq8pLQYvtKyTfQuqqPUWyhoYbU957t"
180180 let pwrWavesPrice = parseBigIntValue({
181181 let @ = invoke(poolsFactoryAddress, "getPrice", [pwrWavesAddressStr], nil)
182182 if ($isInstanceOf(@, "String"))
183183 then @
184184 else throw(($getType(@) + " couldn't be cast to String"))
185185 })
186186 fraction(pwrWavesPrice, wavesUsdtPrice, mult18)
187187 }
188188 else if (("Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" == $match0))
189189 then {
190190 let wxWavesAddressStr = "3PFzaH2ghpwANHFgjeva83N1yxzErELx2eh"
191191 let wxWavesPrice = parseBigIntValue({
192192 let @ = invoke(poolsFactoryAddress, "getPrice", [wxWavesAddressStr], nil)
193193 if ($isInstanceOf(@, "String"))
194194 then @
195195 else throw(($getType(@) + " couldn't be cast to String"))
196196 })
197197 fraction(wxWavesPrice, wavesUsdtPrice, mult18)
198198 }
199199 else if (("34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" == $match0))
200200 then {
201201 let wavesUsdtwxgAddressStr = "3PKMVZ7kQeaREajYi8Yc25Ro6mcNw5D6QSa"
202202 let wavesUsdtwxgPrice = parseBigIntValue({
203203 let @ = invoke(poolsFactoryAddress, "getPrice", [wavesUsdtwxgAddressStr], nil)
204204 if ($isInstanceOf(@, "String"))
205205 then @
206206 else throw(($getType(@) + " couldn't be cast to String"))
207207 })
208208 fraction(wavesUsdtPrice, mult18, wavesUsdtwxgPrice)
209209 }
210210 else if (("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" == $match0))
211211 then {
212212 let wavesUsdcwxgAddressStr = "3P3g3eipfG2NZKKQE8DZXt2E9tRJqii9jcX"
213213 let wavesUsdcwxgPrice = parseBigIntValue({
214214 let @ = invoke(poolsFactoryAddress, "getPrice", [wavesUsdcwxgAddressStr], nil)
215215 if ($isInstanceOf(@, "String"))
216216 then @
217217 else throw(($getType(@) + " couldn't be cast to String"))
218218 })
219219 fraction(wavesUsdtPrice, mult18, wavesUsdcwxgPrice)
220220 }
221221 else if (("HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk" == $match0))
222222 then {
223223 let ltcwxgXtnAddressStr = "3P94wvu5gA7VhjPgAB3twaeqdwHCwNK2vsn"
224224 let ltcwxgXtnPrice = parseBigIntValue({
225225 let @ = invoke(poolsFactoryAddress, "getPrice", [ltcwxgXtnAddressStr], nil)
226226 if ($isInstanceOf(@, "String"))
227227 then @
228228 else throw(($getType(@) + " couldn't be cast to String"))
229229 })
230230 fraction(ltcwxgXtnPrice, xtnUsdtPrice, mult18)
231231 }
232232 else if (("474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu" == $match0))
233233 then {
234234 let ethwxgWavesAddressStr = "3P3XGTN6s292g9iwYhs3TEqJqHiffQYojuE"
235235 let ethwxgWavesPrice = parseBigIntValue({
236236 let @ = invoke(poolsFactoryAddress, "getPrice", [ethwxgWavesAddressStr], nil)
237237 if ($isInstanceOf(@, "String"))
238238 then @
239239 else throw(($getType(@) + " couldn't be cast to String"))
240240 })
241241 fraction(ethwxgWavesPrice, wavesUsdtPrice, mult18)
242242 }
243243 else if (("8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS" == $match0))
244244 then {
245245 let btcwxgXtnAddressStr = "3PCBWDTA6jrFswd7gQgaE3Xk7gLM5RKofvp"
246246 let btcwxgXtnPrice = parseBigIntValue({
247247 let @ = invoke(poolsFactoryAddress, "getPrice", [btcwxgXtnAddressStr], nil)
248248 if ($isInstanceOf(@, "String"))
249249 then @
250250 else throw(($getType(@) + " couldn't be cast to String"))
251251 })
252252 fraction(btcwxgXtnPrice, xtnUsdtPrice, mult18)
253253 }
254254 else throwErr("invalid asset id")
255255 }
256256 (acc :+ price)
257257 }
258258
259259 let $l = assetIdList
260260 let $s = size($l)
261261 let $acc0 = nil
262262 func $f0_1 ($a,$i) = if (($i >= $s))
263263 then $a
264264 else map($a, $l[$i])
265265
266266 func $f0_2 ($a,$i) = if (($i >= $s))
267267 then $a
268268 else throw("List size exceeds 10")
269269
270270 $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)
271271 }
272272 else if ((chainId == chainIdT))
273273 then {
274274 func map (acc,nextAssetId) = {
275275 let price = match nextAssetId {
276276 case _ =>
277277 if (("EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc" == $match0))
278278 then {
279279 let wxUsdtAddressStr = "3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt"
280280 let wxUsdtPrice = parseBigIntValue({
281281 let @ = invoke(poolsFactoryAddress, "getPrice", [wxUsdtAddressStr], nil)
282282 if ($isInstanceOf(@, "String"))
283283 then @
284284 else throw(($getType(@) + " couldn't be cast to String"))
285285 })
286286 wxUsdtPrice
287287 }
288288 else if (("A7Ksh7fXyqm1KhKAiK3bAB2aiPSitQQF6v1pyu9SS3FR" == $match0))
289289 then {
290290 let usdcUsdtAddressStr = "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA"
291291 let usdcUsdtPrice = parseBigIntValue({
292292 let @ = invoke(poolsFactoryAddress, "getPrice", [usdcUsdtAddressStr], nil)
293293 if ($isInstanceOf(@, "String"))
294294 then @
295295 else throw(($getType(@) + " couldn't be cast to String"))
296296 })
297297 usdcUsdtPrice
298298 }
299299 else if (("8Q6SE2ANebufw8JuPjJVRjZD6drD8ihjNjM8xaGUSfdR" == $match0))
300300 then {
301- let price = toBigInt(100000000)
301+ let price = toX18(150000000, usdtDecimals)
302302 price
303303 }
304304 else throwErr("invalid asset id")
305305 }
306306 (acc :+ price)
307307 }
308308
309309 let $l = assetIdList
310310 let $s = size($l)
311311 let $acc0 = nil
312312 func $f0_1 ($a,$i) = if (($i >= $s))
313313 then $a
314314 else map($a, $l[$i])
315315
316316 func $f0_2 ($a,$i) = if (($i >= $s))
317317 then $a
318318 else throw("List size exceeds 10")
319319
320320 $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)
321321 }
322322 else throwErr("invalid chain id")
323323
324324
325325 func calcTreasuryValue (factoryAddress) = {
326326 let treasuryAddress = getTreasuryAddress(factoryAddress)
327327 let poolsFactoryAddress = getPoolsFactoryAddress(factoryAddress)
328328 let assetsStr = split(getAssetsStr(factoryAddress), SEP)
329329 let assetsBalances = getAssetsBalances(treasuryAddress, assetsStr)
330330 let assetsPrices = getAssetsPrices(poolsFactoryAddress, assetsStr)
331331 func reduce (acc,nextAssetIdStr) = {
332332 let assetId = fromBase58String(nextAssetIdStr)
333333 let index = valueOrErrorMessage(indexOf(assetsStr, nextAssetIdStr), wrapErr("invalid asset id"))
334334 let balance = assetsBalances[index]
335335 let price = assetsPrices[index]
336336 let assetValue = fraction(balance, price, mult18)
337337 (acc + assetValue)
338338 }
339339
340340 let treasuryValue = {
341341 let $l = assetsStr
342342 let $s = size($l)
343343 let $acc0 = toBigInt(0)
344344 func $f0_1 ($a,$i) = if (($i >= $s))
345345 then $a
346346 else reduce($a, $l[$i])
347347
348348 func $f0_2 ($a,$i) = if (($i >= $s))
349349 then $a
350350 else throw("List size exceeds 10")
351351
352352 $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)
353353 }
354354 treasuryValue
355355 }
356356
357357
358358 func calcPrice (factoryAddress) = {
359359 let poolsFactoryAddress = getPoolsFactoryAddress(factoryAddress)
360360 let currentPeriod = valueOrErrorMessage(getInteger(factoryAddress, keyCurrentPeriod()), wrapErr("invalid current period"))
361361 let startTreasuryValue = valueOrErrorMessage(getInteger(factoryAddress, keyTreasuryValueByPeriod(currentPeriod)), wrapErr(("invalid treasury value for period " + toString(currentPeriod))))
362362 let treasuryValue = fromX18(calcTreasuryValue(factoryAddress), pow(10, 0, usdtDecimals, 0, 0, DOWN))
363363 let treasuryValueDiff = (treasuryValue - startTreasuryValue)
364364 let pwrAssetId = getPowerAssetId(factoryAddress)
365365 let pwrPriceRaw = getAssetsPrices(poolsFactoryAddress, [toBase58String(pwrAssetId)])[0]
366366 let pwrPrice = if ((pwrPriceRaw > toBigInt(0)))
367367 then fromX18(pwrPriceRaw, pow(10, 0, usdtDecimals, 0, 0, DOWN))
368368 else throwErr("invalid PWR price")
369369 let treasuryAddress = getTreasuryAddress(factoryAddress)
370370 let skinTotal = valueOrElse(getInteger(powerContractAddress(factoryAddress), keySkinTotal(treasuryAddress)), 0)
371371 let pwrRemaining = (getAssetInfoOrFail(getLpAssetId(factoryAddress)).quantity / 100)
372372 let pwrAmount = (skinTotal + pwrRemaining)
373373 let factoryAddressWxBalanceRaw = getAssetsBalances(factoryAddress, [toBase58String(wxAssetId)])[0]
374374 let factoryAddressWxBalance = if ((factoryAddressWxBalanceRaw > toBigInt(0)))
375375 then fromX18(factoryAddressWxBalanceRaw, pow(10, 0, usdtDecimals, 0, 0, DOWN))
376376 else throwErr("invalid factory wx balance")
377377 let wxPriceRaw = getAssetsPrices(poolsFactoryAddress, [toBase58String(wxAssetId)])[0]
378378 let wxPrice = if ((wxPriceRaw > toBigInt(0)))
379379 then fromX18(wxPriceRaw, pow(10, 0, usdtDecimals, 0, 0, DOWN))
380380 else throwErr("invalid wx price")
381381 let wxdaoQuantity = getAssetInfoOrFail(getLpAssetId(factoryAddress)).quantity
382382 let wxDaoPrice = (((pwrPrice + fraction((factoryAddressWxBalance * 100), wxPrice, wxdaoQuantity)) + fraction(max([treasuryValueDiff, 0]), 2, (10 * pwrAmount))) / 100)
383383 $Tuple2(wxDaoPrice, [["wxDaoPrice", wxDaoPrice], ["pwrPrice", pwrPrice], ["factoryAddressWxBalance", factoryAddressWxBalance], ["wxPrice", wxPrice], ["wxdaoQuantity", wxdaoQuantity], ["treasuryValueDiff", treasuryValueDiff], ["pwrAmount", pwrAmount]])
384384 }
385385
386386
387387 @Callable(i)
388388 func withdraw (args) = {
389389 let recipient = addressFromStringValue(args[0])
390390 let amount = parseIntValue(args[1])
391391 let result = invoke(i.caller, "transferWaves", [recipient.bytes, amount], nil)
392392 $Tuple2(nil, result)
393393 }
394394
395395
396396
397397 @Callable(i)
398398 func setIntParam (args) = {
399399 let key = args[0]
400400 let val = parseIntValue(args[1])
401401 let result = invoke(i.caller, "integerEntry", [key, val], nil)
402402 $Tuple2(nil, result)
403403 }
404404
405405
406406
407407 @Callable(i)
408408 func swap (callerPublicKey,args) = {
409409 let factoryAddress = i.caller
410410 let userAddress = addressFromPublicKey(callerPublicKey)
411411 let payment = if ((size(i.payments) == 1))
412412 then i.payments[0]
413413 else throwErr("1 payment is required")
414414 let err = wrapErr("invalid payment asset id")
415415 let paymentAssetId = if ((valueOrErrorMessage(payment.assetId, err) == getLpAssetId(factoryAddress)))
416416 then value(payment.assetId)
417417 else throwErr(err)
418418 let pwrPrice = 100
419419 let pwrAmount = (payment.amount / pwrPrice)
420420 let assetsStr = split(getAssetsStr(factoryAddress), SEP)
421421 let pwrBalance = assetBalance(factoryAddress, getPowerAssetId(factoryAddress))
422422 if ((pwrBalance == pwrBalance))
423423 then {
424424 let wxdaoQuantity = getAssetInfoOrFail(getLpAssetId(factoryAddress)).quantity
425425 if ((wxdaoQuantity == wxdaoQuantity))
426426 then {
427427 let assetsBalances = getAssetsBalances(factoryAddress, assetsStr)
428428 func map (acc,nextAssetIdStr) = {
429429 let assetId = fromBase58String(nextAssetIdStr)
430430 let index = valueOrErrorMessage(indexOf(assetsStr, nextAssetIdStr), wrapErr("invalid asset balance"))
431431 let assetDecimals = getAssetInfoOrFail(assetId).decimals
432432 let balance = fromX18(assetsBalances[index], pow(10, 0, assetDecimals, 0, 0, DOWN))
433433 let amount = fraction(balance, payment.amount, wxdaoQuantity)
434434 if ((amount > 0))
435435 then $Tuple2((acc._1 :+ assetId), (acc._2 :+ amount))
436436 else acc
437437 }
438438
439439 let transfers = {
440440 let $l = assetsStr
441441 let $s = size($l)
442442 let $acc0 = $Tuple2(nil, nil)
443443 func $f0_1 ($a,$i) = if (($i >= $s))
444444 then $a
445445 else map($a, $l[$i])
446446
447447 func $f0_2 ($a,$i) = if (($i >= $s))
448448 then $a
449449 else throw("List size exceeds 6")
450450
451451 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
452452 }
453453 if ((transfers == transfers))
454454 then {
455455 let additionalLockRounds = 0
456456 let factoryActions = ([invoke(factoryAddress, "commitAfterStartWithLockRoundFor", [toString(powerContractAddress(factoryAddress)), toString(factoryAddress), toString(userAddress), additionalLockRounds, getPowerAssetId(factoryAddress), pwrAmount], nil)] ++ (if ((size(transfers._1) == 0))
457457 then nil
458458 else [invoke(factoryAddress, "transferAssets", [userAddress.bytes, transfers._1, transfers._2], nil)]))
459459 $Tuple2([Burn(paymentAssetId, payment.amount)], factoryActions)
460460 }
461461 else throw("Strict value is not equal to itself.")
462462 }
463463 else throw("Strict value is not equal to itself.")
464464 }
465465 else throw("Strict value is not equal to itself.")
466466 }
467467
468468
469469
470470 @Callable(i)
471471 func price (callerPublicKey,args) = {
472472 let factoryAddress = i.caller
473473 $Tuple2(nil, calcPrice(factoryAddress)._1)
474474 }
475475
476476
477477
478478 @Callable(i)
479479 func priceDebug (callerPublicKey,args) = {
480480 let factoryAddress = i.caller
481481 $Tuple2(nil, calcPrice(factoryAddress)._2)
482482 }
483483
484484
485485
486486 @Callable(i)
487487 func getTreasuryValue (callerPublicKey,args) = {
488488 let factoryAddress = i.caller
489489 let treasuryValue = fromX18(calcTreasuryValue(factoryAddress), pow(10, 0, usdtDecimals, 0, 0, DOWN))
490490 $Tuple2(nil, treasuryValue)
491491 }
492492
493493
494494 @Verifier(tx)
495495 func verify () = (chainId == chainIdT)
496496

github/deemru/w8io/026f985 
57.59 ms