tx · Gv5pwEeNUkw6zeKWsaARomE3pyg33KJrpz8KhQNBdVcp 3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1: -0.01000000 Waves 2024.01.09 14:57 [2923902] smart account 3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1 > SELF 0.00000000 Waves
{ "type": 13, "id": "Gv5pwEeNUkw6zeKWsaARomE3pyg33KJrpz8KhQNBdVcp", "fee": 1000000, "feeAssetId": null, "timestamp": 1704801461273, "version": 2, "chainId": 84, "sender": "3MwyBKGZcdChEK9Z55HwLn3A2EgwEJJpqC1", "senderPublicKey": "7c3qLtcJ7EaPS2JDjXv8MBbd4kpyc6R27wcn5GgvZhur", "proofs": [ "49vfg6gL37WdYN9khwtJXcbKxtS1NKqRhqt7Vyu94VimH4E8X95H5Socu33EQWDyAC2iobszZeHRHUhUQrdDKGev" ], "script": "base64:BgIRCAISBgoECAEBARIAEgMKAQgZAAxjb250cmFjdEZpbGUCEHZlc3RpbmdfbmVvLnJpZGUAA1NFUAICX18ACElEU19MSVNUCQDMCAIAAAkAzAgCAAEJAMwIAgACCQDMCAIAAwkAzAgCAAQJAMwIAgAFCQDMCAIABgkAzAgCAAcJAMwIAgAICQDMCAIACQkAzAgCAAoJAMwIAgALCQDMCAIADAkAzAgCAA0JAMwIAgAOCQDMCAIADwkAzAgCABAJAMwIAgARCQDMCAIAEgkAzAgCABMJAMwIAgAUCQDMCAIAFQkAzAgCABYJAMwIAgAXCQDMCAIAGAkAzAgCABkJAMwIAgAaCQDMCAIAGwkAzAgCABwJAMwIAgAdBQNuaWwAEU1BWF9WRVNUSU5HX0NPVU5UCQCQAwEFCElEU19MSVNUAQh0aHJvd0VycgEDbXNnCQACAQkArAICCQCsAgIFDGNvbnRyYWN0RmlsZQICOiAFA21zZwAKa2V5QXNzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICB2Fzc2V0SWQFA25pbAUDU0VQAA1hc3NldElkU3RyaW5nCQELdmFsdWVPckVsc2UCCQC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kcmVzcwDIpLcf", "height": 2923902, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ber9vaDCWa8ar6yvgyDuEwc45ShDrSbTysEn4bj4xXnM Next: 78yVhGW5aKxchThjtZbpmTxryV6qrDYcy1CRvm3cQYqr Diff:
Old | New | Differences | |
---|---|---|---|
194 | 194 | let updateAllVestingsActions = $t049114999._1 | |
195 | 195 | let unlockedSum = $t049114999._2 | |
196 | 196 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
197 | - | let updateAccumulatedActions = [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
197 | + | let updateAccumulatedActions = if ((unlockedSum != 0)) | |
198 | + | then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
199 | + | else nil | |
198 | 200 | $Tuple2((updateAllVestingsActions ++ updateAccumulatedActions), unlockedSum) | |
201 | + | } | |
202 | + | ||
203 | + | ||
204 | + | func getClaimAccumulatedActions (userAddress) = { | |
205 | + | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
206 | + | if ((oldAccumulated != 0)) | |
207 | + | then $Tuple2([ScriptTransfer(addressFromStringValue(userAddress), oldAccumulated, assetIdBytes), DeleteEntry(keyUserAccumulated(userAddress))], oldAccumulated) | |
208 | + | else $Tuple2(nil, 0) | |
199 | 209 | } | |
200 | 210 | ||
201 | 211 | ||
202 | 212 | func getAvailableVestingId (userAddress) = { | |
203 | 213 | func helper (availableId,id) = { | |
204 | - | let $ | |
205 | - | let vestingAmount = $ | |
206 | - | let startBlock = $ | |
207 | - | let lockLength = $ | |
214 | + | let $t058185897 = parseUserVesting(userAddress, id) | |
215 | + | let vestingAmount = $t058185897._1 | |
216 | + | let startBlock = $t058185897._2 | |
217 | + | let lockLength = $t058185897._3 | |
208 | 218 | if ((vestingAmount > 0)) | |
209 | 219 | then availableId | |
210 | 220 | else if ((availableId == -1)) | |
262 | 272 | @Callable(i) | |
263 | 273 | func claimAll () = { | |
264 | 274 | let userAddress = toString(i.caller) | |
265 | - | let $t069397008 = getAllUserClaimActions(userAddress) | |
266 | - | let claimActions = $t069397008._1 | |
267 | - | let totalAmount = $t069397008._2 | |
275 | + | let $t073747446 = getAllUserClaimActions(userAddress) | |
276 | + | let claimActions = $t073747446._1 | |
277 | + | let unlockedAmount = $t073747446._2 | |
278 | + | let $t074497539 = getClaimAccumulatedActions(userAddress) | |
279 | + | let claimAccumulatedActions = $t074497539._1 | |
280 | + | let accumulatedAmount = $t074497539._2 | |
281 | + | let totalAmount = (unlockedAmount + accumulatedAmount) | |
268 | 282 | let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)] | |
269 | 283 | if ((totalAmount > 0)) | |
270 | - | then (claimActions ++ historyActions) | |
284 | + | then ((claimActions ++ claimAccumulatedActions) ++ historyActions) | |
271 | 285 | else throwErr("nothing to claim") | |
272 | 286 | } | |
287 | + | ||
288 | + | ||
289 | + | ||
290 | + | @Callable(i) | |
291 | + | func foo (userAddress) = getMoveAllUnlockedToAccumulatorActions(userAddress) | |
273 | 292 | ||
274 | 293 |
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 [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(remainingAmount, height, remainingBlocks))] | |
127 | 127 | else nil | |
128 | 128 | $Tuple2(updateVestingActions, unlockedAmount) | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getUserClaimActions (userAddress,id) = { | |
133 | 133 | let $t038233908 = getUpdateVestingActions(userAddress, id) | |
134 | 134 | let updateVestingActions = $t038233908._1 | |
135 | 135 | let unlockedAmount = $t038233908._2 | |
136 | 136 | let transferActions = if ((unlockedAmount != 0)) | |
137 | 137 | then [ScriptTransfer(addressFromStringValue(userAddress), unlockedAmount, assetIdBytes)] | |
138 | 138 | else nil | |
139 | 139 | $Tuple2((updateVestingActions ++ transferActions), unlockedAmount) | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getAllUserClaimActions (userAddress) = { | |
144 | 144 | func actionsHelper (acc,a) = { | |
145 | 145 | let $t042824322 = acc | |
146 | 146 | let allVestingsClaimActions = $t042824322._1 | |
147 | 147 | let sum = $t042824322._2 | |
148 | 148 | let $t043274403 = getUserClaimActions(userAddress, a) | |
149 | 149 | let vestingClaimActions = $t043274403._1 | |
150 | 150 | let claimAmount = $t043274403._2 | |
151 | 151 | $Tuple2((allVestingsClaimActions ++ vestingClaimActions), (sum + claimAmount)) | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | let $l = IDS_LIST | |
155 | 155 | let $s = size($l) | |
156 | 156 | let $acc0 = $Tuple2(nil, 0) | |
157 | 157 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
158 | 158 | then $a | |
159 | 159 | else actionsHelper($a, $l[$i]) | |
160 | 160 | ||
161 | 161 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
162 | 162 | then $a | |
163 | 163 | else throw("List size exceeds 30") | |
164 | 164 | ||
165 | 165 | $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) | |
166 | 166 | } | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func getMoveAllUnlockedToAccumulatorActions (userAddress) = { | |
170 | 170 | func actionsHelper (acc,a) = { | |
171 | 171 | let $t046954736 = acc | |
172 | 172 | let updateAllVestingsActions = $t046954736._1 | |
173 | 173 | let sum = $t046954736._2 | |
174 | 174 | let $t047414825 = getUpdateVestingActions(userAddress, a) | |
175 | 175 | let updateVestingActions = $t047414825._1 | |
176 | 176 | let unlockedAmount = $t047414825._2 | |
177 | 177 | $Tuple2((updateAllVestingsActions ++ updateVestingActions), (sum + unlockedAmount)) | |
178 | 178 | } | |
179 | 179 | ||
180 | 180 | let $t049114999 = { | |
181 | 181 | let $l = IDS_LIST | |
182 | 182 | let $s = size($l) | |
183 | 183 | let $acc0 = $Tuple2(nil, 0) | |
184 | 184 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
185 | 185 | then $a | |
186 | 186 | else actionsHelper($a, $l[$i]) | |
187 | 187 | ||
188 | 188 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
189 | 189 | then $a | |
190 | 190 | else throw("List size exceeds 30") | |
191 | 191 | ||
192 | 192 | $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) | |
193 | 193 | } | |
194 | 194 | let updateAllVestingsActions = $t049114999._1 | |
195 | 195 | let unlockedSum = $t049114999._2 | |
196 | 196 | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
197 | - | let updateAccumulatedActions = [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
197 | + | let updateAccumulatedActions = if ((unlockedSum != 0)) | |
198 | + | then [IntegerEntry(keyUserAccumulated(userAddress), (oldAccumulated + unlockedSum))] | |
199 | + | else nil | |
198 | 200 | $Tuple2((updateAllVestingsActions ++ updateAccumulatedActions), unlockedSum) | |
201 | + | } | |
202 | + | ||
203 | + | ||
204 | + | func getClaimAccumulatedActions (userAddress) = { | |
205 | + | let oldAccumulated = valueOrElse(getInteger(this, keyUserAccumulated(userAddress)), 0) | |
206 | + | if ((oldAccumulated != 0)) | |
207 | + | then $Tuple2([ScriptTransfer(addressFromStringValue(userAddress), oldAccumulated, assetIdBytes), DeleteEntry(keyUserAccumulated(userAddress))], oldAccumulated) | |
208 | + | else $Tuple2(nil, 0) | |
199 | 209 | } | |
200 | 210 | ||
201 | 211 | ||
202 | 212 | func getAvailableVestingId (userAddress) = { | |
203 | 213 | func helper (availableId,id) = { | |
204 | - | let $ | |
205 | - | let vestingAmount = $ | |
206 | - | let startBlock = $ | |
207 | - | let lockLength = $ | |
214 | + | let $t058185897 = parseUserVesting(userAddress, id) | |
215 | + | let vestingAmount = $t058185897._1 | |
216 | + | let startBlock = $t058185897._2 | |
217 | + | let lockLength = $t058185897._3 | |
208 | 218 | if ((vestingAmount > 0)) | |
209 | 219 | then availableId | |
210 | 220 | else if ((availableId == -1)) | |
211 | 221 | then id | |
212 | 222 | else min([availableId, id]) | |
213 | 223 | } | |
214 | 224 | ||
215 | 225 | let availableId = { | |
216 | 226 | let $l = IDS_LIST | |
217 | 227 | let $s = size($l) | |
218 | 228 | let $acc0 = -1 | |
219 | 229 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
220 | 230 | then $a | |
221 | 231 | else helper($a, $l[$i]) | |
222 | 232 | ||
223 | 233 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
224 | 234 | then $a | |
225 | 235 | else throw("List size exceeds 30") | |
226 | 236 | ||
227 | 237 | $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) | |
228 | 238 | } | |
229 | 239 | if ((availableId == -1)) | |
230 | 240 | then throwErr(makeString(["user exceeded max active vesting count: ", userAddress], " ")) | |
231 | 241 | else availableId | |
232 | 242 | } | |
233 | 243 | ||
234 | 244 | ||
235 | 245 | func getNewVestingActions (userAddress,id,vestingAmount,startBlock,lockLength) = [StringEntry(keyUserVesting(userAddress, id), formatUserVesting(vestingAmount, startBlock, lockLength))] | |
236 | 246 | ||
237 | 247 | ||
238 | 248 | @Callable(i) | |
239 | 249 | func vestingForUser (userAddress,vestingAmount,startBlock,lockLength) = { | |
240 | 250 | let check = [if ((size(i.payments) == 1)) | |
241 | 251 | then true | |
242 | 252 | else throwErr("should be with exactly 1 payment"), if ((i.payments[0].assetId == assetIdBytes)) | |
243 | 253 | then true | |
244 | 254 | else throwErr(makeString(["payment assetId should be: ", assetIdString], " ")), if ((i.payments[0].amount == vestingAmount)) | |
245 | 255 | then true | |
246 | 256 | else throwErr("payment amount should be equal to vestingAmount"), if (if ((adminList == nil)) | |
247 | 257 | then true | |
248 | 258 | else containsElement(adminList, toString(i.caller))) | |
249 | 259 | then true | |
250 | 260 | else throwErr("you must be admin")] | |
251 | 261 | if ((check == check)) | |
252 | 262 | then { | |
253 | 263 | let id = getAvailableVestingId(userAddress) | |
254 | 264 | let historyActions = [IntegerEntry(keyVestingHistory("vested", userAddress, toBase58String(i.transactionId)), vestingAmount)] | |
255 | 265 | (getNewVestingActions(userAddress, id, vestingAmount, startBlock, lockLength) ++ historyActions) | |
256 | 266 | } | |
257 | 267 | else throw("Strict value is not equal to itself.") | |
258 | 268 | } | |
259 | 269 | ||
260 | 270 | ||
261 | 271 | ||
262 | 272 | @Callable(i) | |
263 | 273 | func claimAll () = { | |
264 | 274 | let userAddress = toString(i.caller) | |
265 | - | let $t069397008 = getAllUserClaimActions(userAddress) | |
266 | - | let claimActions = $t069397008._1 | |
267 | - | let totalAmount = $t069397008._2 | |
275 | + | let $t073747446 = getAllUserClaimActions(userAddress) | |
276 | + | let claimActions = $t073747446._1 | |
277 | + | let unlockedAmount = $t073747446._2 | |
278 | + | let $t074497539 = getClaimAccumulatedActions(userAddress) | |
279 | + | let claimAccumulatedActions = $t074497539._1 | |
280 | + | let accumulatedAmount = $t074497539._2 | |
281 | + | let totalAmount = (unlockedAmount + accumulatedAmount) | |
268 | 282 | let historyActions = [IntegerEntry(keyVestingHistory("claimed", userAddress, toBase58String(i.transactionId)), totalAmount)] | |
269 | 283 | if ((totalAmount > 0)) | |
270 | - | then (claimActions ++ historyActions) | |
284 | + | then ((claimActions ++ claimAccumulatedActions) ++ historyActions) | |
271 | 285 | else throwErr("nothing to claim") | |
272 | 286 | } | |
287 | + | ||
288 | + | ||
289 | + | ||
290 | + | @Callable(i) | |
291 | + | func foo (userAddress) = getMoveAllUnlockedToAccumulatorActions(userAddress) | |
273 | 292 | ||
274 | 293 |
github/deemru/w8io/169f3d6 38.40 ms ◑