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