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