tx · 3MaQF2RpkVDUkPf2aLj8mTdHKwvKoFDTProYx4Y3uk18 3NBnUoHfxSDfoqjnDU2JGaXyK2fYJaB5JyZ: -0.01000000 Waves 2019.12.02 19:41 [791311] smart account 3NBnUoHfxSDfoqjnDU2JGaXyK2fYJaB5JyZ > SELF 0.00000000 Waves
{ "type": 13, "id": "3MaQF2RpkVDUkPf2aLj8mTdHKwvKoFDTProYx4Y3uk18", "fee": 1000000, "feeAssetId": null, "timestamp": 1575304866568, "version": 1, "sender": "3NBnUoHfxSDfoqjnDU2JGaXyK2fYJaB5JyZ", "senderPublicKey": "Gq13j7CGZCkbVaaXWL7JTW8WkRTdci1Vx8Hc3buuzGDr", "proofs": [ "5SwukznAe4GMakoKwoJmv2fE2mPzAUswpJn2AxveqjqdLBizKkH91nz5mpMB8sftgy49NaFpgD4RsRAd5Kvi2GEZ" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQgAAAADAAAAAAt0aWNrZXRQcmljZQkAAGgAAAACAAAAAAAAAABkAAAAAAAAAABkAAAAAAVNUlRpZAEAAAAgKeael6TKukPl2shoQI/BCqNOkI24cGFIFf/zOPYqBTwBAAAAD2dldFRpY2tldEFtb3VudAAAAAAEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwIAAAARdGlja2V0QW1vdW50VG90YWwDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAAAAAIAAAAKY29udGV4dE9iagEAAAAJYnV5VGlja2V0AAAAAAMJAAAAAAAAAggFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyBQAAAAR0aGlzCQAAAgAAAAECAAAAI3RpY2tldCBodWIgY2FuJ3QgY2FsbCB0aGlzIGZ1bmN0aW9uAwkAAAAAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAAZzdGF0dXMCAAAAD3RpY2tldGluZ1BlcmlvZAQ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3VudCBvciBhc3NldElkIGluIHBheW1lbnQJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQJAAACAAAAAQIAAAAZSXQgaXNuJ3QgdGlja2V0aW5nIHBlcmlvZAAAAApjb250ZXh0T2JqAQAAAAlhZGRXaW5uZXIAAAABAAAAB2xvdHRlcnkEAAAADmxvdHRlcnlBZGRyZXNzCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAB2xvdHRlcnkDCQEAAAAJaXNEZWZpbmVkAAAAAQkABBsAAAACBQAAAAR0aGlzCQABLAAAAAICAAAACGxvdHRlcnlfBQAAAAdsb3R0ZXJ5BAAAAA13aW5uZXJBZGRyZXNzCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAA5sb3R0ZXJ5QWRkcmVzcwIAAAANd2lubmVyQWRkcmVzcwQAAAAMd2lubmVyVGlja2V0CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAA5sb3R0ZXJ5QWRkcmVzcwIAAAAMd2lubmVyVGlja2V0CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAICAAAADXdpbm5pbmdUaWNrZXQJAAGkAAAAAQUAAAAMd2lubmVyVGlja2V0BQAAAA13aW5uZXJBZGRyZXNzBQAAAANuaWwJAAACAAAAAQIAAAAjeW91IHRvdWNoIGluY29ycmVjdCBsb3R0ZXJ5IGFkZHJlc3MAAAAA/Ewa2Q==", "chainId": 84, "height": 791311, "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 = (100 * 100) | |
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/169f3d6 18.21 ms ◑