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:AAIDAAAAAAAAAAAAAAAIAAAAAAdSVU5OSU5HAgAAAAdSVU5OSU5HAAAAAAZDTE9TRUQCAAAABkNMT1NFRAAAAAAJREFQUE9XTkVSAgAAACMzTjROUGl2b1RodHNrcjdKeG5OcktMN3M4QnptUkd4OXJUMgAAAAAFV0FWRVMCAAAABVdBVkVTAAAAAAROT05FAgAAAAROT05FAQAAAAtnZXROdW1CeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAEGdldENvbnRlc3RTdGF0dXMAAAAAB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ANY3VycmVuY3lWYWx1ZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GBlSub1A=", "chainId": 84, "height": 626170, "spentComplexity": 0 } View: original | compacted Prev: 85NzpGQw98mdFCUj2ZMfJmGdvd6b7QAKjBzGH7cAAEeX Next: 444cQjJ4rjJTwfZyY7RACgdndZhJY8UExxjrHAvvfANz Diff:
OldNewDifferences
3535
3636 func getContestStatus () = {
3737 let contestCurrNumber = getNumByKey("contest_currentnumber")
38- getStrByKey((("contest_" + toString(contestCurrNumber)) + "status"))
38+ getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
3939 }
4040
4141
4848 then (contestStatus != CLOSED)
4949 else false)
5050 then throw(("Invalid status: " + contestStatus))
51- else WriteSet([DataEntry((("contest_" + toString(contestNumber)) + "status"), contestStatus)])
51+ else WriteSet([DataEntry((("contest_" + toString(contestNumber)) + "_status"), contestStatus)])
5252 }
5353
5454
8181 let account = toBase58String(i.caller.bytes)
8282 let pmt = extract(i.payment)
8383 let contestCurrNumber = getNumByKey("contest_currentnumber")
84- let contestStartHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "startheight"))
85- let contestFinishHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "finishheight"))
86- let contestStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "status"))
84+ let contestStartHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_startheight"))
85+ let contestFinishHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_finishheight"))
86+ let contestStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
8787 if ((height > (contestFinishHeight - (2 * 1440))))
8888 then throw("You cannot bet anymore at this height.")
8989 else if ((contestStatus != RUNNING))
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 DAPPOWNER = "3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2"
99
1010 let WAVES = "WAVES"
1111
1212 let NONE = "NONE"
1313
1414 func getNumByKey (key) = {
1515 let num = match getInteger(this, key) {
1616 case a: Int =>
1717 a
1818 case _ =>
1919 0
2020 }
2121 num
2222 }
2323
2424
2525 func getStrByKey (key) = {
2626 let str = match getString(this, key) {
2727 case a: String =>
2828 a
2929 case _ =>
3030 NONE
3131 }
3232 str
3333 }
3434
3535
3636 func getContestStatus () = {
3737 let contestCurrNumber = getNumByKey("contest_currentnumber")
38- getStrByKey((("contest_" + toString(contestCurrNumber)) + "status"))
38+ getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
3939 }
4040
4141
4242 @Callable(i)
4343 func setContestStatus (contestNumber,contestStatus) = {
4444 let account = toBase58String(i.caller.bytes)
4545 if ((account != DAPPOWNER))
4646 then throw("Only dAPP Owner can set Contest Status.")
4747 else if (if ((contestStatus != RUNNING))
4848 then (contestStatus != CLOSED)
4949 else false)
5050 then throw(("Invalid status: " + contestStatus))
51- else WriteSet([DataEntry((("contest_" + toString(contestNumber)) + "status"), contestStatus)])
51+ else WriteSet([DataEntry((("contest_" + toString(contestNumber)) + "_status"), contestStatus)])
5252 }
5353
5454
5555
5656 @Callable(i)
5757 func setContestConfiguration (currencyTicker,contestStartHeight) = {
5858 let account = toBase58String(i.caller.bytes)
5959 let contestPrevNumber = getNumByKey("contest_currentnumber")
6060 let contestPrevStatus = getStrByKey((("contest_" + toString(contestPrevNumber)) + "_status"))
6161 let contestCurrNumber = (contestPrevNumber + 1)
6262 if ((account != DAPPOWNER))
6363 then throw("Only dAPP Owner can Configure Contest.")
6464 else if ((height >= contestStartHeight))
6565 then throw(("Start Height must be greater than current Blockchain height: " + toString(height)))
6666 else if ((contestPrevStatus == RUNNING))
6767 then throw(("You cannot configure a new Contest while old Contest status is: " + contestPrevStatus))
6868 else if ((currencyTicker != WAVES))
6969 then throw((("dAPP does not support currency: " + currencyTicker) + " yet."))
7070 else {
7171 let contestFinishHeight = (contestStartHeight + (7 * 1440))
7272 WriteSet([DataEntry("contest_currentnumber", contestCurrNumber), DataEntry((("contest_" + toString(contestCurrNumber)) + "_currency"), currencyTicker), DataEntry((("contest_" + toString(contestCurrNumber)) + "_startheight"), contestStartHeight), DataEntry((("contest_" + toString(contestCurrNumber)) + "_finishheight"), contestFinishHeight), DataEntry((("contest_" + toString(contestCurrNumber)) + "_status"), RUNNING)])
7373 }
7474 }
7575
7676
7777
7878 @Callable(i)
7979 func bet (currencyValue) = {
8080 let WLT = base58'2B3mWxfnhAaCpJuqbkbiD6HVCTEcgwdmzxFCjZe65NYg'
8181 let account = toBase58String(i.caller.bytes)
8282 let pmt = extract(i.payment)
8383 let contestCurrNumber = getNumByKey("contest_currentnumber")
84- let contestStartHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "startheight"))
85- let contestFinishHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "finishheight"))
86- let contestStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "status"))
84+ let contestStartHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_startheight"))
85+ let contestFinishHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_finishheight"))
86+ let contestStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
8787 if ((height > (contestFinishHeight - (2 * 1440))))
8888 then throw("You cannot bet anymore at this height.")
8989 else if ((contestStatus != RUNNING))
9090 then throw("Invalid status: you cannot bet now.")
9191 else if (if ((pmt.assetId != WLT))
9292 then true
9393 else (pmt.amount != 500000))
9494 then throw("You must pay 5 WLT to bet.")
9595 else WriteSet([DataEntry(((("bet_" + toString(contestCurrNumber)) + "_") + account), currencyValue)])
9696 }
9797
9898
9999 @Verifier(tx)
100100 func verify () = match tx {
101101 case _: SetScriptTransaction|DataTransaction =>
102102 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
103103 case _: InvokeScriptTransaction =>
104104 true
105105 case _ =>
106106 true
107107 }
108108

github/deemru/w8io/169f3d6 
34.77 ms