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:AAIEAAAAAAAAABIIAhIFCgMIAQgSBwoFCAEBAQEAAAAAAAAAAgAAAAFpAQAAAA9yZW50UGFya2luZ1Nwb3QAAAADAAAADXBhcmtpbmdTcG90SWQAAAAJc3RhcnRUaW1lAAAABnJlbnRlcgQAAAAQcm91bmRlZFN0YXJ0VGltZQkAAGUAAAACBQAAAAlzdGFydFRpbWUJAABqAAAAAgUAAAAJc3RhcnRUaW1lAAAAAAAAAA4QBAAAABRwYXJraW5nU3BvdFN0YXJ0VGltZQkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAA1wYXJraW5nU3BvdElkAgAAAApfc3RhcnRUaW1lBAAAABJwYXJraW5nU3BvdEVuZFRpbWUJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAANcGFya2luZ1Nwb3RJZAIAAAAIX2VuZFRpbWUDAwkAAGYAAAACBQAAABRwYXJraW5nU3BvdFN0YXJ0VGltZQUAAAAQcm91bmRlZFN0YXJ0VGltZQYJAABmAAAAAgkAAG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AAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAIAAAAEX2xhdAUAAAADbGF0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAJYAAAAAQgFAAAAAWkAAAANdHJhbnNhY3Rpb25JZAIAAAAFX2xvbmcFAAAABGxvbmcFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5Sbir7g==", "height": 1541552, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5pdiHKfA49puPhFXimJjdv2zZYzMQgSqCS7wqZ5merQY Next: Hm1Ap2jfar4vQHAev5M6zCN8jDBMLh2zHTgLU1ouNtUZ Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func rentParkingSpot (parkingSpotId,startTime,renter) = { | |
8 | + | let roundedStartTime = (startTime - (startTime % 3600)) | |
8 | 9 | let parkingSpotStartTime = getIntegerValue(this, (parkingSpotId + "_startTime")) | |
9 | 10 | let parkingSpotEndTime = getIntegerValue(this, (parkingSpotId + "_endTime")) | |
10 | - | if (if ((parkingSpotStartTime > | |
11 | + | if (if ((parkingSpotStartTime > roundedStartTime)) | |
11 | 12 | then true | |
12 | - | else (( | |
13 | + | else ((roundedStartTime + 3600) > parkingSpotEndTime)) | |
13 | 14 | then throw("time is out of range for parking spot") | |
14 | 15 | else { | |
15 | - | let bookingEntry = getString(this, (((parkingSpotId + "_") + toString( | |
16 | + | let bookingEntry = getString(this, (((parkingSpotId + "_") + toString(roundedStartTime)) + "_booked")) | |
16 | 17 | if ((bookingEntry != unit)) | |
17 | 18 | then throw("timeslot has already been booked") | |
18 | - | else [StringEntry((((parkingSpotId + "_") + toString( | |
19 | + | else [StringEntry((((parkingSpotId + "_") + toString(roundedStartTime)) + "_booked"), renter)] | |
19 | 20 | } | |
20 | 21 | } | |
21 | 22 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func rentParkingSpot (parkingSpotId,startTime,renter) = { | |
8 | + | let roundedStartTime = (startTime - (startTime % 3600)) | |
8 | 9 | let parkingSpotStartTime = getIntegerValue(this, (parkingSpotId + "_startTime")) | |
9 | 10 | let parkingSpotEndTime = getIntegerValue(this, (parkingSpotId + "_endTime")) | |
10 | - | if (if ((parkingSpotStartTime > | |
11 | + | if (if ((parkingSpotStartTime > roundedStartTime)) | |
11 | 12 | then true | |
12 | - | else (( | |
13 | + | else ((roundedStartTime + 3600) > parkingSpotEndTime)) | |
13 | 14 | then throw("time is out of range for parking spot") | |
14 | 15 | else { | |
15 | - | let bookingEntry = getString(this, (((parkingSpotId + "_") + toString( | |
16 | + | let bookingEntry = getString(this, (((parkingSpotId + "_") + toString(roundedStartTime)) + "_booked")) | |
16 | 17 | if ((bookingEntry != unit)) | |
17 | 18 | then throw("timeslot has already been booked") | |
18 | - | else [StringEntry((((parkingSpotId + "_") + toString( | |
19 | + | else [StringEntry((((parkingSpotId + "_") + toString(roundedStartTime)) + "_booked"), renter)] | |
19 | 20 | } | |
20 | 21 | } | |
21 | 22 | ||
22 | 23 | ||
23 | 24 | ||
24 | 25 | @Callable(i) | |
25 | 26 | 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)] | |
26 | 27 | ||
27 | 28 | ||
28 | 29 | @Verifier(tx) | |
29 | 30 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
30 | 31 |
github/deemru/w8io/026f985 27.47 ms ◑