tx · GHpH2Pr3BzzUUeagvePuuyKa7bv4UzohXxasNMYKjQzC 3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2: -0.01400000 Waves 2019.08.11 12:00 [626170] smart account 3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2 > SELF 0.00000000 Waves
{ "type": 13, "id": "GHpH2Pr3BzzUUeagvePuuyKa7bv4UzohXxasNMYKjQzC", "fee": 1400000, "feeAssetId": null, "timestamp": 1565513982122, "version": 1, "sender": "3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2", "senderPublicKey": "F3vhYapU4NBzfM2X4KNkoFcxj3UbYnJjqituG6KE7ZPG", "proofs": [ "2SRZvnezc5J7shMjVNYN8QnpsTUfuYxWCu7AK6boSwen7K4RzVtMGBzde62MG8RGEQHmFCA4TKAhbKNtDz35YTQF" ], "script": "base64:AAIDAAAAAAAAAAAAAAAIAAAAAAdSVU5OSU5HAgAAAAdSVU5OSU5HAAAAAAZDTE9TRUQCAAAABkNMT1NFRAAAAAAJREFQUE9XTkVSAgAAACMzTjROUGl2b1RodHNrcjdKeG5OcktMN3M4QnptUkd4OXJUMgAAAAAFV0FWRVMCAAAABVdBVkVTAAAAAAROT05FAgAAAAROT05FAQAAAAtnZXROdW1CeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAEGdldENvbnRlc3RTdGF0dXMAAAAABA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Y3VycmVuY3lWYWx1ZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GBlSub1A=", "chainId": 84, "height": 626170, "spentComplexity": 0 } View: original | compacted Prev: 85NzpGQw98mdFCUj2ZMfJmGdvd6b7QAKjBzGH7cAAEeX Next: 444cQjJ4rjJTwfZyY7RACgdndZhJY8UExxjrHAvvfANz Diff:
Old | New | Differences | |
---|---|---|---|
41 | 41 | ||
42 | 42 | func m () = { | |
43 | 43 | let n = f("contest_currentnumber") | |
44 | - | k((("contest_" + toString(n)) + "status")) | |
44 | + | k((("contest_" + toString(n)) + "_status")) | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
54 | 54 | then (q != b) | |
55 | 55 | else false) | |
56 | 56 | then throw(("Invalid status: " + q)) | |
57 | - | else WriteSet([DataEntry((("contest_" + toString(p)) + "status"), q)]) | |
57 | + | else WriteSet([DataEntry((("contest_" + toString(p)) + "_status"), q)]) | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
87 | 87 | let r = toBase58String(o.caller.bytes) | |
88 | 88 | let z = extract(o.payment) | |
89 | 89 | let n = f("contest_currentnumber") | |
90 | - | let t = f((("contest_" + toString(n)) + "startheight")) | |
91 | - | let w = f((("contest_" + toString(n)) + "finishheight")) | |
92 | - | let q = k((("contest_" + toString(n)) + "status")) | |
90 | + | let t = f((("contest_" + toString(n)) + "_startheight")) | |
91 | + | let w = f((("contest_" + toString(n)) + "_finishheight")) | |
92 | + | let q = k((("contest_" + toString(n)) + "_status")) | |
93 | 93 | if ((height > (w - (2 * 1440)))) | |
94 | 94 | then throw("You cannot bet anymore at this height.") | |
95 | 95 | else if ((q != a)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "RUNNING" | |
5 | 5 | ||
6 | 6 | let b = "CLOSED" | |
7 | 7 | ||
8 | 8 | let c = "3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2" | |
9 | 9 | ||
10 | 10 | let d = "WAVES" | |
11 | 11 | ||
12 | 12 | let e = "NONE" | |
13 | 13 | ||
14 | 14 | func f (g) = { | |
15 | 15 | let h = { | |
16 | 16 | let i = getInteger(this, g) | |
17 | 17 | if ($isInstanceOf(i, "Int")) | |
18 | 18 | then { | |
19 | 19 | let j = i | |
20 | 20 | j | |
21 | 21 | } | |
22 | 22 | else 0 | |
23 | 23 | } | |
24 | 24 | h | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func k (g) = { | |
29 | 29 | let l = { | |
30 | 30 | let i = getString(this, g) | |
31 | 31 | if ($isInstanceOf(i, "String")) | |
32 | 32 | then { | |
33 | 33 | let j = i | |
34 | 34 | j | |
35 | 35 | } | |
36 | 36 | else e | |
37 | 37 | } | |
38 | 38 | l | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func m () = { | |
43 | 43 | let n = f("contest_currentnumber") | |
44 | - | k((("contest_" + toString(n)) + "status")) | |
44 | + | k((("contest_" + toString(n)) + "_status")) | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | @Callable(o) | |
49 | 49 | func setContestStatus (p,q) = { | |
50 | 50 | let r = toBase58String(o.caller.bytes) | |
51 | 51 | if ((r != c)) | |
52 | 52 | then throw("Only dAPP Owner can set Contest Status.") | |
53 | 53 | else if (if ((q != a)) | |
54 | 54 | then (q != b) | |
55 | 55 | else false) | |
56 | 56 | then throw(("Invalid status: " + q)) | |
57 | - | else WriteSet([DataEntry((("contest_" + toString(p)) + "status"), q)]) | |
57 | + | else WriteSet([DataEntry((("contest_" + toString(p)) + "_status"), q)]) | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | 62 | @Callable(o) | |
63 | 63 | func setContestConfiguration (s,t) = { | |
64 | 64 | let r = toBase58String(o.caller.bytes) | |
65 | 65 | let u = f("contest_currentnumber") | |
66 | 66 | let v = k((("contest_" + toString(u)) + "_status")) | |
67 | 67 | let n = (u + 1) | |
68 | 68 | if ((r != c)) | |
69 | 69 | then throw("Only dAPP Owner can Configure Contest.") | |
70 | 70 | else if ((height >= t)) | |
71 | 71 | then throw(("Start Height must be greater than current Blockchain height: " + toString(height))) | |
72 | 72 | else if ((v == a)) | |
73 | 73 | then throw(("You cannot configure a new Contest while old Contest status is: " + v)) | |
74 | 74 | else if ((s != d)) | |
75 | 75 | then throw((("dAPP does not support currency: " + s) + " yet.")) | |
76 | 76 | else { | |
77 | 77 | let w = (t + (7 * 1440)) | |
78 | 78 | WriteSet([DataEntry("contest_currentnumber", n), DataEntry((("contest_" + toString(n)) + "_currency"), s), DataEntry((("contest_" + toString(n)) + "_startheight"), t), DataEntry((("contest_" + toString(n)) + "_finishheight"), w), DataEntry((("contest_" + toString(n)) + "_status"), a)]) | |
79 | 79 | } | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(o) | |
85 | 85 | func bet (x) = { | |
86 | 86 | let y = base58'2B3mWxfnhAaCpJuqbkbiD6HVCTEcgwdmzxFCjZe65NYg' | |
87 | 87 | let r = toBase58String(o.caller.bytes) | |
88 | 88 | let z = extract(o.payment) | |
89 | 89 | let n = f("contest_currentnumber") | |
90 | - | let t = f((("contest_" + toString(n)) + "startheight")) | |
91 | - | let w = f((("contest_" + toString(n)) + "finishheight")) | |
92 | - | let q = k((("contest_" + toString(n)) + "status")) | |
90 | + | let t = f((("contest_" + toString(n)) + "_startheight")) | |
91 | + | let w = f((("contest_" + toString(n)) + "_finishheight")) | |
92 | + | let q = k((("contest_" + toString(n)) + "_status")) | |
93 | 93 | if ((height > (w - (2 * 1440)))) | |
94 | 94 | then throw("You cannot bet anymore at this height.") | |
95 | 95 | else if ((q != a)) | |
96 | 96 | then throw("Invalid status: you cannot bet now.") | |
97 | 97 | else if (if ((z.assetId != y)) | |
98 | 98 | then true | |
99 | 99 | else (z.amount != 500000)) | |
100 | 100 | then throw("You must pay 5 WLT to bet.") | |
101 | 101 | else WriteSet([DataEntry(((("bet_" + toString(n)) + "_") + r), x)]) | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | @Verifier(A) | |
106 | 106 | func B () = { | |
107 | 107 | let i = A | |
108 | 108 | if (if ($isInstanceOf(i, "SetScriptTransaction")) | |
109 | 109 | then true | |
110 | 110 | else $isInstanceOf(i, "DataTransaction")) | |
111 | 111 | then sigVerify(A.bodyBytes, A.proofs[0], A.senderPublicKey) | |
112 | 112 | else if ($isInstanceOf(i, "InvokeScriptTransaction")) | |
113 | 113 | then true | |
114 | 114 | else true | |
115 | 115 | } | |
116 | 116 |
github/deemru/w8io/169f3d6 33.53 ms ◑