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