tx · Du2mjeg5WpWkPHtoyE48gCkWH6WuCmiJybTTRcU4BvNY 3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn: -0.02400000 Waves 2023.08.28 11:36 [2730290] smart account 3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn > SELF 0.00000000 Waves
{ "type": 13, "id": "Du2mjeg5WpWkPHtoyE48gCkWH6WuCmiJybTTRcU4BvNY", "fee": 2400000, "feeAssetId": null, "timestamp": 1693211804067, "version": 2, "chainId": 84, "sender": "3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn", "senderPublicKey": "Fj9LPkCtmW3pDnVU6wPQnvqpZJCBieWSvZqY5FAGeCyp", "proofs": [ "41PsBwQ1saBBWDZVviBs38BsTg3rkZx9FrHcFGifKBsf9Eq3mx9Bzp3s7kPjFrBwvwkBrQe5uFy9cynF1XuLteAi", "2WhWuBDnkczKrFQQJiiSqJLUsaF2vctVPiPhrLz7GZEPd5pmGcJJkcgvYn1LqLmnXABNVappV7z8GbbiQTkh9jzU" ], "script": "base64:BgIhCAISABIAEgQKAggIEgMKAQgSBwoFCAgIAQESAwoBCBIAUAAGU0NBTEU4AIDC1y8AC0xFTkRFUlNfQVBSCQDMCAIAlgEJAMwIAgB4CQDMCAIAZAkAzAgCAFAJAMwIAgA8CQDMCAIAKAkAzAgCAB4JAMwIAgAUCQDMCAIACgUDbmlsABNMRU5ERVJTX0FQUl9QRVJJT0RTCQDMCAICAzEtMQkAzAgCAgMyLTIJAMwIAgIDMy0zCQDMCAICAzQtNAkAzAgCAgM1LTgJAMwIAgIEOS0xMgkAzAgCAgUxNC0xNgkAzAgCAgUxNy0yMAkAzAgCAgYyMC0xMDQFA25pbAATTEVOREVSU19NQVhfUEVSSU9EUwBoAAZMUF9BUFIJAMwIAgCWAQkAzAgCAHgJAMwIAgBkCQDMCAIAUAkAzAgCADwJAMwIAgAoBQNuaWwADkxQX0FQUl9QRVJJT0RTCQDMCAICAzEtMQkAzAgCAgMyLTIJAMwIAgID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AAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUIYWRtaW4zUEsAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBANpbnYFByRtYXRjaDAEBmlzU2VsZgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQKaXNSaWdodEZlZQMJAAACCAUDaW52A2ZlZQCg9zYJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHBAppc0luaXRDYWxsCQAAAggFA2ludghmdW5jdGlvbgIEaW5pdAQMaXNub1BheW1lbnRzCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAADAwMDBQppc1JpZ2h0RmVlBQppc0luaXRDYWxsBwUGaXNTZWxmBwUMaXNub1BheW1lbnRzBwYFE211bHRpU2lnbmVkQnlBZG1pbnMFE211bHRpU2lnbmVkQnlBZG1pbnNd363n", "height": 2730290, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FPKLWkgy6Zyj2uXph7GjFcrdZcyNFMGewQVs8tPsYURU Next: none Diff:
Old | New | Differences | |
---|---|---|---|
432 | 432 | ||
433 | 433 | @Callable(i) | |
434 | 434 | func lendAction (user,tokenId) = valueOrElse(isLandCall(i), { | |
435 | - | let userAvailableClaim = valueOrElse(getInteger(this, (tokenId + kUserLendAvailableClaim)), 0) | |
436 | - | let $ | |
437 | - | let uReward = $ | |
438 | - | let newTokenInterest = $ | |
435 | + | let userAvailableClaim = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendAvailableClaim)), 0) | |
436 | + | let $t01241212479 = calcLendUserReward(user, tokenId) | |
437 | + | let uReward = $t01241212479._1 | |
438 | + | let newTokenInterest = $t01241212479._2 | |
439 | 439 | [IntegerEntry((((tokenId + "_") + user) + kUserLendInterest), newTokenInterest), IntegerEntry((((tokenId + "_") + user) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)] | |
440 | 440 | }) | |
441 | 441 | ||
443 | 443 | ||
444 | 444 | @Callable(i) | |
445 | 445 | func lpAction (user) = valueOrElse(isSFFarmingCall(i), { | |
446 | - | let userAvailableClaim = valueOrElse(getInteger(this, kUserLpAvailableClaim), 0) | |
447 | - | let $ | |
448 | - | let uReward = $ | |
449 | - | let newLpInterest = $ | |
446 | + | let userAvailableClaim = valueOrElse(getInteger(this, (user + kUserLpAvailableClaim)), 0) | |
447 | + | let $t01295113004 = calcLpUserReward(user) | |
448 | + | let uReward = $t01295113004._1 | |
449 | + | let newLpInterest = $t01295113004._2 | |
450 | 450 | [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry(kLpInterest, newLpInterest), IntegerEntry(kLpInterestHeight, height)] | |
451 | 451 | }) | |
452 | 452 | ||
487 | 487 | else false) | |
488 | 488 | then throw("rewards alredy updated in this period") | |
489 | 489 | else { | |
490 | - | let $ | |
491 | - | let totalSupply = $ | |
492 | - | let totalSupplyUsd = $ | |
493 | - | let totalSupplyUsdAll = $ | |
490 | + | let $t01494815028 = getTotalSupplyAllTokens() | |
491 | + | let totalSupply = $t01494815028._1 | |
492 | + | let totalSupplyUsd = $t01494815028._2 | |
493 | + | let totalSupplyUsdAll = $t01494815028._3 | |
494 | 494 | let axlyPrice = getAssetPrice(axlyId) | |
495 | 495 | let axlyPrecision = getAssetPrecision(axlyId) | |
496 | 496 | let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR) | |
497 | 497 | func updateReward (a,tokenId) = { | |
498 | - | let $ | |
499 | - | let enteries = $ | |
500 | - | let totalPeriodReward = $ | |
501 | - | let index = $ | |
498 | + | let $t01527715321 = a | |
499 | + | let enteries = $t01527715321._1 | |
500 | + | let totalPeriodReward = $t01527715321._2 | |
501 | + | let index = $t01527715321._3 | |
502 | 502 | if ((totalSupply[index] == 0)) | |
503 | 503 | then $Tuple3((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), totalPeriodReward, (index + 1)) | |
504 | 504 | else { | |
519 | 519 | } | |
520 | 520 | } | |
521 | 521 | ||
522 | - | let $ | |
522 | + | let $t01701317105 = { | |
523 | 523 | let $l = getAllTokens() | |
524 | 524 | let $s = size($l) | |
525 | 525 | let $acc0 = $Tuple3(nil, 0, 0) | |
533 | 533 | ||
534 | 534 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
535 | 535 | } | |
536 | - | let tokensEnteries = $ | |
537 | - | let totalTokenReward = $ | |
536 | + | let tokensEnteries = $t01701317105._1 | |
537 | + | let totalTokenReward = $t01701317105._2 | |
538 | 538 | let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR) | |
539 | 539 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
540 | 540 | let preLPSupply = valueOrElse(getInteger(this, kPrevLPSupply), 0) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 100000000 | |
5 | 5 | ||
6 | 6 | let LENDERS_APR = [150, 120, 100, 80, 60, 40, 30, 20, 10] | |
7 | 7 | ||
8 | 8 | let LENDERS_APR_PERIODS = ["1-1", "2-2", "3-3", "4-4", "5-8", "9-12", "14-16", "17-20", "20-104"] | |
9 | 9 | ||
10 | 10 | let LENDERS_MAX_PERIODS = 104 | |
11 | 11 | ||
12 | 12 | let LP_APR = [150, 120, 100, 80, 60, 40] | |
13 | 13 | ||
14 | 14 | let LP_APR_PERIODS = ["1-1", "2-2", "3-3", "4-4", "5-8", "9-12"] | |
15 | 15 | ||
16 | 16 | let LP_MAX_PERIODS = 12 | |
17 | 17 | ||
18 | 18 | let kStartHeight = "startHeight" | |
19 | 19 | ||
20 | 20 | let kPeriodLength = "periodLength" | |
21 | 21 | ||
22 | 22 | let kLendersMaxAmount = "lendRewardsAmount" | |
23 | 23 | ||
24 | 24 | let kLPMaxAmount = "lpRewardAmount" | |
25 | 25 | ||
26 | 26 | let kTokens = "tokens" | |
27 | 27 | ||
28 | 28 | let kUserSupply = "_userTotalSupply" | |
29 | 29 | ||
30 | 30 | let kTokenInterest = "_tokenInterest" | |
31 | 31 | ||
32 | 32 | let kTokenInterestHeight = "_tokenInterestHeight" | |
33 | 33 | ||
34 | 34 | let kTokenRewardPerBlock = "_tokenRewardPerBlock" | |
35 | 35 | ||
36 | 36 | let kLastUpdatePeriod = "rewardUpdatePeriod" | |
37 | 37 | ||
38 | 38 | let kUserLendInterest = "_userLandInterest" | |
39 | 39 | ||
40 | 40 | let kUserLendAvailableClaim = "_userLendAvailableClaim" | |
41 | 41 | ||
42 | 42 | let kUserLpAvailableClaim = "_userLpAvailableClaim" | |
43 | 43 | ||
44 | 44 | let kLpInterest = "lpInterest" | |
45 | 45 | ||
46 | 46 | let kLpInterestHeight = "lpInterestHeight" | |
47 | 47 | ||
48 | 48 | let kPrevLPSupply = "prevLPTotalSupply" | |
49 | 49 | ||
50 | 50 | let kLpRewardPerBlock = "lpRewardPerBlock" | |
51 | 51 | ||
52 | 52 | let kUserLpInterest = "_userLpInterest" | |
53 | 53 | ||
54 | 54 | let kPriceInOracle = "_twap5B" | |
55 | 55 | ||
56 | 56 | let kPrevLendTokenSupply = "_prevLendTotalSupply" | |
57 | 57 | ||
58 | 58 | let kAXLYTokenId = "axlyTokenId" | |
59 | 59 | ||
60 | 60 | let kLendTokenSupply = "total_supplied_" | |
61 | 61 | ||
62 | 62 | let kLendUserSupply = "_supplied_" | |
63 | 63 | ||
64 | 64 | let kLendSetupTokens = "setup_tokens" | |
65 | 65 | ||
66 | 66 | let kSFTotalSupply = "_total_share_tokens_locked" | |
67 | 67 | ||
68 | 68 | let kSFUserTotalSupply = "_share_tokens_locked" | |
69 | 69 | ||
70 | 70 | let kAxlyPool = "axlyPool" | |
71 | 71 | ||
72 | 72 | let kLpId = "share_asset_id" | |
73 | 73 | ||
74 | 74 | let kPriceOracle = "price_oracle" | |
75 | 75 | ||
76 | 76 | let kAxlyMainContract = "mainContract" | |
77 | 77 | ||
78 | 78 | let kAxlyTokenomicContract = "tokenomicContract" | |
79 | 79 | ||
80 | 80 | let kSFFarmingContract = "swopfi_farming_addr" | |
81 | 81 | ||
82 | 82 | let kLendContract = "lend_service_addr" | |
83 | 83 | ||
84 | 84 | let kAdmin1PK = "group1_admin1_pub_key" | |
85 | 85 | ||
86 | 86 | let kAdmin2PK = "group1_admin2_pub_key" | |
87 | 87 | ||
88 | 88 | let kAdmin3PK = "group1_admin3_pub_key" | |
89 | 89 | ||
90 | 90 | let kOperatorCallPK = "admin_call_pub_key" | |
91 | 91 | ||
92 | 92 | let axlyPool = valueOrErrorMessage(getString(this, kAxlyPool), "Can't get axlyPool key") | |
93 | 93 | ||
94 | 94 | let mainContract = addressFromStringValue(valueOrErrorMessage(getString(this, kAxlyMainContract), "Can't get mainContact key")) | |
95 | 95 | ||
96 | 96 | let tokenContract = addressFromStringValue(valueOrErrorMessage(getString(this, kAxlyTokenomicContract), "Can't get tokenomicContract key")) | |
97 | 97 | ||
98 | 98 | let lendContract = addressFromStringValue(valueOrErrorMessage(getString(mainContract, kLendContract), "Can't get lend_service_addr key")) | |
99 | 99 | ||
100 | 100 | let sfFarmingContract = addressFromStringValue(valueOrErrorMessage(getString(mainContract, kSFFarmingContract), "Can't get swopfi_farming_addr key")) | |
101 | 101 | ||
102 | 102 | let priceOracleAddr = addressFromStringValue(valueOrErrorMessage(getString(mainContract, kPriceOracle), "Can't get price_oracle key")) | |
103 | 103 | ||
104 | 104 | let admin1PK = fromBase58String(valueOrErrorMessage(getString(mainContract, kAdmin1PK), "Can't get admin1PK")) | |
105 | 105 | ||
106 | 106 | let admin2PK = fromBase58String(valueOrErrorMessage(getString(mainContract, kAdmin2PK), "Can't get admin2PK")) | |
107 | 107 | ||
108 | 108 | let admin3PK = fromBase58String(valueOrErrorMessage(getString(mainContract, kAdmin3PK), "Can't get operatorPK")) | |
109 | 109 | ||
110 | 110 | let operatorPK = fromBase58String(valueOrErrorMessage(getString(this, kOperatorCallPK), "Can't get operatorPK")) | |
111 | 111 | ||
112 | 112 | let axlyId = valueOrErrorMessage(getString(tokenContract, kAXLYTokenId), "Can't get Axly token id") | |
113 | 113 | ||
114 | 114 | let startHeight = getIntegerValue(this, kStartHeight) | |
115 | 115 | ||
116 | 116 | let periodLength = getIntegerValue(this, kPeriodLength) | |
117 | 117 | ||
118 | 118 | let lendMaxAmount = getIntegerValue(tokenContract, kLendersMaxAmount) | |
119 | 119 | ||
120 | 120 | let lendMaxPeriodAmount = (lendMaxAmount / LENDERS_MAX_PERIODS) | |
121 | 121 | ||
122 | 122 | let lpMaxAmount = getIntegerValue(tokenContract, kLPMaxAmount) | |
123 | 123 | ||
124 | 124 | let lpMaxPeriodAmount = (lpMaxAmount / LP_MAX_PERIODS) | |
125 | 125 | ||
126 | 126 | func isAdminCall (i) = if (containsElement([admin1PK, admin2PK, admin3PK], i.callerPublicKey)) | |
127 | 127 | then unit | |
128 | 128 | else throw("Only admin group1 can call this function") | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func isSelfCall (i) = if ((i.caller == this)) | |
132 | 132 | then unit | |
133 | 133 | else throw("Only contract itself can call this function") | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func isOperatorCall (i) = if ((i.callerPublicKey == operatorPK)) | |
137 | 137 | then unit | |
138 | 138 | else throw("Only operator can call this function") | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func isLandCall (i) = if ((i.caller == lendContract)) | |
142 | 142 | then unit | |
143 | 143 | else throw("Only land contract can call this function") | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func isSFFarmingCall (i) = if ((i.caller == sfFarmingContract)) | |
147 | 147 | then unit | |
148 | 148 | else throw("Only land contract can call this function") | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getAllTokens () = { | |
152 | 152 | let tokens = valueOrElse(getString(this, kTokens), "") | |
153 | 153 | if ((tokens == "")) | |
154 | 154 | then nil | |
155 | 155 | else split(tokens, ",") | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func getAssetPrice (assetId) = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
163 | 163 | then 8 | |
164 | 164 | else match assetInfo(fromBase58String(assetId)) { | |
165 | 165 | case asset: Asset => | |
166 | 166 | asset.decimals | |
167 | 167 | case _ => | |
168 | 168 | throw("Can't find asset") | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func getAssetPrecision (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN) | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func getAdoptedAPRByPeriod (period,aprPeriods,apr) = { | |
176 | 176 | func for (a,aperiod) = { | |
177 | 177 | let $t053625384 = a | |
178 | 178 | let index = $t053625384._1 | |
179 | 179 | let found = $t053625384._2 | |
180 | 180 | let ft = split(aperiod, "-") | |
181 | 181 | let $t054215484 = $Tuple2(parseIntValue(ft[0]), parseIntValue(ft[1])) | |
182 | 182 | let from = $t054215484._1 | |
183 | 183 | let to = $t054215484._2 | |
184 | 184 | if (found) | |
185 | 185 | then a | |
186 | 186 | else if (if ((period >= from)) | |
187 | 187 | then (to >= period) | |
188 | 188 | else false) | |
189 | 189 | then $Tuple2(index, true) | |
190 | 190 | else $Tuple2((index + 1), false) | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | let $t056215687 = { | |
194 | 194 | let $l = LENDERS_APR_PERIODS | |
195 | 195 | let $s = size($l) | |
196 | 196 | let $acc0 = $Tuple2(0, false) | |
197 | 197 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
198 | 198 | then $a | |
199 | 199 | else for($a, $l[$i]) | |
200 | 200 | ||
201 | 201 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
202 | 202 | then $a | |
203 | 203 | else throw("List size exceeds 9") | |
204 | 204 | ||
205 | 205 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
206 | 206 | } | |
207 | 207 | let index = $t056215687._1 | |
208 | 208 | let found = $t056215687._2 | |
209 | 209 | if (found) | |
210 | 210 | then fraction((LENDERS_APR[index] * SCALE8), 7, 365) | |
211 | 211 | else 0 | |
212 | 212 | } | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func getTotalSupplyAllTokens () = { | |
216 | 216 | func for (a,tokenId) = { | |
217 | 217 | let $t058755931 = a | |
218 | 218 | let totalSupply = $t058755931._1 | |
219 | 219 | let totalSupplyUsd = $t058755931._2 | |
220 | 220 | let totalSupplyUsdAll = $t058755931._3 | |
221 | 221 | let tSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0) | |
222 | 222 | let assetPrice = getAssetPrice(tokenId) | |
223 | 223 | let assetPrecision = getAssetPrecision(tokenId) | |
224 | 224 | let tSupplyUsd = fraction(tSupply, assetPrice, assetPrecision) | |
225 | 225 | $Tuple3((totalSupply :+ tSupply), (totalSupplyUsd :+ tSupplyUsd), (totalSupplyUsdAll + tSupplyUsd)) | |
226 | 226 | } | |
227 | 227 | ||
228 | 228 | let $l = getAllTokens() | |
229 | 229 | let $s = size($l) | |
230 | 230 | let $acc0 = $Tuple3(nil, nil, 0) | |
231 | 231 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
232 | 232 | then $a | |
233 | 233 | else for($a, $l[$i]) | |
234 | 234 | ||
235 | 235 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
236 | 236 | then $a | |
237 | 237 | else throw("List size exceeds 30") | |
238 | 238 | ||
239 | 239 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
240 | 240 | } | |
241 | 241 | ||
242 | 242 | ||
243 | 243 | func getTotalSupplyUsd (tokenId) = { | |
244 | 244 | let tSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0) | |
245 | 245 | let assetPrice = getAssetPrice(tokenId) | |
246 | 246 | let assetPrecision = getAssetPrecision(tokenId) | |
247 | 247 | fraction(tSupply, assetPrice, assetPrecision) | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func calcNewTokenInterest (tokenId,totalSupply) = if ((startHeight >= height)) | |
252 | 252 | then 0 | |
253 | 253 | else { | |
254 | 254 | let rewardPerBlock = getIntegerValue(this, (tokenId + kTokenRewardPerBlock)) | |
255 | 255 | let oldInterest = getIntegerValue(this, (tokenId + kTokenInterest)) | |
256 | 256 | let updateHeight = getIntegerValue(this, (tokenId + kTokenInterestHeight)) | |
257 | 257 | let reward = ((height - updateHeight) * rewardPerBlock) | |
258 | 258 | let interest = if ((totalSupply > 0)) | |
259 | 259 | then fraction(reward, SCALE8, totalSupply) | |
260 | 260 | else 0 | |
261 | 261 | (oldInterest + interest) | |
262 | 262 | } | |
263 | 263 | ||
264 | 264 | ||
265 | 265 | func calcNewLpInterest (totalSupply) = if ((startHeight >= height)) | |
266 | 266 | then 0 | |
267 | 267 | else { | |
268 | 268 | let rewardPerBlock = valueOrElse(getInteger(this, kLpRewardPerBlock), 0) | |
269 | 269 | let oldInterest = valueOrElse(getInteger(this, kLpInterest), 0) | |
270 | 270 | let updateHeight = valueOrElse(getInteger(this, kLpInterestHeight), height) | |
271 | 271 | let reward = ((height - updateHeight) * rewardPerBlock) | |
272 | 272 | let interest = if ((totalSupply > 0)) | |
273 | 273 | then fraction(reward, SCALE8, totalSupply) | |
274 | 274 | else 0 | |
275 | 275 | (oldInterest + interest) | |
276 | 276 | } | |
277 | 277 | ||
278 | 278 | ||
279 | 279 | func calcLendUserReward (user,tokenId) = { | |
280 | 280 | let totalSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0) | |
281 | 281 | let tokenInterest = calcNewTokenInterest(tokenId, totalSupply) | |
282 | 282 | let userSupply = valueOrElse(getInteger(lendContract, ((user + kLendUserSupply) + tokenId)), 0) | |
283 | 283 | let userTokenInterest = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendInterest)), if ((userSupply == 0)) | |
284 | 284 | then tokenInterest | |
285 | 285 | else 0) | |
286 | 286 | let reward = fraction(userSupply, (tokenInterest - userTokenInterest), SCALE8) | |
287 | 287 | $Tuple3(reward, tokenInterest, userSupply) | |
288 | 288 | } | |
289 | 289 | ||
290 | 290 | ||
291 | 291 | func calcLpUserReward (user) = { | |
292 | 292 | let totalSupply = valueOrElse(getInteger(sfFarmingContract, (axlyPool + kSFTotalSupply)), 0) | |
293 | 293 | let tokenInterest = calcNewLpInterest(totalSupply) | |
294 | 294 | let userSupply = valueOrElse(getInteger(sfFarmingContract, (((axlyPool + "_") + user) + kSFUserTotalSupply)), 0) | |
295 | 295 | let userTokenInterest = valueOrElse(getInteger(this, (user + kUserLpInterest)), if ((userSupply == 0)) | |
296 | 296 | then tokenInterest | |
297 | 297 | else 0) | |
298 | 298 | let reward = fraction(userSupply, (tokenInterest - userTokenInterest), SCALE8) | |
299 | 299 | $Tuple3(reward, tokenInterest, userSupply) | |
300 | 300 | } | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | func claimLenderRewardsCommon (user,readOnly) = { | |
304 | 304 | func claim (a,tokenId) = { | |
305 | 305 | let $t088208864 = a | |
306 | 306 | let tokenIds = $t088208864._1 | |
307 | 307 | let cAmount = $t088208864._2 | |
308 | 308 | let total = $t088208864._3 | |
309 | 309 | let enteries = $t088208864._4 | |
310 | 310 | let userAvailableClaim = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendAvailableClaim)), 0) | |
311 | 311 | let $t089779056 = calcLendUserReward(user, tokenId) | |
312 | 312 | let uReward = $t089779056._1 | |
313 | 313 | let newTokenInterest = $t089779056._2 | |
314 | 314 | let userSupply = $t089779056._3 | |
315 | 315 | let totalToClaim = (userAvailableClaim + uReward) | |
316 | 316 | if (if ((totalToClaim > 0)) | |
317 | 317 | then true | |
318 | 318 | else (userSupply > 0)) | |
319 | 319 | then { | |
320 | 320 | let newEntreries = if (if (readOnly) | |
321 | 321 | then true | |
322 | 322 | else (totalToClaim == 0)) | |
323 | 323 | then enteries | |
324 | 324 | else (enteries ++ [IntegerEntry((((tokenId + "_") + user) + kUserLendInterest), newTokenInterest), IntegerEntry((((tokenId + "_") + user) + kUserLendAvailableClaim), 0), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)]) | |
325 | 325 | $Tuple4((tokenIds :+ tokenId), (cAmount :+ totalToClaim), (total + totalToClaim), newEntreries) | |
326 | 326 | } | |
327 | 327 | else $Tuple4(tokenIds, cAmount, total, enteries) | |
328 | 328 | } | |
329 | 329 | ||
330 | 330 | let $l = getAllTokens() | |
331 | 331 | let $s = size($l) | |
332 | 332 | let $acc0 = $Tuple4(nil, nil, 0, nil) | |
333 | 333 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
334 | 334 | then $a | |
335 | 335 | else claim($a, $l[$i]) | |
336 | 336 | ||
337 | 337 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
338 | 338 | then $a | |
339 | 339 | else throw("List size exceeds 30") | |
340 | 340 | ||
341 | 341 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
342 | 342 | } | |
343 | 343 | ||
344 | 344 | ||
345 | 345 | func claimLpRewardsCommon (user,readOnly) = { | |
346 | 346 | let userAvailableClaim = valueOrElse(getInteger(this, (user + kUserLpAvailableClaim)), 0) | |
347 | 347 | let $t0998710052 = calcLpUserReward(user) | |
348 | 348 | let uReward = $t0998710052._1 | |
349 | 349 | let newLpInterest = $t0998710052._2 | |
350 | 350 | let userSupply = $t0998710052._3 | |
351 | 351 | let totalToClaim = (userAvailableClaim + uReward) | |
352 | 352 | if (if (readOnly) | |
353 | 353 | then true | |
354 | 354 | else (totalToClaim == 0)) | |
355 | 355 | then $Tuple2(totalToClaim, nil) | |
356 | 356 | else $Tuple2(totalToClaim, [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), 0), IntegerEntry(kLpInterest, newLpInterest), IntegerEntry(kLpInterestHeight, height)]) | |
357 | 357 | } | |
358 | 358 | ||
359 | 359 | ||
360 | 360 | func getTokensAPRs () = { | |
361 | 361 | let axlyPrice = getAssetPrice(axlyId) | |
362 | 362 | let axlyPrecision = getAssetPrecision(axlyId) | |
363 | 363 | func tokensAprs (apr,tokenId) = { | |
364 | 364 | let rwpb = valueOrElse(getInteger(this, (tokenId + kTokenRewardPerBlock)), 0) | |
365 | 365 | let rwpbUsd = fraction(rwpb, axlyPrice, axlyPrecision) | |
366 | 366 | let rwYear = ((rwpbUsd * periodLength) * 52) | |
367 | 367 | let totalSupplyUsd = getTotalSupplyUsd(tokenId) | |
368 | 368 | (apr :+ fraction(rwYear, SCALE8, totalSupplyUsd)) | |
369 | 369 | } | |
370 | 370 | ||
371 | 371 | let aprs = { | |
372 | 372 | let $l = getAllTokens() | |
373 | 373 | let $s = size($l) | |
374 | 374 | let $acc0 = nil | |
375 | 375 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
376 | 376 | then $a | |
377 | 377 | else tokensAprs($a, $l[$i]) | |
378 | 378 | ||
379 | 379 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
380 | 380 | then $a | |
381 | 381 | else throw("List size exceeds 30") | |
382 | 382 | ||
383 | 383 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
384 | 384 | } | |
385 | 385 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
386 | 386 | let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId) | |
387 | 387 | let lpPrecision = getAssetPrecision(lpId) | |
388 | 388 | let lpPrice = { | |
389 | 389 | let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [lpId], nil) | |
390 | 390 | if ($isInstanceOf(@, "Int")) | |
391 | 391 | then @ | |
392 | 392 | else throw(($getType(@) + " couldn't be cast to Int")) | |
393 | 393 | } | |
394 | 394 | let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision) | |
395 | 395 | let rwpb = valueOrElse(getInteger(this, kLpRewardPerBlock), 0) | |
396 | 396 | let rwpbUsd = fraction(rwpb, axlyPrice, axlyPrecision) | |
397 | 397 | let rwYear = ((rwpbUsd * periodLength) * 52) | |
398 | 398 | let lpApr = fraction(rwYear, SCALE8, lpTotalSupplyUsd) | |
399 | 399 | $Tuple3(getAllTokens(), aprs, lpApr) | |
400 | 400 | } | |
401 | 401 | ||
402 | 402 | ||
403 | 403 | @Callable(i) | |
404 | 404 | func claimLenderRewards () = { | |
405 | 405 | let claimRes = claimLenderRewardsCommon(toString(i.caller), false) | |
406 | 406 | if ((claimRes._3 == 0)) | |
407 | 407 | then throw("claim amount must be greater than 0") | |
408 | 408 | else { | |
409 | 409 | let inv = invoke(tokenContract, "withdrawLendReward", [claimRes._3, toString(i.caller)], nil) | |
410 | 410 | if ((inv == inv)) | |
411 | 411 | then claimRes._4 | |
412 | 412 | else throw("Strict value is not equal to itself.") | |
413 | 413 | } | |
414 | 414 | } | |
415 | 415 | ||
416 | 416 | ||
417 | 417 | ||
418 | 418 | @Callable(i) | |
419 | 419 | func claimLpRewards () = { | |
420 | 420 | let claimRes = claimLpRewardsCommon(toString(i.caller), false) | |
421 | 421 | if ((claimRes._1 == 0)) | |
422 | 422 | then throw("claim amount must be greater than 0") | |
423 | 423 | else { | |
424 | 424 | let inv = invoke(tokenContract, "withdrawLpReward", [claimRes._1, toString(i.caller)], nil) | |
425 | 425 | if ((inv == inv)) | |
426 | 426 | then claimRes._2 | |
427 | 427 | else throw("Strict value is not equal to itself.") | |
428 | 428 | } | |
429 | 429 | } | |
430 | 430 | ||
431 | 431 | ||
432 | 432 | ||
433 | 433 | @Callable(i) | |
434 | 434 | func lendAction (user,tokenId) = valueOrElse(isLandCall(i), { | |
435 | - | let userAvailableClaim = valueOrElse(getInteger(this, (tokenId + kUserLendAvailableClaim)), 0) | |
436 | - | let $ | |
437 | - | let uReward = $ | |
438 | - | let newTokenInterest = $ | |
435 | + | let userAvailableClaim = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendAvailableClaim)), 0) | |
436 | + | let $t01241212479 = calcLendUserReward(user, tokenId) | |
437 | + | let uReward = $t01241212479._1 | |
438 | + | let newTokenInterest = $t01241212479._2 | |
439 | 439 | [IntegerEntry((((tokenId + "_") + user) + kUserLendInterest), newTokenInterest), IntegerEntry((((tokenId + "_") + user) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)] | |
440 | 440 | }) | |
441 | 441 | ||
442 | 442 | ||
443 | 443 | ||
444 | 444 | @Callable(i) | |
445 | 445 | func lpAction (user) = valueOrElse(isSFFarmingCall(i), { | |
446 | - | let userAvailableClaim = valueOrElse(getInteger(this, kUserLpAvailableClaim), 0) | |
447 | - | let $ | |
448 | - | let uReward = $ | |
449 | - | let newLpInterest = $ | |
446 | + | let userAvailableClaim = valueOrElse(getInteger(this, (user + kUserLpAvailableClaim)), 0) | |
447 | + | let $t01295113004 = calcLpUserReward(user) | |
448 | + | let uReward = $t01295113004._1 | |
449 | + | let newLpInterest = $t01295113004._2 | |
450 | 450 | [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry(kLpInterest, newLpInterest), IntegerEntry(kLpInterestHeight, height)] | |
451 | 451 | }) | |
452 | 452 | ||
453 | 453 | ||
454 | 454 | ||
455 | 455 | @Callable(i) | |
456 | 456 | func init (axlyMainContractAddr,axlyTokenomicContractAddr,axlyPoolAddr,farmingStartHeight,periodLength) = valueOrElse(isSelfCall(i), if (!(isDefined(addressFromString(axlyMainContractAddr)))) | |
457 | 457 | then throw("Wrong farming address") | |
458 | 458 | else if (!(isDefined(addressFromString(axlyTokenomicContractAddr)))) | |
459 | 459 | then throw("Wrong main contract address") | |
460 | 460 | else [StringEntry(kAxlyMainContract, axlyMainContractAddr), StringEntry(kAxlyTokenomicContract, axlyTokenomicContractAddr), StringEntry(kAxlyPool, axlyPoolAddr), IntegerEntry(kStartHeight, farmingStartHeight), IntegerEntry(kPeriodLength, periodLength)]) | |
461 | 461 | ||
462 | 462 | ||
463 | 463 | ||
464 | 464 | @Callable(i) | |
465 | 465 | func initNewToken (tokenId) = valueOrElse(isAdminCall(i), if (isDefined(getInteger(this, (tokenId + kTokenInterest)))) | |
466 | 466 | then throw("token already inited") | |
467 | 467 | else if (!(contains(getStringValue(lendContract, kLendSetupTokens), tokenId))) | |
468 | 468 | then throw("no token on landing") | |
469 | 469 | else { | |
470 | 470 | let newAllTokens = (getAllTokens() :+ tokenId) | |
471 | 471 | [IntegerEntry((tokenId + kTokenInterest), 0), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height])), StringEntry(kTokens, makeString(newAllTokens, ",")), IntegerEntry((tokenId + kTokenRewardPerBlock), 0)] | |
472 | 472 | }) | |
473 | 473 | ||
474 | 474 | ||
475 | 475 | ||
476 | 476 | @Callable(i) | |
477 | 477 | func updateRewards () = valueOrElse(isOperatorCall(i), { | |
478 | 478 | let lastUpdatePeriod = valueOrElse(getInteger(this, kLastUpdatePeriod), 0) | |
479 | 479 | let calcPeriod = (((height - startHeight) / periodLength) + 1) | |
480 | 480 | let curPeriod = if ((0 >= calcPeriod)) | |
481 | 481 | then 1 | |
482 | 482 | else calcPeriod | |
483 | 483 | if ((curPeriod > 104)) | |
484 | 484 | then throw("max period is 104") | |
485 | 485 | else if (if ((lastUpdatePeriod >= curPeriod)) | |
486 | 486 | then (lastUpdatePeriod != 0) | |
487 | 487 | else false) | |
488 | 488 | then throw("rewards alredy updated in this period") | |
489 | 489 | else { | |
490 | - | let $ | |
491 | - | let totalSupply = $ | |
492 | - | let totalSupplyUsd = $ | |
493 | - | let totalSupplyUsdAll = $ | |
490 | + | let $t01494815028 = getTotalSupplyAllTokens() | |
491 | + | let totalSupply = $t01494815028._1 | |
492 | + | let totalSupplyUsd = $t01494815028._2 | |
493 | + | let totalSupplyUsdAll = $t01494815028._3 | |
494 | 494 | let axlyPrice = getAssetPrice(axlyId) | |
495 | 495 | let axlyPrecision = getAssetPrecision(axlyId) | |
496 | 496 | let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR) | |
497 | 497 | func updateReward (a,tokenId) = { | |
498 | - | let $ | |
499 | - | let enteries = $ | |
500 | - | let totalPeriodReward = $ | |
501 | - | let index = $ | |
498 | + | let $t01527715321 = a | |
499 | + | let enteries = $t01527715321._1 | |
500 | + | let totalPeriodReward = $t01527715321._2 | |
501 | + | let index = $t01527715321._3 | |
502 | 502 | if ((totalSupply[index] == 0)) | |
503 | 503 | then $Tuple3((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), totalPeriodReward, (index + 1)) | |
504 | 504 | else { | |
505 | 505 | let share = fraction(totalSupplyUsd[index], SCALE8, totalSupplyUsdAll) | |
506 | 506 | let maxReward = fraction(share, lendMaxPeriodAmount, SCALE8) | |
507 | 507 | let maxRewardUsd = fraction(maxReward, axlyPrice, axlyPrecision) | |
508 | 508 | let prevTotalSupply = valueOrElse(getInteger(this, (tokenId + kPrevLendTokenSupply)), 0) | |
509 | 509 | let rtCoef = if (if ((prevTotalSupply == 0)) | |
510 | 510 | then true | |
511 | 511 | else (totalSupply[index] == 0)) | |
512 | 512 | then 0 | |
513 | 513 | else (fraction(totalSupply[index], SCALE8, prevTotalSupply) - SCALE8) | |
514 | 514 | let reward = ((min([(maxAPR * (SCALE8 + max([rtCoef, 0]))), fraction(maxAPR, (15 * SCALE8), 10)]) / SCALE8) / 100) | |
515 | 515 | let rewardUsd = min([maxRewardUsd, fraction(totalSupplyUsd[index], reward, SCALE8)]) | |
516 | 516 | let rewardPeriod = fraction(rewardUsd, axlyPrecision, axlyPrice) | |
517 | 517 | let rewardPerBlock = (rewardPeriod / periodLength) | |
518 | 518 | $Tuple3((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), rewardPerBlock), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), max([startHeight, height]))]), (totalPeriodReward + rewardPeriod), (index + 1)) | |
519 | 519 | } | |
520 | 520 | } | |
521 | 521 | ||
522 | - | let $ | |
522 | + | let $t01701317105 = { | |
523 | 523 | let $l = getAllTokens() | |
524 | 524 | let $s = size($l) | |
525 | 525 | let $acc0 = $Tuple3(nil, 0, 0) | |
526 | 526 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
527 | 527 | then $a | |
528 | 528 | else updateReward($a, $l[$i]) | |
529 | 529 | ||
530 | 530 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
531 | 531 | then $a | |
532 | 532 | else throw("List size exceeds 30") | |
533 | 533 | ||
534 | 534 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
535 | 535 | } | |
536 | - | let tokensEnteries = $ | |
537 | - | let totalTokenReward = $ | |
536 | + | let tokensEnteries = $t01701317105._1 | |
537 | + | let totalTokenReward = $t01701317105._2 | |
538 | 538 | let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR) | |
539 | 539 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
540 | 540 | let preLPSupply = valueOrElse(getInteger(this, kPrevLPSupply), 0) | |
541 | 541 | let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId) | |
542 | 542 | let lpPrecision = getAssetPrecision(lpId) | |
543 | 543 | let lpPrice = { | |
544 | 544 | let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [lpId], nil) | |
545 | 545 | if ($isInstanceOf(@, "Int")) | |
546 | 546 | then @ | |
547 | 547 | else throw(($getType(@) + " couldn't be cast to Int")) | |
548 | 548 | } | |
549 | 549 | let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision) | |
550 | 550 | let maxLPRewardUsd = fraction(lpMaxPeriodAmount, axlyPrice, axlyPrecision) | |
551 | 551 | let rtLPCoef = if (if ((preLPSupply == 0)) | |
552 | 552 | then true | |
553 | 553 | else (lpTotalSupply == 0)) | |
554 | 554 | then 0 | |
555 | 555 | else (fraction(lpTotalSupply, SCALE8, preLPSupply) - SCALE8) | |
556 | 556 | let rewardLp = ((min([(lpMaxAPR * (SCALE8 + max([rtLPCoef, 0]))), fraction(lpMaxAPR, (15 * SCALE8), 10)]) / SCALE8) / 100) | |
557 | 557 | let rewardLpUsd = min([maxLPRewardUsd, fraction(lpTotalSupplyUsd, rewardLp, SCALE8)]) | |
558 | 558 | let rewardLpPeriod = fraction(rewardLpUsd, axlyPrecision, axlyPrice) | |
559 | 559 | let rewardLpPerBlock = (rewardLpPeriod / periodLength) | |
560 | 560 | let burnLend = (lendMaxPeriodAmount - totalTokenReward) | |
561 | 561 | let burnLp = (lpMaxPeriodAmount - rewardLpPeriod) | |
562 | 562 | let inv = invoke(tokenContract, "withdrawLpReward", [(burnLend + burnLp), toString(this)], nil) | |
563 | 563 | if ((inv == inv)) | |
564 | 564 | then { | |
565 | 565 | let lpEnteries = if ((12 >= curPeriod)) | |
566 | 566 | then [IntegerEntry(kPrevLPSupply, lpTotalSupply), IntegerEntry(kLpRewardPerBlock, rewardLpPerBlock), IntegerEntry(kLpInterest, calcNewLpInterest(lpTotalSupply)), IntegerEntry(kLpInterestHeight, max([startHeight, height])), ScriptTransfer(Address(base58'3MsXJ3BesPECkYejzBQGHZPJT8GVYy4Fd3Q'), burnLend, fromBase58String(axlyId)), ScriptTransfer(Address(base58'3MsXJ3BesPECkYejzBQGHZPJT8GVYy4Fd3Q'), burnLp, fromBase58String(axlyId))] | |
567 | 567 | else nil | |
568 | 568 | ((lpEnteries ++ tokensEnteries) :+ IntegerEntry(kLastUpdatePeriod, curPeriod)) | |
569 | 569 | } | |
570 | 570 | else throw("Strict value is not equal to itself.") | |
571 | 571 | } | |
572 | 572 | }) | |
573 | 573 | ||
574 | 574 | ||
575 | 575 | @Verifier(tx) | |
576 | 576 | func verify () = { | |
577 | 577 | let multiSignedByAdmins = { | |
578 | 578 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK)) | |
579 | 579 | then 1 | |
580 | 580 | else 0 | |
581 | 581 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK)) | |
582 | 582 | then 1 | |
583 | 583 | else 0 | |
584 | 584 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK)) | |
585 | 585 | then 1 | |
586 | 586 | else 0 | |
587 | 587 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
588 | 588 | } | |
589 | 589 | match tx { | |
590 | 590 | case inv: InvokeScriptTransaction => | |
591 | 591 | let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
592 | 592 | let isRightFee = if ((inv.fee == 900000)) | |
593 | 593 | then (inv.feeAssetId == unit) | |
594 | 594 | else false | |
595 | 595 | let isInitCall = (inv.function == "init") | |
596 | 596 | let isnoPayments = (size(inv.payments) == 0) | |
597 | 597 | if (if (if (if (isRightFee) | |
598 | 598 | then isInitCall | |
599 | 599 | else false) | |
600 | 600 | then isSelf | |
601 | 601 | else false) | |
602 | 602 | then isnoPayments | |
603 | 603 | else false) | |
604 | 604 | then true | |
605 | 605 | else multiSignedByAdmins | |
606 | 606 | case _ => | |
607 | 607 | multiSignedByAdmins | |
608 | 608 | } | |
609 | 609 | } | |
610 | 610 |
github/deemru/w8io/169f3d6 74.47 ms ◑