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:AAIDAAAAAAAAAAAAAAAIAAAAAAdSVU5OSU5HAgAAAAdSVU5OSU5HAAAAAAZDTE9TRUQCAAAABkNMT1NFRAAAAAAIQ0FOQ0VMRUQCAAAACENBTkNFTEVEAAAAAAlEQVBQT1dORVICAAAAIzNNdVVuMnhVWkVMcG1uRWFIdkNDWjE2cHB3b25xU2ZEMVVEAAAAABBEQVBQQVVUSE9SV0FMTEVUAgAAACMzTkM3SzJEZmtya3BHSGZHaFN2b3NRblczcWNmYnNtUGZUVAAAAAAETk9ORQIAAAAETk9ORQEAAAALZ2V0TnVtQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0c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XN0XwkAAaQAAAABBQAAABFjb250ZXN0Q3Vyck51bWJlcgIAAAAKX21vdmllbmFtZQUAAAAEbmFtZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GBmPmOZc=", "chainId": 84, "height": 646872, "spentComplexity": 0 } View: original | compacted Prev: G5PSBQmHKn7GtBsjFyD2csr1eHZyXnQjMnAyMT4QMg7N Next: none Diff:
OldNewDifferences
6060 let pmt = extract(i.payment)
6161 let contestCurrNumber = getNumByKey("contest_currentnumber")
6262 let contestCurrStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
63- let contestBetCost = 10000000
63+ let contestBetCost = 25000000
6464 let contestGuessNumber = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber"))
6565 if ((contestCurrStatus != RUNNING))
6666 then throw(("Invalid status: you cannot bet now, contest status is: " + contestCurrStatus))
7474 let balance = wavesBalance(this)
7575 let toAuthor = ((balance * 5) / 100)
7676 let toWinner = ((balance * 94) / 100)
77- ScriptResult(WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + hashedName), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_winner"), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED)]), TransferSet([ScriptTransfer(extract(addressFromString(DAPPAUTHORWALLET)), toAuthor, unit), ScriptTransfer(extract(addressFromString(account)), toWinner, unit)]))
77+ ScriptResult(WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + hashedName), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_winner"), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_prize"), toWinner), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED)]), TransferSet([ScriptTransfer(extract(addressFromString(DAPPAUTHORWALLET)), toAuthor, unit), ScriptTransfer(extract(addressFromString(account)), toWinner, unit)]))
7878 }
7979 }
8080
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let RUNNING = "RUNNING"
55
66 let CLOSED = "CLOSED"
77
88 let CANCELED = "CANCELED"
99
1010 let DAPPOWNER = "3MuUn2xUZELpmnEaHvCCZ16ppwonqSfD1UD"
1111
1212 let DAPPAUTHORWALLET = "3NC7K2DfkrkpGHfGhSvosQnW3qcfbsmPfTT"
1313
1414 let NONE = "NONE"
1515
1616 func getNumByKey (key) = {
1717 let num = match getInteger(this, key) {
1818 case a: Int =>
1919 a
2020 case _ =>
2121 0
2222 }
2323 num
2424 }
2525
2626
2727 func getStrByKey (key) = {
2828 let str = match getString(this, key) {
2929 case a: String =>
3030 a
3131 case _ =>
3232 NONE
3333 }
3434 str
3535 }
3636
3737
3838 @Callable(i)
3939 func setContestConfiguration (name,image) = {
4040 let account = toBase58String(i.caller.bytes)
4141 let contestCurrNumber = getNumByKey("contest_currentnumber")
4242 let contestCurrStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
4343 let contestNewNumber = (contestCurrNumber + 1)
4444 let contestGuessNumber = 0
4545 let balance = wavesBalance(this)
4646 if ((account != DAPPOWNER))
4747 then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + account) + " dapp owner: ") + DAPPOWNER))
4848 else if ((contestCurrStatus == RUNNING))
4949 then throw(("You cannot configure a new Contest while old Contest status is: " + contestCurrStatus))
5050 else if ((500000000 > balance))
5151 then throw("Balance too low, cannot start a contest.")
5252 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)])
5353 }
5454
5555
5656
5757 @Callable(i)
5858 func bet (hashedName) = {
5959 let account = toBase58String(i.caller.bytes)
6060 let pmt = extract(i.payment)
6161 let contestCurrNumber = getNumByKey("contest_currentnumber")
6262 let contestCurrStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
63- let contestBetCost = 10000000
63+ let contestBetCost = 25000000
6464 let contestGuessNumber = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber"))
6565 if ((contestCurrStatus != RUNNING))
6666 then throw(("Invalid status: you cannot bet now, contest status is: " + contestCurrStatus))
6767 else if ((pmt.amount != contestBetCost))
6868 then throw(((("You must pay at least: " + toString(contestBetCost)) + " WAVES to bet. You paid: ") + toString(pmt.amount)))
6969 else if ((contestGuessNumber > 50))
7070 then throw("Sorry but the max number of guesses for this movie has been reached.")
7171 else if ((hashedName != getStrByKey((("contest_" + toString(contestCurrNumber)) + "_moviename"))))
7272 then WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + hashedName), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_contestguessnumber"), (contestGuessNumber + 1))])
7373 else {
7474 let balance = wavesBalance(this)
7575 let toAuthor = ((balance * 5) / 100)
7676 let toWinner = ((balance * 94) / 100)
77- ScriptResult(WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + hashedName), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_winner"), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED)]), TransferSet([ScriptTransfer(extract(addressFromString(DAPPAUTHORWALLET)), toAuthor, unit), ScriptTransfer(extract(addressFromString(account)), toWinner, unit)]))
77+ ScriptResult(WriteSet([DataEntry(((("guess_" + toString(contestCurrNumber)) + "_") + hashedName), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_winner"), account), DataEntry((("contest_" + toString(contestCurrNumber)) + "_prize"), toWinner), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), CLOSED)]), TransferSet([ScriptTransfer(extract(addressFromString(DAPPAUTHORWALLET)), toAuthor, unit), ScriptTransfer(extract(addressFromString(account)), toWinner, unit)]))
7878 }
7979 }
8080
8181
8282
8383 @Callable(i)
8484 func reveal (name) = {
8585 let account = toBase58String(i.caller.bytes)
8686 let contestCurrNumber = getNumByKey("contest_currentnumber")
8787 if ((account != DAPPOWNER))
8888 then throw(((("Only dAPP Owner can Reveal the movie namet. Caller account: " + account) + " dapp owner: ") + DAPPOWNER))
8989 else WriteSet([DataEntry((("contest_" + toString(contestCurrNumber)) + "_moviename"), name)])
9090 }
9191
9292
9393 @Verifier(tx)
9494 func verify () = match tx {
9595 case _: SetScriptTransaction|DataTransaction =>
9696 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
9797 case _: InvokeScriptTransaction =>
9898 true
9999 case _ =>
100100 true
101101 }
102102

github/deemru/w8io/169f3d6 
47.48 ms