tx · DeBG3B89GqEFXpUzK2eaantcCLwg5Cw6hnuai2ZzRqmE 3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1: -0.01100000 Waves 2024.01.09 15:40 [2923956] smart account 3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1 > SELF 0.00000000 Waves
{ "type": 13, "id": "DeBG3B89GqEFXpUzK2eaantcCLwg5Cw6hnuai2ZzRqmE", "fee": 1100000, "feeAssetId": null, "timestamp": 1704804039791, "version": 2, "chainId": 84, "sender": "3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1", "senderPublicKey": "7c3qLtcJ7EaPS2JDjXv8MBbd4kpyc6R27wcn5GgvZhur", "proofs": [ "snezoH8L6jHCy53LgnS3yzsu7V9XzesZN46swjRD1N321UpSSJ8mo13oiGvJAcYSF1y24VNLGoCRweyP8tMbkUt" ], "script": "base64:BgIWCAISBgoECAEBARIAEgMKAQgSAwoBCBwADGNvbnRyYWN0RmlsZQIQdmVzdGluZ19uZW8ucmlkZQADU0VQAgJfXwAISURTX0xJU1QJAMwIAgAACQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUJAMwIAgAGCQDMCAIABwkAzAgCAAgJAMwIAgAJCQDMCAIACgkAzAgCAAsJAMwIAgAMCQDMCAIADQkAzAgCAA4JAMwIAgAPCQDMCAIAEAkAzAgCABEJAMwIAgASCQDMCAIAEwkAzAgCABQJAMwIAgAVCQDMCAIAFgkAzAgCABcJAMwIAgAYCQDMCAIAGQkAzAgCABoJAMwIAgAbCQDMCAIAHAkAzAgCAB0FA25pbAARTUFYX1ZFU1RJTkdfQ09VTlQJAJADAQUISURTX0xJU1QBCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADWFzc2V0SWRTdHJpbmcJAQt2YWx1ZU9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RyeQIFCmtleUJhbkxpc3QJALsJAgkAzQgCBQdiYW5MaXN0BQt1c2VyQWRkcmVzcwICX18FA25pbAkAzggCBRhtb3ZlVG9BY2N1bXVsYXRlZEFjdGlvbnMFE2FkZFRvQmFuTGlzdEFjdGlvbnMJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEFdW5iYW4BC3VzZXJBZGRyZXNzBAZjaGVja3MJAMwIAgMDCQAAAgUJYWRtaW5MaXN0BQNuaWwGCQEPY29udGFpbnNFbGVtZW50AgUJYWRtaW5MaXN0CQClCAEIBQFpBmNhbGxlcgYJAQh0aHJvd0VycgECEXlvdSBtdXN0IGJlIGFkbWluCQDMCAIDCQEPY29udGFpbnNFbGVtZW50AgUHYmFuTGlzdAULdXNlckFkZHJlc3MGCQEIdGhyb3dFcnIBCQC5CQIJAMwIAgIXdXNlciBub3QgaW4gYSBiYW4gbGlzdDoJAMwIAgULdXNlckFkZHJlc3MFA25pbAIBIAUDbmlsAwkAAAIFBmNoZWNrcwUGY2hlY2tzBApuZXdCYW5MaXN0BAckbWF0Y2gwCQDPCAIFB2Jhbkxpc3QFC3VzZXJBZGRyZXNzAwkAAQIFByRtYXRjaDACA0ludAQDaW5kBQckbWF0Y2gwCQDRCAIFB2Jhbkxpc3QFA2luZAkBCHRocm93RXJyAQIrdXNlciBhZGRyZXNzIGluZGV4IGluIGJhbiBsaXN0IGlzIG5vdCBmb3VuZAMJAAACBQpuZXdCYW5MaXN0BQNuaWwJAMwIAgkBC0RlbGV0ZUVudHJ5AQUKa2V5QmFuTGlzdAUDbmlsCQDMCAIJAQtTdHJpbmdFbnRyeQIFCmtleUJhbkxpc3QJALsJAgUKbmV3QmFuTGlzdAICX18FA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgBXZ6KY", "height": 2923956, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CKptvzRwTAYpRJEnQ5ETTXLgFsfnL4A1Z23UsL1WGEND Next: AA7g7dX8UfSR8BYfNyy1tngFPsP3LNMVcfdt8u5VodX Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFile = "vesting_neo.ride" | |
345 | 345 | case _ => | |
346 | 346 | throwErr("user address index in ban list is not found") | |
347 | 347 | } | |
348 | - | [StringEntry(keyBanList, makeString_11C(newBanList, "__"))] | |
348 | + | if ((newBanList == nil)) | |
349 | + | then [DeleteEntry(keyBanList)] | |
350 | + | else [StringEntry(keyBanList, makeString_11C(newBanList, "__"))] | |
349 | 351 | } | |
350 | 352 | else throw("Strict value is not equal to itself.") | |
351 | 353 | } |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
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 | 25 | let keyBanList = makeString(["%s", "banList"], SEP) | |
26 | 26 | ||
27 | 27 | let adminList = match getString(this, keyAdminList) { | |
28 | 28 | case s: String => | |
29 | 29 | split(s, SEP) | |
30 | 30 | case _ => | |
31 | 31 | nil | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | let banList = match getString(this, keyBanList) { | |
35 | 35 | case s: String => | |
36 | 36 | split_51C(s, SEP) | |
37 | 37 | case _ => | |
38 | 38 | nil | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | func isValidAddressString (addressString) = match addressFromString(addressString) { | |
42 | 42 | case a: Address => | |
43 | 43 | true | |
44 | 44 | case _ => | |
45 | 45 | false | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyUserVesting (userAddress,id) = { | |
50 | 50 | let checks = [if (isValidAddressString(userAddress)) | |
51 | 51 | then true | |
52 | 52 | else throwErr(makeString(["address is not valid:", userAddress], " ")), if (if ((id >= 0)) | |
53 | 53 | then (MAX_VESTING_COUNT > id) | |
54 | 54 | else false) | |
55 | 55 | then true | |
56 | 56 | else throwErr(makeString(["id should be less than", toString(MAX_VESTING_COUNT), "got:", toString(id)], " "))] | |
57 | 57 | if ((checks == checks)) | |
58 | 58 | then makeString(["%s%s%d", "vesting", userAddress, toString(id)], SEP) | |
59 | 59 | else throw("Strict value is not equal to itself.") | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func keyUserAccumulated (userAddress) = { | |
64 | 64 | let checks = [if (isValidAddressString(userAddress)) | |
65 | 65 | then true | |
66 | 66 | else throwErr(makeString(["address is not valid:", userAddress], " "))] | |
67 | 67 | if ((checks == checks)) | |
68 | 68 | then makeString(["%s%s", "accumulated", userAddress], SEP) | |
69 | 69 | else throw("Strict value is not equal to itself.") | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func formatUserVesting (vestingAmount,startBlock,lockLength) = { | |
74 | 74 | let checks = [if ((vestingAmount >= 0)) | |
75 | 75 | then true | |
76 | 76 | else throwErr("vesting amount cannot be negative"), if ((startBlock >= 0)) | |
77 | 77 | then true | |
78 | 78 | else throwErr("start block cannot be negative"), if ((lockLength >= 0)) | |
79 | 79 | then true | |
80 | 80 | else throwErr("lock length cannot be negative")] | |
81 | 81 | if ((checks == checks)) | |
82 | 82 | then makeString(["%d%d%d%d%d", toString(vestingAmount), toString(startBlock), toString(lockLength)], SEP) | |
83 | 83 | else throw("Strict value is not equal to itself.") | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func parseUserVesting (userAddress,id) = match getString(this, keyUserVesting(userAddress, id)) { | |
88 | 88 | case rawString: String => | |
89 | 89 | let splitString = split(rawString, SEP) | |
90 | 90 | let vestingAmount = parseIntValue(splitString[1]) | |
91 | 91 | let startBlock = parseIntValue(splitString[2]) | |
92 | 92 | let lockLength = parseIntValue(splitString[3]) | |
93 | 93 | $Tuple3(vestingAmount, startBlock, lockLength) | |
94 | 94 | case _ => | |
95 | 95 | $Tuple3(0, 0, 0) | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", userAddress, action, txId], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func calcUnlockedAmount (amount,startBlock,lockLength) = { | |
103 | 103 | let elapsedBlocks = (height - startBlock) | |
104 | 104 | let unlockedAmount = if (if ((lockLength != 0)) | |
105 | 105 | then (elapsedBlocks > 0) | |
106 | 106 | else false) | |
107 | 107 | then min([fraction(amount, elapsedBlocks, lockLength), amount]) | |
108 | 108 | else 0 | |
109 | 109 | $Tuple2(unlockedAmount, (amount - unlockedAmount)) | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getUserUnlockedAmount (userAddress,id) = { | |
114 | 114 | let $t031883267 = parseUserVesting(userAddress, id) | |
115 | 115 | let vestingAmount = $t031883267._1 | |
116 | 116 | let startBlock = $t031883267._2 | |
117 | 117 | let lockLength = $t031883267._3 | |
118 | 118 | let $t032703367 = calcUnlockedAmount(vestingAmount, startBlock, lockLength) | |
119 | 119 | let unlockedAmount = $t032703367._1 | |
120 | 120 | let remainingAmount = $t032703367._2 | |
121 | 121 | $Tuple2(unlockedAmount, remainingAmount) | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getUpdateVestingActions (userAddress,id) = { | |
126 | 126 | let $t034743553 = parseUserVesting(userAddress, id) | |
127 | 127 | let vestingAmount = $t034743553._1 | |
128 | 128 | let startBlock = $t034743553._2 | |
129 | 129 | let lockLength = $t034743553._3 | |
130 | 130 | let $t035563634 = getUserUnlockedAmount(userAddress, id) | |
131 | 131 | let unlockedAmount = $t035563634._1 | |
132 | 132 | let remainingAmount = $t035563634._2 | |
133 | 133 | let remainingBlocks = max([((startBlock + lockLength) - height), 0]) | |
134 | 134 | let updateVestingActions = if ((unlockedAmount != 0)) | |
135 | 135 | then if ((remainingBlocks != 0)) | |
136 | 136 | then [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(remainingAmount, height, remainingBlocks))] | |
137 | 137 | else [DeleteEntry(keyUserVesting(userAddress, id))] | |
138 | 138 | else nil | |
139 | 139 | $Tuple2(updateVestingActions, unlockedAmount) | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getUserClaimActions (userAddress,id) = { | |
144 | 144 | let $t040984183 = getUpdateVestingActions(userAddress, id) | |
145 | 145 | let updateVestingActions = $t040984183._1 | |
146 | 146 | let unlockedAmount = $t040984183._2 | |
147 | 147 | let transferActions = if ((unlockedAmount != 0)) | |
148 | 148 | then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)] | |
149 | 149 | else nil | |
150 | 150 | $Tuple2((updateVestingActions ++ transferActions), unlockedAmount) | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getAllUserClaimActions (userAddress) = { | |
155 | 155 | func actionsHelper (acc,a) = { | |
156 | 156 | let $t045574597 = acc | |
157 | 157 | let allVestingsClaimActions = $t045574597._1 | |
158 | 158 | let sum = $t045574597._2 | |
159 | 159 | let $t046024678 = getUserClaimActions(userAddress, a) | |
160 | 160 | let vestingClaimActions = $t046024678._1 | |
161 | 161 | let claimAmount = $t046024678._2 | |
162 | 162 | $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount)) | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | let $l = IDS_LIST | |
166 | 166 | let $s = size($l) | |
167 | 167 | let $acc0 = $Tuple2(nil, 0) | |
168 | 168 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
169 | 169 | then $a | |
170 | 170 | else actionsHelper($a, $l[$i]) | |
171 | 171 | ||
172 | 172 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
173 | 173 | then $a | |
174 | 174 | else throw("List size exceeds 30") | |
175 | 175 | ||
176 | 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) | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func getMoveAllUnlockedToAccumulatorActions (userAddress) = { | |
181 | 181 | func actionsHelper (acc,a) = { | |
182 | 182 | let $t049705011 = acc | |
183 | 183 | let updateAllVestingsActions = $t049705011._1 | |
184 | 184 | let sum = $t049705011._2 | |
185 | 185 | let $t050165100 = getUpdateVestingActions(userAddress, a) | |
186 | 186 | let updateVestingActions = $t050165100._1 | |
187 | 187 | let unlockedAmount = $t050165100._2 | |
188 | 188 | $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount)) | |
189 | 189 | } | |
190 | 190 | ||
191 | 191 | let $t051865274 = { | |
192 | 192 | let $l = IDS_LIST | |
193 | 193 | let $s = size($l) | |
194 | 194 | let $acc0 = $Tuple2(nil, 0) | |
195 | 195 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
196 | 196 | then $a | |
197 | 197 | else actionsHelper($a, $l[$i]) | |
198 | 198 | ||
199 | 199 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
200 | 200 | then $a | |
201 | 201 | else throw("List size exceeds 30") | |
202 | 202 | ||
203 | 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) | |
204 | 204 | } | |
205 | 205 | let updateAllVestingsActions = $t051865274._1 | |
206 | 206 | let unlockedSum = $t051865274._2 | |
207 | 207 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
208 | 208 | let updateAccumulatedActions = if ((unlockedSum != 0)) | |
209 | 209 | then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
210 | 210 | else nil | |
211 | 211 | $Tuple2((updateAllVestingsActions ++ updateAccumulatedActions), unlockedSum) | |
212 | 212 | } | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func getClaimAccumulatedActions (userAddress) = { | |
216 | 216 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
217 | 217 | if ((oldAccumulated != 0)) | |
218 | 218 | then $Tuple2([ScriptTransfer(addressFromStringValue(userAddress), oldAccumulated, assetIdBytes), DeleteEntry(keyUserAccumulated(userAddress))], oldAccumulated) | |
219 | 219 | else $Tuple2(nil, 0) | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func getClaimAllActions (userAddress) = { | |
224 | 224 | let $t060426114 = getAllUserClaimActions(userAddress) | |
225 | 225 | let claimActions = $t060426114._1 | |
226 | 226 | let unlockedAmount = $t060426114._2 | |
227 | 227 | let $t061176207 = getClaimAccumulatedActions(userAddress) | |
228 | 228 | let claimAccumulatedActions = $t061176207._1 | |
229 | 229 | let accumulatedAmount = $t061176207._2 | |
230 | 230 | let totalAmount = (unlockedAmount + accumulatedAmount) | |
231 | 231 | if ((totalAmount > 0)) | |
232 | 232 | then $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount) | |
233 | 233 | else throwErr("nothing to claim") | |
234 | 234 | } | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func getAvailableVestingId (userAddress) = { | |
238 | 238 | func helper (availableId,id) = { | |
239 | 239 | let $t064986577 = parseUserVesting(userAddress, id) | |
240 | 240 | let vestingAmount = $t064986577._1 | |
241 | 241 | let startBlock = $t064986577._2 | |
242 | 242 | let lockLength = $t064986577._3 | |
243 | 243 | if ((vestingAmount > 0)) | |
244 | 244 | then availableId | |
245 | 245 | else if ((availableId == -1)) | |
246 | 246 | then id | |
247 | 247 | else min([availableId, id]) | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | let availableId = { | |
251 | 251 | let $l = IDS_LIST | |
252 | 252 | let $s = size($l) | |
253 | 253 | let $acc0 = -1 | |
254 | 254 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
255 | 255 | then $a | |
256 | 256 | else helper($a, $l[$i]) | |
257 | 257 | ||
258 | 258 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
259 | 259 | then $a | |
260 | 260 | else throw("List size exceeds 30") | |
261 | 261 | ||
262 | 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) | |
263 | 263 | } | |
264 | 264 | if ((availableId == -1)) | |
265 | 265 | then throwErr(makeString(["user exceeded max active vesting count: ", userAddress], " ")) | |
266 | 266 | else availableId | |
267 | 267 | } | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | func getNewVestingActions (userAddress,id,vestingAmount,startBlock,lockLength) = [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(vestingAmount, startBlock, lockLength))] | |
271 | 271 | ||
272 | 272 | ||
273 | 273 | @Callable(i) | |
274 | 274 | func vestingForUser (userAddress,vestingAmount,startBlock,lockLength) = { | |
275 | 275 | let check = [if ((size(i.payments) == 1)) | |
276 | 276 | then true | |
277 | 277 | else throwErr("should be with exactly 1 payment"), if ((i.payments[0].assetId == assetIdBytes)) | |
278 | 278 | then true | |
279 | 279 | else throwErr(makeString(["payment assetId should be: ", assetIdString], " ")), if ((i.payments[0].amount == vestingAmount)) | |
280 | 280 | then true | |
281 | 281 | else throwErr("payment amount should be equal to vestingAmount"), if (if ((adminList == nil)) | |
282 | 282 | then true | |
283 | 283 | else containsElement(adminList, toString(i.caller))) | |
284 | 284 | then true | |
285 | 285 | else throwErr("you must be admin")] | |
286 | 286 | if ((check == check)) | |
287 | 287 | then { | |
288 | 288 | let id = getAvailableVestingId(userAddress) | |
289 | 289 | let historyActions = [IntegerEntry(keyVestingHistory("vested", userAddress, toBase58String(i.transactionId)), vestingAmount)] | |
290 | 290 | (getNewVestingActions(userAddress, id, vestingAmount, startBlock, lockLength) ++ historyActions) | |
291 | 291 | } | |
292 | 292 | else throw("Strict value is not equal to itself.") | |
293 | 293 | } | |
294 | 294 | ||
295 | 295 | ||
296 | 296 | ||
297 | 297 | @Callable(i) | |
298 | 298 | func claimAll () = { | |
299 | 299 | let userAddress = toString(i.caller) | |
300 | 300 | let $t080548119 = getClaimAllActions(userAddress) | |
301 | 301 | let claimActions = $t080548119._1 | |
302 | 302 | let totalAmount = $t080548119._2 | |
303 | 303 | let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)] | |
304 | 304 | (claimActions ++ historyActions) | |
305 | 305 | } | |
306 | 306 | ||
307 | 307 | ||
308 | 308 | ||
309 | 309 | @Callable(i) | |
310 | 310 | func ban (userAddress) = { | |
311 | 311 | let checks = [if (if ((adminList == nil)) | |
312 | 312 | then true | |
313 | 313 | else containsElement(adminList, toString(i.caller))) | |
314 | 314 | then true | |
315 | 315 | else throwErr("you must be admin"), if (!(containsElement(banList, userAddress))) | |
316 | 316 | then true | |
317 | 317 | else throwErr(makeString(["user already in a ban list:", userAddress], " "))] | |
318 | 318 | if ((checks == checks)) | |
319 | 319 | then { | |
320 | 320 | let $t085918679 = getMoveAllUnlockedToAccumulatorActions(userAddress) | |
321 | 321 | let moveToAccumulatedActions = $t085918679._1 | |
322 | 322 | let _a = $t085918679._2 | |
323 | 323 | let addToBanListActions = [StringEntry(keyBanList, makeString_11C((banList :+ userAddress), "__"))] | |
324 | 324 | (moveToAccumulatedActions ++ addToBanListActions) | |
325 | 325 | } | |
326 | 326 | else throw("Strict value is not equal to itself.") | |
327 | 327 | } | |
328 | 328 | ||
329 | 329 | ||
330 | 330 | ||
331 | 331 | @Callable(i) | |
332 | 332 | func unban (userAddress) = { | |
333 | 333 | let checks = [if (if ((adminList == nil)) | |
334 | 334 | then true | |
335 | 335 | else containsElement(adminList, toString(i.caller))) | |
336 | 336 | then true | |
337 | 337 | else throwErr("you must be admin"), if (containsElement(banList, userAddress)) | |
338 | 338 | then true | |
339 | 339 | else throwErr(makeString(["user not in a ban list:", userAddress], " "))] | |
340 | 340 | if ((checks == checks)) | |
341 | 341 | then { | |
342 | 342 | let newBanList = match indexOf(banList, userAddress) { | |
343 | 343 | case ind: Int => | |
344 | 344 | removeByIndex(banList, ind) | |
345 | 345 | case _ => | |
346 | 346 | throwErr("user address index in ban list is not found") | |
347 | 347 | } | |
348 | - | [StringEntry(keyBanList, makeString_11C(newBanList, "__"))] | |
348 | + | if ((newBanList == nil)) | |
349 | + | then [DeleteEntry(keyBanList)] | |
350 | + | else [StringEntry(keyBanList, makeString_11C(newBanList, "__"))] | |
349 | 351 | } | |
350 | 352 | else throw("Strict value is not equal to itself.") | |
351 | 353 | } | |
352 | 354 | ||
353 | 355 |
github/deemru/w8io/169f3d6 51.02 ms ◑