tx · 5aNw85dGxbo3aykyWQT7DoWKBxDQbs3JqpmBfo6onS31
3Mxc1WtkzRarwxjRG1VSTgoPPynuS3q196Y: -0.01000000 Waves
2021.07.06 16:35 [1601817] smart account 3Mxc1WtkzRarwxjRG1VSTgoPPynuS3q196Y > SELF 0.00000000 Waves
{
"type": 13,
"id": "5aNw85dGxbo3aykyWQT7DoWKBxDQbs3JqpmBfo6onS31",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1625578567043,
"version": 2,
"chainId": 84,
"sender": "3Mxc1WtkzRarwxjRG1VSTgoPPynuS3q196Y",
"senderPublicKey": "9DTfiDzKQLuATT7gasgcj1kBn8VLJHjuBKJipCXbUJjr",
"proofs": [
"5NNjrXkdqhtVu6dLeuZcEjRiY1ZBVvM2MpPpcnCwGCLQRdPZ39qa64b8qQH1SEu6ihvv7M8132AbTd8tfK8YtHgk"
],
"script": "base64:AAIFAAAAAAAAAGQIAhIDCgEIGgcKAmExEgFpGgsKAmEyEgVuYXp3YRoJCgJhMxIDcG10GhUKAmE0Eg9jdXN0b21lckFkZHJlc3MaCwoCYTUSBXByaWNlGg0KAmE2EgckbWF0Y2gwGgcKAmE3EgFhAAAAAAAAAAEAAAACYTEBAAAACHB1cmNoYXNlAAAAAQAAAAJhMgQAAAACYTMJAAGRAAAAAggFAAAAAmExAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAJhMwAAAAdhc3NldElkCQAAAgAAAAECAAAAFXdvcmtzIHdpdGggd2F2ZXMgb25seQQAAAACYTQJAAJYAAAAAQgIBQAAAAJhMQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAAmE1BAAAAAJhNgkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgIAAAAFaXRlbV8FAAAAAmEyAgAAAA1fY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAJhNgIAAAADSW50BAAAAAJhNwUAAAACYTYFAAAAAmE3AAAAAAAAAAAAAwkAAGYAAAACBQAAAAJhNQgFAAAAAmEzAAAABmFtb3VudAkAAAIAAAABAgAAAARibGFkAwkAAGYAAAACCAUAAAACYTMAAAAGYW1vdW50BQAAAAJhNQkAAAIAAAABAgAAAA1ibGFkMiB6YSBkdXpvCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAFXN0YXR1czpwdXJjaGFzZV9pdGVtXwUAAAACYTICAAAACl9jdXN0b21lcl8FAAAAAmE0AgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAFHByaWNlOnB1cmNoYXNlX2l0ZW1fBQAAAAJhMgIAAAAKX2N1c3RvbWVyXwUAAAACYTQFAAAAAmE1BQAAAANuaWwAAAAAwyf/mg==",
"height": 1601817,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 5VrZMaGG3HJLVzNcSwUw1z3i3wpfR8UVLFi5A7D6wwm
Next: B8TjFovxVEsqaYpVE4ncw9LyZGKG2dG9mtqeh3LDqK1k
Diff:
Old | New | | Differences |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func purchase (type) = { |
---|
| 7 | + | func purchase (nazwa) = { |
---|
8 | 8 | | let pmt = i.payments[0] |
---|
9 | 9 | | if (isDefined(pmt.assetId)) |
---|
10 | 10 | | then throw("works with waves only") |
---|
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_" + nazwa) + "_coupon_price")) { |
---|
14 | 14 | | case a: Int => |
---|
15 | 15 | | a |
---|
16 | 16 | | case _ => |
---|
|
20 | 20 | | then throw("blad") |
---|
21 | 21 | | else if ((pmt.amount > price)) |
---|
22 | 22 | | then throw("blad2 za duzo") |
---|
23 | | - | else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)] |
---|
| 23 | + | else [StringEntry(((("status:purchase_item_" + nazwa) + "_customer_") + customerAddress), "confirmed"), IntegerEntry(((("price:purchase_item_" + nazwa) + "_customer_") + customerAddress), price)] |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | | - | func purchase (type) = { |
---|
| 7 | + | func purchase (nazwa) = { |
---|
8 | 8 | | let pmt = i.payments[0] |
---|
9 | 9 | | if (isDefined(pmt.assetId)) |
---|
10 | 10 | | then throw("works with waves only") |
---|
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_" + nazwa) + "_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 | 20 | | then throw("blad") |
---|
21 | 21 | | else if ((pmt.amount > price)) |
---|
22 | 22 | | then throw("blad2 za duzo") |
---|
23 | | - | else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)] |
---|
| 23 | + | else [StringEntry(((("status:purchase_item_" + nazwa) + "_customer_") + customerAddress), "confirmed"), IntegerEntry(((("price:purchase_item_" + nazwa) + "_customer_") + customerAddress), price)] |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
27 | 27 | | |
---|