tx · ErYZ112buUqZKXyCPz9s8ciisX1nCsxDf1w5DntQ8xYv 3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD: -0.01400000 Waves 2019.08.25 18:37 [646872] smart account 3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD > SELF 0.00000000 Waves
{ "type": 13, "id": "ErYZ112buUqZKXyCPz9s8ciisX1nCsxDf1w5DntQ8xYv", "fee": 1400000, "feeAssetId": null, "timestamp": 1566747481058, "version": 1, "sender": "3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD", "senderPublicKey": "FEngg164m8DD6zconE15dGjmW7DN4axV4voE3CMUvwFp", "proofs": [ "4jgZHR8mpk9BWputSdX3z2rMtDVdsYn57aHVGUVr1HL261YZomoJMy5EKeiE3L9X86xX9CpQLtb5hTRg4kdgVnvf" ], "script": "base64:AAIDAAAAAAAAAAAAAAAIAAAAAAdSVU5OSU5HAgAAAAdSVU5OSU5HAAAAAAZDTE9TRUQCAAAABkNMT1NFRAAAAAAIQ0FOQ0VMRUQCAAAACENBTkNFTEVEAAAAAAlEQVBQT1dORVICAAAAIzNNdVVuMnhVWkVMcG1uRWFIdkNDWjE2cHB3b25xU2ZEMVVEAAAAABBEQVBQQVVUSE9SV0FMTEVUAgAAACMzTkM3SzJEZmtya3BHSGZHaFN2b3NRblczcWNmYnNtUGZUVAAAAAAETk9ORQIAAAAETk9ORQEAAAALZ2V0TnVtQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cm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N0XwkAAaQAAAABBQAAABFjb250ZXN0Q3Vyck51bWJlcgIAAAAKX21vdmllbmFtZQUAAAAEbmFtZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GBmPmOZc=", "chainId": 84, "height": 646872, "spentComplexity": 0 } View: original | compacted Prev: G5PSBQmHKn7GtBsjFyD2csr1eHZyXnQjMnAyMT4QMg7N Next: none Diff:
Old | New | Differences | |
---|---|---|---|
66 | 66 | let x = extract(n.payment) | |
67 | 67 | let r = g("contest_currentnumber") | |
68 | 68 | let s = l((("contest_" + toString(r)) + "_status")) | |
69 | - | let y = | |
69 | + | let y = 25000000 | |
70 | 70 | let u = g((("contest_" + toString(r)) + "_contestguessnumber")) | |
71 | 71 | if ((s != a)) | |
72 | 72 | then throw(("Invalid status: you cannot bet now, contest status is: " + s)) | |
80 | 80 | let v = wavesBalance(this) | |
81 | 81 | let z = ((v * 5) / 100) | |
82 | 82 | let A = ((v * 94) / 100) | |
83 | - | ScriptResult(WriteSet([DataEntry(((("guess_" + toString(r)) + "_") + w), q), DataEntry((("contest_" + toString(r)) + "_winner"), q), DataEntry((("contest_" + toString(r)) + "_status"), b)]), TransferSet([ScriptTransfer(extract(addressFromString(e)), z, unit), ScriptTransfer(extract(addressFromString(q)), A, unit)])) | |
83 | + | ScriptResult(WriteSet([DataEntry(((("guess_" + toString(r)) + "_") + w), q), DataEntry((("contest_" + toString(r)) + "_winner"), q), DataEntry((("contest_" + toString(r)) + "_prize"), A), DataEntry((("contest_" + toString(r)) + "_status"), b)]), TransferSet([ScriptTransfer(extract(addressFromString(e)), z, unit), ScriptTransfer(extract(addressFromString(q)), A, unit)])) | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 |
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 = "CANCELED" | |
9 | 9 | ||
10 | 10 | let d = "3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD" | |
11 | 11 | ||
12 | 12 | let e = "3NC7K2DfkrkpGHfGhSvosQnW3qcfbsmPfTT" | |
13 | 13 | ||
14 | 14 | let f = "NONE" | |
15 | 15 | ||
16 | 16 | func g (h) = { | |
17 | 17 | let i = { | |
18 | 18 | let j = getInteger(this, h) | |
19 | 19 | if ($isInstanceOf(j, "Int")) | |
20 | 20 | then { | |
21 | 21 | let k = j | |
22 | 22 | k | |
23 | 23 | } | |
24 | 24 | else 0 | |
25 | 25 | } | |
26 | 26 | i | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func l (h) = { | |
31 | 31 | let m = { | |
32 | 32 | let j = getString(this, h) | |
33 | 33 | if ($isInstanceOf(j, "String")) | |
34 | 34 | then { | |
35 | 35 | let k = j | |
36 | 36 | k | |
37 | 37 | } | |
38 | 38 | else f | |
39 | 39 | } | |
40 | 40 | m | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(n) | |
45 | 45 | func setContestConfiguration (o,p) = { | |
46 | 46 | let q = toBase58String(n.caller.bytes) | |
47 | 47 | let r = g("contest_currentnumber") | |
48 | 48 | let s = l((("contest_" + toString(r)) + "_status")) | |
49 | 49 | let t = (r + 1) | |
50 | 50 | let u = 0 | |
51 | 51 | let v = wavesBalance(this) | |
52 | 52 | if ((q != d)) | |
53 | 53 | then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + q) + " dapp owner: ") + d)) | |
54 | 54 | else if ((s == a)) | |
55 | 55 | then throw(("You cannot configure a new Contest while old Contest status is: " + s)) | |
56 | 56 | else if ((500000000 > v)) | |
57 | 57 | then throw("Balance too low, cannot start a contest.") | |
58 | 58 | else WriteSet([DataEntry("contest_currentnumber", t), DataEntry((("contest_" + toString(t)) + "_status"), a), DataEntry((("contest_" + toString(t)) + "_contestguessnumber"), 0), DataEntry((("contest_" + toString(t)) + "_moviename"), o), DataEntry((("contest_" + toString(t)) + "_movieimage"), p)]) | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(n) | |
64 | 64 | func bet (w) = { | |
65 | 65 | let q = toBase58String(n.caller.bytes) | |
66 | 66 | let x = extract(n.payment) | |
67 | 67 | let r = g("contest_currentnumber") | |
68 | 68 | let s = l((("contest_" + toString(r)) + "_status")) | |
69 | - | let y = | |
69 | + | let y = 25000000 | |
70 | 70 | let u = g((("contest_" + toString(r)) + "_contestguessnumber")) | |
71 | 71 | if ((s != a)) | |
72 | 72 | then throw(("Invalid status: you cannot bet now, contest status is: " + s)) | |
73 | 73 | else if ((x.amount != y)) | |
74 | 74 | then throw(((("You must pay at least: " + toString(y)) + " WAVES to bet. You paid: ") + toString(x.amount))) | |
75 | 75 | else if ((u > 50)) | |
76 | 76 | then throw("Sorry but the max number of guesses for this movie has been reached.") | |
77 | 77 | else if ((w != l((("contest_" + toString(r)) + "_moviename")))) | |
78 | 78 | then WriteSet([DataEntry(((("guess_" + toString(r)) + "_") + w), q), DataEntry((("contest_" + toString(r)) + "_contestguessnumber"), (u + 1))]) | |
79 | 79 | else { | |
80 | 80 | let v = wavesBalance(this) | |
81 | 81 | let z = ((v * 5) / 100) | |
82 | 82 | let A = ((v * 94) / 100) | |
83 | - | ScriptResult(WriteSet([DataEntry(((("guess_" + toString(r)) + "_") + w), q), DataEntry((("contest_" + toString(r)) + "_winner"), q), DataEntry((("contest_" + toString(r)) + "_status"), b)]), TransferSet([ScriptTransfer(extract(addressFromString(e)), z, unit), ScriptTransfer(extract(addressFromString(q)), A, unit)])) | |
83 | + | ScriptResult(WriteSet([DataEntry(((("guess_" + toString(r)) + "_") + w), q), DataEntry((("contest_" + toString(r)) + "_winner"), q), DataEntry((("contest_" + toString(r)) + "_prize"), A), DataEntry((("contest_" + toString(r)) + "_status"), b)]), TransferSet([ScriptTransfer(extract(addressFromString(e)), z, unit), ScriptTransfer(extract(addressFromString(q)), A, unit)])) | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(n) | |
90 | 90 | func reveal (o) = { | |
91 | 91 | let q = toBase58String(n.caller.bytes) | |
92 | 92 | let r = g("contest_currentnumber") | |
93 | 93 | if ((q != d)) | |
94 | 94 | then throw(((("Only dAPP Owner can Reveal the movie namet. Caller account: " + q) + " dapp owner: ") + d)) | |
95 | 95 | else WriteSet([DataEntry((("contest_" + toString(r)) + "_moviename"), o)]) | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Verifier(B) | |
100 | 100 | func C () = { | |
101 | 101 | let j = B | |
102 | 102 | if (if ($isInstanceOf(j, "SetScriptTransaction")) | |
103 | 103 | then true | |
104 | 104 | else $isInstanceOf(j, "DataTransaction")) | |
105 | 105 | then sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey) | |
106 | 106 | else if ($isInstanceOf(j, "InvokeScriptTransaction")) | |
107 | 107 | then true | |
108 | 108 | else true | |
109 | 109 | } | |
110 | 110 |
github/deemru/w8io/169f3d6 313.33 ms ◑