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