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