tx · H1vN3gaTNtFoRFFQE8FCXBZhZsroz5URutGNLpVR8kHT

3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1:  -0.01200000 Waves

2024.01.09 16:24 [2924005] smart account 3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1 > SELF 0.00000000 Waves

{ "type": 13, "id": "H1vN3gaTNtFoRFFQE8FCXBZhZsroz5URutGNLpVR8kHT", "fee": 1200000, "feeAssetId": null, "timestamp": 1704806673268, "version": 2, "chainId": 84, "sender": "3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1", "senderPublicKey": "7c3qLtcJ7EaPS2JDjXv8MBbd4kpyc6R27wcn5GgvZhur", "proofs": [ "jEUWBAgk35dcqA1wLv8JbvVXGh4bFqEFVDJ4R56y73y48zVw6SEXzDa2auhEqbPBiKB1WLsGyHRJhZQjaBtgEua" ], "script": "base64:BgIbCAISBgoECAEBARIDCgEIEgMKAQgSABIDCgEIHQAMY29udHJhY3RGaWxlAhB2ZXN0aW5nX25lby5yaWRlAANTRVACAl9fAAhJRFNfTElTVAkAzAgCAAAJAMwIAgABCQDMCAIAAgkAzAgCAAMJAMwIAgAECQDMCAIABQkAzAgCAAYJAMwIAgAHCQDMCAIACAkAzAgCAAkJAMwIAgAKCQDMCAIACwkAzAgCAAwJAMwIAgANCQDMCAIADgkAzAgCAA8JAMwIAgAQCQDMCAIAEQkAzAgCABIJAMwIAgATCQDMCAIAFAkAzAgCABUJAMwIAgAWCQDMCAIAFwkAzAgCABgJAMwIAgAZCQDMCAIAGgkAzAgCABsJAMwIAgAcCQDMCAIAHQUDbmlsABFNQVhfVkVTVElOR19DT1VOVAkAkAMBBQhJRFNfTElTVAEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cACmtleUFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAANYXNzZXRJZFN0cmluZwkBC3ZhbH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udAgFCyR0MDk3MDQ5NzY5Al8yBA5oaXN0b3J5QWN0aW9ucwkAzAgCCQEMSW50ZWdlckVudHJ5AgkBEWtleVZlc3RpbmdIaXN0b3J5AwIHY2xhaW1lZAULdXNlckFkZHJlc3MJANgEAQgFAWkNdHJhbnNhY3Rpb25JZAULdG90YWxBbW91bnQFA25pbAMJAGYCBQt0b3RhbEFtb3VudAAACQDOCAIFDGNsYWltQWN0aW9ucwUOaGlzdG9yeUFjdGlvbnMJAQh0aHJvd0VycgECEG5vdGhpbmcgdG8gY2xhaW0BaQEQY2xhaW1BbGxSRUFET05MWQELdXNlckFkZHJlc3MEDSR0MDEwMDgwMTAxMzUJARJnZXRDbGFpbUFsbEFjdGlvbnMBBQt1c2VyQWRkcmVzcwQCX2EIBQ0kdDAxMDA4MDEwMTM1Al8xBAt0b3RhbEFtb3VudAgFDSR0MDEwMDgwMTAxMzUCXzIJAJQKAgUDbmlsCQCUCgIFC3RvdGFsQW1vdW50CQESZ2V0VmVzdGluZ1VzZXJJbmZvAQULdXNlckFkZHJlc3MAlPDe0A==", "height": 2924005, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DWqrgmBr8MS9DmXUHuPDBtB5P6PbayEXpCsG6kEtXAZu Next: 2vZvNzE12untPy6REKjUMyssnbkAC7xu6CQRfD5FJJYK Diff:
OldNewDifferences
155155
156156 func getAllUserClaimActions (userAddress) = {
157157 func actionsHelper (acc,a) = {
158- let $t045784618 = acc
159- let allVestingsClaimActions = $t045784618._1
160- let sum = $t045784618._2
161- let $t046234699 = getUserClaimActions(userAddress, a)
162- let vestingClaimActions = $t046234699._1
163- let claimAmount = $t046234699._2
158+ let $t045774617 = acc
159+ let allVestingsClaimActions = $t045774617._1
160+ let sum = $t045774617._2
161+ let $t046224698 = getUserClaimActions(userAddress, a)
162+ let vestingClaimActions = $t046224698._1
163+ let claimAmount = $t046224698._2
164164 $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount))
165165 }
166166
181181
182182 func getMoveAllUnlockedToAccumulatorActions (userAddress) = {
183183 func actionsHelper (acc,a) = {
184- let $t049915032 = acc
185- let updateAllVestingsActions = $t049915032._1
186- let sum = $t049915032._2
187- let $t050375121 = getUpdateVestingActions(userAddress, a)
188- let updateVestingActions = $t050375121._1
189- let unlockedAmount = $t050375121._2
184+ let $t049905031 = acc
185+ let updateAllVestingsActions = $t049905031._1
186+ let sum = $t049905031._2
187+ let $t050365120 = getUpdateVestingActions(userAddress, a)
188+ let updateVestingActions = $t050365120._1
189+ let unlockedAmount = $t050365120._2
190190 $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount))
191191 }
192192
193- let $t052075295 = {
193+ let $t052065294 = {
194194 let $l = IDS_LIST
195195 let $s = size($l)
196196 let $acc0 = $Tuple2(nil, 0)
204204
205205 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30)
206206 }
207- let updateAllVestingsActions = $t052075295._1
208- let unlockedSum = $t052075295._2
207+ let updateAllVestingsActions = $t052065294._1
208+ let unlockedSum = $t052065294._2
209209 let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0)
210210 let updateAccumulatedActions = if ((unlockedSum != 0))
211211 then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))]
223223
224224
225225 func getClaimAllActions (userAddress) = {
226- let $t060636196 = if (!(containsElement(banList, userAddress)))
226+ let $t060626195 = if (!(containsElement(banList, userAddress)))
227227 then getAllUserClaimActions(userAddress)
228228 else $Tuple2(nil, 0)
229- let claimActions = $t060636196._1
230- let unlockedAmount = $t060636196._2
231- let $t061996289 = getClaimAccumulatedActions(userAddress)
232- let claimAccumulatedActions = $t061996289._1
233- let accumulatedAmount = $t061996289._2
229+ let claimActions = $t060626195._1
230+ let unlockedAmount = $t060626195._2
231+ let $t061986288 = getClaimAccumulatedActions(userAddress)
232+ let claimAccumulatedActions = $t061986288._1
233+ let accumulatedAmount = $t061986288._2
234234 let totalAmount = (unlockedAmount + accumulatedAmount)
235235 $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount)
236236 }
237237
238238
239+func getVestingUserInfo (userAddress) = {
240+ func helper (acc,id) = {
241+ let $t065026581 = parseUserVesting(userAddress, id)
242+ let vestingAmount = $t065026581._1
243+ let startBlock = $t065026581._2
244+ let lockLength = $t065026581._3
245+ let $t065866664 = getUserUnlockedAmount(userAddress, id)
246+ let unlockedAmount = $t065866664._1
247+ let remainingAmount = $t065866664._2
248+ if (if ((vestingAmount == 0))
249+ then true
250+ else containsElement(banList, userAddress))
251+ then acc
252+ else (acc :+ [vestingAmount, (startBlock + lockLength), unlockedAmount, remainingAmount])
253+ }
254+
255+ let $l = IDS_LIST
256+ let $s = size($l)
257+ let $acc0 = nil
258+ func $f0_1 ($a,$i) = if (($i >= $s))
259+ then $a
260+ else helper($a, $l[$i])
261+
262+ func $f0_2 ($a,$i) = if (($i >= $s))
263+ then $a
264+ else throw("List size exceeds 30")
265+
266+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30)
267+ }
268+
269+
239270 func getAvailableVestingId (userAddress) = {
240271 func helper (availableId,id) = {
241- let $t065086587 = parseUserVesting(userAddress, id)
242- let vestingAmount = $t065086587._1
243- let startBlock = $t065086587._2
244- let lockLength = $t065086587._3
272+ let $t069887067 = parseUserVesting(userAddress, id)
273+ let vestingAmount = $t069887067._1
274+ let startBlock = $t069887067._2
275+ let lockLength = $t069887067._3
245276 if ((vestingAmount > 0))
246277 then availableId
247278 else if ((availableId == -1))
297328
298329
299330 @Callable(i)
300-func claimAll () = {
301- let userAddress = toString(i.caller)
302- let $t080638128 = getClaimAllActions(userAddress)
303- let claimActions = $t080638128._1
304- let totalAmount = $t080638128._2
305- let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)]
306- if ((totalAmount > 0))
307- then (claimActions ++ historyActions)
308- else throwErr("nothing to claim")
309- }
310-
311-
312-
313-@Callable(i)
314331 func ban (userAddress) = {
315332 let checks = [if (if ((adminList == nil))
316333 then true
321338 else throwErr(makeString(["user already in a ban list:", userAddress], " "))]
322339 if ((checks == checks))
323340 then {
324- let $t086758763 = getMoveAllUnlockedToAccumulatorActions(userAddress)
325- let moveToAccumulatedActions = $t086758763._1
326- let _a = $t086758763._2
341+ let $t087668854 = getMoveAllUnlockedToAccumulatorActions(userAddress)
342+ let moveToAccumulatedActions = $t087668854._1
343+ let _a = $t087668854._2
327344 let addToBanListActions = [StringEntry(keyBanList, makeString_11C((banList :+ userAddress), "__"))]
328345 (moveToAccumulatedActions ++ addToBanListActions)
329346 }
357374 }
358375
359376
377+
378+@Callable(i)
379+func claimAll () = {
380+ let userAddress = toString(i.caller)
381+ let $t097049769 = getClaimAllActions(userAddress)
382+ let claimActions = $t097049769._1
383+ let totalAmount = $t097049769._2
384+ let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)]
385+ if ((totalAmount > 0))
386+ then (claimActions ++ historyActions)
387+ else throwErr("nothing to claim")
388+ }
389+
390+
391+
392+@Callable(i)
393+func claimAllREADONLY (userAddress) = {
394+ let $t01008010135 = getClaimAllActions(userAddress)
395+ let _a = $t01008010135._1
396+ let totalAmount = $t01008010135._2
397+ $Tuple2(nil, $Tuple2(totalAmount, getVestingUserInfo(userAddress)))
398+ }
399+
400+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFile = "vesting_neo.ride"
55
66 let SEP = "__"
77
88 let IDS_LIST = [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]
99
1010 let MAX_VESTING_COUNT = size(IDS_LIST)
1111
1212 func throwErr (msg) = throw(((contractFile + ": ") + msg))
1313
1414
1515 let keyAssetId = makeString(["%s", "assetId"], SEP)
1616
1717 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
1818
1919 let assetIdBytes = if ((assetIdString == "WAVES"))
2020 then unit
2121 else fromBase58String(assetIdString)
2222
2323 let keyAdminList = makeString(["%s", "adminList"], SEP)
2424
2525 let keyBanList = makeString(["%s", "banList"], SEP)
2626
2727 let adminList = match getString(this, keyAdminList) {
2828 case s: String =>
2929 split(s, SEP)
3030 case _ =>
3131 nil
3232 }
3333
3434 let banList = match getString(this, keyBanList) {
3535 case s: String =>
3636 if ((s == ""))
3737 then nil
3838 else split_51C(s, SEP)
3939 case _ =>
4040 nil
4141 }
4242
4343 func isValidAddressString (addressString) = match addressFromString(addressString) {
4444 case a: Address =>
4545 true
4646 case _ =>
4747 false
4848 }
4949
5050
5151 func keyUserVesting (userAddress,id) = {
5252 let checks = [if (isValidAddressString(userAddress))
5353 then true
5454 else throwErr(makeString(["address is not valid:", userAddress], " ")), if (if ((id >= 0))
5555 then (MAX_VESTING_COUNT > id)
5656 else false)
5757 then true
5858 else throwErr(makeString(["id should be less than", toString(MAX_VESTING_COUNT), "got:", toString(id)], " "))]
5959 if ((checks == checks))
6060 then makeString(["%s%s%d", "vesting", userAddress, toString(id)], SEP)
6161 else throw("Strict value is not equal to itself.")
6262 }
6363
6464
6565 func keyUserAccumulated (userAddress) = {
6666 let checks = [if (isValidAddressString(userAddress))
6767 then true
6868 else throwErr(makeString(["address is not valid:", userAddress], " "))]
6969 if ((checks == checks))
7070 then makeString(["%s%s", "accumulated", userAddress], SEP)
7171 else throw("Strict value is not equal to itself.")
7272 }
7373
7474
7575 func formatUserVesting (vestingAmount,startBlock,lockLength) = {
7676 let checks = [if ((vestingAmount >= 0))
7777 then true
7878 else throwErr("vesting amount cannot be negative"), if ((startBlock >= 0))
7979 then true
8080 else throwErr("start block cannot be negative"), if ((lockLength >= 0))
8181 then true
8282 else throwErr("lock length cannot be negative")]
8383 if ((checks == checks))
8484 then makeString(["%d%d%d", toString(vestingAmount), toString(startBlock), toString(lockLength)], SEP)
8585 else throw("Strict value is not equal to itself.")
8686 }
8787
8888
8989 func parseUserVesting (userAddress,id) = match getString(this, keyUserVesting(userAddress, id)) {
9090 case rawString: String =>
9191 let splitString = split(rawString, SEP)
9292 let vestingAmount = parseIntValue(splitString[1])
9393 let startBlock = parseIntValue(splitString[2])
9494 let lockLength = parseIntValue(splitString[3])
9595 $Tuple3(vestingAmount, startBlock, lockLength)
9696 case _ =>
9797 $Tuple3(0, 0, 0)
9898 }
9999
100100
101101 func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", userAddress, action, txId], SEP)
102102
103103
104104 func calcUnlockedAmount (amount,startBlock,lockLength) = {
105105 let elapsedBlocks = (height - startBlock)
106106 let unlockedAmount = if (if ((lockLength != 0))
107107 then (elapsedBlocks > 0)
108108 else false)
109109 then min([fraction(amount, elapsedBlocks, lockLength), amount])
110110 else 0
111111 $Tuple2(unlockedAmount, (amount - unlockedAmount))
112112 }
113113
114114
115115 func getUserUnlockedAmount (userAddress,id) = {
116116 let $t032093288 = parseUserVesting(userAddress, id)
117117 let vestingAmount = $t032093288._1
118118 let startBlock = $t032093288._2
119119 let lockLength = $t032093288._3
120120 let $t032913388 = calcUnlockedAmount(vestingAmount, startBlock, lockLength)
121121 let unlockedAmount = $t032913388._1
122122 let remainingAmount = $t032913388._2
123123 $Tuple2(unlockedAmount, remainingAmount)
124124 }
125125
126126
127127 func getUpdateVestingActions (userAddress,id) = {
128128 let $t034953574 = parseUserVesting(userAddress, id)
129129 let vestingAmount = $t034953574._1
130130 let startBlock = $t034953574._2
131131 let lockLength = $t034953574._3
132132 let $t035773655 = getUserUnlockedAmount(userAddress, id)
133133 let unlockedAmount = $t035773655._1
134134 let remainingAmount = $t035773655._2
135135 let remainingBlocks = max([((startBlock + lockLength) - height), 0])
136136 let updateVestingActions = if ((unlockedAmount != 0))
137137 then if ((remainingBlocks != 0))
138138 then [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(remainingAmount, height, remainingBlocks))]
139139 else [DeleteEntry(keyUserVesting(userAddress, id))]
140140 else nil
141141 $Tuple2(updateVestingActions, unlockedAmount)
142142 }
143143
144144
145145 func getUserClaimActions (userAddress,id) = {
146146 let $t041194204 = getUpdateVestingActions(userAddress, id)
147147 let updateVestingActions = $t041194204._1
148148 let unlockedAmount = $t041194204._2
149149 let transferActions = if ((unlockedAmount != 0))
150150 then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)]
151151 else nil
152152 $Tuple2((updateVestingActions ++ transferActions), unlockedAmount)
153153 }
154154
155155
156156 func getAllUserClaimActions (userAddress) = {
157157 func actionsHelper (acc,a) = {
158- let $t045784618 = acc
159- let allVestingsClaimActions = $t045784618._1
160- let sum = $t045784618._2
161- let $t046234699 = getUserClaimActions(userAddress, a)
162- let vestingClaimActions = $t046234699._1
163- let claimAmount = $t046234699._2
158+ let $t045774617 = acc
159+ let allVestingsClaimActions = $t045774617._1
160+ let sum = $t045774617._2
161+ let $t046224698 = getUserClaimActions(userAddress, a)
162+ let vestingClaimActions = $t046224698._1
163+ let claimAmount = $t046224698._2
164164 $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount))
165165 }
166166
167167 let $l = IDS_LIST
168168 let $s = size($l)
169169 let $acc0 = $Tuple2(nil, 0)
170170 func $f0_1 ($a,$i) = if (($i >= $s))
171171 then $a
172172 else actionsHelper($a, $l[$i])
173173
174174 func $f0_2 ($a,$i) = if (($i >= $s))
175175 then $a
176176 else throw("List size exceeds 30")
177177
178178 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30)
179179 }
180180
181181
182182 func getMoveAllUnlockedToAccumulatorActions (userAddress) = {
183183 func actionsHelper (acc,a) = {
184- let $t049915032 = acc
185- let updateAllVestingsActions = $t049915032._1
186- let sum = $t049915032._2
187- let $t050375121 = getUpdateVestingActions(userAddress, a)
188- let updateVestingActions = $t050375121._1
189- let unlockedAmount = $t050375121._2
184+ let $t049905031 = acc
185+ let updateAllVestingsActions = $t049905031._1
186+ let sum = $t049905031._2
187+ let $t050365120 = getUpdateVestingActions(userAddress, a)
188+ let updateVestingActions = $t050365120._1
189+ let unlockedAmount = $t050365120._2
190190 $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount))
191191 }
192192
193- let $t052075295 = {
193+ let $t052065294 = {
194194 let $l = IDS_LIST
195195 let $s = size($l)
196196 let $acc0 = $Tuple2(nil, 0)
197197 func $f0_1 ($a,$i) = if (($i >= $s))
198198 then $a
199199 else actionsHelper($a, $l[$i])
200200
201201 func $f0_2 ($a,$i) = if (($i >= $s))
202202 then $a
203203 else throw("List size exceeds 30")
204204
205205 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30)
206206 }
207- let updateAllVestingsActions = $t052075295._1
208- let unlockedSum = $t052075295._2
207+ let updateAllVestingsActions = $t052065294._1
208+ let unlockedSum = $t052065294._2
209209 let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0)
210210 let updateAccumulatedActions = if ((unlockedSum != 0))
211211 then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))]
212212 else nil
213213 $Tuple2((updateAllVestingsActions ++ updateAccumulatedActions), unlockedSum)
214214 }
215215
216216
217217 func getClaimAccumulatedActions (userAddress) = {
218218 let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0)
219219 if ((oldAccumulated != 0))
220220 then $Tuple2([ScriptTransfer(addressFromStringValue(userAddress), oldAccumulated, assetIdBytes), DeleteEntry(keyUserAccumulated(userAddress))], oldAccumulated)
221221 else $Tuple2(nil, 0)
222222 }
223223
224224
225225 func getClaimAllActions (userAddress) = {
226- let $t060636196 = if (!(containsElement(banList, userAddress)))
226+ let $t060626195 = if (!(containsElement(banList, userAddress)))
227227 then getAllUserClaimActions(userAddress)
228228 else $Tuple2(nil, 0)
229- let claimActions = $t060636196._1
230- let unlockedAmount = $t060636196._2
231- let $t061996289 = getClaimAccumulatedActions(userAddress)
232- let claimAccumulatedActions = $t061996289._1
233- let accumulatedAmount = $t061996289._2
229+ let claimActions = $t060626195._1
230+ let unlockedAmount = $t060626195._2
231+ let $t061986288 = getClaimAccumulatedActions(userAddress)
232+ let claimAccumulatedActions = $t061986288._1
233+ let accumulatedAmount = $t061986288._2
234234 let totalAmount = (unlockedAmount + accumulatedAmount)
235235 $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount)
236236 }
237237
238238
239+func getVestingUserInfo (userAddress) = {
240+ func helper (acc,id) = {
241+ let $t065026581 = parseUserVesting(userAddress, id)
242+ let vestingAmount = $t065026581._1
243+ let startBlock = $t065026581._2
244+ let lockLength = $t065026581._3
245+ let $t065866664 = getUserUnlockedAmount(userAddress, id)
246+ let unlockedAmount = $t065866664._1
247+ let remainingAmount = $t065866664._2
248+ if (if ((vestingAmount == 0))
249+ then true
250+ else containsElement(banList, userAddress))
251+ then acc
252+ else (acc :+ [vestingAmount, (startBlock + lockLength), unlockedAmount, remainingAmount])
253+ }
254+
255+ let $l = IDS_LIST
256+ let $s = size($l)
257+ let $acc0 = nil
258+ func $f0_1 ($a,$i) = if (($i >= $s))
259+ then $a
260+ else helper($a, $l[$i])
261+
262+ func $f0_2 ($a,$i) = if (($i >= $s))
263+ then $a
264+ else throw("List size exceeds 30")
265+
266+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30)
267+ }
268+
269+
239270 func getAvailableVestingId (userAddress) = {
240271 func helper (availableId,id) = {
241- let $t065086587 = parseUserVesting(userAddress, id)
242- let vestingAmount = $t065086587._1
243- let startBlock = $t065086587._2
244- let lockLength = $t065086587._3
272+ let $t069887067 = parseUserVesting(userAddress, id)
273+ let vestingAmount = $t069887067._1
274+ let startBlock = $t069887067._2
275+ let lockLength = $t069887067._3
245276 if ((vestingAmount > 0))
246277 then availableId
247278 else if ((availableId == -1))
248279 then id
249280 else min([availableId, id])
250281 }
251282
252283 let availableId = {
253284 let $l = IDS_LIST
254285 let $s = size($l)
255286 let $acc0 = -1
256287 func $f0_1 ($a,$i) = if (($i >= $s))
257288 then $a
258289 else helper($a, $l[$i])
259290
260291 func $f0_2 ($a,$i) = if (($i >= $s))
261292 then $a
262293 else throw("List size exceeds 30")
263294
264295 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30)
265296 }
266297 if ((availableId == -1))
267298 then throwErr(makeString(["user exceeded max active vesting count: ", userAddress], " "))
268299 else availableId
269300 }
270301
271302
272303 func getNewVestingActions (userAddress,id,vestingAmount,startBlock,lockLength) = [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(vestingAmount, startBlock, lockLength))]
273304
274305
275306 @Callable(i)
276307 func vestingForUser (userAddress,vestingAmount,startBlock,lockLength) = {
277308 let check = [if ((size(i.payments) == 1))
278309 then true
279310 else throwErr("should be with exactly 1 payment"), if ((i.payments[0].assetId == assetIdBytes))
280311 then true
281312 else throwErr(makeString(["payment assetId should be: ", assetIdString], " ")), if ((i.payments[0].amount == vestingAmount))
282313 then true
283314 else throwErr("payment amount should be equal to vestingAmount"), if (if ((adminList == nil))
284315 then true
285316 else containsElement(adminList, toString(i.caller)))
286317 then true
287318 else throwErr("you must be admin")]
288319 if ((check == check))
289320 then {
290321 let id = getAvailableVestingId(userAddress)
291322 let historyActions = [IntegerEntry(keyVestingHistory("vested", userAddress, toBase58String(i.transactionId)), vestingAmount)]
292323 (getNewVestingActions(userAddress, id, vestingAmount, startBlock, lockLength) ++ historyActions)
293324 }
294325 else throw("Strict value is not equal to itself.")
295326 }
296327
297328
298329
299330 @Callable(i)
300-func claimAll () = {
301- let userAddress = toString(i.caller)
302- let $t080638128 = getClaimAllActions(userAddress)
303- let claimActions = $t080638128._1
304- let totalAmount = $t080638128._2
305- let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)]
306- if ((totalAmount > 0))
307- then (claimActions ++ historyActions)
308- else throwErr("nothing to claim")
309- }
310-
311-
312-
313-@Callable(i)
314331 func ban (userAddress) = {
315332 let checks = [if (if ((adminList == nil))
316333 then true
317334 else containsElement(adminList, toString(i.caller)))
318335 then true
319336 else throwErr("you must be admin"), if (!(containsElement(banList, userAddress)))
320337 then true
321338 else throwErr(makeString(["user already in a ban list:", userAddress], " "))]
322339 if ((checks == checks))
323340 then {
324- let $t086758763 = getMoveAllUnlockedToAccumulatorActions(userAddress)
325- let moveToAccumulatedActions = $t086758763._1
326- let _a = $t086758763._2
341+ let $t087668854 = getMoveAllUnlockedToAccumulatorActions(userAddress)
342+ let moveToAccumulatedActions = $t087668854._1
343+ let _a = $t087668854._2
327344 let addToBanListActions = [StringEntry(keyBanList, makeString_11C((banList :+ userAddress), "__"))]
328345 (moveToAccumulatedActions ++ addToBanListActions)
329346 }
330347 else throw("Strict value is not equal to itself.")
331348 }
332349
333350
334351
335352 @Callable(i)
336353 func unban (userAddress) = {
337354 let checks = [if (if ((adminList == nil))
338355 then true
339356 else containsElement(adminList, toString(i.caller)))
340357 then true
341358 else throwErr("you must be admin"), if (containsElement(banList, userAddress))
342359 then true
343360 else throwErr(makeString(["user not in a ban list:", userAddress], " "))]
344361 if ((checks == checks))
345362 then {
346363 let newBanList = match indexOf(banList, userAddress) {
347364 case ind: Int =>
348365 removeByIndex(banList, ind)
349366 case _ =>
350367 throwErr("user address index in ban list is not found")
351368 }
352369 if ((newBanList == nil))
353370 then [DeleteEntry(keyBanList)]
354371 else [StringEntry(keyBanList, makeString_11C(newBanList, "__"))]
355372 }
356373 else throw("Strict value is not equal to itself.")
357374 }
358375
359376
377+
378+@Callable(i)
379+func claimAll () = {
380+ let userAddress = toString(i.caller)
381+ let $t097049769 = getClaimAllActions(userAddress)
382+ let claimActions = $t097049769._1
383+ let totalAmount = $t097049769._2
384+ let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)]
385+ if ((totalAmount > 0))
386+ then (claimActions ++ historyActions)
387+ else throwErr("nothing to claim")
388+ }
389+
390+
391+
392+@Callable(i)
393+func claimAllREADONLY (userAddress) = {
394+ let $t01008010135 = getClaimAllActions(userAddress)
395+ let _a = $t01008010135._1
396+ let totalAmount = $t01008010135._2
397+ $Tuple2(nil, $Tuple2(totalAmount, getVestingUserInfo(userAddress)))
398+ }
399+
400+

github/deemru/w8io/169f3d6 
57.18 ms