tx · 5SX2a6whCeTiSWiFwFXefmbT8w4cnU9Rrt5RnGWVAL19

3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp:  -0.00100000 Waves

2024.11.11 04:11 [3366108] smart account 3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp > SELF 0.00000000 Waves

{ "type": 13, "id": "5SX2a6whCeTiSWiFwFXefmbT8w4cnU9Rrt5RnGWVAL19", "fee": 100000, "feeAssetId": null, "timestamp": 1731287523964, "version": 1, "sender": "3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp", "senderPublicKey": "B5p5JF1Hn7k2YwGxQxgFre8bM5pd7N2c6wPdyKdLzzd6", "proofs": [ "2ZsHCb5ncup81oiNAKD4k9T9RV59QmDGm8a8okhaPtD4wrtZBKTxaD6MjUWoV3cwz3q1f47uFRco32tZMFLdyjrn" ], "script": "base64:CAIHCAISAwoBCAABAWkBGGNoZWNrQW5kSW5jcmVtZW50Q291bnRlcgEIZnVuY05hbWUECWhvdXJseUtleQkArAICBQhmdW5jTmFtZQIOX2hvdXJseVR4Q291bnQECGRhaWx5S2V5CQCsAgIFCGZ1bmNOYW1lAg1fZGFpbHlUeENvdW50BA1ob3VybHlUeENvdW50BAckbWF0Y2gwCQCaCAIFBHRoaXMFCWhvdXJseUtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQMZGFpbHlUeENvdW50BAckbWF0Y2gwCQCaCAIFBHRoaXMFCGRhaWx5S2V5AwkAAQIFByRtYXRjaDACA0ludAQBYQUHJG1hdGNoMAUBYQAABAtob3VybHlMaW1pdAABBApkYWlseUxpbWl0AAIDCQBnAgUNaG91cmx5VHhDb3VudAULaG91cmx5TGltaXQJAAIBAhVIb3VybHkgbGltaXQgZXhjZWVkZWQDCQBnAgUMZGFpbHlUeENvdW50BQpkYWlseUxpbWl0CQACAQIURGFpbHkgbGltaXQgZXhjZWVkZWQEDm5ld0hvdXJseUNvdW50CQBkAgUNaG91cmx5VHhDb3VudAABBA1uZXdEYWlseUNvdW50CQBkAgUMZGFpbHlUeENvdW50AAEEDXVwZGF0ZVJlc3VsdHMJAMwIAgkBDEludGVnZXJFbnRyeQIFCWhvdXJseUtleQUObmV3SG91cmx5Q291bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCGRhaWx5S2V5BQ1uZXdEYWlseUNvdW50CQDMCAIJAQxCb29sZWFuRW50cnkCAhhjaGVja0FuZEluY3JlbWVudENvdW50ZXIGBQNuaWwEC2NoZWNrSG91cmx5CQCaCAIFBHRoaXMFCWhvdXJseUtleQQKY2hlY2tEYWlseQkAmggCBQR0aGlzBQhkYWlseUtleQQHJG1hdGNoMAULY2hlY2tIb3VybHkDCQABAgUHJG1hdGNoMAIDSW50BAFhBQckbWF0Y2gwBAckbWF0Y2gxBQpjaGVja0RhaWx5AwkAAQIFByRtYXRjaDECA0ludAQBYgUHJG1hdGNoMQMDCQAAAgUBYQUObmV3SG91cmx5Q291bnQJAAACBQFiBQ1uZXdEYWlseUNvdW50BwUNdXBkYXRlUmVzdWx0cwkAAgECEkRhdGEgdXBkYXRlIGZhaWxlZAkAAgECGUZhaWxlZCB0byBnZXQgZGFpbHkgY291bnQJAAIBAhpGYWlsZWQgdG8gZ2V0IGhvdXJseSBjb3VudABJxpIH", "chainId": 84, "height": 3366108, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 614c6F6SrW5Tkjw4qqVtmNtLfzVRnRA4bjW5nC2dqEwM Next: 2qttdA8FW2zeUWqJu5FiAWrqsYNQuDR4cMy6C5mmdedD Diff:
OldNewDifferences
2828 else {
2929 let newHourlyCount = (hourlyTxCount + 1)
3030 let newDailyCount = (dailyTxCount + 1)
31- let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), IntegerEntry("status", 1)]
32- match getInteger(this, hourlyKey) {
31+ let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry("checkAndIncrementCounter", true)]
32+ let checkHourly = getInteger(this, hourlyKey)
33+ let checkDaily = getInteger(this, dailyKey)
34+ match checkHourly {
3335 case a: Int =>
34- match getInteger(this, dailyKey) {
36+ match checkDaily {
3537 case b: Int =>
3638 if (if ((a == newHourlyCount))
3739 then (b == newDailyCount)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 8 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func checkAndIncrementCounter (funcName) = {
88 let hourlyKey = (funcName + "_hourlyTxCount")
99 let dailyKey = (funcName + "_dailyTxCount")
1010 let hourlyTxCount = match getInteger(this, hourlyKey) {
1111 case a: Int =>
1212 a
1313 case _ =>
1414 0
1515 }
1616 let dailyTxCount = match getInteger(this, dailyKey) {
1717 case a: Int =>
1818 a
1919 case _ =>
2020 0
2121 }
2222 let hourlyLimit = 1
2323 let dailyLimit = 2
2424 if ((hourlyTxCount >= hourlyLimit))
2525 then throw("Hourly limit exceeded")
2626 else if ((dailyTxCount >= dailyLimit))
2727 then throw("Daily limit exceeded")
2828 else {
2929 let newHourlyCount = (hourlyTxCount + 1)
3030 let newDailyCount = (dailyTxCount + 1)
31- let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), IntegerEntry("status", 1)]
32- match getInteger(this, hourlyKey) {
31+ let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry("checkAndIncrementCounter", true)]
32+ let checkHourly = getInteger(this, hourlyKey)
33+ let checkDaily = getInteger(this, dailyKey)
34+ match checkHourly {
3335 case a: Int =>
34- match getInteger(this, dailyKey) {
36+ match checkDaily {
3537 case b: Int =>
3638 if (if ((a == newHourlyCount))
3739 then (b == newDailyCount)
3840 else false)
3941 then updateResults
4042 else throw("Data update failed")
4143 case _ =>
4244 throw("Failed to get daily count")
4345 }
4446 case _ =>
4547 throw("Failed to get hourly count")
4648 }
4749 }
4850 }
4951
5052

github/deemru/w8io/026f985 
19.25 ms