tx · HsgABABQU9j6fhArukcLfhNuoyVrenxUQj7cujjbtTob 3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn: -0.02300000 Waves 2023.08.17 14:12 [2714518] smart account 3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn > SELF 0.00000000 Waves
{ "type": 13, "id": "HsgABABQU9j6fhArukcLfhNuoyVrenxUQj7cujjbtTob", "fee": 2300000, "feeAssetId": null, "timestamp": 1692270807059, "version": 2, "chainId": 84, "sender": "3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn", "senderPublicKey": "Fj9LPkCtmW3pDnVU6wPQnvqpZJCBieWSvZqY5FAGeCyp", "proofs": [ "5bpyryTAPVPHo8Y4JNzgHeN8QfYQCfJVJ3zv4ZUP7AeXKYa7bGnStEEbSBNWkJ9GxbxRrr8MfhuqjJkcCJTrcYja", "SdheJ1HZX49xWSPjiGWmS1BXFjLzofZjBRZB1Sgfgzm7jaK6qsdt5kzmSoqPwp7FVxfrz2ifqAer7rvjUgAJELN" ], "script": "base64:BgIhCAISABIAEgQKAggIEgMKAQgSBwoFCAgIAQESAwoBCBIAUQAGU0NBTEU4AIDC1y8AC0xFTkRFUlNfQVBSCQDMCAIAlgEJAMwIAgB4CQDMCAIAZAkAzAgCAFAJAMwIAgA8CQDMCAIAKAkAzAgCAB4JAMwIAgAUCQDMCAIACgUDbmlsABNMRU5ERVJTX0FQUl9QRVJJT0RTCQDMCAICAzEtMQkAzAgCAgMyLTIJAMwIAgIDMy0zCQDMCAICAzQtNAkAzAgCAgM1LTgJAMwIAgIEOS0xMgkAzAgCAgcxNCAtIDE2CQDMCAICBTE3LTIwCQDMCAICBjIwLTEwNAUDbmlsABNMRU5ERVJTX01BWF9QRVJJT0RTAGgABkxQX0FQUgkAzAgCAJYBCQDMCAIAeAkAzAgCAGQJAMwIAgBQCQDMCAIAPAkAzAgCACgFA25pbAAOTFBfQVBSX1BFUklPRFMJAMwIAgIDMS0xCQDMCAICAzItMgkAzAgCAgMzLTM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qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BAppc1JpZ2h0RmVlAwkAAAIIBQNpbnYDZmVlAKD3NgkAAAIIBQNpbnYKZmVlQXNzZXRJZAUEdW5pdAcECmlzSW5pdENhbGwJAAACCAUDaW52CGZ1bmN0aW9uAgRpbml0BAxpc25vUGF5bWVudHMJAAACCQCQAwEIBQNpbnYIcGF5bWVudHMAAAMDAwMFCmlzUmlnaHRGZWUFCmlzSW5pdENhbGwHBQZpc1NlbGYHBQxpc25vUGF5bWVudHMHBgUTbXVsdGlTaWduZWRCeUFkbWlucwUTbXVsdGlTaWduZWRCeUFkbWlucxwhBdU=", "height": 2714518, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8qRLHzPe2YAh37ehvXAD1Tte7ywnJK2j27zR5fiQDMkg Next: AaJfjphPicUsARKyY6bVziu4JTwjbb2GnxMq7op9RaDu Diff:
Old | New | Differences | |
---|---|---|---|
244 | 244 | } | |
245 | 245 | ||
246 | 246 | ||
247 | - | func calcNewTokenInterest (tokenId,totalSupply) = { | |
248 | - | let rewardPerBlock = getIntegerValue(this, (tokenId + kTokenRewardPerBlock)) | |
249 | - | let oldInterest = getIntegerValue(this, (tokenId + kTokenInterest)) | |
250 | - | let updateHeight = getIntegerValue(this, (tokenId + kTokenInterestHeight)) | |
251 | - | let reward = ((height - updateHeight) * rewardPerBlock) | |
252 | - | let interest = if ((totalSupply > 0)) | |
253 | - | then fraction(reward, SCALE8, totalSupply) | |
254 | - | else 0 | |
255 | - | (oldInterest + interest) | |
256 | - | } | |
247 | + | func calcNewTokenInterest (tokenId,totalSupply) = if ((height >= startHeight)) | |
248 | + | then 0 | |
249 | + | else { | |
250 | + | let rewardPerBlock = getIntegerValue(this, (tokenId + kTokenRewardPerBlock)) | |
251 | + | let oldInterest = getIntegerValue(this, (tokenId + kTokenInterest)) | |
252 | + | let updateHeight = getIntegerValue(this, (tokenId + kTokenInterestHeight)) | |
253 | + | let reward = ((height - updateHeight) * rewardPerBlock) | |
254 | + | let interest = if ((totalSupply > 0)) | |
255 | + | then fraction(reward, SCALE8, totalSupply) | |
256 | + | else 0 | |
257 | + | (oldInterest + interest) | |
258 | + | } | |
257 | 259 | ||
258 | 260 | ||
259 | - | func calcNewLpInterest (totalSupply) = { | |
260 | - | let rewardPerBlock = getIntegerValue(this, kLpRewardPerBlock) | |
261 | - | let oldInterest = getIntegerValue(this, kLpInterest) | |
262 | - | let updateHeight = getIntegerValue(this, kLpInterestHeight) | |
263 | - | let reward = ((height - updateHeight) * rewardPerBlock) | |
264 | - | let interest = if ((totalSupply > 0)) | |
265 | - | then fraction(reward, SCALE8, totalSupply) | |
266 | - | else 0 | |
267 | - | (oldInterest + interest) | |
268 | - | } | |
261 | + | func calcNewLpInterest (totalSupply) = if ((height >= startHeight)) | |
262 | + | then 0 | |
263 | + | else { | |
264 | + | let rewardPerBlock = getIntegerValue(this, kLpRewardPerBlock) | |
265 | + | let oldInterest = getIntegerValue(this, kLpInterest) | |
266 | + | let updateHeight = getIntegerValue(this, kLpInterestHeight) | |
267 | + | let reward = ((height - updateHeight) * rewardPerBlock) | |
268 | + | let interest = if ((totalSupply > 0)) | |
269 | + | then fraction(reward, SCALE8, totalSupply) | |
270 | + | else 0 | |
271 | + | (oldInterest + interest) | |
272 | + | } | |
269 | 273 | ||
270 | 274 | ||
271 | 275 | func calcLendUserReward (user,tokenId) = { | |
294 | 298 | ||
295 | 299 | func claimLenderRewardsCommon (user,readOnly) = { | |
296 | 300 | func claim (a,tokenId) = { | |
297 | - | let $ | |
298 | - | let tokenIds = $ | |
299 | - | let cAmount = $ | |
300 | - | let total = $ | |
301 | - | let enteries = $ | |
301 | + | let $t087538797 = a | |
302 | + | let tokenIds = $t087538797._1 | |
303 | + | let cAmount = $t087538797._2 | |
304 | + | let total = $t087538797._3 | |
305 | + | let enteries = $t087538797._4 | |
302 | 306 | let userAvailableClaim = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendAvailableClaim)), 0) | |
303 | - | let $ | |
304 | - | let uReward = $ | |
305 | - | let newTokenInterest = $ | |
306 | - | let userSupply = $ | |
307 | + | let $t089108989 = calcLendUserReward(user, tokenId) | |
308 | + | let uReward = $t089108989._1 | |
309 | + | let newTokenInterest = $t089108989._2 | |
310 | + | let userSupply = $t089108989._3 | |
307 | 311 | let totalToClaim = (userAvailableClaim + uReward) | |
308 | 312 | if (if ((totalToClaim > 0)) | |
309 | 313 | then true | |
336 | 340 | ||
337 | 341 | func claimLpRewardsCommon (user,readOnly) = { | |
338 | 342 | let userAvailableClaim = valueOrElse(getInteger(this, (user + kUserLpAvailableClaim)), 0) | |
339 | - | let $ | |
340 | - | let uReward = $ | |
341 | - | let newLpInterest = $ | |
342 | - | let userSupply = $ | |
343 | + | let $t099169981 = calcLpUserReward(user) | |
344 | + | let uReward = $t099169981._1 | |
345 | + | let newLpInterest = $t099169981._2 | |
346 | + | let userSupply = $t099169981._3 | |
343 | 347 | let totalToClaim = (userAvailableClaim + uReward) | |
344 | 348 | if (if (readOnly) | |
345 | 349 | then true | |
430 | 434 | @Callable(i) | |
431 | 435 | func lendAction (user,tokenId) = valueOrElse(isLandCall(i), { | |
432 | 436 | let userAvailableClaim = valueOrElse(getInteger(this, (tokenId + kUserLendAvailableClaim)), 0) | |
433 | - | let $ | |
434 | - | let uReward = $ | |
435 | - | let newTokenInterest = $ | |
437 | + | let $t01234312410 = calcLendUserReward(user, tokenId) | |
438 | + | let uReward = $t01234312410._1 | |
439 | + | let newTokenInterest = $t01234312410._2 | |
436 | 440 | [IntegerEntry((((user + "_") + tokenId) + kUserLendInterest), newTokenInterest), IntegerEntry((((user + "_") + tokenId) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)] | |
437 | 441 | }) | |
438 | 442 | ||
441 | 445 | @Callable(i) | |
442 | 446 | func lpAction (user) = valueOrElse(isSFFarmingCall(i), { | |
443 | 447 | let userAvailableClaim = valueOrElse(getInteger(this, kUserLpAvailableClaim), 0) | |
444 | - | let $ | |
445 | - | let uReward = $ | |
446 | - | let newLpInterest = $ | |
448 | + | let $t01287512928 = calcLpUserReward(user) | |
449 | + | let uReward = $t01287512928._1 | |
450 | + | let newLpInterest = $t01287512928._2 | |
447 | 451 | [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((user + kLpInterest), newLpInterest), IntegerEntry((user + kLpInterestHeight), height)] | |
448 | 452 | }) | |
449 | 453 | ||
473 | 477 | if (((lastUpdateHeight + periodLength) > height)) | |
474 | 478 | then throw("rewards alredy updated in this period") | |
475 | 479 | else { | |
476 | - | let $ | |
477 | - | let totalSupply = $ | |
478 | - | let totalSupplyUsd = $ | |
479 | - | let totalSupplyUsdAll = $ | |
480 | + | let $t01460314683 = getTotalSupplyAllTokens() | |
481 | + | let totalSupply = $t01460314683._1 | |
482 | + | let totalSupplyUsd = $t01460314683._2 | |
483 | + | let totalSupplyUsdAll = $t01460314683._3 | |
480 | 484 | let axlyPrice = getAssetPrice(axlyId) | |
481 | 485 | let axlyPrecision = getAssetPrecision(axlyId) | |
482 | 486 | let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR) | |
483 | 487 | func updateReward (a,tokenId) = { | |
484 | - | let $ | |
485 | - | let enteries = $ | |
486 | - | let index = $ | |
488 | + | let $t01492714952 = a | |
489 | + | let enteries = $t01492714952._1 | |
490 | + | let index = $t01492714952._2 | |
487 | 491 | if ((totalSupply[index] == 0)) | |
488 | 492 | then $Tuple2((enteries ++ [IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), height)]), (index + 1)) | |
489 | 493 | else { | |
504 | 508 | } | |
505 | 509 | } | |
506 | 510 | ||
507 | - | let $ | |
511 | + | let $t01642316495 = { | |
508 | 512 | let $l = allTokens | |
509 | 513 | let $s = size($l) | |
510 | 514 | let $acc0 = $Tuple2(nil, 0) | |
518 | 522 | ||
519 | 523 | $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) | |
520 | 524 | } | |
521 | - | let tokensEnteries = $ | |
522 | - | let index = $ | |
525 | + | let tokensEnteries = $t01642316495._1 | |
526 | + | let index = $t01642316495._2 | |
523 | 527 | let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR) | |
524 | 528 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
525 | 529 | 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 kRewardUpdateHeight = "rewardUpdateHeight" | |
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 curPeriod = ((height - startHeight) / periodLength) | |
119 | 119 | ||
120 | 120 | let lendMaxAmount = getIntegerValue(tokenContract, kLendersMaxAmount) | |
121 | 121 | ||
122 | 122 | let lendMaxPeriodAmount = (lendMaxAmount / LENDERS_MAX_PERIODS) | |
123 | 123 | ||
124 | 124 | let lpMaxAmount = getIntegerValue(tokenContract, kLPMaxAmount) | |
125 | 125 | ||
126 | 126 | let lpMaxPeriodAmount = (lpMaxAmount / LP_MAX_PERIODS) | |
127 | 127 | ||
128 | 128 | let allTokens = split(getStringValue(this, kTokens), ",") | |
129 | 129 | ||
130 | 130 | func isAdminCall (i) = if (containsElement([admin1PK, admin2PK, admin3PK], i.callerPublicKey)) | |
131 | 131 | then unit | |
132 | 132 | else throw("Only admin group1 can call this function") | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func isSelfCall (i) = if ((i.caller == this)) | |
136 | 136 | then unit | |
137 | 137 | else throw("Only contract itself can call this function") | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func isOperatorCall (i) = if ((i.callerPublicKey == operatorPK)) | |
141 | 141 | then unit | |
142 | 142 | else throw("Only operator can call this function") | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func isLandCall (i) = if ((i.caller == lendContract)) | |
146 | 146 | then unit | |
147 | 147 | else throw("Only land contract can call this function") | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func isSFFarmingCall (i) = if ((i.caller == sfFarmingContract)) | |
151 | 151 | then unit | |
152 | 152 | else throw("Only land contract can call this function") | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func getAssetPrice (assetId) = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
159 | 159 | then 8 | |
160 | 160 | else match assetInfo(fromBase58String(assetId)) { | |
161 | 161 | case asset: Asset => | |
162 | 162 | asset.decimals | |
163 | 163 | case _ => | |
164 | 164 | throw("Can't find asset") | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func getAssetPrecision (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func getAdoptedAPRByPeriod (period,aprPeriods,apr) = { | |
172 | 172 | func for (a,aperiod) = { | |
173 | 173 | let $t053405362 = a | |
174 | 174 | let index = $t053405362._1 | |
175 | 175 | let found = $t053405362._2 | |
176 | 176 | let ft = split(aperiod, "-") | |
177 | 177 | let $t053995462 = $Tuple2(parseIntValue(ft[0]), parseIntValue(ft[1])) | |
178 | 178 | let from = $t053995462._1 | |
179 | 179 | let to = $t053995462._2 | |
180 | 180 | if (found) | |
181 | 181 | then a | |
182 | 182 | else if (if ((period >= from)) | |
183 | 183 | then (to >= period) | |
184 | 184 | else false) | |
185 | 185 | then $Tuple2(index, true) | |
186 | 186 | else $Tuple2((index + 1), false) | |
187 | 187 | } | |
188 | 188 | ||
189 | 189 | let $t055995665 = { | |
190 | 190 | let $l = LENDERS_APR_PERIODS | |
191 | 191 | let $s = size($l) | |
192 | 192 | let $acc0 = $Tuple2(0, false) | |
193 | 193 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
194 | 194 | then $a | |
195 | 195 | else for($a, $l[$i]) | |
196 | 196 | ||
197 | 197 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
198 | 198 | then $a | |
199 | 199 | else throw("List size exceeds 9") | |
200 | 200 | ||
201 | 201 | $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) | |
202 | 202 | } | |
203 | 203 | let index = $t055995665._1 | |
204 | 204 | let found = $t055995665._2 | |
205 | 205 | if (found) | |
206 | 206 | then fraction((LENDERS_APR[index] * SCALE8), 7, 365) | |
207 | 207 | else 0 | |
208 | 208 | } | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func getTotalSupplyAllTokens () = { | |
212 | 212 | func for (a,tokenId) = { | |
213 | 213 | let $t058535909 = a | |
214 | 214 | let totalSupply = $t058535909._1 | |
215 | 215 | let totalSupplyUsd = $t058535909._2 | |
216 | 216 | let totalSupplyUsdAll = $t058535909._3 | |
217 | 217 | let tSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0) | |
218 | 218 | let assetPrice = getAssetPrice(tokenId) | |
219 | 219 | let assetPrecision = getAssetPrecision(tokenId) | |
220 | 220 | let tSupplyUsd = fraction(tSupply, assetPrice, assetPrecision) | |
221 | 221 | $Tuple3((totalSupply :+ tSupply), (totalSupplyUsd :+ tSupplyUsd), (totalSupplyUsdAll + tSupplyUsd)) | |
222 | 222 | } | |
223 | 223 | ||
224 | 224 | let $l = allTokens | |
225 | 225 | let $s = size($l) | |
226 | 226 | let $acc0 = $Tuple3(nil, nil, 0) | |
227 | 227 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
228 | 228 | then $a | |
229 | 229 | else for($a, $l[$i]) | |
230 | 230 | ||
231 | 231 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
232 | 232 | then $a | |
233 | 233 | else throw("List size exceeds 30") | |
234 | 234 | ||
235 | 235 | $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) | |
236 | 236 | } | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | func getTotalSupplyUsd (tokenId) = { | |
240 | 240 | let tSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0) | |
241 | 241 | let assetPrice = getAssetPrice(tokenId) | |
242 | 242 | let assetPrecision = getAssetPrecision(tokenId) | |
243 | 243 | fraction(tSupply, assetPrice, assetPrecision) | |
244 | 244 | } | |
245 | 245 | ||
246 | 246 | ||
247 | - | func calcNewTokenInterest (tokenId,totalSupply) = { | |
248 | - | let rewardPerBlock = getIntegerValue(this, (tokenId + kTokenRewardPerBlock)) | |
249 | - | let oldInterest = getIntegerValue(this, (tokenId + kTokenInterest)) | |
250 | - | let updateHeight = getIntegerValue(this, (tokenId + kTokenInterestHeight)) | |
251 | - | let reward = ((height - updateHeight) * rewardPerBlock) | |
252 | - | let interest = if ((totalSupply > 0)) | |
253 | - | then fraction(reward, SCALE8, totalSupply) | |
254 | - | else 0 | |
255 | - | (oldInterest + interest) | |
256 | - | } | |
247 | + | func calcNewTokenInterest (tokenId,totalSupply) = if ((height >= startHeight)) | |
248 | + | then 0 | |
249 | + | else { | |
250 | + | let rewardPerBlock = getIntegerValue(this, (tokenId + kTokenRewardPerBlock)) | |
251 | + | let oldInterest = getIntegerValue(this, (tokenId + kTokenInterest)) | |
252 | + | let updateHeight = getIntegerValue(this, (tokenId + kTokenInterestHeight)) | |
253 | + | let reward = ((height - updateHeight) * rewardPerBlock) | |
254 | + | let interest = if ((totalSupply > 0)) | |
255 | + | then fraction(reward, SCALE8, totalSupply) | |
256 | + | else 0 | |
257 | + | (oldInterest + interest) | |
258 | + | } | |
257 | 259 | ||
258 | 260 | ||
259 | - | func calcNewLpInterest (totalSupply) = { | |
260 | - | let rewardPerBlock = getIntegerValue(this, kLpRewardPerBlock) | |
261 | - | let oldInterest = getIntegerValue(this, kLpInterest) | |
262 | - | let updateHeight = getIntegerValue(this, kLpInterestHeight) | |
263 | - | let reward = ((height - updateHeight) * rewardPerBlock) | |
264 | - | let interest = if ((totalSupply > 0)) | |
265 | - | then fraction(reward, SCALE8, totalSupply) | |
266 | - | else 0 | |
267 | - | (oldInterest + interest) | |
268 | - | } | |
261 | + | func calcNewLpInterest (totalSupply) = if ((height >= startHeight)) | |
262 | + | then 0 | |
263 | + | else { | |
264 | + | let rewardPerBlock = getIntegerValue(this, kLpRewardPerBlock) | |
265 | + | let oldInterest = getIntegerValue(this, kLpInterest) | |
266 | + | let updateHeight = getIntegerValue(this, kLpInterestHeight) | |
267 | + | let reward = ((height - updateHeight) * rewardPerBlock) | |
268 | + | let interest = if ((totalSupply > 0)) | |
269 | + | then fraction(reward, SCALE8, totalSupply) | |
270 | + | else 0 | |
271 | + | (oldInterest + interest) | |
272 | + | } | |
269 | 273 | ||
270 | 274 | ||
271 | 275 | func calcLendUserReward (user,tokenId) = { | |
272 | 276 | let totalSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0) | |
273 | 277 | let tokenInterest = calcNewTokenInterest(tokenId, totalSupply) | |
274 | 278 | let userSupply = valueOrElse(getInteger(lendContract, ((user + kLendUserSupply) + tokenId)), 0) | |
275 | 279 | let userTokenInterest = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendInterest)), if ((userSupply == 0)) | |
276 | 280 | then tokenInterest | |
277 | 281 | else 0) | |
278 | 282 | let reward = fraction(userSupply, (tokenInterest - userTokenInterest), SCALE8) | |
279 | 283 | $Tuple3(reward, tokenInterest, userSupply) | |
280 | 284 | } | |
281 | 285 | ||
282 | 286 | ||
283 | 287 | func calcLpUserReward (user) = { | |
284 | 288 | let totalSupply = valueOrElse(getInteger(sfFarmingContract, (axlyPool + kSFTotalSupply)), 0) | |
285 | 289 | let tokenInterest = calcNewLpInterest(totalSupply) | |
286 | 290 | let userSupply = valueOrElse(getInteger(lendContract, (((axlyPool + "_") + user) + kSFUserTotalSupply)), 0) | |
287 | 291 | let userTokenInterest = valueOrElse(getInteger(this, (user + kUserLpInterest)), if ((userSupply == 0)) | |
288 | 292 | then tokenInterest | |
289 | 293 | else 0) | |
290 | 294 | let reward = fraction(userSupply, (tokenInterest - userTokenInterest), SCALE8) | |
291 | 295 | $Tuple3(reward, tokenInterest, userSupply) | |
292 | 296 | } | |
293 | 297 | ||
294 | 298 | ||
295 | 299 | func claimLenderRewardsCommon (user,readOnly) = { | |
296 | 300 | func claim (a,tokenId) = { | |
297 | - | let $ | |
298 | - | let tokenIds = $ | |
299 | - | let cAmount = $ | |
300 | - | let total = $ | |
301 | - | let enteries = $ | |
301 | + | let $t087538797 = a | |
302 | + | let tokenIds = $t087538797._1 | |
303 | + | let cAmount = $t087538797._2 | |
304 | + | let total = $t087538797._3 | |
305 | + | let enteries = $t087538797._4 | |
302 | 306 | let userAvailableClaim = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendAvailableClaim)), 0) | |
303 | - | let $ | |
304 | - | let uReward = $ | |
305 | - | let newTokenInterest = $ | |
306 | - | let userSupply = $ | |
307 | + | let $t089108989 = calcLendUserReward(user, tokenId) | |
308 | + | let uReward = $t089108989._1 | |
309 | + | let newTokenInterest = $t089108989._2 | |
310 | + | let userSupply = $t089108989._3 | |
307 | 311 | let totalToClaim = (userAvailableClaim + uReward) | |
308 | 312 | if (if ((totalToClaim > 0)) | |
309 | 313 | then true | |
310 | 314 | else (userSupply > 0)) | |
311 | 315 | then { | |
312 | 316 | let newEntreries = if (if (readOnly) | |
313 | 317 | then true | |
314 | 318 | else (totalToClaim == 0)) | |
315 | 319 | then enteries | |
316 | 320 | else (enteries ++ [IntegerEntry((((tokenId + "_") + user) + kUserLendInterest), newTokenInterest), IntegerEntry((((tokenId + "_") + user) + kUserLendAvailableClaim), 0), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)]) | |
317 | 321 | $Tuple4((tokenIds :+ tokenId), (cAmount :+ totalToClaim), (total + totalToClaim), newEntreries) | |
318 | 322 | } | |
319 | 323 | else $Tuple4(tokenIds, cAmount, total, enteries) | |
320 | 324 | } | |
321 | 325 | ||
322 | 326 | let $l = allTokens | |
323 | 327 | let $s = size($l) | |
324 | 328 | let $acc0 = $Tuple4(nil, nil, 0, nil) | |
325 | 329 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
326 | 330 | then $a | |
327 | 331 | else claim($a, $l[$i]) | |
328 | 332 | ||
329 | 333 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
330 | 334 | then $a | |
331 | 335 | else throw("List size exceeds 30") | |
332 | 336 | ||
333 | 337 | $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) | |
334 | 338 | } | |
335 | 339 | ||
336 | 340 | ||
337 | 341 | func claimLpRewardsCommon (user,readOnly) = { | |
338 | 342 | let userAvailableClaim = valueOrElse(getInteger(this, (user + kUserLpAvailableClaim)), 0) | |
339 | - | let $ | |
340 | - | let uReward = $ | |
341 | - | let newLpInterest = $ | |
342 | - | let userSupply = $ | |
343 | + | let $t099169981 = calcLpUserReward(user) | |
344 | + | let uReward = $t099169981._1 | |
345 | + | let newLpInterest = $t099169981._2 | |
346 | + | let userSupply = $t099169981._3 | |
343 | 347 | let totalToClaim = (userAvailableClaim + uReward) | |
344 | 348 | if (if (readOnly) | |
345 | 349 | then true | |
346 | 350 | else (totalToClaim == 0)) | |
347 | 351 | then $Tuple2(totalToClaim, nil) | |
348 | 352 | else $Tuple2(totalToClaim, [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), 0), IntegerEntry(kLpInterest, newLpInterest), IntegerEntry(kLpInterestHeight, height)]) | |
349 | 353 | } | |
350 | 354 | ||
351 | 355 | ||
352 | 356 | func getTokensAPRs () = { | |
353 | 357 | let axlyPrice = getAssetPrice(axlyId) | |
354 | 358 | let axlyPrecision = getAssetPrecision(axlyId) | |
355 | 359 | func tokensAprs (apr,tokenId) = { | |
356 | 360 | let rwpb = valueOrElse(getInteger(this, (tokenId + kTokenRewardPerBlock)), 0) | |
357 | 361 | let rwpbUsd = fraction(rwpb, axlyPrice, axlyPrecision) | |
358 | 362 | let rwYear = ((rwpbUsd * periodLength) * 52) | |
359 | 363 | let totalSupplyUsd = getTotalSupplyUsd(tokenId) | |
360 | 364 | (apr :+ fraction(rwYear, SCALE8, totalSupplyUsd)) | |
361 | 365 | } | |
362 | 366 | ||
363 | 367 | let aprs = { | |
364 | 368 | let $l = allTokens | |
365 | 369 | let $s = size($l) | |
366 | 370 | let $acc0 = nil | |
367 | 371 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
368 | 372 | then $a | |
369 | 373 | else tokensAprs($a, $l[$i]) | |
370 | 374 | ||
371 | 375 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
372 | 376 | then $a | |
373 | 377 | else throw("List size exceeds 30") | |
374 | 378 | ||
375 | 379 | $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) | |
376 | 380 | } | |
377 | 381 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
378 | 382 | let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId) | |
379 | 383 | let lpPrecision = getAssetPrecision(lpId) | |
380 | 384 | let lpPrice = { | |
381 | 385 | let @ = ({ | |
382 | 386 | let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [[lpId]], nil) | |
383 | 387 | if ($isInstanceOf(@, "List[Any]")) | |
384 | 388 | then @ | |
385 | 389 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
386 | 390 | })[0] | |
387 | 391 | if ($isInstanceOf(@, "Int")) | |
388 | 392 | then @ | |
389 | 393 | else throw(($getType(@) + " couldn't be cast to Int")) | |
390 | 394 | } | |
391 | 395 | let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision) | |
392 | 396 | let rwpb = valueOrElse(getInteger(this, kLpRewardPerBlock), 0) | |
393 | 397 | let rwpbUsd = fraction(rwpb, axlyPrice, axlyPrecision) | |
394 | 398 | let rwYear = ((rwpbUsd * periodLength) * 52) | |
395 | 399 | let lpApr = fraction(rwYear, SCALE8, lpTotalSupplyUsd) | |
396 | 400 | $Tuple3(allTokens, aprs, lpApr) | |
397 | 401 | } | |
398 | 402 | ||
399 | 403 | ||
400 | 404 | @Callable(i) | |
401 | 405 | func claimLenderRewards () = { | |
402 | 406 | let claimRes = claimLenderRewardsCommon(toString(i.caller), false) | |
403 | 407 | if ((claimRes._3 == 0)) | |
404 | 408 | then throw("claim amount must be greater than 0") | |
405 | 409 | else { | |
406 | 410 | let inv = invoke(tokenContract, "withdrawLendReward", [claimRes._3, toString(i.caller)], nil) | |
407 | 411 | if ((inv == inv)) | |
408 | 412 | then claimRes._4 | |
409 | 413 | else throw("Strict value is not equal to itself.") | |
410 | 414 | } | |
411 | 415 | } | |
412 | 416 | ||
413 | 417 | ||
414 | 418 | ||
415 | 419 | @Callable(i) | |
416 | 420 | func claimLpRewards () = { | |
417 | 421 | let claimRes = claimLpRewardsCommon(toString(i.caller), false) | |
418 | 422 | if ((claimRes._1 == 0)) | |
419 | 423 | then throw("claim amount must be greater than 0") | |
420 | 424 | else { | |
421 | 425 | let inv = invoke(tokenContract, "withdrawLpReward", [claimRes._1, toString(i.caller)], nil) | |
422 | 426 | if ((inv == inv)) | |
423 | 427 | then claimRes._2 | |
424 | 428 | else throw("Strict value is not equal to itself.") | |
425 | 429 | } | |
426 | 430 | } | |
427 | 431 | ||
428 | 432 | ||
429 | 433 | ||
430 | 434 | @Callable(i) | |
431 | 435 | func lendAction (user,tokenId) = valueOrElse(isLandCall(i), { | |
432 | 436 | let userAvailableClaim = valueOrElse(getInteger(this, (tokenId + kUserLendAvailableClaim)), 0) | |
433 | - | let $ | |
434 | - | let uReward = $ | |
435 | - | let newTokenInterest = $ | |
437 | + | let $t01234312410 = calcLendUserReward(user, tokenId) | |
438 | + | let uReward = $t01234312410._1 | |
439 | + | let newTokenInterest = $t01234312410._2 | |
436 | 440 | [IntegerEntry((((user + "_") + tokenId) + kUserLendInterest), newTokenInterest), IntegerEntry((((user + "_") + tokenId) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)] | |
437 | 441 | }) | |
438 | 442 | ||
439 | 443 | ||
440 | 444 | ||
441 | 445 | @Callable(i) | |
442 | 446 | func lpAction (user) = valueOrElse(isSFFarmingCall(i), { | |
443 | 447 | let userAvailableClaim = valueOrElse(getInteger(this, kUserLpAvailableClaim), 0) | |
444 | - | let $ | |
445 | - | let uReward = $ | |
446 | - | let newLpInterest = $ | |
448 | + | let $t01287512928 = calcLpUserReward(user) | |
449 | + | let uReward = $t01287512928._1 | |
450 | + | let newLpInterest = $t01287512928._2 | |
447 | 451 | [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((user + kLpInterest), newLpInterest), IntegerEntry((user + kLpInterestHeight), height)] | |
448 | 452 | }) | |
449 | 453 | ||
450 | 454 | ||
451 | 455 | ||
452 | 456 | @Callable(i) | |
453 | 457 | func init (axlyMainContractAddr,axlyTokenomicContractAddr,axlyPoolAddr,farmingStartHeight,periodLength) = valueOrElse(isSelfCall(i), if (!(isDefined(addressFromString(axlyMainContractAddr)))) | |
454 | 458 | then throw("Wrong farming address") | |
455 | 459 | else if (!(isDefined(addressFromString(axlyTokenomicContractAddr)))) | |
456 | 460 | then throw("Wrong main contract address") | |
457 | 461 | else [StringEntry(kAxlyMainContract, axlyMainContractAddr), StringEntry(kAxlyTokenomicContract, axlyTokenomicContractAddr), StringEntry(kAxlyPool, axlyPoolAddr), IntegerEntry(kStartHeight, farmingStartHeight), StringEntry(kTokens, "")]) | |
458 | 462 | ||
459 | 463 | ||
460 | 464 | ||
461 | 465 | @Callable(i) | |
462 | 466 | func initNewToken (tokenId) = valueOrElse(isAdminCall(i), if (isDefined(getInteger(this, (tokenId + kTokenInterest)))) | |
463 | 467 | then throw("token already inited") | |
464 | 468 | else if (!(contains(getStringValue(this, kLendSetupTokens), tokenId))) | |
465 | 469 | then throw("no token on landing") | |
466 | 470 | else [IntegerEntry((tokenId + kTokenInterest), 0), IntegerEntry((tokenId + kTokenInterestHeight), height), StringEntry(kTokens, makeString((allTokens :+ tokenId), ",")), IntegerEntry(kTokenRewardPerBlock, 0)]) | |
467 | 471 | ||
468 | 472 | ||
469 | 473 | ||
470 | 474 | @Callable(i) | |
471 | 475 | func updateRewards () = valueOrElse(isOperatorCall(i), { | |
472 | 476 | let lastUpdateHeight = valueOrElse(getInteger(this, kRewardUpdateHeight), 0) | |
473 | 477 | if (((lastUpdateHeight + periodLength) > height)) | |
474 | 478 | then throw("rewards alredy updated in this period") | |
475 | 479 | else { | |
476 | - | let $ | |
477 | - | let totalSupply = $ | |
478 | - | let totalSupplyUsd = $ | |
479 | - | let totalSupplyUsdAll = $ | |
480 | + | let $t01460314683 = getTotalSupplyAllTokens() | |
481 | + | let totalSupply = $t01460314683._1 | |
482 | + | let totalSupplyUsd = $t01460314683._2 | |
483 | + | let totalSupplyUsdAll = $t01460314683._3 | |
480 | 484 | let axlyPrice = getAssetPrice(axlyId) | |
481 | 485 | let axlyPrecision = getAssetPrecision(axlyId) | |
482 | 486 | let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR) | |
483 | 487 | func updateReward (a,tokenId) = { | |
484 | - | let $ | |
485 | - | let enteries = $ | |
486 | - | let index = $ | |
488 | + | let $t01492714952 = a | |
489 | + | let enteries = $t01492714952._1 | |
490 | + | let index = $t01492714952._2 | |
487 | 491 | if ((totalSupply[index] == 0)) | |
488 | 492 | then $Tuple2((enteries ++ [IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), height)]), (index + 1)) | |
489 | 493 | else { | |
490 | 494 | let share = fraction(totalSupplyUsd[index], SCALE8, totalSupplyUsdAll) | |
491 | 495 | let maxReward = fraction(share, lendMaxPeriodAmount, SCALE8) | |
492 | 496 | let maxRewardUsd = fraction(maxReward, axlyPrice, axlyPrecision) | |
493 | 497 | let prevTotalSupply = valueOrElse(getInteger(this, kPrevLendTokenSupply), 0) | |
494 | 498 | let rtCoef = if (if ((prevTotalSupply == 0)) | |
495 | 499 | then true | |
496 | 500 | else (totalSupply[index] == 0)) | |
497 | 501 | then 0 | |
498 | 502 | else fraction(prevTotalSupply, SCALE8, totalSupply[index]) | |
499 | 503 | let reward = (min([(maxAPR * (SCALE8 + rtCoef)), fraction(maxAPR, (15 * SCALE8), 10)]) / SCALE8) | |
500 | 504 | let rewardUsd = min([maxRewardUsd, fraction(totalSupplyUsd[index], reward, SCALE8)]) | |
501 | 505 | let rewardPeriod = fraction(rewardUsd, axlyPrice, axlyPrecision) | |
502 | 506 | let rewardPerBlock = (rewardPeriod / periodLength) | |
503 | 507 | $Tuple2((enteries ++ [IntegerEntry((tokenId + kPrevLendTokenSupply), totalSupply[index]), IntegerEntry((tokenId + kTokenRewardPerBlock), rewardPerBlock), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), height)]), (index + 1)) | |
504 | 508 | } | |
505 | 509 | } | |
506 | 510 | ||
507 | - | let $ | |
511 | + | let $t01642316495 = { | |
508 | 512 | let $l = allTokens | |
509 | 513 | let $s = size($l) | |
510 | 514 | let $acc0 = $Tuple2(nil, 0) | |
511 | 515 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
512 | 516 | then $a | |
513 | 517 | else updateReward($a, $l[$i]) | |
514 | 518 | ||
515 | 519 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
516 | 520 | then $a | |
517 | 521 | else throw("List size exceeds 30") | |
518 | 522 | ||
519 | 523 | $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) | |
520 | 524 | } | |
521 | - | let tokensEnteries = $ | |
522 | - | let index = $ | |
525 | + | let tokensEnteries = $t01642316495._1 | |
526 | + | let index = $t01642316495._2 | |
523 | 527 | let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR) | |
524 | 528 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
525 | 529 | let preLPSupply = valueOrElse(getInteger(this, kPrevLPSupply), 0) | |
526 | 530 | let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId) | |
527 | 531 | let lpPrecision = getAssetPrecision(lpId) | |
528 | 532 | let lpPrice = { | |
529 | 533 | let @ = ({ | |
530 | 534 | let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [[lpId]], nil) | |
531 | 535 | if ($isInstanceOf(@, "List[Any]")) | |
532 | 536 | then @ | |
533 | 537 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
534 | 538 | })[0] | |
535 | 539 | if ($isInstanceOf(@, "Int")) | |
536 | 540 | then @ | |
537 | 541 | else throw(($getType(@) + " couldn't be cast to Int")) | |
538 | 542 | } | |
539 | 543 | let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision) | |
540 | 544 | let maxLPRewardUsd = fraction(lpMaxPeriodAmount, axlyPrice, axlyPrecision) | |
541 | 545 | let rtLPCoef = if (if ((preLPSupply == 0)) | |
542 | 546 | then true | |
543 | 547 | else (lpTotalSupply == 0)) | |
544 | 548 | then 0 | |
545 | 549 | else fraction(preLPSupply, SCALE8, lpTotalSupply) | |
546 | 550 | let rewardLp = (min([(lpMaxAPR * (SCALE8 + rtLPCoef)), fraction(lpMaxAPR, (15 * SCALE8), 10)]) / SCALE8) | |
547 | 551 | let rewardLpUsd = min([maxLPRewardUsd, fraction(lpTotalSupplyUsd, rewardLp, SCALE8)]) | |
548 | 552 | let rewardLpPeriod = fraction(rewardLpUsd, axlyPrice, axlyPrecision) | |
549 | 553 | let rewardLpPerBlock = (rewardLpPeriod / periodLength) | |
550 | 554 | let lpEnteries = [IntegerEntry(kPrevLPSupply, lpTotalSupply), IntegerEntry(kLpRewardPerBlock, rewardLpPerBlock), IntegerEntry(kLpInterest, calcNewLpInterest(lpTotalSupply)), IntegerEntry(kLpInterestHeight, height)] | |
551 | 555 | ((lpEnteries ++ tokensEnteries) :+ IntegerEntry(kRewardUpdateHeight, height)) | |
552 | 556 | } | |
553 | 557 | }) | |
554 | 558 | ||
555 | 559 | ||
556 | 560 | @Verifier(tx) | |
557 | 561 | func verify () = { | |
558 | 562 | let multiSignedByAdmins = { | |
559 | 563 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK)) | |
560 | 564 | then 1 | |
561 | 565 | else 0 | |
562 | 566 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK)) | |
563 | 567 | then 1 | |
564 | 568 | else 0 | |
565 | 569 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK)) | |
566 | 570 | then 1 | |
567 | 571 | else 0 | |
568 | 572 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
569 | 573 | } | |
570 | 574 | match tx { | |
571 | 575 | case inv: InvokeScriptTransaction => | |
572 | 576 | let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
573 | 577 | let isRightFee = if ((inv.fee == 900000)) | |
574 | 578 | then (inv.feeAssetId == unit) | |
575 | 579 | else false | |
576 | 580 | let isInitCall = (inv.function == "init") | |
577 | 581 | let isnoPayments = (size(inv.payments) == 0) | |
578 | 582 | if (if (if (if (isRightFee) | |
579 | 583 | then isInitCall | |
580 | 584 | else false) | |
581 | 585 | then isSelf | |
582 | 586 | else false) | |
583 | 587 | then isnoPayments | |
584 | 588 | else false) | |
585 | 589 | then true | |
586 | 590 | else multiSignedByAdmins | |
587 | 591 | case _ => | |
588 | 592 | multiSignedByAdmins | |
589 | 593 | } | |
590 | 594 | } | |
591 | 595 |
github/deemru/w8io/026f985 80.80 ms ◑