tx · F3vaB8tUCLLPYUdKX7ScVBfXFVMLb9TJ1VGzGiQXyHZW 3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp: -0.01400000 Waves 2021.05.13 12:32 [1523721] smart account 3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp > SELF 0.00000000 Waves
{ "type": 13, "id": "F3vaB8tUCLLPYUdKX7ScVBfXFVMLb9TJ1VGzGiQXyHZW", "fee": 1400000, "feeAssetId": null, "timestamp": 1620898358322, "version": 2, "chainId": 84, "sender": "3N3P5euNnTjmGsZHxXceWDyFZM7CN9YPjhp", "senderPublicKey": "ECgJ5aXMvEomM6yWA4tsqXdM3az7ddLr4cLr3yNJwJUb", "proofs": [ "42TpnCxu6UCWPvVco2mEb2WW6PkkV1truzDY6u7VPWED1AJ3FWAx3P1uT3z8rNkF7gKnCzuqwseKsuAjoaicj89Z" ], "script": "base64:AAIEAAAAAAAAADMIAhIDCgEIEgUKAwgBCBIGCgQIAQEIEggKBggBAQEICBIRCg8ICAgIAQgBCAEIAQgBCAEAAAABAQAAAAdjdXJyZW50AAAAAQAAAAFpBAAAAANwbXQJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQACWAAAAAEJAQAAAAV2YWx1ZQAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAIAAAAFV0FWRVMAAAAFAAAAAWkBAAAAFXJhbmtpbmdTcG9uc29yRGVwb3NpdAAAAAEAAAAObW9udGhUaW1lc3RhbXAEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAJY3VycmVudElkCQEAAAAHY3VycmVudAAAAAEFAAAAAWkEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAA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AAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAD25lYXJwaW4xYWRkcmVzcwUAAAAObmVhcnBpbjFhbW91bnQFAAAADmN1cnJlbnRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAD25lYXJwaW4yYWRkcmVzcwUAAAAObmVhcnBpbjJhbW91bnQFAAAADmN1cnJlbnRBc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlefKi8Yk=", "height": 1523721, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D6q5mBJvdjQN97fdRpVX1mKrCfxaGTDD4ti47Nym3HWX Next: FharT9PjBWzg1BiAB8tAwhCaC3m7zxncqZ8imNHFU34v Diff:
Old | New | Differences | |
---|---|---|---|
21 | 21 | 0 | |
22 | 22 | } | |
23 | 23 | let newAmount = (currentAmount + pmt.amount) | |
24 | - | let rankingCurrentAmount = match getInteger(this, ((("ranking_sponsor" + currentId) + "_") + monthTimestamp)) { | |
24 | + | let rankingCurrentAmount = match getInteger(this, ((("ranking_sponsor_" + currentId) + "_") + monthTimestamp)) { | |
25 | 25 | case a: Int => | |
26 | 26 | a | |
27 | 27 | case _ => | |
29 | 29 | } | |
30 | 30 | let rankingNewAmount = (rankingCurrentAmount + pmt.amount) | |
31 | 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)] | |
32 | 61 | } | |
33 | 62 | ||
34 | 63 |
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 | 10 | ||
11 | 11 | ||
12 | 12 | @Callable(i) | |
13 | 13 | func rankingSponsorDeposit (monthTimestamp) = { | |
14 | 14 | let pmt = i.payments[0] | |
15 | 15 | let currentId = current(i) | |
16 | 16 | let currentKey = toBase58String(i.caller.bytes) | |
17 | 17 | let currentAmount = match getInteger(this, ((((("ranking_sponsor_" + currentKey) + "_") + currentId) + "_") + monthTimestamp)) { | |
18 | 18 | case a: Int => | |
19 | 19 | a | |
20 | 20 | case _ => | |
21 | 21 | 0 | |
22 | 22 | } | |
23 | 23 | let newAmount = (currentAmount + pmt.amount) | |
24 | - | let rankingCurrentAmount = match getInteger(this, ((("ranking_sponsor" + currentId) + "_") + monthTimestamp)) { | |
24 | + | let rankingCurrentAmount = match getInteger(this, ((("ranking_sponsor_" + currentId) + "_") + monthTimestamp)) { | |
25 | 25 | case a: Int => | |
26 | 26 | a | |
27 | 27 | case _ => | |
28 | 28 | 0 | |
29 | 29 | } | |
30 | 30 | let rankingNewAmount = (rankingCurrentAmount + pmt.amount) | |
31 | 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)] | |
32 | 61 | } | |
33 | 62 | ||
34 | 63 | ||
35 | 64 | ||
36 | 65 | @Callable(i) | |
37 | 66 | func sponsorDeposit (compeNumber,compeEndTimestamp,timestamp,compeAddress) = { | |
38 | 67 | let pmt = i.payments[0] | |
39 | 68 | let currentId = current(i) | |
40 | 69 | if ((timestamp > compeEndTimestamp)) | |
41 | 70 | then throw("Competition is finished") | |
42 | 71 | else { | |
43 | 72 | let currentKey = toBase58String(i.caller.bytes) | |
44 | 73 | let currentAmount = match getInteger(this, ((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber)) { | |
45 | 74 | case a: Int => | |
46 | 75 | a | |
47 | 76 | case _ => | |
48 | 77 | 0 | |
49 | 78 | } | |
50 | 79 | let newAmount = (currentAmount + pmt.amount) | |
51 | 80 | let compeCurrentAmount = match getInteger(this, ((((compeNumber + "_") + compeAddress) + "_") + currentId)) { | |
52 | 81 | case a: Int => | |
53 | 82 | a | |
54 | 83 | case _ => | |
55 | 84 | 0 | |
56 | 85 | } | |
57 | 86 | let compeNewAmount = (compeCurrentAmount + pmt.amount) | |
58 | 87 | [IntegerEntry(((((("sponsor_" + currentKey) + "_") + currentId) + "_") + compeNumber), newAmount), IntegerEntry(((((compeNumber + "_") + compeAddress) + "_") + currentId), compeNewAmount)] | |
59 | 88 | } | |
60 | 89 | } | |
61 | 90 | ||
62 | 91 | ||
63 | 92 | ||
64 | 93 | @Callable(i) | |
65 | 94 | func sponsorWithdraw (compeNumber,compeEndTimestamp,timestamp,amount,assetId,compeAddress) = { | |
66 | 95 | let currentKey = toBase58String(i.caller.bytes) | |
67 | 96 | let currentAssetId = fromBase58String(assetId) | |
68 | 97 | let currentAmount = match getInteger(this, ((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber)) { | |
69 | 98 | case a: Int => | |
70 | 99 | a | |
71 | 100 | case _ => | |
72 | 101 | 0 | |
73 | 102 | } | |
74 | 103 | let newAmount = (currentAmount - amount) | |
75 | 104 | let compeCurrentAmount = match getInteger(this, ((((compeNumber + "_") + compeAddress) + "_") + assetId)) { | |
76 | 105 | case a: Int => | |
77 | 106 | a | |
78 | 107 | case _ => | |
79 | 108 | 0 | |
80 | 109 | } | |
81 | 110 | let compeNewAmount = (compeCurrentAmount - amount) | |
82 | 111 | if ((timestamp > compeEndTimestamp)) | |
83 | 112 | then throw("Competition is finished") | |
84 | 113 | else if ((0 > amount)) | |
85 | 114 | then throw("Can't withdraw negative amount") | |
86 | 115 | else if ((0 > newAmount)) | |
87 | 116 | then throw("Not enough balance") | |
88 | 117 | else if ((0 > compeNewAmount)) | |
89 | 118 | then throw("Can't withdraw negative bounty amount") | |
90 | 119 | else [IntegerEntry(((((("sponsor_" + currentKey) + "_") + assetId) + "_") + compeNumber), newAmount), IntegerEntry(((((compeNumber + "_") + compeAddress) + "_") + assetId), compeNewAmount), ScriptTransfer(i.caller, amount, currentAssetId)] | |
91 | 120 | } | |
92 | 121 | ||
93 | 122 | ||
94 | 123 | ||
95 | 124 | @Callable(i) | |
96 | 125 | func sponsorDistribution (compeNumber,assetId,compeAddress,net1,net1percent,net2,net2percent,net3,net3percent,booby,boobypercent,nearpin1,nearpin1percent,nearpin2,nearpin2percent) = { | |
97 | 126 | let currentAssetId = fromBase58String(assetId) | |
98 | 127 | let compeCurrentAmount = match getInteger(this, ((((compeNumber + "_") + compeAddress) + "_") + assetId)) { | |
99 | 128 | case a: Int => | |
100 | 129 | a | |
101 | 130 | case _ => | |
102 | 131 | 0 | |
103 | 132 | } | |
104 | 133 | let net1address = addressFromStringValue(net1) | |
105 | 134 | let net1amount = (compeCurrentAmount * (net1percent / 100)) | |
106 | 135 | let net2address = addressFromStringValue(net2) | |
107 | 136 | let net2amount = (compeCurrentAmount * (net2percent / 100)) | |
108 | 137 | let net3address = addressFromStringValue(net3) | |
109 | 138 | let net3amount = (compeCurrentAmount * (net3percent / 100)) | |
110 | 139 | let boobyaddress = addressFromStringValue(booby) | |
111 | 140 | let boobyamount = (compeCurrentAmount * (boobypercent / 100)) | |
112 | 141 | let nearpin1address = addressFromStringValue(nearpin1) | |
113 | 142 | let nearpin1amount = (compeCurrentAmount * (nearpin1percent / 100)) | |
114 | 143 | let nearpin2address = addressFromStringValue(nearpin2) | |
115 | 144 | let nearpin2amount = (compeCurrentAmount * (nearpin2percent / 100)) | |
116 | 145 | if ((compeCurrentAmount == 0)) | |
117 | 146 | then throw("Can't distribution negative amount") | |
118 | 147 | else [IntegerEntry(((((compeNumber + "_") + compeAddress) + "_") + assetId), 0), ScriptTransfer(net1address, net1amount, currentAssetId), ScriptTransfer(net2address, net2amount, currentAssetId), ScriptTransfer(net3address, net3amount, currentAssetId), ScriptTransfer(boobyaddress, boobyamount, currentAssetId), ScriptTransfer(nearpin1address, nearpin1amount, currentAssetId), ScriptTransfer(nearpin2address, nearpin2amount, currentAssetId)] | |
119 | 148 | } | |
120 | 149 | ||
121 | 150 | ||
122 | 151 | @Verifier(tx) | |
123 | 152 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
124 | 153 |
github/deemru/w8io/169f3d6 51.62 ms ◑