tx · 8UKuwDKizTP6yhvBa7mpM46HSeHuRRCb97VaP5euNHdV 3N5P6L87h3JMKWjKNSfu2VQDgr4epK1wEhK: -0.01400000 Waves 2021.05.14 05:12 [1524734] smart account 3N5P6L87h3JMKWjKNSfu2VQDgr4epK1wEhK > SELF 0.00000000 Waves
{ "type": 13, "id": "8UKuwDKizTP6yhvBa7mpM46HSeHuRRCb97VaP5euNHdV", "fee": 1400000, "feeAssetId": null, "timestamp": 1620958364262, "version": 2, "chainId": 84, "sender": "3N5P6L87h3JMKWjKNSfu2VQDgr4epK1wEhK", "senderPublicKey": "G3vBmhh2RzDJL3uZhsxK27NHV3hcZpqpNs1k3UPPMe4e", "proofs": [ "ng51FkjZmTFE2cKxnFnLrHtEE64SynVTR3w17SdgHb3V2PvcRHNjYAbM3xdZQBt1rQp6xLe44bTbxu28Zm7wJ92" ], "script": "base64:AAIEAAAAAAAAAA4IAhIDCgEIEgUKAwgBCAAAAAIBAAAAB2N1cnJlbnQAAAABAAAAAWkEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkAgAAAAVXQVZFUwEAAAAJaWRDb252ZXJ0AAAAAQAAAAhzdHJpbmdJZAMJAAAAAAAAAgUAAAAIc3RyaW5nSWQCAAAABVdBVkVTBQAAAAR1bml0CQACWQAAAAEFAAAACHN0cmluZ0lkAAAAAgAAAAFpAQAAABVyYW5raW5nU3BvbnNvckRlcG9zaXQAAAABAAAADm1vbnRoVGltZXN0YW1wBAAAAANwbXQJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAACWN1cnJlbnRJZAkBAAAAB2N1cnJlbnQAAAABBQAAAAFpBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjY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uZWdhdGl2ZSBhbW91bnQDCQAAZgAAAAIAAAAAAAAAAAAFAAAACW5ld0Ftb3VudAkAAAIAAAABAgAAABtOb3QgZW5vdWdoIHNwb25zb3JkIGJhbGFuY2UDCQAAZgAAAAIAAAAAAAAAAAAFAAAAEHJhbmtpbmdOZXdBbW91bnQJAAACAAAAAQIAAAAfTm90IGVub3VnaCB0b3RhbCBib3VudHkgYmFsYW5jZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAEHJhbmtpbmctc3BvbnNvcl8FAAAACmN1cnJlbnRLZXkCAAAAAV8FAAAAB2Fzc2V0SWQCAAAAAV8FAAAADm1vbnRoVGltZXN0YW1wBQAAAAluZXdBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAEHJhbmtpbmctc3BvbnNvcl8FAAAAB2Fzc2V0SWQCAAAAAV8FAAAADm1vbnRoVGltZXN0YW1wBQAAABByYW5raW5nTmV3QW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAA5jdXJyZW50QXNzZXRJZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmjhtI7", "height": 1524734, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BJzAk9ZEmUUgp1MLASmFZZDzkNvrr5bvNxxPfKJ7r33F Next: none Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | then toBase58String(value(pmt.assetId)) | |
8 | 8 | else "WAVES" | |
9 | 9 | } | |
10 | + | ||
11 | + | ||
12 | + | func idConvert (stringId) = if ((stringId == "WAVES")) | |
13 | + | then unit | |
14 | + | else fromBase58String(stringId) | |
10 | 15 | ||
11 | 16 | ||
12 | 17 | @Callable(i) | |
36 | 41 | @Callable(i) | |
37 | 42 | func rankingSponsorWithdraw (monthTimestamp,amount,assetId) = { | |
38 | 43 | let currentKey = toBase58String(i.caller.bytes) | |
39 | - | let currentAssetId = | |
44 | + | let currentAssetId = idConvert(assetId) | |
40 | 45 | let currentAmount = match getInteger(this, ((((("ranking-sponsor_" + currentKey) + "_") + assetId) + "_") + monthTimestamp)) { | |
41 | 46 | case a: Int => | |
42 | 47 | a |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func current (i) = { | |
5 | 5 | let pmt = i.payments[0] | |
6 | 6 | if (isDefined(pmt.assetId)) | |
7 | 7 | then toBase58String(value(pmt.assetId)) | |
8 | 8 | else "WAVES" | |
9 | 9 | } | |
10 | + | ||
11 | + | ||
12 | + | func idConvert (stringId) = if ((stringId == "WAVES")) | |
13 | + | then unit | |
14 | + | else fromBase58String(stringId) | |
10 | 15 | ||
11 | 16 | ||
12 | 17 | @Callable(i) | |
13 | 18 | func rankingSponsorDeposit (monthTimestamp) = { | |
14 | 19 | let pmt = i.payments[0] | |
15 | 20 | let currentId = current(i) | |
16 | 21 | let currentKey = toBase58String(i.caller.bytes) | |
17 | 22 | let currentAmount = match getInteger(this, ((((("ranking-sponsor_" + currentKey) + "_") + currentId) + "_") + monthTimestamp)) { | |
18 | 23 | case a: Int => | |
19 | 24 | a | |
20 | 25 | case _ => | |
21 | 26 | 0 | |
22 | 27 | } | |
23 | 28 | let newAmount = (currentAmount + pmt.amount) | |
24 | 29 | let rankingCurrentAmount = match getInteger(this, ((("ranking-sponsor_" + currentId) + "_") + monthTimestamp)) { | |
25 | 30 | case a: Int => | |
26 | 31 | a | |
27 | 32 | case _ => | |
28 | 33 | 0 | |
29 | 34 | } | |
30 | 35 | let rankingNewAmount = (rankingCurrentAmount + pmt.amount) | |
31 | 36 | [IntegerEntry(((((("ranking-sponsor_" + currentKey) + "_") + currentId) + "_") + monthTimestamp), newAmount), IntegerEntry(((("ranking-sponsor_" + currentId) + "_") + monthTimestamp), rankingNewAmount)] | |
32 | 37 | } | |
33 | 38 | ||
34 | 39 | ||
35 | 40 | ||
36 | 41 | @Callable(i) | |
37 | 42 | func rankingSponsorWithdraw (monthTimestamp,amount,assetId) = { | |
38 | 43 | let currentKey = toBase58String(i.caller.bytes) | |
39 | - | let currentAssetId = | |
44 | + | let currentAssetId = idConvert(assetId) | |
40 | 45 | let currentAmount = match getInteger(this, ((((("ranking-sponsor_" + currentKey) + "_") + assetId) + "_") + monthTimestamp)) { | |
41 | 46 | case a: Int => | |
42 | 47 | a | |
43 | 48 | case _ => | |
44 | 49 | 0 | |
45 | 50 | } | |
46 | 51 | let newAmount = (currentAmount - amount) | |
47 | 52 | let currentRankingAmount = match getInteger(this, ((("ranking-sponsor_" + assetId) + "_") + monthTimestamp)) { | |
48 | 53 | case a: Int => | |
49 | 54 | a | |
50 | 55 | case _ => | |
51 | 56 | 0 | |
52 | 57 | } | |
53 | 58 | let rankingNewAmount = (currentRankingAmount - amount) | |
54 | 59 | if ((0 > amount)) | |
55 | 60 | then throw("Can't withdraw negative amount") | |
56 | 61 | else if ((0 > newAmount)) | |
57 | 62 | then throw("Not enough sponsord balance") | |
58 | 63 | else if ((0 > rankingNewAmount)) | |
59 | 64 | then throw("Not enough total bounty balance") | |
60 | 65 | else [IntegerEntry(((((("ranking-sponsor_" + currentKey) + "_") + assetId) + "_") + monthTimestamp), newAmount), IntegerEntry(((("ranking-sponsor_" + assetId) + "_") + monthTimestamp), rankingNewAmount), ScriptTransfer(i.caller, amount, currentAssetId)] | |
61 | 66 | } | |
62 | 67 | ||
63 | 68 | ||
64 | 69 | @Verifier(tx) | |
65 | 70 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
66 | 71 |
github/deemru/w8io/169f3d6 26.27 ms ◑