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