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