tx · 7da6B6VMRwNn1VK5wdiir1PRmhtaiQkqzLYgEcNHB9uX 3MuZayPFVLM2GSiVHDbo1SCGagfLQh6pQEr: -0.01200000 Waves 2022.09.08 02:16 [2219334] smart account 3MuZayPFVLM2GSiVHDbo1SCGagfLQh6pQEr > SELF 0.00000000 Waves
{ "type": 13, "id": "7da6B6VMRwNn1VK5wdiir1PRmhtaiQkqzLYgEcNHB9uX", "fee": 1200000, "feeAssetId": null, "timestamp": 1662592647589, "version": 2, "chainId": 84, "sender": "3MuZayPFVLM2GSiVHDbo1SCGagfLQh6pQEr", "senderPublicKey": "GscL7UdayRbv4gkUuDa4FDPnDR2s81kqve8sM5MpDKdN", "proofs": [ "2vaMGVy1NidgzwXLonJcvpkTQiAVeqUkqz1K9B3rrEAPrnUHBzENKDQhsuL1AohigFFyAnzrbPe7XXhHv6cEyttP" ], "script": "base64:AAIEAAAAAAAAABMIAhIAEgASAwoBCBIAEgASABIAAAAAHAAAAAAOZ2FtZVRva2VuTGFiZWwCAAAACUdfVE9LRU5JRAAAAAAQZ2FtZUJhbGFuY2VMYWJlbAIAAAAJR19CQUxBTkNFAAAAABVnYW1lQ29tbXVuaXR5UG90TGFiZWwCAAAADkdfQ09NTVVOSVRZUE9UAQAAABFnYW1lUHJpemVQb3RMYWJlbAAAAAEAAAAKZ2FtZU51bWJlcgkAASwAAAACCQABLAAAAAICAAAAAkdfCQABpAAAAAEFAAAACmdhbWVOdW1iZXICAAAACV9QUklaRVBPVAEAAAAZZ2FtZVByaXplU2hhcmVBbW91bnRMYWJlbAAAAAEAAAAKZ2FtZU51bWJlcgkAASwAAAACCQABLAAAAAICAAAAAkdfCQABpAAAAAEFAAAACmdhbWVOdW1iZXICAAAAEVBfUklaRVNIQVJFQU1PVU5UAAAAABBnYW1lQ291bnRlckxhYmVsAgAAAA5HX0dBTUVTQ09VTlRFUgEAAAASZ2FtZVRvdGFsQmV0c0xhYmVsAAAAAQAAAApnYW1lTnVtYmVyCQABLAAAAAIJAAE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N1bGF0ZWQgeWV0LgkAAAIAAAABAgAAABVHYW1lIHN0YXRlIG5vdCBmb3VuZC4JAAACAAAAAQIAAAA1R2FtZSBoYXMgbm90IGJlZW4gaW5pdGlhbGl6ZWQsIHRvdGFsIGdhbWVzIG5vdCBmb3VuZC4AAAAAywSwyw==", "height": 2219334, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 5ZdWShJqCUVN578vvEZFHEdBw7e8fC9mPHkjZj68bip Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let gameTokenLabel = "G_TOKENID" | |
5 | + | ||
6 | + | let gameBalanceLabel = "G_BALANCE" | |
7 | + | ||
8 | + | let gameCommunityPotLabel = "G_COMMUNITYPOT" | |
9 | + | ||
10 | + | func gamePrizePotLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_PRIZEPOT") | |
11 | + | ||
12 | + | ||
13 | + | func gamePrizeShareAmountLabel (gameNumber) = (("G_" + toString(gameNumber)) + "P_RIZESHAREAMOUNT") | |
14 | + | ||
15 | + | ||
16 | + | let gameCounterLabel = "G_GAMESCOUNTER" | |
17 | + | ||
18 | + | func gameTotalBetsLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_TOTALBETS") | |
19 | + | ||
20 | + | ||
21 | + | func gameProcessedBetsLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_PROCESSEDBETS") | |
22 | + | ||
23 | + | ||
24 | + | func gameWinnersCounterLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_WINNERSCOUNT") | |
25 | + | ||
26 | + | ||
27 | + | func gameProcessedWinnersLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_PROCESSEDWINNERS") | |
28 | + | ||
29 | + | ||
30 | + | func gameResultLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_RESULT") | |
31 | + | ||
32 | + | ||
33 | + | func betDetailsLabel (betNumber) = (("B_" + toString(betNumber)) + "_BETDETAILS") | |
34 | + | ||
35 | + | ||
36 | + | func winnerDetailsLabel (winnerNumber) = (("W_" + toString(winnerNumber)) + "_WINNERDETAILS") | |
37 | + | ||
38 | + | ||
39 | + | func gameStateLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_STATE") | |
40 | + | ||
41 | + | ||
42 | + | func gameBalance () = getInteger(this, gameBalanceLabel) | |
43 | + | ||
44 | + | ||
45 | + | func gameCommunityPot () = getInteger(this, gameCommunityPotLabel) | |
46 | + | ||
47 | + | ||
48 | + | func gamePrizePot (gameNumber) = getInteger(this, gamePrizePotLabel(gameNumber)) | |
49 | + | ||
50 | + | ||
51 | + | func gamePrizeShareAmount (gameNumber) = getInteger(this, gamePrizeShareAmountLabel(gameNumber)) | |
52 | + | ||
53 | + | ||
54 | + | func gamesGetCounter () = getInteger(this, gameCounterLabel) | |
55 | + | ||
56 | + | ||
57 | + | func gameTotalBets (gameNumber) = getInteger(this, gameTotalBetsLabel(gameNumber)) | |
58 | + | ||
59 | + | ||
60 | + | func gameProcessedBets (gameNumber) = getInteger(this, gameProcessedBetsLabel(gameNumber)) | |
61 | + | ||
62 | + | ||
63 | + | func gameWinnersCounter (gameNumber) = getInteger(this, gameWinnersCounterLabel(gameNumber)) | |
64 | + | ||
65 | + | ||
66 | + | func gameProcessedWinners (gameNumber) = getInteger(this, gameProcessedWinnersLabel(gameNumber)) | |
67 | + | ||
68 | + | ||
69 | + | func gameGetResult (gameNumber) = getStringValue(this, gameResultLabel(gameNumber)) | |
70 | + | ||
71 | + | ||
72 | + | func betDetails (betNumber) = getStringValue(this, betDetailsLabel(betNumber)) | |
73 | + | ||
74 | + | ||
75 | + | func winnerDetails (winnerNumber) = getStringValue(this, winnerDetailsLabel(winnerNumber)) | |
76 | + | ||
77 | + | ||
78 | + | func gameGetState (gameNumber) = getInteger(this, gameStateLabel(gameNumber)) | |
79 | + | ||
80 | + | ||
81 | + | func gameToken () = match getString(this, gameTokenLabel) { | |
82 | + | case tokenId: String => | |
83 | + | if ((tokenId == "")) | |
84 | + | then unit | |
85 | + | else fromBase58String(tokenId) | |
86 | + | case _ => | |
87 | + | unit | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | @Callable(i) | |
92 | + | func initGame () = [IntegerEntry(gameBalanceLabel, 0), IntegerEntry(gameCommunityPotLabel, 0), IntegerEntry(gameCounterLabel, 0), IntegerEntry(gameStateLabel(0), 1), IntegerEntry(gameWinnersCounterLabel(0), 0), IntegerEntry(gameProcessedWinnersLabel(0), 0), IntegerEntry(gameTotalBetsLabel(0), 0), IntegerEntry(gameProcessedBetsLabel(0), 0)] | |
93 | + | ||
94 | + | ||
95 | + | ||
96 | + | @Callable(i) | |
97 | + | func startGame () = match gamesGetCounter() { | |
98 | + | case currentGame: Int => | |
99 | + | match gameGetState(currentGame) { | |
100 | + | case gameState: Int => | |
101 | + | if ((gameState == 0)) | |
102 | + | then throw("Last game has not finished yet.") | |
103 | + | else match gameTotalBets(currentGame) { | |
104 | + | case totalBets: Int => | |
105 | + | match gameProcessedBets(currentGame) { | |
106 | + | case totalProcessedBets: Int => | |
107 | + | if ((totalBets == totalProcessedBets)) | |
108 | + | then match gameWinnersCounter(currentGame) { | |
109 | + | case totalWinners: Int => | |
110 | + | match gameProcessedWinners(currentGame) { | |
111 | + | case lastProcessedWinner: Int => | |
112 | + | if ((totalWinners == lastProcessedWinner)) | |
113 | + | then { | |
114 | + | let newGame = (currentGame + 1) | |
115 | + | [IntegerEntry(gameCounterLabel, newGame), IntegerEntry(gamePrizePotLabel(newGame), 100000000), IntegerEntry(gamePrizeShareAmountLabel(newGame), 0), IntegerEntry(gameTotalBetsLabel(newGame), 0), IntegerEntry(gameProcessedBetsLabel(newGame), 0), IntegerEntry(gameWinnersCounterLabel(newGame), 0), IntegerEntry(gameProcessedWinnersLabel(newGame), 0), IntegerEntry(gameStateLabel(newGame), 0)] | |
116 | + | } | |
117 | + | else throw("All winners have not been processed yet. Cannot start new game.") | |
118 | + | case _ => | |
119 | + | throw("Game has not been initialized, total processed winners not found.") | |
120 | + | } | |
121 | + | case _ => | |
122 | + | throw("Game has not been initialized, total winners not found.") | |
123 | + | } | |
124 | + | else throw("All bets have not been processed yet. Cannot start new game.") | |
125 | + | case _ => | |
126 | + | throw("Game has not been initialized, total processed bets not found.") | |
127 | + | } | |
128 | + | case _ => | |
129 | + | throw("Game has not been initialized, total bets not found.") | |
130 | + | } | |
131 | + | case _ => | |
132 | + | throw("Game state not found.") | |
133 | + | } | |
134 | + | case _ => | |
135 | + | throw("Game has not been initialized, total games not found.") | |
136 | + | } | |
137 | + | ||
138 | + | ||
139 | + | ||
140 | + | @Callable(i) | |
141 | + | func placeBet (guessValue) = match gamesGetCounter() { | |
142 | + | case currentGame: Int => | |
143 | + | match gameGetState(currentGame) { | |
144 | + | case gameState: Int => | |
145 | + | if ((gameState == 1)) | |
146 | + | then throw("Game is finished and next game has not started.") | |
147 | + | else match gameTotalBets(currentGame) { | |
148 | + | case totalBets: Int => | |
149 | + | let newBet = (totalBets + 1) | |
150 | + | let bet = guessValue | |
151 | + | [IntegerEntry(gameTotalBetsLabel(currentGame), newBet), StringEntry(betDetailsLabel(newBet), ((("G" + toString(currentGame)) + "-") + bet))] | |
152 | + | case _ => | |
153 | + | throw("Game has not been initialized, total bets not found.") | |
154 | + | } | |
155 | + | case _ => | |
156 | + | throw("Game state not found.") | |
157 | + | } | |
158 | + | case _ => | |
159 | + | throw("Game has not been initialized, total games not found.") | |
160 | + | } | |
161 | + | ||
162 | + | ||
163 | + | ||
164 | + | @Callable(i) | |
165 | + | func endGame () = match gamesGetCounter() { | |
166 | + | case currentGame: Int => | |
167 | + | match gameGetState(currentGame) { | |
168 | + | case gameState: Int => | |
169 | + | if ((gameState == 1)) | |
170 | + | then throw("Game is finished and next game has not started.") | |
171 | + | else [StringEntry(gameResultLabel(currentGame), ((("G" + toString(currentGame)) + "-") + "1,2,3")), IntegerEntry(gameStateLabel(currentGame), 1)] | |
172 | + | case _ => | |
173 | + | throw("Game state not found.") | |
174 | + | } | |
175 | + | case _ => | |
176 | + | throw("Game has not been initialized, total games not found.") | |
177 | + | } | |
178 | + | ||
179 | + | ||
180 | + | ||
181 | + | @Callable(i) | |
182 | + | func processNextBet () = match gamesGetCounter() { | |
183 | + | case currentGame: Int => | |
184 | + | match gameGetState(currentGame) { | |
185 | + | case gameState: Int => | |
186 | + | if ((gameState == 0)) | |
187 | + | then throw("Last game has not finished yet.") | |
188 | + | else match gameTotalBets(currentGame) { | |
189 | + | case totalBets: Int => | |
190 | + | match gameProcessedBets(currentGame) { | |
191 | + | case lastProcessedBet: Int => | |
192 | + | let nextBet = (lastProcessedBet + 1) | |
193 | + | if ((nextBet > totalBets)) | |
194 | + | then throw("Next bet has not been placed.") | |
195 | + | else match gamesGetCounter() { | |
196 | + | case gameNumber: Int => | |
197 | + | match gameWinnersCounter(currentGame) { | |
198 | + | case winnersCount: Int => | |
199 | + | let result = gameGetResult(gameNumber) | |
200 | + | let betDetail = betDetails(nextBet) | |
201 | + | if ((betDetail == result)) | |
202 | + | then { | |
203 | + | let newWinnersCount = (winnersCount + 1) | |
204 | + | [IntegerEntry(gameProcessedBetsLabel(currentGame), nextBet), IntegerEntry(gameWinnersCounterLabel(currentGame), newWinnersCount), StringEntry(winnerDetailsLabel(newWinnersCount), toBase58String(i.caller.bytes))] | |
205 | + | } | |
206 | + | else [IntegerEntry(gameProcessedBetsLabel(currentGame), nextBet)] | |
207 | + | case _ => | |
208 | + | throw("Game has not been initialized, total winners not found.") | |
209 | + | } | |
210 | + | case _ => | |
211 | + | throw("Game has not been initialized, total games not found.") | |
212 | + | } | |
213 | + | case _ => | |
214 | + | throw("Game has not been initialized, total processed bets not found.") | |
215 | + | } | |
216 | + | case _ => | |
217 | + | throw("Game has not been initialized, total bets not found.") | |
218 | + | } | |
219 | + | case _ => | |
220 | + | throw("Game state not found.") | |
221 | + | } | |
222 | + | case _ => | |
223 | + | throw("Game has not been initialized, total games not found.") | |
224 | + | } | |
225 | + | ||
226 | + | ||
227 | + | ||
228 | + | @Callable(i) | |
229 | + | func calculatePrize () = match gamesGetCounter() { | |
230 | + | case currentGame: Int => | |
231 | + | match gameGetState(currentGame) { | |
232 | + | case gameState: Int => | |
233 | + | if ((gameState == 0)) | |
234 | + | then throw("Last game has not finished yet.") | |
235 | + | else match gameTotalBets(currentGame) { | |
236 | + | case totalBets: Int => | |
237 | + | match gameProcessedBets(currentGame) { | |
238 | + | case lastProcessedBet: Int => | |
239 | + | if ((totalBets == lastProcessedBet)) | |
240 | + | then match gameWinnersCounter(currentGame) { | |
241 | + | case winnersCount: Int => | |
242 | + | if ((winnersCount == 0)) | |
243 | + | then throw("There are no winners this round.") | |
244 | + | else match gamePrizePot(currentGame) { | |
245 | + | case prizePotAmount: Int => | |
246 | + | let prizeShareAmount = (prizePotAmount / winnersCount) | |
247 | + | [IntegerEntry(gamePrizeShareAmountLabel(currentGame), prizeShareAmount)] | |
248 | + | case _ => | |
249 | + | throw("Game has not been initialized, total games not found.") | |
250 | + | } | |
251 | + | case _ => | |
252 | + | throw("Game has not been initialized, total winners not found.") | |
253 | + | } | |
254 | + | else throw("There are still bets that need to be processed. Cannot calculate prize yet.") | |
255 | + | case _ => | |
256 | + | throw("Game has not been initialized, total processed bets not found.") | |
257 | + | } | |
258 | + | case _ => | |
259 | + | throw("Game has not been initialized, total bets not found.") | |
260 | + | } | |
261 | + | case _ => | |
262 | + | throw("Game state not found.") | |
263 | + | } | |
264 | + | case _ => | |
265 | + | throw("Game has not been initialized, total games not found") | |
266 | + | } | |
267 | + | ||
268 | + | ||
269 | + | ||
270 | + | @Callable(i) | |
271 | + | func processNextWinner () = match gamesGetCounter() { | |
272 | + | case currentGame: Int => | |
273 | + | match gameGetState(currentGame) { | |
274 | + | case gameState: Int => | |
275 | + | if ((gameState == 0)) | |
276 | + | then throw("Last game has not finished yet.") | |
277 | + | else match gamePrizeShareAmount(currentGame) { | |
278 | + | case prizeShareAmount: Int => | |
279 | + | if ((prizeShareAmount == 0)) | |
280 | + | then throw("Prize share amount has not been calculated yet.") | |
281 | + | else match gameWinnersCounter(currentGame) { | |
282 | + | case totalWinners: Int => | |
283 | + | if ((totalWinners == 0)) | |
284 | + | then throw("There are no winners this round.") | |
285 | + | else match gameProcessedWinners(currentGame) { | |
286 | + | case lastProcessedWinner: Int => | |
287 | + | let nextWinner = (lastProcessedWinner + 1) | |
288 | + | if ((nextWinner > totalWinners)) | |
289 | + | then throw("No more winners to be processed.") | |
290 | + | else { | |
291 | + | let betPlacer = winnerDetails(nextWinner) | |
292 | + | let address = value(addressFromString(betPlacer)) | |
293 | + | [ScriptTransfer(address, prizeShareAmount, gameToken()), IntegerEntry(gameProcessedWinnersLabel(currentGame), nextWinner)] | |
294 | + | } | |
295 | + | case _ => | |
296 | + | throw("Game has not been initialized, total processed winners not found.") | |
297 | + | } | |
298 | + | case _ => | |
299 | + | throw("Game has not been initialized, total winners not found.") | |
300 | + | } | |
301 | + | case _ => | |
302 | + | throw("Prize share amount has not been calculated yet.") | |
303 | + | } | |
304 | + | case _ => | |
305 | + | throw("Game state not found.") | |
306 | + | } | |
307 | + | case _ => | |
308 | + | throw("Game has not been initialized, total games not found.") | |
309 | + | } | |
310 | + | ||
311 | + |
github/deemru/w8io/169f3d6 40.01 ms ◑