tx · Hq2jw7mQaM9AKWTJ8tdbXiGETFKmrbGH7GJNMr3cuhiX 3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt: -0.01200000 Waves 2023.12.11 09:59 [2881708] smart account 3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt > SELF 0.00000000 Waves
{ "type": 13, "id": "Hq2jw7mQaM9AKWTJ8tdbXiGETFKmrbGH7GJNMr3cuhiX", "fee": 1200000, "feeAssetId": null, "timestamp": 1702278050495, "version": 1, "sender": "3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt", "senderPublicKey": "FACNGaFYnR8yFbQFg9sRBpzGVCyzMyLeVw3JMhGQT1wn", "proofs": [ "rE9wKLG8kB4HyCeoRmZZxxWjiz9unyy1q3w83iDn5vCRXuoE1VSK953xDAtz9CwxYuXRix8d7j3bLvnJFgUVqfu" ], "script": "base64:BgIWCAISBAoCCAESBQoDGBEBEgMKAQgSADAADGNvbnRyYWN0RmlsZQIRbDJtcF9zdGFraW5nLnJpZGUAA1NFUAICX18ABnNjYWxlOACAwtcvAAdzY2FsZTE4AICAkLu61q3wDQANc2NhbGUxOEJpZ0ludAkAtgIBBQdzY2FsZTE4ABJBRERSRVNTX0JZVEVTX1NJWkUAGgANQkxPQ0tTX0lOX0RBWQCgCwAMYWRtaW5BZGRyZXNzCQERQGV4dHJOYXRpdmUoMTA2MikBAiMzTXBzN0NacUI5blViRWlyWXlDTU1vQTdWYnFyeEx2SkZTQgEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cACmtleUFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAATa2V5RW1pc3Npb25QZXJCbG9jawkAuQkCCQDMCAICAiVzCQDMCAICEGVtaXNzaW9uUGVyQmxvY2sFA25pbAUDU0VQABlrZXlFbWlzc2lvblBlcmlvZEluQmxvY2tzCQC5CQIJAMwIAgICJXMJAMwIAgIWZW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tpbmdOb2Rlc0xpc3QIBQ0kdDAxMDY3MjEwNzY0Al8xBBl1c2VyU3Rha2luZ05vZGVTaGFyZXNMaXN0CAUNJHQwMTA2NzIxMDc2NAJfMgkAlAoCBQNuaWwJAJwKCgUMdXNlckxwQW1vdW50BRx1c2VyQXZhaWxhYmxlQXNzZXRUb1dpdGhkcmF3CQEPZ2V0Q3VycmVudFByaWNlAAUVdXNlclRvdGFsU3Rha2VkQW1vdW50BRd1c2VyVG90YWxBc3NldFdpdGhkcmF3bgUSdXNlckxvY2tlZExwQW1vdW50BRV1c2VyTG9ja2VkQXNzZXRBbW91bnQFFHVzZXJTdGFraW5nTm9kZXNMaXN0BRl1c2VyU3Rha2luZ05vZGVTaGFyZXNMaXN0CQESZ2V0UmVtYWluaW5nQmxvY2tzAAFpARZnZXRUb3RhbEFzc2V0c1JFQURPTkxZAAkAlAoCBQNuaWwJAJgKBgUNdG90YWxMcEFtb3VudAkBK2dldFRvdGFsQXNzZXRBbW91bnRXaXRoUHJvZml0T3JNYXhBdmFpbGFibGUBBQZoZWlnaHQJAQ9nZXRDdXJyZW50UHJpY2UABRN0b3RhbExvY2tlZExwQW1vdW50CQEPY2FsY0Fzc2V0RnJvbUxwAgUTdG90YWxMb2NrZWRMcEFtb3VudAUGaGVpZ2h0CQESZ2V0UmVtYWluaW5nQmxvY2tzAABtidG5", "chainId": 84, "height": 2881708, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D5dPMa5Sz2QcHQrn5piwiHR2YZkjh1MZbUJt5MG5gath Next: 86f1wMkBdKnMiHu4udATPPUkn5M37Bhy7qGtJPuoxPDc Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | let ADDRESS_BYTES_SIZE = 26 | |
15 | 15 | ||
16 | 16 | let BLOCKS_IN_DAY = 1440 | |
17 | + | ||
18 | + | let adminAddress = addressFromStringValue("3Mps7CZqB9nUbEirYyCMMoA7VbqrxLvJFSB") | |
17 | 19 | ||
18 | 20 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
19 | 21 | ||
196 | 198 | ||
197 | 199 | @Callable(i) | |
198 | 200 | func stakeForAdmin (userAddress,stakeHeight) = { | |
199 | - | let check = [if ((i.caller == | |
201 | + | let check = [if ((i.caller == adminAddress)) | |
200 | 202 | then true | |
201 | 203 | else throwErr("permission denied")] | |
202 | 204 | if ((check == check)) | |
226 | 228 | ||
227 | 229 | $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) | |
228 | 230 | } | |
229 | - | let check = [if ((i.caller == | |
231 | + | let check = [if ((i.caller == adminAddress)) | |
230 | 232 | then true | |
231 | 233 | else throwErr("permission denied"), if ((size(i.payments) == 1)) | |
232 | 234 | then true | |
242 | 244 | if ((check == check)) | |
243 | 245 | then { | |
244 | 246 | func getAirdropStateChanges (accum,assetAmount) = { | |
245 | - | let $ | |
246 | - | let result = $ | |
247 | - | let index = $ | |
248 | - | let totalLp = $ | |
249 | - | let processedList = $ | |
247 | + | let $t083528403 = accum | |
248 | + | let result = $t083528403._1 | |
249 | + | let index = $t083528403._2 | |
250 | + | let totalLp = $t083528403._3 | |
251 | + | let processedList = $t083528403._4 | |
250 | 252 | let addressString = addressList[index] | |
251 | 253 | let address = match addressFromString(addressString) { | |
252 | 254 | case adr: Address => | |
267 | 269 | else throw("Strict value is not equal to itself.") | |
268 | 270 | } | |
269 | 271 | ||
270 | - | let $ | |
272 | + | let $t091829299 = { | |
271 | 273 | let $l = amountList | |
272 | 274 | let $s = size($l) | |
273 | 275 | let $acc0 = $Tuple4(nil, 0, 0, nil) | |
281 | 283 | ||
282 | 284 | $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) | |
283 | 285 | } | |
284 | - | let airdropEntries = $ | |
285 | - | let _a = $ | |
286 | - | let addedTotalLockedLpAmount = $ | |
287 | - | let _b = $ | |
286 | + | let airdropEntries = $t091829299._1 | |
287 | + | let _a = $t091829299._2 | |
288 | + | let addedTotalLockedLpAmount = $t091829299._3 | |
289 | + | let _b = $t091829299._4 | |
288 | 290 | let newTotalAsset = calcAssetFromLp((totalLpAmount + addedTotalLockedLpAmount), airdropHeight) | |
289 | 291 | ([IntegerEntry(keyTotalLockedLpAmount, (totalLockedLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalLpAmount, (totalLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalAssetAmount, newTotalAsset), IntegerEntry(keyStartBlock, height)] ++ airdropEntries) | |
290 | 292 | } | |
301 | 303 | let userAvailableAssetToWithdraw = getUserAvailableAssetsToWithdraw(userAddress) | |
302 | 304 | let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0) | |
303 | 305 | let userTotalAssetWithdrawn = valueOrElse(getInteger(this, keyUserTotalAssetWithdrawn(userAddress)), 0) | |
304 | - | let $ | |
305 | - | let userStakingNodesList = $ | |
306 | - | let userStakingNodeSharesList = $ | |
306 | + | let $t01067210764 = getUserStakingNodesData(userAddress) | |
307 | + | let userStakingNodesList = $t01067210764._1 | |
308 | + | let userStakingNodeSharesList = $t01067210764._2 | |
307 | 309 | $Tuple2(nil, $Tuple10(userLpAmount, userAvailableAssetToWithdraw, getCurrentPrice(), userTotalStakedAmount, userTotalAssetWithdrawn, userLockedLpAmount, userLockedAssetAmount, userStakingNodesList, userStakingNodeSharesList, getRemainingBlocks())) | |
308 | 310 | } | |
309 | 311 |
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 | + | ||
18 | + | let adminAddress = addressFromStringValue("3Mps7CZqB9nUbEirYyCMMoA7VbqrxLvJFSB") | |
17 | 19 | ||
18 | 20 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
19 | 21 | ||
20 | 22 | ||
21 | 23 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
22 | 24 | ||
23 | 25 | let keyEmissionPerBlock = makeString(["%s", "emissionPerBlock"], SEP) | |
24 | 26 | ||
25 | 27 | let keyEmissionPeriodInBlocks = makeString(["%s", "emissionPeriodInBlocks"], SEP) | |
26 | 28 | ||
27 | 29 | let keyStartBlock = makeString(["%s", "startBlock"], SEP) | |
28 | 30 | ||
29 | 31 | let keyTotalLpAmount = makeString(["%s", "totalLpAmount"], SEP) | |
30 | 32 | ||
31 | 33 | let keyTotalAssetAmount = makeString(["%s", "totalAssetAmount"], SEP) | |
32 | 34 | ||
33 | 35 | let keyTotalLockedLpAmount = makeString(["%s", "totalLockedLpAmount"], SEP) | |
34 | 36 | ||
35 | 37 | func keyUserLpAmount (userAddress) = makeString(["%s%s", "userLpAmount", userAddress], SEP) | |
36 | 38 | ||
37 | 39 | ||
38 | 40 | func keyUserLockedLpAmount (userAddress) = makeString(["%s%s", "userLockedLpAmount", userAddress], SEP) | |
39 | 41 | ||
40 | 42 | ||
41 | 43 | func keyUserStakingNodes (userAddress) = makeString(["%s%s", "userStakingNodes", userAddress], SEP) | |
42 | 44 | ||
43 | 45 | ||
44 | 46 | func keyUserStakingNodesShares (userAddress) = makeString(["%s%s", "userStakingNodesShares", userAddress], SEP) | |
45 | 47 | ||
46 | 48 | ||
47 | 49 | func keyUserTotalAssetWithdrawn (userAddress) = makeString(["%s%s", "totalAssetWithdrawn", userAddress], SEP) | |
48 | 50 | ||
49 | 51 | ||
50 | 52 | func keyUserTotalAssetStaked (userAddress) = makeString(["%s%s", "totalAssetStaked", userAddress], SEP) | |
51 | 53 | ||
52 | 54 | ||
53 | 55 | func keyHistory (type,userAddress,txId) = makeString(["%s%s%s", type, userAddress, toBase58String(txId)], SEP) | |
54 | 56 | ||
55 | 57 | ||
56 | 58 | func formatHistory (totalProfit,price,totalAssetAmount,totalLpAmount) = makeString(["%d%d%d%d", toString(totalProfit), toString(price), toString(totalAssetAmount), toString(totalLpAmount)], SEP) | |
57 | 59 | ||
58 | 60 | ||
59 | 61 | let totalLpAmount = valueOrElse(getInteger(this, keyTotalLpAmount), 0) | |
60 | 62 | ||
61 | 63 | let totalAssetAmount = valueOrElse(getInteger(this, keyTotalAssetAmount), 0) | |
62 | 64 | ||
63 | 65 | let totalLockedLpAmount = valueOrElse(getInteger(this, keyTotalLockedLpAmount), 0) | |
64 | 66 | ||
65 | 67 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
66 | 68 | ||
67 | 69 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
68 | 70 | then unit | |
69 | 71 | else fromBase58String(assetIdString) | |
70 | 72 | ||
71 | 73 | let emissionPeriodInBlocks = valueOrElse(getInteger(this, keyEmissionPeriodInBlocks), BLOCKS_IN_DAY) | |
72 | 74 | ||
73 | 75 | let emissionPerBlock = valueOrElse(getInteger(this, keyEmissionPerBlock), 0) | |
74 | 76 | ||
75 | 77 | let emissionPerPeriod = (emissionPerBlock * emissionPeriodInBlocks) | |
76 | 78 | ||
77 | 79 | func stringListToIntListHelper (acc,value) = (acc :+ parseIntValue(value)) | |
78 | 80 | ||
79 | 81 | ||
80 | 82 | func calcTotalProfitForHeight (h) = { | |
81 | 83 | let startBlock = valueOrElse(getInteger(this, keyStartBlock), height) | |
82 | 84 | let startPeriod = fraction(startBlock, 1, emissionPeriodInBlocks) | |
83 | 85 | let elapsedPeriods = ((h / emissionPeriodInBlocks) - startPeriod) | |
84 | 86 | max([0, (emissionPerPeriod * elapsedPeriods)]) | |
85 | 87 | } | |
86 | 88 | ||
87 | 89 | ||
88 | 90 | func calcTotalProfit () = calcTotalProfitForHeight(height) | |
89 | 91 | ||
90 | 92 | ||
91 | 93 | func getMaxAssetAvailable () = match assetIdBytes { | |
92 | 94 | case u: Unit => | |
93 | 95 | wavesBalance(this).available | |
94 | 96 | case b: ByteVector => | |
95 | 97 | assetBalance(this, b) | |
96 | 98 | case _ => | |
97 | 99 | throw("Match error") | |
98 | 100 | } | |
99 | 101 | ||
100 | 102 | ||
101 | 103 | func getTotalAssetAmountWithProfitOrMaxAvailable (atHeight) = { | |
102 | 104 | let totalAssetAmountWithProfit = (totalAssetAmount + calcTotalProfitForHeight(atHeight)) | |
103 | 105 | let totalAmount = min([totalAssetAmountWithProfit, getMaxAssetAvailable()]) | |
104 | 106 | if ((totalLpAmount == 0)) | |
105 | 107 | then 0 | |
106 | 108 | else totalAmount | |
107 | 109 | } | |
108 | 110 | ||
109 | 111 | ||
110 | 112 | func getPriceAtHeight (h) = if ((totalLpAmount != 0)) | |
111 | 113 | then fraction(toBigInt(getTotalAssetAmountWithProfitOrMaxAvailable(h)), scale18BigInt, toBigInt(totalLpAmount)) | |
112 | 114 | else scale18BigInt | |
113 | 115 | ||
114 | 116 | ||
115 | 117 | func getCurrentPrice () = getPriceAtHeight(height) | |
116 | 118 | ||
117 | 119 | ||
118 | 120 | func getRemainingBlocks () = if ((emissionPerBlock == 0)) | |
119 | 121 | then 0 | |
120 | 122 | else fraction((getMaxAssetAvailable() - getTotalAssetAmountWithProfitOrMaxAvailable(height)), 1, emissionPerBlock) | |
121 | 123 | ||
122 | 124 | ||
123 | 125 | func getUserStakingNodesData (userAddress) = { | |
124 | 126 | let nodesRaw = valueOrElse(getString(this, keyUserStakingNodes(userAddress)), "") | |
125 | 127 | let sharesRaw = valueOrElse(getString(this, keyUserStakingNodesShares(userAddress)), "") | |
126 | 128 | let nodesList = if ((nodesRaw == "")) | |
127 | 129 | then nil | |
128 | 130 | else split(nodesRaw, SEP) | |
129 | 131 | let sharesStringList = if ((sharesRaw == "")) | |
130 | 132 | then nil | |
131 | 133 | else split(sharesRaw, SEP) | |
132 | 134 | let sharesList = { | |
133 | 135 | let $l = sharesStringList | |
134 | 136 | let $s = size($l) | |
135 | 137 | let $acc0 = nil | |
136 | 138 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
137 | 139 | then $a | |
138 | 140 | else stringListToIntListHelper($a, $l[$i]) | |
139 | 141 | ||
140 | 142 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
141 | 143 | then $a | |
142 | 144 | else throw("List size exceeds 20") | |
143 | 145 | ||
144 | 146 | $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) | |
145 | 147 | } | |
146 | 148 | $Tuple2(nodesList, sharesList) | |
147 | 149 | } | |
148 | 150 | ||
149 | 151 | ||
150 | 152 | func calcAssetFromLp (lpAmount,atHeight) = max([0, toInt(fraction(toBigInt(lpAmount), getPriceAtHeight(atHeight), scale18BigInt))]) | |
151 | 153 | ||
152 | 154 | ||
153 | 155 | func calcLpFromAsset (assetAmount,atHeight) = max([0, toInt(fraction(toBigInt(assetAmount), scale18BigInt, getPriceAtHeight(atHeight)))]) | |
154 | 156 | ||
155 | 157 | ||
156 | 158 | func getUserLpAmount (userAddress) = valueOrElse(getInteger(this, keyUserLpAmount(userAddress)), 0) | |
157 | 159 | ||
158 | 160 | ||
159 | 161 | func getUserLockedLpAmount (userAddress) = valueOrElse(getInteger(this, keyUserLockedLpAmount(userAddress)), 0) | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | func getUserAvailableAssetsToWithdraw (userAddress) = { | |
163 | 165 | let userLpAmount = getUserLpAmount(userAddress) | |
164 | 166 | calcAssetFromLp(userLpAmount, height) | |
165 | 167 | } | |
166 | 168 | ||
167 | 169 | ||
168 | 170 | func getClearStakingNodesActions (userAddress) = [DeleteEntry(keyUserStakingNodes(userAddress)), DeleteEntry(keyUserStakingNodesShares(userAddress))] | |
169 | 171 | ||
170 | 172 | ||
171 | 173 | func getStakeActions (i,userAddress,stakeHeight) = { | |
172 | 174 | let checks = [if ((size(i.payments) == 1)) | |
173 | 175 | then true | |
174 | 176 | else throwErr("should include 1 payment"), if ((i.payments[0].assetId == assetIdBytes)) | |
175 | 177 | then true | |
176 | 178 | else throwErr(("payment should be in " + assetIdString)), if ((i.payments[0].amount > 0)) | |
177 | 179 | then true | |
178 | 180 | else "payment amount should be greater than 0", if ((size(fromBase58String(userAddress)) == ADDRESS_BYTES_SIZE)) | |
179 | 181 | then true | |
180 | 182 | else throwErr("user address is not valid")] | |
181 | 183 | if ((checks == checks)) | |
182 | 184 | then { | |
183 | 185 | let paymentAmount = i.payments[0].amount | |
184 | 186 | let paymentLpAmount = calcLpFromAsset(paymentAmount, stakeHeight) | |
185 | 187 | let userLpAmount = getUserLpAmount(userAddress) | |
186 | 188 | let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0) | |
187 | 189 | let newTotalLpAmount = (totalLpAmount + paymentLpAmount) | |
188 | 190 | let newTotalAssetAmount = calcAssetFromLp(newTotalLpAmount, stakeHeight) | |
189 | 191 | let newUserLpAmount = (userLpAmount + paymentLpAmount) | |
190 | 192 | let newUserTotalStakedAmount = (userTotalStakedAmount + paymentAmount) | |
191 | 193 | [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)] | |
192 | 194 | } | |
193 | 195 | else throw("Strict value is not equal to itself.") | |
194 | 196 | } | |
195 | 197 | ||
196 | 198 | ||
197 | 199 | @Callable(i) | |
198 | 200 | func stakeForAdmin (userAddress,stakeHeight) = { | |
199 | - | let check = [if ((i.caller == | |
201 | + | let check = [if ((i.caller == adminAddress)) | |
200 | 202 | then true | |
201 | 203 | else throwErr("permission denied")] | |
202 | 204 | if ((check == check)) | |
203 | 205 | then getStakeActions(i, userAddress, stakeHeight) | |
204 | 206 | else throw("Strict value is not equal to itself.") | |
205 | 207 | } | |
206 | 208 | ||
207 | 209 | ||
208 | 210 | ||
209 | 211 | @Callable(i) | |
210 | 212 | func airdrop (addressList,amountList,airdropHeight) = { | |
211 | 213 | func sum (accum,next) = if ((0 > next)) | |
212 | 214 | then throwErr("negative amount value in amountList") | |
213 | 215 | else (accum + next) | |
214 | 216 | ||
215 | 217 | let amountListSum = { | |
216 | 218 | let $l = amountList | |
217 | 219 | let $s = size($l) | |
218 | 220 | let $acc0 = 0 | |
219 | 221 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
220 | 222 | then $a | |
221 | 223 | else sum($a, $l[$i]) | |
222 | 224 | ||
223 | 225 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
224 | 226 | then $a | |
225 | 227 | else throw("List size exceeds 90") | |
226 | 228 | ||
227 | 229 | $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) | |
228 | 230 | } | |
229 | - | let check = [if ((i.caller == | |
231 | + | let check = [if ((i.caller == adminAddress)) | |
230 | 232 | then true | |
231 | 233 | else throwErr("permission denied"), if ((size(i.payments) == 1)) | |
232 | 234 | then true | |
233 | 235 | else throwErr("should include 1 payment"), if ((i.payments[0].assetId == assetIdBytes)) | |
234 | 236 | then true | |
235 | 237 | else throwErr(("payment should be in " + assetIdString)), if ((i.payments[0].amount > 0)) | |
236 | 238 | then true | |
237 | 239 | else "payment amount should be greater than 0", if ((size(addressList) == size(amountList))) | |
238 | 240 | then true | |
239 | 241 | else throwErr("addressList should be same size as amountList"), if ((i.payments[0].amount >= amountListSum)) | |
240 | 242 | then true | |
241 | 243 | else throwErr("payment amount is less than sum of amountList")] | |
242 | 244 | if ((check == check)) | |
243 | 245 | then { | |
244 | 246 | func getAirdropStateChanges (accum,assetAmount) = { | |
245 | - | let $ | |
246 | - | let result = $ | |
247 | - | let index = $ | |
248 | - | let totalLp = $ | |
249 | - | let processedList = $ | |
247 | + | let $t083528403 = accum | |
248 | + | let result = $t083528403._1 | |
249 | + | let index = $t083528403._2 | |
250 | + | let totalLp = $t083528403._3 | |
251 | + | let processedList = $t083528403._4 | |
250 | 252 | let addressString = addressList[index] | |
251 | 253 | let address = match addressFromString(addressString) { | |
252 | 254 | case adr: Address => | |
253 | 255 | adr | |
254 | 256 | case _ => | |
255 | 257 | throwErr("invalid address in addressList") | |
256 | 258 | } | |
257 | 259 | let ch = [if (!(containsElement(processedList, address))) | |
258 | 260 | then true | |
259 | 261 | else throwErr("duplicate address is addressList")] | |
260 | 262 | if ((ch == ch)) | |
261 | 263 | then { | |
262 | 264 | let addedLpAmount = calcLpFromAsset(assetAmount, airdropHeight) | |
263 | 265 | let userLockedLpKey = keyUserLockedLpAmount(addressString) | |
264 | 266 | let oldLpAmount = valueOrElse(getInteger(this, userLockedLpKey), 0) | |
265 | 267 | $Tuple4((result :+ IntegerEntry(userLockedLpKey, (oldLpAmount + addedLpAmount))), (index + 1), (totalLp + addedLpAmount), (processedList :+ address)) | |
266 | 268 | } | |
267 | 269 | else throw("Strict value is not equal to itself.") | |
268 | 270 | } | |
269 | 271 | ||
270 | - | let $ | |
272 | + | let $t091829299 = { | |
271 | 273 | let $l = amountList | |
272 | 274 | let $s = size($l) | |
273 | 275 | let $acc0 = $Tuple4(nil, 0, 0, nil) | |
274 | 276 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
275 | 277 | then $a | |
276 | 278 | else getAirdropStateChanges($a, $l[$i]) | |
277 | 279 | ||
278 | 280 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
279 | 281 | then $a | |
280 | 282 | else throw("List size exceeds 90") | |
281 | 283 | ||
282 | 284 | $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) | |
283 | 285 | } | |
284 | - | let airdropEntries = $ | |
285 | - | let _a = $ | |
286 | - | let addedTotalLockedLpAmount = $ | |
287 | - | let _b = $ | |
286 | + | let airdropEntries = $t091829299._1 | |
287 | + | let _a = $t091829299._2 | |
288 | + | let addedTotalLockedLpAmount = $t091829299._3 | |
289 | + | let _b = $t091829299._4 | |
288 | 290 | let newTotalAsset = calcAssetFromLp((totalLpAmount + addedTotalLockedLpAmount), airdropHeight) | |
289 | 291 | ([IntegerEntry(keyTotalLockedLpAmount, (totalLockedLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalLpAmount, (totalLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalAssetAmount, newTotalAsset), IntegerEntry(keyStartBlock, height)] ++ airdropEntries) | |
290 | 292 | } | |
291 | 293 | else throw("Strict value is not equal to itself.") | |
292 | 294 | } | |
293 | 295 | ||
294 | 296 | ||
295 | 297 | ||
296 | 298 | @Callable(i) | |
297 | 299 | func getUserAssetsREADONLY (userAddress) = { | |
298 | 300 | let userLpAmount = getUserLpAmount(userAddress) | |
299 | 301 | let userLockedLpAmount = getUserLockedLpAmount(userAddress) | |
300 | 302 | let userLockedAssetAmount = calcAssetFromLp(userLockedLpAmount, height) | |
301 | 303 | let userAvailableAssetToWithdraw = getUserAvailableAssetsToWithdraw(userAddress) | |
302 | 304 | let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0) | |
303 | 305 | let userTotalAssetWithdrawn = valueOrElse(getInteger(this, keyUserTotalAssetWithdrawn(userAddress)), 0) | |
304 | - | let $ | |
305 | - | let userStakingNodesList = $ | |
306 | - | let userStakingNodeSharesList = $ | |
306 | + | let $t01067210764 = getUserStakingNodesData(userAddress) | |
307 | + | let userStakingNodesList = $t01067210764._1 | |
308 | + | let userStakingNodeSharesList = $t01067210764._2 | |
307 | 309 | $Tuple2(nil, $Tuple10(userLpAmount, userAvailableAssetToWithdraw, getCurrentPrice(), userTotalStakedAmount, userTotalAssetWithdrawn, userLockedLpAmount, userLockedAssetAmount, userStakingNodesList, userStakingNodeSharesList, getRemainingBlocks())) | |
308 | 310 | } | |
309 | 311 | ||
310 | 312 | ||
311 | 313 | ||
312 | 314 | @Callable(i) | |
313 | 315 | func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple6(totalLpAmount, getTotalAssetAmountWithProfitOrMaxAvailable(height), getCurrentPrice(), totalLockedLpAmount, calcAssetFromLp(totalLockedLpAmount, height), getRemainingBlocks())) | |
314 | 316 | ||
315 | 317 |
github/deemru/w8io/026f985 56.97 ms ◑