tx · AeBWvN6ptRuom4ZnkhVC9FAWvHvprxkCm6DPJV6X9ns 3N2V9vbP8zDTDvNMR8jQeGuUu22vz1KCv5i: -0.01700000 Waves 2023.05.10 13:17 [2571657] smart account 3N2V9vbP8zDTDvNMR8jQeGuUu22vz1KCv5i > SELF 0.00000000 Waves
{ "type": 13, "id": "AeBWvN6ptRuom4ZnkhVC9FAWvHvprxkCm6DPJV6X9ns", "fee": 1700000, "feeAssetId": null, "timestamp": 1683713868982, "version": 2, "chainId": 84, "sender": "3N2V9vbP8zDTDvNMR8jQeGuUu22vz1KCv5i", "senderPublicKey": "3JBooHFx9f8xuJuUNn9AeF8B4U8a9onpNMbvzV3UTVTk", "proofs": [ "1sJb46Haznv1yY1DhEL5x33ev45THMZ6euwKpb51xRguTbuQcYqiYLYPuKJSG9Ahu56vPxGfP1HBzaujWYoz76n" ], "script": "base64:AAIFAAAAAAAABH4IAhIDCgEIEgQKAggBEgMKAQgSBAoCCAgSAwoBCBIECgIICBIECgIICBIECgIIARIECgIIARIFCgMICAESBQoDCAgBEgUKAwgIARIDCgEIEgMKAQgSBAoCCAgiA1NFUCIFRU1QVFkiE2tleU1hbmFnZXJQdWJsaWNLZXkiFmtleU1hbmFnZXJWYXVsdEFkZHJlc3MiD2tleUFkbWluUHViS2V5cyIHa2V5VXNlciIHYXNzZXRJZCIHYWRkcmVzcyITa2V5VXNlckZpeGVkRGVwb3NpdCIFYmxvY2siCmtleVJldm9rZWQiD2tleVJldm9rZWRUb3RhbCITa2V5VXNlclZlc3RpbmdTdGFydCIRa2V5VXNlclZlc3RpbmdFbmQiFWtleVVzZXJBbW91bnRQZXJCbG9jayIOa2V5Q2xhaW1EZW5pZWQiCHRocm93RXJyIgNtc2ciHGdldE1hbmFnZXJWYXVsdEFkZHJlc3NPclRoaXMiByRtYXRjaDAiAXMiFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQiE21hbmFnZXJWYXVsdEFkZHJlc3MiC211c3RNYW5hZ2VyIgFpIgJwZ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25pbAAAAAEAAAACYXMBAAAAAmF0AAAAAAQAAAACYXUEAAAAAXQJAQAAAAF2AAAAAAMJAAABAAAAAgUAAAABdAIAAAAKQnl0ZVZlY3RvcgQAAAABQQUAAAABdAUAAAABQQMJAAABAAAAAgUAAAABdAIAAAAEVW5pdAgFAAAAAmFzAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACYXMAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJhcwAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmF1R3D64w==", "height": 2571657, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BG1NtcEhXdXnoQxcm4RkU7cmByPRnWFgRpPHjAf4yRHz Next: none Diff:
Old | New | Differences | |
---|---|---|---|
8 | 8 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
9 | 9 | ||
10 | 10 | ||
11 | - | func | |
11 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func keyAdminPubKeys () = "%s__adminPubKeys" | |
41 | 41 | func throwErr (msg) = throw(makeString(["vesting_multiasset.ride:", msg], " ")) | |
42 | 42 | ||
43 | 43 | ||
44 | - | func | |
44 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
45 | 45 | case s: String => | |
46 | - | fromBase58String(s) | |
47 | - | case _: Unit => | |
48 | - | unit | |
46 | + | addressFromStringValue(s) | |
49 | 47 | case _ => | |
50 | - | | |
48 | + | this | |
51 | 49 | } | |
52 | 50 | ||
53 | 51 | ||
54 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
55 | - | case s: String => | |
56 | - | fromBase58String(s) | |
57 | - | case _: Unit => | |
58 | - | unit | |
59 | - | case _ => | |
60 | - | throw("Match error") | |
61 | - | } | |
52 | + | func managerPublicKeyOrUnit () = { | |
53 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
54 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
55 | + | case s: String => | |
56 | + | fromBase58String(s) | |
57 | + | case _: Unit => | |
58 | + | unit | |
59 | + | case _ => | |
60 | + | throw("Match error") | |
61 | + | } | |
62 | + | } | |
62 | 63 | ||
63 | 64 | ||
64 | 65 | func mustManager (i) = { | |
365 | 366 | func stats (assetId,address) = $Tuple2(nil, [value(getInteger(keyUserVestingStart(assetId, address))), value(getInteger(keyUserVestingEnd(assetId, address))), getUserTotalAmount(assetId, address), getUserClaimedAmount(assetId, address), getUserRemainingAmount(assetId, address), availableToClaimNow(assetId, address)]) | |
366 | 367 | ||
367 | 368 | ||
368 | - | ||
369 | - | @Callable(i) | |
370 | - | func setManager (pendingManagerPublicKey) = { | |
371 | - | let checkCaller = mustManager(i) | |
372 | - | if ((checkCaller == checkCaller)) | |
373 | - | then { | |
374 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
375 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
376 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
377 | - | else throw("Strict value is not equal to itself.") | |
378 | - | } | |
379 | - | else throw("Strict value is not equal to itself.") | |
380 | - | } | |
381 | - | ||
382 | - | ||
383 | - | ||
384 | - | @Callable(i) | |
385 | - | func confirmManager () = { | |
386 | - | let pm = pendingManagerPublicKeyOrUnit() | |
387 | - | let hasPM = if (isDefined(pm)) | |
388 | - | then true | |
389 | - | else throwErr("no pending manager") | |
390 | - | if ((hasPM == hasPM)) | |
391 | - | then { | |
392 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
393 | - | then true | |
394 | - | else throwErr("you are not pending manager") | |
395 | - | if ((checkPM == checkPM)) | |
396 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
397 | - | else throw("Strict value is not equal to itself.") | |
398 | - | } | |
399 | - | else throw("Strict value is not equal to itself.") | |
400 | - | } | |
401 | - | ||
402 | - | ||
403 | 369 | @Verifier(tx) | |
404 | 370 | func verify () = { | |
405 | 371 | let targetPublicKey = match managerPublicKeyOrUnit() { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let EMPTY = "" | |
7 | 7 | ||
8 | 8 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
9 | 9 | ||
10 | 10 | ||
11 | - | func | |
11 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func keyAdminPubKeys () = "%s__adminPubKeys" | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func keyUser (assetId,address) = makeString(["%s%s", assetId, address], SEP) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func keyUserFixedDeposit (assetId,address,block) = makeString(["%s%s%s%d", "fixedDeposit", assetId, address, toString(block)], SEP) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func keyRevoked (assetId,address) = makeString(["%s%s%s", "revoked", assetId, address], SEP) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func keyRevokedTotal (assetId) = makeString(["%s%s", "revokedTotal", assetId], SEP) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func keyUserVestingStart (assetId,address) = makeString(["%s%s%s", "vestingStart", assetId, address], SEP) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func keyUserVestingEnd (assetId,address) = makeString(["%s%s%s", "vestingEnd", assetId, address], SEP) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func keyUserAmountPerBlock (assetId,address) = makeString(["%s%s%s", "amountPerBlock", assetId, address], SEP) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keyClaimDenied (assetId) = makeString(["%s%s", "claimDenied", assetId], SEP) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func throwErr (msg) = throw(makeString(["vesting_multiasset.ride:", msg], " ")) | |
42 | 42 | ||
43 | 43 | ||
44 | - | func | |
44 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
45 | 45 | case s: String => | |
46 | - | fromBase58String(s) | |
47 | - | case _: Unit => | |
48 | - | unit | |
46 | + | addressFromStringValue(s) | |
49 | 47 | case _ => | |
50 | - | | |
48 | + | this | |
51 | 49 | } | |
52 | 50 | ||
53 | 51 | ||
54 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
55 | - | case s: String => | |
56 | - | fromBase58String(s) | |
57 | - | case _: Unit => | |
58 | - | unit | |
59 | - | case _ => | |
60 | - | throw("Match error") | |
61 | - | } | |
52 | + | func managerPublicKeyOrUnit () = { | |
53 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
54 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
55 | + | case s: String => | |
56 | + | fromBase58String(s) | |
57 | + | case _: Unit => | |
58 | + | unit | |
59 | + | case _ => | |
60 | + | throw("Match error") | |
61 | + | } | |
62 | + | } | |
62 | 63 | ||
63 | 64 | ||
64 | 65 | func mustManager (i) = { | |
65 | 66 | let pd = throwErr("permission denied") | |
66 | 67 | match managerPublicKeyOrUnit() { | |
67 | 68 | case pk: ByteVector => | |
68 | 69 | if ((i.callerPublicKey == pk)) | |
69 | 70 | then true | |
70 | 71 | else pd | |
71 | 72 | case _: Unit => | |
72 | 73 | if ((i.caller == this)) | |
73 | 74 | then true | |
74 | 75 | else pd | |
75 | 76 | case _ => | |
76 | 77 | throw("Match error") | |
77 | 78 | } | |
78 | 79 | } | |
79 | 80 | ||
80 | 81 | ||
81 | 82 | func mustAdmin (i) = { | |
82 | 83 | let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP) | |
83 | 84 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
84 | 85 | then true | |
85 | 86 | else { | |
86 | 87 | let isManager = mustManager(i) | |
87 | 88 | if ((isManager == isManager)) | |
88 | 89 | then true | |
89 | 90 | else throw("Strict value is not equal to itself.") | |
90 | 91 | } | |
91 | 92 | } | |
92 | 93 | ||
93 | 94 | ||
94 | 95 | func valueUserS (totalAmount,remainingAmount,claimedWXAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, "0", claimedWXAmount, lastClaimedHeight], SEP) | |
95 | 96 | ||
96 | 97 | ||
97 | 98 | func valueUser (totalAmount,remainingAmount,claimedWXAmount,lastClaimedHeight) = valueUserS(toString(totalAmount), toString(remainingAmount), toString(claimedWXAmount), toString(lastClaimedHeight)) | |
98 | 99 | ||
99 | 100 | ||
100 | 101 | func getUserTotalAmount (assetId,address) = parseIntValue(split(value(getString(keyUser(assetId, address))), SEP)[1]) | |
101 | 102 | ||
102 | 103 | ||
103 | 104 | func getUserRemainingAmount (assetId,address) = parseIntValue(split(value(getString(keyUser(assetId, address))), SEP)[2]) | |
104 | 105 | ||
105 | 106 | ||
106 | 107 | func getUserClaimedAmount (assetId,address) = parseIntValue(split(value(getString(keyUser(assetId, address))), SEP)[3]) | |
107 | 108 | ||
108 | 109 | ||
109 | 110 | func getUserLastClaimedHeight (assetId,address) = parseIntValue(split(value(getString(keyUser(assetId, address))), SEP)[5]) | |
110 | 111 | ||
111 | 112 | ||
112 | 113 | func availableToClaimNow (assetId,address) = { | |
113 | 114 | let isRevokedUser = valueOrElse(getBoolean(keyRevoked(assetId, address)), false) | |
114 | 115 | if (isRevokedUser) | |
115 | 116 | then getUserRemainingAmount(assetId, address) | |
116 | 117 | else { | |
117 | 118 | let lastHeight = getUserLastClaimedHeight(assetId, address) | |
118 | 119 | if ((lastHeight >= height)) | |
119 | 120 | then 0 | |
120 | 121 | else { | |
121 | 122 | let end = value(getInteger(keyUserVestingEnd(assetId, address))) | |
122 | 123 | if ((height > end)) | |
123 | 124 | then getUserRemainingAmount(assetId, address) | |
124 | 125 | else { | |
125 | 126 | let unclaimedPeriod = (height - lastHeight) | |
126 | 127 | (value(getInteger(keyUserAmountPerBlock(assetId, address))) * unclaimedPeriod) | |
127 | 128 | } | |
128 | 129 | } | |
129 | 130 | } | |
130 | 131 | } | |
131 | 132 | ||
132 | 133 | ||
133 | 134 | func availableToClaimFixed (assetId,address,releaseBlock) = valueOrElse(getInteger(keyUserFixedDeposit(assetId, address, releaseBlock)), 0) | |
134 | 135 | ||
135 | 136 | ||
136 | 137 | func claimInternal (assetId,address) = { | |
137 | 138 | let addr = addressFromStringValue(address) | |
138 | 139 | let asset = fromBase58String(assetId) | |
139 | 140 | let amount = availableToClaimNow(assetId, address) | |
140 | 141 | let checks = [if ((valueOrElse(getBoolean(keyClaimDenied(assetId)), false) == false)) | |
141 | 142 | then true | |
142 | 143 | else throwErr("asset claim denied"), if ((amount != 0)) | |
143 | 144 | then true | |
144 | 145 | else throwErr("nothing to claim")] | |
145 | 146 | if ((checks == checks)) | |
146 | 147 | then { | |
147 | 148 | let totalAmount = getUserTotalAmount(assetId, address) | |
148 | 149 | let remainingAmount = getUserRemainingAmount(assetId, address) | |
149 | 150 | let claimedAmount = getUserClaimedAmount(assetId, address) | |
150 | 151 | let isRevokedUser = valueOrElse(getBoolean(keyRevoked(assetId, address)), false) | |
151 | 152 | if (isRevokedUser) | |
152 | 153 | then [ScriptTransfer(addr, remainingAmount, asset), StringEntry(keyUser(assetId, address), valueUser(totalAmount, 0, (claimedAmount + remainingAmount), height))] | |
153 | 154 | else [ScriptTransfer(addr, amount, asset), StringEntry(keyUser(assetId, address), valueUser(totalAmount, (remainingAmount - amount), (claimedAmount + amount), height))] | |
154 | 155 | } | |
155 | 156 | else throw("Strict value is not equal to itself.") | |
156 | 157 | } | |
157 | 158 | ||
158 | 159 | ||
159 | 160 | func claimFixedInternal (assetId,address,releaseBlock) = { | |
160 | 161 | let userFixedDeposit = getInteger(keyUserFixedDeposit(assetId, address, releaseBlock)) | |
161 | 162 | let checks = [if ((valueOrElse(getBoolean(keyClaimDenied(assetId)), false) == false)) | |
162 | 163 | then true | |
163 | 164 | else throwErr("asset claim denied"), if ((height > releaseBlock)) | |
164 | 165 | then true | |
165 | 166 | else throwErr("current height must be more than releaseBlock for fixed deposit"), if ((valueOrElse(userFixedDeposit, 0) != 0)) | |
166 | 167 | then true | |
167 | 168 | else throwErr("no fixed deposit for assetId/address/height")] | |
168 | 169 | if ((checks == checks)) | |
169 | 170 | then { | |
170 | 171 | let addr = addressFromStringValue(address) | |
171 | 172 | let asset = fromBase58String(assetId) | |
172 | 173 | let amount = value(userFixedDeposit) | |
173 | 174 | [ScriptTransfer(addr, amount, asset), IntegerEntry(keyUserFixedDeposit(assetId, address, releaseBlock), 0)] | |
174 | 175 | } | |
175 | 176 | else throw("Strict value is not equal to itself.") | |
176 | 177 | } | |
177 | 178 | ||
178 | 179 | ||
179 | 180 | @Callable(i) | |
180 | 181 | func withdrawRevoked (assetId) = { | |
181 | 182 | let amount = valueOrElse(getInteger(keyRevokedTotal(assetId)), 0) | |
182 | 183 | let asset = fromBase58String(assetId) | |
183 | 184 | let checks = [mustManager(i), if ((amount > 0)) | |
184 | 185 | then true | |
185 | 186 | else throwErr("revoked amount is zero, nothing to withdraw")] | |
186 | 187 | if ((checks == checks)) | |
187 | 188 | then [ScriptTransfer(i.caller, amount, asset), IntegerEntry(keyRevokedTotal(assetId), 0)] | |
188 | 189 | else throw("Strict value is not equal to itself.") | |
189 | 190 | } | |
190 | 191 | ||
191 | 192 | ||
192 | 193 | ||
193 | 194 | @Callable(i) | |
194 | 195 | func createDepositFor (address,blocksDuration) = { | |
195 | 196 | let amount = i.payments[0].amount | |
196 | 197 | let assetId = toBase58String(value(i.payments[0].assetId)) | |
197 | 198 | let endHeight = (height + blocksDuration) | |
198 | 199 | let vestingLen = (endHeight - height) | |
199 | 200 | let amountPerBlock = (amount / vestingLen) | |
200 | 201 | let checks = [if ((endHeight > height)) | |
201 | 202 | then true | |
202 | 203 | else throwErr("endHeight must be more than height"), if ((getString(keyUser(assetId, address)) == unit)) | |
203 | 204 | then true | |
204 | 205 | else throwErr("deposit of this asset for user already exists"), if ((amountPerBlock != 0)) | |
205 | 206 | then true | |
206 | 207 | else throwErr("attached amount too small or blocksDuration too large — will claimed zero per block")] | |
207 | 208 | if ((checks == checks)) | |
208 | 209 | then [StringEntry(keyUser(assetId, address), valueUser(amount, amount, 0, height)), IntegerEntry(keyUserVestingStart(assetId, address), height), IntegerEntry(keyUserVestingEnd(assetId, address), endHeight), IntegerEntry(keyUserAmountPerBlock(assetId, address), amountPerBlock)] | |
209 | 210 | else throw("Strict value is not equal to itself.") | |
210 | 211 | } | |
211 | 212 | ||
212 | 213 | ||
213 | 214 | ||
214 | 215 | @Callable(i) | |
215 | 216 | func increaseDepositFor (address) = { | |
216 | 217 | let amount = i.payments[0].amount | |
217 | 218 | let assetId = toBase58String(value(i.payments[0].assetId)) | |
218 | 219 | let availableToClaim = availableToClaimNow(assetId, address) | |
219 | 220 | let forceClaim = if ((availableToClaim > 0)) | |
220 | 221 | then claimInternal(assetId, address) | |
221 | 222 | else unit | |
222 | 223 | if ((forceClaim == forceClaim)) | |
223 | 224 | then { | |
224 | 225 | let endHeight = value(getInteger(keyUserVestingEnd(assetId, address))) | |
225 | 226 | let vestingLen = (endHeight - height) | |
226 | 227 | let amountPerBlock = value(getInteger(keyUserAmountPerBlock(assetId, address))) | |
227 | 228 | let incAmountPerBlock = (amount / vestingLen) | |
228 | 229 | let userTotalAmount = getUserTotalAmount(assetId, address) | |
229 | 230 | let userRemainingAmount = getUserRemainingAmount(assetId, address) | |
230 | 231 | let userClaimedAmount = getUserClaimedAmount(assetId, address) | |
231 | 232 | let userLastClaimedHeight = getUserLastClaimedHeight(assetId, address) | |
232 | 233 | let checks = [if ((valueOrElse(getBoolean(keyRevoked(assetId, address)), false) == false)) | |
233 | 234 | then true | |
234 | 235 | else throwErr("deposit for user is revoked"), if ((getString(keyUser(assetId, address)) != unit)) | |
235 | 236 | then true | |
236 | 237 | else throwErr("deposit for user doesn't exists"), if ((incAmountPerBlock != 0)) | |
237 | 238 | then true | |
238 | 239 | else throwErr("attached amount too small — increase is zero per block")] | |
239 | 240 | if ((checks == checks)) | |
240 | 241 | then [StringEntry(keyUser(assetId, address), valueUser((userTotalAmount + amount), (userRemainingAmount + amount), userClaimedAmount, userLastClaimedHeight)), IntegerEntry(keyUserAmountPerBlock(assetId, address), (amountPerBlock + incAmountPerBlock))] | |
241 | 242 | else throw("Strict value is not equal to itself.") | |
242 | 243 | } | |
243 | 244 | else throw("Strict value is not equal to itself.") | |
244 | 245 | } | |
245 | 246 | ||
246 | 247 | ||
247 | 248 | ||
248 | 249 | @Callable(i) | |
249 | 250 | func revokeDepositFor (assetId,address) = { | |
250 | 251 | let totalAmount = getUserTotalAmount(assetId, address) | |
251 | 252 | let remainingAmount = getUserRemainingAmount(assetId, address) | |
252 | 253 | let claimedWXAmount = getUserClaimedAmount(assetId, address) | |
253 | 254 | let lastClaimedHeight = getUserLastClaimedHeight(assetId, address) | |
254 | 255 | let unclaimedAmountNow = availableToClaimNow(assetId, address) | |
255 | 256 | let revokedTotal = valueOrElse(getInteger(keyRevokedTotal(assetId)), 0) | |
256 | 257 | let amountToRevoke = (remainingAmount - unclaimedAmountNow) | |
257 | 258 | let newRevokedTotal = (revokedTotal + amountToRevoke) | |
258 | 259 | let checks = [mustAdmin(i), if ((getString(keyUser(assetId, address)) != unit)) | |
259 | 260 | then true | |
260 | 261 | else throwErr("deposit of this asset for user is not exists"), if ((newRevokedTotal > revokedTotal)) | |
261 | 262 | then true | |
262 | 263 | else throwErr("newRevokedTotal can't be less or equal than revokedTotal")] | |
263 | 264 | if ((checks == checks)) | |
264 | 265 | then [BooleanEntry(keyRevoked(assetId, address), true), IntegerEntry(keyRevokedTotal(assetId), newRevokedTotal), StringEntry(keyUser(assetId, address), valueUser(totalAmount, unclaimedAmountNow, claimedWXAmount, lastClaimedHeight))] | |
265 | 266 | else throw("Strict value is not equal to itself.") | |
266 | 267 | } | |
267 | 268 | ||
268 | 269 | ||
269 | 270 | ||
270 | 271 | @Callable(i) | |
271 | 272 | func claim (assetId) = claimInternal(assetId, toBase58String(i.caller.bytes)) | |
272 | 273 | ||
273 | 274 | ||
274 | 275 | ||
275 | 276 | @Callable(i) | |
276 | 277 | func claimFor (assetId,address) = claimInternal(assetId, address) | |
277 | 278 | ||
278 | 279 | ||
279 | 280 | ||
280 | 281 | @Callable(i) | |
281 | 282 | func claimREADONLY (assetId,address) = { | |
282 | 283 | let amount = availableToClaimNow(assetId, address) | |
283 | 284 | $Tuple2(nil, amount) | |
284 | 285 | } | |
285 | 286 | ||
286 | 287 | ||
287 | 288 | ||
288 | 289 | @Callable(i) | |
289 | 290 | func createFixedDepositFor (address,releaseBlock) = { | |
290 | 291 | let amount = i.payments[0].amount | |
291 | 292 | let assetId = toBase58String(value(i.payments[0].assetId)) | |
292 | 293 | let userFixedDeposit = keyUserFixedDeposit(assetId, address, releaseBlock) | |
293 | 294 | let checks = [if ((releaseBlock > height)) | |
294 | 295 | then true | |
295 | 296 | else throwErr("releaseBlock must be more than height"), if ((getInteger(userFixedDeposit) == unit)) | |
296 | 297 | then true | |
297 | 298 | else throwErr("deposit for this height for user already exists")] | |
298 | 299 | if ((checks == checks)) | |
299 | 300 | then [IntegerEntry(userFixedDeposit, amount)] | |
300 | 301 | else throw("Strict value is not equal to itself.") | |
301 | 302 | } | |
302 | 303 | ||
303 | 304 | ||
304 | 305 | ||
305 | 306 | @Callable(i) | |
306 | 307 | func claimFixed (assetId,releaseBlock) = claimFixedInternal(assetId, toBase58String(i.caller.bytes), releaseBlock) | |
307 | 308 | ||
308 | 309 | ||
309 | 310 | ||
310 | 311 | @Callable(i) | |
311 | 312 | func claimFixedFor (assetId,address,releaseBlock) = claimFixedInternal(assetId, address, releaseBlock) | |
312 | 313 | ||
313 | 314 | ||
314 | 315 | ||
315 | 316 | @Callable(i) | |
316 | 317 | func claimFixedREADONLY (assetId,address,releaseBlock) = { | |
317 | 318 | let amount = availableToClaimFixed(assetId, address, releaseBlock) | |
318 | 319 | $Tuple2(nil, amount) | |
319 | 320 | } | |
320 | 321 | ||
321 | 322 | ||
322 | 323 | ||
323 | 324 | @Callable(i) | |
324 | 325 | func revokeFixedDepositFor (assetId,address,releaseBlock) = { | |
325 | 326 | let checks = [mustAdmin(i), if ((releaseBlock > height)) | |
326 | 327 | then true | |
327 | 328 | else throwErr("can't revoke deposit in past"), if ((valueOrElse(getInteger(keyUserFixedDeposit(assetId, address, releaseBlock)), 0) != 0)) | |
328 | 329 | then true | |
329 | 330 | else throwErr("deposit for this height for user not exists")] | |
330 | 331 | if ((checks == checks)) | |
331 | 332 | then { | |
332 | 333 | let amount = value(getInteger(keyUserFixedDeposit(assetId, address, releaseBlock))) | |
333 | 334 | [IntegerEntry(keyRevokedTotal(assetId), amount), IntegerEntry(keyUserFixedDeposit(assetId, address, releaseBlock), 0)] | |
334 | 335 | } | |
335 | 336 | else throw("Strict value is not equal to itself.") | |
336 | 337 | } | |
337 | 338 | ||
338 | 339 | ||
339 | 340 | ||
340 | 341 | @Callable(i) | |
341 | 342 | func denyAssetClaim (assetId) = { | |
342 | 343 | let checks = [mustAdmin(i), if ((valueOrElse(getBoolean(keyClaimDenied(assetId)), false) == false)) | |
343 | 344 | then true | |
344 | 345 | else throwErr("asset already denied")] | |
345 | 346 | if ((checks == checks)) | |
346 | 347 | then [BooleanEntry(keyClaimDenied(assetId), true)] | |
347 | 348 | else throw("Strict value is not equal to itself.") | |
348 | 349 | } | |
349 | 350 | ||
350 | 351 | ||
351 | 352 | ||
352 | 353 | @Callable(i) | |
353 | 354 | func allowAssetClaim (assetId) = { | |
354 | 355 | let checks = [mustAdmin(i), if ((valueOrElse(getBoolean(keyClaimDenied(assetId)), false) == true)) | |
355 | 356 | then true | |
356 | 357 | else throwErr("asset already allowed")] | |
357 | 358 | if ((checks == checks)) | |
358 | 359 | then [DeleteEntry(keyClaimDenied(assetId))] | |
359 | 360 | else throw("Strict value is not equal to itself.") | |
360 | 361 | } | |
361 | 362 | ||
362 | 363 | ||
363 | 364 | ||
364 | 365 | @Callable(i) | |
365 | 366 | func stats (assetId,address) = $Tuple2(nil, [value(getInteger(keyUserVestingStart(assetId, address))), value(getInteger(keyUserVestingEnd(assetId, address))), getUserTotalAmount(assetId, address), getUserClaimedAmount(assetId, address), getUserRemainingAmount(assetId, address), availableToClaimNow(assetId, address)]) | |
366 | 367 | ||
367 | 368 | ||
368 | - | ||
369 | - | @Callable(i) | |
370 | - | func setManager (pendingManagerPublicKey) = { | |
371 | - | let checkCaller = mustManager(i) | |
372 | - | if ((checkCaller == checkCaller)) | |
373 | - | then { | |
374 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
375 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
376 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
377 | - | else throw("Strict value is not equal to itself.") | |
378 | - | } | |
379 | - | else throw("Strict value is not equal to itself.") | |
380 | - | } | |
381 | - | ||
382 | - | ||
383 | - | ||
384 | - | @Callable(i) | |
385 | - | func confirmManager () = { | |
386 | - | let pm = pendingManagerPublicKeyOrUnit() | |
387 | - | let hasPM = if (isDefined(pm)) | |
388 | - | then true | |
389 | - | else throwErr("no pending manager") | |
390 | - | if ((hasPM == hasPM)) | |
391 | - | then { | |
392 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
393 | - | then true | |
394 | - | else throwErr("you are not pending manager") | |
395 | - | if ((checkPM == checkPM)) | |
396 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
397 | - | else throw("Strict value is not equal to itself.") | |
398 | - | } | |
399 | - | else throw("Strict value is not equal to itself.") | |
400 | - | } | |
401 | - | ||
402 | - | ||
403 | 369 | @Verifier(tx) | |
404 | 370 | func verify () = { | |
405 | 371 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
406 | 372 | case pk: ByteVector => | |
407 | 373 | pk | |
408 | 374 | case _: Unit => | |
409 | 375 | tx.senderPublicKey | |
410 | 376 | case _ => | |
411 | 377 | throw("Match error") | |
412 | 378 | } | |
413 | 379 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
414 | 380 | } | |
415 | 381 |
github/deemru/w8io/169f3d6 63.69 ms ◑