tx · BG1NtcEhXdXnoQxcm4RkU7cmByPRnWFgRpPHjAf4yRHz

3N2V9vbP8zDTDvNMR8jQeGuUu22vz1KCv5i:  -0.01700000 Waves

2022.10.20 11:14 [2280469] smart account 3N2V9vbP8zDTDvNMR8jQeGuUu22vz1KCv5i > SELF 0.00000000 Waves

{ "type": 13, "id": "BG1NtcEhXdXnoQxcm4RkU7cmByPRnWFgRpPHjAf4yRHz", "fee": 1700000, "feeAssetId": null, "timestamp": 1666253780378, "version": 1, "sender": "3N2V9vbP8zDTDvNMR8jQeGuUu22vz1KCv5i", "senderPublicKey": "3JBooHFx9f8xuJuUNn9AeF8B4U8a9onpNMbvzV3UTVTk", "proofs": [ "2d2p3e5xx1mbg77LiZdyuNbUaymX1KR77H1DNZSSzQUARGqRHCjrZjqW5hBQRvZeRqDZ4Pb6fa5URsnzB3ceUbbk" ], "script": "base64:AAIFAAAAAAAABMYIAhIDCgEIEgQKAggBEgMKAQgSBAoCCAgSAwoBCBIECgIICBIECgIICBIECgIIARIECgIIARIFCgMICAESBQoDCAgBEgUKAwgIARIDCgEIEgMKAQgSBAoCCAgSAwoBCBIAIgNTRVAiBUVNUFRZIhNrZXlNYW5hZ2VyUHVibGljS2V5IhprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleSIPa2V5QWRtaW5QdWJLZXlzIgdrZXlVc2VyIgdhc3NldElkIgdhZGRyZXNzIhNrZXlVc2VyRml4ZWREZXBvc2l0IgVibG9jayIKa2V5UmV2b2tlZCIPa2V5UmV2b2tlZFRvdGFsIhNrZXlVc2VyVmVzdGluZ1N0YXJ0IhFrZXlVc2VyVmVzdGluZ0VuZCIVa2V5VXNlckFtb3VudFBlckJsb2NrIg5rZXlDbGFpbURlbmllZCIIdGhyb3dFcnIiA21zZyIWbWFuYWdlclB1YmxpY0tleU9yVW5pdCIHJG1hdGNoMCIBcyIdcGVuZGluZ01hbmFnZXJQdWJsaWNLZXlPclVuaXQiC211c3RNYW5hZ2VyIgFpIgJwZCIC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AAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJheAEAAAACYXkAAAAABAAAAAJhegQAAAABdAkBAAAAAXMAAAAAAwkAAAEAAAACBQAAAAF0AgAAAApCeXRlVmVjdG9yBAAAAAF6BQAAAAF0BQAAAAF6AwkAAAEAAAACBQAAAAF0AgAAAARVbml0CAUAAAACYXgAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJheAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmF4AAAABnByb29mcwAAAAAAAAAAAAUAAAACYXqnKhcV", "chainId": 84, "height": 2280469, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GMLLNavJWcjseCSktGqJGo97VaWZ6KfznxzRyFiinHP2 Next: AeBWvN6ptRuom4ZnkhVC9FAWvHvprxkCm6DPJV6X9ns Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 func keyManagerPublicKey () = "%s__managerPublicKey"
99
1010
1111 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
1212
1313
1414 func keyAdminPubKeys () = "%s__adminPubKeys"
1515
1616
1717 func keyUser (assetId,address) = makeString(["%s%s", assetId, address], SEP)
1818
1919
2020 func keyUserFixedDeposit (assetId,address,block) = makeString(["%s%s%s%d", "fixedDeposit", assetId, address, toString(block)], SEP)
2121
2222
2323 func keyRevoked (assetId,address) = makeString(["%s%s%s", "revoked", assetId, address], SEP)
2424
2525
2626 func keyRevokedTotal (assetId) = makeString(["%s%s", "revokedTotal", assetId], SEP)
2727
2828
2929 func keyUserVestingStart (assetId,address) = makeString(["%s%s%s", "vestingStart", assetId, address], SEP)
3030
3131
3232 func keyUserVestingEnd (assetId,address) = makeString(["%s%s%s", "vestingEnd", assetId, address], SEP)
3333
3434
3535 func keyUserAmountPerBlock (assetId,address) = makeString(["%s%s%s", "amountPerBlock", assetId, address], SEP)
3636
3737
3838 func keyClaimDenied (assetId) = makeString(["%s%s", "claimDenied", assetId], SEP)
3939
4040
4141 func throwErr (msg) = throw(makeString(["vesting_multiasset.ride:", msg], " "))
4242
4343
4444 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
4545 case s: String =>
4646 fromBase58String(s)
4747 case _: Unit =>
4848 unit
4949 case _ =>
5050 throw("Match error")
5151 }
5252
5353
5454 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
5555 case s: String =>
5656 fromBase58String(s)
5757 case _: Unit =>
5858 unit
5959 case _ =>
6060 throw("Match error")
6161 }
6262
6363
6464 func mustManager (i) = {
6565 let pd = throwErr("permission denied")
6666 match managerPublicKeyOrUnit() {
6767 case pk: ByteVector =>
6868 if ((i.callerPublicKey == pk))
6969 then true
7070 else pd
7171 case _: Unit =>
7272 if ((i.caller == this))
7373 then true
7474 else pd
7575 case _ =>
7676 throw("Match error")
7777 }
7878 }
7979
8080
8181 func mustAdmin (i) = {
8282 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
8383 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
8484 then true
8585 else {
8686 let isManager = mustManager(i)
8787 if ((isManager == isManager))
8888 then true
8989 else throw("Strict value is not equal to itself.")
9090 }
9191 }
9292
9393
9494 func valueUserS (totalAmount,remainingAmount,claimedWXAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, "0", claimedWXAmount, lastClaimedHeight], SEP)
9595
9696
9797 func valueUser (totalAmount,remainingAmount,claimedWXAmount,lastClaimedHeight) = valueUserS(toString(totalAmount), toString(remainingAmount), toString(claimedWXAmount), toString(lastClaimedHeight))
9898
9999
100100 func getUserTotalAmount (assetId,address) = parseIntValue(split(value(getString(keyUser(assetId, address))), SEP)[1])
101101
102102
103103 func getUserRemainingAmount (assetId,address) = parseIntValue(split(value(getString(keyUser(assetId, address))), SEP)[2])
104104
105105
106106 func getUserClaimedAmount (assetId,address) = parseIntValue(split(value(getString(keyUser(assetId, address))), SEP)[3])
107107
108108
109109 func getUserLastClaimedHeight (assetId,address) = parseIntValue(split(value(getString(keyUser(assetId, address))), SEP)[5])
110110
111111
112112 func availableToClaimNow (assetId,address) = {
113113 let isRevokedUser = valueOrElse(getBoolean(keyRevoked(assetId, address)), false)
114114 if (isRevokedUser)
115115 then getUserRemainingAmount(assetId, address)
116116 else {
117117 let lastHeight = getUserLastClaimedHeight(assetId, address)
118118 if ((lastHeight >= height))
119119 then 0
120120 else {
121121 let end = value(getInteger(keyUserVestingEnd(assetId, address)))
122122 if ((height > end))
123123 then getUserRemainingAmount(assetId, address)
124124 else {
125125 let unclaimedPeriod = (height - lastHeight)
126126 (value(getInteger(keyUserAmountPerBlock(assetId, address))) * unclaimedPeriod)
127127 }
128128 }
129129 }
130130 }
131131
132132
133133 func availableToClaimFixed (assetId,address,releaseBlock) = valueOrElse(getInteger(keyUserFixedDeposit(assetId, address, releaseBlock)), 0)
134134
135135
136136 func claimInternal (assetId,address) = {
137137 let addr = addressFromStringValue(address)
138138 let asset = fromBase58String(assetId)
139139 let amount = availableToClaimNow(assetId, address)
140140 let checks = [if ((valueOrElse(getBoolean(keyClaimDenied(assetId)), false) == false))
141141 then true
142142 else throwErr("asset claim denied"), if ((amount != 0))
143143 then true
144144 else throwErr("nothing to claim")]
145145 if ((checks == checks))
146146 then {
147147 let totalAmount = getUserTotalAmount(assetId, address)
148148 let remainingAmount = getUserRemainingAmount(assetId, address)
149149 let claimedAmount = getUserClaimedAmount(assetId, address)
150150 let isRevokedUser = valueOrElse(getBoolean(keyRevoked(assetId, address)), false)
151151 if (isRevokedUser)
152152 then [ScriptTransfer(addr, remainingAmount, asset), StringEntry(keyUser(assetId, address), valueUser(totalAmount, 0, (claimedAmount + remainingAmount), height))]
153153 else [ScriptTransfer(addr, amount, asset), StringEntry(keyUser(assetId, address), valueUser(totalAmount, (remainingAmount - amount), (claimedAmount + amount), height))]
154154 }
155155 else throw("Strict value is not equal to itself.")
156156 }
157157
158158
159159 func claimFixedInternal (assetId,address,releaseBlock) = {
160160 let userFixedDeposit = getInteger(keyUserFixedDeposit(assetId, address, releaseBlock))
161161 let checks = [if ((valueOrElse(getBoolean(keyClaimDenied(assetId)), false) == false))
162162 then true
163163 else throwErr("asset claim denied"), if ((height > releaseBlock))
164164 then true
165165 else throwErr("current height must be more than releaseBlock for fixed deposit"), if ((valueOrElse(userFixedDeposit, 0) != 0))
166166 then true
167167 else throwErr("no fixed deposit for assetId/address/height")]
168168 if ((checks == checks))
169169 then {
170170 let addr = addressFromStringValue(address)
171171 let asset = fromBase58String(assetId)
172172 let amount = value(userFixedDeposit)
173173 [ScriptTransfer(addr, amount, asset), IntegerEntry(keyUserFixedDeposit(assetId, address, releaseBlock), 0)]
174174 }
175175 else throw("Strict value is not equal to itself.")
176176 }
177177
178178
179179 @Callable(i)
180180 func withdrawRevoked (assetId) = {
181181 let amount = valueOrElse(getInteger(keyRevokedTotal(assetId)), 0)
182182 let asset = fromBase58String(assetId)
183183 let checks = [mustManager(i), if ((amount > 0))
184184 then true
185185 else throwErr("revoked amount is zero, nothing to withdraw")]
186186 if ((checks == checks))
187187 then [ScriptTransfer(i.caller, amount, asset), IntegerEntry(keyRevokedTotal(assetId), 0)]
188188 else throw("Strict value is not equal to itself.")
189189 }
190190
191191
192192
193193 @Callable(i)
194194 func createDepositFor (address,blocksDuration) = {
195195 let amount = i.payments[0].amount
196196 let assetId = toBase58String(value(i.payments[0].assetId))
197197 let endHeight = (height + blocksDuration)
198198 let vestingLen = (endHeight - height)
199199 let amountPerBlock = (amount / vestingLen)
200200 let checks = [if ((endHeight > height))
201201 then true
202202 else throwErr("endHeight must be more than height"), if ((getString(keyUser(assetId, address)) == unit))
203203 then true
204204 else throwErr("deposit of this asset for user already exists"), if ((amountPerBlock != 0))
205205 then true
206206 else throwErr("attached amount too small or blocksDuration too large — will claimed zero per block")]
207207 if ((checks == checks))
208208 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)]
209209 else throw("Strict value is not equal to itself.")
210210 }
211211
212212
213213
214214 @Callable(i)
215215 func increaseDepositFor (address) = {
216216 let amount = i.payments[0].amount
217217 let assetId = toBase58String(value(i.payments[0].assetId))
218218 let availableToClaim = availableToClaimNow(assetId, address)
219219 let forceClaim = if ((availableToClaim > 0))
220220 then claimInternal(assetId, address)
221221 else unit
222222 if ((forceClaim == forceClaim))
223223 then {
224224 let endHeight = value(getInteger(keyUserVestingEnd(assetId, address)))
225225 let vestingLen = (endHeight - height)
226226 let amountPerBlock = value(getInteger(keyUserAmountPerBlock(assetId, address)))
227227 let incAmountPerBlock = (amount / vestingLen)
228228 let userTotalAmount = getUserTotalAmount(assetId, address)
229229 let userRemainingAmount = getUserRemainingAmount(assetId, address)
230230 let userClaimedAmount = getUserClaimedAmount(assetId, address)
231231 let userLastClaimedHeight = getUserLastClaimedHeight(assetId, address)
232232 let checks = [if ((valueOrElse(getBoolean(keyRevoked(assetId, address)), false) == false))
233233 then true
234234 else throwErr("deposit for user is revoked"), if ((getString(keyUser(assetId, address)) != unit))
235235 then true
236236 else throwErr("deposit for user doesn't exists"), if ((incAmountPerBlock != 0))
237237 then true
238238 else throwErr("attached amount too small — increase is zero per block")]
239239 if ((checks == checks))
240240 then [StringEntry(keyUser(assetId, address), valueUser((userTotalAmount + amount), (userRemainingAmount + amount), userClaimedAmount, userLastClaimedHeight)), IntegerEntry(keyUserAmountPerBlock(assetId, address), (amountPerBlock + incAmountPerBlock))]
241241 else throw("Strict value is not equal to itself.")
242242 }
243243 else throw("Strict value is not equal to itself.")
244244 }
245245
246246
247247
248248 @Callable(i)
249249 func revokeDepositFor (assetId,address) = {
250250 let totalAmount = getUserTotalAmount(assetId, address)
251251 let remainingAmount = getUserRemainingAmount(assetId, address)
252252 let claimedWXAmount = getUserClaimedAmount(assetId, address)
253253 let lastClaimedHeight = getUserLastClaimedHeight(assetId, address)
254254 let unclaimedAmountNow = availableToClaimNow(assetId, address)
255255 let revokedTotal = valueOrElse(getInteger(keyRevokedTotal(assetId)), 0)
256256 let amountToRevoke = (remainingAmount - unclaimedAmountNow)
257257 let newRevokedTotal = (revokedTotal + amountToRevoke)
258258 let checks = [mustAdmin(i), if ((getString(keyUser(assetId, address)) != unit))
259259 then true
260260 else throwErr("deposit of this asset for user is not exists"), if ((newRevokedTotal > revokedTotal))
261261 then true
262262 else throwErr("newRevokedTotal can't be less or equal than revokedTotal")]
263263 if ((checks == checks))
264264 then [BooleanEntry(keyRevoked(assetId, address), true), IntegerEntry(keyRevokedTotal(assetId), newRevokedTotal), StringEntry(keyUser(assetId, address), valueUser(totalAmount, unclaimedAmountNow, claimedWXAmount, lastClaimedHeight))]
265265 else throw("Strict value is not equal to itself.")
266266 }
267267
268268
269269
270270 @Callable(i)
271271 func claim (assetId) = claimInternal(assetId, toBase58String(i.caller.bytes))
272272
273273
274274
275275 @Callable(i)
276276 func claimFor (assetId,address) = claimInternal(assetId, address)
277277
278278
279279
280280 @Callable(i)
281281 func claimREADONLY (assetId,address) = {
282282 let amount = availableToClaimNow(assetId, address)
283283 $Tuple2(nil, amount)
284284 }
285285
286286
287287
288288 @Callable(i)
289289 func createFixedDepositFor (address,releaseBlock) = {
290290 let amount = i.payments[0].amount
291291 let assetId = toBase58String(value(i.payments[0].assetId))
292292 let userFixedDeposit = keyUserFixedDeposit(assetId, address, releaseBlock)
293293 let checks = [if ((releaseBlock > height))
294294 then true
295295 else throwErr("releaseBlock must be more than height"), if ((getInteger(userFixedDeposit) == unit))
296296 then true
297297 else throwErr("deposit for this height for user already exists")]
298298 if ((checks == checks))
299299 then [IntegerEntry(userFixedDeposit, amount)]
300300 else throw("Strict value is not equal to itself.")
301301 }
302302
303303
304304
305305 @Callable(i)
306306 func claimFixed (assetId,releaseBlock) = claimFixedInternal(assetId, toBase58String(i.caller.bytes), releaseBlock)
307307
308308
309309
310310 @Callable(i)
311311 func claimFixedFor (assetId,address,releaseBlock) = claimFixedInternal(assetId, address, releaseBlock)
312312
313313
314314
315315 @Callable(i)
316316 func claimFixedREADONLY (assetId,address,releaseBlock) = {
317317 let amount = availableToClaimFixed(assetId, address, releaseBlock)
318318 $Tuple2(nil, amount)
319319 }
320320
321321
322322
323323 @Callable(i)
324324 func revokeFixedDepositFor (assetId,address,releaseBlock) = {
325325 let checks = [mustAdmin(i), if ((releaseBlock > height))
326326 then true
327327 else throwErr("can't revoke deposit in past"), if ((valueOrElse(getInteger(keyUserFixedDeposit(assetId, address, releaseBlock)), 0) != 0))
328328 then true
329329 else throwErr("deposit for this height for user not exists")]
330330 if ((checks == checks))
331331 then {
332332 let amount = value(getInteger(keyUserFixedDeposit(assetId, address, releaseBlock)))
333333 [IntegerEntry(keyRevokedTotal(assetId), amount), IntegerEntry(keyUserFixedDeposit(assetId, address, releaseBlock), 0)]
334334 }
335335 else throw("Strict value is not equal to itself.")
336336 }
337337
338338
339339
340340 @Callable(i)
341341 func denyAssetClaim (assetId) = {
342342 let checks = [mustAdmin(i), if ((valueOrElse(getBoolean(keyClaimDenied(assetId)), false) == false))
343343 then true
344344 else throwErr("asset already denied")]
345345 if ((checks == checks))
346346 then [BooleanEntry(keyClaimDenied(assetId), true)]
347347 else throw("Strict value is not equal to itself.")
348348 }
349349
350350
351351
352352 @Callable(i)
353353 func allowAssetClaim (assetId) = {
354354 let checks = [mustAdmin(i), if ((valueOrElse(getBoolean(keyClaimDenied(assetId)), false) == true))
355355 then true
356356 else throwErr("asset already allowed")]
357357 if ((checks == checks))
358358 then [DeleteEntry(keyClaimDenied(assetId))]
359359 else throw("Strict value is not equal to itself.")
360360 }
361361
362362
363363
364364 @Callable(i)
365365 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)])
366366
367367
368368
369369 @Callable(i)
370370 func setManager (pendingManagerPublicKey) = {
371371 let checkCaller = mustManager(i)
372372 if ((checkCaller == checkCaller))
373373 then {
374374 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
375375 if ((checkManagerPublicKey == checkManagerPublicKey))
376376 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
377377 else throw("Strict value is not equal to itself.")
378378 }
379379 else throw("Strict value is not equal to itself.")
380380 }
381381
382382
383383
384384 @Callable(i)
385385 func confirmManager () = {
386386 let pm = pendingManagerPublicKeyOrUnit()
387387 let hasPM = if (isDefined(pm))
388388 then true
389389 else throwErr("no pending manager")
390390 if ((hasPM == hasPM))
391391 then {
392392 let checkPM = if ((i.callerPublicKey == value(pm)))
393393 then true
394394 else throwErr("you are not pending manager")
395395 if ((checkPM == checkPM))
396396 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
397397 else throw("Strict value is not equal to itself.")
398398 }
399399 else throw("Strict value is not equal to itself.")
400400 }
401401
402402
403403 @Verifier(tx)
404404 func verify () = {
405405 let targetPublicKey = match managerPublicKeyOrUnit() {
406406 case pk: ByteVector =>
407407 pk
408408 case _: Unit =>
409409 tx.senderPublicKey
410410 case _ =>
411411 throw("Match error")
412412 }
413413 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
414414 }
415415

github/deemru/w8io/169f3d6 
73.76 ms