tx · GXMmNF21ZmFpnSzpXHWC1FUgGLZc9bJfwhzjoUN1gywg
3N5dNGqf97iKYDFN14a3jijT6XbBPMQ5Tbb: -0.05000000 Waves
2020.02.01 22:31 [880481] smart account 3N5dNGqf97iKYDFN14a3jijT6XbBPMQ5Tbb > SELF 0.00000000 Waves
{
"type": 13,
"id": "GXMmNF21ZmFpnSzpXHWC1FUgGLZc9bJfwhzjoUN1gywg",
"fee": 5000000,
"feeAssetId": null,
"timestamp": 1580585529327,
"version": 1,
"sender": "3N5dNGqf97iKYDFN14a3jijT6XbBPMQ5Tbb",
"senderPublicKey": "7vJLhpxiWqK5mqJFQSkbqdBCLNpM1ecA9VExrGEK5Jpr",
"proofs": [
"5zDM6bwZwuBoJa1G1LFPiKtjXx9MJAiZZ8fmWrWhEDmVsg2StpgpqXVVnANSyQNouF25rErZEVSc2vMSMyWVgWTM"
],
"script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAQAAAAAQaXRlbUFDb3Vwb25QcmljZQAAAAAAAJiWgAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAhY2FuIHVzZSBXQVZFUyAgb25seSBhdCB0aGUgbW9tZW50BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UFAAAAEGl0ZW1BQ291cG9uUHJpY2UDCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAIAAAABAgAAAC5wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBpdGVtIHByaWNlAwkAAGYAAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAFcHJpY2UJAAACAAAAAQIAAAAwcHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBoaWdoZXIgdGhhbiBpdGVtIHByaWNlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAIHN0YXR1czpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAAB9wcmljZTpwdXJjaGFzZV9pdGVtX0FfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MFAAAABXByaWNlBQAAAANuaWwAAAAAWuX5ww==",
"chainId": 84,
"height": 880481,
"spentComplexity": 0
}
View: original | compacted
Prev: CXyD4C9A7oA4R3x52UcqjqQrfzN1kDdHudBK1sTET2n7
Next: Ef6h2erbDnkx3qZPUMVYEu8VxWYUYVAco6PVD98A8D19
Diff:
Old | New | | Differences |
---|
13 | 13 | | let price = itemACouponPrice |
---|
14 | 14 | | if ((price > pmt.amount)) |
---|
15 | 15 | | then throw("purchase amount cannot be less than item price") |
---|
16 | | - | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) |
---|
| 16 | + | else if ((pmt.amount > price)) |
---|
| 17 | + | then throw("purchase amount cannot be higher than item price") |
---|
| 18 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) |
---|
17 | 19 | | } |
---|
18 | 20 | | } |
---|
19 | 21 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let itemACouponPrice = 10000000 |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func purchase () = { |
---|
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 = itemACouponPrice |
---|
14 | 14 | | if ((price > pmt.amount)) |
---|
15 | 15 | | then throw("purchase amount cannot be less than item price") |
---|
16 | | - | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) |
---|
| 16 | + | else if ((pmt.amount > price)) |
---|
| 17 | + | then throw("purchase amount cannot be higher than item price") |
---|
| 18 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) |
---|
17 | 19 | | } |
---|
18 | 20 | | } |
---|
19 | 21 | | |
---|
20 | 22 | | |
---|