tx · 3ugbYTTe5RSAEHKaUcink3srFrtFXse1o2mpQfX4Mp6R 3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1: -0.01300000 Waves 2024.01.12 10:37 [2928005] smart account 3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1 > SELF 0.00000000 Waves
{ "type": 13, "id": "3ugbYTTe5RSAEHKaUcink3srFrtFXse1o2mpQfX4Mp6R", "fee": 1300000, "feeAssetId": null, "timestamp": 1705045112643, "version": 2, "chainId": 84, "sender": "3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1", "senderPublicKey": "7c3qLtcJ7EaPS2JDjXv8MBbd4kpyc6R27wcn5GgvZhur", "proofs": [ "3sbe8cdjkU5CL2LpzSVAdedurLcGAqhswvfz9UjWduuE26muW234DWfKkR6uUEgEQy5w973FC4oAuA88rCNwq7R5" ], "script": "base64:BgIbCAISBgoECAEBARIDCgEIEgMKAQgSABIDCgEIIQAMY29udHJhY3RGaWxlAhB2ZXN0aW5nX25lby5yaWRlAANTRVACAl9fAAhJRFNfTElTVAkAzAgCAAAJAMwIAgABCQDMCAIAAgkAzAgCAAMJAMwIAgAECQDMCAIABQkAzAgCAAYJAMwIAgAHCQDMCAIACAkAzAgCAAkJAMwIAgAKCQDMCAIACwkAzAgCAAwJAMwIAgANCQDMCAIADgkAzAgCAA8JAMwIAgAQCQDMCAIAEQkAzAgCABIJAMwIAgATCQDMCAIAFAkAzAgCABUJAMwIAgAWCQDMCAIAFwkAzAgCABgJAMwIAgAZCQDMCAIAGgkAzAgCABsJAMwIAgAcCQDMCAIAHQUDbmlsABFNQVhfVkVTVElOR19DT1VOVAkAkAMBBQhJRFNfTElTVAEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cBE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFuYWdlclB1YmxpY0tleQEWa2V5TWFuYWdlclZhdWx0QWRkcmVzcwACFyVzX19t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zBA0kdDAxMTE1MDExMjA1CQESZ2V0Q2xhaW1BbGxBY3Rpb25zAQULdXNlckFkZHJlc3MEAl9hCAUNJHQwMTExNTAxMTIwNQJfMQQLdG90YWxBbW91bnQIBQ0kdDAxMTE1MDExMjA1Al8yBBFhY2N1bXVsYXRlZEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzCQESa2V5VXNlckFjY3VtdWxhdGVkAQULdXNlckFkZHJlc3MAAAkAlAoCBQNuaWwJAJUKAwULdG90YWxBbW91bnQFEWFjY3VtdWxhdGVkQW1vdW50CQESZ2V0VmVzdGluZ1VzZXJJbmZvAQULdXNlckFkZHJlc3MBAnR4AQZ2ZXJpZnkABA90YXJnZXRQdWJsaWNLZXkEByRtYXRjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXlvdhaU", "height": 2928005, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DZzX9CgaF2xRFZ6oAHDynpCyNcv8vpCYfUj1PBHCGtQ3 Next: 6ufmP5RMMxW3rVNkZsrigp22Mnx2QtAE6Mzr6XPNJWkU Diff:
Old | New | Differences | |
---|---|---|---|
10 | 10 | let MAX_VESTING_COUNT = size(IDS_LIST) | |
11 | 11 | ||
12 | 12 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
13 | + | ||
14 | + | ||
15 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
16 | + | ||
17 | + | ||
18 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
19 | + | ||
20 | + | ||
21 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
22 | + | case s: String => | |
23 | + | addressFromStringValue(s) | |
24 | + | case _ => | |
25 | + | this | |
26 | + | } | |
27 | + | ||
28 | + | ||
29 | + | func managerPublicKeyOrUnit () = { | |
30 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
31 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
32 | + | case s: String => | |
33 | + | fromBase58String(s) | |
34 | + | case _: Unit => | |
35 | + | unit | |
36 | + | case _ => | |
37 | + | throw("Match error") | |
38 | + | } | |
39 | + | } | |
13 | 40 | ||
14 | 41 | ||
15 | 42 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
31 | 58 | nil | |
32 | 59 | } | |
33 | 60 | ||
34 | - | let banList = match getString(this, keyBanList) { | |
35 | - | case s: String => | |
36 | - | if ((s == "")) | |
37 | - | then nil | |
38 | - | else split_51C(s, SEP) | |
39 | - | case _ => | |
40 | - | nil | |
41 | - | } | |
61 | + | let banList = { | |
62 | + | let banListRaw = valueOrElse(getString(this, keyBanList), "") | |
63 | + | if ((banListRaw == "")) | |
64 | + | then nil | |
65 | + | else split_51C(banListRaw, SEP) | |
66 | + | } | |
42 | 67 | ||
43 | 68 | func isValidAddressString (addressString) = match addressFromString(addressString) { | |
44 | 69 | case a: Address => | |
113 | 138 | ||
114 | 139 | ||
115 | 140 | func getUserUnlockedAmount (userAddress,id) = { | |
116 | - | let $ | |
117 | - | let vestingAmount = $ | |
118 | - | let startBlock = $ | |
119 | - | let lockLength = $ | |
120 | - | let $ | |
121 | - | let unlockedAmount = $ | |
122 | - | let remainingAmount = $ | |
141 | + | let $t037793858 = parseUserVesting(userAddress, id) | |
142 | + | let vestingAmount = $t037793858._1 | |
143 | + | let startBlock = $t037793858._2 | |
144 | + | let lockLength = $t037793858._3 | |
145 | + | let $t038613958 = calcUnlockedAmount(vestingAmount, startBlock, lockLength) | |
146 | + | let unlockedAmount = $t038613958._1 | |
147 | + | let remainingAmount = $t038613958._2 | |
123 | 148 | $Tuple2(unlockedAmount, remainingAmount) | |
124 | 149 | } | |
125 | 150 | ||
126 | 151 | ||
127 | 152 | func getUpdateVestingActions (userAddress,id) = { | |
128 | - | let $ | |
129 | - | let vestingAmount = $ | |
130 | - | let startBlock = $ | |
131 | - | let lockLength = $ | |
132 | - | let $ | |
133 | - | let unlockedAmount = $ | |
134 | - | let remainingAmount = $ | |
153 | + | let $t040654144 = parseUserVesting(userAddress, id) | |
154 | + | let vestingAmount = $t040654144._1 | |
155 | + | let startBlock = $t040654144._2 | |
156 | + | let lockLength = $t040654144._3 | |
157 | + | let $t041474225 = getUserUnlockedAmount(userAddress, id) | |
158 | + | let unlockedAmount = $t041474225._1 | |
159 | + | let remainingAmount = $t041474225._2 | |
135 | 160 | let remainingBlocks = max([((startBlock + lockLength) - height), 0]) | |
136 | 161 | let updateVestingActions = if ((unlockedAmount != 0)) | |
137 | 162 | then if ((remainingBlocks != 0)) | |
143 | 168 | ||
144 | 169 | ||
145 | 170 | func getUserClaimActions (userAddress,id) = { | |
146 | - | let $ | |
147 | - | let updateVestingActions = $ | |
148 | - | let unlockedAmount = $ | |
171 | + | let $t046894774 = getUpdateVestingActions(userAddress, id) | |
172 | + | let updateVestingActions = $t046894774._1 | |
173 | + | let unlockedAmount = $t046894774._2 | |
149 | 174 | let transferActions = if ((unlockedAmount != 0)) | |
150 | 175 | then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)] | |
151 | 176 | else nil | |
155 | 180 | ||
156 | 181 | func getAllUserClaimActions (userAddress) = { | |
157 | 182 | func actionsHelper (acc,id) = { | |
158 | - | let $ | |
159 | - | let allVestingsClaimActions = $ | |
160 | - | let sum = $ | |
161 | - | let $ | |
162 | - | let vestingClaimActions = $ | |
163 | - | let claimAmount = $ | |
183 | + | let $t051485188 = acc | |
184 | + | let allVestingsClaimActions = $t051485188._1 | |
185 | + | let sum = $t051485188._2 | |
186 | + | let $t051935270 = getUserClaimActions(userAddress, id) | |
187 | + | let vestingClaimActions = $t051935270._1 | |
188 | + | let claimAmount = $t051935270._2 | |
164 | 189 | $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount)) | |
165 | 190 | } | |
166 | 191 | ||
181 | 206 | ||
182 | 207 | func getMoveAllUnlockedToAccumulatorActions (userAddress) = { | |
183 | 208 | func actionsHelper (acc,id) = { | |
184 | - | let $ | |
185 | - | let updateAllVestingsActions = $ | |
186 | - | let sum = $ | |
187 | - | let $ | |
188 | - | let updateVestingActions = $ | |
189 | - | let unlockedAmount = $ | |
209 | + | let $t055635604 = acc | |
210 | + | let updateAllVestingsActions = $t055635604._1 | |
211 | + | let sum = $t055635604._2 | |
212 | + | let $t056095694 = getUpdateVestingActions(userAddress, id) | |
213 | + | let updateVestingActions = $t056095694._1 | |
214 | + | let unlockedAmount = $t056095694._2 | |
190 | 215 | $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount)) | |
191 | 216 | } | |
192 | 217 | ||
193 | - | let $ | |
218 | + | let $t057805868 = { | |
194 | 219 | let $l = IDS_LIST | |
195 | 220 | let $s = size($l) | |
196 | 221 | let $acc0 = $Tuple2(nil, 0) | |
204 | 229 | ||
205 | 230 | $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) | |
206 | 231 | } | |
207 | - | let updateAllVestingsActions = $ | |
208 | - | let unlockedSum = $ | |
232 | + | let updateAllVestingsActions = $t057805868._1 | |
233 | + | let unlockedSum = $t057805868._2 | |
209 | 234 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
210 | 235 | let updateAccumulatedActions = if ((unlockedSum != 0)) | |
211 | 236 | then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
223 | 248 | ||
224 | 249 | ||
225 | 250 | func getClaimAllActions (userAddress) = { | |
226 | - | let $ | |
251 | + | let $t066366769 = if (!(containsElement(banList, userAddress))) | |
227 | 252 | then getAllUserClaimActions(userAddress) | |
228 | 253 | else $Tuple2(nil, 0) | |
229 | - | let claimActions = $ | |
230 | - | let unlockedAmount = $ | |
231 | - | let $ | |
232 | - | let claimAccumulatedActions = $ | |
233 | - | let accumulatedAmount = $ | |
254 | + | let claimActions = $t066366769._1 | |
255 | + | let unlockedAmount = $t066366769._2 | |
256 | + | let $t067726862 = getClaimAccumulatedActions(userAddress) | |
257 | + | let claimAccumulatedActions = $t067726862._1 | |
258 | + | let accumulatedAmount = $t067726862._2 | |
234 | 259 | let totalAmount = (unlockedAmount + accumulatedAmount) | |
235 | 260 | $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount) | |
236 | 261 | } | |
238 | 263 | ||
239 | 264 | func getVestingUserInfo (userAddress) = { | |
240 | 265 | func helper (acc,id) = { | |
241 | - | let $ | |
242 | - | let vestingAmount = $ | |
243 | - | let startBlock = $ | |
244 | - | let lockLength = $ | |
245 | - | let $ | |
246 | - | let unlockedAmount = $ | |
247 | - | let remainingAmount = $ | |
266 | + | let $t070767155 = parseUserVesting(userAddress, id) | |
267 | + | let vestingAmount = $t070767155._1 | |
268 | + | let startBlock = $t070767155._2 | |
269 | + | let lockLength = $t070767155._3 | |
270 | + | let $t071607238 = getUserUnlockedAmount(userAddress, id) | |
271 | + | let unlockedAmount = $t071607238._1 | |
272 | + | let remainingAmount = $t071607238._2 | |
248 | 273 | if (if ((vestingAmount == 0)) | |
249 | 274 | then true | |
250 | 275 | else containsElement(banList, userAddress)) | |
269 | 294 | ||
270 | 295 | func getAvailableVestingId (userAddress) = { | |
271 | 296 | func helper (availableId,id) = { | |
272 | - | let $ | |
273 | - | let vestingAmount = $ | |
274 | - | let startBlock = $ | |
275 | - | let lockLength = $ | |
297 | + | let $t075627641 = parseUserVesting(userAddress, id) | |
298 | + | let vestingAmount = $t075627641._1 | |
299 | + | let startBlock = $t075627641._2 | |
300 | + | let lockLength = $t075627641._3 | |
276 | 301 | if ((vestingAmount > 0)) | |
277 | 302 | then availableId | |
278 | 303 | else if ((availableId == -1)) | |
338 | 363 | else throwErr(makeString(["user already in a ban list:", userAddress], " "))] | |
339 | 364 | if ((checks == checks)) | |
340 | 365 | then { | |
341 | - | let $ | |
342 | - | let moveToAccumulatedActions = $ | |
343 | - | let _a = $ | |
366 | + | let $t095039591 = getMoveAllUnlockedToAccumulatorActions(userAddress) | |
367 | + | let moveToAccumulatedActions = $t095039591._1 | |
368 | + | let _a = $t095039591._2 | |
344 | 369 | let addToBanListActions = [StringEntry(keyBanList, makeString_11C((banList :+ userAddress), "__"))] | |
345 | 370 | (moveToAccumulatedActions ++ addToBanListActions) | |
346 | 371 | } | |
378 | 403 | @Callable(i) | |
379 | 404 | func claimAll () = { | |
380 | 405 | let userAddress = toString(i.caller) | |
381 | - | let $ | |
382 | - | let claimActions = $ | |
383 | - | let totalAmount = $ | |
406 | + | let $t01048410549 = getClaimAllActions(userAddress) | |
407 | + | let claimActions = $t01048410549._1 | |
408 | + | let totalAmount = $t01048410549._2 | |
384 | 409 | let historyActions = [StringEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), toString(totalAmount))] | |
385 | 410 | if ((totalAmount > 0)) | |
386 | 411 | then (claimActions ++ historyActions) | |
391 | 416 | ||
392 | 417 | @Callable(i) | |
393 | 418 | func userInfoREADONLY (userAddress) = { | |
394 | - | let $ | |
395 | - | let _a = $ | |
396 | - | let totalAmount = $ | |
419 | + | let $t01115011205 = getClaimAllActions(userAddress) | |
420 | + | let _a = $t01115011205._1 | |
421 | + | let totalAmount = $t01115011205._2 | |
397 | 422 | let accumulatedAmount = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
398 | 423 | $Tuple2(nil, $Tuple3(totalAmount, accumulatedAmount, getVestingUserInfo(userAddress))) | |
399 | 424 | } | |
400 | 425 | ||
401 | 426 | ||
427 | + | @Verifier(tx) | |
428 | + | func verify () = { | |
429 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
430 | + | case pk: ByteVector => | |
431 | + | pk | |
432 | + | case _: Unit => | |
433 | + | tx.senderPublicKey | |
434 | + | case _ => | |
435 | + | throw("Match error") | |
436 | + | } | |
437 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
438 | + | } | |
439 | + |
Old | New | Differences | |
---|---|---|---|
1 | 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 | + | ||
14 | + | ||
15 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
16 | + | ||
17 | + | ||
18 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
19 | + | ||
20 | + | ||
21 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
22 | + | case s: String => | |
23 | + | addressFromStringValue(s) | |
24 | + | case _ => | |
25 | + | this | |
26 | + | } | |
27 | + | ||
28 | + | ||
29 | + | func managerPublicKeyOrUnit () = { | |
30 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
31 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
32 | + | case s: String => | |
33 | + | fromBase58String(s) | |
34 | + | case _: Unit => | |
35 | + | unit | |
36 | + | case _ => | |
37 | + | throw("Match error") | |
38 | + | } | |
39 | + | } | |
13 | 40 | ||
14 | 41 | ||
15 | 42 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
16 | 43 | ||
17 | 44 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
18 | 45 | ||
19 | 46 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
20 | 47 | then unit | |
21 | 48 | else fromBase58String(assetIdString) | |
22 | 49 | ||
23 | 50 | let keyAdminList = makeString(["%s", "adminAddressList"], SEP) | |
24 | 51 | ||
25 | 52 | let keyBanList = makeString(["%s", "banList"], SEP) | |
26 | 53 | ||
27 | 54 | let adminList = match getString(this, keyAdminList) { | |
28 | 55 | case s: String => | |
29 | 56 | split(s, SEP) | |
30 | 57 | case _ => | |
31 | 58 | nil | |
32 | 59 | } | |
33 | 60 | ||
34 | - | let banList = match getString(this, keyBanList) { | |
35 | - | case s: String => | |
36 | - | if ((s == "")) | |
37 | - | then nil | |
38 | - | else split_51C(s, SEP) | |
39 | - | case _ => | |
40 | - | nil | |
41 | - | } | |
61 | + | let banList = { | |
62 | + | let banListRaw = valueOrElse(getString(this, keyBanList), "") | |
63 | + | if ((banListRaw == "")) | |
64 | + | then nil | |
65 | + | else split_51C(banListRaw, SEP) | |
66 | + | } | |
42 | 67 | ||
43 | 68 | func isValidAddressString (addressString) = match addressFromString(addressString) { | |
44 | 69 | case a: Address => | |
45 | 70 | true | |
46 | 71 | case _ => | |
47 | 72 | false | |
48 | 73 | } | |
49 | 74 | ||
50 | 75 | ||
51 | 76 | func keyUserVesting (userAddress,id) = { | |
52 | 77 | let checks = [if (isValidAddressString(userAddress)) | |
53 | 78 | then true | |
54 | 79 | else throwErr(makeString(["address is not valid:", userAddress], " ")), if (if ((id >= 0)) | |
55 | 80 | then (MAX_VESTING_COUNT > id) | |
56 | 81 | else false) | |
57 | 82 | then true | |
58 | 83 | else throwErr(makeString(["id should be less than", toString(MAX_VESTING_COUNT), "got:", toString(id)], " "))] | |
59 | 84 | if ((checks == checks)) | |
60 | 85 | then makeString(["%s%s%d", "vesting", userAddress, toString(id)], SEP) | |
61 | 86 | else throw("Strict value is not equal to itself.") | |
62 | 87 | } | |
63 | 88 | ||
64 | 89 | ||
65 | 90 | func keyUserAccumulated (userAddress) = { | |
66 | 91 | let checks = [if (isValidAddressString(userAddress)) | |
67 | 92 | then true | |
68 | 93 | else throwErr(makeString(["address is not valid:", userAddress], " "))] | |
69 | 94 | if ((checks == checks)) | |
70 | 95 | then makeString(["%s%s", "accumulated", userAddress], SEP) | |
71 | 96 | else throw("Strict value is not equal to itself.") | |
72 | 97 | } | |
73 | 98 | ||
74 | 99 | ||
75 | 100 | func formatUserVesting (vestingAmount,startBlock,lockLength) = { | |
76 | 101 | let checks = [if ((vestingAmount >= 0)) | |
77 | 102 | then true | |
78 | 103 | else throwErr("vesting amount cannot be negative"), if ((startBlock >= 0)) | |
79 | 104 | then true | |
80 | 105 | else throwErr("start block cannot be negative"), if ((lockLength >= 0)) | |
81 | 106 | then true | |
82 | 107 | else throwErr("lock length cannot be negative")] | |
83 | 108 | if ((checks == checks)) | |
84 | 109 | then makeString(["%d%d%d", toString(vestingAmount), toString(startBlock), toString(lockLength)], SEP) | |
85 | 110 | else throw("Strict value is not equal to itself.") | |
86 | 111 | } | |
87 | 112 | ||
88 | 113 | ||
89 | 114 | func parseUserVesting (userAddress,id) = match getString(this, keyUserVesting(userAddress, id)) { | |
90 | 115 | case rawString: String => | |
91 | 116 | let splitString = split(rawString, SEP) | |
92 | 117 | let vestingAmount = parseIntValue(splitString[1]) | |
93 | 118 | let startBlock = parseIntValue(splitString[2]) | |
94 | 119 | let lockLength = parseIntValue(splitString[3]) | |
95 | 120 | $Tuple3(vestingAmount, startBlock, lockLength) | |
96 | 121 | case _ => | |
97 | 122 | $Tuple3(0, 0, 0) | |
98 | 123 | } | |
99 | 124 | ||
100 | 125 | ||
101 | 126 | func keyVestingHistory (action,userAddress,txId) = makeString(["%s%s%s%s", "history", userAddress, action, txId], SEP) | |
102 | 127 | ||
103 | 128 | ||
104 | 129 | func calcUnlockedAmount (amount,startBlock,lockLength) = { | |
105 | 130 | let elapsedBlocks = (height - startBlock) | |
106 | 131 | let unlockedAmount = if (if ((lockLength != 0)) | |
107 | 132 | then (elapsedBlocks > 0) | |
108 | 133 | else false) | |
109 | 134 | then min([fraction(amount, elapsedBlocks, lockLength), amount]) | |
110 | 135 | else 0 | |
111 | 136 | $Tuple2(unlockedAmount, (amount - unlockedAmount)) | |
112 | 137 | } | |
113 | 138 | ||
114 | 139 | ||
115 | 140 | func getUserUnlockedAmount (userAddress,id) = { | |
116 | - | let $ | |
117 | - | let vestingAmount = $ | |
118 | - | let startBlock = $ | |
119 | - | let lockLength = $ | |
120 | - | let $ | |
121 | - | let unlockedAmount = $ | |
122 | - | let remainingAmount = $ | |
141 | + | let $t037793858 = parseUserVesting(userAddress, id) | |
142 | + | let vestingAmount = $t037793858._1 | |
143 | + | let startBlock = $t037793858._2 | |
144 | + | let lockLength = $t037793858._3 | |
145 | + | let $t038613958 = calcUnlockedAmount(vestingAmount, startBlock, lockLength) | |
146 | + | let unlockedAmount = $t038613958._1 | |
147 | + | let remainingAmount = $t038613958._2 | |
123 | 148 | $Tuple2(unlockedAmount, remainingAmount) | |
124 | 149 | } | |
125 | 150 | ||
126 | 151 | ||
127 | 152 | func getUpdateVestingActions (userAddress,id) = { | |
128 | - | let $ | |
129 | - | let vestingAmount = $ | |
130 | - | let startBlock = $ | |
131 | - | let lockLength = $ | |
132 | - | let $ | |
133 | - | let unlockedAmount = $ | |
134 | - | let remainingAmount = $ | |
153 | + | let $t040654144 = parseUserVesting(userAddress, id) | |
154 | + | let vestingAmount = $t040654144._1 | |
155 | + | let startBlock = $t040654144._2 | |
156 | + | let lockLength = $t040654144._3 | |
157 | + | let $t041474225 = getUserUnlockedAmount(userAddress, id) | |
158 | + | let unlockedAmount = $t041474225._1 | |
159 | + | let remainingAmount = $t041474225._2 | |
135 | 160 | let remainingBlocks = max([((startBlock + lockLength) - height), 0]) | |
136 | 161 | let updateVestingActions = if ((unlockedAmount != 0)) | |
137 | 162 | then if ((remainingBlocks != 0)) | |
138 | 163 | then [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(remainingAmount, height, remainingBlocks))] | |
139 | 164 | else [DeleteEntry(keyUserVesting(userAddress, id))] | |
140 | 165 | else nil | |
141 | 166 | $Tuple2(updateVestingActions, unlockedAmount) | |
142 | 167 | } | |
143 | 168 | ||
144 | 169 | ||
145 | 170 | func getUserClaimActions (userAddress,id) = { | |
146 | - | let $ | |
147 | - | let updateVestingActions = $ | |
148 | - | let unlockedAmount = $ | |
171 | + | let $t046894774 = getUpdateVestingActions(userAddress, id) | |
172 | + | let updateVestingActions = $t046894774._1 | |
173 | + | let unlockedAmount = $t046894774._2 | |
149 | 174 | let transferActions = if ((unlockedAmount != 0)) | |
150 | 175 | then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)] | |
151 | 176 | else nil | |
152 | 177 | $Tuple2((updateVestingActions ++ transferActions), unlockedAmount) | |
153 | 178 | } | |
154 | 179 | ||
155 | 180 | ||
156 | 181 | func getAllUserClaimActions (userAddress) = { | |
157 | 182 | func actionsHelper (acc,id) = { | |
158 | - | let $ | |
159 | - | let allVestingsClaimActions = $ | |
160 | - | let sum = $ | |
161 | - | let $ | |
162 | - | let vestingClaimActions = $ | |
163 | - | let claimAmount = $ | |
183 | + | let $t051485188 = acc | |
184 | + | let allVestingsClaimActions = $t051485188._1 | |
185 | + | let sum = $t051485188._2 | |
186 | + | let $t051935270 = getUserClaimActions(userAddress, id) | |
187 | + | let vestingClaimActions = $t051935270._1 | |
188 | + | let claimAmount = $t051935270._2 | |
164 | 189 | $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount)) | |
165 | 190 | } | |
166 | 191 | ||
167 | 192 | let $l = IDS_LIST | |
168 | 193 | let $s = size($l) | |
169 | 194 | let $acc0 = $Tuple2(nil, 0) | |
170 | 195 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
171 | 196 | then $a | |
172 | 197 | else actionsHelper($a, $l[$i]) | |
173 | 198 | ||
174 | 199 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
175 | 200 | then $a | |
176 | 201 | else throw("List size exceeds 30") | |
177 | 202 | ||
178 | 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) | |
179 | 204 | } | |
180 | 205 | ||
181 | 206 | ||
182 | 207 | func getMoveAllUnlockedToAccumulatorActions (userAddress) = { | |
183 | 208 | func actionsHelper (acc,id) = { | |
184 | - | let $ | |
185 | - | let updateAllVestingsActions = $ | |
186 | - | let sum = $ | |
187 | - | let $ | |
188 | - | let updateVestingActions = $ | |
189 | - | let unlockedAmount = $ | |
209 | + | let $t055635604 = acc | |
210 | + | let updateAllVestingsActions = $t055635604._1 | |
211 | + | let sum = $t055635604._2 | |
212 | + | let $t056095694 = getUpdateVestingActions(userAddress, id) | |
213 | + | let updateVestingActions = $t056095694._1 | |
214 | + | let unlockedAmount = $t056095694._2 | |
190 | 215 | $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount)) | |
191 | 216 | } | |
192 | 217 | ||
193 | - | let $ | |
218 | + | let $t057805868 = { | |
194 | 219 | let $l = IDS_LIST | |
195 | 220 | let $s = size($l) | |
196 | 221 | let $acc0 = $Tuple2(nil, 0) | |
197 | 222 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
198 | 223 | then $a | |
199 | 224 | else actionsHelper($a, $l[$i]) | |
200 | 225 | ||
201 | 226 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
202 | 227 | then $a | |
203 | 228 | else throw("List size exceeds 30") | |
204 | 229 | ||
205 | 230 | $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) | |
206 | 231 | } | |
207 | - | let updateAllVestingsActions = $ | |
208 | - | let unlockedSum = $ | |
232 | + | let updateAllVestingsActions = $t057805868._1 | |
233 | + | let unlockedSum = $t057805868._2 | |
209 | 234 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
210 | 235 | let updateAccumulatedActions = if ((unlockedSum != 0)) | |
211 | 236 | then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
212 | 237 | else nil | |
213 | 238 | $Tuple2((updateAllVestingsActions ++ updateAccumulatedActions), unlockedSum) | |
214 | 239 | } | |
215 | 240 | ||
216 | 241 | ||
217 | 242 | func getClaimAccumulatedActions (userAddress) = { | |
218 | 243 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
219 | 244 | if ((oldAccumulated != 0)) | |
220 | 245 | then $Tuple2([ScriptTransfer(addressFromStringValue(userAddress), oldAccumulated, assetIdBytes), DeleteEntry(keyUserAccumulated(userAddress))], oldAccumulated) | |
221 | 246 | else $Tuple2(nil, 0) | |
222 | 247 | } | |
223 | 248 | ||
224 | 249 | ||
225 | 250 | func getClaimAllActions (userAddress) = { | |
226 | - | let $ | |
251 | + | let $t066366769 = if (!(containsElement(banList, userAddress))) | |
227 | 252 | then getAllUserClaimActions(userAddress) | |
228 | 253 | else $Tuple2(nil, 0) | |
229 | - | let claimActions = $ | |
230 | - | let unlockedAmount = $ | |
231 | - | let $ | |
232 | - | let claimAccumulatedActions = $ | |
233 | - | let accumulatedAmount = $ | |
254 | + | let claimActions = $t066366769._1 | |
255 | + | let unlockedAmount = $t066366769._2 | |
256 | + | let $t067726862 = getClaimAccumulatedActions(userAddress) | |
257 | + | let claimAccumulatedActions = $t067726862._1 | |
258 | + | let accumulatedAmount = $t067726862._2 | |
234 | 259 | let totalAmount = (unlockedAmount + accumulatedAmount) | |
235 | 260 | $Tuple2((claimActions ++ claimAccumulatedActions), totalAmount) | |
236 | 261 | } | |
237 | 262 | ||
238 | 263 | ||
239 | 264 | func getVestingUserInfo (userAddress) = { | |
240 | 265 | func helper (acc,id) = { | |
241 | - | let $ | |
242 | - | let vestingAmount = $ | |
243 | - | let startBlock = $ | |
244 | - | let lockLength = $ | |
245 | - | let $ | |
246 | - | let unlockedAmount = $ | |
247 | - | let remainingAmount = $ | |
266 | + | let $t070767155 = parseUserVesting(userAddress, id) | |
267 | + | let vestingAmount = $t070767155._1 | |
268 | + | let startBlock = $t070767155._2 | |
269 | + | let lockLength = $t070767155._3 | |
270 | + | let $t071607238 = getUserUnlockedAmount(userAddress, id) | |
271 | + | let unlockedAmount = $t071607238._1 | |
272 | + | let remainingAmount = $t071607238._2 | |
248 | 273 | if (if ((vestingAmount == 0)) | |
249 | 274 | then true | |
250 | 275 | else containsElement(banList, userAddress)) | |
251 | 276 | then acc | |
252 | 277 | else (acc :+ [vestingAmount, (startBlock + lockLength), unlockedAmount, remainingAmount]) | |
253 | 278 | } | |
254 | 279 | ||
255 | 280 | let $l = IDS_LIST | |
256 | 281 | let $s = size($l) | |
257 | 282 | let $acc0 = nil | |
258 | 283 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
259 | 284 | then $a | |
260 | 285 | else helper($a, $l[$i]) | |
261 | 286 | ||
262 | 287 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
263 | 288 | then $a | |
264 | 289 | else throw("List size exceeds 30") | |
265 | 290 | ||
266 | 291 | $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 | 292 | } | |
268 | 293 | ||
269 | 294 | ||
270 | 295 | func getAvailableVestingId (userAddress) = { | |
271 | 296 | func helper (availableId,id) = { | |
272 | - | let $ | |
273 | - | let vestingAmount = $ | |
274 | - | let startBlock = $ | |
275 | - | let lockLength = $ | |
297 | + | let $t075627641 = parseUserVesting(userAddress, id) | |
298 | + | let vestingAmount = $t075627641._1 | |
299 | + | let startBlock = $t075627641._2 | |
300 | + | let lockLength = $t075627641._3 | |
276 | 301 | if ((vestingAmount > 0)) | |
277 | 302 | then availableId | |
278 | 303 | else if ((availableId == -1)) | |
279 | 304 | then id | |
280 | 305 | else min([availableId, id]) | |
281 | 306 | } | |
282 | 307 | ||
283 | 308 | let availableId = { | |
284 | 309 | let $l = IDS_LIST | |
285 | 310 | let $s = size($l) | |
286 | 311 | let $acc0 = -1 | |
287 | 312 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
288 | 313 | then $a | |
289 | 314 | else helper($a, $l[$i]) | |
290 | 315 | ||
291 | 316 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
292 | 317 | then $a | |
293 | 318 | else throw("List size exceeds 30") | |
294 | 319 | ||
295 | 320 | $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) | |
296 | 321 | } | |
297 | 322 | if ((availableId == -1)) | |
298 | 323 | then throwErr(makeString(["user exceeded max active vesting count: ", userAddress], " ")) | |
299 | 324 | else availableId | |
300 | 325 | } | |
301 | 326 | ||
302 | 327 | ||
303 | 328 | func getNewVestingActions (userAddress,id,vestingAmount,startBlock,lockLength) = [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(vestingAmount, startBlock, lockLength))] | |
304 | 329 | ||
305 | 330 | ||
306 | 331 | @Callable(i) | |
307 | 332 | func vestingForUser (userAddress,vestingAmount,startBlock,lockLength) = { | |
308 | 333 | let check = [if ((size(i.payments) == 1)) | |
309 | 334 | then true | |
310 | 335 | else throwErr("should be with exactly 1 payment"), if ((i.payments[0].assetId == assetIdBytes)) | |
311 | 336 | then true | |
312 | 337 | else throwErr(makeString(["payment assetId should be: ", assetIdString], " ")), if ((i.payments[0].amount == vestingAmount)) | |
313 | 338 | then true | |
314 | 339 | else throwErr("payment amount should be equal to vestingAmount"), if (if ((adminList == nil)) | |
315 | 340 | then true | |
316 | 341 | else containsElement(adminList, toString(i.caller))) | |
317 | 342 | then true | |
318 | 343 | else throwErr("you must be admin")] | |
319 | 344 | if ((check == check)) | |
320 | 345 | then { | |
321 | 346 | let id = getAvailableVestingId(userAddress) | |
322 | 347 | let historyActions = [StringEntry(keyVestingHistory("vested", userAddress, toBase58String(i.transactionId)), makeString([toString(vestingAmount), toString(startBlock), toString(lockLength)], SEP))] | |
323 | 348 | (getNewVestingActions(userAddress, id, vestingAmount, startBlock, lockLength) ++ historyActions) | |
324 | 349 | } | |
325 | 350 | else throw("Strict value is not equal to itself.") | |
326 | 351 | } | |
327 | 352 | ||
328 | 353 | ||
329 | 354 | ||
330 | 355 | @Callable(i) | |
331 | 356 | func ban (userAddress) = { | |
332 | 357 | let checks = [if (if ((adminList == nil)) | |
333 | 358 | then true | |
334 | 359 | else containsElement(adminList, toString(i.caller))) | |
335 | 360 | then true | |
336 | 361 | else throwErr("you must be admin"), if (!(containsElement(banList, userAddress))) | |
337 | 362 | then true | |
338 | 363 | else throwErr(makeString(["user already in a ban list:", userAddress], " "))] | |
339 | 364 | if ((checks == checks)) | |
340 | 365 | then { | |
341 | - | let $ | |
342 | - | let moveToAccumulatedActions = $ | |
343 | - | let _a = $ | |
366 | + | let $t095039591 = getMoveAllUnlockedToAccumulatorActions(userAddress) | |
367 | + | let moveToAccumulatedActions = $t095039591._1 | |
368 | + | let _a = $t095039591._2 | |
344 | 369 | let addToBanListActions = [StringEntry(keyBanList, makeString_11C((banList :+ userAddress), "__"))] | |
345 | 370 | (moveToAccumulatedActions ++ addToBanListActions) | |
346 | 371 | } | |
347 | 372 | else throw("Strict value is not equal to itself.") | |
348 | 373 | } | |
349 | 374 | ||
350 | 375 | ||
351 | 376 | ||
352 | 377 | @Callable(i) | |
353 | 378 | func unban (userAddress) = { | |
354 | 379 | let checks = [if (if ((adminList == nil)) | |
355 | 380 | then true | |
356 | 381 | else containsElement(adminList, toString(i.caller))) | |
357 | 382 | then true | |
358 | 383 | else throwErr("you must be admin"), if (containsElement(banList, userAddress)) | |
359 | 384 | then true | |
360 | 385 | else throwErr(makeString(["user not in a ban list:", userAddress], " "))] | |
361 | 386 | if ((checks == checks)) | |
362 | 387 | then { | |
363 | 388 | let newBanList = match indexOf(banList, userAddress) { | |
364 | 389 | case ind: Int => | |
365 | 390 | removeByIndex(banList, ind) | |
366 | 391 | case _ => | |
367 | 392 | throwErr("user address index in ban list is not found") | |
368 | 393 | } | |
369 | 394 | if ((newBanList == nil)) | |
370 | 395 | then [DeleteEntry(keyBanList)] | |
371 | 396 | else [StringEntry(keyBanList, makeString_11C(newBanList, "__"))] | |
372 | 397 | } | |
373 | 398 | else throw("Strict value is not equal to itself.") | |
374 | 399 | } | |
375 | 400 | ||
376 | 401 | ||
377 | 402 | ||
378 | 403 | @Callable(i) | |
379 | 404 | func claimAll () = { | |
380 | 405 | let userAddress = toString(i.caller) | |
381 | - | let $ | |
382 | - | let claimActions = $ | |
383 | - | let totalAmount = $ | |
406 | + | let $t01048410549 = getClaimAllActions(userAddress) | |
407 | + | let claimActions = $t01048410549._1 | |
408 | + | let totalAmount = $t01048410549._2 | |
384 | 409 | let historyActions = [StringEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), toString(totalAmount))] | |
385 | 410 | if ((totalAmount > 0)) | |
386 | 411 | then (claimActions ++ historyActions) | |
387 | 412 | else throwErr("nothing to claim") | |
388 | 413 | } | |
389 | 414 | ||
390 | 415 | ||
391 | 416 | ||
392 | 417 | @Callable(i) | |
393 | 418 | func userInfoREADONLY (userAddress) = { | |
394 | - | let $ | |
395 | - | let _a = $ | |
396 | - | let totalAmount = $ | |
419 | + | let $t01115011205 = getClaimAllActions(userAddress) | |
420 | + | let _a = $t01115011205._1 | |
421 | + | let totalAmount = $t01115011205._2 | |
397 | 422 | let accumulatedAmount = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
398 | 423 | $Tuple2(nil, $Tuple3(totalAmount, accumulatedAmount, getVestingUserInfo(userAddress))) | |
399 | 424 | } | |
400 | 425 | ||
401 | 426 | ||
427 | + | @Verifier(tx) | |
428 | + | func verify () = { | |
429 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
430 | + | case pk: ByteVector => | |
431 | + | pk | |
432 | + | case _: Unit => | |
433 | + | tx.senderPublicKey | |
434 | + | case _ => | |
435 | + | throw("Match error") | |
436 | + | } | |
437 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
438 | + | } | |
439 | + |
github/deemru/w8io/169f3d6 87.27 ms ◑