tx · 556Km7buwpjQhspdE55GMSbvp5J2g8k21iyZWbrXNZjp 3N7E5gWZuaeJjgCou4UHGBJm5bh9Hh7KdnB: -0.01000000 Waves 2019.12.05 14:53 [795399] smart account 3N7E5gWZuaeJjgCou4UHGBJm5bh9Hh7KdnB > SELF 0.00000000 Waves
{ "type": 13, "id": "556Km7buwpjQhspdE55GMSbvp5J2g8k21iyZWbrXNZjp", "fee": 1000000, "feeAssetId": null, "timestamp": 1575546363656, "version": 1, "sender": "3N7E5gWZuaeJjgCou4UHGBJm5bh9Hh7KdnB", "senderPublicKey": "CmpQ6Q9vWocJdukZ82Bgk8SogoxvZovs6pSJPpcu5EDq", "proofs": [ "D6j69QA2tMEdiZjK9ZZ8Me358bMdrk2FnHSqvqpGrnSXbHRf1D3efQjx4FPhNYHsip3aJiT2pBAf9Ha7at3c683" ], "script": "base64:AAIDAAAAAAAAAAQIARIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAgY2FuIHVzZSBXQVZFUyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNpdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAIAAAABAgAAAC8gcHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBsZXNzIHRoYW4gaXRlbSBwcmljZQMJAABmAAAAAggFAAAAA3BtdAAAAAZhbW91bnQFAAAABXByaWNlCQAAAgAAAAECAAAAMHB1cmNoYXNlIGFtb3VudCBjYW5ub3QgYmUgaGlnaGVyIHRoYW4gaXRlbSBwcmljZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsAAAAAD5jwoA=", "chainId": 84, "height": 795399, "spentComplexity": 0 } View: original | compacted Prev: none Next: FzD3W8uBM2nLipFQBPidL3W2wQCbSZAivY1N145gX3To 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 price") | |
21 | + | else if ((pmt.amount > price)) | |
22 | + | then throw("purchase amount cannot be higher than item price") | |
23 | + | else WriteSet([DataEntry(("status:purchase_item_A_customer_" + customerAddress), "confirmed"), DataEntry(("price:purchase_item_A_customer_" + customerAddress), price)]) | |
24 | + | } | |
25 | + | } | |
26 | + | ||
27 | + |
github/deemru/w8io/026f985 35.83 ms ◑