tx · 3rv6nGTABW68UgnF9wqgrNx9mRKNixqi7zNor1f2Rjxm 3N7skFMcgQH4hnxafnvkgAmMwkmM2Adfsn7: -0.01400000 Waves 2020.04.17 04:03 [957783] smart account 3N7skFMcgQH4hnxafnvkgAmMwkmM2Adfsn7 > SELF 0.00000000 Waves
{ "type": 13, "id": "3rv6nGTABW68UgnF9wqgrNx9mRKNixqi7zNor1f2Rjxm", "fee": 1400000, "feeAssetId": null, "timestamp": 1587085427126, "version": 1, "sender": "3N7skFMcgQH4hnxafnvkgAmMwkmM2Adfsn7", "senderPublicKey": "Ffk2ikVKp6QaHe8K3H9aRsrGXmS5Xcay19vK9LP8o6Gt", "proofs": [ "Pe51yGcRH2YSfbLs39zYNqMBqRGNdTzDA8KpgRep9oShQvaZZbWXa8aGcz3xgB2hok7Rh1jQgpNGw3ZMhCWnZpi" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAgY2FuIHVzZSBXQVZFUyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNpdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAIAAAABAgAAAC1wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBpdGVtIHBpY2UDCQAAZgAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAVwcmljZQkAAAIAAAABAgAAAC9wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGhpZ2hlciB0aGFuIGl0ZW0gcGljZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYGmpwk+w==", "chainId": 84, "height": 957783, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func purchase () = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | if (isDefined(pmt.assetId)) | |
10 | + | then throw("can use WAVES only at the moment") | |
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 ((price > pmt.amount)) | |
20 | + | then throw("purchase amount cannot be less than item pice") | |
21 | + | else if ((pmt.amount > price)) | |
22 | + | then throw("purchase amount cannot be higher than item pice") | |
23 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) | |
24 | + | } | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | @Verifier(tx) | |
29 | + | func verify () = match tx { | |
30 | + | case d: SetScriptTransaction => | |
31 | + | true | |
32 | + | case d: DataTransaction => | |
33 | + | true | |
34 | + | case d: TransferTransaction => | |
35 | + | true | |
36 | + | case _ => | |
37 | + | true | |
38 | + | } | |
39 | + |
github/deemru/w8io/169f3d6 18.91 ms ◑