tx · Gt2NH17aJycRZQR3UqjybJQXiPRQrhjg422VcCQxBJRX
3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe: -0.00100000 Waves
2022.09.19 17:44 [2236145] smart account 3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe > SELF 0.00000000 Waves
{
"type": 13,
"id": "Gt2NH17aJycRZQR3UqjybJQXiPRQrhjg422VcCQxBJRX",
"fee": 100000,
"feeAssetId": null,
"timestamp": 1663598662240,
"version": 2,
"chainId": 84,
"sender": "3MzFjVphaDKp1oZjd5KmCYou3wCzCzTmEFe",
"senderPublicKey": "FFVf3kC6HkjRMmf8W6Zr2bNKhJ5EN5W1vG44GbgvHd9Z",
"proofs": [
"5tbLLkgFfdSSBx3kNxHWntjBhaykiM6uKuGYVmm5Hpa9VHFippmeXRgH1DfAeZkBTucySnXLph159LeQAEak2i5W"
],
"script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAABAAAACkNvdXBvblR5cGUEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACBjYW4gdXNlIFdBVkVTIG9ubHkgYXQgdGhlIG1vbWVudAQAAAAPY3VzdG9tZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXByaWNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACAgAAAAVJdGVtXwUAAAAKQ291cG9uVHlwZQIAAAANX2NvdXBvbl9wcmljZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkBAAAAAiE9AAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABXByaWNlCQAAAgAAAAECAAAAKVB1cmNoYXNlIGFtb3VudCBzaG91bGQgYmUgZXF1YWwgdG8gcHJpY2UgCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABZzdGF0dXM6IHB1cmNoYXNlX2l0ZW1fBQAAAApDb3Vwb25UeXBlAgAAAApfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MCAAAACWNvbmZpcm1lZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAVcHJpY2U6IHB1cmNoYXNlX2l0ZW1fBQAAAApDb3Vwb25UeXBlAgAAAApfY3VzdG9tZXJfBQAAAA9jdXN0b21lckFkZHJlc3MFAAAABXByaWNlBQAAAANuaWwAAAAArN32Dw==",
"height": 2236145,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: B7hkcnyvHN66SqHNnEEEBaTSBHVfAnxAV7Fd9UvUeFNu
Next: G6DAxYWgrrwBWBFg4uwSHuQHzqxV8y7fjyjruXmhRAJf
Diff:
Old | New | | Differences |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func purchase () = { |
---|
| 7 | + | func purchase (CouponType) = { |
---|
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_" + CouponType) + "_coupon_price")) { |
---|
14 | 14 | | case a: Int => |
---|
15 | 15 | | a |
---|
16 | 16 | | case _ => |
---|
|
18 | 18 | | } |
---|
19 | 19 | | if ((pmt.amount != price)) |
---|
20 | 20 | | then throw("Purchase amount should be equal to price ") |
---|
21 | | - | else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)]) |
---|
| 21 | + | else WriteSet([DataEntry(((("status: purchase_item_" + CouponType) + "_customer_") + customerAddress), "confirmed"), DataEntry(((("price: purchase_item_" + CouponType) + "_customer_") + customerAddress), price)]) |
---|
22 | 22 | | } |
---|
23 | 23 | | } |
---|
24 | 24 | | |
---|
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 | | - | func purchase () = { |
---|
| 7 | + | func purchase (CouponType) = { |
---|
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_" + CouponType) + "_coupon_price")) { |
---|
14 | 14 | | case a: Int => |
---|
15 | 15 | | a |
---|
16 | 16 | | case _ => |
---|
17 | 17 | | 0 |
---|
18 | 18 | | } |
---|
19 | 19 | | if ((pmt.amount != price)) |
---|
20 | 20 | | then throw("Purchase amount should be equal to price ") |
---|
21 | | - | else WriteSet([DataEntry(("status: purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + customerAddress), price)]) |
---|
| 21 | + | else WriteSet([DataEntry(((("status: purchase_item_" + CouponType) + "_customer_") + customerAddress), "confirmed"), DataEntry(((("price: purchase_item_" + CouponType) + "_customer_") + customerAddress), price)]) |
---|
22 | 22 | | } |
---|
23 | 23 | | } |
---|
24 | 24 | | |
---|
25 | 25 | | |
---|