tx · FmhcMWMV8njjv9kvnTVPoSqQgG4EK8nKv1oSAemQy24g 3MuPe52GsMZN8tduGQ3jgoUBsJK1zAhjaqm: -0.01000000 Waves 2022.03.09 19:31 [1956653] smart account 3MuPe52GsMZN8tduGQ3jgoUBsJK1zAhjaqm > SELF 0.00000000 Waves
{ "type": 13, "id": "FmhcMWMV8njjv9kvnTVPoSqQgG4EK8nKv1oSAemQy24g", "fee": 1000000, "feeAssetId": null, "timestamp": 1646843502829, "version": 2, "chainId": 84, "sender": "3MuPe52GsMZN8tduGQ3jgoUBsJK1zAhjaqm", "senderPublicKey": "DKZcYM5WoZ3gBkiAgjzXdfQaZcfisgn2Zn4B226GHMcD", "proofs": [ "3miVw47HfHhT52jJHP3kzg6zLYnGSKUSxM33P3SLYYxz9riyQ3UvG7ArWyuvRrmMKqjdwcgEZAWUxLdT7P7ixxgC" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAIcHVyY2hhc2UAAAAABAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAcQXR0YWNoZWQgcGF5bWVudCBpcyByZXF1aXJlZAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAgY2FuIHVzZSBXQVZFUyBvbmx5IGF0IHRoZSBtb21lbnQEAAAAD2N1c3RvbWVyQWRkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwcmljZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAABNpdGVtX0FfY291cG9uX3ByaWNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAABXByaWNlCAUAAAADcG10AAAABmFtb3VudAkAAAIAAAABAgAAAC5wdXJjaGFzZSBhbW91bnQgY2Fubm90IGJlIGxlc3MgdGhhbiBpdGVtIHByaWNlAwkAAGYAAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAFcHJpY2UJAAACAAAAAQIAAAAwcHVyY2hhc2UgYW1vdW50IGNhbm5vdCBiZSBoaWdoZXIgdGhhbiBpdGVtIHByaWNlCQAFFAAAAAIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAACBzdGF0dXM6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzAgAAAAljb25maXJtZWQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAfcHJpY2U6cHVyY2hhc2VfaXRlbV9BX2N1c3RvbWVyXwUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAVwcmljZQUAAAADbmlsBQAAAAR1bml0AAAAAGEHKac=", "height": 1956653, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: FojoH3QYVEtEYvFUCPtgDxLzuUZsjhYRXHSZ2Rfz6Jyn Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(a) | |
7 | + | func purchase () = { | |
8 | + | let b = if ((size(a.payments) == 1)) | |
9 | + | then a.payments[0] | |
10 | + | else throw("Attached payment is required") | |
11 | + | if (isDefined(b.assetId)) | |
12 | + | then throw("can use WAVES only at the moment") | |
13 | + | else { | |
14 | + | let c = toBase58String(a.caller.bytes) | |
15 | + | let d = { | |
16 | + | let e = getInteger(this, "item_A_coupon_price") | |
17 | + | if ($isInstanceOf(e, "Int")) | |
18 | + | then { | |
19 | + | let f = e | |
20 | + | f | |
21 | + | } | |
22 | + | else 0 | |
23 | + | } | |
24 | + | if ((d > b.amount)) | |
25 | + | then throw("purchase amount cannot be less than item price") | |
26 | + | else if ((b.amount > d)) | |
27 | + | then throw("purchase amount cannot be higher than item price") | |
28 | + | else $Tuple2([StringEntry(("status:purchase_item_A_customer_" + c), "confirmed"), IntegerEntry(("price:purchase_item_A_customer_" + c), d)], unit) | |
29 | + | } | |
30 | + | } | |
31 | + | ||
32 | + |
github/deemru/w8io/026f985 13.98 ms ◑