tx · 5dSdrWBpDMejPM511A4wjbiQ6MX7uMFfQSMWDQSfjvc1 3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD: -0.01400000 Waves 2019.08.22 15:39 [642333] smart account 3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD > SELF 0.00000000 Waves
{ "type": 13, "id": "5dSdrWBpDMejPM511A4wjbiQ6MX7uMFfQSMWDQSfjvc1", "fee": 1400000, "feeAssetId": null, "timestamp": 1566477633126, "version": 1, "sender": "3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD", "senderPublicKey": "FEngg164m8DD6zconE15dGjmW7DN4axV4voE3CMUvwFp", "proofs": [ "2yzvZN1Udg22sizfTkrJfrprY1pPywKUFDr9cYdSsDi5ackEU6WP3d6bB3SZzmHv43st7MtQvAiGzNNyvPKRvjK2" ], "script": "base64:AAIDAAAAAAAAAAAAAAAIAAAAAAdSVU5OSU5HAgAAAAdSVU5OSU5HAAAAAAZDTE9TRUQCAAAABkNMT1NFRAAAAAAIQ0FOQ0VMRUQCAAAACENBTkNFTEVEAAAAAAlEQVBQT1dORVICAAAAIzNNdVVuMnhVWkVMcG1uRWFIdkNDWjE2cHB3b25xU2ZEMVVEAAAAABBEQVBQQVVUSE9SV0FMTEVUAgAAACMzTkM3SzJEZmtya3BHSGZHaFN2b3NRblczcWNmYnNtUGZUVAAAAAAETk9ORQIAAAAETk9ORQEAAAALZ2V0TnVtQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN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AAAwkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABBQAAABBEQVBQQVVUSE9SV0FMTEVUBQAAAAh0b0F1dGhvcgUAAAAEdW5pdAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHZXh0cmFjdAAAAAEJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAEFAAAAB2FjY291bnQFAAAACHRvV2lubmVyBQAAAAR1bml0BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBgkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24JAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgYGCdfL6Q==", "chainId": 84, "height": 642333, "spentComplexity": 0 } View: original | compacted Prev: 4qYUi65BypCGYz5k881iGehJwddykJp5viv2N3VS53Es Next: GuTKWXYSEkRe86P8TGnxdyavpTzj8DsRuXFiEAktSP5Q Diff:
Old | New | Differences | |
---|---|---|---|
61 | 61 | let contestCurrNumber = getNumByKey("contest_currentnumber") | |
62 | 62 | let contestCurrStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status")) | |
63 | 63 | let contestBetCost = 10000000 | |
64 | + | let contestGuessNumber = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber")) | |
64 | 65 | if ((contestCurrStatus != RUNNING)) | |
65 | 66 | then throw(("Invalid status: you cannot bet now, contest status is: " + contestCurrStatus)) | |
66 | 67 | else if ((pmt.amount != contestBetCost)) | |
67 | 68 | then throw(((("You must pay at least: " + toString(contestBetCost)) + " WAVES to bet. You paid: ") + toString(pmt.amount))) | |
68 | - | else if (( | |
69 | + | else if ((contestGuessNumber > 50)) | |
69 | 70 | then throw("Sorry but the max number of guesses for this movie has been reached.") | |
70 | 71 | else if ((name != getStrByKey((("contest_" + toString(contestCurrNumber)) + "_moviename")))) | |
71 | 72 | then if ((getNumByKey((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber")) >= 50)) | |
72 | - | then WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account), DataEntry(((("winner_" + toString(contestCurrNumber)) + "_") + name), NONE), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED), DataEntry((("contest_" + toString(contestCurrNumber)) + "_reveal"), true)]) | |
73 | - | else WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account)]) | |
73 | + | then WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account), DataEntry(((("winner_" + toString(contestCurrNumber)) + "_") + name), NONE), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED), DataEntry((("contest_" + toString(contestCurrNumber)) + "_reveal"), true), DataEntry((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber"), (contestGuessNumber + 1))]) | |
74 | + | else WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber"), (contestGuessNumber + 1))]) | |
74 | 75 | else { | |
75 | 76 | let balance = wavesBalance(this) | |
76 | 77 | let toAuthor = ((balance * 5) / 100) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RUNNING = "RUNNING" | |
5 | 5 | ||
6 | 6 | let CLOSED = "CLOSED" | |
7 | 7 | ||
8 | 8 | let CANCELED = "CANCELED" | |
9 | 9 | ||
10 | 10 | let DAPPOWNER = "3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD" | |
11 | 11 | ||
12 | 12 | let DAPPAUTHORWALLET = "3NC7K2DfkrkpGHfGhSvosQnW3qcfbsmPfTT" | |
13 | 13 | ||
14 | 14 | let NONE = "NONE" | |
15 | 15 | ||
16 | 16 | func getNumByKey (key) = { | |
17 | 17 | let num = match getInteger(this, key) { | |
18 | 18 | case a: Int => | |
19 | 19 | a | |
20 | 20 | case _ => | |
21 | 21 | 0 | |
22 | 22 | } | |
23 | 23 | num | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getStrByKey (key) = { | |
28 | 28 | let str = match getString(this, key) { | |
29 | 29 | case a: String => | |
30 | 30 | a | |
31 | 31 | case _ => | |
32 | 32 | NONE | |
33 | 33 | } | |
34 | 34 | str | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Callable(i) | |
39 | 39 | func setContestConfiguration (name,image) = { | |
40 | 40 | let account = toBase58String(i.caller.bytes) | |
41 | 41 | let contestCurrNumber = getNumByKey("contest_currentnumber") | |
42 | 42 | let contestCurrStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status")) | |
43 | 43 | let contestNewNumber = (contestCurrNumber + 1) | |
44 | 44 | let contestGuessNumber = 0 | |
45 | 45 | let balance = wavesBalance(this) | |
46 | 46 | if ((account != DAPPOWNER)) | |
47 | 47 | then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + account) + " dapp owner: ") + DAPPOWNER)) | |
48 | 48 | else if ((contestCurrStatus == RUNNING)) | |
49 | 49 | then throw(("You cannot configure a new Contest while old Contest status is: " + contestCurrStatus)) | |
50 | 50 | else if ((500000000 > balance)) | |
51 | 51 | then throw("Balance too low, cannot start a contest.") | |
52 | 52 | else WriteSet([DataEntry("contest_currentnumber", contestNewNumber), DataEntry((("contest_" + toString(contestNewNumber)) + "_status"), RUNNING), DataEntry((("contest_" + toString(contestNewNumber)) + "_contestguessnumber"), 0), DataEntry((("contest_" + toString(contestNewNumber)) + "_moviename"), name), DataEntry((("contest_" + toString(contestNewNumber)) + "_movieimage"), image)]) | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(i) | |
58 | 58 | func bet (name) = { | |
59 | 59 | let account = toBase58String(i.caller.bytes) | |
60 | 60 | let pmt = extract(i.payment) | |
61 | 61 | let contestCurrNumber = getNumByKey("contest_currentnumber") | |
62 | 62 | let contestCurrStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status")) | |
63 | 63 | let contestBetCost = 10000000 | |
64 | + | let contestGuessNumber = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber")) | |
64 | 65 | if ((contestCurrStatus != RUNNING)) | |
65 | 66 | then throw(("Invalid status: you cannot bet now, contest status is: " + contestCurrStatus)) | |
66 | 67 | else if ((pmt.amount != contestBetCost)) | |
67 | 68 | then throw(((("You must pay at least: " + toString(contestBetCost)) + " WAVES to bet. You paid: ") + toString(pmt.amount))) | |
68 | - | else if (( | |
69 | + | else if ((contestGuessNumber > 50)) | |
69 | 70 | then throw("Sorry but the max number of guesses for this movie has been reached.") | |
70 | 71 | else if ((name != getStrByKey((("contest_" + toString(contestCurrNumber)) + "_moviename")))) | |
71 | 72 | then if ((getNumByKey((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber")) >= 50)) | |
72 | - | then WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account), DataEntry(((("winner_" + toString(contestCurrNumber)) + "_") + name), NONE), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED), DataEntry((("contest_" + toString(contestCurrNumber)) + "_reveal"), true)]) | |
73 | - | else WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account)]) | |
73 | + | then WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account), DataEntry(((("winner_" + toString(contestCurrNumber)) + "_") + name), NONE), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED), DataEntry((("contest_" + toString(contestCurrNumber)) + "_reveal"), true), DataEntry((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber"), (contestGuessNumber + 1))]) | |
74 | + | else WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber"), (contestGuessNumber + 1))]) | |
74 | 75 | else { | |
75 | 76 | let balance = wavesBalance(this) | |
76 | 77 | let toAuthor = ((balance * 5) / 100) | |
77 | 78 | let toWinner = ((balance * 94) / 100) | |
78 | 79 | ScriptResult(WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + name), account), DataEntry(((("winner_" + toString(contestCurrNumber)) + "_") + name), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED)]), TransferSet([ScriptTransfer(extract(addressFromString(DAPPAUTHORWALLET)), toAuthor, unit), ScriptTransfer(extract(addressFromString(account)), toWinner, unit)])) | |
79 | 80 | } | |
80 | 81 | } | |
81 | 82 | ||
82 | 83 | ||
83 | 84 | @Verifier(tx) | |
84 | 85 | func verify () = match tx { | |
85 | 86 | case _: SetScriptTransaction|DataTransaction => | |
86 | 87 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
87 | 88 | case _: InvokeScriptTransaction => | |
88 | 89 | true | |
89 | 90 | case _ => | |
90 | 91 | true | |
91 | 92 | } | |
92 | 93 |
github/deemru/w8io/169f3d6 66.00 ms ◑