tx · PgAt8ZTB54Va2DyYPDnsX3TuK8ZfCa1xgqVCcgVRfhp 3N4yYqBkTUq1mDdHhvAd3St7spCbm84DytS: -0.02200000 Waves 2023.11.29 11:55 [2864480] smart account 3N4yYqBkTUq1mDdHhvAd3St7spCbm84DytS > SELF 0.00000000 Waves
{ "type": 13, "id": "PgAt8ZTB54Va2DyYPDnsX3TuK8ZfCa1xgqVCcgVRfhp", "fee": 2200000, "feeAssetId": null, "timestamp": 1701248213750, "version": 1, "sender": "3N4yYqBkTUq1mDdHhvAd3St7spCbm84DytS", "senderPublicKey": "8h7G4haeVwXKNHXNHsWkC1miUp5CQtk3WmpBKazQPxRh", "proofs": [ "57nFFtAkjRoSUsdi4vJgaojH6VdHeS84C1cvgtRjk2dLk9wsmvcnBrtL4MB6ew6LTXF1peWrgMwoVHWiLZNgee9s" ], "script": "base64:BgI0CAISAwoBARIDCgEBEgASAwoBCBIDCgEBEgMKAQgSAwoBCBIECgIYERIDCgEIEgASAwoBCEAADGNvbnRyYWN0RmlsZQIRbDJtcF9zdGFraW5nLnJpZGUAA1NFUAICX18ABnNjYWxlOACAwtcvAAdzY2FsZTE4AICAkLu61q3wDQANc2NhbGUxOEJpZ0ludAkAtgIBBQdzY2FsZTE4ABJBRERSRVNTX0JZVEVTX1NJWkUAGgANQkxPQ0tTX0lOX0RBWQCgCwEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cACmtleUFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAATa2V5RW1pc3Npb25QZXJCbG9jawkAuQkCCQDMCAICAiVzCQDMCAICEGVtaXNzaW9uUGVyQmxvY2sFA25pbAUDU0VQABlrZXlFbWlzc2lvblBlcmlvZEluQmxvY2tzCQC5CQIJAMwIAgICJXMJAMwIAgIWZW1pc3Npb25QZXJpb2RJbkJsb2NrcwUDbmlsBQNTRVAADWtleVN0YXJ0QmxvY2sJ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c2UCCQCdCAIFBHRoaXMJAQ5rZXlBbGxvd2VkVHhJZAACAAQHYnlPd25lcgMJAGcCCQCQAwEJAQ1nZXRBZG1pbnNMaXN0AAUGUVVPUlVNBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQMFCGJ5QWRtaW5zBgUHYnlPd25lcrqZpXk=", "chainId": 84, "height": 2864480, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9aragTtCWGYsryKUKA59HJUjQhce68XyNSEapChTyZ6H Next: J4Grg3KAFzWz6BRLjFozgvfhG2DzZQtL8uo4HD7zLT8w Diff:
Old | New | Differences | |
---|---|---|---|
70 | 70 | ||
71 | 71 | let emissionPeriodInBlocks = valueOrElse(getInteger(this, keyEmissionPeriodInBlocks), BLOCKS_IN_DAY) | |
72 | 72 | ||
73 | - | let emissionPerPeriod = (valueOrElse(getInteger(this, keyEmissionPerBlock), 0) * emissionPeriodInBlocks) | |
73 | + | let emissionPerBlock = valueOrElse(getInteger(this, keyEmissionPerBlock), 0) | |
74 | + | ||
75 | + | let emissionPerPeriod = (emissionPerBlock * emissionPeriodInBlocks) | |
74 | 76 | ||
75 | 77 | let ADMIN_LIST_SIZE = 5 | |
76 | 78 | ||
108 | 110 | ||
109 | 111 | ||
110 | 112 | func genVotesKeysHelper (a,adminAddress) = { | |
111 | - | let $ | |
112 | - | let result = $ | |
113 | - | let prefix = $ | |
113 | + | let $t035953619 = a | |
114 | + | let result = $t035953619._1 | |
115 | + | let prefix = $t035953619._2 | |
114 | 116 | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
115 | 117 | } | |
116 | 118 | ||
117 | 119 | ||
118 | 120 | func genVotesKeys (keyPrefix) = { | |
119 | 121 | let adminList = keyAdminAddressList() | |
120 | - | let $ | |
122 | + | let $t037663850 = { | |
121 | 123 | let $l = getAdminsList() | |
122 | 124 | let $s = size($l) | |
123 | 125 | let $acc0 = $Tuple2(nil, keyPrefix) | |
131 | 133 | ||
132 | 134 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
133 | 135 | } | |
134 | - | let result = $ | |
135 | - | let prefix = $ | |
136 | + | let result = $t037663850._1 | |
137 | + | let prefix = $t037663850._2 | |
136 | 138 | result | |
137 | 139 | } | |
138 | 140 | ||
213 | 215 | func calcTotalProfit () = calcTotalProfitForHeight(height) | |
214 | 216 | ||
215 | 217 | ||
218 | + | func getMaxAssetAvailable () = match assetIdBytes { | |
219 | + | case u: Unit => | |
220 | + | wavesBalance(this).available | |
221 | + | case b: ByteVector => | |
222 | + | assetBalance(this, b) | |
223 | + | case _ => | |
224 | + | throw("Match error") | |
225 | + | } | |
226 | + | ||
227 | + | ||
216 | 228 | func getTotalAssetAmountWithProfitOrMaxAvailable () = { | |
217 | 229 | let totalAssetAmountWithProfit = (totalAssetAmount + calcTotalProfit()) | |
218 | - | let totalAmount = match assetIdBytes { | |
219 | - | case u: Unit => | |
220 | - | min([totalAssetAmountWithProfit, wavesBalance(this).available]) | |
221 | - | case b: ByteVector => | |
222 | - | min([totalAssetAmountWithProfit, assetBalance(this, b)]) | |
223 | - | case _ => | |
224 | - | throw("Match error") | |
225 | - | } | |
230 | + | let totalAmount = min([totalAssetAmountWithProfit, getMaxAssetAvailable()]) | |
226 | 231 | if ((totalLpAmount == 0)) | |
227 | 232 | then 0 | |
228 | 233 | else totalAmount | |
232 | 237 | func getCurrentPrice () = if ((totalLpAmount != 0)) | |
233 | 238 | then fraction(toBigInt(getTotalAssetAmountWithProfitOrMaxAvailable()), scale18BigInt, toBigInt(totalLpAmount)) | |
234 | 239 | else scale18BigInt | |
240 | + | ||
241 | + | ||
242 | + | func getRemainingBlocks () = if ((emissionPerBlock == 0)) | |
243 | + | then 0 | |
244 | + | else fraction((getMaxAssetAvailable() - getTotalAssetAmountWithProfitOrMaxAvailable()), 1, emissionPerBlock) | |
235 | 245 | ||
236 | 246 | ||
237 | 247 | func getUserStakingNodesData (userAddress) = { | |
447 | 457 | if ((check == check)) | |
448 | 458 | then { | |
449 | 459 | func getAirdropStateChanges (accum,assetAmount) = { | |
450 | - | let $ | |
451 | - | let result = $ | |
452 | - | let index = $ | |
453 | - | let totalLp = $ | |
460 | + | let $t01449114527 = accum | |
461 | + | let result = $t01449114527._1 | |
462 | + | let index = $t01449114527._2 | |
463 | + | let totalLp = $t01449114527._3 | |
454 | 464 | let addedLpAmount = calcLpFromAsset(assetAmount) | |
455 | 465 | let userLockedLpKey = keyUserLockedLpAmount(addressList[index]) | |
456 | 466 | let oldLpAmount = valueOrElse(getInteger(this, userLockedLpKey), 0) | |
457 | 467 | $Tuple3((result :+ IntegerEntry(userLockedLpKey, (oldLpAmount + addedLpAmount))), (index + 1), (totalLp + addedLpAmount)) | |
458 | 468 | } | |
459 | 469 | ||
460 | - | let $ | |
470 | + | let $t01485814967 = { | |
461 | 471 | let $l = amountList | |
462 | 472 | let $s = size($l) | |
463 | 473 | let $acc0 = $Tuple3(nil, 0, 0) | |
471 | 481 | ||
472 | 482 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_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), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90) | |
473 | 483 | } | |
474 | - | let airdropEntries = $ | |
475 | - | let _a = $ | |
476 | - | let addedTotalLockedLpAmount = $ | |
484 | + | let airdropEntries = $t01485814967._1 | |
485 | + | let _a = $t01485814967._2 | |
486 | + | let addedTotalLockedLpAmount = $t01485814967._3 | |
477 | 487 | ([IntegerEntry(keyTotalLockedLpAmount, (totalLockedLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalLpAmount, (totalLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalAssetAmount, (totalAssetAmount + amountListSum))] ++ airdropEntries) | |
478 | 488 | } | |
479 | 489 | else throw("Strict value is not equal to itself.") | |
489 | 499 | let userAvailableAssetToWithdraw = getUserAvailableAssetsToWithdraw(userAddress) | |
490 | 500 | let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0) | |
491 | 501 | let userTotalAssetWithdrawn = valueOrElse(getInteger(this, keyUserTotalAssetWithdrawn(userAddress)), 0) | |
492 | - | let $ | |
493 | - | let userStakingNodesList = $ | |
494 | - | let userStakingNodeSharesList = $ | |
502 | + | let $t01615516247 = getUserStakingNodesData(userAddress) | |
503 | + | let userStakingNodesList = $t01615516247._1 | |
504 | + | let userStakingNodeSharesList = $t01615516247._2 | |
495 | 505 | $Tuple2(nil, $Tuple9(userLpAmount, userAvailableAssetToWithdraw, getCurrentPrice(), userTotalStakedAmount, userTotalAssetWithdrawn, userLockedLpAmount, userLockedAssetAmount, userStakingNodesList, userStakingNodeSharesList)) | |
496 | 506 | } | |
497 | 507 | ||
498 | 508 | ||
499 | 509 | ||
500 | 510 | @Callable(i) | |
501 | - | func getTotalAssetsREADONLY () = $Tuple2(nil, $ | |
511 | + | func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple6(totalLpAmount, getTotalAssetAmountWithProfitOrMaxAvailable(), getCurrentPrice(), totalLockedLpAmount, calcAssetFromLp(totalLockedLpAmount), getRemainingBlocks())) | |
502 | 512 | ||
503 | 513 | ||
504 | 514 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFile = "l2mp_staking.ride" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let scale8 = 100000000 | |
9 | 9 | ||
10 | 10 | let scale18 = 1000000000000000000 | |
11 | 11 | ||
12 | 12 | let scale18BigInt = toBigInt(scale18) | |
13 | 13 | ||
14 | 14 | let ADDRESS_BYTES_SIZE = 26 | |
15 | 15 | ||
16 | 16 | let BLOCKS_IN_DAY = 1440 | |
17 | 17 | ||
18 | 18 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
22 | 22 | ||
23 | 23 | let keyEmissionPerBlock = makeString(["%s", "emissionPerBlock"], SEP) | |
24 | 24 | ||
25 | 25 | let keyEmissionPeriodInBlocks = makeString(["%s", "emissionPeriodInBlocks"], SEP) | |
26 | 26 | ||
27 | 27 | let keyStartBlock = makeString(["%s", "startBlock"], SEP) | |
28 | 28 | ||
29 | 29 | let keyTotalLpAmount = makeString(["%s", "totalLpAmount"], SEP) | |
30 | 30 | ||
31 | 31 | let keyTotalAssetAmount = makeString(["%s", "totalAssetAmount"], SEP) | |
32 | 32 | ||
33 | 33 | let keyTotalLockedLpAmount = makeString(["%s", "totalLockedLpAmount"], SEP) | |
34 | 34 | ||
35 | 35 | func keyUserLpAmount (userAddress) = makeString(["%s%s", "userLpAmount", userAddress], SEP) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keyUserLockedLpAmount (userAddress) = makeString(["%s%s", "userLockedLpAmount", userAddress], SEP) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func keyUserStakingNodes (userAddress) = makeString(["%s%s", "userStakingNodes", userAddress], SEP) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func keyUserStakingNodesShares (userAddress) = makeString(["%s%s", "userStakingNodesShares", userAddress], SEP) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func keyUserTotalAssetWithdrawn (userAddress) = makeString(["%s%s", "totalAssetWithdrawn", userAddress], SEP) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyUserTotalAssetStaked (userAddress) = makeString(["%s%s", "totalAssetStaked", userAddress], SEP) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyHistory (type,userAddress,txId) = makeString(["%s%s%s", type, userAddress, toBase58String(txId)], SEP) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func formatHistory (totalProfit,price,totalAssetAmount,totalLpAmount) = makeString(["%d%d%d%d", toString(totalProfit), toString(price), toString(totalAssetAmount), toString(totalLpAmount)], SEP) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | let totalLpAmount = valueOrElse(getInteger(this, keyTotalLpAmount), 0) | |
60 | 60 | ||
61 | 61 | let totalAssetAmount = valueOrElse(getInteger(this, keyTotalAssetAmount), 0) | |
62 | 62 | ||
63 | 63 | let totalLockedLpAmount = valueOrElse(getInteger(this, keyTotalLockedLpAmount), 0) | |
64 | 64 | ||
65 | 65 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
66 | 66 | ||
67 | 67 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
68 | 68 | then unit | |
69 | 69 | else fromBase58String(assetIdString) | |
70 | 70 | ||
71 | 71 | let emissionPeriodInBlocks = valueOrElse(getInteger(this, keyEmissionPeriodInBlocks), BLOCKS_IN_DAY) | |
72 | 72 | ||
73 | - | let emissionPerPeriod = (valueOrElse(getInteger(this, keyEmissionPerBlock), 0) * emissionPeriodInBlocks) | |
73 | + | let emissionPerBlock = valueOrElse(getInteger(this, keyEmissionPerBlock), 0) | |
74 | + | ||
75 | + | let emissionPerPeriod = (emissionPerBlock * emissionPeriodInBlocks) | |
74 | 76 | ||
75 | 77 | let ADMIN_LIST_SIZE = 5 | |
76 | 78 | ||
77 | 79 | let QUORUM = 3 | |
78 | 80 | ||
79 | 81 | let TXID_BYTES_LENGTH = 32 | |
80 | 82 | ||
81 | 83 | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
82 | 84 | ||
83 | 85 | ||
84 | 86 | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
85 | 87 | ||
86 | 88 | ||
87 | 89 | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
88 | 90 | ||
89 | 91 | ||
90 | 92 | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
91 | 93 | ||
92 | 94 | ||
93 | 95 | func getAdminVote (prefix,admin) = { | |
94 | 96 | let voteKey = keyFullAdminVote(prefix, admin) | |
95 | 97 | valueOrElse(getInteger(voteKey), 0) | |
96 | 98 | } | |
97 | 99 | ||
98 | 100 | ||
99 | 101 | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
100 | 102 | case s: String => | |
101 | 103 | split(s, SEP) | |
102 | 104 | case _ => | |
103 | 105 | nil | |
104 | 106 | } | |
105 | 107 | ||
106 | 108 | ||
107 | 109 | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
108 | 110 | ||
109 | 111 | ||
110 | 112 | func genVotesKeysHelper (a,adminAddress) = { | |
111 | - | let $ | |
112 | - | let result = $ | |
113 | - | let prefix = $ | |
113 | + | let $t035953619 = a | |
114 | + | let result = $t035953619._1 | |
115 | + | let prefix = $t035953619._2 | |
114 | 116 | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
115 | 117 | } | |
116 | 118 | ||
117 | 119 | ||
118 | 120 | func genVotesKeys (keyPrefix) = { | |
119 | 121 | let adminList = keyAdminAddressList() | |
120 | - | let $ | |
122 | + | let $t037663850 = { | |
121 | 123 | let $l = getAdminsList() | |
122 | 124 | let $s = size($l) | |
123 | 125 | let $acc0 = $Tuple2(nil, keyPrefix) | |
124 | 126 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
125 | 127 | then $a | |
126 | 128 | else genVotesKeysHelper($a, $l[$i]) | |
127 | 129 | ||
128 | 130 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
129 | 131 | then $a | |
130 | 132 | else throw("List size exceeds 5") | |
131 | 133 | ||
132 | 134 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
133 | 135 | } | |
134 | - | let result = $ | |
135 | - | let prefix = $ | |
136 | + | let result = $t037663850._1 | |
137 | + | let prefix = $t037663850._2 | |
136 | 138 | result | |
137 | 139 | } | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
141 | 143 | ||
142 | 144 | ||
143 | 145 | func countVotes (prefix) = { | |
144 | 146 | let votes = genVotesKeys(prefix) | |
145 | 147 | let $l = votes | |
146 | 148 | let $s = size($l) | |
147 | 149 | let $acc0 = 0 | |
148 | 150 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
149 | 151 | then $a | |
150 | 152 | else countVotesHelper($a, $l[$i]) | |
151 | 153 | ||
152 | 154 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
153 | 155 | then $a | |
154 | 156 | else throw("List size exceeds 5") | |
155 | 157 | ||
156 | 158 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
157 | 159 | } | |
158 | 160 | ||
159 | 161 | ||
160 | 162 | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
161 | 163 | ||
162 | 164 | ||
163 | 165 | func getClearVoteEntries (prefix) = { | |
164 | 166 | let votes = genVotesKeys(prefix) | |
165 | 167 | let $l = votes | |
166 | 168 | let $s = size($l) | |
167 | 169 | let $acc0 = nil | |
168 | 170 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
169 | 171 | then $a | |
170 | 172 | else clearVotesHelper($a, $l[$i]) | |
171 | 173 | ||
172 | 174 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
173 | 175 | then $a | |
174 | 176 | else throw("List size exceeds 5") | |
175 | 177 | ||
176 | 178 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
177 | 179 | } | |
178 | 180 | ||
179 | 181 | ||
180 | 182 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
181 | 183 | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
182 | 184 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
183 | 185 | let err = if (!(isInAdminList(callerAddressString))) | |
184 | 186 | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
185 | 187 | else if ((adminCurrentVote == 1)) | |
186 | 188 | then throwErr((voteKey + " you already voted")) | |
187 | 189 | else unit | |
188 | 190 | if ((err == err)) | |
189 | 191 | then { | |
190 | 192 | let votes = countVotes(keyPrefix) | |
191 | 193 | if (((votes + 1) >= minVotes)) | |
192 | 194 | then { | |
193 | 195 | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
194 | 196 | (clearVoteEntries ++ voteResult) | |
195 | 197 | } | |
196 | 198 | else [IntegerEntry(voteKey, 1)] | |
197 | 199 | } | |
198 | 200 | else throw("Strict value is not equal to itself.") | |
199 | 201 | } | |
200 | 202 | ||
201 | 203 | ||
202 | 204 | func stringListToIntListHelper (acc,value) = (acc :+ parseIntValue(value)) | |
203 | 205 | ||
204 | 206 | ||
205 | 207 | func calcTotalProfitForHeight (h) = { | |
206 | 208 | let startBlock = valueOrElse(getInteger(this, keyStartBlock), height) | |
207 | 209 | let startPeriod = fraction(startBlock, 1, emissionPeriodInBlocks) | |
208 | 210 | let elapsedPeriods = ((h / emissionPeriodInBlocks) - startPeriod) | |
209 | 211 | max([0, (emissionPerPeriod * elapsedPeriods)]) | |
210 | 212 | } | |
211 | 213 | ||
212 | 214 | ||
213 | 215 | func calcTotalProfit () = calcTotalProfitForHeight(height) | |
214 | 216 | ||
215 | 217 | ||
218 | + | func getMaxAssetAvailable () = match assetIdBytes { | |
219 | + | case u: Unit => | |
220 | + | wavesBalance(this).available | |
221 | + | case b: ByteVector => | |
222 | + | assetBalance(this, b) | |
223 | + | case _ => | |
224 | + | throw("Match error") | |
225 | + | } | |
226 | + | ||
227 | + | ||
216 | 228 | func getTotalAssetAmountWithProfitOrMaxAvailable () = { | |
217 | 229 | let totalAssetAmountWithProfit = (totalAssetAmount + calcTotalProfit()) | |
218 | - | let totalAmount = match assetIdBytes { | |
219 | - | case u: Unit => | |
220 | - | min([totalAssetAmountWithProfit, wavesBalance(this).available]) | |
221 | - | case b: ByteVector => | |
222 | - | min([totalAssetAmountWithProfit, assetBalance(this, b)]) | |
223 | - | case _ => | |
224 | - | throw("Match error") | |
225 | - | } | |
230 | + | let totalAmount = min([totalAssetAmountWithProfit, getMaxAssetAvailable()]) | |
226 | 231 | if ((totalLpAmount == 0)) | |
227 | 232 | then 0 | |
228 | 233 | else totalAmount | |
229 | 234 | } | |
230 | 235 | ||
231 | 236 | ||
232 | 237 | func getCurrentPrice () = if ((totalLpAmount != 0)) | |
233 | 238 | then fraction(toBigInt(getTotalAssetAmountWithProfitOrMaxAvailable()), scale18BigInt, toBigInt(totalLpAmount)) | |
234 | 239 | else scale18BigInt | |
240 | + | ||
241 | + | ||
242 | + | func getRemainingBlocks () = if ((emissionPerBlock == 0)) | |
243 | + | then 0 | |
244 | + | else fraction((getMaxAssetAvailable() - getTotalAssetAmountWithProfitOrMaxAvailable()), 1, emissionPerBlock) | |
235 | 245 | ||
236 | 246 | ||
237 | 247 | func getUserStakingNodesData (userAddress) = { | |
238 | 248 | let nodesRaw = valueOrElse(getString(this, keyUserStakingNodes(userAddress)), "") | |
239 | 249 | let sharesRaw = valueOrElse(getString(this, keyUserStakingNodesShares(userAddress)), "") | |
240 | 250 | let nodesList = if ((nodesRaw == "")) | |
241 | 251 | then nil | |
242 | 252 | else split(nodesRaw, SEP) | |
243 | 253 | let sharesStringList = if ((sharesRaw == "")) | |
244 | 254 | then nil | |
245 | 255 | else split(sharesRaw, SEP) | |
246 | 256 | let sharesList = { | |
247 | 257 | let $l = sharesStringList | |
248 | 258 | let $s = size($l) | |
249 | 259 | let $acc0 = nil | |
250 | 260 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
251 | 261 | then $a | |
252 | 262 | else stringListToIntListHelper($a, $l[$i]) | |
253 | 263 | ||
254 | 264 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
255 | 265 | then $a | |
256 | 266 | else throw("List size exceeds 20") | |
257 | 267 | ||
258 | 268 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
259 | 269 | } | |
260 | 270 | $Tuple2(nodesList, sharesList) | |
261 | 271 | } | |
262 | 272 | ||
263 | 273 | ||
264 | 274 | func calcAssetFromLp (lpAmount) = max([0, toInt(fraction(toBigInt(lpAmount), getCurrentPrice(), scale18BigInt))]) | |
265 | 275 | ||
266 | 276 | ||
267 | 277 | func calcLpFromAsset (assetAmount) = max([0, toInt(fraction(toBigInt(assetAmount), scale18BigInt, getCurrentPrice()))]) | |
268 | 278 | ||
269 | 279 | ||
270 | 280 | func getUserLpAmount (userAddress) = valueOrElse(getInteger(this, keyUserLpAmount(userAddress)), 0) | |
271 | 281 | ||
272 | 282 | ||
273 | 283 | func getUserLockedLpAmount (userAddress) = valueOrElse(getInteger(this, keyUserLockedLpAmount(userAddress)), 0) | |
274 | 284 | ||
275 | 285 | ||
276 | 286 | func getUserAvailableAssetsToWithdraw (userAddress) = { | |
277 | 287 | let userLpAmount = getUserLpAmount(userAddress) | |
278 | 288 | calcAssetFromLp(userLpAmount) | |
279 | 289 | } | |
280 | 290 | ||
281 | 291 | ||
282 | 292 | func getStakeActions (i,userAddress) = { | |
283 | 293 | let checks = [if ((size(i.payments) == 1)) | |
284 | 294 | then true | |
285 | 295 | else throwErr("should include 1 payment"), if ((i.payments[0].assetId == assetIdBytes)) | |
286 | 296 | then true | |
287 | 297 | else throwErr(("payment should be in " + assetIdString)), if ((i.payments[0].amount > 0)) | |
288 | 298 | then true | |
289 | 299 | else "payment amount should be greater than 0", if ((size(fromBase58String(userAddress)) == ADDRESS_BYTES_SIZE)) | |
290 | 300 | then true | |
291 | 301 | else throwErr("user address is not valid")] | |
292 | 302 | if ((checks == checks)) | |
293 | 303 | then { | |
294 | 304 | let paymentAmount = i.payments[0].amount | |
295 | 305 | let paymentLpAmount = toInt(fraction(toBigInt(paymentAmount), scale18BigInt, getCurrentPrice())) | |
296 | 306 | let userLpAmount = getUserLpAmount(userAddress) | |
297 | 307 | let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0) | |
298 | 308 | let newTotalLpAmount = (totalLpAmount + paymentLpAmount) | |
299 | 309 | let newTotalAssetAmount = toInt(fraction(toBigInt(newTotalLpAmount), getCurrentPrice(), scale18BigInt)) | |
300 | 310 | let newUserLpAmount = (userLpAmount + paymentLpAmount) | |
301 | 311 | let newUserTotalStakedAmount = (userTotalStakedAmount + paymentAmount) | |
302 | 312 | [StringEntry(keyHistory("stake", userAddress, i.transactionId), formatHistory(calcTotalProfit(), getCurrentPrice(), totalLpAmount, totalAssetAmount)), IntegerEntry(keyTotalLpAmount, newTotalLpAmount), IntegerEntry(keyTotalAssetAmount, newTotalAssetAmount), IntegerEntry(keyUserLpAmount(userAddress), newUserLpAmount), IntegerEntry(keyUserTotalAssetStaked(userAddress), newUserTotalStakedAmount), IntegerEntry(keyStartBlock, height)] | |
303 | 313 | } | |
304 | 314 | else throw("Strict value is not equal to itself.") | |
305 | 315 | } | |
306 | 316 | ||
307 | 317 | ||
308 | 318 | func getWithdrawActions (i,lpAssetWithdrawAmount) = { | |
309 | 319 | let userAddress = toString(i.caller) | |
310 | 320 | let userLpAmount = getUserLpAmount(userAddress) | |
311 | 321 | let check = [if ((lpAssetWithdrawAmount > 0)) | |
312 | 322 | then true | |
313 | 323 | else throwErr("LP amount should be more than 0"), if ((userLpAmount >= lpAssetWithdrawAmount)) | |
314 | 324 | then true | |
315 | 325 | else throwErr((("cannot withdraw more than available LP (" + toString(userLpAmount)) + ")"))] | |
316 | 326 | if ((check == check)) | |
317 | 327 | then { | |
318 | 328 | let newUserLpAmount = (userLpAmount - lpAssetWithdrawAmount) | |
319 | 329 | let withdrawAssetAmount = toInt(fraction(toBigInt(lpAssetWithdrawAmount), getCurrentPrice(), scale18BigInt)) | |
320 | 330 | let newTotalLpAmount = (totalLpAmount - lpAssetWithdrawAmount) | |
321 | 331 | let newTotalAssetAmount = toInt(fraction(toBigInt(newTotalLpAmount), getCurrentPrice(), scale18BigInt)) | |
322 | 332 | let userTotalAssetWithdrawn = valueOrElse(getInteger(this, keyUserTotalAssetWithdrawn(userAddress)), 0) | |
323 | 333 | let newUserTotalAssetWithdrawn = (userTotalAssetWithdrawn + withdrawAssetAmount) | |
324 | 334 | [StringEntry(keyHistory("withdraw", userAddress, i.transactionId), formatHistory(calcTotalProfit(), getCurrentPrice(), totalLpAmount, totalAssetAmount)), IntegerEntry(keyTotalLpAmount, newTotalLpAmount), IntegerEntry(keyTotalAssetAmount, newTotalAssetAmount), IntegerEntry(keyUserLpAmount(userAddress), newUserLpAmount), IntegerEntry(keyUserTotalAssetWithdrawn(userAddress), newUserTotalAssetWithdrawn), IntegerEntry(keyStartBlock, height), ScriptTransfer(i.caller, withdrawAssetAmount, assetIdBytes)] | |
325 | 335 | } | |
326 | 336 | else throw("Strict value is not equal to itself.") | |
327 | 337 | } | |
328 | 338 | ||
329 | 339 | ||
330 | 340 | func getSetStakingNodeActions (userAddress,nodeAddress,nodeShare) = { | |
331 | 341 | let check = [if ((size(fromBase58String(userAddress)) == ADDRESS_BYTES_SIZE)) | |
332 | 342 | then true | |
333 | 343 | else throwErr("user address is not valid"), if ((size(fromBase58String(nodeAddress)) == ADDRESS_BYTES_SIZE)) | |
334 | 344 | then true | |
335 | 345 | else throwErr("node address is not valid")] | |
336 | 346 | if ((check == check)) | |
337 | 347 | then [StringEntry(keyUserStakingNodes(userAddress), nodeAddress), StringEntry(keyUserStakingNodesShares(userAddress), toString(nodeShare))] | |
338 | 348 | else throw("Strict value is not equal to itself.") | |
339 | 349 | } | |
340 | 350 | ||
341 | 351 | ||
342 | 352 | @Callable(i) | |
343 | 353 | func setEmissionPerBlock (emissionPerBlock) = { | |
344 | 354 | let check = [if ((i.caller == this)) | |
345 | 355 | then true | |
346 | 356 | else throwErr("permission denied")] | |
347 | 357 | if ((check == check)) | |
348 | 358 | then [IntegerEntry(keyTotalAssetAmount, getTotalAssetAmountWithProfitOrMaxAvailable()), IntegerEntry(keyStartBlock, height), IntegerEntry(keyEmissionPerBlock, max([0, emissionPerBlock]))] | |
349 | 359 | else throw("Strict value is not equal to itself.") | |
350 | 360 | } | |
351 | 361 | ||
352 | 362 | ||
353 | 363 | ||
354 | 364 | @Callable(i) | |
355 | 365 | func setEmissionPeriodInBlocks (p) = { | |
356 | 366 | let check = [if ((p > 0)) | |
357 | 367 | then true | |
358 | 368 | else throwErr("emission period should be greater than 0"), if ((i.caller == this)) | |
359 | 369 | then true | |
360 | 370 | else throwErr("permission denied")] | |
361 | 371 | if ((check == check)) | |
362 | 372 | then [IntegerEntry(keyTotalAssetAmount, getTotalAssetAmountWithProfitOrMaxAvailable()), IntegerEntry(keyStartBlock, height), IntegerEntry(keyEmissionPeriodInBlocks, p)] | |
363 | 373 | else throw("Strict value is not equal to itself.") | |
364 | 374 | } | |
365 | 375 | ||
366 | 376 | ||
367 | 377 | ||
368 | 378 | @Callable(i) | |
369 | 379 | func stake () = { | |
370 | 380 | let userAddress = toString(i.caller) | |
371 | 381 | getStakeActions(i, userAddress) | |
372 | 382 | } | |
373 | 383 | ||
374 | 384 | ||
375 | 385 | ||
376 | 386 | @Callable(i) | |
377 | 387 | func stakeFor (userAddress) = getStakeActions(i, userAddress) | |
378 | 388 | ||
379 | 389 | ||
380 | 390 | ||
381 | 391 | @Callable(i) | |
382 | 392 | func withdraw (withdrawAssetAmount) = { | |
383 | 393 | let userAddress = toString(i.caller) | |
384 | 394 | let userLpAmount = getUserLpAmount(userAddress) | |
385 | 395 | let lpAmountToWithdraw = toInt(fraction(toBigInt(withdrawAssetAmount), scale18BigInt, getCurrentPrice())) | |
386 | 396 | let userAvailableAssetToWithdraw = getUserAvailableAssetsToWithdraw(userAddress) | |
387 | 397 | let minWithdrawAssetAmount = toInt(fraction(getCurrentPrice(), toBigInt(1), scale18BigInt, CEILING)) | |
388 | 398 | let check = [if ((withdrawAssetAmount > 0)) | |
389 | 399 | then true | |
390 | 400 | else throwErr("withdraw amount should be more than 0"), if ((userAvailableAssetToWithdraw >= withdrawAssetAmount)) | |
391 | 401 | then true | |
392 | 402 | else throwErr((("cannot withdraw more than available (" + toString(userAvailableAssetToWithdraw)) + ")")), if ((withdrawAssetAmount >= minWithdrawAssetAmount)) | |
393 | 403 | then true | |
394 | 404 | else throwErr((("withdraw amount is too small. Min: (" + toString(minWithdrawAssetAmount)) + ")"))] | |
395 | 405 | if ((check == check)) | |
396 | 406 | then getWithdrawActions(i, min([userLpAmount, (lpAmountToWithdraw + 1)])) | |
397 | 407 | else throw("Strict value is not equal to itself.") | |
398 | 408 | } | |
399 | 409 | ||
400 | 410 | ||
401 | 411 | ||
402 | 412 | @Callable(i) | |
403 | 413 | func setStakingNode (nodeAddress) = { | |
404 | 414 | let userAddress = toString(i.caller) | |
405 | 415 | getSetStakingNodeActions(userAddress, nodeAddress, 100) | |
406 | 416 | } | |
407 | 417 | ||
408 | 418 | ||
409 | 419 | ||
410 | 420 | @Callable(i) | |
411 | 421 | func stakeAndSetStakingNode (nodeAddress) = { | |
412 | 422 | let userAddress = toString(i.caller) | |
413 | 423 | (getStakeActions(i, userAddress) ++ getSetStakingNodeActions(userAddress, nodeAddress, 100)) | |
414 | 424 | } | |
415 | 425 | ||
416 | 426 | ||
417 | 427 | ||
418 | 428 | @Callable(i) | |
419 | 429 | func airdrop (addressList,amountList) = { | |
420 | 430 | func sum (accum,next) = (accum + next) | |
421 | 431 | ||
422 | 432 | let amountListSum = { | |
423 | 433 | let $l = amountList | |
424 | 434 | let $s = size($l) | |
425 | 435 | let $acc0 = 0 | |
426 | 436 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
427 | 437 | then $a | |
428 | 438 | else sum($a, $l[$i]) | |
429 | 439 | ||
430 | 440 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
431 | 441 | then $a | |
432 | 442 | else throw("List size exceeds 90") | |
433 | 443 | ||
434 | 444 | $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($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90) | |
435 | 445 | } | |
436 | 446 | let check = [if ((size(i.payments) == 1)) | |
437 | 447 | then true | |
438 | 448 | else throwErr("should include 1 payment"), if ((i.payments[0].assetId == assetIdBytes)) | |
439 | 449 | then true | |
440 | 450 | else throwErr(("payment should be in " + assetIdString)), if ((i.payments[0].amount > 0)) | |
441 | 451 | then true | |
442 | 452 | else "payment amount should be greater than 0", if ((size(addressList) == size(amountList))) | |
443 | 453 | then true | |
444 | 454 | else throwErr("addressList should be same size as amountList"), if ((i.payments[0].amount >= amountListSum)) | |
445 | 455 | then true | |
446 | 456 | else throwErr("payment amount is less than sum of amountList")] | |
447 | 457 | if ((check == check)) | |
448 | 458 | then { | |
449 | 459 | func getAirdropStateChanges (accum,assetAmount) = { | |
450 | - | let $ | |
451 | - | let result = $ | |
452 | - | let index = $ | |
453 | - | let totalLp = $ | |
460 | + | let $t01449114527 = accum | |
461 | + | let result = $t01449114527._1 | |
462 | + | let index = $t01449114527._2 | |
463 | + | let totalLp = $t01449114527._3 | |
454 | 464 | let addedLpAmount = calcLpFromAsset(assetAmount) | |
455 | 465 | let userLockedLpKey = keyUserLockedLpAmount(addressList[index]) | |
456 | 466 | let oldLpAmount = valueOrElse(getInteger(this, userLockedLpKey), 0) | |
457 | 467 | $Tuple3((result :+ IntegerEntry(userLockedLpKey, (oldLpAmount + addedLpAmount))), (index + 1), (totalLp + addedLpAmount)) | |
458 | 468 | } | |
459 | 469 | ||
460 | - | let $ | |
470 | + | let $t01485814967 = { | |
461 | 471 | let $l = amountList | |
462 | 472 | let $s = size($l) | |
463 | 473 | let $acc0 = $Tuple3(nil, 0, 0) | |
464 | 474 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
465 | 475 | then $a | |
466 | 476 | else getAirdropStateChanges($a, $l[$i]) | |
467 | 477 | ||
468 | 478 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
469 | 479 | then $a | |
470 | 480 | else throw("List size exceeds 90") | |
471 | 481 | ||
472 | 482 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_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), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90) | |
473 | 483 | } | |
474 | - | let airdropEntries = $ | |
475 | - | let _a = $ | |
476 | - | let addedTotalLockedLpAmount = $ | |
484 | + | let airdropEntries = $t01485814967._1 | |
485 | + | let _a = $t01485814967._2 | |
486 | + | let addedTotalLockedLpAmount = $t01485814967._3 | |
477 | 487 | ([IntegerEntry(keyTotalLockedLpAmount, (totalLockedLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalLpAmount, (totalLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalAssetAmount, (totalAssetAmount + amountListSum))] ++ airdropEntries) | |
478 | 488 | } | |
479 | 489 | else throw("Strict value is not equal to itself.") | |
480 | 490 | } | |
481 | 491 | ||
482 | 492 | ||
483 | 493 | ||
484 | 494 | @Callable(i) | |
485 | 495 | func getUserAssetsREADONLY (userAddress) = { | |
486 | 496 | let userLpAmount = getUserLpAmount(userAddress) | |
487 | 497 | let userLockedLpAmount = getUserLockedLpAmount(userAddress) | |
488 | 498 | let userLockedAssetAmount = calcAssetFromLp(userLockedLpAmount) | |
489 | 499 | let userAvailableAssetToWithdraw = getUserAvailableAssetsToWithdraw(userAddress) | |
490 | 500 | let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0) | |
491 | 501 | let userTotalAssetWithdrawn = valueOrElse(getInteger(this, keyUserTotalAssetWithdrawn(userAddress)), 0) | |
492 | - | let $ | |
493 | - | let userStakingNodesList = $ | |
494 | - | let userStakingNodeSharesList = $ | |
502 | + | let $t01615516247 = getUserStakingNodesData(userAddress) | |
503 | + | let userStakingNodesList = $t01615516247._1 | |
504 | + | let userStakingNodeSharesList = $t01615516247._2 | |
495 | 505 | $Tuple2(nil, $Tuple9(userLpAmount, userAvailableAssetToWithdraw, getCurrentPrice(), userTotalStakedAmount, userTotalAssetWithdrawn, userLockedLpAmount, userLockedAssetAmount, userStakingNodesList, userStakingNodeSharesList)) | |
496 | 506 | } | |
497 | 507 | ||
498 | 508 | ||
499 | 509 | ||
500 | 510 | @Callable(i) | |
501 | - | func getTotalAssetsREADONLY () = $Tuple2(nil, $ | |
511 | + | func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple6(totalLpAmount, getTotalAssetAmountWithProfitOrMaxAvailable(), getCurrentPrice(), totalLockedLpAmount, calcAssetFromLp(totalLockedLpAmount), getRemainingBlocks())) | |
502 | 512 | ||
503 | 513 | ||
504 | 514 | ||
505 | 515 | @Callable(i) | |
506 | 516 | func voteForTxId (txId) = { | |
507 | 517 | let callerAddressString = toBase58String(i.caller.bytes) | |
508 | 518 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
509 | 519 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
510 | 520 | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
511 | 521 | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
512 | 522 | then true | |
513 | 523 | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
514 | 524 | then true | |
515 | 525 | else (value(allowedTxIdOption) != txId)) | |
516 | 526 | then true | |
517 | 527 | else throwErr((txId + " is already allowed"))] | |
518 | 528 | if ((err == err)) | |
519 | 529 | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
520 | 530 | else throw("Strict value is not equal to itself.") | |
521 | 531 | } | |
522 | 532 | ||
523 | 533 | ||
524 | 534 | @Verifier(tx) | |
525 | 535 | func verify () = { | |
526 | 536 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
527 | 537 | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
528 | 538 | then false | |
529 | 539 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
530 | 540 | if (byAdmins) | |
531 | 541 | then true | |
532 | 542 | else byOwner | |
533 | 543 | } | |
534 | 544 |
github/deemru/w8io/169f3d6 124.90 ms ◑