tx · 8jPgiKRQ3Ck5FBVUBenbXv4HHQaRVXDtYKDE45H51hiG 3N5kv9zPPj9YbiMXbCeiCNf9o5B5M9NC4Ps: -0.01000000 Waves 2019.12.02 18:23 [791224] smart account 3N5kv9zPPj9YbiMXbCeiCNf9o5B5M9NC4Ps > SELF 0.00000000 Waves
{ "type": 13, "id": "8jPgiKRQ3Ck5FBVUBenbXv4HHQaRVXDtYKDE45H51hiG", "fee": 1000000, "feeAssetId": null, "timestamp": 1575300180488, "version": 1, "sender": "3N5kv9zPPj9YbiMXbCeiCNf9o5B5M9NC4Ps", "senderPublicKey": "85CmZ2RmgncdEzYyCV1uWovKo5YmJLPMtLMGXYyB8K7Q", "proofs": [ "2kLeopneCsJw17CsKqr4DKgSXqVSLpEGLAVzy8QXDVEBoiBPh9bF3br7ZaURrG189zhsgUM7s6FyrzLu6t6VVdGC" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQgAAAADAAAAAAt0aWNrZXRQcmljZQAAAAAAAAAAAwAAAAAFTVJUaWQBAAAAICnmnpekyrpD5drIaECPwQqjTpCNuHBhSBX/8zj2KgU8AQAAAA9nZXRUaWNrZXRBbW91bnQAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAAEXRpY2tldEFtb3VudFRvdGFsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAAAAACAAAACmNvbnRleHRPYmoBAAAACWJ1eVRpY2tldAAAAAADCQAAAAAAAAIIBQAAAApjb250ZXh0T2JqAAAABmNhbGxlcgUAAAAEdGhpcwkAAAIAAAABAgAAACN0aWNrZXQgaHViIGNhbid0IGNhbGwgdGhpcyBmdW5jdGlvbgMJAAAAAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAGc3RhdHVzAgAAAA90aWNrZXRpbmdQZXJpb2QEAAAAByRtYXRjaD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ZXRJZCBpbiBwYXltZW50CQAAAgAAAAECAAAAFFBheW1lbnQgbm90IGF0dGFjaGVkCQAAAgAAAAECAAAAGUl0IGlzbid0IHRpY2tldGluZyBwZXJpb2QAAAAKY29udGV4dE9iagEAAAAJYWRkV2lubmVyAAAAAQAAAAdsb3R0ZXJ5BAAAAA5sb3R0ZXJ5QWRkcmVzcwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAdsb3R0ZXJ5AwkBAAAACWlzRGVmaW5lZAAAAAEJAAQbAAAAAgUAAAAEdGhpcwkAASwAAAACAgAAAAhsb3R0ZXJ5XwUAAAAHbG90dGVyeQQAAAANd2lubmVyQWRkcmVzcwkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAObG90dGVyeUFkZHJlc3MCAAAADXdpbm5lckFkZHJlc3MEAAAADHdpbm5lclRpY2tldAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAObG90dGVyeUFkZHJlc3MCAAAADHdpbm5lclRpY2tldAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAAA13aW5uaW5nVGlja2V0CQABpAAAAAEFAAAADHdpbm5lclRpY2tldAUAAAANd2lubmVyQWRkcmVzcwUAAAADbmlsCQAAAgAAAAECAAAAI3lvdSB0b3VjaCBpbmNvcnJlY3QgbG90dGVyeSBhZGRyZXNzAAAAABhx4Qo=", "chainId": 84, "height": 791224, "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 | + | let a = 3 | |
5 | + | ||
6 | + | let b = base58'3pZgFJLNfUey8rnyG6zrTVwvXdptnUZdkmpYu3wY5CuR' | |
7 | + | ||
8 | + | func c () = { | |
9 | + | let d = getInteger(this, "ticketAmountTotal") | |
10 | + | if ($isInstanceOf(d, "Int")) | |
11 | + | then { | |
12 | + | let e = d | |
13 | + | e | |
14 | + | } | |
15 | + | else 0 | |
16 | + | } | |
17 | + | ||
18 | + | ||
19 | + | @Callable(f) | |
20 | + | func buyTicket () = if ((f.caller == this)) | |
21 | + | then throw("ticket hub can't call this function") | |
22 | + | else if ((getStringValue(this, "status") == "ticketingPeriod")) | |
23 | + | then { | |
24 | + | let d = f.payment | |
25 | + | if ($isInstanceOf(d, "AttachedPayment")) | |
26 | + | then { | |
27 | + | let g = d | |
28 | + | if (if ((g.amount >= a)) | |
29 | + | then (g.assetId == b) | |
30 | + | else false) | |
31 | + | then { | |
32 | + | let h = (g.amount / a) | |
33 | + | let i = c() | |
34 | + | let j = (i + h) | |
35 | + | let k = toString((i + 1)) | |
36 | + | let l = toString((i + h)) | |
37 | + | let m = toString(f.caller) | |
38 | + | WriteSet([DataEntry(((("ticketsFrom" + k) + "To") + l), m), DataEntry("ticketAmountTotal", j)]) | |
39 | + | } | |
40 | + | else throw("Incorrect amount or assetId in payment") | |
41 | + | } | |
42 | + | else throw("Payment not attached") | |
43 | + | } | |
44 | + | else throw("It isn't ticketing period") | |
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | @Callable(f) | |
49 | + | func addWinner (n) = { | |
50 | + | let o = addressFromStringValue(n) | |
51 | + | if (isDefined(getBoolean(this, ("lottery_" + n)))) | |
52 | + | then { | |
53 | + | let p = getStringValue(o, "winnerAddress") | |
54 | + | let q = getIntegerValue(o, "winnerTicket") | |
55 | + | WriteSet([DataEntry(("winningTicket" + toString(q)), p)]) | |
56 | + | } | |
57 | + | else throw("you touch incorrect lottery address") | |
58 | + | } | |
59 | + | ||
60 | + |
github/deemru/w8io/026f985 14.77 ms ◑