tx · 5G26X7xFnuNSCgHXBMCV13U336oF6EHSUsRoC3zB8esf 3Mso4SkQZqP8xKHMq7AJJjexAU6L2McSfbx: -0.01000000 Waves 2022.07.31 02:50 [2163239] smart account 3Mso4SkQZqP8xKHMq7AJJjexAU6L2McSfbx > SELF 0.00000000 Waves
{ "type": 13, "id": "5G26X7xFnuNSCgHXBMCV13U336oF6EHSUsRoC3zB8esf", "fee": 1000000, "feeAssetId": null, "timestamp": 1659225020800, "version": 2, "chainId": 84, "sender": "3Mso4SkQZqP8xKHMq7AJJjexAU6L2McSfbx", "senderPublicKey": "APom8FtYuLDXUGnjz1mwLh3uzsFwxRTQGDwi3LowpCBY", "proofs": [ "45JLAd6yKnSgLdX5gqSFkckspSuuRq2KGjGSTf3FtpEA7MVXEdM8QY7LjhwEGFtmRhdUfQjq5W6wJpz8YX6ybRvr" ], "script": "base64:BgIjCAISAwoBCBIAEgUKAwgIARIECgIIARIAEgUKAwgICBIAEgAPAAV3YXZlcwCAwtcvAA50aWNrZXRQcmljZUludADAhD0AC3RpY2tldFByaWNlBQ50aWNrZXRQcmljZUludAAGaW52RmVlAKDCHgASd2l0aGRyYXdGZWVQZXJjZW50AAUAFmZlZUNvbGxlY3RvckFkZHJlc3NLZXkCE2ZlZUNvbGxlY3RvckFkZHJlc3MBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAABEmdldFRpY2tldHNDb3VudEtleQENYWRkcmVzc1N0cmluZwkArAICBQ1hZGRyZXNzU3RyaW5nAg1fdGlja2V0c0NvdW50AQ1nYW1lV2lubmVyS2V5AQZnYW1lSWQJAKwCAgUGZ2FtZUlkAgdfd2lubmVyARhhZGRyZXNzQXZhaWxhYmxlRnVuZHNLZXkBB2FkZHJlc3MJAKwCAgUHYWRkcmVzcwIPX2F2YWlsYWJsZUZ1bmRzARphZGRyZXNzVG90YWxMb2NrZW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BdmFpbGFibGVSZXdhcmRzBQR1bml0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFEGZlZUNvbGxlY3RvckFkZHIFC3dpdGhkcmF3RmVlBQR1bml0BQNuaWwBaQEKYnV5VGlja2V0cwAEA3BtdAMJAAACCQCQAwEIBQFpCHBheW1lbnRzAAEJAJEDAggFAWkIcGF5bWVudHMAAAkAAgECIVBsZWFzZSBhdHRhY2ggZXhhY3RseSBvbmUgcGF5bWVudAMJAQlpc0RlZmluZWQBCAUDcG10B2Fzc2V0SWQJAAIBAidUaWNrZXRzIGNhbiBvbmx5IGliZSBwdXJjaGFzZWQgaW4gV2F2ZXMDCQECIT0CCAUDcG10BmFtb3VudAULdGlja2V0UHJpY2UJAAIBCQCsAgIJAKwCAgIfVGhlIHBheW1lbnQgbXVzdCBiZSBvZiBleGFjdGx5IAkApAMBBQ50aWNrZXRQcmljZUludAIGIHdhdmVzBA1jYWxsZXJBZGRyU3RyCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEE2N1cnJlbnRUaWNrZXRzQ291bnQJAQ10cnlHZXRJbnRlZ2VyAQkBEmdldFRpY2tldHNDb3VudEtleQEFDWNhbGxlckFkZHJTdHIJAJQKAgkAzAgCCQEMSW50ZWdlckVudHJ5AgkBEmdldFRpY2tldHNDb3VudEtleQEFDWNhbGxlckFkZHJTdHIJAGQCBRNjdXJyZW50VGlja2V0c0NvdW50AAEFA25pbAABAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleZjeCqA=", "height": 2163239, "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 + "_availableFunds") | |
34 | + | ||
35 | + | ||
36 | + | func q (p) = (p + "_totalLockedFunds") | |
37 | + | ||
38 | + | ||
39 | + | func r (p,n) = ((p + "_lockedFunds_") + n) | |
40 | + | ||
41 | + | ||
42 | + | func s (p) = (p + "_availableRewards") | |
43 | + | ||
44 | + | ||
45 | + | func t (l) = g(k(l)) | |
46 | + | ||
47 | + | ||
48 | + | func u (v) = { | |
49 | + | let w = t(v) | |
50 | + | let x = (w - 1) | |
51 | + | if ((0 > x)) | |
52 | + | then 0 | |
53 | + | else x | |
54 | + | } | |
55 | + | ||
56 | + | ||
57 | + | @Callable(y) | |
58 | + | func setFeeCollectorAddress (z) = if ((y.caller != this)) | |
59 | + | then throw("Admin Only") | |
60 | + | else [StringEntry(f, z)] | |
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | @Callable(y) | |
65 | + | func depositFunds () = { | |
66 | + | let A = if ((size(y.payments) == 1)) | |
67 | + | then y.payments[0] | |
68 | + | else throw("Please attach exactly one payment") | |
69 | + | if (isDefined(A.assetId)) | |
70 | + | then throw("You can only deposit USDN") | |
71 | + | else { | |
72 | + | let B = toBase58String(y.caller.bytes) | |
73 | + | $Tuple2([IntegerEntry(o(B), A.amount)], 1) | |
74 | + | } | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | @Callable(y) | |
80 | + | func playerExitGame (n,v,C) = if ((y.caller != this)) | |
81 | + | then throw("Admin Only") | |
82 | + | else { | |
83 | + | let D = g(q(v)) | |
84 | + | let E = g(o(v)) | |
85 | + | let F = g(r(v, n)) | |
86 | + | $Tuple2([IntegerEntry(o(v), (E + C)), IntegerEntry(q(v), (D - F))], 1) | |
87 | + | } | |
88 | + | ||
89 | + | ||
90 | + | ||
91 | + | @Callable(y) | |
92 | + | func lockFundsForGame (n,G) = { | |
93 | + | let B = toBase58String(y.caller.bytes) | |
94 | + | let E = g(o(B)) | |
95 | + | let D = g(q(B)) | |
96 | + | if ((G > E)) | |
97 | + | then throw("Not enough available funds to lock") | |
98 | + | else $Tuple2([IntegerEntry(o(B), (E - G)), IntegerEntry(q(B), (D + G)), IntegerEntry(r(B, n), G)], 1) | |
99 | + | } | |
100 | + | ||
101 | + | ||
102 | + | ||
103 | + | @Callable(y) | |
104 | + | func withdrawFunds () = { | |
105 | + | let B = toBase58String(y.caller.bytes) | |
106 | + | let H = addressFromStringValue(getStringValue(f)) | |
107 | + | let E = g(o(B)) | |
108 | + | let I = fraction(E, e, 100) | |
109 | + | let J = (E - I) | |
110 | + | if ((0 >= J)) | |
111 | + | then throw("No available funds to withdraw") | |
112 | + | else [IntegerEntry(o(B), 0), ScriptTransfer(y.caller, J, unit), ScriptTransfer(H, I, unit)] | |
113 | + | } | |
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | @Callable(y) | |
118 | + | func setWinnerHeadsUp (n,K,L) = if ((y.caller != this)) | |
119 | + | then throw("Admin Only") | |
120 | + | else { | |
121 | + | let M = s(K) | |
122 | + | let N = g(M) | |
123 | + | let O = u(K) | |
124 | + | let P = u(L) | |
125 | + | [StringEntry(m(n), K), IntegerEntry(M, (N + (c * 2))), IntegerEntry(k(K), O), IntegerEntry(k(L), P)] | |
126 | + | } | |
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | @Callable(y) | |
131 | + | func withdrawRewards () = { | |
132 | + | let B = toBase58String(y.caller.bytes) | |
133 | + | let H = addressFromStringValue(getStringValue(f)) | |
134 | + | let N = g(s(B)) | |
135 | + | let I = fraction(N, e, 100) | |
136 | + | let Q = ((N - d) - I) | |
137 | + | if ((0 >= N)) | |
138 | + | then throw("No available rewards to withdraw") | |
139 | + | else [IntegerEntry(s(B), 0), ScriptTransfer(y.caller, Q, unit), ScriptTransfer(H, I, unit)] | |
140 | + | } | |
141 | + | ||
142 | + | ||
143 | + | ||
144 | + | @Callable(y) | |
145 | + | func buyTickets () = { | |
146 | + | let A = if ((size(y.payments) == 1)) | |
147 | + | then y.payments[0] | |
148 | + | else throw("Please attach exactly one payment") | |
149 | + | if (isDefined(A.assetId)) | |
150 | + | then throw("Tickets can only ibe purchased in Waves") | |
151 | + | else if ((A.amount != c)) | |
152 | + | then throw((("The payment must be of exactly " + toString(b)) + " waves")) | |
153 | + | else { | |
154 | + | let B = toBase58String(y.caller.bytes) | |
155 | + | let R = g(k(B)) | |
156 | + | $Tuple2([IntegerEntry(k(B), (R + 1))], 1) | |
157 | + | } | |
158 | + | } | |
159 | + | ||
160 | + | ||
161 | + | @Verifier(S) | |
162 | + | func T () = sigVerify(S.bodyBytes, S.proofs[0], S.senderPublicKey) | |
163 | + |
github/deemru/w8io/169f3d6 19.17 ms ◑