tx · 6aLMzw8QnK8tXCmDdAWjHbJB38jttvpeRFViZYRv6ij7

3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp:  -0.00200000 Waves

2024.11.11 04:19 [3366115] smart account 3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp > SELF 0.00000000 Waves

{ "type": 13, "id": "6aLMzw8QnK8tXCmDdAWjHbJB38jttvpeRFViZYRv6ij7", "fee": 200000, "feeAssetId": null, "timestamp": 1731288010812, "version": 1, "sender": "3MzgLbskN82suZgkmqTvzQxDtZfjQfX1DLp", "senderPublicKey": "B5p5JF1Hn7k2YwGxQxgFre8bM5pd7N2c6wPdyKdLzzd6", "proofs": [ "243ff3fY11MdXFPsJSiN1i4wH669DpNFWPG3vThcH6XSNnZn1gxStpU6YKS4AMZGVHzyqjyLdb7aq8ujxY8EGKQ3" ], "script": "base64:CAIHCAISAwoBCAABAWkBGGNoZWNrQW5kSW5jcmVtZW50Q291bnRlcgEIZnVuY05hbWUECWhvdXJseUtleQkArAICBQhmdW5jTmFtZQIOX2hvdXJseVR4Q291bnQECGRhaWx5S2V5CQCsAgIFCGZ1bmNOYW1lAg1fZGFpbHlUeENvdW50BAphbGxvd2VkS2V5CQCsAgIFCGZ1bmNOYW1lAghfYWxsb3dlZAQNaG91cmx5VHhDb3VudAQHJG1hdGNoMAkAmggCBQR0aGlzBQlob3VybHlLZXkDCQABAgUHJG1hdGNoMAIDSW50BAFhBQckbWF0Y2gwBQFhAAAEDGRhaWx5VHhDb3VudAQHJG1hdGNoMAkAmggCBQR0aGlzBQhkYWlseUtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQLaG91cmx5TGltaXQAZAQKZGFpbHlMaW1pdADIAQMJAGcCBQ1ob3VybHlUeENvdW50BQtob3VybHlMaW1pdAkAAgECFUhvdXJseSBsaW1pdCBleGNlZWRlZAMJAGcCBQxkYWlseVR4Q291bnQFCmRhaWx5TGltaXQJAAIBAhREYWlseSBsaW1pdCBleGNlZWRlZAQObmV3SG91cmx5Q291bnQJAGQCBQ1ob3VybHlUeENvdW50AAEEDW5ld0RhaWx5Q291bnQJAGQCBQxkYWlseVR4Q291bnQAAQQNdXBkYXRlUmVzdWx0cwkAzAgCCQEMSW50ZWdlckVudHJ5AgUJaG91cmx5S2V5BQ5uZXdIb3VybHlDb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgUIZGFpbHlLZXkFDW5ld0RhaWx5Q291bnQJAMwIAgkBDEJvb2xlYW5FbnRyeQIFCmFsbG93ZWRLZXkGBQNuaWwEC2NoZWNrSG91cmx5CQCaCAIFBHRoaXMFCWhvdXJseUtleQQKY2hlY2tEYWlseQkAmggCBQR0aGlzBQhkYWlseUtleQQHJG1hdGNoMAULY2hlY2tIb3VybHkDCQABAgUHJG1hdGNoMAIDSW50BAFhBQckbWF0Y2gwBAckbWF0Y2gxBQpjaGVja0RhaWx5AwkAAQIFByRtYXRjaDECA0ludAQBYgUHJG1hdGNoMQMDCQAAAgUBYQUObmV3SG91cmx5Q291bnQJAAACBQFiBQ1uZXdEYWlseUNvdW50BwUNdXBkYXRlUmVzdWx0cwkAAgECEkRhdGEgdXBkYXRlIGZhaWxlZAkAAgECGUZhaWxlZCB0byBnZXQgZGFpbHkgY291bnQJAAIBAhpGYWlsZWQgdG8gZ2V0IGhvdXJseSBjb3VudABQJn+G", "chainId": 84, "height": 3366115, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2qttdA8FW2zeUWqJu5FiAWrqsYNQuDR4cMy6C5mmdedD Next: H1chrA1GmjAAzkypojKFU3CBJhjGjNunkdktdveX7294 Diff:
OldNewDifferences
77 func checkAndIncrementCounter (funcName) = {
88 let hourlyKey = (funcName + "_hourlyTxCount")
99 let dailyKey = (funcName + "_dailyTxCount")
10+ let allowedKey = (funcName + "_allowed")
1011 let hourlyTxCount = match getInteger(this, hourlyKey) {
1112 case a: Int =>
1213 a
2829 else {
2930 let newHourlyCount = (hourlyTxCount + 1)
3031 let newDailyCount = (dailyTxCount + 1)
31- let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry("checkAndIncrementCounter", true)]
32+ let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry(allowedKey, true)]
3233 let checkHourly = getInteger(this, hourlyKey)
3334 let checkDaily = getInteger(this, dailyKey)
3435 match checkHourly {
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")
10+ let allowedKey = (funcName + "_allowed")
1011 let hourlyTxCount = match getInteger(this, hourlyKey) {
1112 case a: Int =>
1213 a
1314 case _ =>
1415 0
1516 }
1617 let dailyTxCount = match getInteger(this, dailyKey) {
1718 case a: Int =>
1819 a
1920 case _ =>
2021 0
2122 }
2223 let hourlyLimit = 100
2324 let dailyLimit = 200
2425 if ((hourlyTxCount >= hourlyLimit))
2526 then throw("Hourly limit exceeded")
2627 else if ((dailyTxCount >= dailyLimit))
2728 then throw("Daily limit exceeded")
2829 else {
2930 let newHourlyCount = (hourlyTxCount + 1)
3031 let newDailyCount = (dailyTxCount + 1)
31- let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry("checkAndIncrementCounter", true)]
32+ let updateResults = [IntegerEntry(hourlyKey, newHourlyCount), IntegerEntry(dailyKey, newDailyCount), BooleanEntry(allowedKey, true)]
3233 let checkHourly = getInteger(this, hourlyKey)
3334 let checkDaily = getInteger(this, dailyKey)
3435 match checkHourly {
3536 case a: Int =>
3637 match checkDaily {
3738 case b: Int =>
3839 if (if ((a == newHourlyCount))
3940 then (b == newDailyCount)
4041 else false)
4142 then updateResults
4243 else throw("Data update failed")
4344 case _ =>
4445 throw("Failed to get daily count")
4546 }
4647 case _ =>
4748 throw("Failed to get hourly count")
4849 }
4950 }
5051 }
5152
5253

github/deemru/w8io/026f985 
14.36 ms