tx · 6GJFDyiBBeMWrmLmVuTwACQwiMeFL9wix6mWJk9BtMKH 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz: -0.02900000 Waves 2022.06.27 12:41 [2114679] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves
{ "type": 13, "id": "6GJFDyiBBeMWrmLmVuTwACQwiMeFL9wix6mWJk9BtMKH", "fee": 2900000, "feeAssetId": null, "timestamp": 1656322919117, "version": 1, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "2FZvKR4BorV72cDZSdgEJV54qWF4ssSiNP4QrkUymcRGb1MVMzTC1VV1H2F7DUeVw3SPVBg2va8qzZxUGC5zbVBu" ], "script": "base64:BgI3CAISAwoBCBIDCgEIEgMKAQgSABIAEgQKAggBEgMKAQgSBAoCCAgSBAoCCAgSAwoBCBIECgIICF8ABlNDQUxFOAAIAAVNVUxUOACAwtcvAAdTQ0FMRTE4ABIABk1VTFQxOAkAtgIBAICAkLu61q3wDQADU0VQAgJfXwAOUE9PTFdFSUdIVE1VTFQFBU1VTFQ4AAp6ZXJvQmlnSW50CQC2AgEAAAAJb25lQmlnSW50CQC2AgEAAQEJYXNBbnlMaXN0AQN2YWwEByRtYXRjaDAFA3ZhbAMJAAECBQckbWF0Y2gwAglMaXN0W0FueV0ECnZhbEFueUx5c3QFByRtYXRjaDAFCnZhbEFueUx5c3QJAAIBAhtmYWlsIHRvIGNhc3QgaW50byBMaXN0W0FueV0BBWFzSW50AQN2YWwEByRtYXRjaDAFA3ZhbAMJAAECBQckbWF0Y2gwAgNJbnQEBnZhbEludAUHJG1hdGNoMAUGdmFsSW50CQACAQIVZmFpbCB0byBjYXN0IGludG8gSW50AQhhc1N0cmluZwEDdmFsBAckbWF0Y2gwBQN2YWwDCQABAgUHJG1hdGNoMAIGU3R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3MjgwNjcJARRyZWZyZXNoUG9vbElOVEVHUkFMUwMFDGxwQXNzZXRJZFN0cgUOcG9vbEFkZHJlc3NTdHIAAAQSd3hQZXJMcEludGVncmFsTmV3CAUNJHQwMjc5NTcyODA2NwJfMQQRcG9vbEludGVncmFsU1RBVEUIBQ0kdDAyNzk1NzI4MDY3Al8yBAlwb29sREVCVUcIBQ0kdDAyNzk1NzI4MDY3Al8zBRFwb29sSW50ZWdyYWxTVEFURQECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IEEW1pZ3JhdG9yUHVibGljS2V5BAckbWF0Y2gwCQEXbWlncmF0b3JQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXkGCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABRFtaWdyYXRvclB1YmxpY0tlea4bmFM=", "chainId": 84, "height": 2114679, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ELz9FeMZ1AavkUU5Grx8MGuVqH3KySp3KUov8LjHfy7U Next: 9puiTqag5FdcqPMpFLqKJ5uahNN2cj56tNBduaiiDYVS Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
12 | 12 | let SEP = "__" | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | + | ||
16 | + | let zeroBigInt = toBigInt(0) | |
17 | + | ||
18 | + | let oneBigInt = toBigInt(1) | |
15 | 19 | ||
16 | 20 | func asAnyList (val) = match val { | |
17 | 21 | case valAnyLyst: List[Any] => | |
45 | 49 | } | |
46 | 50 | ||
47 | 51 | ||
48 | - | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
52 | + | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
49 | 53 | ||
50 | 54 | ||
51 | 55 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
60 | 64 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
61 | 65 | ||
62 | 66 | ||
67 | + | func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0"))) | |
68 | + | ||
69 | + | ||
70 | + | func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) { | |
71 | + | case s: String => | |
72 | + | value(parseBigInt(s)) | |
73 | + | case _: Unit => | |
74 | + | defaultVal | |
75 | + | case _ => | |
76 | + | throw("Match error") | |
77 | + | } | |
78 | + | ||
79 | + | ||
63 | 80 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
64 | 81 | ||
65 | 82 | ||
67 | 84 | ||
68 | 85 | ||
69 | 86 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
87 | + | ||
88 | + | ||
89 | + | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
70 | 90 | ||
71 | 91 | ||
72 | 92 | let IdxFactoryCfgStakingDapp = 1 | |
87 | 107 | ||
88 | 108 | ||
89 | 109 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
110 | + | ||
111 | + | ||
112 | + | func keyMigratorPublicKey () = "%s__migratorPublicKey" | |
90 | 113 | ||
91 | 114 | ||
92 | 115 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
152 | 175 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
153 | 176 | ||
154 | 177 | ||
155 | - | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed | |
178 | + | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP) | |
156 | 179 | ||
157 | 180 | ||
158 | 181 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
206 | 229 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
207 | 230 | ||
208 | 231 | ||
209 | - | let factoryAddress = getStringOrFail(keyFactoryAddress()) | |
232 | + | let factoryAddress = getStringOrFail(this, keyFactoryAddress()) | |
210 | 233 | ||
211 | 234 | let factoryContract = addressFromStringValue(factoryAddress) | |
212 | 235 | ||
216 | 239 | ||
217 | 240 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
218 | 241 | ||
219 | - | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0)) | |
220 | - | then (stakedByUser > 0) | |
242 | + | func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP) | |
243 | + | ||
244 | + | ||
245 | + | func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP) | |
246 | + | ||
247 | + | ||
248 | + | func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP) | |
249 | + | ||
250 | + | ||
251 | + | func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP) | |
252 | + | ||
253 | + | ||
254 | + | func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP) | |
255 | + | ||
256 | + | ||
257 | + | func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP) | |
258 | + | ||
259 | + | ||
260 | + | func containsNode (listName,id) = { | |
261 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
262 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
263 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
264 | + | if (if ((id == valueOrElse(headOrUnit, ""))) | |
265 | + | then true | |
266 | + | else (prevOrUnit != unit)) | |
267 | + | then true | |
268 | + | else (nextOrUnit != unit) | |
269 | + | } | |
270 | + | ||
271 | + | ||
272 | + | func insertNodeActions (listName,id) = { | |
273 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
274 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
275 | + | let checkNode = if (!(containsNode(listName, id))) | |
276 | + | then true | |
277 | + | else throw("Node exists") | |
278 | + | if ((checkNode == checkNode)) | |
279 | + | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
280 | + | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
281 | + | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
282 | + | else throw("Strict value is not equal to itself.") | |
283 | + | } | |
284 | + | ||
285 | + | ||
286 | + | func deleteNodeActions (listName,id) = { | |
287 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
288 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
289 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
290 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
291 | + | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
292 | + | then (nextOrUnit != unit) | |
293 | + | else false) | |
294 | + | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
295 | + | else if ((nextOrUnit != unit)) | |
296 | + | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
297 | + | else if ((prevOrUnit != unit)) | |
298 | + | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
299 | + | else if ((id == valueOrElse(headOrUnit, ""))) | |
300 | + | then [DeleteEntry(keyListHead(listName))] | |
301 | + | else throw(((("invalid node: " + listName) + ".") + id)))) | |
302 | + | } | |
303 | + | ||
304 | + | ||
305 | + | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt)) | |
306 | + | then (stakedByUser > zeroBigInt) | |
221 | 307 | else false) | |
222 | - | then | |
223 | - | else if ((stakedByUser == | |
308 | + | then zeroBigInt | |
309 | + | else if ((stakedByUser == zeroBigInt)) | |
224 | 310 | then wxPerLpIntegralNew | |
225 | - | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > | |
226 | - | then (stakedByUser > | |
311 | + | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt)) | |
312 | + | then (stakedByUser > zeroBigInt) | |
227 | 313 | else false) | |
228 | - | then | |
314 | + | then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY))) | |
229 | 315 | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
230 | 316 | ||
231 | 317 | ||
232 | 318 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
233 | 319 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
234 | - | let stakedTotal = readStaked(stakedTotalKEY) | |
320 | + | let stakedTotal = toBigInt(readStaked(stakedTotalKEY)) | |
321 | + | let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt)) | |
322 | + | then oneBigInt | |
323 | + | else stakedTotal | |
235 | 324 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
236 | 325 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
237 | 326 | let MULT3 = 1000 | |
241 | 330 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
242 | 331 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
243 | 332 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
244 | - | let wxPerLpIntegral = | |
333 | + | let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY) | |
245 | 334 | let wxPerLpOrZeroX3 = 0 | |
246 | 335 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
247 | 336 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
248 | - | then wxPerLpOrZeroX3 | |
249 | - | else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
250 | - | let stakedTotalNew = (stakedTotal + lpDeltaAmount) | |
251 | - | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh)) | |
252 | - | let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew) | |
337 | + | then toBigInt(wxPerLpOrZeroX3) | |
338 | + | else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal) | |
339 | + | let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount)) | |
340 | + | let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt)) | |
341 | + | then oneBigInt | |
342 | + | else stakedTotalNew | |
343 | + | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh))) | |
344 | + | let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew) | |
253 | 345 | let wxPerLpIntegralLastUpdHeightNew = height | |
254 | - | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
255 | - | $Tuple3(wxPerLpIntegralNew, [ | |
346 | + | let debug = makeString(["wxPerLpIntegralNew=", toString(wxPerLpIntegralNew), "dh=", toString(dh), "wxPerLpX3=", toString(wxPerLpX3), "stakedTotal=", toString(stakedTotal), "poolWxEmissionPerBlockX3=", toString(poolWxEmissionPerBlockX3), "wxEmissionPerBlockX3=", toString(wxEmissionPerBlockX3), "poolWeight=", toString(poolWeight)], "::") | |
347 | + | $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug) | |
256 | 348 | } | |
257 | 349 | ||
258 | 350 | ||
259 | 351 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
260 | - | let $ | |
261 | - | let wxPerLpIntegralNew = $ | |
262 | - | let poolIntegralSTATE = $ | |
263 | - | let poolDEBUG = $ | |
352 | + | let $t01447314595 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
353 | + | let wxPerLpIntegralNew = $t01447314595._1 | |
354 | + | let poolIntegralSTATE = $t01447314595._2 | |
355 | + | let poolDEBUG = $t01447314595._3 | |
264 | 356 | let MULT3 = 1000 | |
265 | 357 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
266 | 358 | let stakedByUser = readStaked(stakedByUserKEY) | |
267 | 359 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
268 | 360 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
269 | 361 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
270 | - | let wxToClaimUser = | |
362 | + | let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY) | |
271 | 363 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
272 | - | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
273 | - | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3))) | |
364 | + | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
365 | + | let MULT11 = (MULT8 * MULT3) | |
366 | + | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))) | |
274 | 367 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
275 | 368 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
276 | - | let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
277 | - | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [ | |
369 | + | let debug = makeString(["wxPerLpIntegralUserLastUpdHeightOrZero=", toString(wxPerLpIntegralUserLastUpdHeightOrZero), "wxPerLpIntegralNew=", toString(wxPerLpIntegralNew), "wxToClaimUserNew=", toString(wxToClaimUserNew), "wxPerLpIntegralUserLast=", toString(wxPerLpIntegralUserLast), "stakedByUser=", toString(stakedByUser), "poolDEBUG=", poolDEBUG, "height=", toString(height)], "::") | |
370 | + | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug) | |
278 | 371 | } | |
279 | 372 | ||
280 | 373 | ||
281 | 374 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
375 | + | case s: String => | |
376 | + | fromBase58String(s) | |
377 | + | case _: Unit => | |
378 | + | unit | |
379 | + | case _ => | |
380 | + | throw("Match error") | |
381 | + | } | |
382 | + | ||
383 | + | ||
384 | + | func migratorPublicKeyOrUnit () = match getString(keyMigratorPublicKey()) { | |
282 | 385 | case s: String => | |
283 | 386 | fromBase58String(s) | |
284 | 387 | case _: Unit => | |
298 | 401 | } | |
299 | 402 | ||
300 | 403 | ||
301 | - | func mustManager (i) = { | |
302 | - | let pd = throw("Permission denied") | |
303 | - | match managerPublicKeyOrUnit() { | |
304 | - | case pk: ByteVector => | |
305 | - | if ((i.callerPublicKey == pk)) | |
306 | - | then true | |
307 | - | else pd | |
308 | - | case _: Unit => | |
309 | - | if ((i.caller == this)) | |
310 | - | then true | |
311 | - | else pd | |
312 | - | case _ => | |
313 | - | throw("Match error") | |
314 | - | } | |
315 | - | } | |
404 | + | let permissionDeniedError = throw("Permission denied") | |
405 | + | ||
406 | + | func mustThis (i) = if ((i.caller == this)) | |
407 | + | then true | |
408 | + | else permissionDeniedError | |
409 | + | ||
410 | + | ||
411 | + | func mustManager (i) = match managerPublicKeyOrUnit() { | |
412 | + | case pk: ByteVector => | |
413 | + | if ((i.callerPublicKey == pk)) | |
414 | + | then true | |
415 | + | else permissionDeniedError | |
416 | + | case _: Unit => | |
417 | + | if ((i.caller == this)) | |
418 | + | then true | |
419 | + | else permissionDeniedError | |
420 | + | case _ => | |
421 | + | throw("Match error") | |
422 | + | } | |
316 | 423 | ||
317 | 424 | ||
318 | 425 | @Callable(i) | |
320 | 427 | let checkCaller = mustManager(i) | |
321 | 428 | if ((checkCaller == checkCaller)) | |
322 | 429 | then [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
430 | + | else throw("Strict value is not equal to itself.") | |
431 | + | } | |
432 | + | ||
433 | + | ||
434 | + | ||
435 | + | @Callable(i) | |
436 | + | func constructorV2 (votingEmissionContract) = { | |
437 | + | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
438 | + | then true | |
439 | + | else "invalid voting emission contract address"] | |
440 | + | if ((cheks == cheks)) | |
441 | + | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)] | |
323 | 442 | else throw("Strict value is not equal to itself.") | |
324 | 443 | } | |
325 | 444 | ||
377 | 496 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
378 | 497 | let stakedByUser = readStaked(stakedByUserKEY) | |
379 | 498 | let stakedTotal = readStaked(stakedTotalKEY) | |
380 | - | let $t01427414391 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
381 | - | let wxToClaimUserNew = $t01427414391._1 | |
382 | - | let integralSTATE = $t01427414391._2 | |
383 | - | let debug = $t01427414391._3 | |
384 | - | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
499 | + | let $t01946419581 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
500 | + | let wxToClaimUserNew = $t01946419581._1 | |
501 | + | let integralSTATE = $t01946419581._2 | |
502 | + | let debug = $t01946419581._3 | |
503 | + | let listName = getUsersListName(lpAssetIdStr) | |
504 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
505 | + | then nil | |
506 | + | else insertNodeActions(listName, userAddressStr) | |
507 | + | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
385 | 508 | } | |
386 | 509 | ||
387 | 510 | ||
401 | 524 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
402 | 525 | let stakedByUser = readStaked(stakedByUserKEY) | |
403 | 526 | let stakedTotal = readStaked(stakedTotalKEY) | |
404 | - | let $t01552815646 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
405 | - | let wxToClaimUserNew = $t01552815646._1 | |
406 | - | let integralSTATE = $t01552815646._2 | |
407 | - | let debug = $t01552815646._3 | |
527 | + | let $t02091621034 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
528 | + | let wxToClaimUserNew = $t02091621034._1 | |
529 | + | let integralSTATE = $t02091621034._2 | |
530 | + | let debug = $t02091621034._3 | |
531 | + | let listName = getUsersListName(lpAssetIdStr) | |
532 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
533 | + | then deleteNodeActions(listName, userAddressStr) | |
534 | + | else nil | |
408 | 535 | if ((amount > stakedByUser)) | |
409 | 536 | then throw("passed amount is less then available") | |
410 | - | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
537 | + | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
411 | 538 | } | |
412 | 539 | ||
413 | 540 | ||
414 | 541 | ||
415 | 542 | @Callable(i) | |
416 | 543 | func claimWx (lpAssetIdStr) = { | |
417 | - | let userAddress = i.caller | |
418 | 544 | let userAddressStr = toString(i.caller) | |
419 | - | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
420 | - | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
421 | - | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
422 | - | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
423 | - | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
424 | - | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
425 | - | let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY) | |
426 | - | let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY) | |
427 | - | let claimedTotal = getIntOrZero(this, claimedTotalKEY) | |
428 | - | let $t01683816950 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
429 | - | let wxToClaimUserNew = $t01683816950._1 | |
430 | - | let integralSTATE = $t01683816950._2 | |
431 | - | let debug = $t01683816950._3 | |
432 | - | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
433 | - | if ((0 >= availableToClaim)) | |
434 | - | then throw("nothing to claim") | |
435 | - | else { | |
436 | - | let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]) | |
437 | - | let minRewardPart = availableToClaim | |
438 | - | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
439 | - | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0]) | |
440 | - | let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil)) | |
441 | - | if ((emitBoost == emitBoost)) | |
442 | - | 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)] | |
443 | - | else throw("Strict value is not equal to itself.") | |
545 | + | let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil) | |
546 | + | $Tuple2(nil, result) | |
547 | + | } | |
548 | + | ||
549 | + | ||
550 | + | ||
551 | + | @Callable(i) | |
552 | + | func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = { | |
553 | + | let checkCaller = mustThis(i) | |
554 | + | if ((checkCaller == checkCaller)) | |
555 | + | then { | |
556 | + | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address") | |
557 | + | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
558 | + | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
559 | + | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
560 | + | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
561 | + | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
562 | + | let claimedByUser = toBigInt(getIntOrZero(this, claimedByUserKEY)) | |
563 | + | let claimedByUserMinReward = toBigInt(getIntOrZero(this, claimedByUserMinRewardKEY)) | |
564 | + | let claimedByUserBoostReward = toBigInt(getIntOrZero(this, claimedByUserBoostRewardKEY)) | |
565 | + | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
566 | + | let $t02277622888 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
567 | + | let wxToClaimUserNew = $t02277622888._1 | |
568 | + | let integralSTATE = $t02277622888._2 | |
569 | + | let debug = $t02277622888._3 | |
570 | + | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
571 | + | if ((zeroBigInt >= availableToClaim)) | |
572 | + | then throw("nothing to claim") | |
573 | + | else { | |
574 | + | let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]) | |
575 | + | let minRewardPart = availableToClaim | |
576 | + | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
577 | + | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
578 | + | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
579 | + | if ((emitBoost == emitBoost)) | |
580 | + | then { | |
581 | + | let claimedByUserValue = (claimedByUser + availableToClaim) | |
582 | + | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
583 | + | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
584 | + | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
585 | + | [StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)] | |
586 | + | } | |
587 | + | else throw("Strict value is not equal to itself.") | |
588 | + | } | |
444 | 589 | } | |
590 | + | else throw("Strict value is not equal to itself.") | |
445 | 591 | } | |
446 | 592 | ||
447 | 593 | ||
463 | 609 | else (height - emissionStartBlock) | |
464 | 610 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
465 | 611 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
466 | - | let $ | |
467 | - | let wxToClaimUserNew = $ | |
468 | - | let integralSTATE = $ | |
469 | - | let debug = $ | |
470 | - | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
612 | + | let $t02548825600 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
613 | + | let wxToClaimUserNew = $t02548825600._1 | |
614 | + | let integralSTATE = $t02548825600._2 | |
615 | + | let debug = $t02548825600._3 | |
616 | + | let availableToClaim = (wxToClaimUserNew - toBigInt(claimedByUser)) | |
471 | 617 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
472 | 618 | let wxAmountBoostTotal = asInt(boostInvResult[0]) | |
473 | 619 | let boostDebug = asString(boostInvResult[1]) | |
474 | 620 | let minRewardPart = availableToClaim | |
475 | - | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
621 | + | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
476 | 622 | let totalReward = (minRewardPart + boostRewardPart) | |
477 | 623 | $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)) | |
624 | + | } | |
625 | + | ||
626 | + | ||
627 | + | ||
628 | + | @Callable(i) | |
629 | + | func usersListTraversal (lpAssetId) = { | |
630 | + | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
631 | + | then true | |
632 | + | else mustManager(i) | |
633 | + | if ((checkCaller == checkCaller)) | |
634 | + | then { | |
635 | + | let listName = getUsersListName(lpAssetId) | |
636 | + | let userOrUnit = getString(keyNextUser(lpAssetId)) | |
637 | + | let headOrUnit = getString(keyListHead(listName)) | |
638 | + | match userOrUnit { | |
639 | + | case _: Unit => | |
640 | + | match headOrUnit { | |
641 | + | case _: Unit => | |
642 | + | $Tuple2(nil, false) | |
643 | + | case head: String => | |
644 | + | $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true) | |
645 | + | case _ => | |
646 | + | throw("Match error") | |
647 | + | } | |
648 | + | case userAddress: String => | |
649 | + | let claimedByUser = getIntOrZero(this, keyClaimedByUser(lpAssetId, userAddress)) | |
650 | + | let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
651 | + | let $t02716927272 = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0) | |
652 | + | let wxToClaimUserNew = $t02716927272._1 | |
653 | + | let integralSTATE = $t02716927272._2 | |
654 | + | let debug = $t02716927272._3 | |
655 | + | let availableToClaim = (wxToClaimUserNew - toBigInt(claimedByUser)) | |
656 | + | let r = if ((availableToClaim > zeroBigInt)) | |
657 | + | then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil) | |
658 | + | else unit | |
659 | + | if ((r == r)) | |
660 | + | then { | |
661 | + | let nextUserOrUnit = getString(keyListNext(listName, userAddress)) | |
662 | + | match nextUserOrUnit { | |
663 | + | case _: Unit => | |
664 | + | $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false) | |
665 | + | case nextUser: String => | |
666 | + | $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true) | |
667 | + | case _ => | |
668 | + | throw("Match error") | |
669 | + | } | |
670 | + | } | |
671 | + | else throw("Strict value is not equal to itself.") | |
672 | + | case _ => | |
673 | + | throw("Match error") | |
674 | + | } | |
675 | + | } | |
676 | + | else throw("Strict value is not equal to itself.") | |
478 | 677 | } | |
479 | 678 | ||
480 | 679 | ||
483 | 682 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
484 | 683 | then throw("permissions denied") | |
485 | 684 | else { | |
486 | - | let $ | |
487 | - | let wxPerLpIntegralNew = $ | |
488 | - | let poolIntegralSTATE = $ | |
489 | - | let poolDEBUG = $ | |
685 | + | let $t02795728067 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
686 | + | let wxPerLpIntegralNew = $t02795728067._1 | |
687 | + | let poolIntegralSTATE = $t02795728067._2 | |
688 | + | let poolDEBUG = $t02795728067._3 | |
490 | 689 | poolIntegralSTATE | |
491 | 690 | } | |
492 | 691 | ||
501 | 700 | case _ => | |
502 | 701 | throw("Match error") | |
503 | 702 | } | |
504 | - | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
703 | + | let migratorPublicKey = match migratorPublicKeyOrUnit() { | |
704 | + | case pk: ByteVector => | |
705 | + | pk | |
706 | + | case _: Unit => | |
707 | + | tx.senderPublicKey | |
708 | + | case _ => | |
709 | + | throw("Match error") | |
710 | + | } | |
711 | + | if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)) | |
712 | + | then true | |
713 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], migratorPublicKey) | |
505 | 714 | } | |
506 | 715 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
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 | + | ||
16 | + | let zeroBigInt = toBigInt(0) | |
17 | + | ||
18 | + | let oneBigInt = toBigInt(1) | |
15 | 19 | ||
16 | 20 | func asAnyList (val) = match val { | |
17 | 21 | case valAnyLyst: List[Any] => | |
18 | 22 | valAnyLyst | |
19 | 23 | case _ => | |
20 | 24 | throw("fail to cast into List[Any]") | |
21 | 25 | } | |
22 | 26 | ||
23 | 27 | ||
24 | 28 | func asInt (val) = match val { | |
25 | 29 | case valInt: Int => | |
26 | 30 | valInt | |
27 | 31 | case _ => | |
28 | 32 | throw("fail to cast into Int") | |
29 | 33 | } | |
30 | 34 | ||
31 | 35 | ||
32 | 36 | func asString (val) = match val { | |
33 | 37 | case valStr: String => | |
34 | 38 | valStr | |
35 | 39 | case _ => | |
36 | 40 | throw("fail to cast into Int") | |
37 | 41 | } | |
38 | 42 | ||
39 | 43 | ||
40 | 44 | func asByteVector (val) = match val { | |
41 | 45 | case valBin: ByteVector => | |
42 | 46 | valBin | |
43 | 47 | case _ => | |
44 | 48 | throw("fail to cast into Int") | |
45 | 49 | } | |
46 | 50 | ||
47 | 51 | ||
48 | - | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
52 | + | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
49 | 53 | ||
50 | 54 | ||
51 | 55 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
52 | 56 | ||
53 | 57 | ||
54 | 58 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
55 | 59 | ||
56 | 60 | ||
57 | 61 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
58 | 62 | ||
59 | 63 | ||
60 | 64 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
61 | 65 | ||
62 | 66 | ||
67 | + | func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0"))) | |
68 | + | ||
69 | + | ||
70 | + | func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) { | |
71 | + | case s: String => | |
72 | + | value(parseBigInt(s)) | |
73 | + | case _: Unit => | |
74 | + | defaultVal | |
75 | + | case _ => | |
76 | + | throw("Match error") | |
77 | + | } | |
78 | + | ||
79 | + | ||
63 | 80 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
64 | 81 | ||
65 | 82 | ||
66 | 83 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
67 | 84 | ||
68 | 85 | ||
69 | 86 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
87 | + | ||
88 | + | ||
89 | + | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
70 | 90 | ||
71 | 91 | ||
72 | 92 | let IdxFactoryCfgStakingDapp = 1 | |
73 | 93 | ||
74 | 94 | let IdxFactoryCfgBoostingDapp = 2 | |
75 | 95 | ||
76 | 96 | let IdxFactoryCfgIdoDapp = 3 | |
77 | 97 | ||
78 | 98 | let IdxFactoryCfgTeamDapp = 4 | |
79 | 99 | ||
80 | 100 | let IdxFactoryCfgEmissionDapp = 5 | |
81 | 101 | ||
82 | 102 | let IdxFactoryCfgRestDapp = 6 | |
83 | 103 | ||
84 | 104 | let IdxFactoryCfgSlippageDapp = 7 | |
85 | 105 | ||
86 | 106 | func keyFactoryCfg () = "%s__factoryConfig" | |
87 | 107 | ||
88 | 108 | ||
89 | 109 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
110 | + | ||
111 | + | ||
112 | + | func keyMigratorPublicKey () = "%s__migratorPublicKey" | |
90 | 113 | ||
91 | 114 | ||
92 | 115 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
93 | 116 | ||
94 | 117 | ||
95 | 118 | func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr" | |
96 | 119 | ||
97 | 120 | ||
98 | 121 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
99 | 122 | ||
100 | 123 | ||
101 | 124 | func keyFactoryLpList () = "%s__lpTokensList" | |
102 | 125 | ||
103 | 126 | ||
104 | 127 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
105 | 128 | ||
106 | 129 | ||
107 | 130 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
108 | 131 | ||
109 | 132 | ||
110 | 133 | func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP) | |
111 | 134 | ||
112 | 135 | ||
113 | 136 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
114 | 137 | ||
115 | 138 | ||
116 | 139 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
117 | 140 | ||
118 | 141 | ||
119 | 142 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
120 | 143 | ||
121 | 144 | ||
122 | 145 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
123 | 146 | ||
124 | 147 | ||
125 | 148 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
126 | 149 | ||
127 | 150 | ||
128 | 151 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
129 | 152 | ||
130 | 153 | ||
131 | 154 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
132 | 155 | ||
133 | 156 | ||
134 | 157 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
135 | 158 | ||
136 | 159 | ||
137 | 160 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
138 | 161 | ||
139 | 162 | ||
140 | 163 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
141 | 164 | ||
142 | 165 | ||
143 | 166 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
144 | 167 | ||
145 | 168 | ||
146 | 169 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
147 | 170 | ||
148 | 171 | ||
149 | 172 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
150 | 173 | ||
151 | 174 | ||
152 | 175 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
153 | 176 | ||
154 | 177 | ||
155 | - | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed | |
178 | + | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP) | |
156 | 179 | ||
157 | 180 | ||
158 | 181 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
159 | 182 | ||
160 | 183 | ||
161 | 184 | func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP) | |
162 | 185 | ||
163 | 186 | ||
164 | 187 | func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP) | |
165 | 188 | ||
166 | 189 | ||
167 | 190 | func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP) | |
168 | 191 | ||
169 | 192 | ||
170 | 193 | func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP) | |
171 | 194 | ||
172 | 195 | ||
173 | 196 | func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP) | |
174 | 197 | ||
175 | 198 | ||
176 | 199 | func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP) | |
177 | 200 | ||
178 | 201 | ||
179 | 202 | func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP) | |
180 | 203 | ||
181 | 204 | ||
182 | 205 | func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP) | |
183 | 206 | ||
184 | 207 | ||
185 | 208 | func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP) | |
186 | 209 | ||
187 | 210 | ||
188 | 211 | func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP) | |
189 | 212 | ||
190 | 213 | ||
191 | 214 | func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP) | |
192 | 215 | ||
193 | 216 | ||
194 | 217 | func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP) | |
195 | 218 | ||
196 | 219 | ||
197 | 220 | func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP) | |
198 | 221 | ||
199 | 222 | ||
200 | 223 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
201 | 224 | ||
202 | 225 | ||
203 | 226 | func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP) | |
204 | 227 | ||
205 | 228 | ||
206 | 229 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
207 | 230 | ||
208 | 231 | ||
209 | - | let factoryAddress = getStringOrFail(keyFactoryAddress()) | |
232 | + | let factoryAddress = getStringOrFail(this, keyFactoryAddress()) | |
210 | 233 | ||
211 | 234 | let factoryContract = addressFromStringValue(factoryAddress) | |
212 | 235 | ||
213 | 236 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
214 | 237 | ||
215 | 238 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
216 | 239 | ||
217 | 240 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
218 | 241 | ||
219 | - | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0)) | |
220 | - | then (stakedByUser > 0) | |
242 | + | func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP) | |
243 | + | ||
244 | + | ||
245 | + | func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP) | |
246 | + | ||
247 | + | ||
248 | + | func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP) | |
249 | + | ||
250 | + | ||
251 | + | func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP) | |
252 | + | ||
253 | + | ||
254 | + | func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP) | |
255 | + | ||
256 | + | ||
257 | + | func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP) | |
258 | + | ||
259 | + | ||
260 | + | func containsNode (listName,id) = { | |
261 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
262 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
263 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
264 | + | if (if ((id == valueOrElse(headOrUnit, ""))) | |
265 | + | then true | |
266 | + | else (prevOrUnit != unit)) | |
267 | + | then true | |
268 | + | else (nextOrUnit != unit) | |
269 | + | } | |
270 | + | ||
271 | + | ||
272 | + | func insertNodeActions (listName,id) = { | |
273 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
274 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
275 | + | let checkNode = if (!(containsNode(listName, id))) | |
276 | + | then true | |
277 | + | else throw("Node exists") | |
278 | + | if ((checkNode == checkNode)) | |
279 | + | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
280 | + | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
281 | + | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
282 | + | else throw("Strict value is not equal to itself.") | |
283 | + | } | |
284 | + | ||
285 | + | ||
286 | + | func deleteNodeActions (listName,id) = { | |
287 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
288 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
289 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
290 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
291 | + | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
292 | + | then (nextOrUnit != unit) | |
293 | + | else false) | |
294 | + | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
295 | + | else if ((nextOrUnit != unit)) | |
296 | + | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
297 | + | else if ((prevOrUnit != unit)) | |
298 | + | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
299 | + | else if ((id == valueOrElse(headOrUnit, ""))) | |
300 | + | then [DeleteEntry(keyListHead(listName))] | |
301 | + | else throw(((("invalid node: " + listName) + ".") + id)))) | |
302 | + | } | |
303 | + | ||
304 | + | ||
305 | + | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt)) | |
306 | + | then (stakedByUser > zeroBigInt) | |
221 | 307 | else false) | |
222 | - | then | |
223 | - | else if ((stakedByUser == | |
308 | + | then zeroBigInt | |
309 | + | else if ((stakedByUser == zeroBigInt)) | |
224 | 310 | then wxPerLpIntegralNew | |
225 | - | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > | |
226 | - | then (stakedByUser > | |
311 | + | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt)) | |
312 | + | then (stakedByUser > zeroBigInt) | |
227 | 313 | else false) | |
228 | - | then | |
314 | + | then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY))) | |
229 | 315 | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
230 | 316 | ||
231 | 317 | ||
232 | 318 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
233 | 319 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
234 | - | let stakedTotal = readStaked(stakedTotalKEY) | |
320 | + | let stakedTotal = toBigInt(readStaked(stakedTotalKEY)) | |
321 | + | let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt)) | |
322 | + | then oneBigInt | |
323 | + | else stakedTotal | |
235 | 324 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
236 | 325 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
237 | 326 | let MULT3 = 1000 | |
238 | 327 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3) | |
239 | 328 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
240 | 329 | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
241 | 330 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
242 | 331 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
243 | 332 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
244 | - | let wxPerLpIntegral = | |
333 | + | let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY) | |
245 | 334 | let wxPerLpOrZeroX3 = 0 | |
246 | 335 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
247 | 336 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
248 | - | then wxPerLpOrZeroX3 | |
249 | - | else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
250 | - | let stakedTotalNew = (stakedTotal + lpDeltaAmount) | |
251 | - | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh)) | |
252 | - | let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew) | |
337 | + | then toBigInt(wxPerLpOrZeroX3) | |
338 | + | else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal) | |
339 | + | let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount)) | |
340 | + | let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt)) | |
341 | + | then oneBigInt | |
342 | + | else stakedTotalNew | |
343 | + | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh))) | |
344 | + | let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew) | |
253 | 345 | let wxPerLpIntegralLastUpdHeightNew = height | |
254 | - | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
255 | - | $Tuple3(wxPerLpIntegralNew, [ | |
346 | + | let debug = makeString(["wxPerLpIntegralNew=", toString(wxPerLpIntegralNew), "dh=", toString(dh), "wxPerLpX3=", toString(wxPerLpX3), "stakedTotal=", toString(stakedTotal), "poolWxEmissionPerBlockX3=", toString(poolWxEmissionPerBlockX3), "wxEmissionPerBlockX3=", toString(wxEmissionPerBlockX3), "poolWeight=", toString(poolWeight)], "::") | |
347 | + | $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug) | |
256 | 348 | } | |
257 | 349 | ||
258 | 350 | ||
259 | 351 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
260 | - | let $ | |
261 | - | let wxPerLpIntegralNew = $ | |
262 | - | let poolIntegralSTATE = $ | |
263 | - | let poolDEBUG = $ | |
352 | + | let $t01447314595 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
353 | + | let wxPerLpIntegralNew = $t01447314595._1 | |
354 | + | let poolIntegralSTATE = $t01447314595._2 | |
355 | + | let poolDEBUG = $t01447314595._3 | |
264 | 356 | let MULT3 = 1000 | |
265 | 357 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
266 | 358 | let stakedByUser = readStaked(stakedByUserKEY) | |
267 | 359 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
268 | 360 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
269 | 361 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
270 | - | let wxToClaimUser = | |
362 | + | let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY) | |
271 | 363 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
272 | - | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
273 | - | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3))) | |
364 | + | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
365 | + | let MULT11 = (MULT8 * MULT3) | |
366 | + | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))) | |
274 | 367 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
275 | 368 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
276 | - | let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
277 | - | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [ | |
369 | + | let debug = makeString(["wxPerLpIntegralUserLastUpdHeightOrZero=", toString(wxPerLpIntegralUserLastUpdHeightOrZero), "wxPerLpIntegralNew=", toString(wxPerLpIntegralNew), "wxToClaimUserNew=", toString(wxToClaimUserNew), "wxPerLpIntegralUserLast=", toString(wxPerLpIntegralUserLast), "stakedByUser=", toString(stakedByUser), "poolDEBUG=", poolDEBUG, "height=", toString(height)], "::") | |
370 | + | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug) | |
278 | 371 | } | |
279 | 372 | ||
280 | 373 | ||
281 | 374 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
375 | + | case s: String => | |
376 | + | fromBase58String(s) | |
377 | + | case _: Unit => | |
378 | + | unit | |
379 | + | case _ => | |
380 | + | throw("Match error") | |
381 | + | } | |
382 | + | ||
383 | + | ||
384 | + | func migratorPublicKeyOrUnit () = match getString(keyMigratorPublicKey()) { | |
282 | 385 | case s: String => | |
283 | 386 | fromBase58String(s) | |
284 | 387 | case _: Unit => | |
285 | 388 | unit | |
286 | 389 | case _ => | |
287 | 390 | throw("Match error") | |
288 | 391 | } | |
289 | 392 | ||
290 | 393 | ||
291 | 394 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
292 | 395 | case s: String => | |
293 | 396 | fromBase58String(s) | |
294 | 397 | case _: Unit => | |
295 | 398 | unit | |
296 | 399 | case _ => | |
297 | 400 | throw("Match error") | |
298 | 401 | } | |
299 | 402 | ||
300 | 403 | ||
301 | - | func mustManager (i) = { | |
302 | - | let pd = throw("Permission denied") | |
303 | - | match managerPublicKeyOrUnit() { | |
304 | - | case pk: ByteVector => | |
305 | - | if ((i.callerPublicKey == pk)) | |
306 | - | then true | |
307 | - | else pd | |
308 | - | case _: Unit => | |
309 | - | if ((i.caller == this)) | |
310 | - | then true | |
311 | - | else pd | |
312 | - | case _ => | |
313 | - | throw("Match error") | |
314 | - | } | |
315 | - | } | |
404 | + | let permissionDeniedError = throw("Permission denied") | |
405 | + | ||
406 | + | func mustThis (i) = if ((i.caller == this)) | |
407 | + | then true | |
408 | + | else permissionDeniedError | |
409 | + | ||
410 | + | ||
411 | + | func mustManager (i) = match managerPublicKeyOrUnit() { | |
412 | + | case pk: ByteVector => | |
413 | + | if ((i.callerPublicKey == pk)) | |
414 | + | then true | |
415 | + | else permissionDeniedError | |
416 | + | case _: Unit => | |
417 | + | if ((i.caller == this)) | |
418 | + | then true | |
419 | + | else permissionDeniedError | |
420 | + | case _ => | |
421 | + | throw("Match error") | |
422 | + | } | |
316 | 423 | ||
317 | 424 | ||
318 | 425 | @Callable(i) | |
319 | 426 | func constructor (factoryAddressStr) = { | |
320 | 427 | let checkCaller = mustManager(i) | |
321 | 428 | if ((checkCaller == checkCaller)) | |
322 | 429 | then [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
430 | + | else throw("Strict value is not equal to itself.") | |
431 | + | } | |
432 | + | ||
433 | + | ||
434 | + | ||
435 | + | @Callable(i) | |
436 | + | func constructorV2 (votingEmissionContract) = { | |
437 | + | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
438 | + | then true | |
439 | + | else "invalid voting emission contract address"] | |
440 | + | if ((cheks == cheks)) | |
441 | + | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)] | |
323 | 442 | else throw("Strict value is not equal to itself.") | |
324 | 443 | } | |
325 | 444 | ||
326 | 445 | ||
327 | 446 | ||
328 | 447 | @Callable(i) | |
329 | 448 | func setManager (pendingManagerPublicKey) = { | |
330 | 449 | let checkCaller = mustManager(i) | |
331 | 450 | if ((checkCaller == checkCaller)) | |
332 | 451 | then { | |
333 | 452 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
334 | 453 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
335 | 454 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
336 | 455 | else throw("Strict value is not equal to itself.") | |
337 | 456 | } | |
338 | 457 | else throw("Strict value is not equal to itself.") | |
339 | 458 | } | |
340 | 459 | ||
341 | 460 | ||
342 | 461 | ||
343 | 462 | @Callable(i) | |
344 | 463 | func confirmManager () = { | |
345 | 464 | let pm = pendingManagerPublicKeyOrUnit() | |
346 | 465 | let hasPM = if (isDefined(pm)) | |
347 | 466 | then true | |
348 | 467 | else throw("No pending manager") | |
349 | 468 | if ((hasPM == hasPM)) | |
350 | 469 | then { | |
351 | 470 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
352 | 471 | then true | |
353 | 472 | else throw("You are not pending manager") | |
354 | 473 | if ((checkPM == checkPM)) | |
355 | 474 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
356 | 475 | else throw("Strict value is not equal to itself.") | |
357 | 476 | } | |
358 | 477 | else throw("Strict value is not equal to itself.") | |
359 | 478 | } | |
360 | 479 | ||
361 | 480 | ||
362 | 481 | ||
363 | 482 | @Callable(i) | |
364 | 483 | func stake () = if ((size(i.payments) != 1)) | |
365 | 484 | then throw("invalid payment - exact one payment must be attached") | |
366 | 485 | else { | |
367 | 486 | let pmt = i.payments[0] | |
368 | 487 | let lpAssetId = value(pmt.assetId) | |
369 | 488 | let lpAssetIdStr = toBase58String(lpAssetId) | |
370 | 489 | let amount = pmt.amount | |
371 | 490 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
372 | 491 | let callerStr = toString(i.caller) | |
373 | 492 | let userAddressStr = if ((callerStr == poolAddressStr)) | |
374 | 493 | then toString(i.originCaller) | |
375 | 494 | else callerStr | |
376 | 495 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
377 | 496 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
378 | 497 | let stakedByUser = readStaked(stakedByUserKEY) | |
379 | 498 | let stakedTotal = readStaked(stakedTotalKEY) | |
380 | - | let $t01427414391 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
381 | - | let wxToClaimUserNew = $t01427414391._1 | |
382 | - | let integralSTATE = $t01427414391._2 | |
383 | - | let debug = $t01427414391._3 | |
384 | - | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
499 | + | let $t01946419581 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
500 | + | let wxToClaimUserNew = $t01946419581._1 | |
501 | + | let integralSTATE = $t01946419581._2 | |
502 | + | let debug = $t01946419581._3 | |
503 | + | let listName = getUsersListName(lpAssetIdStr) | |
504 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
505 | + | then nil | |
506 | + | else insertNodeActions(listName, userAddressStr) | |
507 | + | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
385 | 508 | } | |
386 | 509 | ||
387 | 510 | ||
388 | 511 | ||
389 | 512 | @Callable(i) | |
390 | 513 | func unstake (lpAssetIdStr,amount) = { | |
391 | 514 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
392 | 515 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
393 | 516 | let poolAddon = valueOrElse(getString(this, keyStablePoolAddonAddr()), poolAddressStr) | |
394 | 517 | let callerStr = toString(i.caller) | |
395 | 518 | let userAddressStr = if (if ((callerStr == poolAddressStr)) | |
396 | 519 | then true | |
397 | 520 | else (callerStr == poolAddon)) | |
398 | 521 | then toString(i.originCaller) | |
399 | 522 | else callerStr | |
400 | 523 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
401 | 524 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
402 | 525 | let stakedByUser = readStaked(stakedByUserKEY) | |
403 | 526 | let stakedTotal = readStaked(stakedTotalKEY) | |
404 | - | let $t01552815646 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
405 | - | let wxToClaimUserNew = $t01552815646._1 | |
406 | - | let integralSTATE = $t01552815646._2 | |
407 | - | let debug = $t01552815646._3 | |
527 | + | let $t02091621034 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
528 | + | let wxToClaimUserNew = $t02091621034._1 | |
529 | + | let integralSTATE = $t02091621034._2 | |
530 | + | let debug = $t02091621034._3 | |
531 | + | let listName = getUsersListName(lpAssetIdStr) | |
532 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
533 | + | then deleteNodeActions(listName, userAddressStr) | |
534 | + | else nil | |
408 | 535 | if ((amount > stakedByUser)) | |
409 | 536 | then throw("passed amount is less then available") | |
410 | - | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
537 | + | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
411 | 538 | } | |
412 | 539 | ||
413 | 540 | ||
414 | 541 | ||
415 | 542 | @Callable(i) | |
416 | 543 | func claimWx (lpAssetIdStr) = { | |
417 | - | let userAddress = i.caller | |
418 | 544 | let userAddressStr = toString(i.caller) | |
419 | - | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
420 | - | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
421 | - | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
422 | - | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
423 | - | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
424 | - | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
425 | - | let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY) | |
426 | - | let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY) | |
427 | - | let claimedTotal = getIntOrZero(this, claimedTotalKEY) | |
428 | - | let $t01683816950 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
429 | - | let wxToClaimUserNew = $t01683816950._1 | |
430 | - | let integralSTATE = $t01683816950._2 | |
431 | - | let debug = $t01683816950._3 | |
432 | - | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
433 | - | if ((0 >= availableToClaim)) | |
434 | - | then throw("nothing to claim") | |
435 | - | else { | |
436 | - | let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]) | |
437 | - | let minRewardPart = availableToClaim | |
438 | - | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
439 | - | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0]) | |
440 | - | let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil)) | |
441 | - | if ((emitBoost == emitBoost)) | |
442 | - | 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)] | |
443 | - | else throw("Strict value is not equal to itself.") | |
545 | + | let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil) | |
546 | + | $Tuple2(nil, result) | |
547 | + | } | |
548 | + | ||
549 | + | ||
550 | + | ||
551 | + | @Callable(i) | |
552 | + | func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = { | |
553 | + | let checkCaller = mustThis(i) | |
554 | + | if ((checkCaller == checkCaller)) | |
555 | + | then { | |
556 | + | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address") | |
557 | + | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
558 | + | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
559 | + | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
560 | + | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
561 | + | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
562 | + | let claimedByUser = toBigInt(getIntOrZero(this, claimedByUserKEY)) | |
563 | + | let claimedByUserMinReward = toBigInt(getIntOrZero(this, claimedByUserMinRewardKEY)) | |
564 | + | let claimedByUserBoostReward = toBigInt(getIntOrZero(this, claimedByUserBoostRewardKEY)) | |
565 | + | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
566 | + | let $t02277622888 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
567 | + | let wxToClaimUserNew = $t02277622888._1 | |
568 | + | let integralSTATE = $t02277622888._2 | |
569 | + | let debug = $t02277622888._3 | |
570 | + | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
571 | + | if ((zeroBigInt >= availableToClaim)) | |
572 | + | then throw("nothing to claim") | |
573 | + | else { | |
574 | + | let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]) | |
575 | + | let minRewardPart = availableToClaim | |
576 | + | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
577 | + | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
578 | + | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
579 | + | if ((emitBoost == emitBoost)) | |
580 | + | then { | |
581 | + | let claimedByUserValue = (claimedByUser + availableToClaim) | |
582 | + | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
583 | + | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
584 | + | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
585 | + | [StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)] | |
586 | + | } | |
587 | + | else throw("Strict value is not equal to itself.") | |
588 | + | } | |
444 | 589 | } | |
590 | + | else throw("Strict value is not equal to itself.") | |
445 | 591 | } | |
446 | 592 | ||
447 | 593 | ||
448 | 594 | ||
449 | 595 | @Callable(i) | |
450 | 596 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
451 | 597 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
452 | 598 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
453 | 599 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
454 | 600 | let stakedByUser = readStaked(stakedByUserKEY) | |
455 | 601 | let stakedTotal = readStaked(stakedTotalKEY) | |
456 | 602 | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
457 | 603 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
458 | 604 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
459 | 605 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
460 | 606 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
461 | 607 | let passedBlocks = if ((emissionStartBlock > height)) | |
462 | 608 | then 0 | |
463 | 609 | else (height - emissionStartBlock) | |
464 | 610 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
465 | 611 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
466 | - | let $ | |
467 | - | let wxToClaimUserNew = $ | |
468 | - | let integralSTATE = $ | |
469 | - | let debug = $ | |
470 | - | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
612 | + | let $t02548825600 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
613 | + | let wxToClaimUserNew = $t02548825600._1 | |
614 | + | let integralSTATE = $t02548825600._2 | |
615 | + | let debug = $t02548825600._3 | |
616 | + | let availableToClaim = (wxToClaimUserNew - toBigInt(claimedByUser)) | |
471 | 617 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
472 | 618 | let wxAmountBoostTotal = asInt(boostInvResult[0]) | |
473 | 619 | let boostDebug = asString(boostInvResult[1]) | |
474 | 620 | let minRewardPart = availableToClaim | |
475 | - | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
621 | + | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
476 | 622 | let totalReward = (minRewardPart + boostRewardPart) | |
477 | 623 | $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)) | |
624 | + | } | |
625 | + | ||
626 | + | ||
627 | + | ||
628 | + | @Callable(i) | |
629 | + | func usersListTraversal (lpAssetId) = { | |
630 | + | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
631 | + | then true | |
632 | + | else mustManager(i) | |
633 | + | if ((checkCaller == checkCaller)) | |
634 | + | then { | |
635 | + | let listName = getUsersListName(lpAssetId) | |
636 | + | let userOrUnit = getString(keyNextUser(lpAssetId)) | |
637 | + | let headOrUnit = getString(keyListHead(listName)) | |
638 | + | match userOrUnit { | |
639 | + | case _: Unit => | |
640 | + | match headOrUnit { | |
641 | + | case _: Unit => | |
642 | + | $Tuple2(nil, false) | |
643 | + | case head: String => | |
644 | + | $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true) | |
645 | + | case _ => | |
646 | + | throw("Match error") | |
647 | + | } | |
648 | + | case userAddress: String => | |
649 | + | let claimedByUser = getIntOrZero(this, keyClaimedByUser(lpAssetId, userAddress)) | |
650 | + | let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
651 | + | let $t02716927272 = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0) | |
652 | + | let wxToClaimUserNew = $t02716927272._1 | |
653 | + | let integralSTATE = $t02716927272._2 | |
654 | + | let debug = $t02716927272._3 | |
655 | + | let availableToClaim = (wxToClaimUserNew - toBigInt(claimedByUser)) | |
656 | + | let r = if ((availableToClaim > zeroBigInt)) | |
657 | + | then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil) | |
658 | + | else unit | |
659 | + | if ((r == r)) | |
660 | + | then { | |
661 | + | let nextUserOrUnit = getString(keyListNext(listName, userAddress)) | |
662 | + | match nextUserOrUnit { | |
663 | + | case _: Unit => | |
664 | + | $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false) | |
665 | + | case nextUser: String => | |
666 | + | $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true) | |
667 | + | case _ => | |
668 | + | throw("Match error") | |
669 | + | } | |
670 | + | } | |
671 | + | else throw("Strict value is not equal to itself.") | |
672 | + | case _ => | |
673 | + | throw("Match error") | |
674 | + | } | |
675 | + | } | |
676 | + | else throw("Strict value is not equal to itself.") | |
478 | 677 | } | |
479 | 678 | ||
480 | 679 | ||
481 | 680 | ||
482 | 681 | @Callable(i) | |
483 | 682 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
484 | 683 | then throw("permissions denied") | |
485 | 684 | else { | |
486 | - | let $ | |
487 | - | let wxPerLpIntegralNew = $ | |
488 | - | let poolIntegralSTATE = $ | |
489 | - | let poolDEBUG = $ | |
685 | + | let $t02795728067 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
686 | + | let wxPerLpIntegralNew = $t02795728067._1 | |
687 | + | let poolIntegralSTATE = $t02795728067._2 | |
688 | + | let poolDEBUG = $t02795728067._3 | |
490 | 689 | poolIntegralSTATE | |
491 | 690 | } | |
492 | 691 | ||
493 | 692 | ||
494 | 693 | @Verifier(tx) | |
495 | 694 | func verify () = { | |
496 | 695 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
497 | 696 | case pk: ByteVector => | |
498 | 697 | pk | |
499 | 698 | case _: Unit => | |
500 | 699 | tx.senderPublicKey | |
501 | 700 | case _ => | |
502 | 701 | throw("Match error") | |
503 | 702 | } | |
504 | - | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
703 | + | let migratorPublicKey = match migratorPublicKeyOrUnit() { | |
704 | + | case pk: ByteVector => | |
705 | + | pk | |
706 | + | case _: Unit => | |
707 | + | tx.senderPublicKey | |
708 | + | case _ => | |
709 | + | throw("Match error") | |
710 | + | } | |
711 | + | if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)) | |
712 | + | then true | |
713 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], migratorPublicKey) | |
505 | 714 | } | |
506 | 715 |
github/deemru/w8io/169f3d6 119.56 ms ◑