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