tx · 7VasV9EDZPvJLDMRqomGxTE5diWCUrALey8gHsHuPgqa

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.01400000 Waves

2021.12.15 12:24 [1835181] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "7VasV9EDZPvJLDMRqomGxTE5diWCUrALey8gHsHuPgqa", "fee": 1400000, "feeAssetId": null, "timestamp": 1639560271131, "version": 1, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "2bR6ohPrk3QNXfaqa25aD6RtsgFNcr9jVS1UgMFT68C4J6ZpKPst4Q2LLQtHRkbx3KArtQKPZMX3cH1pko2RXGWE" ], "script": "base64:AAIFAAAAAAAAACAIAhIDCgEIEgASBAoCCAESAwoBCBIECgIICBIECgIICAAAAEcAAAAABlNDQUxFOAAAAAAAAAAACAAAAAAFTVVMVDgAAAAAAAX14QAAAAAAB1NDQUxFMTgAAAAAAAAAABIAAAAABk1VTFQxOAkAATYAAAABAA3gtrOnZAAAAAAAAANTRVACAAAAAl9fAAAAAA5QT09MV0VJR0hUTVVMVAUAAAAFTVVMVDgBAAAACWFzQW55TGlzdAAAAAEAAAADdmFsBAAAAAckbWF0Y2gwBQAAAAN2YWwDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACUxpc3RbQW55XQQAAAAKdmFsQW55THlzdAUAAAAHJG1hdGNoMAUAAAAKdmFsQW55THlzdAkAAAIAAAABAgAAABtmYWlsIHRvIGNhc3QgaW50byBMaXN0W0FueV0BAAAABWFzSW50AAAAAQAAAAN2YWwEAAAAByRtYXRjaDAFAAAAA3ZhbAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAZ2YWxJbnQFAAAAByRtYXRjaDAFAAAABnZhbEludAkAAAIAAAABAgAAABVmYW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sSW50ZWdyYWxTVEFURQgFAAAADSR0MDE4NTM2MTg2NDYAAAACXzIEAAAACXBvb2xERUJVRwgFAAAADSR0MDE4NTM2MTg2NDYAAAACXzMFAAAAEXBvb2xJbnRlZ3JhbFNUQVRFAAAAAAHFvoA=", "chainId": 84, "height": 1835181, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4ANkMz4DGaFvtGXBkYWpkTGidXYLDE6Ztq6JTmLaPjwF Next: 4i9yCgAGHmuCmXHjoez59gdBb3pUf34c4QWGYQ7dCvv9 Diff:
OldNewDifferences
9898 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
9999
100100
101-func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress()))
102-
103-
104-func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
101+func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
105102
106103
107104 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
200197 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
201198
202199
203-let factoryContract = readFactoryAddressOrFail()
200+let factoryAddress = getStringOrFail(keyFactoryAddress())
201+
202+let factoryContract = addressFromStringValue(factoryAddress)
204203
205204 let factoryCfg = readFactoryCfgOrFail(factoryContract)
206205
221220 else throw("calcWxPerLpIntegralUserLast: unexpected state")
222221
223222
224-func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
225- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
223+func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
226224 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
227- let stakedByUser = readStaked(stakedByUserKEY)
228225 let stakedTotal = readStaked(stakedTotalKEY)
229226 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
230227 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
231228 let MULT3 = 1000
232- let wxEmissionPerBlock = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
233- let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, (POOLWEIGHTMULT * 3))
229+ let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
230+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
234231 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
235232 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
233+ let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
234+ let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
235+ let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
236+ let wxPerLpOrZeroX3 = 0
237+ let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
238+ let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
239+ then wxPerLpOrZeroX3
240+ else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal)
241+ let stakedTotalNew = (stakedTotal + lpDeltaAmount)
242+ let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh))
243+ let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew)
244+ let wxPerLpIntegralLastUpdHeightNew = height
245+ let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
246+ $Tuple3(wxPerLpIntegralNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpX3New)], debug)
247+ }
248+
249+
250+func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
251+ let $t01032310445 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
252+ let wxPerLpIntegralNew = $t01032310445._1
253+ let poolIntegralSTATE = $t01032310445._2
254+ let poolDEBUG = $t01032310445._3
255+ let MULT3 = 1000
256+ let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
257+ let stakedByUser = readStaked(stakedByUserKEY)
236258 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
237259 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
238- let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
239260 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
240- let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
241- let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
242261 let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY)
243262 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
244- let wxPerLpOrZeroX8 = 0
245- let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
246- let wxPerLpX8 = if ((wxPerLpOrZeroX8 != 0))
247- then wxPerLpOrZeroX8
248- else fraction(poolWxEmissionPerBlock, MULT8, stakedTotal)
249- let stakedTotalNew = (stakedTotal + lpDeltaAmount)
250- let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX8 * dh))
251263 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
252264 let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3)))
253265 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
254- let wxPerLpNewX8 = 0
255- let wxPerLpIntegralLastUpdHeightNew = height
256266 let wxPerLpIntegralUserLastUpdHeightNew = height
257- let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), toString(dh), toString(wxPerLpX8), toString(stakedTotal), toString(poolWxEmissionPerBlock), toString(wxEmissionPerBlock), toString(poolWeight), toString(height)], "::")
258- $Tuple3(wxToClaimUserNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpNewX8), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)], debug)
267+ let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
268+ $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)]), debug)
259269 }
260270
261271
283293 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
284294 let stakedByUser = readStaked(stakedByUserKEY)
285295 let stakedTotal = readStaked(stakedTotalKEY)
286- let $t01252212639 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
287- let wxToClaimUserNew = $t01252212639._1
288- let integralSTATE = $t01252212639._2
289- let debug = $t01252212639._3
296+ let $t01298813105 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
297+ let wxToClaimUserNew = $t01298813105._1
298+ let integralSTATE = $t01298813105._2
299+ let debug = $t01298813105._3
290300 ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
291301 }
292302
301311 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
302312 let stakedByUser = readStaked(stakedByUserKEY)
303313 let stakedTotal = readStaked(stakedTotalKEY)
304- let $t01345613574 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))
305- let wxToClaimUserNew = $t01345613574._1
306- let integralSTATE = $t01345613574._2
307- let debug = $t01345613574._3
314+ let $t01392214040 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))
315+ let wxToClaimUserNew = $t01392214040._1
316+ let integralSTATE = $t01392214040._2
317+ let debug = $t01392214040._3
308318 if ((amount > stakedByUser))
309319 then throw("passed amount is less then available")
310320 else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
325335 let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY)
326336 let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY)
327337 let claimedTotal = getIntOrZero(this, claimedTotalKEY)
328- let $t01476614878 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
329- let wxToClaimUserNew = $t01476614878._1
330- let integralSTATE = $t01476614878._2
331- let debug = $t01476614878._3
338+ let $t01523215344 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
339+ let wxToClaimUserNew = $t01523215344._1
340+ let integralSTATE = $t01523215344._2
341+ let debug = $t01523215344._3
332342 let availableToClaim = (wxToClaimUserNew - claimedByUser)
333343 if ((0 >= availableToClaim))
334344 then throw("nothing to claim")
335345 else {
336346 let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0])
337- let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
338347 let minRewardPart = availableToClaim
339348 let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal])
340349 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0])
356365 let stakedTotal = readStaked(stakedTotalKEY)
357366 let claimedByUser = getIntOrZero(this, claimedByUserKEY)
358367 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
359- let poolWeightMult = MULT8
360368 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
361369 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
362370 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
363371 let passedBlocks = if ((emissionStartBlock > height))
364372 then 0
365373 else (height - emissionStartBlock)
366- let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, poolWeightMult)
374+ let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
367375 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
368- let $t01722917341 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
369- let wxToClaimUserNew = $t01722917341._1
370- let integralSTATE = $t01722917341._2
371- let debug = $t01722917341._3
376+ let $t01754417656 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
377+ let wxToClaimUserNew = $t01754417656._1
378+ let integralSTATE = $t01754417656._2
379+ let debug = $t01754417656._3
372380 let availableToClaim = (wxToClaimUserNew - claimedByUser)
373381 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
374382 let wxAmountBoostTotal = asInt(boostInvResult[0])
380388 }
381389
382390
391+
392+@Callable(i)
393+func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
394+ then throw("permissions denied")
395+ else {
396+ let $t01853618646 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
397+ let wxPerLpIntegralNew = $t01853618646._1
398+ let poolIntegralSTATE = $t01853618646._2
399+ let poolDEBUG = $t01853618646._3
400+ poolIntegralSTATE
401+ }
402+
403+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT8 = 100000000
77
88 let SCALE18 = 18
99
1010 let MULT18 = toBigInt(1000000000000000000)
1111
1212 let SEP = "__"
1313
1414 let POOLWEIGHTMULT = MULT8
1515
1616 func asAnyList (val) = match val {
1717 case valAnyLyst: List[Any] =>
1818 valAnyLyst
1919 case _ =>
2020 throw("fail to cast into List[Any]")
2121 }
2222
2323
2424 func asInt (val) = match val {
2525 case valInt: Int =>
2626 valInt
2727 case _ =>
2828 throw("fail to cast into Int")
2929 }
3030
3131
3232 func asString (val) = match val {
3333 case valStr: String =>
3434 valStr
3535 case _ =>
3636 throw("fail to cast into Int")
3737 }
3838
3939
4040 func asByteVector (val) = match val {
4141 case valBin: ByteVector =>
4242 valBin
4343 case _ =>
4444 throw("fail to cast into Int")
4545 }
4646
4747
4848 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
4949
5050
5151 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
5252
5353
5454 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
5555
5656
5757 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
5858
5959
6060 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
6161
6262
6363 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
6464
6565
6666 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
6767
6868
6969 func keyFactoryAddress () = "%s%s__config__factoryAddress"
7070
7171
7272 let IdxFactoryCfgStakingDapp = 1
7373
7474 let IdxFactoryCfgBoostingDapp = 2
7575
7676 let IdxFactoryCfgIdoDapp = 3
7777
7878 let IdxFactoryCfgTeamDapp = 4
7979
8080 let IdxFactoryCfgEmissionDapp = 5
8181
8282 let IdxFactoryCfgRestDapp = 6
8383
8484 let IdxFactoryCfgSlippageDapp = 7
8585
8686 func keyFactoryCfg () = "%s__factoryConfig"
8787
8888
8989 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9090
9191
9292 func keyFactoryLpList () = "%s__lpTokensList"
9393
9494
9595 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9696
9797
9898 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
9999
100100
101-func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress()))
102-
103-
104-func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
101+func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
105102
106103
107104 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
108105
109106
110107 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
111108
112109
113110 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
114111
115112
116113 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
117114
118115
119116 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
120117
121118
122119 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
123120
124121
125122 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
126123
127124
128125 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
129126
130127
131128 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
132129
133130
134131 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
135132
136133
137134 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
138135
139136
140137 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
141138
142139
143140 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
144141
145142
146143 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
147144
148145
149146 func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed", "total", lpAssetIdStr], SEP)
150147
151148
152149 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
153150
154151
155152 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
156153
157154
158155 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
159156
160157
161158 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
162159
163160
164161 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
165162
166163
167164 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
168165
169166
170167 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
171168
172169
173170 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
174171
175172
176173 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
177174
178175
179176 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
180177
181178
182179 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
183180
184181
185182 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
186183
187184
188185 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
189186
190187
191188 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
192189
193190
194191 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
195192
196193
197194 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
198195
199196
200197 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
201198
202199
203-let factoryContract = readFactoryAddressOrFail()
200+let factoryAddress = getStringOrFail(keyFactoryAddress())
201+
202+let factoryContract = addressFromStringValue(factoryAddress)
204203
205204 let factoryCfg = readFactoryCfgOrFail(factoryContract)
206205
207206 let emissionContract = getEmissionAddressOrFail(factoryCfg)
208207
209208 let boostingContract = getBoostingAddressOrFail(factoryCfg)
210209
211210 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0))
212211 then (stakedByUser > 0)
213212 else false)
214213 then 0
215214 else if ((stakedByUser == 0))
216215 then wxPerLpIntegralNew
217216 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0))
218217 then (stakedByUser > 0)
219218 else false)
220219 then getIntOrFail(this, wxPerLpIntegralUserLastKEY)
221220 else throw("calcWxPerLpIntegralUserLast: unexpected state")
222221
223222
224-func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
225- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
223+func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
226224 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
227- let stakedByUser = readStaked(stakedByUserKEY)
228225 let stakedTotal = readStaked(stakedTotalKEY)
229226 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
230227 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
231228 let MULT3 = 1000
232- let wxEmissionPerBlock = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
233- let poolWxEmissionPerBlock = fraction(wxEmissionPerBlock, poolWeight, (POOLWEIGHTMULT * 3))
229+ let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
230+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
234231 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
235232 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
233+ let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
234+ let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
235+ let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
236+ let wxPerLpOrZeroX3 = 0
237+ let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
238+ let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
239+ then wxPerLpOrZeroX3
240+ else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal)
241+ let stakedTotalNew = (stakedTotal + lpDeltaAmount)
242+ let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh))
243+ let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew)
244+ let wxPerLpIntegralLastUpdHeightNew = height
245+ let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
246+ $Tuple3(wxPerLpIntegralNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpX3New)], debug)
247+ }
248+
249+
250+func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
251+ let $t01032310445 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
252+ let wxPerLpIntegralNew = $t01032310445._1
253+ let poolIntegralSTATE = $t01032310445._2
254+ let poolDEBUG = $t01032310445._3
255+ let MULT3 = 1000
256+ let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
257+ let stakedByUser = readStaked(stakedByUserKEY)
236258 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
237259 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
238- let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
239260 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
240- let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
241- let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
242261 let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY)
243262 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
244- let wxPerLpOrZeroX8 = 0
245- let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
246- let wxPerLpX8 = if ((wxPerLpOrZeroX8 != 0))
247- then wxPerLpOrZeroX8
248- else fraction(poolWxEmissionPerBlock, MULT8, stakedTotal)
249- let stakedTotalNew = (stakedTotal + lpDeltaAmount)
250- let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX8 * dh))
251263 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
252264 let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3)))
253265 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
254- let wxPerLpNewX8 = 0
255- let wxPerLpIntegralLastUpdHeightNew = height
256266 let wxPerLpIntegralUserLastUpdHeightNew = height
257- let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), toString(dh), toString(wxPerLpX8), toString(stakedTotal), toString(poolWxEmissionPerBlock), toString(wxEmissionPerBlock), toString(poolWeight), toString(height)], "::")
258- $Tuple3(wxToClaimUserNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpNewX8), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)], debug)
267+ let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
268+ $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)]), debug)
259269 }
260270
261271
262272 @Callable(i)
263273 func constructor (factoryAddressStr) = if ((i.caller != this))
264274 then throw("not authorized")
265275 else [StringEntry(keyFactoryAddress(), factoryAddressStr)]
266276
267277
268278
269279 @Callable(i)
270280 func stake () = if ((size(i.payments) != 1))
271281 then throw("invalid payment - exact one payment must be attached")
272282 else {
273283 let pmt = i.payments[0]
274284 let lpAssetId = value(pmt.assetId)
275285 let lpAssetIdStr = toBase58String(lpAssetId)
276286 let amount = pmt.amount
277287 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
278288 let callerStr = toString(i.caller)
279289 let userAddressStr = if ((callerStr == poolAddressStr))
280290 then toString(i.originCaller)
281291 else callerStr
282292 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
283293 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
284294 let stakedByUser = readStaked(stakedByUserKEY)
285295 let stakedTotal = readStaked(stakedTotalKEY)
286- let $t01252212639 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
287- let wxToClaimUserNew = $t01252212639._1
288- let integralSTATE = $t01252212639._2
289- let debug = $t01252212639._3
296+ let $t01298813105 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
297+ let wxToClaimUserNew = $t01298813105._1
298+ let integralSTATE = $t01298813105._2
299+ let debug = $t01298813105._3
290300 ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
291301 }
292302
293303
294304
295305 @Callable(i)
296306 func unstake (lpAssetIdStr,amount) = {
297307 let userAddressStr = toString(i.caller)
298308 let lpAssetId = fromBase58String(lpAssetIdStr)
299309 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
300310 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
301311 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
302312 let stakedByUser = readStaked(stakedByUserKEY)
303313 let stakedTotal = readStaked(stakedTotalKEY)
304- let $t01345613574 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))
305- let wxToClaimUserNew = $t01345613574._1
306- let integralSTATE = $t01345613574._2
307- let debug = $t01345613574._3
314+ let $t01392214040 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))
315+ let wxToClaimUserNew = $t01392214040._1
316+ let integralSTATE = $t01392214040._2
317+ let debug = $t01392214040._3
308318 if ((amount > stakedByUser))
309319 then throw("passed amount is less then available")
310320 else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
311321 }
312322
313323
314324
315325 @Callable(i)
316326 func claimWx (lpAssetIdStr) = {
317327 let userAddress = i.caller
318328 let userAddressStr = toString(i.caller)
319329 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
320330 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
321331 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
322332 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
323333 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
324334 let claimedByUser = getIntOrZero(this, claimedByUserKEY)
325335 let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY)
326336 let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY)
327337 let claimedTotal = getIntOrZero(this, claimedTotalKEY)
328- let $t01476614878 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
329- let wxToClaimUserNew = $t01476614878._1
330- let integralSTATE = $t01476614878._2
331- let debug = $t01476614878._3
338+ let $t01523215344 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
339+ let wxToClaimUserNew = $t01523215344._1
340+ let integralSTATE = $t01523215344._2
341+ let debug = $t01523215344._3
332342 let availableToClaim = (wxToClaimUserNew - claimedByUser)
333343 if ((0 >= availableToClaim))
334344 then throw("nothing to claim")
335345 else {
336346 let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0])
337- let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
338347 let minRewardPart = availableToClaim
339348 let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal])
340349 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0])
341350 let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil))
342351 if ((emitBoost == emitBoost))
343352 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)]
344353 else throw("Strict value is not equal to itself.")
345354 }
346355 }
347356
348357
349358
350359 @Callable(i)
351360 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
352361 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
353362 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
354363 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
355364 let stakedByUser = readStaked(stakedByUserKEY)
356365 let stakedTotal = readStaked(stakedTotalKEY)
357366 let claimedByUser = getIntOrZero(this, claimedByUserKEY)
358367 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
359- let poolWeightMult = MULT8
360368 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
361369 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
362370 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
363371 let passedBlocks = if ((emissionStartBlock > height))
364372 then 0
365373 else (height - emissionStartBlock)
366- let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, poolWeightMult)
374+ let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
367375 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
368- let $t01722917341 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
369- let wxToClaimUserNew = $t01722917341._1
370- let integralSTATE = $t01722917341._2
371- let debug = $t01722917341._3
376+ let $t01754417656 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
377+ let wxToClaimUserNew = $t01754417656._1
378+ let integralSTATE = $t01754417656._2
379+ let debug = $t01754417656._3
372380 let availableToClaim = (wxToClaimUserNew - claimedByUser)
373381 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
374382 let wxAmountBoostTotal = asInt(boostInvResult[0])
375383 let boostDebug = asString(boostInvResult[1])
376384 let minRewardPart = availableToClaim
377385 let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal])
378386 let totalReward = (minRewardPart + boostRewardPart)
379387 $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))
380388 }
381389
382390
391+
392+@Callable(i)
393+func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
394+ then throw("permissions denied")
395+ else {
396+ let $t01853618646 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
397+ let wxPerLpIntegralNew = $t01853618646._1
398+ let poolIntegralSTATE = $t01853618646._2
399+ let poolDEBUG = $t01853618646._3
400+ poolIntegralSTATE
401+ }
402+
403+

github/deemru/w8io/fabc49c 
57.44 ms