tx · AaJfjphPicUsARKyY6bVziu4JTwjbb2GnxMq7op9RaDu 3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn: -0.02300000 Waves 2023.08.17 14:17 [2714523] smart account 3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn > SELF 0.00000000 Waves
{ "type": 13, "id": "AaJfjphPicUsARKyY6bVziu4JTwjbb2GnxMq7op9RaDu", "fee": 2300000, "feeAssetId": null, "timestamp": 1692271060974, "version": 2, "chainId": 84, "sender": "3N2M4PztorHwrfENp7D6LhYGgGodjiD1fjn", "senderPublicKey": "Fj9LPkCtmW3pDnVU6wPQnvqpZJCBieWSvZqY5FAGeCyp", "proofs": [ "5pBFn6HYy1WcgsU2n9YzwTz5tFeKvDaxjQSFtgTaoJ3J8YogYide1pyJPQsSNHrmXsiGhWXxEX8RCbzjnNo2fbR", "3r4425tz9fFfeKaHovJp6kMEjNy4VfASqFwWaQvwaVh4agSxAvG2gVe9n61pbghVPVUUv3kQsrCBgideibcrreMv" ], "script": "base64:BgIhCAISABIAEgQKAggIEgMKAQgSBwoFCAgIAQESAwoBCBIAUQAGU0NBTEU4AIDC1y8AC0xFTkRFUlNfQVBSCQDMCAIAlgEJAMwIAgB4CQDMCAIAZAkAzAgCAFAJAMwIAgA8CQDMCAIAKAkAzAgCAB4JAMwIAgAUCQDMCAIACgUDbmlsABNMRU5ERVJTX0FQUl9QRVJJT0RTCQDMCAICAzEtMQkAzAgCAgMyLTIJAMwIAgIDMy0zCQDMCAICAzQtNAkAzAgCAgM1LTgJAMwIAgIEOS0xMgkAzAgCAgcxNCAtIDE2CQDMCAICBTE3LTIwCQDMCAICBjIwLTEwNAUDbmlsABNMRU5ERVJTX01BWF9QRVJJT0RTAGgABkxQX0FQUgkAzAgCAJYBCQDMCAIAeAkAzAgCAGQJAMwIAgBQCQDMCAIAPAkAzAgCACgFA25pbAAOTFBfQVBSX1BFUklPRFMJAMwIAgIDMS0xCQDMCAICAzItMgkAzAgCAgMzLTMJAMwIAg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AnR4AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBANpbnYFByRtYXRjaDAEBmlzU2VsZgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQKaXNSaWdodEZlZQMJAAACCAUDaW52A2ZlZQCg9zYJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHBAppc0luaXRDYWxsCQAAAggFA2ludghmdW5jdGlvbgIEaW5pdAQMaXNub1BheW1lbnRzCQAAAgkAkAMBCAUDaW52CHBheW1lbnRzAAADAwMDBQppc1JpZ2h0RmVlBQppc0luaXRDYWxsBwUGaXNTZWxmBwUMaXNub1BheW1lbnRzBwYFE211bHRpU2lnbmVkQnlBZG1pbnMFE211bHRpU2lnbmVkQnlBZG1pbnPItJKT", "height": 2714523, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HsgABABQU9j6fhArukcLfhNuoyVrenxUQj7cujjbtTob Next: FtVbtHUpfGTH4pLVAJ4KdP5b1u6wLqq7sxbT3LNwVDSy Diff:
Old | New | Differences | |
---|---|---|---|
458 | 458 | then throw("Wrong farming address") | |
459 | 459 | else if (!(isDefined(addressFromString(axlyTokenomicContractAddr)))) | |
460 | 460 | then throw("Wrong main contract address") | |
461 | - | else [StringEntry(kAxlyMainContract, axlyMainContractAddr), StringEntry(kAxlyTokenomicContract, axlyTokenomicContractAddr), StringEntry(kAxlyPool, axlyPoolAddr), IntegerEntry(kStartHeight, farmingStartHeight), StringEntry(kTokens, "")]) | |
461 | + | else [StringEntry(kAxlyMainContract, axlyMainContractAddr), StringEntry(kAxlyTokenomicContract, axlyTokenomicContractAddr), StringEntry(kAxlyPool, axlyPoolAddr), IntegerEntry(kStartHeight, farmingStartHeight), IntegerEntry(kPeriodLength, periodLength), StringEntry(kTokens, "")]) | |
462 | 462 | ||
463 | 463 | ||
464 | 464 | ||
465 | 465 | @Callable(i) | |
466 | 466 | func initNewToken (tokenId) = valueOrElse(isAdminCall(i), if (isDefined(getInteger(this, (tokenId + kTokenInterest)))) | |
467 | 467 | then throw("token already inited") | |
468 | - | else if (!(contains(getStringValue( | |
468 | + | else if (!(contains(getStringValue(lendContract, kLendSetupTokens), tokenId))) | |
469 | 469 | then throw("no token on landing") | |
470 | 470 | else [IntegerEntry((tokenId + kTokenInterest), 0), IntegerEntry((tokenId + kTokenInterestHeight), height), StringEntry(kTokens, makeString((allTokens :+ tokenId), ",")), IntegerEntry(kTokenRewardPerBlock, 0)]) | |
471 | 471 | ||
477 | 477 | if (((lastUpdateHeight + periodLength) > height)) | |
478 | 478 | then throw("rewards alredy updated in this period") | |
479 | 479 | else { | |
480 | - | let $ | |
481 | - | let totalSupply = $ | |
482 | - | let totalSupplyUsd = $ | |
483 | - | let totalSupplyUsdAll = $ | |
480 | + | let $t01465814738 = getTotalSupplyAllTokens() | |
481 | + | let totalSupply = $t01465814738._1 | |
482 | + | let totalSupplyUsd = $t01465814738._2 | |
483 | + | let totalSupplyUsdAll = $t01465814738._3 | |
484 | 484 | let axlyPrice = getAssetPrice(axlyId) | |
485 | 485 | let axlyPrecision = getAssetPrecision(axlyId) | |
486 | 486 | let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR) | |
487 | 487 | func updateReward (a,tokenId) = { | |
488 | - | let $ | |
489 | - | let enteries = $ | |
490 | - | let index = $ | |
488 | + | let $t01498215007 = a | |
489 | + | let enteries = $t01498215007._1 | |
490 | + | let index = $t01498215007._2 | |
491 | 491 | if ((totalSupply[index] == 0)) | |
492 | 492 | then $Tuple2((enteries ++ [IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), height)]), (index + 1)) | |
493 | 493 | else { | |
508 | 508 | } | |
509 | 509 | } | |
510 | 510 | ||
511 | - | let $ | |
511 | + | let $t01647816550 = { | |
512 | 512 | let $l = allTokens | |
513 | 513 | let $s = size($l) | |
514 | 514 | let $acc0 = $Tuple2(nil, 0) | |
522 | 522 | ||
523 | 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) | |
524 | 524 | } | |
525 | - | let tokensEnteries = $ | |
526 | - | let index = $ | |
525 | + | let tokensEnteries = $t01647816550._1 | |
526 | + | let index = $t01647816550._2 | |
527 | 527 | let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR) | |
528 | 528 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
529 | 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 | 247 | func calcNewTokenInterest (tokenId,totalSupply) = if ((height >= startHeight)) | |
248 | 248 | then 0 | |
249 | 249 | else { | |
250 | 250 | let rewardPerBlock = getIntegerValue(this, (tokenId + kTokenRewardPerBlock)) | |
251 | 251 | let oldInterest = getIntegerValue(this, (tokenId + kTokenInterest)) | |
252 | 252 | let updateHeight = getIntegerValue(this, (tokenId + kTokenInterestHeight)) | |
253 | 253 | let reward = ((height - updateHeight) * rewardPerBlock) | |
254 | 254 | let interest = if ((totalSupply > 0)) | |
255 | 255 | then fraction(reward, SCALE8, totalSupply) | |
256 | 256 | else 0 | |
257 | 257 | (oldInterest + interest) | |
258 | 258 | } | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | func calcNewLpInterest (totalSupply) = if ((height >= startHeight)) | |
262 | 262 | then 0 | |
263 | 263 | else { | |
264 | 264 | let rewardPerBlock = getIntegerValue(this, kLpRewardPerBlock) | |
265 | 265 | let oldInterest = getIntegerValue(this, kLpInterest) | |
266 | 266 | let updateHeight = getIntegerValue(this, kLpInterestHeight) | |
267 | 267 | let reward = ((height - updateHeight) * rewardPerBlock) | |
268 | 268 | let interest = if ((totalSupply > 0)) | |
269 | 269 | then fraction(reward, SCALE8, totalSupply) | |
270 | 270 | else 0 | |
271 | 271 | (oldInterest + interest) | |
272 | 272 | } | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func calcLendUserReward (user,tokenId) = { | |
276 | 276 | let totalSupply = valueOrElse(getInteger(lendContract, (kLendTokenSupply + tokenId)), 0) | |
277 | 277 | let tokenInterest = calcNewTokenInterest(tokenId, totalSupply) | |
278 | 278 | let userSupply = valueOrElse(getInteger(lendContract, ((user + kLendUserSupply) + tokenId)), 0) | |
279 | 279 | let userTokenInterest = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendInterest)), if ((userSupply == 0)) | |
280 | 280 | then tokenInterest | |
281 | 281 | else 0) | |
282 | 282 | let reward = fraction(userSupply, (tokenInterest - userTokenInterest), SCALE8) | |
283 | 283 | $Tuple3(reward, tokenInterest, userSupply) | |
284 | 284 | } | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | func calcLpUserReward (user) = { | |
288 | 288 | let totalSupply = valueOrElse(getInteger(sfFarmingContract, (axlyPool + kSFTotalSupply)), 0) | |
289 | 289 | let tokenInterest = calcNewLpInterest(totalSupply) | |
290 | 290 | let userSupply = valueOrElse(getInteger(lendContract, (((axlyPool + "_") + user) + kSFUserTotalSupply)), 0) | |
291 | 291 | let userTokenInterest = valueOrElse(getInteger(this, (user + kUserLpInterest)), if ((userSupply == 0)) | |
292 | 292 | then tokenInterest | |
293 | 293 | else 0) | |
294 | 294 | let reward = fraction(userSupply, (tokenInterest - userTokenInterest), SCALE8) | |
295 | 295 | $Tuple3(reward, tokenInterest, userSupply) | |
296 | 296 | } | |
297 | 297 | ||
298 | 298 | ||
299 | 299 | func claimLenderRewardsCommon (user,readOnly) = { | |
300 | 300 | func claim (a,tokenId) = { | |
301 | 301 | let $t087538797 = a | |
302 | 302 | let tokenIds = $t087538797._1 | |
303 | 303 | let cAmount = $t087538797._2 | |
304 | 304 | let total = $t087538797._3 | |
305 | 305 | let enteries = $t087538797._4 | |
306 | 306 | let userAvailableClaim = valueOrElse(getInteger(this, (((tokenId + "_") + user) + kUserLendAvailableClaim)), 0) | |
307 | 307 | let $t089108989 = calcLendUserReward(user, tokenId) | |
308 | 308 | let uReward = $t089108989._1 | |
309 | 309 | let newTokenInterest = $t089108989._2 | |
310 | 310 | let userSupply = $t089108989._3 | |
311 | 311 | let totalToClaim = (userAvailableClaim + uReward) | |
312 | 312 | if (if ((totalToClaim > 0)) | |
313 | 313 | then true | |
314 | 314 | else (userSupply > 0)) | |
315 | 315 | then { | |
316 | 316 | let newEntreries = if (if (readOnly) | |
317 | 317 | then true | |
318 | 318 | else (totalToClaim == 0)) | |
319 | 319 | then enteries | |
320 | 320 | else (enteries ++ [IntegerEntry((((tokenId + "_") + user) + kUserLendInterest), newTokenInterest), IntegerEntry((((tokenId + "_") + user) + kUserLendAvailableClaim), 0), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)]) | |
321 | 321 | $Tuple4((tokenIds :+ tokenId), (cAmount :+ totalToClaim), (total + totalToClaim), newEntreries) | |
322 | 322 | } | |
323 | 323 | else $Tuple4(tokenIds, cAmount, total, enteries) | |
324 | 324 | } | |
325 | 325 | ||
326 | 326 | let $l = allTokens | |
327 | 327 | let $s = size($l) | |
328 | 328 | let $acc0 = $Tuple4(nil, nil, 0, nil) | |
329 | 329 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
330 | 330 | then $a | |
331 | 331 | else claim($a, $l[$i]) | |
332 | 332 | ||
333 | 333 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
334 | 334 | then $a | |
335 | 335 | else throw("List size exceeds 30") | |
336 | 336 | ||
337 | 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) | |
338 | 338 | } | |
339 | 339 | ||
340 | 340 | ||
341 | 341 | func claimLpRewardsCommon (user,readOnly) = { | |
342 | 342 | let userAvailableClaim = valueOrElse(getInteger(this, (user + kUserLpAvailableClaim)), 0) | |
343 | 343 | let $t099169981 = calcLpUserReward(user) | |
344 | 344 | let uReward = $t099169981._1 | |
345 | 345 | let newLpInterest = $t099169981._2 | |
346 | 346 | let userSupply = $t099169981._3 | |
347 | 347 | let totalToClaim = (userAvailableClaim + uReward) | |
348 | 348 | if (if (readOnly) | |
349 | 349 | then true | |
350 | 350 | else (totalToClaim == 0)) | |
351 | 351 | then $Tuple2(totalToClaim, nil) | |
352 | 352 | else $Tuple2(totalToClaim, [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), 0), IntegerEntry(kLpInterest, newLpInterest), IntegerEntry(kLpInterestHeight, height)]) | |
353 | 353 | } | |
354 | 354 | ||
355 | 355 | ||
356 | 356 | func getTokensAPRs () = { | |
357 | 357 | let axlyPrice = getAssetPrice(axlyId) | |
358 | 358 | let axlyPrecision = getAssetPrecision(axlyId) | |
359 | 359 | func tokensAprs (apr,tokenId) = { | |
360 | 360 | let rwpb = valueOrElse(getInteger(this, (tokenId + kTokenRewardPerBlock)), 0) | |
361 | 361 | let rwpbUsd = fraction(rwpb, axlyPrice, axlyPrecision) | |
362 | 362 | let rwYear = ((rwpbUsd * periodLength) * 52) | |
363 | 363 | let totalSupplyUsd = getTotalSupplyUsd(tokenId) | |
364 | 364 | (apr :+ fraction(rwYear, SCALE8, totalSupplyUsd)) | |
365 | 365 | } | |
366 | 366 | ||
367 | 367 | let aprs = { | |
368 | 368 | let $l = allTokens | |
369 | 369 | let $s = size($l) | |
370 | 370 | let $acc0 = nil | |
371 | 371 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
372 | 372 | then $a | |
373 | 373 | else tokensAprs($a, $l[$i]) | |
374 | 374 | ||
375 | 375 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
376 | 376 | then $a | |
377 | 377 | else throw("List size exceeds 30") | |
378 | 378 | ||
379 | 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) | |
380 | 380 | } | |
381 | 381 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
382 | 382 | let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId) | |
383 | 383 | let lpPrecision = getAssetPrecision(lpId) | |
384 | 384 | let lpPrice = { | |
385 | 385 | let @ = ({ | |
386 | 386 | let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [[lpId]], nil) | |
387 | 387 | if ($isInstanceOf(@, "List[Any]")) | |
388 | 388 | then @ | |
389 | 389 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
390 | 390 | })[0] | |
391 | 391 | if ($isInstanceOf(@, "Int")) | |
392 | 392 | then @ | |
393 | 393 | else throw(($getType(@) + " couldn't be cast to Int")) | |
394 | 394 | } | |
395 | 395 | let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision) | |
396 | 396 | let rwpb = valueOrElse(getInteger(this, kLpRewardPerBlock), 0) | |
397 | 397 | let rwpbUsd = fraction(rwpb, axlyPrice, axlyPrecision) | |
398 | 398 | let rwYear = ((rwpbUsd * periodLength) * 52) | |
399 | 399 | let lpApr = fraction(rwYear, SCALE8, lpTotalSupplyUsd) | |
400 | 400 | $Tuple3(allTokens, aprs, lpApr) | |
401 | 401 | } | |
402 | 402 | ||
403 | 403 | ||
404 | 404 | @Callable(i) | |
405 | 405 | func claimLenderRewards () = { | |
406 | 406 | let claimRes = claimLenderRewardsCommon(toString(i.caller), false) | |
407 | 407 | if ((claimRes._3 == 0)) | |
408 | 408 | then throw("claim amount must be greater than 0") | |
409 | 409 | else { | |
410 | 410 | let inv = invoke(tokenContract, "withdrawLendReward", [claimRes._3, toString(i.caller)], nil) | |
411 | 411 | if ((inv == inv)) | |
412 | 412 | then claimRes._4 | |
413 | 413 | else throw("Strict value is not equal to itself.") | |
414 | 414 | } | |
415 | 415 | } | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | ||
419 | 419 | @Callable(i) | |
420 | 420 | func claimLpRewards () = { | |
421 | 421 | let claimRes = claimLpRewardsCommon(toString(i.caller), false) | |
422 | 422 | if ((claimRes._1 == 0)) | |
423 | 423 | then throw("claim amount must be greater than 0") | |
424 | 424 | else { | |
425 | 425 | let inv = invoke(tokenContract, "withdrawLpReward", [claimRes._1, toString(i.caller)], nil) | |
426 | 426 | if ((inv == inv)) | |
427 | 427 | then claimRes._2 | |
428 | 428 | else throw("Strict value is not equal to itself.") | |
429 | 429 | } | |
430 | 430 | } | |
431 | 431 | ||
432 | 432 | ||
433 | 433 | ||
434 | 434 | @Callable(i) | |
435 | 435 | func lendAction (user,tokenId) = valueOrElse(isLandCall(i), { | |
436 | 436 | let userAvailableClaim = valueOrElse(getInteger(this, (tokenId + kUserLendAvailableClaim)), 0) | |
437 | 437 | let $t01234312410 = calcLendUserReward(user, tokenId) | |
438 | 438 | let uReward = $t01234312410._1 | |
439 | 439 | let newTokenInterest = $t01234312410._2 | |
440 | 440 | [IntegerEntry((((user + "_") + tokenId) + kUserLendInterest), newTokenInterest), IntegerEntry((((user + "_") + tokenId) + kUserLendAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((tokenId + kTokenInterest), newTokenInterest), IntegerEntry((tokenId + kTokenInterestHeight), height)] | |
441 | 441 | }) | |
442 | 442 | ||
443 | 443 | ||
444 | 444 | ||
445 | 445 | @Callable(i) | |
446 | 446 | func lpAction (user) = valueOrElse(isSFFarmingCall(i), { | |
447 | 447 | let userAvailableClaim = valueOrElse(getInteger(this, kUserLpAvailableClaim), 0) | |
448 | 448 | let $t01287512928 = calcLpUserReward(user) | |
449 | 449 | let uReward = $t01287512928._1 | |
450 | 450 | let newLpInterest = $t01287512928._2 | |
451 | 451 | [IntegerEntry((user + kUserLpInterest), newLpInterest), IntegerEntry((user + kUserLpAvailableClaim), (userAvailableClaim + uReward)), IntegerEntry((user + kLpInterest), newLpInterest), IntegerEntry((user + kLpInterestHeight), height)] | |
452 | 452 | }) | |
453 | 453 | ||
454 | 454 | ||
455 | 455 | ||
456 | 456 | @Callable(i) | |
457 | 457 | func init (axlyMainContractAddr,axlyTokenomicContractAddr,axlyPoolAddr,farmingStartHeight,periodLength) = valueOrElse(isSelfCall(i), if (!(isDefined(addressFromString(axlyMainContractAddr)))) | |
458 | 458 | then throw("Wrong farming address") | |
459 | 459 | else if (!(isDefined(addressFromString(axlyTokenomicContractAddr)))) | |
460 | 460 | then throw("Wrong main contract address") | |
461 | - | else [StringEntry(kAxlyMainContract, axlyMainContractAddr), StringEntry(kAxlyTokenomicContract, axlyTokenomicContractAddr), StringEntry(kAxlyPool, axlyPoolAddr), IntegerEntry(kStartHeight, farmingStartHeight), StringEntry(kTokens, "")]) | |
461 | + | else [StringEntry(kAxlyMainContract, axlyMainContractAddr), StringEntry(kAxlyTokenomicContract, axlyTokenomicContractAddr), StringEntry(kAxlyPool, axlyPoolAddr), IntegerEntry(kStartHeight, farmingStartHeight), IntegerEntry(kPeriodLength, periodLength), StringEntry(kTokens, "")]) | |
462 | 462 | ||
463 | 463 | ||
464 | 464 | ||
465 | 465 | @Callable(i) | |
466 | 466 | func initNewToken (tokenId) = valueOrElse(isAdminCall(i), if (isDefined(getInteger(this, (tokenId + kTokenInterest)))) | |
467 | 467 | then throw("token already inited") | |
468 | - | else if (!(contains(getStringValue( | |
468 | + | else if (!(contains(getStringValue(lendContract, kLendSetupTokens), tokenId))) | |
469 | 469 | then throw("no token on landing") | |
470 | 470 | else [IntegerEntry((tokenId + kTokenInterest), 0), IntegerEntry((tokenId + kTokenInterestHeight), height), StringEntry(kTokens, makeString((allTokens :+ tokenId), ",")), IntegerEntry(kTokenRewardPerBlock, 0)]) | |
471 | 471 | ||
472 | 472 | ||
473 | 473 | ||
474 | 474 | @Callable(i) | |
475 | 475 | func updateRewards () = valueOrElse(isOperatorCall(i), { | |
476 | 476 | let lastUpdateHeight = valueOrElse(getInteger(this, kRewardUpdateHeight), 0) | |
477 | 477 | if (((lastUpdateHeight + periodLength) > height)) | |
478 | 478 | then throw("rewards alredy updated in this period") | |
479 | 479 | else { | |
480 | - | let $ | |
481 | - | let totalSupply = $ | |
482 | - | let totalSupplyUsd = $ | |
483 | - | let totalSupplyUsdAll = $ | |
480 | + | let $t01465814738 = getTotalSupplyAllTokens() | |
481 | + | let totalSupply = $t01465814738._1 | |
482 | + | let totalSupplyUsd = $t01465814738._2 | |
483 | + | let totalSupplyUsdAll = $t01465814738._3 | |
484 | 484 | let axlyPrice = getAssetPrice(axlyId) | |
485 | 485 | let axlyPrecision = getAssetPrecision(axlyId) | |
486 | 486 | let maxAPR = getAdoptedAPRByPeriod(curPeriod, LENDERS_APR_PERIODS, LENDERS_APR) | |
487 | 487 | func updateReward (a,tokenId) = { | |
488 | - | let $ | |
489 | - | let enteries = $ | |
490 | - | let index = $ | |
488 | + | let $t01498215007 = a | |
489 | + | let enteries = $t01498215007._1 | |
490 | + | let index = $t01498215007._2 | |
491 | 491 | if ((totalSupply[index] == 0)) | |
492 | 492 | then $Tuple2((enteries ++ [IntegerEntry((tokenId + kTokenRewardPerBlock), 0), IntegerEntry((tokenId + kTokenInterest), calcNewTokenInterest(tokenId, totalSupply[index])), IntegerEntry((tokenId + kTokenInterestHeight), height)]), (index + 1)) | |
493 | 493 | else { | |
494 | 494 | let share = fraction(totalSupplyUsd[index], SCALE8, totalSupplyUsdAll) | |
495 | 495 | let maxReward = fraction(share, lendMaxPeriodAmount, SCALE8) | |
496 | 496 | let maxRewardUsd = fraction(maxReward, axlyPrice, axlyPrecision) | |
497 | 497 | let prevTotalSupply = valueOrElse(getInteger(this, kPrevLendTokenSupply), 0) | |
498 | 498 | let rtCoef = if (if ((prevTotalSupply == 0)) | |
499 | 499 | then true | |
500 | 500 | else (totalSupply[index] == 0)) | |
501 | 501 | then 0 | |
502 | 502 | else fraction(prevTotalSupply, SCALE8, totalSupply[index]) | |
503 | 503 | let reward = (min([(maxAPR * (SCALE8 + rtCoef)), fraction(maxAPR, (15 * SCALE8), 10)]) / SCALE8) | |
504 | 504 | let rewardUsd = min([maxRewardUsd, fraction(totalSupplyUsd[index], reward, SCALE8)]) | |
505 | 505 | let rewardPeriod = fraction(rewardUsd, axlyPrice, axlyPrecision) | |
506 | 506 | let rewardPerBlock = (rewardPeriod / periodLength) | |
507 | 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)) | |
508 | 508 | } | |
509 | 509 | } | |
510 | 510 | ||
511 | - | let $ | |
511 | + | let $t01647816550 = { | |
512 | 512 | let $l = allTokens | |
513 | 513 | let $s = size($l) | |
514 | 514 | let $acc0 = $Tuple2(nil, 0) | |
515 | 515 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
516 | 516 | then $a | |
517 | 517 | else updateReward($a, $l[$i]) | |
518 | 518 | ||
519 | 519 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
520 | 520 | then $a | |
521 | 521 | else throw("List size exceeds 30") | |
522 | 522 | ||
523 | 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) | |
524 | 524 | } | |
525 | - | let tokensEnteries = $ | |
526 | - | let index = $ | |
525 | + | let tokensEnteries = $t01647816550._1 | |
526 | + | let index = $t01647816550._2 | |
527 | 527 | let lpMaxAPR = getAdoptedAPRByPeriod(curPeriod, LP_APR_PERIODS, LP_APR) | |
528 | 528 | let lpTotalSupply = getIntegerValue(sfFarmingContract, (axlyPool + kSFTotalSupply)) | |
529 | 529 | let preLPSupply = valueOrElse(getInteger(this, kPrevLPSupply), 0) | |
530 | 530 | let lpId = getStringValue(addressFromStringValue(axlyPool), kLpId) | |
531 | 531 | let lpPrecision = getAssetPrecision(lpId) | |
532 | 532 | let lpPrice = { | |
533 | 533 | let @ = ({ | |
534 | 534 | let @ = invoke(mainContract, "getShareAssetPriceREADONLY", [[lpId]], nil) | |
535 | 535 | if ($isInstanceOf(@, "List[Any]")) | |
536 | 536 | then @ | |
537 | 537 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
538 | 538 | })[0] | |
539 | 539 | if ($isInstanceOf(@, "Int")) | |
540 | 540 | then @ | |
541 | 541 | else throw(($getType(@) + " couldn't be cast to Int")) | |
542 | 542 | } | |
543 | 543 | let lpTotalSupplyUsd = fraction(lpTotalSupply, lpPrice, lpPrecision) | |
544 | 544 | let maxLPRewardUsd = fraction(lpMaxPeriodAmount, axlyPrice, axlyPrecision) | |
545 | 545 | let rtLPCoef = if (if ((preLPSupply == 0)) | |
546 | 546 | then true | |
547 | 547 | else (lpTotalSupply == 0)) | |
548 | 548 | then 0 | |
549 | 549 | else fraction(preLPSupply, SCALE8, lpTotalSupply) | |
550 | 550 | let rewardLp = (min([(lpMaxAPR * (SCALE8 + rtLPCoef)), fraction(lpMaxAPR, (15 * SCALE8), 10)]) / SCALE8) | |
551 | 551 | let rewardLpUsd = min([maxLPRewardUsd, fraction(lpTotalSupplyUsd, rewardLp, SCALE8)]) | |
552 | 552 | let rewardLpPeriod = fraction(rewardLpUsd, axlyPrice, axlyPrecision) | |
553 | 553 | let rewardLpPerBlock = (rewardLpPeriod / periodLength) | |
554 | 554 | let lpEnteries = [IntegerEntry(kPrevLPSupply, lpTotalSupply), IntegerEntry(kLpRewardPerBlock, rewardLpPerBlock), IntegerEntry(kLpInterest, calcNewLpInterest(lpTotalSupply)), IntegerEntry(kLpInterestHeight, height)] | |
555 | 555 | ((lpEnteries ++ tokensEnteries) :+ IntegerEntry(kRewardUpdateHeight, height)) | |
556 | 556 | } | |
557 | 557 | }) | |
558 | 558 | ||
559 | 559 | ||
560 | 560 | @Verifier(tx) | |
561 | 561 | func verify () = { | |
562 | 562 | let multiSignedByAdmins = { | |
563 | 563 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK)) | |
564 | 564 | then 1 | |
565 | 565 | else 0 | |
566 | 566 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK)) | |
567 | 567 | then 1 | |
568 | 568 | else 0 | |
569 | 569 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK)) | |
570 | 570 | then 1 | |
571 | 571 | else 0 | |
572 | 572 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
573 | 573 | } | |
574 | 574 | match tx { | |
575 | 575 | case inv: InvokeScriptTransaction => | |
576 | 576 | let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
577 | 577 | let isRightFee = if ((inv.fee == 900000)) | |
578 | 578 | then (inv.feeAssetId == unit) | |
579 | 579 | else false | |
580 | 580 | let isInitCall = (inv.function == "init") | |
581 | 581 | let isnoPayments = (size(inv.payments) == 0) | |
582 | 582 | if (if (if (if (isRightFee) | |
583 | 583 | then isInitCall | |
584 | 584 | else false) | |
585 | 585 | then isSelf | |
586 | 586 | else false) | |
587 | 587 | then isnoPayments | |
588 | 588 | else false) | |
589 | 589 | then true | |
590 | 590 | else multiSignedByAdmins | |
591 | 591 | case _ => | |
592 | 592 | multiSignedByAdmins | |
593 | 593 | } | |
594 | 594 | } | |
595 | 595 |
github/deemru/w8io/026f985 68.97 ms ◑