tx · 4uBePxkDqkXTes1di5hhCjAx6Bqby3ffbdRPw2j8xoH5 3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt: -0.01400000 Waves 2020.11.17 18:36 [1269554] smart account 3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt > SELF 0.00000000 Waves
{ "type": 13, "id": "4uBePxkDqkXTes1di5hhCjAx6Bqby3ffbdRPw2j8xoH5", "fee": 1400000, "feeAssetId": null, "timestamp": 1605627402543, "version": 2, "chainId": 84, "sender": "3NAj7owPjfmLoE3odgXC6cXfB1QzEhnpBtt", "senderPublicKey": "iRqJrgq4rS2ndNGFJoZtKcoTfskkxr3zfTesPWqtKzp", "proofs": [ "3YLk9qAr9BNdVCNfqvAjRsyanTJTUjeDiYdUfkjpeQ5G3xMXJfDBiCxJdWm2i9ZD8ex4urCQqRNEGL65NTAah7Kq" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAAdwYXltZW50CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAXT25seSBXYXZlcyBhcmUgYWNjZXB0ZWQEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNpdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAAAAAAAIIBQAAAAdwYXltZW50AAAABmFtb3VudAAAAAAAAAAAAAkAAAIAAAABAgAAABRQdXJjaGFzZSBhbW91bnQgaXMgMAMJAABmAAAAAgUAAAAFcHJpY2UIBQAAAAdwYXltZW50AAAABmFtb3VudAkAAAIAAAABAgAAABpQdXJjaGFzZSBhbW91bnQgaXMgdG9vIGxvdwMJAABmAAAAAggFAAAAB3BheW1lbnQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAABtQdXJjaGFzZSBhbW91bnQgaXMgdG9vIGhpZ2gJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAAB9zdGF0dXM6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyBQAAAA9jdXN0b21lckFkZHJlc3MCAAAABHRydWUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAecHJpY2U6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyBQAAAA9jdXN0b21lckFkZHJlc3MFAAAABXByaWNlBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAlzaWduYXR1cmUJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYFAAAACXNpZ25hdHVyZSfg+eE=", "height": 1269554, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: G481CT4A4N2EKS7trqz3Zv4AQYDaucLvEVQtDy6vAt3b Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func purchase () = { | |
8 | + | let payment = value(i.payments[0]) | |
9 | + | if (isDefined(payment.assetId)) | |
10 | + | then throw("Only Waves are accepted") | |
11 | + | else { | |
12 | + | let customerAddress = toBase58String(i.caller.bytes) | |
13 | + | let price = match getInteger(this, "item_A_coupon_price") { | |
14 | + | case a: Int => | |
15 | + | a | |
16 | + | case _ => | |
17 | + | 0 | |
18 | + | } | |
19 | + | if ((payment.amount == 0)) | |
20 | + | then throw("Purchase amount is 0") | |
21 | + | else if ((price > payment.amount)) | |
22 | + | then throw("Purchase amount is too low") | |
23 | + | else if ((payment.amount > price)) | |
24 | + | then throw("Purchase amount is too high") | |
25 | + | else [StringEntry(("status:purchase_item_A_customer" + customerAddress), "true"), IntegerEntry(("price:purchase_item_A_customer" + customerAddress), price)] | |
26 | + | } | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | @Verifier(tx) | |
31 | + | func verify () = { | |
32 | + | let signature = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
33 | + | match tx { | |
34 | + | case d: SetScriptTransaction => | |
35 | + | true | |
36 | + | case d: InvokeScriptTransaction => | |
37 | + | true | |
38 | + | case _ => | |
39 | + | signature | |
40 | + | } | |
41 | + | } | |
42 | + |
github/deemru/w8io/169f3d6 20.28 ms ◑