tx · 4vBWRhoh2qb5iSri55czCtQBfNSx8RLca2T18g7CV3s9

3N9fzexZxi7HrPcfizpvpFcaAnvpyuuMKPg:  -0.01400000 Waves

2019.08.27 23:30 [650080] smart account 3N9fzexZxi7HrPcfizpvpFcaAnvpyuuMKPg > SELF 0.00000000 Waves

{ "type": 13, "id": "4vBWRhoh2qb5iSri55czCtQBfNSx8RLca2T18g7CV3s9", "fee": 1400000, "feeAssetId": null, "timestamp": 1566937883772, "version": 1, "sender": "3N9fzexZxi7HrPcfizpvpFcaAnvpyuuMKPg", "senderPublicKey": "BJB5QS4iQna1z8idKb5QQ5cACUmNgxzHc81Y7AW6ZZY7", "proofs": [ "3ovhiXEds13qi4HDWHw882zVZRHQvWtHFpQ5jhVCCnczZHP9jWzg9qEyvwAh29MyR38GYBfMkT4c1Ch9AbWYxPbD" ], "script": "base64:AAIDAAAAAAAAAAAAAAAGAAAAABBzdGFydFJvdW5kSGVpZ2h0AAAAAAAAAAAFAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BAAAAAFhBQAAAAckbWF0Y2gwAQAAAAxXYXZlc0xvdHRvVjIJAQAAAAV0aHJvdwAAAAAEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAA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ZSb3VuZAIAAAAOX2NvdW50R2FtZXJzVXADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABZwUAAAAHJG1hdGNoMAUAAAABZwAAAAAAAAAAAAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAGkAAAAAQUAAAAMY3VycmVudFJvdW5kAgAAAAZfbW9yZV8FAAAADGFkZHJlc3NHYW1lcggFAAAAA3BtdAAAAAZhbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAAaQAAAABBQAAAAxjdXJyZW50Um91bmQCAAAADl9jb3VudEdhbWVyc1VwCQAAZAAAAAIFAAAAEG51bWJlck9mR2FtZXJzVXAAAAAAAAAAAAEFAAAAA25pbAMJAABmAAAAAgUAAAAIY291bnRCZXQIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAECAAAAI1BheW1lbnQgbXVzdCBiZSBtb3JlIGZvciB0aGUgcm91bmQhCQAAAgAAAAECAAAAFXdvcmtzIHdpdGggd2F2ZXMgb25seQAAAABcsyWP", "chainId": 84, "height": 650080, "spentComplexity": 0 } View: original | compacted Prev: 1j3JjfzFmJEGkgUzCgT7DrsaP5D8f5EjtZ4AjvvZiiP Next: 46ogj69H7LC1d1DmUAz8sX9KrnVWkToDb2rfraTNYPPW Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let startRoundHeight = 5
55
66 func randomizer (inv) = {
77 let lastPlay = match getBinary(this, "lastPlay") {
88 case s: ByteVector =>
99 s
1010 case a: Unit =>
1111 base58'2ee4oFDYriWJ9EMeR'
1212 case _ =>
1313 throw()
1414 }
1515 let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
1616 sha256(rand)
1717 }
1818
1919
2020 func setWinnersPrevRound (currRound,randhash) = {
2121 let prevNumberRound = (currRound - 1)
2222 if ((randhash > 500))
2323 then WriteSet([DataEntry("lastRoundWinner", (toString(prevNumberRound) + "_more_")), DataEntry("numberRound", currRound), DataEntry("startGame", true), DataEntry("randhash", randhash)])
2424 else WriteSet([DataEntry("lastRoundWinner", (toString(prevNumberRound) + "_less_")), DataEntry("numberRound", currRound), DataEntry("startGame", true), DataEntry("randhash", randhash)])
2525 }
2626
2727
2828 func getCurrentNumberRound () = match getInteger(this, "numberRound") {
2929 case a: Int =>
3030 a
3131 case _ =>
3232 1
3333 }
3434
3535
3636 func getBet (bet,round,addressGamer) = if ((round >= 1))
3737 then {
3838 let winnerOfPrevRound = match getString(this, "lastRoundWinner") {
3939 case w: String =>
4040 w
4141 case _ =>
4242 ""
4343 }
4444 let winnerFromPrevRound = match getString(this, (winnerOfPrevRound + addressGamer)) {
4545 case w: String =>
4646 w
4747 case _ =>
4848 ""
4949 }
5050 if (if ((round > 1))
5151 then (winnerFromPrevRound == "")
5252 else false)
5353 then (round * 2)
5454 else 1
5555 }
5656 else 1
5757
5858
5959 func getNumberGame () = match getInteger(this, "numberGame") {
6060 case a: Int =>
6161 (a + 1)
6262 case _ =>
6363 1
6464 }
6565
6666
6767 @Callable(i)
6868 func startRound () = {
6969 let newNumberOfRound = match getInteger(this, "numberRound") {
7070 case a: Int =>
7171 (a + 1)
7272 case _ =>
7373 1
7474 }
7575 let randhash = randomizer(i)
7676 let isGameStarted = match getBoolean(this, "startGame") {
7777 case g: Boolean =>
7878 g
7979 case _ =>
8080 false
8181 }
8282 if (if (if ((newNumberOfRound == 1))
8383 then (i.caller == this)
8484 else false)
8585 then !(isGameStarted)
8686 else false)
8787 then {
8888 let newNumberGame = getNumberGame()
8989 WriteSet([DataEntry("numberGame", newNumberGame), DataEntry("startGame", !(isGameStarted)), DataEntry("numberRound", newNumberOfRound)])
9090 }
9191 else if (if ((newNumberOfRound > 1))
9292 then (i.caller == this)
9393 else false)
9494 then setWinnersPrevRound(newNumberOfRound, (toInt(randhash) % 1000))
9595 else throw("Only owner can start the game.")
9696 }
9797
9898
9999
100100 @Callable(i)
101101 func forwardRound () = {
102102 let isGameStarted = match getBoolean(this, "startGame") {
103103 case g: Boolean =>
104104 g
105105 case _ =>
106106 false
107107 }
108108 let newNumberOfRound = match getInteger(this, "numberRound") {
109109 case a: Int =>
110110 a
111111 case _ =>
112112 1
113113 }
114114 let numberOfGamersUp = match getInteger(this, (toString(newNumberOfRound) + "_countGamersUp")) {
115115 case g: Int =>
116116 g
117117 case _ =>
118118 0
119119 }
120120 let numberOfGamersDown = match getInteger(this, (toString(newNumberOfRound) + "_countGamersDown")) {
121121 case g: Int =>
122122 g
123123 case _ =>
124124 0
125125 }
126126 if (if (if (if ((numberOfGamersUp > 0))
127127 then (i.caller == this)
128128 else false)
129129 then isGameStarted
130130 else false)
131131 then (numberOfGamersDown > 0)
132132 else false)
133133 then WriteSet([DataEntry("startGame", !(isGameStarted))])
134134 else throw("Only owner can start the game.")
135135 }
136136
137137
138138
139139 @Callable(i)
140140 func makeBetLess () = {
141141 let pmt = extract(i.payment)
142142 let addressGamer = toBase58String(i.caller.bytes)
143143 let currentRound = getCurrentNumberRound()
144144 let countBet = getBet(pmt.amount, currentRound, addressGamer)
145145 if (if (!(isDefined(pmt.assetId)))
146146 then (pmt.amount >= countBet)
147147 else false)
148148 then {
149149 let newNumberOfRound = match getInteger(this, "numberRound") {
150150 case a: Int =>
151151 a
152152 case _ =>
153153 1
154154 }
155155 let numberOfGamersDown = match getInteger(this, (toString(newNumberOfRound) + "_countGamersDown")) {
156156 case g: Int =>
157157 g
158158 case _ =>
159159 0
160160 }
161161 WriteSet([DataEntry(((toString(currentRound) + "_less_") + addressGamer), pmt.amount), DataEntry((toString(currentRound) + "_countGamersDown"), (numberOfGamersDown + 1))])
162162 }
163163 else if ((countBet > pmt.amount))
164164 then throw("Payment must be more for the round!")
165165 else throw("works with waves only")
166166 }
167167
168168
169169
170170 @Callable(i)
171171 func makeBetMore () = {
172172 let pmt = extract(i.payment)
173173 let addressGamer = toBase58String(i.caller.bytes)
174174 let currentRound = getCurrentNumberRound()
175175 let countBet = getBet(pmt.amount, currentRound, addressGamer)
176176 if (if (!(isDefined(pmt.assetId)))
177177 then (pmt.amount >= countBet)
178178 else false)
179179 then {
180180 let newNumberOfRound = match getInteger(this, "numberRound") {
181181 case a: Int =>
182182 a
183183 case _ =>
184184 1
185185 }
186186 let numberOfGamersUp = match getInteger(this, (toString(newNumberOfRound) + "_countGamersUp")) {
187187 case g: Int =>
188188 g
189189 case _ =>
190190 0
191191 }
192192 WriteSet([DataEntry(((toString(currentRound) + "_more_") + addressGamer), pmt.amount), DataEntry((toString(currentRound) + "_countGamersUp"), (numberOfGamersUp + 1))])
193193 }
194194 else if ((countBet > pmt.amount))
195195 then throw("Payment must be more for the round!")
196196 else throw("works with waves only")
197197 }
198198
199199

github/deemru/w8io/026f985 
28.63 ms