tx · Hdw8qc8DFZjBee4oEFHmzi3vfQQLZANBVzjXskqggDbc
3NBuGJbt1pYXWoAEB3yd1bBgmFZ95oBNeo6: -0.01000000 Waves
2021.07.06 14:54 [1601711] smart account 3NBuGJbt1pYXWoAEB3yd1bBgmFZ95oBNeo6 > SELF 0.00000000 Waves
{
"type": 13,
"id": "Hdw8qc8DFZjBee4oEFHmzi3vfQQLZANBVzjXskqggDbc",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1625572506964,
"version": 2,
"chainId": 84,
"sender": "3NBuGJbt1pYXWoAEB3yd1bBgmFZ95oBNeo6",
"senderPublicKey": "J9FtZpuwTo1nZceX5DMbFcETrvVKrgf7CLZPR1PQfdED",
"proofs": [
"3Po39hiEPdHrY3MBZnSZw582AzefD8asAKUu4ZVyV5Muem4L2VxStLUrg6ypG6QR1tMT1hxNr9dYKQHeQ3SSWUzW"
],
"script": "base64:AAIFAAAAAAAAAFQIAhIAGgcKAmExEgFpGgkKAmEyEgNwbXQaFQoCYTMSD2N1c3RvbWVyQWRkcmVzcxoLCgJhNBIFcHJpY2UaDQoCYTUSByRtYXRjaDAaBwoCYTYSAWEAAAAAAAAAAQAAAAJhMQEAAAAIcHVyY2hhc2UAAAAABAAAAAJhMgkAAZEAAAACCAUAAAACYTEAAAAIcGF5bWVudHMAAAAAAAAAAAADCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAAmEyAAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5BAAAAAJhMwkAAlgAAAABCAgFAAAAAmExAAAABmNhbGxlcgAAAAVieXRlcwQAAAACYTQEAAAAAmE1CQAEGgAAAAIFAAAABHRoaXMFAAAAAmEzAwkAAAEAAAACBQAAAAJhNQIAAAADSW50BAAAAAJhNgUAAAACYTUFAAAAAmE2AAAAAAAAAAAAAwkAAGYAAAACBQAAAAJhNAgFAAAAAmEyAAAABmFtb3VudAkAAAIAAAABAgAAAARibGFkAwkAAGYAAAACCAUAAAACYTIAAAAGYW1vdW50BQAAAAJhNAkAAAIAAAABAgAAAA1ibGFkMiB6YSBkdXpvCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAgc3RhdHVzOnB1cmNoYXNlX2l0ZW1fQV9jdXN0b21lcl8FAAAAAmEzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAACYTMFAAAAAmE0BQAAAANuaWwAAAAAJnbLeg==",
"height": 1601711,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: none
Next: JCKxXq8PVKnVg4tiExkyNjPrejfcg76LMLNgh5vLK85C
Full:
Old | New | | Differences |
---|
1 | | - | # no script |
---|
| 1 | + | {-# STDLIB_VERSION 5 #-} |
---|
| 2 | + | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
| 3 | + | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | |
---|
| 5 | + | |
---|
| 6 | + | @Callable(i) |
---|
| 7 | + | func purchase () = { |
---|
| 8 | + | let pmt = i.payments[0] |
---|
| 9 | + | if (isDefined(pmt.assetId)) |
---|
| 10 | + | then throw("works with waves only") |
---|
| 11 | + | else { |
---|
| 12 | + | let customerAddress = toBase58String(i.caller.bytes) |
---|
| 13 | + | let price = match getInteger(this, customerAddress) { |
---|
| 14 | + | case a: Int => |
---|
| 15 | + | a |
---|
| 16 | + | case _ => |
---|
| 17 | + | 0 |
---|
| 18 | + | } |
---|
| 19 | + | if ((price > pmt.amount)) |
---|
| 20 | + | then throw("blad") |
---|
| 21 | + | else if ((pmt.amount > price)) |
---|
| 22 | + | then throw("blad2 za duzo") |
---|
| 23 | + | else [StringEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + customerAddress), price)] |
---|
| 24 | + | } |
---|
| 25 | + | } |
---|
| 26 | + | |
---|
| 27 | + | |
---|