tx · H1chrA1GmjAAzkypojKFU3CBJhjGjNunkdktdveX7294 3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp: -0.00100000 Waves 2024.11.11 23:45 [3367290] smart account 3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp > SELF 0.00000000 Waves
{ "type": 13, "id": "H1chrA1GmjAAzkypojKFU3CBJhjGjNunkdktdveX7294", "fee": 100000, "feeAssetId": null, "timestamp": 1731357964559, "version": 1, "sender": "3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp", "senderPublicKey": "B5p5JF1Hn7k2YwGxQxgFre8bM5pd7N2c6wPdyKdLzzd6", "proofs": [ "3X1Yk7B6TBxidjJSwo7dxucte5L5nVQ5qWZR6GUEyznV968KSZBxYw836kREft1bBMBuEo48sPTS2khnV4agGZJ7" ], "script": "base64:CAIECAISAAABAWkBDWRpc2FibGVTY3JpcHQACQDMCAIJAQxCb29sZWFuRW50cnkCAg9zY3JpcHRfZGlzYWJsZWQGBQNuaWwAv+7OpA==", "chainId": 84, "height": 3367290, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6aLMzw8QnK8tXCmDdAWjHbJB38jttvpeRFViZYRv6ij7 Next: AFfBiZSRuhTTKBpXHj2DN1UCXccnAuVQ5KusNjHjuc8L Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | - | func checkAndIncrementCounter (funcName) = { | |
8 | - | let hourlyKey = (funcName + "_hourlyTxCount") | |
9 | - | let dailyKey = (funcName + "_dailyTxCount") | |
10 | - | let allowedKey = (funcName + "_allowed") | |
11 | - | let hourlyTxCount = match getInteger(this, hourlyKey) { | |
12 | - | case a: Int => | |
13 | - | a | |
14 | - | case _ => | |
15 | - | 0 | |
16 | - | } | |
17 | - | let dailyTxCount = match getInteger(this, dailyKey) { | |
18 | - | case a: Int => | |
19 | - | a | |
20 | - | case _ => | |
21 | - | 0 | |
22 | - | } | |
23 | - | let hourlyLimit = 100 | |
24 | - | let dailyLimit = 200 | |
25 | - | if ((hourlyTxCount >= hourlyLimit)) | |
26 | - | then throw("Hourly limit exceeded") | |
27 | - | else if ((dailyTxCount >= dailyLimit)) | |
28 | - | then throw("Daily limit exceeded") | |
29 | - | else { | |
30 | - | let newHourlyCount = (hourlyTxCount + 1) | |
31 | - | let newDailyCount = (dailyTxCount + 1) | |
32 | - | let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry(allowedKey, true)] | |
33 | - | let checkHourly = getInteger(this, hourlyKey) | |
34 | - | let checkDaily = getInteger(this, dailyKey) | |
35 | - | match checkHourly { | |
36 | - | case a: Int => | |
37 | - | match checkDaily { | |
38 | - | case b: Int => | |
39 | - | if (if ((a == newHourlyCount)) | |
40 | - | then (b == newDailyCount) | |
41 | - | else false) | |
42 | - | then updateResults | |
43 | - | else throw("Data update failed") | |
44 | - | case _ => | |
45 | - | throw("Failed to get daily count") | |
46 | - | } | |
47 | - | case _ => | |
48 | - | throw("Failed to get hourly count") | |
49 | - | } | |
50 | - | } | |
51 | - | } | |
7 | + | func disableScript () = [BooleanEntry("script_disabled", true)] | |
52 | 8 | ||
53 | 9 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | - | func checkAndIncrementCounter (funcName) = { | |
8 | - | let hourlyKey = (funcName + "_hourlyTxCount") | |
9 | - | let dailyKey = (funcName + "_dailyTxCount") | |
10 | - | let allowedKey = (funcName + "_allowed") | |
11 | - | let hourlyTxCount = match getInteger(this, hourlyKey) { | |
12 | - | case a: Int => | |
13 | - | a | |
14 | - | case _ => | |
15 | - | 0 | |
16 | - | } | |
17 | - | let dailyTxCount = match getInteger(this, dailyKey) { | |
18 | - | case a: Int => | |
19 | - | a | |
20 | - | case _ => | |
21 | - | 0 | |
22 | - | } | |
23 | - | let hourlyLimit = 100 | |
24 | - | let dailyLimit = 200 | |
25 | - | if ((hourlyTxCount >= hourlyLimit)) | |
26 | - | then throw("Hourly limit exceeded") | |
27 | - | else if ((dailyTxCount >= dailyLimit)) | |
28 | - | then throw("Daily limit exceeded") | |
29 | - | else { | |
30 | - | let newHourlyCount = (hourlyTxCount + 1) | |
31 | - | let newDailyCount = (dailyTxCount + 1) | |
32 | - | let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry(allowedKey, true)] | |
33 | - | let checkHourly = getInteger(this, hourlyKey) | |
34 | - | let checkDaily = getInteger(this, dailyKey) | |
35 | - | match checkHourly { | |
36 | - | case a: Int => | |
37 | - | match checkDaily { | |
38 | - | case b: Int => | |
39 | - | if (if ((a == newHourlyCount)) | |
40 | - | then (b == newDailyCount) | |
41 | - | else false) | |
42 | - | then updateResults | |
43 | - | else throw("Data update failed") | |
44 | - | case _ => | |
45 | - | throw("Failed to get daily count") | |
46 | - | } | |
47 | - | case _ => | |
48 | - | throw("Failed to get hourly count") | |
49 | - | } | |
50 | - | } | |
51 | - | } | |
7 | + | func disableScript () = [BooleanEntry("script_disabled", true)] | |
52 | 8 | ||
53 | 9 |
github/deemru/w8io/026f985 18.42 ms ◑