tx · 7BtBAw1QhWbovs2QQm22TgZYWmbcnm7XjKcaurrvnrrH 3N8nB5XeXcXTUDeiH6657UHa3wHa2rbZfDk: -0.01500000 Waves 2021.06.07 22:42 [1560368] smart account 3N8nB5XeXcXTUDeiH6657UHa3wHa2rbZfDk > SELF 0.00000000 Waves
{ "type": 13, "id": "7BtBAw1QhWbovs2QQm22TgZYWmbcnm7XjKcaurrvnrrH", "fee": 1500000, "feeAssetId": null, "timestamp": 1623094979728, "version": 2, "chainId": 84, "sender": "3N8nB5XeXcXTUDeiH6657UHa3wHa2rbZfDk", "senderPublicKey": "BfXK2ez9xjdgWtoFNsnaGPRFjHcFixy3UUrQ2iN8wVfX", "proofs": [ "4Ub9HwHFdNuyykqCrU1cukmb5ZNvQ7ZpsMgGyPXUdH1umrvHEj2zLcqxQ1dbVNMwYuiAkJdKSY4jiZMDQr71Me46" ], "script": "base64:AAIEAAAAAAAAABUIAhIICgYICAgBAQESBwoFCAEBAQgAAAABAQAAABZjcmVhdGVQYXJraW5nU3BvdFNsaWNlAAAABAAAAA1wYXJraW5nU3BvdElkAAAACXN0YXJ0VGltZQAAAAdlbmRUaW1lAAAABXNsaWNlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAA1wYXJraW5nU3BvdElkAgAAAAdfc2xpY2VfCQABpAAAAAEFAAAABXNsaWNlAgAAAApfc3RhcnRUaW1lBQAAAAlzdGFydFRpbWUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAADXBhcmtpbmdTcG90SWQCAAAAB19zbGljZV8JAAGkAAAAAQUAAAAFc2xpY2UCAAAACF9lbmRUaW1lBQAAAAdlbmRUaW1lBQAAAANuaWwAAAACAAAAAWkBAAAAEWNyZWF0ZVBhcmtpbmdTcG90AAAABgAAAAVvd25lcgAAAANsYXQAAAAEbG9uZwAAAAlzdGFydFRpbW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BAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAADXBhcmtpbmdTcG90SWQCAAAAB19zbGljZV8JAAGkAAAAAQUAAAAMZGVzaXJlZFNsaWNlAgAAAApfc3RhcnRUaW1lBQAAAA9ib29rZWRTdGFydFRpbWUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAADXBhcmtpbmdTcG90SWQCAAAAB19zbGljZV8JAAGkAAAAAQUAAAAMZGVzaXJlZFNsaWNlAgAAAAhfZW5kVGltZQUAAAANYm9va2VkRW5kVGltZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACBQAAAA1wYXJraW5nU3BvdElkAgAAAAZfc2xpY2UJAABkAAAAAgUAAAANZXhpc3RpbmdTbGljZQAAAAAAAAAAAgUAAAADbmlsCQEAAAAWY3JlYXRlUGFya2luZ1Nwb3RTbGljZQAAAAQFAAAADXBhcmtpbmdTcG90SWQFAAAAFHBhcmtpbmdTcG90U3RhcnRUaW1lBQAAAA9ib29rZWRTdGFydFRpbWUJAABkAAAAAgUAAAANZXhpc3RpbmdTbGljZQAAAAAAAAAAAQkBAAAAFmNyZWF0ZVBhcmtpbmdTcG90U2xpY2UAAAAEBQAAAA1wYXJraW5nU3BvdElkBQAAAA1ib29rZWRFbmRUaW1lBQAAABJwYXJraW5nU3BvdEVuZFRpbWUJAABkAAAAAgUAAAANZXhpc3RpbmdTbGljZQAAAAAAAAAAAgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V567RfFw==", "height": 1560368, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FfySKd2g3LcTkrv2NLt58k1mnCjfKN7BiEEUpyKH2n7P Next: 8X8tbumv45kxuiZoDmFfXHJqksWghpy5KKVt4HGfWcQ6 Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | func bookParkingSpotSlice (parkingSpotId,desiredSlice,startTime,endTime,renter) = { | |
18 | 18 | let payment = value(i.payments[0]) | |
19 | 19 | let cost = getIntegerValue(this, (parkingSpotId + "_cost")) | |
20 | - | if (( | |
20 | + | if ((payment.assetId == unit)) | |
21 | 21 | then throw("payment should be in waves") | |
22 | 22 | else { | |
23 | 23 | let bookedStartTime = (startTime - (startTime % 3600)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func createParkingSpotSlice (parkingSpotId,startTime,endTime,slice) = [IntegerEntry((((parkingSpotId + "_slice_") + toString(slice)) + "_startTime"), startTime), IntegerEntry((((parkingSpotId + "_slice_") + toString(slice)) + "_endTime"), endTime)] | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | @Callable(i) | |
8 | 8 | func createParkingSpot (owner,lat,long,startTime,endTime,cost) = { | |
9 | 9 | let roundedStartTime = (startTime - (startTime % 3600)) | |
10 | 10 | let roundedEndTime = (endTime - (endTime % 3600)) | |
11 | 11 | ([StringEntry((toBase58String(i.transactionId) + "_owner"), owner), StringEntry((toBase58String(i.transactionId) + "_lat"), lat), StringEntry((toBase58String(i.transactionId) + "_long"), long), IntegerEntry((toBase58String(i.transactionId) + "_cost"), cost), IntegerEntry((toBase58String(i.transactionId) + "_slice"), 0)] ++ createParkingSpotSlice(toBase58String(i.transactionId), roundedStartTime, roundedEndTime, 0)) | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func bookParkingSpotSlice (parkingSpotId,desiredSlice,startTime,endTime,renter) = { | |
18 | 18 | let payment = value(i.payments[0]) | |
19 | 19 | let cost = getIntegerValue(this, (parkingSpotId + "_cost")) | |
20 | - | if (( | |
20 | + | if ((payment.assetId == unit)) | |
21 | 21 | then throw("payment should be in waves") | |
22 | 22 | else { | |
23 | 23 | let bookedStartTime = (startTime - (startTime % 3600)) | |
24 | 24 | let bookedEndTime = (endTime - (endTime % 3600)) | |
25 | 25 | let parkingSpotStartTime = getIntegerValue(this, (((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_startTime")) | |
26 | 26 | let parkingSpotEndTime = getIntegerValue(this, (((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_endTime")) | |
27 | 27 | let existingSlice = getIntegerValue(this, (parkingSpotId + "_slice")) | |
28 | 28 | if (if ((parkingSpotStartTime > bookedStartTime)) | |
29 | 29 | then true | |
30 | 30 | else (bookedEndTime > parkingSpotEndTime)) | |
31 | 31 | then throw("time is out of range for parking spot") | |
32 | 32 | else { | |
33 | 33 | let existingRenter = getString(this, (((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_renter")) | |
34 | 34 | if ((existingRenter != unit)) | |
35 | 35 | then throw("parking spot has already been booked") | |
36 | 36 | else if (if ((bookedStartTime == parkingSpotStartTime)) | |
37 | 37 | then (bookedEndTime == parkingSpotEndTime) | |
38 | 38 | else false) | |
39 | 39 | then [StringEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_renter"), renter), IntegerEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_slicetest0"), desiredSlice)] | |
40 | 40 | else if (if ((bookedStartTime == parkingSpotStartTime)) | |
41 | 41 | then (bookedEndTime != parkingSpotEndTime) | |
42 | 42 | else false) | |
43 | 43 | then ([StringEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_renter"), renter), IntegerEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_startTime"), bookedStartTime), IntegerEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_endTime"), bookedEndTime), IntegerEntry((parkingSpotId + "_slice"), (existingSlice + 1))] ++ createParkingSpotSlice(parkingSpotId, bookedEndTime, parkingSpotEndTime, (existingSlice + 1))) | |
44 | 44 | else if (if ((bookedEndTime == parkingSpotEndTime)) | |
45 | 45 | then (bookedStartTime != parkingSpotStartTime) | |
46 | 46 | else false) | |
47 | 47 | then ([StringEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_renter"), renter), IntegerEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_startTime"), bookedStartTime), IntegerEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_endTime"), bookedEndTime), IntegerEntry((parkingSpotId + "_slice"), (existingSlice + 1))] ++ createParkingSpotSlice(parkingSpotId, parkingSpotStartTime, bookedStartTime, (existingSlice + 1))) | |
48 | 48 | else (([StringEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_renter"), renter), IntegerEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_startTime"), bookedStartTime), IntegerEntry((((parkingSpotId + "_slice_") + toString(desiredSlice)) + "_endTime"), bookedEndTime), IntegerEntry((parkingSpotId + "_slice"), (existingSlice + 2))] ++ createParkingSpotSlice(parkingSpotId, parkingSpotStartTime, bookedStartTime, (existingSlice + 1))) ++ createParkingSpotSlice(parkingSpotId, bookedEndTime, parkingSpotEndTime, (existingSlice + 2))) | |
49 | 49 | } | |
50 | 50 | } | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Verifier(tx) | |
55 | 55 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
56 | 56 |
github/deemru/w8io/026f985 43.34 ms ◑