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(a) |
---|
7 | | - | func purchase () = { |
---|
8 | | - | let b = extract(a.payment) |
---|
9 | | - | if (isDefined(b.assetId)) |
---|
| 7 | + | func purchase (b) = { |
---|
| 8 | + | let c = extract(a.payment) |
---|
| 9 | + | if (isDefined(c.assetId)) |
---|
10 | 10 | | then throw("can use WAVES only at the moment") |
---|
11 | 11 | | else { |
---|
12 | | - | let c = toBase58String(a.caller.bytes) |
---|
13 | | - | let d = { |
---|
14 | | - | let e = getInteger(this, "Item_A_coupon_price") |
---|
15 | | - | if ($isInstanceOf(e, "Int")) |
---|
| 12 | + | let d = toBase58String(a.caller.bytes) |
---|
| 13 | + | let e = { |
---|
| 14 | + | let f = getInteger(this, (("Item_" + b) + "_coupon_price")) |
---|
| 15 | + | if ($isInstanceOf(f, "Int")) |
---|
16 | 16 | | then { |
---|
17 | | - | let f = e |
---|
18 | | - | f |
---|
| 17 | + | let g = f |
---|
| 18 | + | g |
---|
19 | 19 | | } |
---|
20 | 20 | | else 0 |
---|
21 | 21 | | } |
---|
22 | | - | if ((b.amount != d)) |
---|
| 22 | + | if ((c.amount != e)) |
---|
23 | 23 | | then throw("Purchase amount should be equal to price ") |
---|
24 | | - | else WriteSet([DataEntry(("status: purchase_item_A_customer_" + c), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + c), d)]) |
---|
| 24 | + | else WriteSet([DataEntry(((("status: purchase_item_" + b) + "_customer_") + d), "confirmed"), DataEntry(((("price: purchase_item_" + b) + "_customer_") + d), e)]) |
---|
25 | 25 | | } |
---|
26 | 26 | | } |
---|
27 | 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 | 6 | | @Callable(a) |
---|
7 | | - | func purchase () = { |
---|
8 | | - | let b = extract(a.payment) |
---|
9 | | - | if (isDefined(b.assetId)) |
---|
| 7 | + | func purchase (b) = { |
---|
| 8 | + | let c = extract(a.payment) |
---|
| 9 | + | if (isDefined(c.assetId)) |
---|
10 | 10 | | then throw("can use WAVES only at the moment") |
---|
11 | 11 | | else { |
---|
12 | | - | let c = toBase58String(a.caller.bytes) |
---|
13 | | - | let d = { |
---|
14 | | - | let e = getInteger(this, "Item_A_coupon_price") |
---|
15 | | - | if ($isInstanceOf(e, "Int")) |
---|
| 12 | + | let d = toBase58String(a.caller.bytes) |
---|
| 13 | + | let e = { |
---|
| 14 | + | let f = getInteger(this, (("Item_" + b) + "_coupon_price")) |
---|
| 15 | + | if ($isInstanceOf(f, "Int")) |
---|
16 | 16 | | then { |
---|
17 | | - | let f = e |
---|
18 | | - | f |
---|
| 17 | + | let g = f |
---|
| 18 | + | g |
---|
19 | 19 | | } |
---|
20 | 20 | | else 0 |
---|
21 | 21 | | } |
---|
22 | | - | if ((b.amount != d)) |
---|
| 22 | + | if ((c.amount != e)) |
---|
23 | 23 | | then throw("Purchase amount should be equal to price ") |
---|
24 | | - | else WriteSet([DataEntry(("status: purchase_item_A_customer_" + c), "confirmed"), DataEntry(("price: purchase_item_A_customer_" + c), d)]) |
---|
| 24 | + | else WriteSet([DataEntry(((("status: purchase_item_" + b) + "_customer_") + d), "confirmed"), DataEntry(((("price: purchase_item_" + b) + "_customer_") + d), e)]) |
---|
25 | 25 | | } |
---|
26 | 26 | | } |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|