tx · GzYaSUPcanMEvj4kpnZA1zeXLyLbj4g3CH7JWy6qZeVS

3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2:  -0.01400000 Waves

2019.08.12 16:09 [627882] smart account 3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2 > SELF 0.00000000 Waves

{ "type": 13, "id": "GzYaSUPcanMEvj4kpnZA1zeXLyLbj4g3CH7JWy6qZeVS", "fee": 1400000, "feeAssetId": null, "timestamp": 1565615394881, "version": 1, "sender": "3N4NPivoThtskr7JxnNrKL7s8BzmRGx9rT2", "senderPublicKey": "F3vhYapU4NBzfM2X4KNkoFcxj3UbYnJjqituG6KE7ZPG", "proofs": [ "26qV8uSmsmtdR12CPuTZDfbpstujK9X8CW5aGmGzFpDYphGFpNWCawVCYFz5vsBPbX5gWNzNHvSBsbWXoV3shYVw" ], "script": "base64:AAIDAAAAAAAAAAAAAAAJAAAAAAdSVU5OSU5HAgAAAAdSVU5OSU5HAAAAAAZDTE9TRUQCAAAABkNMT1NFRAAAAAAJREFQUE9XTkVSAgAAACMzTjROUGl2b1RodHNrcjdKeG5OcktMN3M4QnptUkd4OXJUMgAAAAAFV0FWRVMCAAAABVdBVkVTAAAAAAROT05FAgAAAAROT05FAQAAAAtnZXROdW1CeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAEGdldENvbnRlc3RTdGF0dXMA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N0aW9uBgaun75M", "chainId": 84, "height": 627882, "spentComplexity": 0 } View: original | compacted Prev: Cq6HqddmoTHVpEAKMJ8uzvGfExKKW1u323zRS8hi8Bdo Next: 1mwDNRjPUUtnMap7NSr7BcMyk7rW9ByCpyhBAVeo4rC Diff:
OldNewDifferences
4141
4242 func getBet (currencyValue) = {
4343 let contestCurrNumber = getNumByKey("contest_currentnumber")
44- getStrByKey(((("contest_" + toString(contestCurrNumber)) + "_") + currencyValue))
44+ getStrByKey(((("bet_" + toString(contestCurrNumber)) + "_") + currencyValue))
4545 }
4646
4747
9191 let contestFinishHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_finishheight"))
9292 let contestStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
9393 let existingBet = getBet(currencyValue)
94- if ((height > (contestFinishHeight - (2 * 1440))))
95- then throw("You cannot bet anymore at this height.")
96- else if ((contestStatus != RUNNING))
97- then throw("Invalid status: you cannot bet now.")
98- else if (if ((pmt.assetId != WLT))
99- then true
100- else (pmt.amount != 500000))
101- then throw("You must pay 5 WLT to bet.")
102- else if (if (if ((existingBet != NONE))
103- then (existingBet != account)
104- else false)
94+ if (true)
95+ then throw(((("bet_" + toString(contestCurrNumber)) + "_") + currencyValue))
96+ else if ((height > (contestFinishHeight - (2 * 1440))))
97+ then throw("You cannot bet anymore at this height.")
98+ else if ((contestStatus != RUNNING))
99+ then throw("Invalid status: you cannot bet now.")
100+ else if (if ((pmt.assetId != WLT))
105101 then true
106- else true)
107- then throw(((("Address: " + existingBet) + " already did bet on value:") + currencyValue))
108- else WriteSet([DataEntry(((("bet_" + toString(contestCurrNumber)) + "_") + currencyValue), account)])
102+ else (pmt.amount != 500000))
103+ then throw("You must pay 5 WLT to bet.")
104+ else if (if (if ((existingBet != NONE))
105+ then (existingBet != account)
106+ else false)
107+ then true
108+ else true)
109+ then throw(((("Address: " + existingBet) + " already did bet on value:") + currencyValue))
110+ else WriteSet([DataEntry(((("bet_" + toString(contestCurrNumber)) + "_") + currencyValue), account)])
109111 }
110112
111113
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")
3838 getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
3939 }
4040
4141
4242 func getBet (currencyValue) = {
4343 let contestCurrNumber = getNumByKey("contest_currentnumber")
44- getStrByKey(((("contest_" + toString(contestCurrNumber)) + "_") + currencyValue))
44+ getStrByKey(((("bet_" + toString(contestCurrNumber)) + "_") + currencyValue))
4545 }
4646
4747
4848 @Callable(i)
4949 func setContestStatus (contestNumber,contestStatus) = {
5050 let account = toBase58String(i.caller.bytes)
5151 if ((account != DAPPOWNER))
5252 then throw("Only dAPP Owner can set Contest Status.")
5353 else if (if ((contestStatus != RUNNING))
5454 then (contestStatus != CLOSED)
5555 else false)
5656 then throw(("Invalid status: " + contestStatus))
5757 else WriteSet([DataEntry((("contest_" + toString(contestNumber)) + "_status"), contestStatus)])
5858 }
5959
6060
6161
6262 @Callable(i)
6363 func setContestConfiguration (currencyTicker,contestStartHeight) = {
6464 let account = toBase58String(i.caller.bytes)
6565 let contestPrevNumber = getNumByKey("contest_currentnumber")
6666 let contestPrevStatus = getStrByKey((("contest_" + toString(contestPrevNumber)) + "_status"))
6767 let contestCurrNumber = (contestPrevNumber + 1)
6868 if ((account != DAPPOWNER))
6969 then throw("Only dAPP Owner can Configure Contest.")
7070 else if ((height >= contestStartHeight))
7171 then throw(("Start Height must be greater than current Blockchain height: " + toString(height)))
7272 else if ((contestPrevStatus == RUNNING))
7373 then throw(("You cannot configure a new Contest while old Contest status is: " + contestPrevStatus))
7474 else if ((currencyTicker != WAVES))
7575 then throw((("dAPP does not support currency: " + currencyTicker) + " yet."))
7676 else {
7777 let contestFinishHeight = (contestStartHeight + (7 * 1440))
7878 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)])
7979 }
8080 }
8181
8282
8383
8484 @Callable(i)
8585 func bet (currencyValue) = {
8686 let WLT = base58'FaA6njrtReYVacBjgj36X8gGwydDYQKrthrt3hufhMZh'
8787 let account = toBase58String(i.caller.bytes)
8888 let pmt = extract(i.payment)
8989 let contestCurrNumber = getNumByKey("contest_currentnumber")
9090 let contestStartHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_startheight"))
9191 let contestFinishHeight = getNumByKey((("contest_" + toString(contestCurrNumber)) + "_finishheight"))
9292 let contestStatus = getStrByKey((("contest_" + toString(contestCurrNumber)) + "_status"))
9393 let existingBet = getBet(currencyValue)
94- if ((height > (contestFinishHeight - (2 * 1440))))
95- then throw("You cannot bet anymore at this height.")
96- else if ((contestStatus != RUNNING))
97- then throw("Invalid status: you cannot bet now.")
98- else if (if ((pmt.assetId != WLT))
99- then true
100- else (pmt.amount != 500000))
101- then throw("You must pay 5 WLT to bet.")
102- else if (if (if ((existingBet != NONE))
103- then (existingBet != account)
104- else false)
94+ if (true)
95+ then throw(((("bet_" + toString(contestCurrNumber)) + "_") + currencyValue))
96+ else if ((height > (contestFinishHeight - (2 * 1440))))
97+ then throw("You cannot bet anymore at this height.")
98+ else if ((contestStatus != RUNNING))
99+ then throw("Invalid status: you cannot bet now.")
100+ else if (if ((pmt.assetId != WLT))
105101 then true
106- else true)
107- then throw(((("Address: " + existingBet) + " already did bet on value:") + currencyValue))
108- else WriteSet([DataEntry(((("bet_" + toString(contestCurrNumber)) + "_") + currencyValue), account)])
102+ else (pmt.amount != 500000))
103+ then throw("You must pay 5 WLT to bet.")
104+ else if (if (if ((existingBet != NONE))
105+ then (existingBet != account)
106+ else false)
107+ then true
108+ else true)
109+ then throw(((("Address: " + existingBet) + " already did bet on value:") + currencyValue))
110+ else WriteSet([DataEntry(((("bet_" + toString(contestCurrNumber)) + "_") + currencyValue), account)])
109111 }
110112
111113
112114 @Verifier(tx)
113115 func verify () = match tx {
114116 case _: SetScriptTransaction|DataTransaction =>
115117 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
116118 case _: InvokeScriptTransaction =>
117119 true
118120 case _ =>
119121 true
120122 }
121123

github/deemru/w8io/169f3d6 
34.44 ms