tx · 9TfShDSzDmUQTcJwaXsueTnXaTmFAafgsLVziag7TuPv
3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe: -0.00100000 Waves
2022.09.18 22:35 [2234979] smart account 3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe > SELF 0.00000000 Waves
{
"type": 13,
"id": "9TfShDSzDmUQTcJwaXsueTnXaTmFAafgsLVziag7TuPv",
"fee": 100000,
"feeAssetId": null,
"timestamp": 1663529784264,
"version": 2,
"chainId": 84,
"sender": "3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe",
"senderPublicKey": "FFVf3kC6HkjRMmf8W6Zr2bNKhJ5EN5W1vG44GbgvHd9Z",
"proofs": [
"3mAReJYntyDRbZU2zXtq1YgjNJXR8tLyPtZ7CKWrxbEaUwuiRNbVG7dcUX46wZjsdqgP6XVUULcU5iKfVwQKZQHi"
],
"script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAASQ2FuIHVzZSBXQVZFUyBvbmx5BAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAFcHJpY2UEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAATSXRlbV9BX0NvdXBvbl9QcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACBQAAAAVwcmljZQgFAAAAA3BtdAAAAAZhbW91bnQJAAACAAAAAQIAAAAjUHVyY2hhc2UgY2Fubm90IGJlIGxlc3MgdGhhbiBwcmljZSADCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAACNQdXJjaGFzZSBjYW5ub3QgYmUgbW9yZSB0aGFuIHByaWNlIAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6IHB1cmNoYXNlX2l0ZW1BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6IHB1cmNoYXNlX2l0ZW1BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAADGt8nk=",
"height": 2234979,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: GpWBv9XRP3ZUknCpH5dJchRxFBzU9YVPwWK7txmPCT8e
Next: E8JFKDuFeqW7pXUU9zT2ZxyGoPAUYSkpnF7tUfxVaP66
Diff:
Old | New | | Differences |
---|
16 | 16 | | case _ => |
---|
17 | 17 | | 0 |
---|
18 | 18 | | } |
---|
19 | | - | if ((pmt.amount != price)) |
---|
20 | | - | then throw("Amount is less or more than price ") |
---|
21 | | - | else WriteSet([DataEntry(("status: purchase_itemA_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_itemA_customer_" + customerAddress), price)]) |
---|
| 19 | + | if ((price > pmt.amount)) |
---|
| 20 | + | then throw("Purchase cannot be less than price ") |
---|
| 21 | + | else if ((pmt.amount > price)) |
---|
| 22 | + | then throw("Purchase cannot be more than price ") |
---|
| 23 | + | else WriteSet([DataEntry(("status: purchase_itemA_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_itemA_customer_" + customerAddress), price)]) |
---|
22 | 24 | | } |
---|
23 | 25 | | } |
---|
24 | 26 | | |
---|
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 () = { |
---|
8 | 8 | | let pmt = extract(i.payment) |
---|
9 | 9 | | if (isDefined(pmt.assetId)) |
---|
10 | 10 | | then throw("Can use WAVES only") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
13 | 13 | | let price = match getInteger(this, "Item_A_Coupon_Price") { |
---|
14 | 14 | | case a: Int => |
---|
15 | 15 | | a |
---|
16 | 16 | | case _ => |
---|
17 | 17 | | 0 |
---|
18 | 18 | | } |
---|
19 | | - | if ((pmt.amount != price)) |
---|
20 | | - | then throw("Amount is less or more than price ") |
---|
21 | | - | else WriteSet([DataEntry(("status: purchase_itemA_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_itemA_customer_" + customerAddress), price)]) |
---|
| 19 | + | if ((price > pmt.amount)) |
---|
| 20 | + | then throw("Purchase cannot be less than price ") |
---|
| 21 | + | else if ((pmt.amount > price)) |
---|
| 22 | + | then throw("Purchase cannot be more than price ") |
---|
| 23 | + | else WriteSet([DataEntry(("status: purchase_itemA_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_itemA_customer_" + customerAddress), price)]) |
---|
22 | 24 | | } |
---|
23 | 25 | | } |
---|
24 | 26 | | |
---|
25 | 27 | | |
---|