tx · 556Be5k5EjPD2vuid1nCnZpCfRs4d5WiK28kakswQGTG

3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt:  -0.01300000 Waves

2023.12.11 10:15 [2881724] smart account 3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt > SELF 0.00000000 Waves

{ "type": 13, "id": "556Be5k5EjPD2vuid1nCnZpCfRs4d5WiK28kakswQGTG", "fee": 1300000, "feeAssetId": null, "timestamp": 1702278925489, "version": 1, "sender": "3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt", "senderPublicKey": "FACNGaFYnR8yFbQFg9sRBpzGVCyzMyLeVw3JMhGQT1wn", "proofs": [ "4JR1jhZfSHJdmigYYgV2jyJLRLnRS9r1qPV5KSqMcCPMyJUWjVn7mckp4pZDywwibgK7iJQQzS6S5P3PoSXBkrSU" ], "script": "base64:BgIWCAISBAoCCAESBQoDGBEBEgMKAQgSADAADGNvbnRyYWN0RmlsZQIRbDJtcF9zdGFraW5nLnJpZGUAA1NFUAICX18ABnNjYWxlOACAwtcvAAdzY2FsZTE4AICAkLu61q3wDQANc2NhbGUxOEJpZ0ludAkAtgIBBQdzY2FsZTE4ABJBRERSRVNTX0JZVEVTX1NJWkUAGgANQkxPQ0tTX0lOX0RBWQCgCwAMYWRtaW5BZGRyZXNzCQERQGV4dHJOYXRpdmUoMTA2MikBAiMzTXBzN0NacUI5blViRWlyWXlDTU1vQTdWYnFyeEx2SkZTQgEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cACmtleUFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAATa2V5RW1pc3Npb25QZXJCbG9jawkAuQkCCQDMCAICAiVzCQDMCAICEGVtaXNzaW9uUGVyQmxvY2sFA25pbAUDU0VQABlrZXlFbWlzc2lvblBlcmlvZEluQmxvY2tzCQC5CQIJAMwIAgICJXMJAMwIAgIWZW1pc3Npb25QZ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AAEDSR0MDEwODQwMTA5MzIJARdnZXRVc2VyU3Rha2luZ05vZGVzRGF0YQEFC3VzZXJBZGRyZXNzBBR1c2VyU3Rha2luZ05vZGVzTGlzdAgFDSR0MDEwODQwMTA5MzICXzEEGXVzZXJTdGFraW5nTm9kZVNoYXJlc0xpc3QIBQ0kdDAxMDg0MDEwOTMyAl8yCQCUCgIFA25pbAkAnAoKBQx1c2VyTHBBbW91bnQFHHVzZXJBdmFpbGFibGVBc3NldFRvV2l0aGRyYXcJAQ9nZXRDdXJyZW50UHJpY2UABRV1c2VyVG90YWxTdGFrZWRBbW91bnQFF3VzZXJUb3RhbEFzc2V0V2l0aGRyYXduBRJ1c2VyTG9ja2VkTHBBbW91bnQFFXVzZXJMb2NrZWRBc3NldEFtb3VudAUUdXNlclN0YWtpbmdOb2Rlc0xpc3QFGXVzZXJTdGFraW5nTm9kZVNoYXJlc0xpc3QJARJnZXRSZW1haW5pbmdCbG9ja3MAAWkBFmdldFRvdGFsQXNzZXRzUkVBRE9OTFkACQCUCgIFA25pbAkAmAoGBQ10b3RhbExwQW1vdW50CQErZ2V0VG90YWxBc3NldEFtb3VudFdpdGhQcm9maXRPck1heEF2YWlsYWJsZQEFBmhlaWdodAkBD2dldEN1cnJlbnRQcmljZQAFE3RvdGFsTG9ja2VkTHBBbW91bnQJAQ9jYWxjQXNzZXRGcm9tTHACBRN0b3RhbExvY2tlZExwQW1vdW50BQZoZWlnaHQJARJnZXRSZW1haW5pbmdCbG9ja3MAACFBdsc=", "chainId": 84, "height": 2881724, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9Yntvwin2bHmAWhDYMe7vJp83gXvStWcLpftuYU8SxWo Next: 3bYHppvuGMPf4D2KpSxGmrc5ka1ccq6UBsabKgr1j2aH Diff:
OldNewDifferences
171171 func getStakeActions (i,userAddress,stakeHeight) = {
172172 let checks = [if ((stakeHeight >= startBlock))
173173 then true
174- else throwErr(makeString(["stakeHeight(", toString(stakeHeight), ") is greater than startBlock(", toString(startBlock), ")"], "")), if ((size(i.payments) == 1))
174+ else throwErr(makeString(["stakeHeight(", toString(stakeHeight), ") is lower than startBlock(", toString(startBlock), ")"], "")), if ((size(i.payments) == 1))
175175 then true
176176 else throwErr("should include 1 payment"), if ((i.payments[0].assetId == assetIdBytes))
177177 then true
232232 then true
233233 else throwErr("permission denied"), if ((airdropHeight >= startBlock))
234234 then true
235- else throwErr(makeString(["airdropHeight(", toString(airdropHeight), ") is greater than startBlock(", toString(startBlock), ")"], "")), if ((size(i.payments) == 1))
235+ else throwErr(makeString(["airdropHeight(", toString(airdropHeight), ") is lower than startBlock(", toString(startBlock), ")"], "")), if ((size(i.payments) == 1))
236236 then true
237237 else throwErr("should include 1 payment"), if ((i.payments[0].assetId == assetIdBytes))
238238 then true
246246 if ((check == check))
247247 then {
248248 func getAirdropStateChanges (accum,assetAmount) = {
249- let $t085178568 = accum
250- let result = $t085178568._1
251- let index = $t085178568._2
252- let totalLp = $t085178568._3
253- let processedList = $t085178568._4
249+ let $t085138564 = accum
250+ let result = $t085138564._1
251+ let index = $t085138564._2
252+ let totalLp = $t085138564._3
253+ let processedList = $t085138564._4
254254 let addressString = addressList[index]
255255 let address = match addressFromString(addressString) {
256256 case adr: Address =>
271271 else throw("Strict value is not equal to itself.")
272272 }
273273
274- let $t093479464 = {
274+ let $t093439460 = {
275275 let $l = amountList
276276 let $s = size($l)
277277 let $acc0 = $Tuple4(nil, 0, 0, nil)
285285
286286 $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)
287287 }
288- let airdropEntries = $t093479464._1
289- let _a = $t093479464._2
290- let addedTotalLockedLpAmount = $t093479464._3
291- let _b = $t093479464._4
288+ let airdropEntries = $t093439460._1
289+ let _a = $t093439460._2
290+ let addedTotalLockedLpAmount = $t093439460._3
291+ let _b = $t093439460._4
292292 let newTotalAsset = calcAssetFromLp((totalLpAmount + addedTotalLockedLpAmount), airdropHeight)
293293 ([IntegerEntry(keyTotalLockedLpAmount, (totalLockedLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalLpAmount, (totalLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalAssetAmount, newTotalAsset), IntegerEntry(keyStartBlock, airdropHeight)] ++ airdropEntries)
294294 }
305305 let userAvailableAssetToWithdraw = getUserAvailableAssetsToWithdraw(userAddress)
306306 let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0)
307307 let userTotalAssetWithdrawn = valueOrElse(getInteger(this, keyUserTotalAssetWithdrawn(userAddress)), 0)
308- let $t01084410936 = getUserStakingNodesData(userAddress)
309- let userStakingNodesList = $t01084410936._1
310- let userStakingNodeSharesList = $t01084410936._2
308+ let $t01084010932 = getUserStakingNodesData(userAddress)
309+ let userStakingNodesList = $t01084010932._1
310+ let userStakingNodeSharesList = $t01084010932._2
311311 $Tuple2(nil, $Tuple10(userLpAmount, userAvailableAssetToWithdraw, getCurrentPrice(), userTotalStakedAmount, userTotalAssetWithdrawn, userLockedLpAmount, userLockedAssetAmount, userStakingNodesList, userStakingNodeSharesList, getRemainingBlocks()))
312312 }
313313
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFile = "l2mp_staking.ride"
55
66 let SEP = "__"
77
88 let scale8 = 100000000
99
1010 let scale18 = 1000000000000000000
1111
1212 let scale18BigInt = toBigInt(scale18)
1313
1414 let ADDRESS_BYTES_SIZE = 26
1515
1616 let BLOCKS_IN_DAY = 1440
1717
1818 let adminAddress = addressFromStringValue("3Mps7CZqB9nUbEirYyCMMoA7VbqrxLvJFSB")
1919
2020 func throwErr (msg) = throw(((contractFile + ": ") + msg))
2121
2222
2323 let keyAssetId = makeString(["%s", "assetId"], SEP)
2424
2525 let keyEmissionPerBlock = makeString(["%s", "emissionPerBlock"], SEP)
2626
2727 let keyEmissionPeriodInBlocks = makeString(["%s", "emissionPeriodInBlocks"], SEP)
2828
2929 let keyStartBlock = makeString(["%s", "startBlock"], SEP)
3030
3131 let keyTotalLpAmount = makeString(["%s", "totalLpAmount"], SEP)
3232
3333 let keyTotalAssetAmount = makeString(["%s", "totalAssetAmount"], SEP)
3434
3535 let keyTotalLockedLpAmount = makeString(["%s", "totalLockedLpAmount"], SEP)
3636
3737 func keyUserLpAmount (userAddress) = makeString(["%s%s", "userLpAmount", userAddress], SEP)
3838
3939
4040 func keyUserLockedLpAmount (userAddress) = makeString(["%s%s", "userLockedLpAmount", userAddress], SEP)
4141
4242
4343 func keyUserStakingNodes (userAddress) = makeString(["%s%s", "userStakingNodes", userAddress], SEP)
4444
4545
4646 func keyUserStakingNodesShares (userAddress) = makeString(["%s%s", "userStakingNodesShares", userAddress], SEP)
4747
4848
4949 func keyUserTotalAssetWithdrawn (userAddress) = makeString(["%s%s", "totalAssetWithdrawn", userAddress], SEP)
5050
5151
5252 func keyUserTotalAssetStaked (userAddress) = makeString(["%s%s", "totalAssetStaked", userAddress], SEP)
5353
5454
5555 func keyHistory (type,userAddress,txId) = makeString(["%s%s%s", type, userAddress, toBase58String(txId)], SEP)
5656
5757
5858 func formatHistory (totalProfit,price,totalAssetAmount,totalLpAmount) = makeString(["%d%d%d%d", toString(totalProfit), toString(price), toString(totalAssetAmount), toString(totalLpAmount)], SEP)
5959
6060
6161 let totalLpAmount = valueOrElse(getInteger(this, keyTotalLpAmount), 0)
6262
6363 let totalAssetAmount = valueOrElse(getInteger(this, keyTotalAssetAmount), 0)
6464
6565 let totalLockedLpAmount = valueOrElse(getInteger(this, keyTotalLockedLpAmount), 0)
6666
6767 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
6868
6969 let assetIdBytes = if ((assetIdString == "WAVES"))
7070 then unit
7171 else fromBase58String(assetIdString)
7272
7373 let emissionPeriodInBlocks = valueOrElse(getInteger(this, keyEmissionPeriodInBlocks), BLOCKS_IN_DAY)
7474
7575 let emissionPerBlock = valueOrElse(getInteger(this, keyEmissionPerBlock), 0)
7676
7777 let emissionPerPeriod = (emissionPerBlock * emissionPeriodInBlocks)
7878
7979 let startBlock = valueOrElse(getInteger(this, keyStartBlock), height)
8080
8181 func stringListToIntListHelper (acc,value) = (acc :+ parseIntValue(value))
8282
8383
8484 func calcTotalProfitForHeight (h) = {
8585 let startPeriod = fraction(startBlock, 1, emissionPeriodInBlocks)
8686 let elapsedPeriods = ((h / emissionPeriodInBlocks) - startPeriod)
8787 max([0, (emissionPerPeriod * elapsedPeriods)])
8888 }
8989
9090
9191 func calcTotalProfit () = calcTotalProfitForHeight(height)
9292
9393
9494 func getMaxAssetAvailable () = match assetIdBytes {
9595 case u: Unit =>
9696 wavesBalance(this).available
9797 case b: ByteVector =>
9898 assetBalance(this, b)
9999 case _ =>
100100 throw("Match error")
101101 }
102102
103103
104104 func getTotalAssetAmountWithProfitOrMaxAvailable (atHeight) = {
105105 let totalAssetAmountWithProfit = (totalAssetAmount + calcTotalProfitForHeight(atHeight))
106106 let totalAmount = min([totalAssetAmountWithProfit, getMaxAssetAvailable()])
107107 if ((totalLpAmount == 0))
108108 then 0
109109 else totalAmount
110110 }
111111
112112
113113 func getPriceAtHeight (h) = if ((totalLpAmount != 0))
114114 then fraction(toBigInt(getTotalAssetAmountWithProfitOrMaxAvailable(h)), scale18BigInt, toBigInt(totalLpAmount))
115115 else scale18BigInt
116116
117117
118118 func getCurrentPrice () = getPriceAtHeight(height)
119119
120120
121121 func getRemainingBlocks () = if ((emissionPerBlock == 0))
122122 then 0
123123 else fraction((getMaxAssetAvailable() - getTotalAssetAmountWithProfitOrMaxAvailable(height)), 1, emissionPerBlock)
124124
125125
126126 func getUserStakingNodesData (userAddress) = {
127127 let nodesRaw = valueOrElse(getString(this, keyUserStakingNodes(userAddress)), "")
128128 let sharesRaw = valueOrElse(getString(this, keyUserStakingNodesShares(userAddress)), "")
129129 let nodesList = if ((nodesRaw == ""))
130130 then nil
131131 else split(nodesRaw, SEP)
132132 let sharesStringList = if ((sharesRaw == ""))
133133 then nil
134134 else split(sharesRaw, SEP)
135135 let sharesList = {
136136 let $l = sharesStringList
137137 let $s = size($l)
138138 let $acc0 = nil
139139 func $f0_1 ($a,$i) = if (($i >= $s))
140140 then $a
141141 else stringListToIntListHelper($a, $l[$i])
142142
143143 func $f0_2 ($a,$i) = if (($i >= $s))
144144 then $a
145145 else throw("List size exceeds 20")
146146
147147 $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)
148148 }
149149 $Tuple2(nodesList, sharesList)
150150 }
151151
152152
153153 func calcAssetFromLp (lpAmount,atHeight) = max([0, toInt(fraction(toBigInt(lpAmount), getPriceAtHeight(atHeight), scale18BigInt))])
154154
155155
156156 func calcLpFromAsset (assetAmount,atHeight) = max([0, toInt(fraction(toBigInt(assetAmount), scale18BigInt, getPriceAtHeight(atHeight)))])
157157
158158
159159 func getUserLpAmount (userAddress) = valueOrElse(getInteger(this, keyUserLpAmount(userAddress)), 0)
160160
161161
162162 func getUserLockedLpAmount (userAddress) = valueOrElse(getInteger(this, keyUserLockedLpAmount(userAddress)), 0)
163163
164164
165165 func getUserAvailableAssetsToWithdraw (userAddress) = {
166166 let userLpAmount = getUserLpAmount(userAddress)
167167 calcAssetFromLp(userLpAmount, height)
168168 }
169169
170170
171171 func getStakeActions (i,userAddress,stakeHeight) = {
172172 let checks = [if ((stakeHeight >= startBlock))
173173 then true
174- else throwErr(makeString(["stakeHeight(", toString(stakeHeight), ") is greater than startBlock(", toString(startBlock), ")"], "")), if ((size(i.payments) == 1))
174+ else throwErr(makeString(["stakeHeight(", toString(stakeHeight), ") is lower than startBlock(", toString(startBlock), ")"], "")), if ((size(i.payments) == 1))
175175 then true
176176 else throwErr("should include 1 payment"), if ((i.payments[0].assetId == assetIdBytes))
177177 then true
178178 else throwErr(("payment should be in " + assetIdString)), if ((i.payments[0].amount > 0))
179179 then true
180180 else "payment amount should be greater than 0", if ((size(fromBase58String(userAddress)) == ADDRESS_BYTES_SIZE))
181181 then true
182182 else throwErr("user address is not valid")]
183183 if ((checks == checks))
184184 then {
185185 let paymentAmount = i.payments[0].amount
186186 let paymentLpAmount = calcLpFromAsset(paymentAmount, stakeHeight)
187187 let userLpAmount = getUserLpAmount(userAddress)
188188 let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0)
189189 let newTotalLpAmount = (totalLpAmount + paymentLpAmount)
190190 let newTotalAssetAmount = calcAssetFromLp(newTotalLpAmount, stakeHeight)
191191 let newUserLpAmount = (userLpAmount + paymentLpAmount)
192192 let newUserTotalStakedAmount = (userTotalStakedAmount + paymentAmount)
193193 [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, stakeHeight)]
194194 }
195195 else throw("Strict value is not equal to itself.")
196196 }
197197
198198
199199 @Callable(i)
200200 func stakeForAdmin (userAddress,stakeHeight) = {
201201 let check = [if ((i.caller == adminAddress))
202202 then true
203203 else throwErr("permission denied")]
204204 if ((check == check))
205205 then getStakeActions(i, userAddress, stakeHeight)
206206 else throw("Strict value is not equal to itself.")
207207 }
208208
209209
210210
211211 @Callable(i)
212212 func airdrop (addressList,amountList,airdropHeight) = {
213213 func sum (accum,next) = if ((0 > next))
214214 then throwErr("negative amount value in amountList")
215215 else (accum + next)
216216
217217 let amountListSum = {
218218 let $l = amountList
219219 let $s = size($l)
220220 let $acc0 = 0
221221 func $f0_1 ($a,$i) = if (($i >= $s))
222222 then $a
223223 else sum($a, $l[$i])
224224
225225 func $f0_2 ($a,$i) = if (($i >= $s))
226226 then $a
227227 else throw("List size exceeds 90")
228228
229229 $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)
230230 }
231231 let check = [if ((i.caller == adminAddress))
232232 then true
233233 else throwErr("permission denied"), if ((airdropHeight >= startBlock))
234234 then true
235- else throwErr(makeString(["airdropHeight(", toString(airdropHeight), ") is greater than startBlock(", toString(startBlock), ")"], "")), if ((size(i.payments) == 1))
235+ else throwErr(makeString(["airdropHeight(", toString(airdropHeight), ") is lower than startBlock(", toString(startBlock), ")"], "")), if ((size(i.payments) == 1))
236236 then true
237237 else throwErr("should include 1 payment"), if ((i.payments[0].assetId == assetIdBytes))
238238 then true
239239 else throwErr(("payment should be in " + assetIdString)), if ((i.payments[0].amount > 0))
240240 then true
241241 else "payment amount should be greater than 0", if ((size(addressList) == size(amountList)))
242242 then true
243243 else throwErr("addressList should be same size as amountList"), if ((i.payments[0].amount >= amountListSum))
244244 then true
245245 else throwErr("payment amount is less than sum of amountList")]
246246 if ((check == check))
247247 then {
248248 func getAirdropStateChanges (accum,assetAmount) = {
249- let $t085178568 = accum
250- let result = $t085178568._1
251- let index = $t085178568._2
252- let totalLp = $t085178568._3
253- let processedList = $t085178568._4
249+ let $t085138564 = accum
250+ let result = $t085138564._1
251+ let index = $t085138564._2
252+ let totalLp = $t085138564._3
253+ let processedList = $t085138564._4
254254 let addressString = addressList[index]
255255 let address = match addressFromString(addressString) {
256256 case adr: Address =>
257257 adr
258258 case _ =>
259259 throwErr("invalid address in addressList")
260260 }
261261 let ch = [if (!(containsElement(processedList, address)))
262262 then true
263263 else throwErr("duplicate address is addressList")]
264264 if ((ch == ch))
265265 then {
266266 let addedLpAmount = calcLpFromAsset(assetAmount, airdropHeight)
267267 let userLockedLpKey = keyUserLockedLpAmount(addressString)
268268 let oldLpAmount = valueOrElse(getInteger(this, userLockedLpKey), 0)
269269 $Tuple4((result :+ IntegerEntry(userLockedLpKey, (oldLpAmount + addedLpAmount))), (index + 1), (totalLp + addedLpAmount), (processedList :+ address))
270270 }
271271 else throw("Strict value is not equal to itself.")
272272 }
273273
274- let $t093479464 = {
274+ let $t093439460 = {
275275 let $l = amountList
276276 let $s = size($l)
277277 let $acc0 = $Tuple4(nil, 0, 0, nil)
278278 func $f1_1 ($a,$i) = if (($i >= $s))
279279 then $a
280280 else getAirdropStateChanges($a, $l[$i])
281281
282282 func $f1_2 ($a,$i) = if (($i >= $s))
283283 then $a
284284 else throw("List size exceeds 90")
285285
286286 $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)
287287 }
288- let airdropEntries = $t093479464._1
289- let _a = $t093479464._2
290- let addedTotalLockedLpAmount = $t093479464._3
291- let _b = $t093479464._4
288+ let airdropEntries = $t093439460._1
289+ let _a = $t093439460._2
290+ let addedTotalLockedLpAmount = $t093439460._3
291+ let _b = $t093439460._4
292292 let newTotalAsset = calcAssetFromLp((totalLpAmount + addedTotalLockedLpAmount), airdropHeight)
293293 ([IntegerEntry(keyTotalLockedLpAmount, (totalLockedLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalLpAmount, (totalLpAmount + addedTotalLockedLpAmount)), IntegerEntry(keyTotalAssetAmount, newTotalAsset), IntegerEntry(keyStartBlock, airdropHeight)] ++ airdropEntries)
294294 }
295295 else throw("Strict value is not equal to itself.")
296296 }
297297
298298
299299
300300 @Callable(i)
301301 func getUserAssetsREADONLY (userAddress) = {
302302 let userLpAmount = getUserLpAmount(userAddress)
303303 let userLockedLpAmount = getUserLockedLpAmount(userAddress)
304304 let userLockedAssetAmount = calcAssetFromLp(userLockedLpAmount, height)
305305 let userAvailableAssetToWithdraw = getUserAvailableAssetsToWithdraw(userAddress)
306306 let userTotalStakedAmount = valueOrElse(getInteger(this, keyUserTotalAssetStaked(userAddress)), 0)
307307 let userTotalAssetWithdrawn = valueOrElse(getInteger(this, keyUserTotalAssetWithdrawn(userAddress)), 0)
308- let $t01084410936 = getUserStakingNodesData(userAddress)
309- let userStakingNodesList = $t01084410936._1
310- let userStakingNodeSharesList = $t01084410936._2
308+ let $t01084010932 = getUserStakingNodesData(userAddress)
309+ let userStakingNodesList = $t01084010932._1
310+ let userStakingNodeSharesList = $t01084010932._2
311311 $Tuple2(nil, $Tuple10(userLpAmount, userAvailableAssetToWithdraw, getCurrentPrice(), userTotalStakedAmount, userTotalAssetWithdrawn, userLockedLpAmount, userLockedAssetAmount, userStakingNodesList, userStakingNodeSharesList, getRemainingBlocks()))
312312 }
313313
314314
315315
316316 @Callable(i)
317317 func getTotalAssetsREADONLY () = $Tuple2(nil, $Tuple6(totalLpAmount, getTotalAssetAmountWithProfitOrMaxAvailable(height), getCurrentPrice(), totalLockedLpAmount, calcAssetFromLp(totalLockedLpAmount, height), getRemainingBlocks()))
318318
319319

github/deemru/w8io/169f3d6 
61.13 ms