tx · 5Q72V1MVhKGM557nD1FWLFxcNV7Dtu9JHe5VYPcSTTvH 3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5: -0.01400000 Waves 2022.01.19 19:59 [1886079] smart account 3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5 > SELF 0.00000000 Waves
{ "type": 13, "id": "5Q72V1MVhKGM557nD1FWLFxcNV7Dtu9JHe5VYPcSTTvH", "fee": 1400000, "feeAssetId": null, "timestamp": 1642611626197, "version": 1, "sender": "3MvkaAmaBu7ngK68fQMV8faYLdcnnBJtrj5", "senderPublicKey": "hXnMcUKtqomxgSbnHn7eToAsYJGaa1PWq7Lq6QQLumm", "proofs": [ "5eyLJMxzMGhr4KTNN6GBq1B1geShNM3mN3NePRqjcNz4tGmsN8oUEVH19H65TuJvuTDhhu1cqDy7xiJM1bYneaz4" ], "script": "base64:AAIFAAAAAAAAACAIAhIDCgEIEgASBAoCCAESAwoBCBIECgIICBIECgIICAAAAEgAAAAABlNDQUxFOAAAAAAAAAAACAAAAAAFTVVMVDgAAAAAAAX14QAAAAAAB1NDQUxFMTgAAAAAAAAAABIAAAAABk1VTFQxOAkAATYAAAABAA3gtrOnZAAAAAAAAANTRVACAAAAAl9fAAAAAA5QT09MV0VJR0hUTVVMVAUAAAAFTVVMVDgBAAAACWFzQW55TGlzdAAAAAEAAAADdmFsBAAAAAckbWF0Y2gwBQAAAAN2YWwDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACUxpc3RbQW55XQQAAAAKdmFsQW55THlzdAUAAAAHJG1hdGNoMAUAAAAKdmFsQW55THlzdAkAAAIAAAABAgAAABtmYWlsIHRvIGNhc3QgaW50byBMaXN0W0FueV0BAAAABWFzSW50AAAAAQAAAAN2YWwEAAAAByRtYXRjaDAFAAAAA3ZhbAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAZ2YWxJbnQFAAAAByRtYXRjaDAFAAAABnZhbEludAkAAAIAAAABAgAAABVmYWlsIHRv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XZWlnaHQAAAACAAAADGxwQXNzZXRJZFN0cgAAAA5wb29sQWRkcmVzc1N0cgMJAQAAAAIhPQAAAAIIBQAAAAFpAAAABmNhbGxlcgUAAAAPZmFjdG9yeUNvbnRyYWN0CQAAAgAAAAECAAAAEnBlcm1pc3Npb25zIGRlbmllZAQAAAANJHQwMTg5MTQxOTAyNAkBAAAAFHJlZnJlc2hQb29sSU5URUdSQUxTAAAAAwUAAAAMbHBBc3NldElkU3RyBQAAAA5wb29sQWRkcmVzc1N0cgAAAAAAAAAAAAQAAAASd3hQZXJMcEludGVncmFsTmV3CAUAAAANJHQwMTg5MTQxOTAyNAAAAAJfMQQAAAARcG9vbEludGVncmFsU1RBVEUIBQAAAA0kdDAxODkxNDE5MDI0AAAAAl8yBAAAAAlwb29sREVCVUcIBQAAAA0kdDAxODkxNDE5MDI0AAAAAl8zBQAAABFwb29sSW50ZWdyYWxTVEFURQAAAADoD8dY", "chainId": 84, "height": 1886079, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3xapWUveNjiEzFj2MwhTA7vkG88gyhdZzp2dxjMSN8oM Next: 5FUxwLK6BRwqBphQzLRkqjNp28aJQRnkf3cK6mmbTdJJ Diff:
Old | New | Differences | |
---|---|---|---|
84 | 84 | let IdxFactoryCfgSlippageDapp = 7 | |
85 | 85 | ||
86 | 86 | func keyFactoryCfg () = "%s__factoryConfig" | |
87 | + | ||
88 | + | ||
89 | + | func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr" | |
87 | 90 | ||
88 | 91 | ||
89 | 92 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
248 | 251 | ||
249 | 252 | ||
250 | 253 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
251 | - | let $ | |
252 | - | let wxPerLpIntegralNew = $ | |
253 | - | let poolIntegralSTATE = $ | |
254 | - | let poolDEBUG = $ | |
254 | + | let $t01038110503 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
255 | + | let wxPerLpIntegralNew = $t01038110503._1 | |
256 | + | let poolIntegralSTATE = $t01038110503._2 | |
257 | + | let poolDEBUG = $t01038110503._3 | |
255 | 258 | let MULT3 = 1000 | |
256 | 259 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
257 | 260 | let stakedByUser = readStaked(stakedByUserKEY) | |
293 | 296 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
294 | 297 | let stakedByUser = readStaked(stakedByUserKEY) | |
295 | 298 | let stakedTotal = readStaked(stakedTotalKEY) | |
296 | - | let $ | |
297 | - | let wxToClaimUserNew = $ | |
298 | - | let integralSTATE = $ | |
299 | - | let debug = $ | |
299 | + | let $t01304613163 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
300 | + | let wxToClaimUserNew = $t01304613163._1 | |
301 | + | let integralSTATE = $t01304613163._2 | |
302 | + | let debug = $t01304613163._3 | |
300 | 303 | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
301 | 304 | } | |
302 | 305 | ||
306 | 309 | func unstake (lpAssetIdStr,amount) = { | |
307 | 310 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
308 | 311 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
312 | + | let poolAddon = valueOrElse(getString(this, keyStablePoolAddonAddr()), poolAddressStr) | |
309 | 313 | let callerStr = toString(i.caller) | |
310 | - | let userAddressStr = if ((callerStr == poolAddressStr)) | |
314 | + | let userAddressStr = if (if ((callerStr == poolAddressStr)) | |
315 | + | then true | |
316 | + | else (callerStr == poolAddon)) | |
311 | 317 | then toString(i.originCaller) | |
312 | 318 | else callerStr | |
313 | 319 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
314 | 320 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
315 | 321 | let stakedByUser = readStaked(stakedByUserKEY) | |
316 | 322 | let stakedTotal = readStaked(stakedTotalKEY) | |
317 | - | let $ | |
318 | - | let wxToClaimUserNew = $ | |
319 | - | let integralSTATE = $ | |
320 | - | let debug = $ | |
323 | + | let $t01430014418 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
324 | + | let wxToClaimUserNew = $t01430014418._1 | |
325 | + | let integralSTATE = $t01430014418._2 | |
326 | + | let debug = $t01430014418._3 | |
321 | 327 | if ((amount > stakedByUser)) | |
322 | 328 | then throw("passed amount is less then available") | |
323 | 329 | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
338 | 344 | let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY) | |
339 | 345 | let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY) | |
340 | 346 | let claimedTotal = getIntOrZero(this, claimedTotalKEY) | |
341 | - | let $ | |
342 | - | let wxToClaimUserNew = $ | |
343 | - | let integralSTATE = $ | |
344 | - | let debug = $ | |
347 | + | let $t01561015722 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
348 | + | let wxToClaimUserNew = $t01561015722._1 | |
349 | + | let integralSTATE = $t01561015722._2 | |
350 | + | let debug = $t01561015722._3 | |
345 | 351 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
346 | 352 | if ((0 >= availableToClaim)) | |
347 | 353 | then throw("nothing to claim") | |
376 | 382 | else (height - emissionStartBlock) | |
377 | 383 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
378 | 384 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
379 | - | let $ | |
380 | - | let wxToClaimUserNew = $ | |
381 | - | let integralSTATE = $ | |
382 | - | let debug = $ | |
385 | + | let $t01792218034 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
386 | + | let wxToClaimUserNew = $t01792218034._1 | |
387 | + | let integralSTATE = $t01792218034._2 | |
388 | + | let debug = $t01792218034._3 | |
383 | 389 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
384 | 390 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
385 | 391 | let wxAmountBoostTotal = asInt(boostInvResult[0]) | |
396 | 402 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
397 | 403 | then throw("permissions denied") | |
398 | 404 | else { | |
399 | - | let $ | |
400 | - | let wxPerLpIntegralNew = $ | |
401 | - | let poolIntegralSTATE = $ | |
402 | - | let poolDEBUG = $ | |
405 | + | let $t01891419024 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
406 | + | let wxPerLpIntegralNew = $t01891419024._1 | |
407 | + | let poolIntegralSTATE = $t01891419024._2 | |
408 | + | let poolDEBUG = $t01891419024._3 | |
403 | 409 | poolIntegralSTATE | |
404 | 410 | } | |
405 | 411 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let SCALE18 = 18 | |
9 | 9 | ||
10 | 10 | let MULT18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let SEP = "__" | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | 15 | ||
16 | 16 | func asAnyList (val) = match val { | |
17 | 17 | case valAnyLyst: List[Any] => | |
18 | 18 | valAnyLyst | |
19 | 19 | case _ => | |
20 | 20 | throw("fail to cast into List[Any]") | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func asInt (val) = match val { | |
25 | 25 | case valInt: Int => | |
26 | 26 | valInt | |
27 | 27 | case _ => | |
28 | 28 | throw("fail to cast into Int") | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func asString (val) = match val { | |
33 | 33 | case valStr: String => | |
34 | 34 | valStr | |
35 | 35 | case _ => | |
36 | 36 | throw("fail to cast into Int") | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func asByteVector (val) = match val { | |
41 | 41 | case valBin: ByteVector => | |
42 | 42 | valBin | |
43 | 43 | case _ => | |
44 | 44 | throw("fail to cast into Int") | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | let IdxFactoryCfgStakingDapp = 1 | |
73 | 73 | ||
74 | 74 | let IdxFactoryCfgBoostingDapp = 2 | |
75 | 75 | ||
76 | 76 | let IdxFactoryCfgIdoDapp = 3 | |
77 | 77 | ||
78 | 78 | let IdxFactoryCfgTeamDapp = 4 | |
79 | 79 | ||
80 | 80 | let IdxFactoryCfgEmissionDapp = 5 | |
81 | 81 | ||
82 | 82 | let IdxFactoryCfgRestDapp = 6 | |
83 | 83 | ||
84 | 84 | let IdxFactoryCfgSlippageDapp = 7 | |
85 | 85 | ||
86 | 86 | func keyFactoryCfg () = "%s__factoryConfig" | |
87 | + | ||
88 | + | ||
89 | + | func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr" | |
87 | 90 | ||
88 | 91 | ||
89 | 92 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
90 | 93 | ||
91 | 94 | ||
92 | 95 | func keyFactoryLpList () = "%s__lpTokensList" | |
93 | 96 | ||
94 | 97 | ||
95 | 98 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
96 | 99 | ||
97 | 100 | ||
98 | 101 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
99 | 102 | ||
100 | 103 | ||
101 | 104 | func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP) | |
102 | 105 | ||
103 | 106 | ||
104 | 107 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
105 | 108 | ||
106 | 109 | ||
107 | 110 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
108 | 111 | ||
109 | 112 | ||
110 | 113 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
111 | 114 | ||
112 | 115 | ||
113 | 116 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
114 | 117 | ||
115 | 118 | ||
116 | 119 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
117 | 120 | ||
118 | 121 | ||
119 | 122 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
120 | 123 | ||
121 | 124 | ||
122 | 125 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
123 | 126 | ||
124 | 127 | ||
125 | 128 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
126 | 129 | ||
127 | 130 | ||
128 | 131 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
129 | 132 | ||
130 | 133 | ||
131 | 134 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
132 | 135 | ||
133 | 136 | ||
134 | 137 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
135 | 138 | ||
136 | 139 | ||
137 | 140 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
138 | 141 | ||
139 | 142 | ||
140 | 143 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
141 | 144 | ||
142 | 145 | ||
143 | 146 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
144 | 147 | ||
145 | 148 | ||
146 | 149 | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed", "total", lpAssetIdStr], SEP) | |
147 | 150 | ||
148 | 151 | ||
149 | 152 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
150 | 153 | ||
151 | 154 | ||
152 | 155 | func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP) | |
153 | 156 | ||
154 | 157 | ||
155 | 158 | func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP) | |
156 | 159 | ||
157 | 160 | ||
158 | 161 | func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP) | |
159 | 162 | ||
160 | 163 | ||
161 | 164 | func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP) | |
162 | 165 | ||
163 | 166 | ||
164 | 167 | func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP) | |
165 | 168 | ||
166 | 169 | ||
167 | 170 | func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP) | |
168 | 171 | ||
169 | 172 | ||
170 | 173 | func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP) | |
171 | 174 | ||
172 | 175 | ||
173 | 176 | func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP) | |
174 | 177 | ||
175 | 178 | ||
176 | 179 | func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP) | |
177 | 180 | ||
178 | 181 | ||
179 | 182 | func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP) | |
180 | 183 | ||
181 | 184 | ||
182 | 185 | func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP) | |
183 | 186 | ||
184 | 187 | ||
185 | 188 | func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP) | |
186 | 189 | ||
187 | 190 | ||
188 | 191 | func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP) | |
189 | 192 | ||
190 | 193 | ||
191 | 194 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
192 | 195 | ||
193 | 196 | ||
194 | 197 | func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP) | |
195 | 198 | ||
196 | 199 | ||
197 | 200 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
198 | 201 | ||
199 | 202 | ||
200 | 203 | let factoryAddress = getStringOrFail(keyFactoryAddress()) | |
201 | 204 | ||
202 | 205 | let factoryContract = addressFromStringValue(factoryAddress) | |
203 | 206 | ||
204 | 207 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
205 | 208 | ||
206 | 209 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
207 | 210 | ||
208 | 211 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
209 | 212 | ||
210 | 213 | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0)) | |
211 | 214 | then (stakedByUser > 0) | |
212 | 215 | else false) | |
213 | 216 | then 0 | |
214 | 217 | else if ((stakedByUser == 0)) | |
215 | 218 | then wxPerLpIntegralNew | |
216 | 219 | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0)) | |
217 | 220 | then (stakedByUser > 0) | |
218 | 221 | else false) | |
219 | 222 | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
220 | 223 | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
221 | 224 | ||
222 | 225 | ||
223 | 226 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
224 | 227 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
225 | 228 | let stakedTotal = readStaked(stakedTotalKEY) | |
226 | 229 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
227 | 230 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
228 | 231 | let MULT3 = 1000 | |
229 | 232 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3) | |
230 | 233 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
231 | 234 | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
232 | 235 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
233 | 236 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
234 | 237 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
235 | 238 | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
236 | 239 | let wxPerLpOrZeroX3 = 0 | |
237 | 240 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
238 | 241 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
239 | 242 | then wxPerLpOrZeroX3 | |
240 | 243 | else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
241 | 244 | let stakedTotalNew = (stakedTotal + lpDeltaAmount) | |
242 | 245 | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh)) | |
243 | 246 | let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew) | |
244 | 247 | let wxPerLpIntegralLastUpdHeightNew = height | |
245 | 248 | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
246 | 249 | $Tuple3(wxPerLpIntegralNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpX3New)], debug) | |
247 | 250 | } | |
248 | 251 | ||
249 | 252 | ||
250 | 253 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
251 | - | let $ | |
252 | - | let wxPerLpIntegralNew = $ | |
253 | - | let poolIntegralSTATE = $ | |
254 | - | let poolDEBUG = $ | |
254 | + | let $t01038110503 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
255 | + | let wxPerLpIntegralNew = $t01038110503._1 | |
256 | + | let poolIntegralSTATE = $t01038110503._2 | |
257 | + | let poolDEBUG = $t01038110503._3 | |
255 | 258 | let MULT3 = 1000 | |
256 | 259 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
257 | 260 | let stakedByUser = readStaked(stakedByUserKEY) | |
258 | 261 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
259 | 262 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
260 | 263 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
261 | 264 | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
262 | 265 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
263 | 266 | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
264 | 267 | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3))) | |
265 | 268 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
266 | 269 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
267 | 270 | let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
268 | 271 | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)]), debug) | |
269 | 272 | } | |
270 | 273 | ||
271 | 274 | ||
272 | 275 | @Callable(i) | |
273 | 276 | func constructor (factoryAddressStr) = if ((i.caller != this)) | |
274 | 277 | then throw("not authorized") | |
275 | 278 | else [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
276 | 279 | ||
277 | 280 | ||
278 | 281 | ||
279 | 282 | @Callable(i) | |
280 | 283 | func stake () = if ((size(i.payments) != 1)) | |
281 | 284 | then throw("invalid payment - exact one payment must be attached") | |
282 | 285 | else { | |
283 | 286 | let pmt = i.payments[0] | |
284 | 287 | let lpAssetId = value(pmt.assetId) | |
285 | 288 | let lpAssetIdStr = toBase58String(lpAssetId) | |
286 | 289 | let amount = pmt.amount | |
287 | 290 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
288 | 291 | let callerStr = toString(i.caller) | |
289 | 292 | let userAddressStr = if ((callerStr == poolAddressStr)) | |
290 | 293 | then toString(i.originCaller) | |
291 | 294 | else callerStr | |
292 | 295 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
293 | 296 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
294 | 297 | let stakedByUser = readStaked(stakedByUserKEY) | |
295 | 298 | let stakedTotal = readStaked(stakedTotalKEY) | |
296 | - | let $ | |
297 | - | let wxToClaimUserNew = $ | |
298 | - | let integralSTATE = $ | |
299 | - | let debug = $ | |
299 | + | let $t01304613163 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
300 | + | let wxToClaimUserNew = $t01304613163._1 | |
301 | + | let integralSTATE = $t01304613163._2 | |
302 | + | let debug = $t01304613163._3 | |
300 | 303 | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
301 | 304 | } | |
302 | 305 | ||
303 | 306 | ||
304 | 307 | ||
305 | 308 | @Callable(i) | |
306 | 309 | func unstake (lpAssetIdStr,amount) = { | |
307 | 310 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
308 | 311 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
312 | + | let poolAddon = valueOrElse(getString(this, keyStablePoolAddonAddr()), poolAddressStr) | |
309 | 313 | let callerStr = toString(i.caller) | |
310 | - | let userAddressStr = if ((callerStr == poolAddressStr)) | |
314 | + | let userAddressStr = if (if ((callerStr == poolAddressStr)) | |
315 | + | then true | |
316 | + | else (callerStr == poolAddon)) | |
311 | 317 | then toString(i.originCaller) | |
312 | 318 | else callerStr | |
313 | 319 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
314 | 320 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
315 | 321 | let stakedByUser = readStaked(stakedByUserKEY) | |
316 | 322 | let stakedTotal = readStaked(stakedTotalKEY) | |
317 | - | let $ | |
318 | - | let wxToClaimUserNew = $ | |
319 | - | let integralSTATE = $ | |
320 | - | let debug = $ | |
323 | + | let $t01430014418 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
324 | + | let wxToClaimUserNew = $t01430014418._1 | |
325 | + | let integralSTATE = $t01430014418._2 | |
326 | + | let debug = $t01430014418._3 | |
321 | 327 | if ((amount > stakedByUser)) | |
322 | 328 | then throw("passed amount is less then available") | |
323 | 329 | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
324 | 330 | } | |
325 | 331 | ||
326 | 332 | ||
327 | 333 | ||
328 | 334 | @Callable(i) | |
329 | 335 | func claimWx (lpAssetIdStr) = { | |
330 | 336 | let userAddress = i.caller | |
331 | 337 | let userAddressStr = toString(i.caller) | |
332 | 338 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
333 | 339 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
334 | 340 | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
335 | 341 | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
336 | 342 | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
337 | 343 | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
338 | 344 | let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY) | |
339 | 345 | let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY) | |
340 | 346 | let claimedTotal = getIntOrZero(this, claimedTotalKEY) | |
341 | - | let $ | |
342 | - | let wxToClaimUserNew = $ | |
343 | - | let integralSTATE = $ | |
344 | - | let debug = $ | |
347 | + | let $t01561015722 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
348 | + | let wxToClaimUserNew = $t01561015722._1 | |
349 | + | let integralSTATE = $t01561015722._2 | |
350 | + | let debug = $t01561015722._3 | |
345 | 351 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
346 | 352 | if ((0 >= availableToClaim)) | |
347 | 353 | then throw("nothing to claim") | |
348 | 354 | else { | |
349 | 355 | let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]) | |
350 | 356 | let minRewardPart = availableToClaim | |
351 | 357 | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
352 | 358 | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0]) | |
353 | 359 | let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil)) | |
354 | 360 | if ((emitBoost == emitBoost)) | |
355 | 361 | then [IntegerEntry(claimedByUserKEY, (claimedByUser + availableToClaim)), IntegerEntry(claimedByUserMinRewardKEY, (claimedByUserMinReward + minRewardPart)), IntegerEntry(claimedByUserBoostRewardKEY, (claimedByUserBoostReward + boostRewardPart)), IntegerEntry(claimedTotalKEY, (claimedTotal + availableToClaim)), ScriptTransfer(userAddress, minRewardPart, wxAssetId), ScriptTransfer(userAddress, boostRewardPart, wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, availableToClaim, i.transactionId)] | |
356 | 362 | else throw("Strict value is not equal to itself.") | |
357 | 363 | } | |
358 | 364 | } | |
359 | 365 | ||
360 | 366 | ||
361 | 367 | ||
362 | 368 | @Callable(i) | |
363 | 369 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
364 | 370 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
365 | 371 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
366 | 372 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
367 | 373 | let stakedByUser = readStaked(stakedByUserKEY) | |
368 | 374 | let stakedTotal = readStaked(stakedTotalKEY) | |
369 | 375 | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
370 | 376 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
371 | 377 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
372 | 378 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
373 | 379 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
374 | 380 | let passedBlocks = if ((emissionStartBlock > height)) | |
375 | 381 | then 0 | |
376 | 382 | else (height - emissionStartBlock) | |
377 | 383 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
378 | 384 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
379 | - | let $ | |
380 | - | let wxToClaimUserNew = $ | |
381 | - | let integralSTATE = $ | |
382 | - | let debug = $ | |
385 | + | let $t01792218034 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
386 | + | let wxToClaimUserNew = $t01792218034._1 | |
387 | + | let integralSTATE = $t01792218034._2 | |
388 | + | let debug = $t01792218034._3 | |
383 | 389 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
384 | 390 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
385 | 391 | let wxAmountBoostTotal = asInt(boostInvResult[0]) | |
386 | 392 | let boostDebug = asString(boostInvResult[1]) | |
387 | 393 | let minRewardPart = availableToClaim | |
388 | 394 | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
389 | 395 | let totalReward = (minRewardPart + boostRewardPart) | |
390 | 396 | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), ((((debug + "::") + toString(userWxReward)) + "::BOOSTDEBUG::") + boostDebug)], SEP)) | |
391 | 397 | } | |
392 | 398 | ||
393 | 399 | ||
394 | 400 | ||
395 | 401 | @Callable(i) | |
396 | 402 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
397 | 403 | then throw("permissions denied") | |
398 | 404 | else { | |
399 | - | let $ | |
400 | - | let wxPerLpIntegralNew = $ | |
401 | - | let poolIntegralSTATE = $ | |
402 | - | let poolDEBUG = $ | |
405 | + | let $t01891419024 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
406 | + | let wxPerLpIntegralNew = $t01891419024._1 | |
407 | + | let poolIntegralSTATE = $t01891419024._2 | |
408 | + | let poolDEBUG = $t01891419024._3 | |
403 | 409 | poolIntegralSTATE | |
404 | 410 | } | |
405 | 411 | ||
406 | 412 |
github/deemru/w8io/026f985 67.62 ms ◑