tx · EWWFX2VWwh9F4KVnTcyttU5k7YGtZM5Txj7NG3SVp67i 3N3rUp6mqXtgoQw3kSkKKxwfcnBFnzH661K: -0.01000000 Waves 2022.07.31 00:43 [2163109] smart account 3N3rUp6mqXtgoQw3kSkKKxwfcnBFnzH661K > SELF 0.00000000 Waves
{ "type": 13, "id": "EWWFX2VWwh9F4KVnTcyttU5k7YGtZM5Txj7NG3SVp67i", "fee": 1000000, "feeAssetId": null, "timestamp": 1659217412988, "version": 2, "chainId": 84, "sender": "3N3rUp6mqXtgoQw3kSkKKxwfcnBFnzH661K", "senderPublicKey": "A6ci2Lvk61xfQkMZ2hB7YyLzF4AzUUC1m8n4qmSvBcuC", "proofs": [ "45eSEHgSzHBRUsVD23e7UsyE2z12qexjZMeKFF3opJRLEjxDkcqYdhAzVAAwafne5GaTxQncA5EnPEjUrK1tRZPR" ], "script": "base64:BgISCAISAwoBCBIFCgMICAgSABIADAAFd2F2ZXMAgMLXLwAOdGlja2V0UHJpY2VJbnQAwIQ9AAt0aWNrZXRQcmljZQUOdGlja2V0UHJpY2VJbnQABmludkZlZQCgwh4AEndpdGhkcmF3RmVlUGVyY2VudAAFABZmZWVDb2xsZWN0b3JBZGRyZXNzS2V5AhNmZWVDb2xsZWN0b3JBZGRyZXNzAQ10cnlHZXRJbnRlZ2VyAQNrZXkEByRtYXRjaDAJAJoIAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQBYgUHJG1hdGNoMAUBYgAAARJnZXRUaWNrZXRzQ291bnRLZXkBDWFkZHJlc3NTdHJpbmcJAKwCAgUNYWRkcmVzc1N0cmluZwINX3RpY2tldHNDb3VudAENZ2FtZVdpbm5lcktleQEGZ2FtZUlkCQCsAgIFBmdhbWVJZAIHX3dpbm5lcgEaYWRkcmVzc0F2YWlsYWJsZVJld2FyZHNLZXkBB2FkZHJlc3MJAKwCAgUHYWRkcmVzcwIRX2F2YWlsYWJsZVJld2FyZHMBD2dldFRpY2tldHNDb3VudAENYWR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dhcmRzBQR1bml0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFEGZlZUNvbGxlY3RvckFkZHIFC3dpdGhkcmF3RmVlBQR1bml0BQNuaWwBaQEKYnV5VGlja2V0cwAEA3BtdAMJAAACCQCQAwEIBQFpCHBheW1lbnRzAAEJAJEDAggFAWkIcGF5bWVudHMAAAkAAgECIVBsZWFzZSBhdHRhY2ggZXhhY3RseSBvbmUgcGF5bWVudAMJAQlpc0RlZmluZWQBCAUDcG10B2Fzc2V0SWQJAAIBAidUaWNrZXRzIGNhbiBvbmx5IGliZSBwdXJjaGFzZWQgaW4gV2F2ZXMDCQECIT0CCAUDcG10BmFtb3VudAULdGlja2V0UHJpY2UJAAIBCQCsAgIJAKwCAgIfVGhlIHBheW1lbnQgbXVzdCBiZSBvZiBleGFjdGx5IAkApAMBBQ50aWNrZXRQcmljZUludAIGIHdhdmVzBA1jYWxsZXJBZGRyU3RyCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEE2N1cnJlbnRUaWNrZXRzQ291bnQJAQ10cnlHZXRJbnRlZ2VyAQkBEmdldFRpY2tldHNDb3VudEtleQEFDWNhbGxlckFkZHJTdHIJAJQKAgkAzAgCCQEMSW50ZWdlckVudHJ5AgkBEmdldFRpY2tldHNDb3VudEtleQEFDWNhbGxlckFkZHJTdHIJAGQCBRNjdXJyZW50VGlja2V0c0NvdW50AAEFA25pbAABAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlefgRmbA=", "height": 2163109, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = 100000000 | |
5 | + | ||
6 | + | let b = 1000000 | |
7 | + | ||
8 | + | let c = b | |
9 | + | ||
10 | + | let d = 500000 | |
11 | + | ||
12 | + | let e = 5 | |
13 | + | ||
14 | + | let f = "feeCollectorAddress" | |
15 | + | ||
16 | + | func g (h) = { | |
17 | + | let i = getInteger(this, h) | |
18 | + | if ($isInstanceOf(i, "Int")) | |
19 | + | then { | |
20 | + | let j = i | |
21 | + | j | |
22 | + | } | |
23 | + | else 0 | |
24 | + | } | |
25 | + | ||
26 | + | ||
27 | + | func k (l) = (l + "_ticketsCount") | |
28 | + | ||
29 | + | ||
30 | + | func m (n) = (n + "_winner") | |
31 | + | ||
32 | + | ||
33 | + | func o (p) = (p + "_availableRewards") | |
34 | + | ||
35 | + | ||
36 | + | func q (l) = g(k(l)) | |
37 | + | ||
38 | + | ||
39 | + | func r (s) = { | |
40 | + | let t = q(s) | |
41 | + | let u = (t - 1) | |
42 | + | if ((0 > u)) | |
43 | + | then 0 | |
44 | + | else u | |
45 | + | } | |
46 | + | ||
47 | + | ||
48 | + | @Callable(v) | |
49 | + | func setFeeCollectorAddress (w) = if ((v.caller != this)) | |
50 | + | then throw("Admin Only") | |
51 | + | else [StringEntry(f, w)] | |
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | @Callable(v) | |
56 | + | func setWinnerHeadsUp (n,x,y) = if ((v.caller != this)) | |
57 | + | then throw("Admin Only") | |
58 | + | else { | |
59 | + | let z = o(x) | |
60 | + | let A = g(z) | |
61 | + | let B = r(x) | |
62 | + | let C = r(y) | |
63 | + | [StringEntry(m(n), x), IntegerEntry(z, (A + (c * 2))), IntegerEntry(k(x), B), IntegerEntry(k(y), C)] | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | @Callable(v) | |
69 | + | func withdrawRewards () = { | |
70 | + | let D = toBase58String(v.caller.bytes) | |
71 | + | let E = addressFromStringValue(getStringValue(f)) | |
72 | + | let A = g(o(D)) | |
73 | + | let F = fraction(A, e, 100) | |
74 | + | let G = ((A - d) - F) | |
75 | + | if ((0 >= A)) | |
76 | + | then throw("No available rewards to withdraw") | |
77 | + | else [IntegerEntry(o(D), 0), ScriptTransfer(v.caller, G, unit), ScriptTransfer(E, F, unit)] | |
78 | + | } | |
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | @Callable(v) | |
83 | + | func buyTickets () = { | |
84 | + | let H = if ((size(v.payments) == 1)) | |
85 | + | then v.payments[0] | |
86 | + | else throw("Please attach exactly one payment") | |
87 | + | if (isDefined(H.assetId)) | |
88 | + | then throw("Tickets can only ibe purchased in Waves") | |
89 | + | else if ((H.amount != c)) | |
90 | + | then throw((("The payment must be of exactly " + toString(b)) + " waves")) | |
91 | + | else { | |
92 | + | let D = toBase58String(v.caller.bytes) | |
93 | + | let I = g(k(D)) | |
94 | + | $Tuple2([IntegerEntry(k(D), (I + 1))], 1) | |
95 | + | } | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | @Verifier(J) | |
100 | + | func K () = sigVerify(J.bodyBytes, J.proofs[0], J.senderPublicKey) | |
101 | + |
github/deemru/w8io/026f985 21.16 ms ◑