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