tx · EJ4Qt5d8AFkBm2Z6YXnXa3AHkYLRNRxmdGP4HUY8LVjA

3MuuTnT6CyA33GwqHBpJDmkKkT98hiJonwP:  -0.05000000 Waves

2021.01.06 16:36 [1341608] smart account 3MuuTnT6CyA33GwqHBpJDmkKkT98hiJonwP > SELF 0.00000000 Waves

{ "type": 13, "id": "EJ4Qt5d8AFkBm2Z6YXnXa3AHkYLRNRxmdGP4HUY8LVjA", "fee": 5000000, "feeAssetId": null, "timestamp": 1609940180566, "version": 2, "chainId": 84, "sender": "3MuuTnT6CyA33GwqHBpJDmkKkT98hiJonwP", "senderPublicKey": "HgH6DMvfVRpE4B8iQtmvvmBxcBqPkgJ3v1s8Kzn37JM2", "proofs": [ "44cwJzXTgy2cVW1ViAaZBqVYHERTSRCg3AYEgdi6cefiGysUyoimHtLKHJwhnTUxwzqYKY5f2TnWxXFmmQmTvnqo" ], "script": "base64:AAIEAAAAAAAAAEEIAhIECgIICBIECgIICBIICgYIAQgICAgSBQoDCAgIEgQKAggIEgQKAggIEgYKBAgICAgSBwoFCAgICAESAwoBCAAAABsAAAAABE5PTkUCAAAABE5PTkUBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUBAAAAD2dldEJvb2xlYW5CeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQEAAAAPZ2V0SW50ZWdlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAA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AAA2tleQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmdvOMN", "height": 1341608, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HkavfZnjgkyj7SQCsTCEKb43Yot9ytn9HsbFSdgVi5tH Next: CgT7jrKktC8NkdJRZvUR825VXoikmAZ65JVwXPFmVamA Diff:
OldNewDifferences
138138 let orderData = getValueDataOfOrderOpen(orderCityString, retailerIdentification)
139139 if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification))
140140 then throw("The requested order does not exist")
141- else if ((getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) != "open"))
141+ else if ((getValueIsAcceptedOfOrder(order, retailerIdentification, "") != "open"))
142142 then throw("The requested order is no longer available")
143143 else [DeleteEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress), orderData), BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), false), StringEntry(getKeyOrderCourier(order, retailerIdentification), courierAddress)]
144144 }
155155 then throw("The requested order is not accepted yet")
156156 else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) != false))
157157 then throw("The requested order is no longer available")
158- else [BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), true), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, ""), "inDelivery")]
158+ else [BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), true), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress), "inDelivery")]
159159 }
160160
161161
182182 let order = getKeyOrder(retailerIdentification, orderId)
183183 let orderCityString = getOrderString(city, order)
184184 let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress)
185- if ((orderData == NONE))
185+ if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification))
186186 then throw("The requested order does not exist")
187- else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) == NONE))
188- then throw("The requested order is not accepted yet")
189- else [DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress)), StringEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification), orderData), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), "open")]
187+ else if ((orderData == NONE))
188+ then throw("The requested order does not exist or is not accepted yet")
189+ else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) == NONE))
190+ then throw("The requested order is not accepted yet")
191+ else [DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress)), StringEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification), orderData), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), "open")]
190192 }
191193
192194
199201 let shipping = (shippingCosts * 100000000)
200202 if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification))
201203 then throw("The requested order does not exist")
202- else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, "") != NONE))
204+ else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, "") == "open"))
203205 then throw("The requested order is already accepted and can no longer be canceled in this way")
204206 else [DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderShippingCosts(order, retailerIdentification)), DeleteEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), ScriptTransfer(addressFromStringValue(retailerWalletAddress), shipping, unit)]
205207 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let NONE = "NONE"
55
66 func getStringByKey (key) = match getString(this, key) {
77 case a: String =>
88 a
99 case _ =>
1010 NONE
1111 }
1212
1313
1414 func getBooleanByKey (key) = match getBoolean(this, key) {
1515 case a: Boolean =>
1616 a
1717 case _ =>
1818 NONE
1919 }
2020
2121
2222 func getIntegerByKey (key) = match getInteger(this, key) {
2323 case a: Int =>
2424 a
2525 case _ =>
2626 -1
2727 }
2828
2929
3030 func getOrderString (city,keyOrderString) = ((city + "_") + keyOrderString)
3131
3232
3333 func getKeyOrder (retailerIdentification,orderId) = {
3434 let retailerIdentificationAndOrderId = (retailerIdentification + orderId)
3535 ("order_" + toBase58String(sha256(toBytes(retailerIdentificationAndOrderId))))
3636 }
3737
3838
3939 func getKeyRetailer (retailerIdentification) = ("retailer_" + toBase58String(sha256(toBytes(retailerIdentification))))
4040
4141
4242 func getKeyCourier (courierIdentification) = ("courier_" + toBase58String(sha256(toBytes(courierIdentification))))
4343
4444
4545 func getKeyOrderCity (order) = (order + "_city")
4646
4747
4848 func getKeyOrderRetailerIdentification (order) = (order + "_retailer")
4949
5050
5151 func getKeyOrderShippingCosts (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_shipping")
5252
5353
5454 func getKeyOrderCourier (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_courierId")
5555
5656
5757 func getKeyOrderIsAccepted (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_data_courier_") + courierAddress)
5858
5959
6060 func getKeyOrderIsInDelivery (order,retailerIdentification,courierAddress) = (((((retailerIdentification + "_") + order) + "_data_courier_") + courierAddress) + "_isInDelivery")
6161
6262
6363 func getKeyOrderDataOpen (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_data_open")
6464
6565
6666 func getKeyOrderIsDelivered (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_isDelivered_") + courierAddress)
6767
6868
6969 func getKeyRetailerData (retailer) = (retailer + "_data")
7070
7171
7272 func getKeyCourierData (courier) = (courier + "_data")
7373
7474
7575 func getValueOrderCity (order) = getStringByKey(getKeyOrderCity(order))
7676
7777
7878 func getValueRetailerIdentificationOfOrder (order) = getStringByKey(getKeyOrderRetailerIdentification(order))
7979
8080
8181 func getValueIsAcceptedOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress))
8282
8383
8484 func getValueCourierIdOfOrder (order,retailerIdentification) = getStringByKey(getKeyOrderCourier(order, retailerIdentification))
8585
8686
8787 func getValueIsInDeliveryOfOrder (order,retailerIdentification,courierAddress) = getBooleanByKey(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress))
8888
8989
9090 func getValueIsDeliveredOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress))
9191
9292
9393 func getValueShippingCostsOfOrder (order,retailerIdentification) = getIntegerByKey(getKeyOrderShippingCosts(order, retailerIdentification))
9494
9595
9696 func getValueDataOfOrderOpen (order,retailerIdentification) = getStringByKey(getKeyOrderDataOpen(order, retailerIdentification))
9797
9898
9999 func getValueDataOfRetailer (retailer) = getStringByKey(getKeyRetailerData(retailer))
100100
101101
102102 @Callable(i)
103103 func registerRetailer (retailerIdentification,retailerData) = {
104104 let retailer = getKeyRetailer(retailerIdentification)
105105 [StringEntry(getKeyRetailerData(retailer), retailerData)]
106106 }
107107
108108
109109
110110 @Callable(i)
111111 func registerCourier (courierIdentification,courierData) = {
112112 let courier = getKeyCourier(courierIdentification)
113113 [StringEntry(getKeyCourierData(courier), courierData)]
114114 }
115115
116116
117117
118118 @Callable(i)
119119 func addOrder (orderId,shippingCosts,orderData,retailerIdentification,retailerData,city) = {
120120 let order = getKeyOrder(retailerIdentification, orderId)
121121 let orderCityString = getOrderString(city, order)
122122 let retailer = getKeyRetailer(retailerIdentification)
123123 let shipping = (shippingCosts * 100000000)
124124 if ((0 >= shippingCosts))
125125 then throw("You cannot create an order with shipping costs lower than 0")
126126 else if ((getValueRetailerIdentificationOfOrder(order) != NONE))
127127 then throw("An order with the same id already exists")
128128 else [StringEntry(getKeyRetailerData(retailer), retailerData), StringEntry(getKeyOrderCity(order), city), StringEntry(getKeyOrderRetailerIdentification(order), retailerIdentification), IntegerEntry(getKeyOrderShippingCosts(order, retailerIdentification), shipping), StringEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification), orderData), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), "open")]
129129 }
130130
131131
132132
133133 @Callable(i)
134134 func setOrderIsAccepted (retailerIdentification,orderId,courierAddress) = {
135135 let order = getKeyOrder(retailerIdentification, orderId)
136136 let city = getValueOrderCity(order)
137137 let orderCityString = getOrderString(city, order)
138138 let orderData = getValueDataOfOrderOpen(orderCityString, retailerIdentification)
139139 if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification))
140140 then throw("The requested order does not exist")
141- else if ((getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) != "open"))
141+ else if ((getValueIsAcceptedOfOrder(order, retailerIdentification, "") != "open"))
142142 then throw("The requested order is no longer available")
143143 else [DeleteEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress), orderData), BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), false), StringEntry(getKeyOrderCourier(order, retailerIdentification), courierAddress)]
144144 }
145145
146146
147147
148148 @Callable(i)
149149 func setOrderIsInDelivery (retailerIdentification,orderId) = {
150150 let order = getKeyOrder(retailerIdentification, orderId)
151151 let courierAddress = getValueCourierIdOfOrder(order, retailerIdentification)
152152 if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification))
153153 then throw("The requested order does not exist")
154154 else if ((courierAddress == NONE))
155155 then throw("The requested order is not accepted yet")
156156 else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) != false))
157157 then throw("The requested order is no longer available")
158- else [BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), true), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, ""), "inDelivery")]
158+ else [BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), true), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress), "inDelivery")]
159159 }
160160
161161
162162
163163 @Callable(i)
164164 func setOrderIsDelivered (retailerIdentification,orderId) = {
165165 let order = getKeyOrder(retailerIdentification, orderId)
166166 let courierAddress = getValueCourierIdOfOrder(order, retailerIdentification)
167167 let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress)
168168 let shipping = getValueShippingCostsOfOrder(order, retailerIdentification)
169169 if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification))
170170 then throw("The requested order does not exist")
171171 else if ((courierAddress == NONE))
172172 then throw("There was no courier set! Something went wrong with the order.")
173173 else if ((getValueIsDeliveredOfOrder(order, retailerIdentification, courierAddress) != "inDelivery"))
174174 then throw("The requested order was already delivered")
175175 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)]
176176 }
177177
178178
179179
180180 @Callable(i)
181181 func cancelAcceptedOrderByCourier (retailerIdentification,orderId,courierAddress,city) = {
182182 let order = getKeyOrder(retailerIdentification, orderId)
183183 let orderCityString = getOrderString(city, order)
184184 let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress)
185- if ((orderData == NONE))
185+ if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification))
186186 then throw("The requested order does not exist")
187- else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) == NONE))
188- then throw("The requested order is not accepted yet")
189- else [DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress)), StringEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification), orderData), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), "open")]
187+ else if ((orderData == NONE))
188+ then throw("The requested order does not exist or is not accepted yet")
189+ else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) == NONE))
190+ then throw("The requested order is not accepted yet")
191+ else [DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)), DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress)), StringEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification), orderData), StringEntry(getKeyOrderIsAccepted(order, retailerIdentification, ""), "open")]
190192 }
191193
192194
193195
194196 @Callable(i)
195197 func cancelOpenOrderByRetailer (retailerIdentification,orderId,city,retailerWalletAddress,shippingCosts) = {
196198 let order = getKeyOrder(retailerIdentification, orderId)
197199 let orderCityString = getOrderString(city, order)
198200 let retailer = getKeyRetailer(retailerIdentification)
199201 let shipping = (shippingCosts * 100000000)
200202 if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification))
201203 then throw("The requested order does not exist")
202- else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, "") != NONE))
204+ else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, "") == "open"))
203205 then throw("The requested order is already accepted and can no longer be canceled in this way")
204206 else [DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderShippingCosts(order, retailerIdentification)), DeleteEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), ScriptTransfer(addressFromStringValue(retailerWalletAddress), shipping, unit)]
205207 }
206208
207209
208210
209211 @Callable(i)
210212 func deleteEntry (key) = [DeleteEntry(key)]
211213
212214
213215 @Verifier(tx)
214216 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
215217

github/deemru/w8io/026f985 
39.10 ms