tx · 6t5rAim16oSqy9raqnfxxzPSEpFuiGm3RmBPMSjKcE7x

3N8nB5XeXcXTUDeiH6657UHa3wHa2rbZfDk:  -0.01400000 Waves

2021.05.25 21:36 [1541552] smart account 3N8nB5XeXcXTUDeiH6657UHa3wHa2rbZfDk > SELF 0.00000000 Waves

{ "type": 13, "id": "6t5rAim16oSqy9raqnfxxzPSEpFuiGm3RmBPMSjKcE7x", "fee": 1400000, "feeAssetId": null, "timestamp": 1621967844377, "version": 2, "chainId": 84, "sender": "3N8nB5XeXcXTUDeiH6657UHa3wHa2rbZfDk", "senderPublicKey": "BfXK2ez9xjdgWtoFNsnaGPRFjHcFixy3UUrQ2iN8wVfX", "proofs": [ "4dY8GKkzWdUcr5vBt62AoWbiTua9XenUzFVYBUCaeSp1yp3SVu2p6xbKkv2HaHNDcgMEAHgmTo71UfCR3AziJZTK" ], "script": "base64:AAIEAAAAAAAAABIIAhIFCgMIAQgSBwoFCAEBAQEAAAAAAAAAAgAAAAFpAQAAAA9yZW50UGFya2luZ1Nwb3QAAAADAAAADXBhcmtpbmdTcG90SWQAAAAJc3RhcnRUaW1lAAAABnJlbnRlcgQAAAAQcm91bmRlZFN0YXJ0VGltZQkAAGUAAAACBQAAAAlzdGFydFRpbWUJAABqAAAAAgUAAAAJc3RhcnRUaW1lAAAAAAAAAA4QBAAAABRwYXJraW5nU3BvdFN0YXJ0VGltZQkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAA1wYXJraW5nU3BvdElkAgAAAApfc3RhcnRUaW1lBAAAABJwYXJraW5nU3BvdEVuZFRpbWUJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAANcGFya2luZ1Nwb3RJZAIAAAAIX2VuZFRpbWUDAwkAAGYAAAACBQAAABRwYXJraW5nU3BvdFN0YXJ0VGltZQUAAAAQcm91bmRlZFN0YXJ0VGltZQYJAABmAAAAAgkAA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ETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAIAAAAEX2xhdAUAAAADbGF0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAIAAAAFX2xvbmcFAAAABGxvbmcFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5Sbir7g==", "height": 1541552, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5pdiHKfA49puPhFXimJjdv2zZYzMQgSqCS7wqZ5merQY Next: Hm1Ap2jfar4vQHAev5M6zCN8jDBMLh2zHTgLU1ouNtUZ Diff:
OldNewDifferences
55
66 @Callable(i)
77 func rentParkingSpot (parkingSpotId,startTime,renter) = {
8+ let roundedStartTime = (startTime - (startTime % 3600))
89 let parkingSpotStartTime = getIntegerValue(this, (parkingSpotId + "_startTime"))
910 let parkingSpotEndTime = getIntegerValue(this, (parkingSpotId + "_endTime"))
10- if (if ((parkingSpotStartTime > startTime))
11+ if (if ((parkingSpotStartTime > roundedStartTime))
1112 then true
12- else ((startTime + 6) > parkingSpotEndTime))
13+ else ((roundedStartTime + 3600) > parkingSpotEndTime))
1314 then throw("time is out of range for parking spot")
1415 else {
15- let bookingEntry = getString(this, (((parkingSpotId + "_") + toString(startTime)) + "_booked"))
16+ let bookingEntry = getString(this, (((parkingSpotId + "_") + toString(roundedStartTime)) + "_booked"))
1617 if ((bookingEntry != unit))
1718 then throw("timeslot has already been booked")
18- else [StringEntry((((parkingSpotId + "_") + toString(startTime)) + "_booked"), renter)]
19+ else [StringEntry((((parkingSpotId + "_") + toString(roundedStartTime)) + "_booked"), renter)]
1920 }
2021 }
2122
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func rentParkingSpot (parkingSpotId,startTime,renter) = {
8+ let roundedStartTime = (startTime - (startTime % 3600))
89 let parkingSpotStartTime = getIntegerValue(this, (parkingSpotId + "_startTime"))
910 let parkingSpotEndTime = getIntegerValue(this, (parkingSpotId + "_endTime"))
10- if (if ((parkingSpotStartTime > startTime))
11+ if (if ((parkingSpotStartTime > roundedStartTime))
1112 then true
12- else ((startTime + 6) > parkingSpotEndTime))
13+ else ((roundedStartTime + 3600) > parkingSpotEndTime))
1314 then throw("time is out of range for parking spot")
1415 else {
15- let bookingEntry = getString(this, (((parkingSpotId + "_") + toString(startTime)) + "_booked"))
16+ let bookingEntry = getString(this, (((parkingSpotId + "_") + toString(roundedStartTime)) + "_booked"))
1617 if ((bookingEntry != unit))
1718 then throw("timeslot has already been booked")
18- else [StringEntry((((parkingSpotId + "_") + toString(startTime)) + "_booked"), renter)]
19+ else [StringEntry((((parkingSpotId + "_") + toString(roundedStartTime)) + "_booked"), renter)]
1920 }
2021 }
2122
2223
2324
2425 @Callable(i)
2526 func createParkingSpot (owner,lat,long,startTime,endTime) = [StringEntry((toBase58String(i.transactionId) + "_owner"), owner), IntegerEntry((toBase58String(i.transactionId) + "_startTime"), startTime), IntegerEntry((toBase58String(i.transactionId) + "_endTime"), endTime), IntegerEntry((toBase58String(i.transactionId) + "_lat"), lat), IntegerEntry((toBase58String(i.transactionId) + "_long"), long)]
2627
2728
2829 @Verifier(tx)
2930 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
3031

github/deemru/w8io/026f985 
27.47 ms