tx · DuSJ3cDg9HpAXk1nJy5sK8VGRh2wppmscqijChwN6evT 3Mza1UcSrYad2hGwnxRpxbquAoP4ee7kS7X: -0.01400000 Waves 2019.07.16 12:18 [588176] smart account 3Mza1UcSrYad2hGwnxRpxbquAoP4ee7kS7X > SELF 0.00000000 Waves
{ "type": 13, "id": "DuSJ3cDg9HpAXk1nJy5sK8VGRh2wppmscqijChwN6evT", "fee": 1400000, "feeAssetId": null, "timestamp": 1563268720839, "version": 1, "sender": "3Mza1UcSrYad2hGwnxRpxbquAoP4ee7kS7X", "senderPublicKey": "BDzd4V6bFqvL3bMmceVKyprt22wBJBe683pvQ2t5NMU5", "proofs": [ "125zinKYKXLDQYCWaCkJUVBYaViVhQV1ipTpmgmMa8GHEb8hCMFq8mzahq1JFRAC7znsstybgw24ZXpC1XiVz5jp" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAEAAAAHcHJvZHVjdAQAAAADcG10CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIENhbiB1c2UgV0FWRVMgb25seSBhdCB0aGUgbW9tZW50BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACAgAAAAVpdGVtXwIAAAARaXRlbV9jb3Vwb25fcHJpY2UDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAECAAAALmFhbmtvb3BiZWRyYWcga2FuIG5pZXQgbGFnZXIgemlqbiBkYW4gZGUgcHJpanMDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAAC5hYW5rb29wYmVkcmFnIGthbiBuaWV0IGhvZ2VyIHppam4gZGFuIGRlIHByaWpzCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAVc3RhdHVzOnB1cmNoYXNlX2l0ZW1fAgAAAApfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAAFHByaWNlOnB1cmNoYXNlX2l0ZW1fAgAAAApfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MFAAAABXByaWNlBQAAAANuaWwAAAAAbA9JRw==", "chainId": 84, "height": 588176, "spentComplexity": 0 } View: original | compacted Prev: DwR1esZi7U5dUhtm5MjH1foHHC4vMkDd7UTihmC5UvE6 Next: E3xmChHohnbUeaqyMdKQhNz3PwfiJsU9z7YfhZocYGfK Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func purchase (product) = { | |
8 | 8 | let pmt = extract(i.payment) | |
9 | 9 | if (isDefined(pmt.assetId)) | |
10 | 10 | then throw("Can use WAVES only at the moment") | |
11 | 11 | else { | |
12 | 12 | let customerAddress = toBase58String(i.caller.bytes) | |
13 | 13 | let price = match getInteger(this, ("item_" + "item_coupon_price")) { | |
14 | 14 | case a: Int => | |
15 | 15 | a | |
16 | 16 | case _ => | |
17 | 17 | 0 | |
18 | 18 | } | |
19 | 19 | if ((price > pmt.amount)) | |
20 | 20 | then throw("aankoopbedrag kan niet lager zijn dan de prijs") | |
21 | 21 | else if ((pmt.amount > price)) | |
22 | 22 | then throw("aankoopbedrag kan niet hoger zijn dan de prijs") | |
23 | 23 | else WriteSet([DataEntry((("status:purchase_item_" + "_customer_") + customerAddress), "confirmed"), DataEntry((("price:purchase_item_" + "_customer_") + customerAddress), price)]) | |
24 | 24 | } | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 |
github/deemru/w8io/026f985 47.52 ms ◑