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