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:CAIWCAISBgoECAEBARIAEgMKAQgSAwoBCBwADGNvbnRyYWN0RmlsZQIQdmVzdGluZ19uZW8ucmlkZQADU0VQAgJfXwAISURTX0xJU1QJAMwIAgAACQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUJAMwIAgAGCQDMCAIABwkAzAgCAAgJAMwIAgAJCQDMCAIACgkAzAgCAAsJAMwIAgAMCQDMCAIADQkAzAgCAA4JAMwIAgAPCQDMCAIAEAkAzAgCABEJAMwIAgASCQDMCAIAEwkAzAgCABQJAMwIAgAVCQDMCAIAFgkAzAgCABcJAMwIAgAYCQDMCAIAGQkAzAgCABoJAMwIAgAbCQDMCAIAHAkAzAgCAB0FA25pbAARTUFYX1ZFU1RJTkdfQ09VTlQJAJADAQUISURTX0xJU1QBCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADWFzc2V0SWRTdHJpbmcJAQt2YWx1ZU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nRyeQIFCmtleUJhbkxpc3QJALsJAgkAzQgCBQdiYW5MaXN0BQt1c2VyQWRkcmVzcwICX18FA25pbAkAzggCBRhtb3ZlVG9BY2N1bXVsYXRlZEFjdGlvbnMFE2FkZFRvQmFuTGlzdEFjdGlvbnMJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEFdW5iYW4BC3VzZXJBZGRyZXNzBAZjaGVja3MJAMwIAgMDCQAAAgUJYWRtaW5MaXN0BQNuaWwGCQEPY29udGFpbnNFbGVtZW50AgUJYWRtaW5MaXN0CQClCAEIBQFpBmNhbGxlcgYJAQh0aHJvd0VycgECEXlvdSBtdXN0IGJlIGFkbWluCQDMCAIDCQEPY29udGFpbnNFbGVtZW50AgUHYmFuTGlzdAULdXNlckFkZHJlc3MGCQEIdGhyb3dFcnIBCQC5CQIJAMwIAgIXdXNlciBub3QgaW4gYSBiYW4gbGlzdDoJAMwIAgULdXNlckFkZHJlc3MFA25pbAIBIAUDbmlsAwkAAAIFBmNoZWNrcwUGY2hlY2tzBApuZXdCYW5MaXN0BAckbWF0Y2gwCQDPCAIFB2Jhbkxpc3QFC3VzZXJBZGRyZXNzAwkAAQIFByRtYXRjaDACA0ludAQDaW5kBQckbWF0Y2gwCQDRCAIFB2Jhbkxpc3QFA2luZAkBCHRocm93RXJyAQIrdXNlciBhZGRyZXNzIGluZGV4IGluIGJhbiBsaXN0IGlzIG5vdCBmb3VuZAkAzAgCCQELU3RyaW5nRW50cnkCBQprZXlCYW5MaXN0CQC7CQIFCm5ld0Jhbkxpc3QCAl9fBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4A5BSSWw==", "height": 2923952, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6SSLGym72Tp67pWGoeFi4a6Hmym5Nd1d7iiqg7kgyXAj Next: DeBG3B89GqEFXpUzK2eaantcCLwg5Cw6hnuai2ZzRqmE Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFile = "vesting_neo.ride" | |
22 | 22 | ||
23 | 23 | let keyAdminList = makeString(["%s", "adminList"], SEP) | |
24 | 24 | ||
25 | + | let keyBanList = makeString(["%s", "banList"], SEP) | |
26 | + | ||
25 | 27 | let adminList = match getString(this, keyAdminList) { | |
26 | 28 | case s: String => | |
27 | 29 | 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) | |
28 | 37 | case _ => | |
29 | 38 | nil | |
30 | 39 | } | |
87 | 96 | } | |
88 | 97 | ||
89 | 98 | ||
90 | - | func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", | |
99 | + | func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", userAddress, action, txId], SEP) | |
91 | 100 | ||
92 | 101 | ||
93 | 102 | func calcUnlockedAmount (amount,startBlock,lockLength) = { | |
102 | 111 | ||
103 | 112 | ||
104 | 113 | func getUserUnlockedAmount (userAddress,id) = { | |
105 | - | let $ | |
106 | - | let vestingAmount = $ | |
107 | - | let startBlock = $ | |
108 | - | let lockLength = $ | |
109 | - | let $ | |
110 | - | let unlockedAmount = $ | |
111 | - | let remainingAmount = $ | |
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 | |
112 | 121 | $Tuple2(unlockedAmount, remainingAmount) | |
113 | 122 | } | |
114 | 123 | ||
115 | 124 | ||
116 | 125 | func getUpdateVestingActions (userAddress,id) = { | |
117 | - | let $ | |
118 | - | let vestingAmount = $ | |
119 | - | let startBlock = $ | |
120 | - | let lockLength = $ | |
121 | - | let $ | |
122 | - | let unlockedAmount = $ | |
123 | - | let remainingAmount = $ | |
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 | |
124 | 133 | let remainingBlocks = max([((startBlock + lockLength) - height), 0]) | |
125 | 134 | let updateVestingActions = if ((unlockedAmount != 0)) | |
126 | 135 | then if ((remainingBlocks != 0)) | |
132 | 141 | ||
133 | 142 | ||
134 | 143 | func getUserClaimActions (userAddress,id) = { | |
135 | - | let $ | |
136 | - | let updateVestingActions = $ | |
137 | - | let unlockedAmount = $ | |
144 | + | let $t040984183 = getUpdateVestingActions(userAddress, id) | |
145 | + | let updateVestingActions = $t040984183._1 | |
146 | + | let unlockedAmount = $t040984183._2 | |
138 | 147 | let transferActions = if ((unlockedAmount != 0)) | |
139 | 148 | then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)] | |
140 | 149 | else nil | |
144 | 153 | ||
145 | 154 | func getAllUserClaimActions (userAddress) = { | |
146 | 155 | func actionsHelper (acc,a) = { | |
147 | - | let $ | |
148 | - | let allVestingsClaimActions = $ | |
149 | - | let sum = $ | |
150 | - | let $ | |
151 | - | let vestingClaimActions = $ | |
152 | - | let claimAmount = $ | |
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 | |
153 | 162 | $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount)) | |
154 | 163 | } | |
155 | 164 | ||
170 | 179 | ||
171 | 180 | func getMoveAllUnlockedToAccumulatorActions (userAddress) = { | |
172 | 181 | func actionsHelper (acc,a) = { | |
173 | - | let $ | |
174 | - | let updateAllVestingsActions = $ | |
175 | - | let sum = $ | |
176 | - | let $ | |
177 | - | let updateVestingActions = $ | |
178 | - | let unlockedAmount = $ | |
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 | |
179 | 188 | $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount)) | |
180 | 189 | } | |
181 | 190 | ||
182 | - | let $ | |
191 | + | let $t051865274 = { | |
183 | 192 | let $l = IDS_LIST | |
184 | 193 | let $s = size($l) | |
185 | 194 | let $acc0 = $Tuple2(nil, 0) | |
193 | 202 | ||
194 | 203 | $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) | |
195 | 204 | } | |
196 | - | let updateAllVestingsActions = $ | |
197 | - | let unlockedSum = $ | |
205 | + | let updateAllVestingsActions = $t051865274._1 | |
206 | + | let unlockedSum = $t051865274._2 | |
198 | 207 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
199 | 208 | let updateAccumulatedActions = if ((unlockedSum != 0)) | |
200 | 209 | then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
212 | 221 | ||
213 | 222 | ||
214 | 223 | func getClaimAllActions (userAddress) = { | |
215 | - | let $ | |
216 | - | let claimActions = $ | |
217 | - | let unlockedAmount = $ | |
218 | - | let $ | |
219 | - | let claimAccumulatedActions = $ | |
220 | - | let accumulatedAmount = $ | |
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 | |
221 | 230 | let totalAmount = (unlockedAmount + accumulatedAmount) | |
222 | 231 | if ((totalAmount > 0)) | |
223 | 232 | then $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount) | |
227 | 236 | ||
228 | 237 | func getAvailableVestingId (userAddress) = { | |
229 | 238 | func helper (availableId,id) = { | |
230 | - | let $ | |
231 | - | let vestingAmount = $ | |
232 | - | let startBlock = $ | |
233 | - | let lockLength = $ | |
239 | + | let $t064986577 = parseUserVesting(userAddress, id) | |
240 | + | let vestingAmount = $t064986577._1 | |
241 | + | let startBlock = $t064986577._2 | |
242 | + | let lockLength = $t064986577._3 | |
234 | 243 | if ((vestingAmount > 0)) | |
235 | 244 | then availableId | |
236 | 245 | else if ((availableId == -1)) | |
288 | 297 | @Callable(i) | |
289 | 298 | func claimAll () = { | |
290 | 299 | let userAddress = toString(i.caller) | |
291 | - | let $ | |
292 | - | let claimActions = $ | |
293 | - | let totalAmount = $ | |
300 | + | let $t080548119 = getClaimAllActions(userAddress) | |
301 | + | let claimActions = $t080548119._1 | |
302 | + | let totalAmount = $t080548119._2 | |
294 | 303 | let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)] | |
295 | 304 | (claimActions ++ historyActions) | |
296 | 305 | } | |
298 | 307 | ||
299 | 308 | ||
300 | 309 | @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 | + | } | |
302 | 352 | ||
303 | 353 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFile = "vesting_neo.ride" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | 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] | |
9 | 9 | ||
10 | 10 | let MAX_VESTING_COUNT = size(IDS_LIST) | |
11 | 11 | ||
12 | 12 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
16 | 16 | ||
17 | 17 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
18 | 18 | ||
19 | 19 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
20 | 20 | then unit | |
21 | 21 | else fromBase58String(assetIdString) | |
22 | 22 | ||
23 | 23 | let keyAdminList = makeString(["%s", "adminList"], SEP) | |
24 | 24 | ||
25 | + | let keyBanList = makeString(["%s", "banList"], SEP) | |
26 | + | ||
25 | 27 | let adminList = match getString(this, keyAdminList) { | |
26 | 28 | case s: String => | |
27 | 29 | 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) | |
28 | 37 | case _ => | |
29 | 38 | nil | |
30 | 39 | } | |
31 | 40 | ||
32 | 41 | func isValidAddressString (addressString) = match addressFromString(addressString) { | |
33 | 42 | case a: Address => | |
34 | 43 | true | |
35 | 44 | case _ => | |
36 | 45 | false | |
37 | 46 | } | |
38 | 47 | ||
39 | 48 | ||
40 | 49 | func keyUserVesting (userAddress,id) = { | |
41 | 50 | let checks = [if (isValidAddressString(userAddress)) | |
42 | 51 | then true | |
43 | 52 | else throwErr(makeString(["address is not valid:", userAddress], " ")), if (if ((id >= 0)) | |
44 | 53 | then (MAX_VESTING_COUNT > id) | |
45 | 54 | else false) | |
46 | 55 | then true | |
47 | 56 | else throwErr(makeString(["id should be less than", toString(MAX_VESTING_COUNT), "got:", toString(id)], " "))] | |
48 | 57 | if ((checks == checks)) | |
49 | 58 | then makeString(["%s%s%d", "vesting", userAddress, toString(id)], SEP) | |
50 | 59 | else throw("Strict value is not equal to itself.") | |
51 | 60 | } | |
52 | 61 | ||
53 | 62 | ||
54 | 63 | func keyUserAccumulated (userAddress) = { | |
55 | 64 | let checks = [if (isValidAddressString(userAddress)) | |
56 | 65 | then true | |
57 | 66 | else throwErr(makeString(["address is not valid:", userAddress], " "))] | |
58 | 67 | if ((checks == checks)) | |
59 | 68 | then makeString(["%s%s", "accumulated", userAddress], SEP) | |
60 | 69 | else throw("Strict value is not equal to itself.") | |
61 | 70 | } | |
62 | 71 | ||
63 | 72 | ||
64 | 73 | func formatUserVesting (vestingAmount,startBlock,lockLength) = { | |
65 | 74 | let checks = [if ((vestingAmount >= 0)) | |
66 | 75 | then true | |
67 | 76 | else throwErr("vesting amount cannot be negative"), if ((startBlock >= 0)) | |
68 | 77 | then true | |
69 | 78 | else throwErr("start block cannot be negative"), if ((lockLength >= 0)) | |
70 | 79 | then true | |
71 | 80 | else throwErr("lock length cannot be negative")] | |
72 | 81 | if ((checks == checks)) | |
73 | 82 | then makeString(["%d%d%d%d%d", toString(vestingAmount), toString(startBlock), toString(lockLength)], SEP) | |
74 | 83 | else throw("Strict value is not equal to itself.") | |
75 | 84 | } | |
76 | 85 | ||
77 | 86 | ||
78 | 87 | func parseUserVesting (userAddress,id) = match getString(this, keyUserVesting(userAddress, id)) { | |
79 | 88 | case rawString: String => | |
80 | 89 | let splitString = split(rawString, SEP) | |
81 | 90 | let vestingAmount = parseIntValue(splitString[1]) | |
82 | 91 | let startBlock = parseIntValue(splitString[2]) | |
83 | 92 | let lockLength = parseIntValue(splitString[3]) | |
84 | 93 | $Tuple3(vestingAmount, startBlock, lockLength) | |
85 | 94 | case _ => | |
86 | 95 | $Tuple3(0, 0, 0) | |
87 | 96 | } | |
88 | 97 | ||
89 | 98 | ||
90 | - | func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", | |
99 | + | func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", userAddress, action, txId], SEP) | |
91 | 100 | ||
92 | 101 | ||
93 | 102 | func calcUnlockedAmount (amount,startBlock,lockLength) = { | |
94 | 103 | let elapsedBlocks = (height - startBlock) | |
95 | 104 | let unlockedAmount = if (if ((lockLength != 0)) | |
96 | 105 | then (elapsedBlocks > 0) | |
97 | 106 | else false) | |
98 | 107 | then min([fraction(amount, elapsedBlocks, lockLength), amount]) | |
99 | 108 | else 0 | |
100 | 109 | $Tuple2(unlockedAmount, (amount - unlockedAmount)) | |
101 | 110 | } | |
102 | 111 | ||
103 | 112 | ||
104 | 113 | func getUserUnlockedAmount (userAddress,id) = { | |
105 | - | let $ | |
106 | - | let vestingAmount = $ | |
107 | - | let startBlock = $ | |
108 | - | let lockLength = $ | |
109 | - | let $ | |
110 | - | let unlockedAmount = $ | |
111 | - | let remainingAmount = $ | |
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 | |
112 | 121 | $Tuple2(unlockedAmount, remainingAmount) | |
113 | 122 | } | |
114 | 123 | ||
115 | 124 | ||
116 | 125 | func getUpdateVestingActions (userAddress,id) = { | |
117 | - | let $ | |
118 | - | let vestingAmount = $ | |
119 | - | let startBlock = $ | |
120 | - | let lockLength = $ | |
121 | - | let $ | |
122 | - | let unlockedAmount = $ | |
123 | - | let remainingAmount = $ | |
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 | |
124 | 133 | let remainingBlocks = max([((startBlock + lockLength) - height), 0]) | |
125 | 134 | let updateVestingActions = if ((unlockedAmount != 0)) | |
126 | 135 | then if ((remainingBlocks != 0)) | |
127 | 136 | then [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(remainingAmount, height, remainingBlocks))] | |
128 | 137 | else [DeleteEntry(keyUserVesting(userAddress, id))] | |
129 | 138 | else nil | |
130 | 139 | $Tuple2(updateVestingActions, unlockedAmount) | |
131 | 140 | } | |
132 | 141 | ||
133 | 142 | ||
134 | 143 | func getUserClaimActions (userAddress,id) = { | |
135 | - | let $ | |
136 | - | let updateVestingActions = $ | |
137 | - | let unlockedAmount = $ | |
144 | + | let $t040984183 = getUpdateVestingActions(userAddress, id) | |
145 | + | let updateVestingActions = $t040984183._1 | |
146 | + | let unlockedAmount = $t040984183._2 | |
138 | 147 | let transferActions = if ((unlockedAmount != 0)) | |
139 | 148 | then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)] | |
140 | 149 | else nil | |
141 | 150 | $Tuple2((updateVestingActions ++ transferActions), unlockedAmount) | |
142 | 151 | } | |
143 | 152 | ||
144 | 153 | ||
145 | 154 | func getAllUserClaimActions (userAddress) = { | |
146 | 155 | func actionsHelper (acc,a) = { | |
147 | - | let $ | |
148 | - | let allVestingsClaimActions = $ | |
149 | - | let sum = $ | |
150 | - | let $ | |
151 | - | let vestingClaimActions = $ | |
152 | - | let claimAmount = $ | |
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 | |
153 | 162 | $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount)) | |
154 | 163 | } | |
155 | 164 | ||
156 | 165 | let $l = IDS_LIST | |
157 | 166 | let $s = size($l) | |
158 | 167 | let $acc0 = $Tuple2(nil, 0) | |
159 | 168 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
160 | 169 | then $a | |
161 | 170 | else actionsHelper($a, $l[$i]) | |
162 | 171 | ||
163 | 172 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
164 | 173 | then $a | |
165 | 174 | else throw("List size exceeds 30") | |
166 | 175 | ||
167 | 176 | $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) | |
168 | 177 | } | |
169 | 178 | ||
170 | 179 | ||
171 | 180 | func getMoveAllUnlockedToAccumulatorActions (userAddress) = { | |
172 | 181 | func actionsHelper (acc,a) = { | |
173 | - | let $ | |
174 | - | let updateAllVestingsActions = $ | |
175 | - | let sum = $ | |
176 | - | let $ | |
177 | - | let updateVestingActions = $ | |
178 | - | let unlockedAmount = $ | |
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 | |
179 | 188 | $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount)) | |
180 | 189 | } | |
181 | 190 | ||
182 | - | let $ | |
191 | + | let $t051865274 = { | |
183 | 192 | let $l = IDS_LIST | |
184 | 193 | let $s = size($l) | |
185 | 194 | let $acc0 = $Tuple2(nil, 0) | |
186 | 195 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
187 | 196 | then $a | |
188 | 197 | else actionsHelper($a, $l[$i]) | |
189 | 198 | ||
190 | 199 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
191 | 200 | then $a | |
192 | 201 | else throw("List size exceeds 30") | |
193 | 202 | ||
194 | 203 | $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) | |
195 | 204 | } | |
196 | - | let updateAllVestingsActions = $ | |
197 | - | let unlockedSum = $ | |
205 | + | let updateAllVestingsActions = $t051865274._1 | |
206 | + | let unlockedSum = $t051865274._2 | |
198 | 207 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
199 | 208 | let updateAccumulatedActions = if ((unlockedSum != 0)) | |
200 | 209 | then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
201 | 210 | else nil | |
202 | 211 | $Tuple2((updateAllVestingsActions ++ updateAccumulatedActions), unlockedSum) | |
203 | 212 | } | |
204 | 213 | ||
205 | 214 | ||
206 | 215 | func getClaimAccumulatedActions (userAddress) = { | |
207 | 216 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
208 | 217 | if ((oldAccumulated != 0)) | |
209 | 218 | then $Tuple2([ScriptTransfer(addressFromStringValue(userAddress), oldAccumulated, assetIdBytes), DeleteEntry(keyUserAccumulated(userAddress))], oldAccumulated) | |
210 | 219 | else $Tuple2(nil, 0) | |
211 | 220 | } | |
212 | 221 | ||
213 | 222 | ||
214 | 223 | func getClaimAllActions (userAddress) = { | |
215 | - | let $ | |
216 | - | let claimActions = $ | |
217 | - | let unlockedAmount = $ | |
218 | - | let $ | |
219 | - | let claimAccumulatedActions = $ | |
220 | - | let accumulatedAmount = $ | |
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 | |
221 | 230 | let totalAmount = (unlockedAmount + accumulatedAmount) | |
222 | 231 | if ((totalAmount > 0)) | |
223 | 232 | then $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount) | |
224 | 233 | else throwErr("nothing to claim") | |
225 | 234 | } | |
226 | 235 | ||
227 | 236 | ||
228 | 237 | func getAvailableVestingId (userAddress) = { | |
229 | 238 | func helper (availableId,id) = { | |
230 | - | let $ | |
231 | - | let vestingAmount = $ | |
232 | - | let startBlock = $ | |
233 | - | let lockLength = $ | |
239 | + | let $t064986577 = parseUserVesting(userAddress, id) | |
240 | + | let vestingAmount = $t064986577._1 | |
241 | + | let startBlock = $t064986577._2 | |
242 | + | let lockLength = $t064986577._3 | |
234 | 243 | if ((vestingAmount > 0)) | |
235 | 244 | then availableId | |
236 | 245 | else if ((availableId == -1)) | |
237 | 246 | then id | |
238 | 247 | else min([availableId, id]) | |
239 | 248 | } | |
240 | 249 | ||
241 | 250 | let availableId = { | |
242 | 251 | let $l = IDS_LIST | |
243 | 252 | let $s = size($l) | |
244 | 253 | let $acc0 = -1 | |
245 | 254 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
246 | 255 | then $a | |
247 | 256 | else helper($a, $l[$i]) | |
248 | 257 | ||
249 | 258 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
250 | 259 | then $a | |
251 | 260 | else throw("List size exceeds 30") | |
252 | 261 | ||
253 | 262 | $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) | |
254 | 263 | } | |
255 | 264 | if ((availableId == -1)) | |
256 | 265 | then throwErr(makeString(["user exceeded max active vesting count: ", userAddress], " ")) | |
257 | 266 | else availableId | |
258 | 267 | } | |
259 | 268 | ||
260 | 269 | ||
261 | 270 | func getNewVestingActions (userAddress,id,vestingAmount,startBlock,lockLength) = [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(vestingAmount, startBlock, lockLength))] | |
262 | 271 | ||
263 | 272 | ||
264 | 273 | @Callable(i) | |
265 | 274 | func vestingForUser (userAddress,vestingAmount,startBlock,lockLength) = { | |
266 | 275 | let check = [if ((size(i.payments) == 1)) | |
267 | 276 | then true | |
268 | 277 | else throwErr("should be with exactly 1 payment"), if ((i.payments[0].assetId == assetIdBytes)) | |
269 | 278 | then true | |
270 | 279 | else throwErr(makeString(["payment assetId should be: ", assetIdString], " ")), if ((i.payments[0].amount == vestingAmount)) | |
271 | 280 | then true | |
272 | 281 | else throwErr("payment amount should be equal to vestingAmount"), if (if ((adminList == nil)) | |
273 | 282 | then true | |
274 | 283 | else containsElement(adminList, toString(i.caller))) | |
275 | 284 | then true | |
276 | 285 | else throwErr("you must be admin")] | |
277 | 286 | if ((check == check)) | |
278 | 287 | then { | |
279 | 288 | let id = getAvailableVestingId(userAddress) | |
280 | 289 | let historyActions = [IntegerEntry(keyVestingHistory("vested", userAddress, toBase58String(i.transactionId)), vestingAmount)] | |
281 | 290 | (getNewVestingActions(userAddress, id, vestingAmount, startBlock, lockLength) ++ historyActions) | |
282 | 291 | } | |
283 | 292 | else throw("Strict value is not equal to itself.") | |
284 | 293 | } | |
285 | 294 | ||
286 | 295 | ||
287 | 296 | ||
288 | 297 | @Callable(i) | |
289 | 298 | func claimAll () = { | |
290 | 299 | let userAddress = toString(i.caller) | |
291 | - | let $ | |
292 | - | let claimActions = $ | |
293 | - | let totalAmount = $ | |
300 | + | let $t080548119 = getClaimAllActions(userAddress) | |
301 | + | let claimActions = $t080548119._1 | |
302 | + | let totalAmount = $t080548119._2 | |
294 | 303 | let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)] | |
295 | 304 | (claimActions ++ historyActions) | |
296 | 305 | } | |
297 | 306 | ||
298 | 307 | ||
299 | 308 | ||
300 | 309 | @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 | + | } | |
302 | 352 | ||
303 | 353 |
github/deemru/w8io/169f3d6 55.43 ms ◑