tx · GoGfNK3BFnhYM8UdNp4ZAeCMkvxrgzqskiDTzTCCoLcJ
3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe: -0.00100000 Waves
2022.09.18 22:50 [2234994] smart account 3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe > SELF 0.00000000 Waves
{
"type": 13,
"id": "GoGfNK3BFnhYM8UdNp4ZAeCMkvxrgzqskiDTzTCCoLcJ",
"fee": 100000,
"feeAssetId": null,
"timestamp": 1663530608886,
"version": 2,
"chainId": 84,
"sender": "3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe",
"senderPublicKey": "FFVf3kC6HkjRMmf8W6Zr2bNKhJ5EN5W1vG44GbgvHd9Z",
"proofs": [
"2xerS7LQUxfzSypGz7weWxJzV8poWVgFdwXidyYHjcxm8FHMK1KsB9ngtrL2umZJYLXCmtHH2GEAgVsHYqDrrcVD"
],
"script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAgY2FuIHVzZSBXQVZFUyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNpdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAIAAAABAgAAAC5wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBpdGVtIHByaWNlAwkAAGYAAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAFcHJpY2UJAAACAAAAAQIAAAAwcHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBoaWdoZXIgdGhhbiBpdGVtIHByaWNlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAAIXN0YXR1czogcHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAgcHJpY2U6IHB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAD2N1c3RvbWVyQWRkcmVzcwUAAAAFcHJpY2UFAAAAA25pbAAAAAC6nO0D",
"height": 2234994,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: E8JFKDuFeqW7pXUU9zT2ZxyGoPAUYSkpnF7tUfxVaP66
Next: B7hkcnyvHN66SqHNnEEEBaTSBHVfAnxAV7Fd9UvUeFNu
Diff:
Old | New | | Differences |
---|
10 | 10 | | then throw("can use WAVES only at the moment") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
13 | | - | let price = match getInteger(this, "Item_A_coupon_price") { |
---|
| 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 | 19 | | if ((price > pmt.amount)) |
---|
20 | | - | then throw("Purchase cannot be lower than price ") |
---|
| 20 | + | then throw("purchase amount cannot be less than item price") |
---|
21 | 21 | | else if ((pmt.amount > price)) |
---|
22 | | - | then throw("Purchase cannot be higher than price ") |
---|
| 22 | + | then throw("purchase amount cannot be higher than item price") |
---|
23 | 23 | | else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)]) |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
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 at the moment") |
---|
11 | 11 | | else { |
---|
12 | 12 | | let customerAddress = toBase58String(i.caller.bytes) |
---|
13 | | - | let price = match getInteger(this, "Item_A_coupon_price") { |
---|
| 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 | 19 | | if ((price > pmt.amount)) |
---|
20 | | - | then throw("Purchase cannot be lower than price ") |
---|
| 20 | + | then throw("purchase amount cannot be less than item price") |
---|
21 | 21 | | else if ((pmt.amount > price)) |
---|
22 | | - | then throw("Purchase cannot be higher than price ") |
---|
| 22 | + | then throw("purchase amount cannot be higher than item price") |
---|
23 | 23 | | else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)]) |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
27 | 27 | | |
---|