tx · 614c6F6SrW5Tkjw4qqVtmNtLfzVRnRA4bjW5nC2dqEwM
3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp: -0.00100000 Waves
2024.11.11 04:05 [3366100] smart account 3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp > SELF 0.00000000 Waves
{
"type": 13,
"id": "614c6F6SrW5Tkjw4qqVtmNtLfzVRnRA4bjW5nC2dqEwM",
"fee": 100000,
"feeAssetId": null,
"timestamp": 1731287172444,
"version": 1,
"sender": "3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp",
"senderPublicKey": "B5p5JF1Hn7k2YwGxQxgFre8bM5pd7N2c6wPdyKdLzzd6",
"proofs": [
"4zr2YW1DqNME1NtP5hkj5KVqib3Zc3grodyV7MmKyet87BdzKcuAiN7WiCyHDNovucmQM6t3NM5mZSg8K7ZHCVns"
],
"script": "base64:CAIHCAISAwoBCAABAWkBGGNoZWNrQW5kSW5jcmVtZW50Q291bnRlcgEIZnVuY05hbWUECWhvdXJseUtleQkArAICBQhmdW5jTmFtZQIOX2hvdXJseVR4Q291bnQECGRhaWx5S2V5CQCsAgIFCGZ1bmNOYW1lAg1fZGFpbHlUeENvdW50BA1ob3VybHlUeENvdW50BAckbWF0Y2gwCQCaCAIFBHRoaXMFCWhvdXJseUtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQMZGFpbHlUeENvdW50BAckbWF0Y2gwCQCaCAIFBHRoaXMFCGRhaWx5S2V5AwkAAQIFByRtYXRjaDACA0ludAQBYQUHJG1hdGNoMAUBYQAABAtob3VybHlMaW1pdAABBApkYWlseUxpbWl0AAIDCQBnAgUNaG91cmx5VHhDb3VudAULaG91cmx5TGltaXQJAAIBAhVIb3VybHkgbGltaXQgZXhjZWVkZWQDCQBnAgUMZGFpbHlUeENvdW50BQpkYWlseUxpbWl0CQACAQIURGFpbHkgbGltaXQgZXhjZWVkZWQEDm5ld0hvdXJseUNvdW50CQBkAgUNaG91cmx5VHhDb3VudAABBA1uZXdEYWlseUNvdW50CQBkAgUMZGFpbHlUeENvdW50AAEEDXVwZGF0ZVJlc3VsdHMJAMwIAgkBDEludGVnZXJFbnRyeQIFCWhvdXJseUtleQUObmV3SG91cmx5Q291bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCGRhaWx5S2V5BQ1uZXdEYWlseUNvdW50CQDMCAIJAQxJbnRlZ2VyRW50cnkCAgZzdGF0dXMAAQUDbmlsBAckbWF0Y2gwCQCaCAIFBHRoaXMFCWhvdXJseUtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAEByRtYXRjaDEJAJoIAgUEdGhpcwUIZGFpbHlLZXkDCQABAgUHJG1hdGNoMQIDSW50BAFiBQckbWF0Y2gxAwMJAAACBQFhBQ5uZXdIb3VybHlDb3VudAkAAAIFAWIFDW5ld0RhaWx5Q291bnQHBQ11cGRhdGVSZXN1bHRzCQACAQISRGF0YSB1cGRhdGUgZmFpbGVkCQACAQIZRmFpbGVkIHRvIGdldCBkYWlseSBjb3VudAkAAgECGkZhaWxlZCB0byBnZXQgaG91cmx5IGNvdW50AA0gDcw=",
"chainId": 84,
"height": 3366100,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 9xodT1oDz92dKasoDtETBUejZA4om5WMm8La8MG522Pc
Next: 5SX2a6whCeTiSWiFwFXefmbT8w4cnU9Rrt5RnGWVAL19
Diff:
Old | New | | Differences |
---|
19 | 19 | | case _ => |
---|
20 | 20 | | 0 |
---|
21 | 21 | | } |
---|
22 | | - | let hourlyLimit = 10 |
---|
23 | | - | let dailyLimit = 30 |
---|
| 22 | + | let hourlyLimit = 1 |
---|
| 23 | + | let dailyLimit = 2 |
---|
24 | 24 | | if ((hourlyTxCount >= hourlyLimit)) |
---|
25 | 25 | | then throw("Hourly limit exceeded") |
---|
26 | 26 | | else if ((dailyTxCount >= dailyLimit)) |
---|
|
28 | 28 | | else { |
---|
29 | 29 | | let newHourlyCount = (hourlyTxCount + 1) |
---|
30 | 30 | | let newDailyCount = (dailyTxCount + 1) |
---|
31 | | - | let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry("status", true)] |
---|
| 31 | + | let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), IntegerEntry("status", 1)] |
---|
32 | 32 | | match getInteger(this, hourlyKey) { |
---|
33 | 33 | | case a: Int => |
---|
34 | 34 | | match getInteger(this, dailyKey) { |
---|
Full:
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 | 7 | | func checkAndIncrementCounter (funcName) = { |
---|
8 | 8 | | let hourlyKey = (funcName + "_hourlyTxCount") |
---|
9 | 9 | | let dailyKey = (funcName + "_dailyTxCount") |
---|
10 | 10 | | let hourlyTxCount = match getInteger(this, hourlyKey) { |
---|
11 | 11 | | case a: Int => |
---|
12 | 12 | | a |
---|
13 | 13 | | case _ => |
---|
14 | 14 | | 0 |
---|
15 | 15 | | } |
---|
16 | 16 | | let dailyTxCount = match getInteger(this, dailyKey) { |
---|
17 | 17 | | case a: Int => |
---|
18 | 18 | | a |
---|
19 | 19 | | case _ => |
---|
20 | 20 | | 0 |
---|
21 | 21 | | } |
---|
22 | | - | let hourlyLimit = 10 |
---|
23 | | - | let dailyLimit = 30 |
---|
| 22 | + | let hourlyLimit = 1 |
---|
| 23 | + | let dailyLimit = 2 |
---|
24 | 24 | | if ((hourlyTxCount >= hourlyLimit)) |
---|
25 | 25 | | then throw("Hourly limit exceeded") |
---|
26 | 26 | | else if ((dailyTxCount >= dailyLimit)) |
---|
27 | 27 | | then throw("Daily limit exceeded") |
---|
28 | 28 | | else { |
---|
29 | 29 | | let newHourlyCount = (hourlyTxCount + 1) |
---|
30 | 30 | | let newDailyCount = (dailyTxCount + 1) |
---|
31 | | - | let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry("status", true)] |
---|
| 31 | + | let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), IntegerEntry("status", 1)] |
---|
32 | 32 | | match getInteger(this, hourlyKey) { |
---|
33 | 33 | | case a: Int => |
---|
34 | 34 | | match getInteger(this, dailyKey) { |
---|
35 | 35 | | case b: Int => |
---|
36 | 36 | | if (if ((a == newHourlyCount)) |
---|
37 | 37 | | then (b == newDailyCount) |
---|
38 | 38 | | else false) |
---|
39 | 39 | | then updateResults |
---|
40 | 40 | | else throw("Data update failed") |
---|
41 | 41 | | case _ => |
---|
42 | 42 | | throw("Failed to get daily count") |
---|
43 | 43 | | } |
---|
44 | 44 | | case _ => |
---|
45 | 45 | | throw("Failed to get hourly count") |
---|
46 | 46 | | } |
---|
47 | 47 | | } |
---|
48 | 48 | | } |
---|
49 | 49 | | |
---|
50 | 50 | | |
---|