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:
OldNewDifferences
44
55
66 @Callable(i)
7-func purchase (type) = {
7+func purchase (nazwa) = {
88 let pmt = i.payments[0]
99 if (isDefined(pmt.assetId))
1010 then throw("works with waves only")
1111 else {
1212 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")) {
1414 case a: Int =>
1515 a
1616 case _ =>
2020 then throw("blad")
2121 else if ((pmt.amount > price))
2222 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)]
2424 }
2525 }
2626
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
7-func purchase (type) = {
7+func purchase (nazwa) = {
88 let pmt = i.payments[0]
99 if (isDefined(pmt.assetId))
1010 then throw("works with waves only")
1111 else {
1212 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")) {
1414 case a: Int =>
1515 a
1616 case _ =>
1717 0
1818 }
1919 if ((price > pmt.amount))
2020 then throw("blad")
2121 else if ((pmt.amount > price))
2222 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)]
2424 }
2525 }
2626
2727

github/deemru/w8io/026f985 
26.79 ms