tx · 5h6TYhzPXzLxD84t6xYvXxmVVn5DDnyoSXjW4FkSTiUR 3MuuTnT6CyA33GwqHBpJDmkKkT98hiJonwP: -0.05000000 Waves 2021.01.04 20:29 [1338958] smart account 3MuuTnT6CyA33GwqHBpJDmkKkT98hiJonwP > SELF 0.00000000 Waves
{ "type": 13, "id": "5h6TYhzPXzLxD84t6xYvXxmVVn5DDnyoSXjW4FkSTiUR", "fee": 5000000, "feeAssetId": null, "timestamp": 1609781431075, "version": 2, "chainId": 84, "sender": "3MuuTnT6CyA33GwqHBpJDmkKkT98hiJonwP", "senderPublicKey": "HgH6DMvfVRpE4B8iQtmvvmBxcBqPkgJ3v1s8Kzn37JM2", "proofs": [ "2XeTy3Ck7Y36qa4hduydKsQZAWBrjG3RDuiVNSchnkS4eS48H3XNJUDmM54WXCZfUwD6nLjT3VeDVx5d3dZhvuVX" ], "script": "base64:AAIEAAAAAAAAAEIIAhIECgIICBIECgIICBIICgYIAQgICAgSBQoDCAgIEgQKAggIEgQKAggIEgYKBAgICAgSCAoGCAgICAgBEgMKAQgAAAAbAAAAAAROT05FAgAAAAROT05FAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FAQAAAA9nZXRCb29sZWFuQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBsAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAB0Jvb2xlYW4EAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUBAAAAD2dldEludGVnZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoM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FAAAABW9yZGVyBQAAABZyZXRhaWxlcklkZW50aWZpY2F0aW9uAgAAAAAJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAFmdldEtleU9yZGVySXNEZWxpdmVyZWQAAAADBQAAAAVvcmRlcgUAAAAWcmV0YWlsZXJJZGVudGlmaWNhdGlvbgIAAAAACQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAAFXJldGFpbGVyV2FsbGV0QWRkcmVzcwUAAAAIc2hpcHBpbmcFAAAABHVuaXQFAAAAA25pbAAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAADa2V5CQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAA2tleQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmYjarR", "height": 1338958, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CC65ZQ3knNgQmyaq1SjmL7ahChuM848rz9Jpqq55y1wb Next: E49YBhNmRotkpS1Wsd63C99JQqRPHVwrJsVNaSdnpQgv Diff:
Old | New | Differences | |
---|---|---|---|
190 | 190 | ||
191 | 191 | ||
192 | 192 | @Callable(i) | |
193 | + | func cancelOpenOrderByRetailer (retailerIdentification,orderId,courierAddress,city,retailerWalletAddress,shipping) = { | |
194 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
195 | + | let orderCityString = getOrderString(city, order) | |
196 | + | let retailer = getKeyRetailer(retailerIdentification) | |
197 | + | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
198 | + | then throw("The requested order does not exist") | |
199 | + | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) != NONE)) | |
200 | + | then throw("The requested order is already accepted and can no longer be canceled in this way") | |
201 | + | else [DeleteEntry(getKeyRetailerData(retailer)), DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderShippingCosts(order, retailerIdentification)), DeleteEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification)), DeleteEntry(getKeyOrderCourier(order, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, "")), DeleteEntry(getKeyOrderIsDelivered(order, retailerIdentification, "")), ScriptTransfer(addressFromStringValue(retailerWalletAddress), shipping, unit)] | |
202 | + | } | |
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | @Callable(i) | |
193 | 207 | func deleteEntry (key) = [DeleteEntry(key)] | |
194 | 208 | ||
195 | 209 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "NONE" | |
5 | 5 | ||
6 | 6 | func getStringByKey (key) = match getString(this, key) { | |
7 | 7 | case a: String => | |
8 | 8 | a | |
9 | 9 | case _ => | |
10 | 10 | NONE | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func getBooleanByKey (key) = match getBoolean(this, key) { | |
15 | 15 | case a: Boolean => | |
16 | 16 | a | |
17 | 17 | case _ => | |
18 | 18 | NONE | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func getIntegerByKey (key) = match getInteger(this, key) { | |
23 | 23 | case a: Int => | |
24 | 24 | a | |
25 | 25 | case _ => | |
26 | 26 | -1 | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func getOrderString (city,keyOrderString) = ((city + "_") + keyOrderString) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getKeyOrder (retailerIdentification,orderId) = { | |
34 | 34 | let retailerIdentificationAndOrderId = (retailerIdentification + orderId) | |
35 | 35 | ("order_" + toBase58String(sha256(toBytes(retailerIdentificationAndOrderId)))) | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func getKeyRetailer (retailerIdentification) = ("retailer_" + toBase58String(sha256(toBytes(retailerIdentification)))) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func getKeyCourier (courierIdentification) = ("courier_" + toBase58String(sha256(toBytes(courierIdentification)))) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func getKeyOrderCity (order) = (order + "_city") | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func getKeyOrderRetailerIdentification (order) = (order + "_retailer") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getKeyOrderShippingCosts (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_shipping") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getKeyOrderCourier (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_courierId") | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getKeyOrderIsAccepted (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_data_courier_") + courierAddress) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getKeyOrderIsInDelivery (order,retailerIdentification,courierAddress) = (((((retailerIdentification + "_") + order) + "_data_courier_") + courierAddress) + "_isInDelivery") | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getKeyOrderDataOpen (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_data_open") | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getKeyOrderIsDelivered (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_isDelivered_") + courierAddress) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getKeyRetailerData (retailer) = (retailer + "_data") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func getKeyCourierData (courier) = (courier + "_data") | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getValueOrderCity (order) = getStringByKey(getKeyOrderCity(order)) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getValueRetailerIdentificationOfOrder (order) = getStringByKey(getKeyOrderRetailerIdentification(order)) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func getValueIsAcceptedOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func getValueCourierIdOfOrder (order,retailerIdentification) = getStringByKey(getKeyOrderCourier(order, retailerIdentification)) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func getValueIsInDeliveryOfOrder (order,retailerIdentification,courierAddress) = getBooleanByKey(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress)) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func getValueIsDeliveredOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress)) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func getValueShippingCostsOfOrder (order,retailerIdentification) = getIntegerByKey(getKeyOrderShippingCosts(order, retailerIdentification)) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func getValueDataOfOrderOpen (order,retailerIdentification) = getStringByKey(getKeyOrderDataOpen(order, retailerIdentification)) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getValueDataOfRetailer (retailer) = getStringByKey(getKeyRetailerData(retailer)) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func registerRetailer (retailerIdentification,retailerData) = { | |
104 | 104 | let retailer = getKeyRetailer(retailerIdentification) | |
105 | 105 | [StringEntry(getKeyRetailerData(retailer), retailerData)] | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | 110 | @Callable(i) | |
111 | 111 | func registerCourier (courierIdentification,courierData) = { | |
112 | 112 | let courier = getKeyCourier(courierIdentification) | |
113 | 113 | [StringEntry(getKeyCourierData(courier), courierData)] | |
114 | 114 | } | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | ||
118 | 118 | @Callable(i) | |
119 | 119 | func addOrder (orderId,shippingCosts,orderData,retailerIdentification,retailerData,city) = { | |
120 | 120 | let order = getKeyOrder(retailerIdentification, orderId) | |
121 | 121 | let orderCityString = getOrderString(city, order) | |
122 | 122 | let retailer = getKeyRetailer(retailerIdentification) | |
123 | 123 | let shipping = (shippingCosts * 100000000) | |
124 | 124 | if ((0 >= shippingCosts)) | |
125 | 125 | then throw("You cannot create an order with shipping costs lower than 0") | |
126 | 126 | else if ((getValueRetailerIdentificationOfOrder(order) != NONE)) | |
127 | 127 | then throw("An order with the same id already exists") | |
128 | 128 | else [StringEntry(getKeyRetailerData(retailer), retailerData), StringEntry(getKeyOrderCity(order), city), StringEntry(getKeyOrderRetailerIdentification(order), retailerIdentification), IntegerEntry(getKeyOrderShippingCosts(order, retailerIdentification), shipping), StringEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification), orderData), StringEntry(getKeyOrderCourier(order, retailerIdentification), NONE), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), NONE), StringEntry(getKeyOrderIsInDelivery(order, retailerIdentification, ""), NONE), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, ""), NONE)] | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | ||
133 | 133 | @Callable(i) | |
134 | 134 | func setOrderIsAccepted (retailerIdentification,orderId,courierAddress) = { | |
135 | 135 | let order = getKeyOrder(retailerIdentification, orderId) | |
136 | 136 | let city = getValueOrderCity(order) | |
137 | 137 | let orderCityString = getOrderString(city, order) | |
138 | 138 | let orderData = getValueDataOfOrderOpen(orderCityString, retailerIdentification) | |
139 | 139 | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
140 | 140 | then throw("The requested order does not exist") | |
141 | 141 | else if ((getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) != NONE)) | |
142 | 142 | then throw("The requested order is no longer available") | |
143 | 143 | else [DeleteEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, "")), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress), orderData), BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), false), StringEntry(getKeyOrderCourier(order, retailerIdentification), courierAddress)] | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | ||
148 | 148 | @Callable(i) | |
149 | 149 | func setOrderIsInDelivery (retailerIdentification,orderId) = { | |
150 | 150 | let order = getKeyOrder(retailerIdentification, orderId) | |
151 | 151 | let courierAddress = getValueCourierIdOfOrder(order, retailerIdentification) | |
152 | 152 | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
153 | 153 | then throw("The requested order does not exist") | |
154 | 154 | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) != false)) | |
155 | 155 | then throw("The requested order is no longer available") | |
156 | 156 | else [BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), true)] | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | ||
161 | 161 | @Callable(i) | |
162 | 162 | func setOrderIsDelivered (retailerIdentification,orderId) = { | |
163 | 163 | let order = getKeyOrder(retailerIdentification, orderId) | |
164 | 164 | let courierAddress = getValueCourierIdOfOrder(order, retailerIdentification) | |
165 | 165 | let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) | |
166 | 166 | let shipping = getValueShippingCostsOfOrder(order, retailerIdentification) | |
167 | 167 | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
168 | 168 | then throw("The requested order does not exist") | |
169 | 169 | else if ((courierAddress == NONE)) | |
170 | 170 | then throw("There was no courier set! Something went wrong with the order.") | |
171 | 171 | else if ((getValueIsDeliveredOfOrder(order, retailerIdentification, courierAddress) != NONE)) | |
172 | 172 | then throw("The requested order is no longer available") | |
173 | 173 | else [DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderIsDelivered(order, retailerIdentification, "")), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress), orderData), ScriptTransfer(addressFromStringValue(courierAddress), shipping, unit)] | |
174 | 174 | } | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | ||
178 | 178 | @Callable(i) | |
179 | 179 | func cancelAcceptedOrderByCourier (retailerIdentification,orderId,courierAddress,city) = { | |
180 | 180 | let order = getKeyOrder(retailerIdentification, orderId) | |
181 | 181 | let orderCityString = getOrderString(city, order) | |
182 | 182 | let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) | |
183 | 183 | if ((orderData == NONE)) | |
184 | 184 | then throw("The requested order does not exist") | |
185 | 185 | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) == NONE)) | |
186 | 186 | then throw("The requested order is not accepted yet") | |
187 | 187 | else [DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress)), StringEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification), orderData), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), NONE), StringEntry(getKeyOrderIsInDelivery(order, retailerIdentification, ""), NONE)] | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | ||
192 | 192 | @Callable(i) | |
193 | + | func cancelOpenOrderByRetailer (retailerIdentification,orderId,courierAddress,city,retailerWalletAddress,shipping) = { | |
194 | + | let order = getKeyOrder(retailerIdentification, orderId) | |
195 | + | let orderCityString = getOrderString(city, order) | |
196 | + | let retailer = getKeyRetailer(retailerIdentification) | |
197 | + | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
198 | + | then throw("The requested order does not exist") | |
199 | + | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) != NONE)) | |
200 | + | then throw("The requested order is already accepted and can no longer be canceled in this way") | |
201 | + | else [DeleteEntry(getKeyRetailerData(retailer)), DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderShippingCosts(order, retailerIdentification)), DeleteEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification)), DeleteEntry(getKeyOrderCourier(order, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, "")), DeleteEntry(getKeyOrderIsDelivered(order, retailerIdentification, "")), ScriptTransfer(addressFromStringValue(retailerWalletAddress), shipping, unit)] | |
202 | + | } | |
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | @Callable(i) | |
193 | 207 | func deleteEntry (key) = [DeleteEntry(key)] | |
194 | 208 | ||
195 | 209 | ||
196 | 210 | @Verifier(tx) | |
197 | 211 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
198 | 212 |
github/deemru/w8io/026f985 34.36 ms ◑