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