tx · 6FHMW7wLr1Zw1GSqFQia5MH8YzdEqZhWWJabp7X4wVwi 3N8WKW33bRoL6j8jhERSykdsxLepdwF4roL: -0.05000000 Waves 2021.01.12 19:39 [1350475] smart account 3N8WKW33bRoL6j8jhERSykdsxLepdwF4roL > SELF 0.00000000 Waves
{ "type": 13, "id": "6FHMW7wLr1Zw1GSqFQia5MH8YzdEqZhWWJabp7X4wVwi", "fee": 5000000, "feeAssetId": null, "timestamp": 1610469528719, "version": 2, "chainId": 84, "sender": "3N8WKW33bRoL6j8jhERSykdsxLepdwF4roL", "senderPublicKey": "DfBpAEVbFfW1EMhjQ2DgbCDVQCY5L1nwL9NdWEmu4j3P", "proofs": [ "3Bq2T6ExFdtTdo52rTRgacUs1h6s7u3mx3E2iTMwv86R4CGj2oYMWDxsfN6Fi11yAcZnSWi9VnK4GHpcqvLdmG8L" ], "script": "base64:AAIEAAAAAAAAAE0IAhIECgIICBIECgIICBIECgIICBIECgIICBIICgYIAQgICAgSBQoDCAgIEgQKAggIEgQKAggIEgYKBAgICAgSBwoFCAgICAESAwoBCAAAAB0AAAAABE5PTkUCAAAABE5PTkUAAAAADnJlYmlydGhBc3NldElkAQAAACBOUoj0Ox1qSWj8AvvJykY60HyXYDn4C1M2mbaBcjAMMQEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQEAAAAPZ2V0Qm9vbGVhbkJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQbAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FAQAAAA9nZXRJbnRlZ2VyQnlLZXkAAAABA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vZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BwfTt5/3", "height": 1350475, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5L2scGfjHQjzSaFMnrM52XMtZcgQgopWFMVuXSmhL8c1 Next: 8Xj1EhpqrzTbH9ffs1PSij4tmzxLMphfx1DZAZga86DW Diff:
Old | New | Differences | |
---|---|---|---|
101 | 101 | func getValueDataOfRetailer (retailer) = getStringByKey(getKeyRetailerData(retailer)) | |
102 | 102 | ||
103 | 103 | ||
104 | + | func getValueDataOfCourier (courier) = getStringByKey(getKeyCourierData(courier)) | |
105 | + | ||
106 | + | ||
104 | 107 | @Callable(i) | |
105 | 108 | func registerRetailer (retailerIdentification,retailerData) = if ((this != i.caller)) | |
106 | 109 | then throw("Caller is not the Contract owner") | |
112 | 115 | ||
113 | 116 | ||
114 | 117 | @Callable(i) | |
118 | + | func updateRetailer (retailerIdentification,retailerData) = if ((this != i.caller)) | |
119 | + | then throw("Caller is not the Contract owner") | |
120 | + | else { | |
121 | + | let retailer = getKeyRetailer(retailerIdentification) | |
122 | + | let oldRetailerData = getValueDataOfRetailer(retailerIdentification) | |
123 | + | if ((oldRetailerData == NONE)) | |
124 | + | then throw("Courier does not exist on the Blockchain") | |
125 | + | else [StringEntry(getKeyCourierData(retailer), retailerData)] | |
126 | + | } | |
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | @Callable(i) | |
115 | 131 | func registerCourier (courierIdentification,courierData) = if ((this != i.caller)) | |
116 | 132 | then throw("Caller is not the Contract owner") | |
117 | 133 | else { | |
118 | 134 | let courier = getKeyCourier(courierIdentification) | |
119 | 135 | [StringEntry(getKeyCourierData(courier), courierData)] | |
136 | + | } | |
137 | + | ||
138 | + | ||
139 | + | ||
140 | + | @Callable(i) | |
141 | + | func updateCourier (courierIdentification,courierData) = if ((this != i.caller)) | |
142 | + | then throw("Caller is not the Contract owner") | |
143 | + | else { | |
144 | + | let courier = getKeyCourier(courierIdentification) | |
145 | + | let oldCourierData = getValueDataOfCourier(courierIdentification) | |
146 | + | if ((oldCourierData == NONE)) | |
147 | + | then throw("Courier does not exist on the Blockchain") | |
148 | + | else [StringEntry(getKeyCourierData(courier), courierData)] | |
120 | 149 | } | |
121 | 150 | ||
122 | 151 |
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 | let rebirthAssetId = base58'6Gjo6dZNLzun8w7uzWuH1t6hoGph9KrMcf1qjbEzBsVJ' | |
7 | 7 | ||
8 | 8 | func getStringByKey (key) = match getString(this, key) { | |
9 | 9 | case a: String => | |
10 | 10 | a | |
11 | 11 | case _ => | |
12 | 12 | NONE | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getBooleanByKey (key) = match getBoolean(this, key) { | |
17 | 17 | case a: Boolean => | |
18 | 18 | a | |
19 | 19 | case _ => | |
20 | 20 | NONE | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func getIntegerByKey (key) = match getInteger(this, key) { | |
25 | 25 | case a: Int => | |
26 | 26 | a | |
27 | 27 | case _ => | |
28 | 28 | -1 | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func getOrderString (city,keyOrderString) = ((city + "_") + keyOrderString) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func getKeyOrder (retailerIdentification,orderId) = { | |
36 | 36 | let retailerIdentificationAndOrderId = (retailerIdentification + orderId) | |
37 | 37 | ("order_" + toBase58String(sha256(toBytes(retailerIdentificationAndOrderId)))) | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getKeyRetailer (retailerIdentification) = ("retailer_" + toBase58String(sha256(toBytes(retailerIdentification)))) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getKeyCourier (courierIdentification) = ("courier_" + toBase58String(sha256(toBytes(courierIdentification)))) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func getKeyOrderCity (order) = (order + "_city") | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func getKeyOrderRetailerIdentification (order) = (order + "_retailer") | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func getKeyOrderShippingCosts (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_shipping") | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getKeyOrderCourier (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_courierId") | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getKeyOrderIsAccepted (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_data_courier_") + courierAddress) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getKeyOrderIsInDelivery (order,retailerIdentification,courierAddress) = (((((retailerIdentification + "_") + order) + "_data_courier_") + courierAddress) + "_isInDelivery") | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getKeyOrderDataOpen (order,retailerIdentification) = (((retailerIdentification + "_") + order) + "_data_open") | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getKeyOrderIsDelivered (order,retailerIdentification,courierAddress) = ((((retailerIdentification + "_") + order) + "_isDelivered_") + courierAddress) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func getKeyRetailerData (retailer) = (retailer + "_data") | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func getKeyCourierData (courier) = (courier + "_data") | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func getValueOrderCity (order) = getStringByKey(getKeyOrderCity(order)) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func getValueRetailerIdentificationOfOrder (order) = getStringByKey(getKeyOrderRetailerIdentification(order)) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func getValueIsAcceptedOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsAccepted(order, retailerIdentification, courierAddress)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func getValueCourierIdOfOrder (order,retailerIdentification) = getStringByKey(getKeyOrderCourier(order, retailerIdentification)) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func getValueIsInDeliveryOfOrder (order,retailerIdentification,courierAddress) = getBooleanByKey(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress)) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func getValueIsDeliveredOfOrder (order,retailerIdentification,courierAddress) = getStringByKey(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress)) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getValueShippingCostsOfOrder (order,retailerIdentification) = getIntegerByKey(getKeyOrderShippingCosts(order, retailerIdentification)) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getValueDataOfOrderOpen (order,retailerIdentification) = getStringByKey(getKeyOrderDataOpen(order, retailerIdentification)) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func getValueDataOfRetailer (retailer) = getStringByKey(getKeyRetailerData(retailer)) | |
102 | 102 | ||
103 | 103 | ||
104 | + | func getValueDataOfCourier (courier) = getStringByKey(getKeyCourierData(courier)) | |
105 | + | ||
106 | + | ||
104 | 107 | @Callable(i) | |
105 | 108 | func registerRetailer (retailerIdentification,retailerData) = if ((this != i.caller)) | |
106 | 109 | then throw("Caller is not the Contract owner") | |
107 | 110 | else { | |
108 | 111 | let retailer = getKeyRetailer(retailerIdentification) | |
109 | 112 | [StringEntry(getKeyRetailerData(retailer), retailerData)] | |
110 | 113 | } | |
111 | 114 | ||
112 | 115 | ||
113 | 116 | ||
114 | 117 | @Callable(i) | |
118 | + | func updateRetailer (retailerIdentification,retailerData) = if ((this != i.caller)) | |
119 | + | then throw("Caller is not the Contract owner") | |
120 | + | else { | |
121 | + | let retailer = getKeyRetailer(retailerIdentification) | |
122 | + | let oldRetailerData = getValueDataOfRetailer(retailerIdentification) | |
123 | + | if ((oldRetailerData == NONE)) | |
124 | + | then throw("Courier does not exist on the Blockchain") | |
125 | + | else [StringEntry(getKeyCourierData(retailer), retailerData)] | |
126 | + | } | |
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | @Callable(i) | |
115 | 131 | func registerCourier (courierIdentification,courierData) = if ((this != i.caller)) | |
116 | 132 | then throw("Caller is not the Contract owner") | |
117 | 133 | else { | |
118 | 134 | let courier = getKeyCourier(courierIdentification) | |
119 | 135 | [StringEntry(getKeyCourierData(courier), courierData)] | |
136 | + | } | |
137 | + | ||
138 | + | ||
139 | + | ||
140 | + | @Callable(i) | |
141 | + | func updateCourier (courierIdentification,courierData) = if ((this != i.caller)) | |
142 | + | then throw("Caller is not the Contract owner") | |
143 | + | else { | |
144 | + | let courier = getKeyCourier(courierIdentification) | |
145 | + | let oldCourierData = getValueDataOfCourier(courierIdentification) | |
146 | + | if ((oldCourierData == NONE)) | |
147 | + | then throw("Courier does not exist on the Blockchain") | |
148 | + | else [StringEntry(getKeyCourierData(courier), courierData)] | |
120 | 149 | } | |
121 | 150 | ||
122 | 151 | ||
123 | 152 | ||
124 | 153 | @Callable(i) | |
125 | 154 | func addOrder (orderId,shippingCosts,orderData,retailerIdentification,retailerData,city) = if ((this != i.caller)) | |
126 | 155 | then throw("Caller is not the Contract owner") | |
127 | 156 | else { | |
128 | 157 | let order = getKeyOrder(retailerIdentification, orderId) | |
129 | 158 | let orderCityString = getOrderString(city, order) | |
130 | 159 | let retailer = getKeyRetailer(retailerIdentification) | |
131 | 160 | let shipping = (shippingCosts * 100000000) | |
132 | 161 | if ((0 >= shippingCosts)) | |
133 | 162 | then throw("You cannot create an order with shipping costs lower than 0") | |
134 | 163 | else if ((getValueRetailerIdentificationOfOrder(order) != NONE)) | |
135 | 164 | then throw("An order with the same id already exists") | |
136 | 165 | 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")] | |
137 | 166 | } | |
138 | 167 | ||
139 | 168 | ||
140 | 169 | ||
141 | 170 | @Callable(i) | |
142 | 171 | func setOrderIsAccepted (retailerIdentification,orderId,courierAddress) = if ((this != i.caller)) | |
143 | 172 | then throw("Caller is not the Contract owner") | |
144 | 173 | else { | |
145 | 174 | let order = getKeyOrder(retailerIdentification, orderId) | |
146 | 175 | let city = getValueOrderCity(order) | |
147 | 176 | let orderCityString = getOrderString(city, order) | |
148 | 177 | let orderData = getValueDataOfOrderOpen(orderCityString, retailerIdentification) | |
149 | 178 | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
150 | 179 | then throw("The requested order does not exist") | |
151 | 180 | else if ((getValueIsAcceptedOfOrder(order, retailerIdentification, "") != "open")) | |
152 | 181 | then throw("The requested order is no longer available") | |
153 | 182 | 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)] | |
154 | 183 | } | |
155 | 184 | ||
156 | 185 | ||
157 | 186 | ||
158 | 187 | @Callable(i) | |
159 | 188 | func setOrderIsInDelivery (retailerIdentification,orderId) = if ((this != i.caller)) | |
160 | 189 | then throw("Caller is not the Contract owner") | |
161 | 190 | else { | |
162 | 191 | let order = getKeyOrder(retailerIdentification, orderId) | |
163 | 192 | let courierAddress = getValueCourierIdOfOrder(order, retailerIdentification) | |
164 | 193 | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
165 | 194 | then throw("The requested order does not exist") | |
166 | 195 | else if ((courierAddress == NONE)) | |
167 | 196 | then throw("The requested order is not accepted yet") | |
168 | 197 | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) != false)) | |
169 | 198 | then throw("The requested order is no longer available") | |
170 | 199 | else [BooleanEntry(getKeyOrderIsInDelivery(order, retailerIdentification, courierAddress), true), StringEntry(getKeyOrderIsDelivered(order, retailerIdentification, courierAddress), "inDelivery")] | |
171 | 200 | } | |
172 | 201 | ||
173 | 202 | ||
174 | 203 | ||
175 | 204 | @Callable(i) | |
176 | 205 | func setOrderIsDelivered (retailerIdentification,orderId) = if ((this != i.caller)) | |
177 | 206 | then throw("Caller is not the Contract owner") | |
178 | 207 | else { | |
179 | 208 | let order = getKeyOrder(retailerIdentification, orderId) | |
180 | 209 | let courierAddress = getValueCourierIdOfOrder(order, retailerIdentification) | |
181 | 210 | let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) | |
182 | 211 | let shipping = getValueShippingCostsOfOrder(order, retailerIdentification) | |
183 | 212 | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
184 | 213 | then throw("The requested order does not exist") | |
185 | 214 | else if ((courierAddress == NONE)) | |
186 | 215 | then throw("There was no courier set! Something went wrong with the order.") | |
187 | 216 | else if ((getValueIsDeliveredOfOrder(order, retailerIdentification, courierAddress) != "inDelivery")) | |
188 | 217 | then throw("The requested order was already delivered") | |
189 | 218 | 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)] | |
190 | 219 | } | |
191 | 220 | ||
192 | 221 | ||
193 | 222 | ||
194 | 223 | @Callable(i) | |
195 | 224 | func cancelAcceptedOrderByCourier (retailerIdentification,orderId,courierAddress,city) = if ((this != i.caller)) | |
196 | 225 | then throw("Caller is not the Contract owner") | |
197 | 226 | else { | |
198 | 227 | let order = getKeyOrder(retailerIdentification, orderId) | |
199 | 228 | let orderCityString = getOrderString(city, order) | |
200 | 229 | let orderData = getValueIsAcceptedOfOrder(order, retailerIdentification, courierAddress) | |
201 | 230 | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
202 | 231 | then throw("The requested order does not exist") | |
203 | 232 | else if ((orderData == NONE)) | |
204 | 233 | then throw("The requested order does not exist or is not accepted yet") | |
205 | 234 | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, courierAddress) == NONE)) | |
206 | 235 | then throw("The requested order is not accepted yet") | |
207 | 236 | 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")] | |
208 | 237 | } | |
209 | 238 | ||
210 | 239 | ||
211 | 240 | ||
212 | 241 | @Callable(i) | |
213 | 242 | func cancelOpenOrderByRetailer (retailerIdentification,orderId,city,retailerWalletAddress,shippingCosts) = if ((this != i.caller)) | |
214 | 243 | then throw("Caller is not the Contract owner") | |
215 | 244 | else { | |
216 | 245 | let order = getKeyOrder(retailerIdentification, orderId) | |
217 | 246 | let orderCityString = getOrderString(city, order) | |
218 | 247 | let retailer = getKeyRetailer(retailerIdentification) | |
219 | 248 | let shipping = (shippingCosts * 100000000) | |
220 | 249 | if ((getValueRetailerIdentificationOfOrder(order) != retailerIdentification)) | |
221 | 250 | then throw("The requested order does not exist") | |
222 | 251 | else if ((getValueIsInDeliveryOfOrder(order, retailerIdentification, "") == "open")) | |
223 | 252 | then throw("The requested order is already accepted and can no longer be canceled in this way") | |
224 | 253 | else [DeleteEntry(getKeyOrderCity(order)), DeleteEntry(getKeyOrderRetailerIdentification(order)), DeleteEntry(getKeyOrderShippingCosts(order, retailerIdentification)), DeleteEntry(getKeyOrderDataOpen(orderCityString, retailerIdentification)), DeleteEntry(getKeyOrderIsAccepted(order, retailerIdentification, "")), ScriptTransfer(addressFromStringValue(retailerWalletAddress), shipping, unit)] | |
225 | 254 | } | |
226 | 255 | ||
227 | 256 | ||
228 | 257 | ||
229 | 258 | @Callable(i) | |
230 | 259 | func deleteEntry (key) = if ((this != i.caller)) | |
231 | 260 | then throw("Caller is not the Contract owner") | |
232 | 261 | else [DeleteEntry(key)] | |
233 | 262 | ||
234 | 263 | ||
235 | 264 | @Verifier(tx) | |
236 | 265 | func verify () = match tx { | |
237 | 266 | case _: SetScriptTransaction => | |
238 | 267 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
239 | 268 | case _: InvokeScriptTransaction => | |
240 | 269 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
241 | 270 | case ttx: TransferTransaction => | |
242 | 271 | if (if (if ((ttx.amount == 300000000)) | |
243 | 272 | then true | |
244 | 273 | else (ttx.amount == 400000000)) | |
245 | 274 | then true | |
246 | 275 | else (ttx.amount == 500000000)) | |
247 | 276 | then true | |
248 | 277 | else if ((ttx.amount == 600000000)) | |
249 | 278 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
250 | 279 | else false | |
251 | 280 | case _ => | |
252 | 281 | false | |
253 | 282 | } | |
254 | 283 |
github/deemru/w8io/026f985 41.08 ms ◑