tx · 3wsnAf9CwhqBRJqPAhJXE5dJZRw4ykVe4TCDe5mjYUYE 3MyVGHdi4Zu9QXehoUu2tNf65njvw5M1WWV: -0.02100000 Waves 2024.10.28 18:18 [3346897] smart account 3MyVGHdi4Zu9QXehoUu2tNf65njvw5M1WWV > SELF 0.00000000 Waves
{ "type": 13, "id": "3wsnAf9CwhqBRJqPAhJXE5dJZRw4ykVe4TCDe5mjYUYE", "fee": 2100000, "feeAssetId": null, "timestamp": 1730128774135, "version": 2, "chainId": 84, "sender": "3MyVGHdi4Zu9QXehoUu2tNf65njvw5M1WWV", "senderPublicKey": "DQUUXNxezuRpbvnPmYTzY9L1xPv2xfeGS78HmwrsGnxW", "proofs": [ "j3hgAJpHupmeRkRQfY55ucnr4mPw2npecXtnHjxrAJKnK8zrCZ1wiLN7nJZZRmqK9QpVoQnYe1tpLE7HEpVwtRP" ], "script": "base64:BgItCAISBwoFCAgICAESBwoFCAgICAESABIDCgEIEgQKAggBEgUKAwgIARIDCgEIRwAHVkVSU0lPTgIIUE0tMC43LjAACWNvbmZpZ1N0cgkBC3ZhbHVlT3JFbHNlAgkAnQgCBQR0aGlzAg1jb25maWdBZGRyZXNzAiMzTjkxZTd3SGlWN1FhZERzeDNSVUpReHgxZXRxY0FLcmZIagAOQ09ORklHX0FERFJFU1MDCQAAAgUJY29uZmlnU3RyAgAFBHRoaXMJAQdBZGRyZXNzAQkA2QQBBQljb25maWdTdHIAFUFzc2V0c1dlaWdodHNEZWNpbWFscwAEAAVTY2FsZQCQTgAGU2NhbGU4AIDC1y8AB1NjYWxlMTYAgICE/qbe4REACEZlZVNjYWxlAJBOABFQb29sVG9rZW5EZWNpbWFscwAIAA5Qb29sVG9rZW5TY2FsZQkAbAYACgAABRFQb29sVG9rZW5EZWNpbWFscwAAAAAFBkhBTEZVUAAQTUlOX1NURVBTX0FNT1VOVAkBC3ZhbHVlT3JFbHNlAgkAmggCBQ5DT05GSUdfQUREUkVTUwIQbWluX3N0ZXBzX2Ftb3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sT3duZXIJAAIBAid0aGlzIGNhbGwgYXZhaWxhYmxlIG9ubHkgZm9yIHBvb2wgb3duZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgIQc3RhdGljX3Bvb2xPd25lcgUPbmV3T3duZXJBZGRyZXNzBQNuaWwAkFzlgg==", "height": 3346897, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 9KtbscpuEmNrQmMykDuWT35mMNvBWXvKeyTU6ZLA91g2 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let VERSION = "PM-0.7.0" | |
5 | + | ||
6 | + | let configStr = valueOrElse(getString(this, "configAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
7 | + | ||
8 | + | let CONFIG_ADDRESS = if ((configStr == "")) | |
9 | + | then this | |
10 | + | else Address(fromBase58String(configStr)) | |
11 | + | ||
12 | + | let AssetsWeightsDecimals = 4 | |
13 | + | ||
14 | + | let Scale = 10000 | |
15 | + | ||
16 | + | let Scale8 = 100000000 | |
17 | + | ||
18 | + | let Scale16 = 10000000000000000 | |
19 | + | ||
20 | + | let FeeScale = 10000 | |
21 | + | ||
22 | + | let PoolTokenDecimals = 8 | |
23 | + | ||
24 | + | let PoolTokenScale = pow(10, 0, PoolTokenDecimals, 0, 0, HALFUP) | |
25 | + | ||
26 | + | let MIN_STEPS_AMOUNT = valueOrElse(getInteger(CONFIG_ADDRESS, "min_steps_amount"), 1) | |
27 | + | ||
28 | + | let MAX_STEPS_AMOUNT = valueOrElse(getInteger(CONFIG_ADDRESS, "max_steps_amount"), 500) | |
29 | + | ||
30 | + | let MIN_STEPS_INTERVAL = valueOrElse(getInteger(CONFIG_ADDRESS, "min_steps_interval"), 1) | |
31 | + | ||
32 | + | let MAX_STEPS_INTERVAL = valueOrElse(getInteger(CONFIG_ADDRESS, "max_steps_interval"), 10000) | |
33 | + | ||
34 | + | let MIN_WEIGHT = valueOrElse(getInteger(CONFIG_ADDRESS, "min_weight"), 100) | |
35 | + | ||
36 | + | let MAX_WEIGHT = valueOrElse(getInteger(CONFIG_ADDRESS, "max_weight"), 9900) | |
37 | + | ||
38 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
39 | + | case b: Int => | |
40 | + | b | |
41 | + | case _ => | |
42 | + | 0 | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | func tryGetBinary (key) = match getBinary(this, key) { | |
47 | + | case b: ByteVector => | |
48 | + | b | |
49 | + | case _ => | |
50 | + | base58'' | |
51 | + | } | |
52 | + | ||
53 | + | ||
54 | + | func tryGetString (key) = match getString(this, key) { | |
55 | + | case b: String => | |
56 | + | b | |
57 | + | case _ => | |
58 | + | "" | |
59 | + | } | |
60 | + | ||
61 | + | ||
62 | + | func tryGetStringOrThrow (key) = match getString(this, key) { | |
63 | + | case b: String => | |
64 | + | b | |
65 | + | case _ => | |
66 | + | throw(("no such key in data storage: " + key)) | |
67 | + | } | |
68 | + | ||
69 | + | ||
70 | + | func getAssetString (assetId) = match assetId { | |
71 | + | case b: ByteVector => | |
72 | + | toBase58String(b) | |
73 | + | case _ => | |
74 | + | "WAVES" | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES")) | |
79 | + | then unit | |
80 | + | else fromBase58String(assetIdStr) | |
81 | + | ||
82 | + | ||
83 | + | func getTokenBalance (assetId) = match assetId { | |
84 | + | case t: ByteVector => | |
85 | + | assetBalance(this, t) | |
86 | + | case _ => | |
87 | + | wavesBalance(this).available | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | func addAssetBytesToList (accum,item) = (accum ++ [getAssetBytes(item)]) | |
92 | + | ||
93 | + | ||
94 | + | func addAssetWeightToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_weight"))]) | |
95 | + | ||
96 | + | ||
97 | + | func addAssetWeightToStrList (accum,item) = (accum ++ [toString(tryGetInteger((("static_" + item) + "_weight")))]) | |
98 | + | ||
99 | + | ||
100 | + | func addAssetDecimalsToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_decimals"))]) | |
101 | + | ||
102 | + | ||
103 | + | func addAssetScaleToList (accum,item) = (accum ++ [tryGetInteger((("static_" + getAssetString(item)) + "_scale"))]) | |
104 | + | ||
105 | + | ||
106 | + | func addIntToList (accum,item) = (accum ++ [parseIntValue(item)]) | |
107 | + | ||
108 | + | ||
109 | + | let usdnAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "usdnAssetIdStr"), "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p") | |
110 | + | ||
111 | + | let puzzleAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "puzzleAssetIdStr"), "HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS") | |
112 | + | ||
113 | + | let usdtAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "usdtAssetIdStr"), "34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ") | |
114 | + | ||
115 | + | let usdtPptAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "usdtPptAssetIdStr"), "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi") | |
116 | + | ||
117 | + | let romeAssetIdStr = valueOrElse(getString(CONFIG_ADDRESS, "romeAssetIdStr"), "AP4Cb5xLYGH6ZigHreCZHoXpQTWDkPsG2BHqfDUx6taJ") | |
118 | + | ||
119 | + | let wavesAssetIdStr = "WAVES" | |
120 | + | ||
121 | + | let usdnAssetId = fromBase58String(usdnAssetIdStr) | |
122 | + | ||
123 | + | let puzzleAssetId = fromBase58String(puzzleAssetIdStr) | |
124 | + | ||
125 | + | let usdtAssetId = fromBase58String(usdtAssetIdStr) | |
126 | + | ||
127 | + | let usdtPptAssetId = fromBase58String(usdtPptAssetIdStr) | |
128 | + | ||
129 | + | let romeAssetId = fromBase58String(romeAssetIdStr) | |
130 | + | ||
131 | + | let wavesAssetId = unit | |
132 | + | ||
133 | + | let supportedFeeAssetsStr = [usdnAssetIdStr, puzzleAssetIdStr, usdtAssetIdStr, usdtPptAssetIdStr, wavesAssetIdStr, romeAssetIdStr] | |
134 | + | ||
135 | + | let oracleAddress = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "oracleAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
136 | + | ||
137 | + | let feesAddress = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "feesAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
138 | + | ||
139 | + | let shutdownAddressStr = valueOrElse(getString(CONFIG_ADDRESS, "shutdownAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
140 | + | ||
141 | + | let layer2Addresses = valueOrElse(getString(CONFIG_ADDRESS, "layer2Addresses"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj") | |
142 | + | ||
143 | + | let coldMasterAddress = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "coldMasterAddress"), "3N91e7wHiV7QadDsx3RUJQxx1etqcAKrfHj"))) | |
144 | + | ||
145 | + | let calculatorAccount = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "factoryAddress"), "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr"))) | |
146 | + | ||
147 | + | let factoryAccount = Address(fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "factoryAddress"), "3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T"))) | |
148 | + | ||
149 | + | let masterPubKey = fromBase58String(valueOrElse(getString(CONFIG_ADDRESS, "masterPubKey"), "4z8CKSYQBKkzx7PBb5uBP1YPa6YAHRNTApW1sQVHT5eU")) | |
150 | + | ||
151 | + | let T = tryGetInteger("static_tokensAmount") | |
152 | + | ||
153 | + | let assetIds = { | |
154 | + | let $l = split(tryGetString("static_tokenIds"), ",") | |
155 | + | let $s = size($l) | |
156 | + | let $acc0 = nil | |
157 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
158 | + | then $a | |
159 | + | else addAssetBytesToList($a, $l[$i]) | |
160 | + | ||
161 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
162 | + | then $a | |
163 | + | else throw("List size exceeds 10") | |
164 | + | ||
165 | + | $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) | |
166 | + | } | |
167 | + | ||
168 | + | let AssetsWeights = { | |
169 | + | let $l = assetIds | |
170 | + | let $s = size($l) | |
171 | + | let $acc0 = nil | |
172 | + | func $f1_1 ($a,$i) = if (($i >= $s)) | |
173 | + | then $a | |
174 | + | else addAssetWeightToList($a, $l[$i]) | |
175 | + | ||
176 | + | func $f1_2 ($a,$i) = if (($i >= $s)) | |
177 | + | then $a | |
178 | + | else throw("List size exceeds 10") | |
179 | + | ||
180 | + | $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) | |
181 | + | } | |
182 | + | ||
183 | + | let Decimals = { | |
184 | + | let $l = assetIds | |
185 | + | let $s = size($l) | |
186 | + | let $acc0 = nil | |
187 | + | func $f2_1 ($a,$i) = if (($i >= $s)) | |
188 | + | then $a | |
189 | + | else addAssetDecimalsToList($a, $l[$i]) | |
190 | + | ||
191 | + | func $f2_2 ($a,$i) = if (($i >= $s)) | |
192 | + | then $a | |
193 | + | else throw("List size exceeds 10") | |
194 | + | ||
195 | + | $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) | |
196 | + | } | |
197 | + | ||
198 | + | let Scales = { | |
199 | + | let $l = assetIds | |
200 | + | let $s = size($l) | |
201 | + | let $acc0 = nil | |
202 | + | func $f3_1 ($a,$i) = if (($i >= $s)) | |
203 | + | then $a | |
204 | + | else addAssetScaleToList($a, $l[$i]) | |
205 | + | ||
206 | + | func $f3_2 ($a,$i) = if (($i >= $s)) | |
207 | + | then $a | |
208 | + | else throw("List size exceeds 10") | |
209 | + | ||
210 | + | $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) | |
211 | + | } | |
212 | + | ||
213 | + | let Fee = tryGetInteger("static_fee") | |
214 | + | ||
215 | + | let earnedAssets = assetIds | |
216 | + | ||
217 | + | func getPoolStatus () = { | |
218 | + | let poolId = valueOrElse(getString(factoryAccount, ("pool__" + toString(this))), "") | |
219 | + | let status = valueOrElse(getInteger(factoryAccount, ("pool__" + poolId)), 2) | |
220 | + | status | |
221 | + | } | |
222 | + | ||
223 | + | ||
224 | + | func getSetting (key) = getIntegerValue(factoryAccount, ("setup__" + key)) | |
225 | + | ||
226 | + | ||
227 | + | let InitalWavesLiquidity = getSetting("virtualLiquidity") | |
228 | + | ||
229 | + | let CreationFee = getSetting("creationFee") | |
230 | + | ||
231 | + | let CurveTarget = getSetting("curveTarget") | |
232 | + | ||
233 | + | func isShutdown () = { | |
234 | + | let shutdownAddress = addressFromString(shutdownAddressStr) | |
235 | + | if ((shutdownAddress == unit)) | |
236 | + | then false | |
237 | + | else match getBoolean(value(shutdownAddress), "is_shutdown") { | |
238 | + | case x: Boolean => | |
239 | + | x | |
240 | + | case _ => | |
241 | + | false | |
242 | + | } | |
243 | + | } | |
244 | + | ||
245 | + | ||
246 | + | func getPriceFromOracle (assetIdStr) = match getInteger(oracleAddress, (assetIdStr + "_twap5B")) { | |
247 | + | case x: Int => | |
248 | + | x | |
249 | + | case _ => | |
250 | + | 1000000 | |
251 | + | } | |
252 | + | ||
253 | + | ||
254 | + | func calculateUsdValue (assetId,amount,aBalance) = { | |
255 | + | let assetWeight = tryGetInteger((("static_" + getAssetString(assetId)) + "_weight")) | |
256 | + | let feeAssetStr = tryGetString("static_feeToken") | |
257 | + | let feeAssetScale = getIntegerValue(this, (("static_" + feeAssetStr) + "_scale")) | |
258 | + | let feeAssetNum = value(indexOf(assetIds, getAssetBytes(feeAssetStr))) | |
259 | + | let feeAssetWeight = AssetsWeights[feeAssetNum] | |
260 | + | let feeAssetBalance = tryGetInteger((("global_" + feeAssetStr) + "_balance")) | |
261 | + | let valInFeeAsset = fraction(amount, (feeAssetBalance / feeAssetWeight), (aBalance / assetWeight)) | |
262 | + | let feeAssetPrice = getPriceFromOracle(feeAssetStr) | |
263 | + | fraction(valInFeeAsset, feeAssetPrice, feeAssetScale) | |
264 | + | } | |
265 | + | ||
266 | + | ||
267 | + | func calculateOutAmount (AmountIn,assetIn,assetOut,BalanceIn,BalanceOut) = { | |
268 | + | let IndexIn = value(indexOf(assetIds, assetIn)) | |
269 | + | let IndexOut = value(indexOf(assetIds, assetOut)) | |
270 | + | if ((IndexIn == IndexOut)) | |
271 | + | then AmountIn | |
272 | + | else fraction(BalanceOut, ((Scale8 * Scale8) - toInt(pow(fraction((toBigInt(BalanceIn) * toBigInt(10000)), toBigInt((Scale8 * Scale8)), (toBigInt((BalanceIn + AmountIn)) * toBigInt(10000)), HALFUP), 16, toBigInt(fraction(AssetsWeights[IndexIn], 1000000000000, AssetsWeights[IndexOut])), 12, 16, CEILING))), (Scale8 * Scale8), HALFEVEN) | |
273 | + | } | |
274 | + | ||
275 | + | ||
276 | + | func calculateCurrentAssetInterest (assetId,assetIdStr,aBalance,tokenEarningsLastCheck) = { | |
277 | + | let totalStaked = tryGetInteger("global_indexStaked") | |
278 | + | let tokenBalanceLastCheck = tokenEarningsLastCheck | |
279 | + | let currentBalanceDelta = (getTokenBalance(assetId) - aBalance) | |
280 | + | let currentTokenEarnings = if ((currentBalanceDelta > tokenBalanceLastCheck)) | |
281 | + | then currentBalanceDelta | |
282 | + | else tokenBalanceLastCheck | |
283 | + | let newEarnings = (currentTokenEarnings - tokenBalanceLastCheck) | |
284 | + | let newInterest = if ((totalStaked == 0)) | |
285 | + | then 0 | |
286 | + | else fraction(newEarnings, Scale8, totalStaked) | |
287 | + | let lastCheckInterest = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_interest")) | |
288 | + | (lastCheckInterest + newInterest) | |
289 | + | } | |
290 | + | ||
291 | + | ||
292 | + | func claimResult (address) = { | |
293 | + | let addressStr = toString(address) | |
294 | + | let puzzleAmount = tryGetInteger((addressStr + "_indexStaked")) | |
295 | + | func handler (accum,assetId) = { | |
296 | + | let assetIdStr = getAssetString(assetId) | |
297 | + | let aBalance = tryGetInteger((("global_" + getAssetString(assetId)) + "_balance")) | |
298 | + | let tokenEarningsLastCheck = tryGetInteger((("global_lastCheck_" + assetIdStr) + "_earnings")) | |
299 | + | let currentTokenInterest = calculateCurrentAssetInterest(assetId, assetIdStr, aBalance, tokenEarningsLastCheck) | |
300 | + | let currentTokenEarnings = max([tokenEarningsLastCheck, (getTokenBalance(assetId) - aBalance)]) | |
301 | + | let rewardAmount = fraction(puzzleAmount, (currentTokenInterest - tryGetInteger((((addressStr + "_lastCheck_") + assetIdStr) + "_interest"))), Scale8) | |
302 | + | let transfer = if ((rewardAmount == 0)) | |
303 | + | then nil | |
304 | + | else [ScriptTransfer(address, rewardAmount, assetId)] | |
305 | + | $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 + calculateUsdValue(assetId, rewardAmount, aBalance))) | |
306 | + | } | |
307 | + | ||
308 | + | let accum = { | |
309 | + | let $l = earnedAssets | |
310 | + | let $s = size($l) | |
311 | + | let $acc0 = $Tuple2(nil, 0) | |
312 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
313 | + | then $a | |
314 | + | else handler($a, $l[$i]) | |
315 | + | ||
316 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
317 | + | then $a | |
318 | + | else throw("List size exceeds 10") | |
319 | + | ||
320 | + | $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) | |
321 | + | } | |
322 | + | $Tuple2((accum._1 ++ [IntegerEntry((addressStr + "_claimedRewardUSD"), (tryGetInteger((addressStr + "_claimedRewardUSD")) + accum._2)), IntegerEntry((addressStr + "_lastClaim"), lastBlock.timestamp)]), accum._2) | |
323 | + | } | |
324 | + | ||
325 | + | ||
326 | + | func sum (accum,n) = (accum + parseIntValue(n)) | |
327 | + | ||
328 | + | ||
329 | + | func checkFeeAsset (accum,next) = if (if ((indexOf(supportedFeeAssetsStr, next) != unit)) | |
330 | + | then (accum == "") | |
331 | + | else false) | |
332 | + | then next | |
333 | + | else accum | |
334 | + | ||
335 | + | ||
336 | + | func swapInternal (assetIn,assetOut,amountIn,minimum,receipientAddressStr) = { | |
337 | + | let AmountIn = amountIn | |
338 | + | let AssetIn = getAssetBytes(assetIn) | |
339 | + | let AssetOut = getAssetBytes(assetOut) | |
340 | + | let scaleIn = (Scale8 / tryGetInteger((("static_" + assetIn) + "_scale"))) | |
341 | + | let scaleOut = (Scale8 / tryGetInteger((("static_" + assetOut) + "_scale"))) | |
342 | + | let feeAssetOutStr = tryGetString("static_feeToken") | |
343 | + | let feeAssetOut = if ((feeAssetOutStr == "")) | |
344 | + | then wavesAssetId | |
345 | + | else getAssetBytes(feeAssetOutStr) | |
346 | + | let AssetInBalance = tryGetInteger((("global_" + getAssetString(AssetIn)) + "_balance")) | |
347 | + | let AssetOutBalance = tryGetInteger((("global_" + assetOut) + "_balance")) | |
348 | + | let AssetInBalanceScaled = (AssetInBalance * scaleIn) | |
349 | + | let AssetOutBalanceScaled = (AssetOutBalance * scaleOut) | |
350 | + | let feeAmountIn = fraction(AmountIn, Fee, FeeScale) | |
351 | + | let cleanAmountIn = (AmountIn - feeAmountIn) | |
352 | + | let cleanAmountInScaled = (cleanAmountIn * scaleIn) | |
353 | + | let AmountOut1 = calculateOutAmount(cleanAmountInScaled, AssetIn, AssetOut, AssetInBalanceScaled, AssetOutBalanceScaled) | |
354 | + | let AmountOut = fraction(AmountOut1, 1, scaleOut) | |
355 | + | let AssetOutBalance2 = (AssetOutBalance - AmountOut) | |
356 | + | let AssetInBalance2 = (AssetInBalance + cleanAmountIn) | |
357 | + | let feeAssetOutBalance = if ((feeAssetOut == AssetIn)) | |
358 | + | then AssetInBalance2 | |
359 | + | else if ((feeAssetOut == AssetOut)) | |
360 | + | then AssetOutBalance2 | |
361 | + | else tryGetInteger((("global_" + getAssetString(feeAssetOut)) + "_balance")) | |
362 | + | let feeAmountOut = calculateOutAmount(feeAmountIn, AssetIn, feeAssetOut, AssetInBalance, feeAssetOutBalance) | |
363 | + | if ((minimum > AmountOut)) | |
364 | + | then throw("amount to recieve is lower than given one") | |
365 | + | else if ((AssetOut == AssetIn)) | |
366 | + | then throw("this swap is not allowed") | |
367 | + | else if ((0 > (AssetOutBalance - AmountOut))) | |
368 | + | then throw("contract is out of reserves") | |
369 | + | else if (isShutdown()) | |
370 | + | then throw("contract is on stop") | |
371 | + | else { | |
372 | + | let creatorFee = fraction(feeAmountOut, 1, 10) | |
373 | + | let protocolFee = fraction(feeAmountOut, 4, 10) | |
374 | + | let newBalanceIn = AssetInBalance2 | |
375 | + | let newBalanceOut = (AssetOutBalance2 - (if ((AssetOut == feeAssetOut)) | |
376 | + | then feeAmountOut | |
377 | + | else 0)) | |
378 | + | let newBalanceFeeAsset = if (if ((feeAssetOut != AssetIn)) | |
379 | + | then (feeAssetOut != AssetOut) | |
380 | + | else false) | |
381 | + | then (feeAssetOutBalance - feeAmountOut) | |
382 | + | else unit | |
383 | + | let assetInChange = IntegerEntry((("global_" + getAssetString(AssetIn)) + "_balance"), newBalanceIn) | |
384 | + | let assetOutChange = IntegerEntry((("global_" + assetOut) + "_balance"), newBalanceOut) | |
385 | + | let feeAssetOutChange = if ((newBalanceFeeAsset != unit)) | |
386 | + | then IntegerEntry((("global_" + getAssetString(feeAssetOut)) + "_balance"), value(newBalanceFeeAsset)) | |
387 | + | else StringEntry("hello", "world") | |
388 | + | let volumeUsdUpdate = calculateUsdValue(AssetIn, AmountIn, AssetInBalance) | |
389 | + | $Tuple2([assetOutChange, assetInChange, feeAssetOutChange, ScriptTransfer(addressFromStringValue(receipientAddressStr), AmountOut, AssetOut), ScriptTransfer(addressFromStringValue(tryGetString("static_poolOwner")), creatorFee, feeAssetOut), IntegerEntry("global_earnedByOwner", (tryGetInteger("global_earnedByOwner") + creatorFee)), IntegerEntry("global_volume_usd", (tryGetInteger("global_volume_usd") + volumeUsdUpdate)), ScriptTransfer(feesAddress, protocolFee, feeAssetOut)], AmountOut) | |
390 | + | } | |
391 | + | } | |
392 | + | ||
393 | + | ||
394 | + | @Callable(i) | |
395 | + | func initPool (poolDomain,poolOwner,tokenName,tokenDesc,tokenQuantity) = { | |
396 | + | func calculatePoolTokensAmount (payments) = { | |
397 | + | func handler (accum,pmt) = { | |
398 | + | let assetId = pmt.assetId | |
399 | + | func handler2 (accum,n) = if ((n == assetId)) | |
400 | + | then value(indexOf(assetIds, n)) | |
401 | + | else accum | |
402 | + | ||
403 | + | let Token = { | |
404 | + | let $l = assetIds | |
405 | + | let $s = size($l) | |
406 | + | let $acc0 = 1 | |
407 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
408 | + | then $a | |
409 | + | else handler2($a, $l[$i]) | |
410 | + | ||
411 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
412 | + | then $a | |
413 | + | else throw("List size exceeds 10") | |
414 | + | ||
415 | + | $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) | |
416 | + | } | |
417 | + | fraction(accum, pow(pmt.amount, Decimals[Token], AssetsWeights[Token], AssetsWeightsDecimals, 8, FLOOR), Scale8) | |
418 | + | } | |
419 | + | ||
420 | + | let $l = payments | |
421 | + | let $s = size($l) | |
422 | + | let $acc0 = PoolTokenScale | |
423 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
424 | + | then $a | |
425 | + | else handler($a, $l[$i]) | |
426 | + | ||
427 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
428 | + | then $a | |
429 | + | else throw("List size exceeds 10") | |
430 | + | ||
431 | + | $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) | |
432 | + | } | |
433 | + | ||
434 | + | let meme = Issue(tokenName, tokenDesc, tokenQuantity, 8, false) | |
435 | + | let memeId = calculateAssetId(meme) | |
436 | + | let memeIdStr = getAssetString(memeId) | |
437 | + | let assetWeightsStr = "5000,5000" | |
438 | + | let baseTokenIdStr = "WAVES" | |
439 | + | let poolOwnerAddress = Address(fromBase58String(poolOwner)) | |
440 | + | let assetIdsStr = ("WAVES," + memeIdStr) | |
441 | + | let assetIdsStrLi = split(assetIdsStr, ",") | |
442 | + | let assetIdsLi = { | |
443 | + | let $l = assetIdsStrLi | |
444 | + | let $s = size($l) | |
445 | + | let $acc0 = nil | |
446 | + | func $f4_1 ($a,$i) = if (($i >= $s)) | |
447 | + | then $a | |
448 | + | else addAssetBytesToList($a, $l[$i]) | |
449 | + | ||
450 | + | func $f4_2 ($a,$i) = if (($i >= $s)) | |
451 | + | then $a | |
452 | + | else throw("List size exceeds 10") | |
453 | + | ||
454 | + | $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) | |
455 | + | } | |
456 | + | let fee = 100 | |
457 | + | let feeAssetStr = { | |
458 | + | let $l = assetIdsStrLi | |
459 | + | let $s = size($l) | |
460 | + | let $acc0 = "" | |
461 | + | func $f5_1 ($a,$i) = if (($i >= $s)) | |
462 | + | then $a | |
463 | + | else checkFeeAsset($a, $l[$i]) | |
464 | + | ||
465 | + | func $f5_2 ($a,$i) = if (($i >= $s)) | |
466 | + | then $a | |
467 | + | else throw("List size exceeds 10") | |
468 | + | ||
469 | + | $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) | |
470 | + | } | |
471 | + | let pmt = i.payments[0] | |
472 | + | let amount = pmt.amount | |
473 | + | let pmtAsset = if ((pmt.assetId == unit)) | |
474 | + | then "WAVES" | |
475 | + | else throw("you have to attach some WAVES") | |
476 | + | if ((this != this)) | |
477 | + | then throw("self-invoke only") | |
478 | + | else if ((feeAssetStr == "")) | |
479 | + | then throw("pool must have one of the supported fee assets in the composition") | |
480 | + | else if ((size(poolDomain) > 13)) | |
481 | + | then throw("too large pool domain") | |
482 | + | else if (if ((fee > 500)) | |
483 | + | then true | |
484 | + | else (0 > fee)) | |
485 | + | then throw("fee value must be between 50 and 500 (0.5-5%)") | |
486 | + | else if (isShutdown()) | |
487 | + | then throw("contract is on stop") | |
488 | + | else { | |
489 | + | let assetWeightsStrLi = split(assetWeightsStr, ",") | |
490 | + | let assetWeightsSum = { | |
491 | + | let $l = assetWeightsStrLi | |
492 | + | let $s = size($l) | |
493 | + | let $acc0 = 0 | |
494 | + | func $f6_1 ($a,$i) = if (($i >= $s)) | |
495 | + | then $a | |
496 | + | else sum($a, $l[$i]) | |
497 | + | ||
498 | + | func $f6_2 ($a,$i) = if (($i >= $s)) | |
499 | + | then $a | |
500 | + | else throw("List size exceeds 10") | |
501 | + | ||
502 | + | $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) | |
503 | + | } | |
504 | + | func addTokenDataEntries (accum,assetNum) = if ((assetNum >= size(assetIdsLi))) | |
505 | + | then accum | |
506 | + | else { | |
507 | + | let assetDecimals = 8 | |
508 | + | (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])))]) | |
509 | + | } | |
510 | + | ||
511 | + | let initialPoolTokens = calculatePoolTokensAmount(i.payments) | |
512 | + | if ((assetWeightsSum != 10000)) | |
513 | + | then throw("sum of token weights must be equal to 10000") | |
514 | + | else if ((initialPoolTokens == 0)) | |
515 | + | then throw("you need a bigger tokens amount to launch the pool") | |
516 | + | else { | |
517 | + | let poolTokenIssue = Issue(("PZ " + poolDomain), "Puzzle Swap: pool index token", initialPoolTokens, PoolTokenDecimals, true, unit, 0) | |
518 | + | let poolTokenId = calculateAssetId(poolTokenIssue) | |
519 | + | $Tuple2(((({ | |
520 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
521 | + | let $s = size($l) | |
522 | + | let $acc0 = nil | |
523 | + | func $f7_1 ($a,$i) = if (($i >= $s)) | |
524 | + | then $a | |
525 | + | else addTokenDataEntries($a, $l[$i]) | |
526 | + | ||
527 | + | func $f7_2 ($a,$i) = if (($i >= $s)) | |
528 | + | then $a | |
529 | + | else throw("List size exceeds 10") | |
530 | + | ||
531 | + | $f7_2($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($f7_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
532 | + | } ++ [meme, 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), IntegerEntry("static_KMult", Scale16), IntegerEntry("global_wasPreInited", 1)]) ++ [IntegerEntry("global_WAVES_balance", InitalWavesLiquidity), IntegerEntry((("global_" + memeIdStr) + "_balance"), tokenQuantity)]) ++ [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)]), memeIdStr) | |
533 | + | } | |
534 | + | } | |
535 | + | } | |
536 | + | ||
537 | + | ||
538 | + | ||
539 | + | @Callable(i) | |
540 | + | func init (poolDomain,poolOwner,tokenName,tokenDesc,tokenQuantity) = if ((i.caller != factoryAccount)) | |
541 | + | then throw("admin only") | |
542 | + | else { | |
543 | + | let inv1 = invoke(this, "initPool", [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity], nil) | |
544 | + | if ((inv1 == inv1)) | |
545 | + | then { | |
546 | + | let memeIdStr = { | |
547 | + | let @ = inv1 | |
548 | + | if ($isInstanceOf(@, "String")) | |
549 | + | then @ | |
550 | + | else throw(($getType(@) + " couldn't be cast to String")) | |
551 | + | } | |
552 | + | swapInternal("WAVES", memeIdStr, (i.payments[0].amount - CreationFee), 0, toString(i.caller))._1 | |
553 | + | } | |
554 | + | else throw("Strict value is not equal to itself.") | |
555 | + | } | |
556 | + | ||
557 | + | ||
558 | + | ||
559 | + | @Callable(i) | |
560 | + | func claimIndexRewards () = if (isShutdown()) | |
561 | + | then throw("contract is on stop") | |
562 | + | else claimResult(i.caller) | |
563 | + | ||
564 | + | ||
565 | + | ||
566 | + | @Callable(i) | |
567 | + | func evaluateClaim (user) = $Tuple2(nil, claimResult(addressFromStringValue(user))._2) | |
568 | + | ||
569 | + | ||
570 | + | ||
571 | + | @Callable(i) | |
572 | + | func swap (assetOut,minimum) = { | |
573 | + | let status = getPoolStatus() | |
574 | + | if ((2 > status)) | |
575 | + | then { | |
576 | + | let pmt = if ((size(i.payments) == 1)) | |
577 | + | then value(i.payments[0]) | |
578 | + | else throw("please attach exactly one payment") | |
579 | + | let AmountIn = value(i.payments[0].amount) | |
580 | + | let AssetIn = i.payments[0].assetId | |
581 | + | let res = swapInternal(getAssetString(AssetIn), assetOut, AmountIn, minimum, toString(i.caller)) | |
582 | + | if ((getIntegerValue("global_WAVES_balance") > CurveTarget)) | |
583 | + | then { | |
584 | + | let notifyInv = invoke(factoryAccount, "notifyStatusUpdate", [2], nil) | |
585 | + | if ((notifyInv == notifyInv)) | |
586 | + | then res | |
587 | + | else throw("Strict value is not equal to itself.") | |
588 | + | } | |
589 | + | else res | |
590 | + | } | |
591 | + | else throw("pool is stopped: most probably it reached the target liquidity") | |
592 | + | } | |
593 | + | ||
594 | + | ||
595 | + | ||
596 | + | @Callable(i) | |
597 | + | func swapReadOnly (assetIn,assetOut,AmountIn) = { | |
598 | + | let AssetIn = getAssetBytes(assetIn) | |
599 | + | let AssetOut = getAssetBytes(assetOut) | |
600 | + | let scaleIn = (Scale8 / tryGetInteger((("static_" + assetIn) + "_scale"))) | |
601 | + | let scaleOut = (Scale8 / tryGetInteger((("static_" + assetOut) + "_scale"))) | |
602 | + | let feeAssetOutStr = tryGetString("static_feeToken") | |
603 | + | let feeAssetOut = if ((feeAssetOutStr == "")) | |
604 | + | then usdnAssetId | |
605 | + | else getAssetBytes(feeAssetOutStr) | |
606 | + | let AssetInBalance = tryGetInteger((("global_" + getAssetString(AssetIn)) + "_balance")) | |
607 | + | let AssetOutBalance = tryGetInteger((("global_" + assetOut) + "_balance")) | |
608 | + | let AssetInBalanceScaled = (AssetInBalance * scaleIn) | |
609 | + | let AssetOutBalanceScaled = (AssetOutBalance * scaleOut) | |
610 | + | let feeAmountIn = fraction(AmountIn, Fee, FeeScale) | |
611 | + | let cleanAmountIn = (AmountIn - feeAmountIn) | |
612 | + | let cleanAmountInScaled = (cleanAmountIn * scaleIn) | |
613 | + | let AmountOut1 = calculateOutAmount(cleanAmountInScaled, AssetIn, AssetOut, AssetInBalanceScaled, AssetOutBalanceScaled) | |
614 | + | let AmountOut = fraction(AmountOut1, 1, scaleOut) | |
615 | + | let AssetOutBalance2 = (AssetOutBalance - AmountOut) | |
616 | + | let AssetInBalance2 = (AssetInBalance + cleanAmountIn) | |
617 | + | let feeAssetOutBalance = if ((feeAssetOut == AssetIn)) | |
618 | + | then AssetInBalance2 | |
619 | + | else if ((feeAssetOut == AssetOut)) | |
620 | + | then AssetOutBalance2 | |
621 | + | else tryGetInteger((("global_" + getAssetString(feeAssetOut)) + "_balance")) | |
622 | + | let feeAmountOut = calculateOutAmount(feeAmountIn, AssetIn, feeAssetOut, AssetInBalance, feeAssetOutBalance) | |
623 | + | if ((AssetOut == AssetIn)) | |
624 | + | then throw("this swap is not allowed") | |
625 | + | else if ((0 > (AssetOutBalance - AmountOut))) | |
626 | + | then throw("contract is out of reserves") | |
627 | + | else if (isShutdown()) | |
628 | + | then throw("contract is on stop") | |
629 | + | else $Tuple2(nil, AmountOut) | |
630 | + | } | |
631 | + | ||
632 | + | ||
633 | + | ||
634 | + | @Callable(i) | |
635 | + | func transferOwnership (newOwnerAddress) = if ((toString(i.caller) != tryGetString("static_poolOwner"))) | |
636 | + | then throw("this call available only for pool owner") | |
637 | + | else [StringEntry("static_poolOwner", newOwnerAddress)] | |
638 | + | ||
639 | + |
github/deemru/w8io/026f985 44.44 ms ◑