tx · CKptvzRwTAYpRJEnQ5ETTXLgFsfnL4A1Z23UsL1WGEND

3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1:  -0.01100000 Waves

2024.01.09 15:37 [2923952] smart account 3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1 > SELF 0.00000000 Waves

{ "type": 13, "id": "CKptvzRwTAYpRJEnQ5ETTXLgFsfnL4A1Z23UsL1WGEND", "fee": 1100000, "feeAssetId": null, "timestamp": 1704803862753, "version": 2, "chainId": 84, "sender": "3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1", "senderPublicKey": "7c3qLtcJ7EaPS2JDjXv8MBbd4kpyc6R27wcn5GgvZhur", "proofs": [ "fKNQspu84W9dGtq65uT8qtA9Vfpb5UCigeEMCesPzffUfabWYeTxUEcufenyKK2SeATgezfU9PEBRtVqk28pyxF" ], "script": "base64:CAIWCAISBgoECAEBARIAEgMKAQgSAwoBCBwADGNvbnRyYWN0RmlsZQIQdmVzdGluZ19uZW8ucmlkZQADU0VQAgJfXwAISURTX0xJU1QJAMwIAgAACQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUJAMwIAgAGCQDMCAIABwkAzAgCAAgJAMwIAgAJCQDMCAIACgkAzAgCAAsJAMwIAgAMCQDMCAIADQkAzAgCAA4JAMwIAgAPCQDMCAIAEAkAzAgCABEJAMwIAgASCQDMCAIAEwkAzAgCABQJAMwIAgAVCQDMCAIAFgkAzAgCABcJAMwIAgAYCQDMCAIAGQkAzAgCABoJAMwIAgAbCQDMCAIAHAkAzAgCAB0FA25pbAARTUFYX1ZFU1RJTkdfQ09VTlQJAJADAQUISURTX0xJU1QBCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADWFzc2V0SWRTdHJpbmcJAQt2YWx1Z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bnRyeQIFCmtleUJhbkxpc3QJALsJAgkAzQgCBQdiYW5MaXN0BQt1c2VyQWRkcmVzcwICX18FA25pbAkAzggCBRhtb3ZlVG9BY2N1bXVsYXRlZEFjdGlvbnMFE2FkZFRvQmFuTGlzdEFjdGlvbnMJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEFdW5iYW4BC3VzZXJBZGRyZXNzBAZjaGVja3MJAMwIAgMDCQAAAgUJYWRtaW5MaXN0BQNuaWwGCQEPY29udGFpbnNFbGVtZW50AgUJYWRtaW5MaXN0CQClCAEIBQFpBmNhbGxlcgYJAQh0aHJvd0VycgECEXlvdSBtdXN0IGJlIGFkbWluCQDMCAIDCQEPY29udGFpbnNFbGVtZW50AgUHYmFuTGlzdAULdXNlckFkZHJlc3MGCQEIdGhyb3dFcnIBCQC5CQIJAMwIAgIXdXNlciBub3QgaW4gYSBiYW4gbGlzdDoJAMwIAgULdXNlckFkZHJlc3MFA25pbAIBIAUDbmlsAwkAAAIFBmNoZWNrcwUGY2hlY2tzBApuZXdCYW5MaXN0BAckbWF0Y2gwCQDPCAIFB2Jhbkxpc3QFC3VzZXJBZGRyZXNzAwkAAQIFByRtYXRjaDACA0ludAQDaW5kBQckbWF0Y2gwCQDRCAIFB2Jhbkxpc3QFA2luZAkBCHRocm93RXJyAQIrdXNlciBhZGRyZXNzIGluZGV4IGluIGJhbiBsaXN0IGlzIG5vdCBmb3VuZAkAzAgCCQELU3RyaW5nRW50cnkCBQprZXlCYW5MaXN0CQC7CQIFCm5ld0Jhbkxpc3QCAl9fBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4A5BSSWw==", "height": 2923952, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6SSLGym72Tp67pWGoeFi4a6Hmym5Nd1d7iiqg7kgyXAj Next: DeBG3B89GqEFXpUzK2eaantcCLwg5Cw6hnuai2ZzRqmE Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 8 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFile = "vesting_neo.ride"
2222
2323 let keyAdminList = makeString(["%s", "adminList"], SEP)
2424
25+let keyBanList = makeString(["%s", "banList"], SEP)
26+
2527 let adminList = match getString(this, keyAdminList) {
2628 case s: String =>
2729 split(s, SEP)
30+ case _ =>
31+ nil
32+}
33+
34+let banList = match getString(this, keyBanList) {
35+ case s: String =>
36+ split_51C(s, SEP)
2837 case _ =>
2938 nil
3039 }
8796 }
8897
8998
90-func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", action, userAddress, txId], SEP)
99+func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", userAddress, action, txId], SEP)
91100
92101
93102 func calcUnlockedAmount (amount,startBlock,lockLength) = {
102111
103112
104113 func getUserUnlockedAmount (userAddress,id) = {
105- let $t030143093 = parseUserVesting(userAddress, id)
106- let vestingAmount = $t030143093._1
107- let startBlock = $t030143093._2
108- let lockLength = $t030143093._3
109- let $t030963193 = calcUnlockedAmount(vestingAmount, startBlock, lockLength)
110- let unlockedAmount = $t030963193._1
111- let remainingAmount = $t030963193._2
114+ let $t031883267 = parseUserVesting(userAddress, id)
115+ let vestingAmount = $t031883267._1
116+ let startBlock = $t031883267._2
117+ let lockLength = $t031883267._3
118+ let $t032703367 = calcUnlockedAmount(vestingAmount, startBlock, lockLength)
119+ let unlockedAmount = $t032703367._1
120+ let remainingAmount = $t032703367._2
112121 $Tuple2(unlockedAmount, remainingAmount)
113122 }
114123
115124
116125 func getUpdateVestingActions (userAddress,id) = {
117- let $t033003379 = parseUserVesting(userAddress, id)
118- let vestingAmount = $t033003379._1
119- let startBlock = $t033003379._2
120- let lockLength = $t033003379._3
121- let $t033823460 = getUserUnlockedAmount(userAddress, id)
122- let unlockedAmount = $t033823460._1
123- let remainingAmount = $t033823460._2
126+ let $t034743553 = parseUserVesting(userAddress, id)
127+ let vestingAmount = $t034743553._1
128+ let startBlock = $t034743553._2
129+ let lockLength = $t034743553._3
130+ let $t035563634 = getUserUnlockedAmount(userAddress, id)
131+ let unlockedAmount = $t035563634._1
132+ let remainingAmount = $t035563634._2
124133 let remainingBlocks = max([((startBlock + lockLength) - height), 0])
125134 let updateVestingActions = if ((unlockedAmount != 0))
126135 then if ((remainingBlocks != 0))
132141
133142
134143 func getUserClaimActions (userAddress,id) = {
135- let $t039244009 = getUpdateVestingActions(userAddress, id)
136- let updateVestingActions = $t039244009._1
137- let unlockedAmount = $t039244009._2
144+ let $t040984183 = getUpdateVestingActions(userAddress, id)
145+ let updateVestingActions = $t040984183._1
146+ let unlockedAmount = $t040984183._2
138147 let transferActions = if ((unlockedAmount != 0))
139148 then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)]
140149 else nil
144153
145154 func getAllUserClaimActions (userAddress) = {
146155 func actionsHelper (acc,a) = {
147- let $t043834423 = acc
148- let allVestingsClaimActions = $t043834423._1
149- let sum = $t043834423._2
150- let $t044284504 = getUserClaimActions(userAddress, a)
151- let vestingClaimActions = $t044284504._1
152- let claimAmount = $t044284504._2
156+ let $t045574597 = acc
157+ let allVestingsClaimActions = $t045574597._1
158+ let sum = $t045574597._2
159+ let $t046024678 = getUserClaimActions(userAddress, a)
160+ let vestingClaimActions = $t046024678._1
161+ let claimAmount = $t046024678._2
153162 $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount))
154163 }
155164
170179
171180 func getMoveAllUnlockedToAccumulatorActions (userAddress) = {
172181 func actionsHelper (acc,a) = {
173- let $t047964837 = acc
174- let updateAllVestingsActions = $t047964837._1
175- let sum = $t047964837._2
176- let $t048424926 = getUpdateVestingActions(userAddress, a)
177- let updateVestingActions = $t048424926._1
178- let unlockedAmount = $t048424926._2
182+ let $t049705011 = acc
183+ let updateAllVestingsActions = $t049705011._1
184+ let sum = $t049705011._2
185+ let $t050165100 = getUpdateVestingActions(userAddress, a)
186+ let updateVestingActions = $t050165100._1
187+ let unlockedAmount = $t050165100._2
179188 $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount))
180189 }
181190
182- let $t050125100 = {
191+ let $t051865274 = {
183192 let $l = IDS_LIST
184193 let $s = size($l)
185194 let $acc0 = $Tuple2(nil, 0)
193202
194203 $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)
195204 }
196- let updateAllVestingsActions = $t050125100._1
197- let unlockedSum = $t050125100._2
205+ let updateAllVestingsActions = $t051865274._1
206+ let unlockedSum = $t051865274._2
198207 let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0)
199208 let updateAccumulatedActions = if ((unlockedSum != 0))
200209 then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))]
212221
213222
214223 func getClaimAllActions (userAddress) = {
215- let $t058685940 = getAllUserClaimActions(userAddress)
216- let claimActions = $t058685940._1
217- let unlockedAmount = $t058685940._2
218- let $t059436033 = getClaimAccumulatedActions(userAddress)
219- let claimAccumulatedActions = $t059436033._1
220- let accumulatedAmount = $t059436033._2
224+ let $t060426114 = getAllUserClaimActions(userAddress)
225+ let claimActions = $t060426114._1
226+ let unlockedAmount = $t060426114._2
227+ let $t061176207 = getClaimAccumulatedActions(userAddress)
228+ let claimAccumulatedActions = $t061176207._1
229+ let accumulatedAmount = $t061176207._2
221230 let totalAmount = (unlockedAmount + accumulatedAmount)
222231 if ((totalAmount > 0))
223232 then $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount)
227236
228237 func getAvailableVestingId (userAddress) = {
229238 func helper (availableId,id) = {
230- let $t063246403 = parseUserVesting(userAddress, id)
231- let vestingAmount = $t063246403._1
232- let startBlock = $t063246403._2
233- let lockLength = $t063246403._3
239+ let $t064986577 = parseUserVesting(userAddress, id)
240+ let vestingAmount = $t064986577._1
241+ let startBlock = $t064986577._2
242+ let lockLength = $t064986577._3
234243 if ((vestingAmount > 0))
235244 then availableId
236245 else if ((availableId == -1))
288297 @Callable(i)
289298 func claimAll () = {
290299 let userAddress = toString(i.caller)
291- let $t078807945 = getClaimAllActions(userAddress)
292- let claimActions = $t078807945._1
293- let totalAmount = $t078807945._2
300+ let $t080548119 = getClaimAllActions(userAddress)
301+ let claimActions = $t080548119._1
302+ let totalAmount = $t080548119._2
294303 let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)]
295304 (claimActions ++ historyActions)
296305 }
298307
299308
300309 @Callable(i)
301-func foo (userAddress) = getMoveAllUnlockedToAccumulatorActions(userAddress)
310+func ban (userAddress) = {
311+ let checks = [if (if ((adminList == nil))
312+ then true
313+ else containsElement(adminList, toString(i.caller)))
314+ then true
315+ else throwErr("you must be admin"), if (!(containsElement(banList, userAddress)))
316+ then true
317+ else throwErr(makeString(["user already in a ban list:", userAddress], " "))]
318+ if ((checks == checks))
319+ then {
320+ let $t085918679 = getMoveAllUnlockedToAccumulatorActions(userAddress)
321+ let moveToAccumulatedActions = $t085918679._1
322+ let _a = $t085918679._2
323+ let addToBanListActions = [StringEntry(keyBanList, makeString_11C((banList :+ userAddress), "__"))]
324+ (moveToAccumulatedActions ++ addToBanListActions)
325+ }
326+ else throw("Strict value is not equal to itself.")
327+ }
328+
329+
330+
331+@Callable(i)
332+func unban (userAddress) = {
333+ let checks = [if (if ((adminList == nil))
334+ then true
335+ else containsElement(adminList, toString(i.caller)))
336+ then true
337+ else throwErr("you must be admin"), if (containsElement(banList, userAddress))
338+ then true
339+ else throwErr(makeString(["user not in a ban list:", userAddress], " "))]
340+ if ((checks == checks))
341+ then {
342+ let newBanList = match indexOf(banList, userAddress) {
343+ case ind: Int =>
344+ removeByIndex(banList, ind)
345+ case _ =>
346+ throwErr("user address index in ban list is not found")
347+ }
348+[StringEntry(keyBanList, makeString_11C(newBanList, "__"))]
349+ }
350+ else throw("Strict value is not equal to itself.")
351+ }
302352
303353
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 8 #-}
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
25+let keyBanList = makeString(["%s", "banList"], SEP)
26+
2527 let adminList = match getString(this, keyAdminList) {
2628 case s: String =>
2729 split(s, SEP)
30+ case _ =>
31+ nil
32+}
33+
34+let banList = match getString(this, keyBanList) {
35+ case s: String =>
36+ split_51C(s, SEP)
2837 case _ =>
2938 nil
3039 }
3140
3241 func isValidAddressString (addressString) = match addressFromString(addressString) {
3342 case a: Address =>
3443 true
3544 case _ =>
3645 false
3746 }
3847
3948
4049 func keyUserVesting (userAddress,id) = {
4150 let checks = [if (isValidAddressString(userAddress))
4251 then true
4352 else throwErr(makeString(["address is not valid:", userAddress], " ")), if (if ((id >= 0))
4453 then (MAX_VESTING_COUNT > id)
4554 else false)
4655 then true
4756 else throwErr(makeString(["id should be less than", toString(MAX_VESTING_COUNT), "got:", toString(id)], " "))]
4857 if ((checks == checks))
4958 then makeString(["%s%s%d", "vesting", userAddress, toString(id)], SEP)
5059 else throw("Strict value is not equal to itself.")
5160 }
5261
5362
5463 func keyUserAccumulated (userAddress) = {
5564 let checks = [if (isValidAddressString(userAddress))
5665 then true
5766 else throwErr(makeString(["address is not valid:", userAddress], " "))]
5867 if ((checks == checks))
5968 then makeString(["%s%s", "accumulated", userAddress], SEP)
6069 else throw("Strict value is not equal to itself.")
6170 }
6271
6372
6473 func formatUserVesting (vestingAmount,startBlock,lockLength) = {
6574 let checks = [if ((vestingAmount >= 0))
6675 then true
6776 else throwErr("vesting amount cannot be negative"), if ((startBlock >= 0))
6877 then true
6978 else throwErr("start block cannot be negative"), if ((lockLength >= 0))
7079 then true
7180 else throwErr("lock length cannot be negative")]
7281 if ((checks == checks))
7382 then makeString(["%d%d%d%d%d", toString(vestingAmount), toString(startBlock), toString(lockLength)], SEP)
7483 else throw("Strict value is not equal to itself.")
7584 }
7685
7786
7887 func parseUserVesting (userAddress,id) = match getString(this, keyUserVesting(userAddress, id)) {
7988 case rawString: String =>
8089 let splitString = split(rawString, SEP)
8190 let vestingAmount = parseIntValue(splitString[1])
8291 let startBlock = parseIntValue(splitString[2])
8392 let lockLength = parseIntValue(splitString[3])
8493 $Tuple3(vestingAmount, startBlock, lockLength)
8594 case _ =>
8695 $Tuple3(0, 0, 0)
8796 }
8897
8998
90-func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", action, userAddress, txId], SEP)
99+func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", userAddress, action, txId], SEP)
91100
92101
93102 func calcUnlockedAmount (amount,startBlock,lockLength) = {
94103 let elapsedBlocks = (height - startBlock)
95104 let unlockedAmount = if (if ((lockLength != 0))
96105 then (elapsedBlocks > 0)
97106 else false)
98107 then min([fraction(amount, elapsedBlocks, lockLength), amount])
99108 else 0
100109 $Tuple2(unlockedAmount, (amount - unlockedAmount))
101110 }
102111
103112
104113 func getUserUnlockedAmount (userAddress,id) = {
105- let $t030143093 = parseUserVesting(userAddress, id)
106- let vestingAmount = $t030143093._1
107- let startBlock = $t030143093._2
108- let lockLength = $t030143093._3
109- let $t030963193 = calcUnlockedAmount(vestingAmount, startBlock, lockLength)
110- let unlockedAmount = $t030963193._1
111- let remainingAmount = $t030963193._2
114+ let $t031883267 = parseUserVesting(userAddress, id)
115+ let vestingAmount = $t031883267._1
116+ let startBlock = $t031883267._2
117+ let lockLength = $t031883267._3
118+ let $t032703367 = calcUnlockedAmount(vestingAmount, startBlock, lockLength)
119+ let unlockedAmount = $t032703367._1
120+ let remainingAmount = $t032703367._2
112121 $Tuple2(unlockedAmount, remainingAmount)
113122 }
114123
115124
116125 func getUpdateVestingActions (userAddress,id) = {
117- let $t033003379 = parseUserVesting(userAddress, id)
118- let vestingAmount = $t033003379._1
119- let startBlock = $t033003379._2
120- let lockLength = $t033003379._3
121- let $t033823460 = getUserUnlockedAmount(userAddress, id)
122- let unlockedAmount = $t033823460._1
123- let remainingAmount = $t033823460._2
126+ let $t034743553 = parseUserVesting(userAddress, id)
127+ let vestingAmount = $t034743553._1
128+ let startBlock = $t034743553._2
129+ let lockLength = $t034743553._3
130+ let $t035563634 = getUserUnlockedAmount(userAddress, id)
131+ let unlockedAmount = $t035563634._1
132+ let remainingAmount = $t035563634._2
124133 let remainingBlocks = max([((startBlock + lockLength) - height), 0])
125134 let updateVestingActions = if ((unlockedAmount != 0))
126135 then if ((remainingBlocks != 0))
127136 then [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(remainingAmount, height, remainingBlocks))]
128137 else [DeleteEntry(keyUserVesting(userAddress, id))]
129138 else nil
130139 $Tuple2(updateVestingActions, unlockedAmount)
131140 }
132141
133142
134143 func getUserClaimActions (userAddress,id) = {
135- let $t039244009 = getUpdateVestingActions(userAddress, id)
136- let updateVestingActions = $t039244009._1
137- let unlockedAmount = $t039244009._2
144+ let $t040984183 = getUpdateVestingActions(userAddress, id)
145+ let updateVestingActions = $t040984183._1
146+ let unlockedAmount = $t040984183._2
138147 let transferActions = if ((unlockedAmount != 0))
139148 then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)]
140149 else nil
141150 $Tuple2((updateVestingActions ++ transferActions), unlockedAmount)
142151 }
143152
144153
145154 func getAllUserClaimActions (userAddress) = {
146155 func actionsHelper (acc,a) = {
147- let $t043834423 = acc
148- let allVestingsClaimActions = $t043834423._1
149- let sum = $t043834423._2
150- let $t044284504 = getUserClaimActions(userAddress, a)
151- let vestingClaimActions = $t044284504._1
152- let claimAmount = $t044284504._2
156+ let $t045574597 = acc
157+ let allVestingsClaimActions = $t045574597._1
158+ let sum = $t045574597._2
159+ let $t046024678 = getUserClaimActions(userAddress, a)
160+ let vestingClaimActions = $t046024678._1
161+ let claimAmount = $t046024678._2
153162 $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount))
154163 }
155164
156165 let $l = IDS_LIST
157166 let $s = size($l)
158167 let $acc0 = $Tuple2(nil, 0)
159168 func $f0_1 ($a,$i) = if (($i >= $s))
160169 then $a
161170 else actionsHelper($a, $l[$i])
162171
163172 func $f0_2 ($a,$i) = if (($i >= $s))
164173 then $a
165174 else throw("List size exceeds 30")
166175
167176 $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)
168177 }
169178
170179
171180 func getMoveAllUnlockedToAccumulatorActions (userAddress) = {
172181 func actionsHelper (acc,a) = {
173- let $t047964837 = acc
174- let updateAllVestingsActions = $t047964837._1
175- let sum = $t047964837._2
176- let $t048424926 = getUpdateVestingActions(userAddress, a)
177- let updateVestingActions = $t048424926._1
178- let unlockedAmount = $t048424926._2
182+ let $t049705011 = acc
183+ let updateAllVestingsActions = $t049705011._1
184+ let sum = $t049705011._2
185+ let $t050165100 = getUpdateVestingActions(userAddress, a)
186+ let updateVestingActions = $t050165100._1
187+ let unlockedAmount = $t050165100._2
179188 $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount))
180189 }
181190
182- let $t050125100 = {
191+ let $t051865274 = {
183192 let $l = IDS_LIST
184193 let $s = size($l)
185194 let $acc0 = $Tuple2(nil, 0)
186195 func $f0_1 ($a,$i) = if (($i >= $s))
187196 then $a
188197 else actionsHelper($a, $l[$i])
189198
190199 func $f0_2 ($a,$i) = if (($i >= $s))
191200 then $a
192201 else throw("List size exceeds 30")
193202
194203 $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)
195204 }
196- let updateAllVestingsActions = $t050125100._1
197- let unlockedSum = $t050125100._2
205+ let updateAllVestingsActions = $t051865274._1
206+ let unlockedSum = $t051865274._2
198207 let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0)
199208 let updateAccumulatedActions = if ((unlockedSum != 0))
200209 then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))]
201210 else nil
202211 $Tuple2((updateAllVestingsActions ++ updateAccumulatedActions), unlockedSum)
203212 }
204213
205214
206215 func getClaimAccumulatedActions (userAddress) = {
207216 let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0)
208217 if ((oldAccumulated != 0))
209218 then $Tuple2([ScriptTransfer(addressFromStringValue(userAddress), oldAccumulated, assetIdBytes), DeleteEntry(keyUserAccumulated(userAddress))], oldAccumulated)
210219 else $Tuple2(nil, 0)
211220 }
212221
213222
214223 func getClaimAllActions (userAddress) = {
215- let $t058685940 = getAllUserClaimActions(userAddress)
216- let claimActions = $t058685940._1
217- let unlockedAmount = $t058685940._2
218- let $t059436033 = getClaimAccumulatedActions(userAddress)
219- let claimAccumulatedActions = $t059436033._1
220- let accumulatedAmount = $t059436033._2
224+ let $t060426114 = getAllUserClaimActions(userAddress)
225+ let claimActions = $t060426114._1
226+ let unlockedAmount = $t060426114._2
227+ let $t061176207 = getClaimAccumulatedActions(userAddress)
228+ let claimAccumulatedActions = $t061176207._1
229+ let accumulatedAmount = $t061176207._2
221230 let totalAmount = (unlockedAmount + accumulatedAmount)
222231 if ((totalAmount > 0))
223232 then $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount)
224233 else throwErr("nothing to claim")
225234 }
226235
227236
228237 func getAvailableVestingId (userAddress) = {
229238 func helper (availableId,id) = {
230- let $t063246403 = parseUserVesting(userAddress, id)
231- let vestingAmount = $t063246403._1
232- let startBlock = $t063246403._2
233- let lockLength = $t063246403._3
239+ let $t064986577 = parseUserVesting(userAddress, id)
240+ let vestingAmount = $t064986577._1
241+ let startBlock = $t064986577._2
242+ let lockLength = $t064986577._3
234243 if ((vestingAmount > 0))
235244 then availableId
236245 else if ((availableId == -1))
237246 then id
238247 else min([availableId, id])
239248 }
240249
241250 let availableId = {
242251 let $l = IDS_LIST
243252 let $s = size($l)
244253 let $acc0 = -1
245254 func $f0_1 ($a,$i) = if (($i >= $s))
246255 then $a
247256 else helper($a, $l[$i])
248257
249258 func $f0_2 ($a,$i) = if (($i >= $s))
250259 then $a
251260 else throw("List size exceeds 30")
252261
253262 $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)
254263 }
255264 if ((availableId == -1))
256265 then throwErr(makeString(["user exceeded max active vesting count: ", userAddress], " "))
257266 else availableId
258267 }
259268
260269
261270 func getNewVestingActions (userAddress,id,vestingAmount,startBlock,lockLength) = [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(vestingAmount, startBlock, lockLength))]
262271
263272
264273 @Callable(i)
265274 func vestingForUser (userAddress,vestingAmount,startBlock,lockLength) = {
266275 let check = [if ((size(i.payments) == 1))
267276 then true
268277 else throwErr("should be with exactly 1 payment"), if ((i.payments[0].assetId == assetIdBytes))
269278 then true
270279 else throwErr(makeString(["payment assetId should be: ", assetIdString], " ")), if ((i.payments[0].amount == vestingAmount))
271280 then true
272281 else throwErr("payment amount should be equal to vestingAmount"), if (if ((adminList == nil))
273282 then true
274283 else containsElement(adminList, toString(i.caller)))
275284 then true
276285 else throwErr("you must be admin")]
277286 if ((check == check))
278287 then {
279288 let id = getAvailableVestingId(userAddress)
280289 let historyActions = [IntegerEntry(keyVestingHistory("vested", userAddress, toBase58String(i.transactionId)), vestingAmount)]
281290 (getNewVestingActions(userAddress, id, vestingAmount, startBlock, lockLength) ++ historyActions)
282291 }
283292 else throw("Strict value is not equal to itself.")
284293 }
285294
286295
287296
288297 @Callable(i)
289298 func claimAll () = {
290299 let userAddress = toString(i.caller)
291- let $t078807945 = getClaimAllActions(userAddress)
292- let claimActions = $t078807945._1
293- let totalAmount = $t078807945._2
300+ let $t080548119 = getClaimAllActions(userAddress)
301+ let claimActions = $t080548119._1
302+ let totalAmount = $t080548119._2
294303 let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)]
295304 (claimActions ++ historyActions)
296305 }
297306
298307
299308
300309 @Callable(i)
301-func foo (userAddress) = getMoveAllUnlockedToAccumulatorActions(userAddress)
310+func ban (userAddress) = {
311+ let checks = [if (if ((adminList == nil))
312+ then true
313+ else containsElement(adminList, toString(i.caller)))
314+ then true
315+ else throwErr("you must be admin"), if (!(containsElement(banList, userAddress)))
316+ then true
317+ else throwErr(makeString(["user already in a ban list:", userAddress], " "))]
318+ if ((checks == checks))
319+ then {
320+ let $t085918679 = getMoveAllUnlockedToAccumulatorActions(userAddress)
321+ let moveToAccumulatedActions = $t085918679._1
322+ let _a = $t085918679._2
323+ let addToBanListActions = [StringEntry(keyBanList, makeString_11C((banList :+ userAddress), "__"))]
324+ (moveToAccumulatedActions ++ addToBanListActions)
325+ }
326+ else throw("Strict value is not equal to itself.")
327+ }
328+
329+
330+
331+@Callable(i)
332+func unban (userAddress) = {
333+ let checks = [if (if ((adminList == nil))
334+ then true
335+ else containsElement(adminList, toString(i.caller)))
336+ then true
337+ else throwErr("you must be admin"), if (containsElement(banList, userAddress))
338+ then true
339+ else throwErr(makeString(["user not in a ban list:", userAddress], " "))]
340+ if ((checks == checks))
341+ then {
342+ let newBanList = match indexOf(banList, userAddress) {
343+ case ind: Int =>
344+ removeByIndex(banList, ind)
345+ case _ =>
346+ throwErr("user address index in ban list is not found")
347+ }
348+[StringEntry(keyBanList, makeString_11C(newBanList, "__"))]
349+ }
350+ else throw("Strict value is not equal to itself.")
351+ }
302352
303353

github/deemru/w8io/169f3d6 
55.43 ms