tx · 59pAUTAXhHGoTvkSJCWrRWBHbWcfBUyoUbn84kR1cMPG

3Mt6NEJ6ZK6TFZs14tvnR5iAgemnomy2m1V:  -0.00700000 Waves

2022.08.31 22:13 [2209032] smart account 3Mt6NEJ6ZK6TFZs14tvnR5iAgemnomy2m1V > SELF 0.00000000 Waves

{ "type": 13, "id": "59pAUTAXhHGoTvkSJCWrRWBHbWcfBUyoUbn84kR1cMPG", "fee": 700000, "feeAssetId": null, "timestamp": 1661973248435, "version": 2, "chainId": 84, "sender": "3Mt6NEJ6ZK6TFZs14tvnR5iAgemnomy2m1V", "senderPublicKey": "5f9EawB8nxaLg7KKhyqV2RDBMwRBG6o69D8zc9myAzrY", "proofs": [ "4x7gJR1VYbTcY34ZNEqmowGVcXJyHz8Rd9tmZDxaaPSqVP1wWJAP1ammJPjGtBthtFfYYdUpqouDRKLaurfjrpKQ" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgASABIAEgASABIAAAAAGgAAAAAOZ2FtZVRva2VuTGFiZWwCAAAACUdfVE9LRU5JRAAAAAAQZ2FtZUJhbGFuY2VMYWJlbAIAAAAJR19CQUxBTkNFAAAAABVnYW1lQ29tbXVuaXR5UG90TGFiZWwCAAAADkdfQ09NTVVOSVRZUE9UAAAAABFnYW1lUHJpemVQb3RMYWJlbAIAAAAKR19QUklaRVBPVAAAAAAZZ2FtZVByaXplU2hhcmVBbW91bnRMYWJlbAIAAAASR19QUklaRVNIQVJFQU1PVU5UAAAAABBnYW1lQ291bnRlckxhYmVsAgAAAA5HX0dBTUVTQ09VTlRFUgAAAAASZ2FtZVRvdGFsQmV0c0xhYmVsAgAAAAtHX1RPVEFMQkVUUwAAAAAWZ2FtZVByb2Nlc3NlZEJldHNMYWJlbAIAAAAPR19QUk9DRVNTRURCRVRTAAAAABdnYW1lV2lubmVyc0NvdW50ZXJMYWJlbAIAAAAOR19XSU5ORVJTQ09VTlQAAAAAGWdhbWVQcm9jZXNzZWRXaW5uZXJzTGFiZWwCAAAAE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h0V2lubmVyBQAAAAx0b3RhbFdpbm5lcnMJAAACAAAAAQIAAAAgTm8gbW9yZSB3aW5uZXJzIHRvIGJlIHByb2Nlc3NlZC4EAAAAByRtYXRjaDIJAQAAABRnYW1lUHJpemVTaGFyZUFtb3VudAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDICAAAAA0ludAQAAAAQcHJpemVTaGFyZUFtb3VudAUAAAAHJG1hdGNoMgQAAAAJYmV0UGxhY2VyCQEAAAANd2lubmVyRGV0YWlscwAAAAEFAAAACm5leHRXaW5uZXIEAAAAB2FkZHJlc3MJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQUAAAAJYmV0UGxhY2VyBAAAAAh3aW5uaW5ncwkBAAAAFGdhbWVQcml6ZVNoYXJlQW1vdW50AAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAdhZGRyZXNzBQAAABBwcml6ZVNoYXJlQW1vdW50CQEAAAAJZ2FtZVRva2VuAAAAAAUAAAADbmlsCQAAAgAAAAECAAAAO0dhbWUgaGFzIG5vdCBiZWVuIGluaXRpYWxpemVkLCBwcml6ZSBzaGFyZSBhbW91bnQgbm90IGZvdW5kCQAAAgAAAAECAAAAQEdhbWUgaGFzIG5vdCBiZWVuIGluaXRpYWxpemVkLCB0b3RhbCBwcm9jZXNzZWQgd2lubmVycyBub3QgZm91bmQJAAACAAAAAQIAAAA2R2FtZSBoYXMgbm90IGJlZW4gaW5pdGlhbGl6ZWQsIHRvdGFsIHdpbm5lcnMgbm90IGZvdW5kAAAAABtFtiI=", "height": 2209032, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4Xgs92tEEYbCYmRww2REc3iY4fEDSPiHobZ1g8R6WUBS Next: FCk9jqnhrbfpy4RAE5C7kahBzZGftQw7rKWw6f78ZH27 Diff:
OldNewDifferences
7777
7878
7979 @Callable(i)
80-func initGame () = [IntegerEntry(gameBalanceLabel, 0), IntegerEntry(gameCommunityPotLabel, 0), IntegerEntry(gamePrizePotLabel, 10000000), IntegerEntry(gamePrizeShareAmountLabel, 0), IntegerEntry(gameCounterLabel, 0), IntegerEntry(gameTotalBetsLabel, 0), IntegerEntry(gameProcessedBetsLabel, 0), IntegerEntry(gameWinnersCounterLabel, 0)]
80+func initGame () = [IntegerEntry(gameBalanceLabel, 0), IntegerEntry(gameCommunityPotLabel, 0), IntegerEntry(gamePrizePotLabel, 10000000), IntegerEntry(gamePrizeShareAmountLabel, 0), IntegerEntry(gameCounterLabel, 0), IntegerEntry(gameTotalBetsLabel, 0), IntegerEntry(gameProcessedBetsLabel, 0), IntegerEntry(gameWinnersCounterLabel, 0), IntegerEntry(gameProcessedWinnersLabel, 0)]
8181
8282
8383
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let gameTokenLabel = "G_TOKENID"
55
66 let gameBalanceLabel = "G_BALANCE"
77
88 let gameCommunityPotLabel = "G_COMMUNITYPOT"
99
1010 let gamePrizePotLabel = "G_PRIZEPOT"
1111
1212 let gamePrizeShareAmountLabel = "G_PRIZESHAREAMOUNT"
1313
1414 let gameCounterLabel = "G_GAMESCOUNTER"
1515
1616 let gameTotalBetsLabel = "G_TOTALBETS"
1717
1818 let gameProcessedBetsLabel = "G_PROCESSEDBETS"
1919
2020 let gameWinnersCounterLabel = "G_WINNERSCOUNT"
2121
2222 let gameProcessedWinnersLabel = "G_PROCESSEDWINNERS"
2323
2424 func gameResultLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_RESULT")
2525
2626
2727 func betDetailsLabel (betNumber) = (("B_" + toString(betNumber)) + "_BETDETAILS")
2828
2929
3030 func winnerDetailsLabel (winnerNumber) = (("W_" + toString(winnerNumber)) + "_WINNERDETAILS")
3131
3232
3333 func gameBalance () = getInteger(this, gameBalanceLabel)
3434
3535
3636 func gameCommunityPot () = getInteger(this, gameCommunityPotLabel)
3737
3838
3939 func gamePrizePot () = getInteger(this, gamePrizePotLabel)
4040
4141
4242 func gamePrizeShareAmount () = getInteger(this, gamePrizeShareAmountLabel)
4343
4444
4545 func gamesGetCounter () = getInteger(this, gameCounterLabel)
4646
4747
4848 func gameTotalBets () = getInteger(this, gameTotalBetsLabel)
4949
5050
5151 func gameProcessedBets () = getInteger(this, gameProcessedBetsLabel)
5252
5353
5454 func gameWinnersCounter () = getInteger(this, gameWinnersCounterLabel)
5555
5656
5757 func gameProcessedWinners () = getInteger(this, gameProcessedWinnersLabel)
5858
5959
6060 func gameGetResult (gameNumber) = getStringValue(this, gameResultLabel(gameNumber))
6161
6262
6363 func betDetails (betNumber) = getStringValue(this, betDetailsLabel(betNumber))
6464
6565
6666 func winnerDetails (winnerNumber) = getStringValue(this, winnerDetailsLabel(winnerNumber))
6767
6868
6969 func gameToken () = match getString(this, gameTokenLabel) {
7070 case tokenId: String =>
7171 if ((tokenId == ""))
7272 then unit
7373 else fromBase58String(tokenId)
7474 case _ =>
7575 unit
7676 }
7777
7878
7979 @Callable(i)
80-func initGame () = [IntegerEntry(gameBalanceLabel, 0), IntegerEntry(gameCommunityPotLabel, 0), IntegerEntry(gamePrizePotLabel, 10000000), IntegerEntry(gamePrizeShareAmountLabel, 0), IntegerEntry(gameCounterLabel, 0), IntegerEntry(gameTotalBetsLabel, 0), IntegerEntry(gameProcessedBetsLabel, 0), IntegerEntry(gameWinnersCounterLabel, 0)]
80+func initGame () = [IntegerEntry(gameBalanceLabel, 0), IntegerEntry(gameCommunityPotLabel, 0), IntegerEntry(gamePrizePotLabel, 10000000), IntegerEntry(gamePrizeShareAmountLabel, 0), IntegerEntry(gameCounterLabel, 0), IntegerEntry(gameTotalBetsLabel, 0), IntegerEntry(gameProcessedBetsLabel, 0), IntegerEntry(gameWinnersCounterLabel, 0), IntegerEntry(gameProcessedWinnersLabel, 0)]
8181
8282
8383
8484 @Callable(i)
8585 func startGame () = match gamesGetCounter() {
8686 case currentGame: Int =>
8787 let newGame = (currentGame + 1)
8888 [IntegerEntry(gameCounterLabel, newGame)]
8989 case _ =>
9090 throw("Game has not been initialized, total games not found")
9191 }
9292
9393
9494
9595 @Callable(i)
9696 func placeBet () = match gamesGetCounter() {
9797 case currentGame: Int =>
9898 match gameTotalBets() {
9999 case totalBets: Int =>
100100 let newBet = (totalBets + 1)
101101 let bet = "1,2,3"
102102 [IntegerEntry(gameTotalBetsLabel, newBet), StringEntry(betDetailsLabel(newBet), ((("G" + toString(currentGame)) + "-") + bet))]
103103 case _ =>
104104 throw("Game has not been initialized, total bets not found")
105105 }
106106 case _ =>
107107 throw("Game has not been initialized, total games not found")
108108 }
109109
110110
111111
112112 @Callable(i)
113113 func endGame () = match gamesGetCounter() {
114114 case currentGame: Int =>
115115 [StringEntry(gameResultLabel(currentGame), ((("G" + toString(currentGame)) + "-") + "1,2,3"))]
116116 case _ =>
117117 throw("Game has not been initialized, total games not found")
118118 }
119119
120120
121121
122122 @Callable(i)
123123 func processNextBet () = match gameTotalBets() {
124124 case totalBets: Int =>
125125 match gameProcessedBets() {
126126 case lastProcessedBet: Int =>
127127 let nextBet = (lastProcessedBet + 1)
128128 if ((nextBet > totalBets))
129129 then throw("Next bet has not been placed.")
130130 else match gamesGetCounter() {
131131 case gameNumber: Int =>
132132 match gameWinnersCounter() {
133133 case winnersCount: Int =>
134134 let result = gameGetResult(gameNumber)
135135 let betDetail = betDetails(nextBet)
136136 if ((betDetail == result))
137137 then {
138138 let newWinnersCount = (winnersCount + 1)
139139 [IntegerEntry(gameProcessedBetsLabel, nextBet), IntegerEntry(gameWinnersCounterLabel, (winnersCount + 1)), StringEntry(winnerDetailsLabel(newWinnersCount), toBase58String(i.caller.bytes))]
140140 }
141141 else [IntegerEntry(gameProcessedBetsLabel, nextBet)]
142142 case _ =>
143143 throw("Game has not been initialized, total winners not found")
144144 }
145145 case _ =>
146146 throw("Game has not been initialized, total games not found")
147147 }
148148 case _ =>
149149 throw("Game has not been initialized, total processed bets not found")
150150 }
151151 case _ =>
152152 throw("Game has not been initialized, total bets not found")
153153 }
154154
155155
156156
157157 @Callable(i)
158158 func calculatePrize () = match gameWinnersCounter() {
159159 case winnersCount: Int =>
160160 if ((winnersCount == 0))
161161 then throw("There are no winners this round.")
162162 else match gamePrizePot() {
163163 case prizePotAmount: Int =>
164164 let prizePot = gamePrizePot()
165165 let prizeShareAmount = (prizePotAmount / winnersCount)
166166 [IntegerEntry(gamePrizeShareAmountLabel, prizeShareAmount)]
167167 case _ =>
168168 throw("Game has not been initialized, total games not found")
169169 }
170170 case _ =>
171171 throw("Game has not been initialized, total winners not found")
172172 }
173173
174174
175175
176176 @Callable(i)
177177 func processNextWinner () = match gameWinnersCounter() {
178178 case totalWinners: Int =>
179179 if ((totalWinners == 0))
180180 then throw("There are no winners this round.")
181181 else match gameProcessedWinners() {
182182 case lastProcessedWinner: Int =>
183183 let nextWinner = (lastProcessedWinner + 1)
184184 if ((nextWinner > totalWinners))
185185 then throw("No more winners to be processed.")
186186 else match gamePrizeShareAmount() {
187187 case prizeShareAmount: Int =>
188188 let betPlacer = winnerDetails(nextWinner)
189189 let address = value(addressFromString(betPlacer))
190190 let winnings = gamePrizeShareAmount()
191191 [ScriptTransfer(address, prizeShareAmount, gameToken())]
192192 case _ =>
193193 throw("Game has not been initialized, prize share amount not found")
194194 }
195195 case _ =>
196196 throw("Game has not been initialized, total processed winners not found")
197197 }
198198 case _ =>
199199 throw("Game has not been initialized, total winners not found")
200200 }
201201
202202

github/deemru/w8io/169f3d6 
30.47 ms