tx · BdowG8XupwLM7oWTHD7gBaEaLcknWiPngd6mZcgmQtxT
3Mza1UcSrYad2hGwnxRpxbquAoP4ee7kS7X: -0.01500000 Waves
2019.07.16 10:45 [588081] smart account 3Mza1UcSrYad2hGwnxRpxbquAoP4ee7kS7X > SELF 0.00000000 Waves
{
"type": 13,
"id": "BdowG8XupwLM7oWTHD7gBaEaLcknWiPngd6mZcgmQtxT",
"fee": 1500000,
"feeAssetId": null,
"timestamp": 1563263174841,
"version": 1,
"sender": "3Mza1UcSrYad2hGwnxRpxbquAoP4ee7kS7X",
"senderPublicKey": "BDzd4V6bFqvL3bMmceVKyprt22wBJBe683pvQ2t5NMU5",
"proofs": [
"5CELMCTxYxLAsQMN4qBXw5SZFgXjWGWLw6omLqNonhSibYD9STiynaR5NfMvo14eBRkPWBc4AXCULTwseasGG1ty"
],
"script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAAFpAQAAAAhwdXJjaGFzZQAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACBDYW4gdXNlIFdBVkVTIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAAE2l0ZW1fQV9jb3Vwb25fcHJpY2UDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAECAAAALmFhbmtvb3BiZWRyYWcga2FuIG5pZXQgbGFnZXIgemlqbiBkYW4gZGUgcHJpanMDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAAC5hYW5rb29wYmVkcmFnIGthbiBuaWV0IGhvZ2VyIHppam4gZGFuIGRlIHByaWpzCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAIHN0YXR1czpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBwcmljZTpwdXJoY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAK4OKOo=",
"chainId": 84,
"height": 588081,
"spentComplexity": 0
}
View: original | compacted
Prev: 5zZQZfFyVS99zXjrUqnsrzaVtZWoUYQXT9RN59rPFLB7
Next: HrxS4uF6PX5ynha9bfrsFfk7xKk7iqVuYMjpKggM84hB
Diff:
Old | New | | Differences |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
| 6 | + | @Callable(i) |
---|
| 7 | + | func purchase () = { |
---|
| 8 | + | let pmt = extract(i.payment) |
---|
| 9 | + | if (isDefined(pmt.assetId)) |
---|
| 10 | + | then throw("Can use WAVES only at the moment") |
---|
| 11 | + | else { |
---|
| 12 | + | let customerAddress = toBase58String(i.caller.bytes) |
---|
| 13 | + | let price = match getInteger(this, "item_A_coupon_price") { |
---|
| 14 | + | case a: Int => |
---|
| 15 | + | a |
---|
| 16 | + | case _ => |
---|
| 17 | + | 0 |
---|
| 18 | + | } |
---|
| 19 | + | if ((price > pmt.amount)) |
---|
| 20 | + | then throw("aankoopbedrag kan niet lager zijn dan de prijs") |
---|
| 21 | + | else if ((pmt.amount > price)) |
---|
| 22 | + | then throw("aankoopbedrag kan niet hoger zijn dan de prijs") |
---|
| 23 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purhchase_item_A_customer_" + customerAddress), price)]) |
---|
| 24 | + | } |
---|
| 25 | + | } |
---|
6 | 26 | | |
---|
7 | | - | @Verifier(tx) |
---|
8 | | - | func verify () = match tx { |
---|
9 | | - | case d: SetScriptTransaction => |
---|
10 | | - | true |
---|
11 | | - | case d: DataTransaction => |
---|
12 | | - | true |
---|
13 | | - | case _ => |
---|
14 | | - | false |
---|
15 | | - | } |
---|
16 | 27 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
| 6 | + | @Callable(i) |
---|
| 7 | + | func purchase () = { |
---|
| 8 | + | let pmt = extract(i.payment) |
---|
| 9 | + | if (isDefined(pmt.assetId)) |
---|
| 10 | + | then throw("Can use WAVES only at the moment") |
---|
| 11 | + | else { |
---|
| 12 | + | let customerAddress = toBase58String(i.caller.bytes) |
---|
| 13 | + | let price = match getInteger(this, "item_A_coupon_price") { |
---|
| 14 | + | case a: Int => |
---|
| 15 | + | a |
---|
| 16 | + | case _ => |
---|
| 17 | + | 0 |
---|
| 18 | + | } |
---|
| 19 | + | if ((price > pmt.amount)) |
---|
| 20 | + | then throw("aankoopbedrag kan niet lager zijn dan de prijs") |
---|
| 21 | + | else if ((pmt.amount > price)) |
---|
| 22 | + | then throw("aankoopbedrag kan niet hoger zijn dan de prijs") |
---|
| 23 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purhchase_item_A_customer_" + customerAddress), price)]) |
---|
| 24 | + | } |
---|
| 25 | + | } |
---|
6 | 26 | | |
---|
7 | | - | @Verifier(tx) |
---|
8 | | - | func verify () = match tx { |
---|
9 | | - | case d: SetScriptTransaction => |
---|
10 | | - | true |
---|
11 | | - | case d: DataTransaction => |
---|
12 | | - | true |
---|
13 | | - | case _ => |
---|
14 | | - | false |
---|
15 | | - | } |
---|
16 | 27 | | |
---|