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:AAIFAAAAAAAAABAIAhIAEgASABIAEgASABIAAAAAGgAAAAAOZ2FtZVRva2VuTGFiZWwCAAAACUdfVE9LRU5JRAAAAAAQZ2FtZUJhbGFuY2VMYWJlbAIAAAAJR19CQUxBTkNFAAAAABVnYW1lQ29tbXVuaXR5UG90TGFiZWwCAAAADkdfQ09NTVVOSVRZUE9UAAAAABFnYW1lUHJpemVQb3RMYWJlbAIAAAAKR19QUklaRVBPVAAAAAAZZ2FtZVByaXplU2hhcmVBbW91bnRMYWJlbAIAAAASR19QUklaRVNIQVJFQU1PVU5UAAAAABBnYW1lQ291bnRlckxhYmVsAgAAAA5HX0dBTUVTQ09VTlRFUgAAAAASZ2FtZVRvdGFsQmV0c0xhYmVsAgAAAAtHX1RPVEFMQkVUUwAAAAAWZ2FtZVByb2Nlc3NlZEJldHNMYWJlbAIAAAAPR19QUk9DRVNTRURCRVRTAAAAABdnYW1lV2lubmVyc0NvdW50ZXJMYWJlbAIAAAAOR19XSU5ORVJTQ09VTlQAAAAAGWdhbWVQcm9jZXNzZWRXaW5uZXJzTGFiZWwCAAAAEk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0V2lubmVyBQAAAAx0b3RhbFdpbm5lcnMJAAACAAAAAQIAAAAgTm8gbW9yZSB3aW5uZXJzIHRvIGJlIHByb2Nlc3NlZC4EAAAAByRtYXRjaDIJAQAAABRnYW1lUHJpemVTaGFyZUFtb3VudAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDICAAAAA0ludAQAAAAQcHJpemVTaGFyZUFtb3VudAUAAAAHJG1hdGNoMgQAAAAJYmV0UGxhY2VyCQEAAAANd2lubmVyRGV0YWlscwAAAAEFAAAACm5leHRXaW5uZXIEAAAAB2FkZHJlc3MJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQUAAAAJYmV0UGxhY2VyBAAAAAh3aW5uaW5ncwkBAAAAFGdhbWVQcml6ZVNoYXJlQW1vdW50AAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAdhZGRyZXNzBQAAABBwcml6ZVNoYXJlQW1vdW50CQEAAAAJZ2FtZVRva2VuAAAAAAUAAAADbmlsCQAAAgAAAAECAAAAO0dhbWUgaGFzIG5vdCBiZWVuIGluaXRpYWxpemVkLCBwcml6ZSBzaGFyZSBhbW91bnQgbm90IGZvdW5kCQAAAgAAAAECAAAAQEdhbWUgaGFzIG5vdCBiZWVuIGluaXRpYWxpemVkLCB0b3RhbCBwcm9jZXNzZWQgd2lubmVycyBub3QgZm91bmQJAAACAAAAAQIAAAA2R2FtZSBoYXMgbm90IGJlZW4gaW5pdGlhbGl6ZWQsIHRvdGFsIHdpbm5lcnMgbm90IGZvdW5kAAAAABtFtiI=", "height": 2209032, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4Xgs92tEEYbCYmRww2REc3iY4fEDSPiHobZ1g8R6WUBS Next: FCk9jqnhrbfpy4RAE5C7kahBzZGftQw7rKWw6f78ZH27 Diff:
Old | New | Differences | |
---|---|---|---|
77 | 77 | ||
78 | 78 | ||
79 | 79 | @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)] | |
81 | 81 | ||
82 | 82 | ||
83 | 83 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let gameTokenLabel = "G_TOKENID" | |
5 | 5 | ||
6 | 6 | let gameBalanceLabel = "G_BALANCE" | |
7 | 7 | ||
8 | 8 | let gameCommunityPotLabel = "G_COMMUNITYPOT" | |
9 | 9 | ||
10 | 10 | let gamePrizePotLabel = "G_PRIZEPOT" | |
11 | 11 | ||
12 | 12 | let gamePrizeShareAmountLabel = "G_PRIZESHAREAMOUNT" | |
13 | 13 | ||
14 | 14 | let gameCounterLabel = "G_GAMESCOUNTER" | |
15 | 15 | ||
16 | 16 | let gameTotalBetsLabel = "G_TOTALBETS" | |
17 | 17 | ||
18 | 18 | let gameProcessedBetsLabel = "G_PROCESSEDBETS" | |
19 | 19 | ||
20 | 20 | let gameWinnersCounterLabel = "G_WINNERSCOUNT" | |
21 | 21 | ||
22 | 22 | let gameProcessedWinnersLabel = "G_PROCESSEDWINNERS" | |
23 | 23 | ||
24 | 24 | func gameResultLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_RESULT") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func betDetailsLabel (betNumber) = (("B_" + toString(betNumber)) + "_BETDETAILS") | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func winnerDetailsLabel (winnerNumber) = (("W_" + toString(winnerNumber)) + "_WINNERDETAILS") | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func gameBalance () = getInteger(this, gameBalanceLabel) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func gameCommunityPot () = getInteger(this, gameCommunityPotLabel) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func gamePrizePot () = getInteger(this, gamePrizePotLabel) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func gamePrizeShareAmount () = getInteger(this, gamePrizeShareAmountLabel) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func gamesGetCounter () = getInteger(this, gameCounterLabel) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func gameTotalBets () = getInteger(this, gameTotalBetsLabel) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func gameProcessedBets () = getInteger(this, gameProcessedBetsLabel) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func gameWinnersCounter () = getInteger(this, gameWinnersCounterLabel) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func gameProcessedWinners () = getInteger(this, gameProcessedWinnersLabel) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func gameGetResult (gameNumber) = getStringValue(this, gameResultLabel(gameNumber)) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func betDetails (betNumber) = getStringValue(this, betDetailsLabel(betNumber)) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func winnerDetails (winnerNumber) = getStringValue(this, winnerDetailsLabel(winnerNumber)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func gameToken () = match getString(this, gameTokenLabel) { | |
70 | 70 | case tokenId: String => | |
71 | 71 | if ((tokenId == "")) | |
72 | 72 | then unit | |
73 | 73 | else fromBase58String(tokenId) | |
74 | 74 | case _ => | |
75 | 75 | unit | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | @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)] | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(i) | |
85 | 85 | func startGame () = match gamesGetCounter() { | |
86 | 86 | case currentGame: Int => | |
87 | 87 | let newGame = (currentGame + 1) | |
88 | 88 | [IntegerEntry(gameCounterLabel, newGame)] | |
89 | 89 | case _ => | |
90 | 90 | throw("Game has not been initialized, total games not found") | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | ||
95 | 95 | @Callable(i) | |
96 | 96 | func placeBet () = match gamesGetCounter() { | |
97 | 97 | case currentGame: Int => | |
98 | 98 | match gameTotalBets() { | |
99 | 99 | case totalBets: Int => | |
100 | 100 | let newBet = (totalBets + 1) | |
101 | 101 | let bet = "1,2,3" | |
102 | 102 | [IntegerEntry(gameTotalBetsLabel, newBet), StringEntry(betDetailsLabel(newBet), ((("G" + toString(currentGame)) + "-") + bet))] | |
103 | 103 | case _ => | |
104 | 104 | throw("Game has not been initialized, total bets not found") | |
105 | 105 | } | |
106 | 106 | case _ => | |
107 | 107 | throw("Game has not been initialized, total games not found") | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | 112 | @Callable(i) | |
113 | 113 | func endGame () = match gamesGetCounter() { | |
114 | 114 | case currentGame: Int => | |
115 | 115 | [StringEntry(gameResultLabel(currentGame), ((("G" + toString(currentGame)) + "-") + "1,2,3"))] | |
116 | 116 | case _ => | |
117 | 117 | throw("Game has not been initialized, total games not found") | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | ||
122 | 122 | @Callable(i) | |
123 | 123 | func processNextBet () = match gameTotalBets() { | |
124 | 124 | case totalBets: Int => | |
125 | 125 | match gameProcessedBets() { | |
126 | 126 | case lastProcessedBet: Int => | |
127 | 127 | let nextBet = (lastProcessedBet + 1) | |
128 | 128 | if ((nextBet > totalBets)) | |
129 | 129 | then throw("Next bet has not been placed.") | |
130 | 130 | else match gamesGetCounter() { | |
131 | 131 | case gameNumber: Int => | |
132 | 132 | match gameWinnersCounter() { | |
133 | 133 | case winnersCount: Int => | |
134 | 134 | let result = gameGetResult(gameNumber) | |
135 | 135 | let betDetail = betDetails(nextBet) | |
136 | 136 | if ((betDetail == result)) | |
137 | 137 | then { | |
138 | 138 | let newWinnersCount = (winnersCount + 1) | |
139 | 139 | [IntegerEntry(gameProcessedBetsLabel, nextBet), IntegerEntry(gameWinnersCounterLabel, (winnersCount + 1)), StringEntry(winnerDetailsLabel(newWinnersCount), toBase58String(i.caller.bytes))] | |
140 | 140 | } | |
141 | 141 | else [IntegerEntry(gameProcessedBetsLabel, nextBet)] | |
142 | 142 | case _ => | |
143 | 143 | throw("Game has not been initialized, total winners not found") | |
144 | 144 | } | |
145 | 145 | case _ => | |
146 | 146 | throw("Game has not been initialized, total games not found") | |
147 | 147 | } | |
148 | 148 | case _ => | |
149 | 149 | throw("Game has not been initialized, total processed bets not found") | |
150 | 150 | } | |
151 | 151 | case _ => | |
152 | 152 | throw("Game has not been initialized, total bets not found") | |
153 | 153 | } | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | ||
157 | 157 | @Callable(i) | |
158 | 158 | func calculatePrize () = match gameWinnersCounter() { | |
159 | 159 | case winnersCount: Int => | |
160 | 160 | if ((winnersCount == 0)) | |
161 | 161 | then throw("There are no winners this round.") | |
162 | 162 | else match gamePrizePot() { | |
163 | 163 | case prizePotAmount: Int => | |
164 | 164 | let prizePot = gamePrizePot() | |
165 | 165 | let prizeShareAmount = (prizePotAmount / winnersCount) | |
166 | 166 | [IntegerEntry(gamePrizeShareAmountLabel, prizeShareAmount)] | |
167 | 167 | case _ => | |
168 | 168 | throw("Game has not been initialized, total games not found") | |
169 | 169 | } | |
170 | 170 | case _ => | |
171 | 171 | throw("Game has not been initialized, total winners not found") | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | @Callable(i) | |
177 | 177 | func processNextWinner () = match gameWinnersCounter() { | |
178 | 178 | case totalWinners: Int => | |
179 | 179 | if ((totalWinners == 0)) | |
180 | 180 | then throw("There are no winners this round.") | |
181 | 181 | else match gameProcessedWinners() { | |
182 | 182 | case lastProcessedWinner: Int => | |
183 | 183 | let nextWinner = (lastProcessedWinner + 1) | |
184 | 184 | if ((nextWinner > totalWinners)) | |
185 | 185 | then throw("No more winners to be processed.") | |
186 | 186 | else match gamePrizeShareAmount() { | |
187 | 187 | case prizeShareAmount: Int => | |
188 | 188 | let betPlacer = winnerDetails(nextWinner) | |
189 | 189 | let address = value(addressFromString(betPlacer)) | |
190 | 190 | let winnings = gamePrizeShareAmount() | |
191 | 191 | [ScriptTransfer(address, prizeShareAmount, gameToken())] | |
192 | 192 | case _ => | |
193 | 193 | throw("Game has not been initialized, prize share amount not found") | |
194 | 194 | } | |
195 | 195 | case _ => | |
196 | 196 | throw("Game has not been initialized, total processed winners not found") | |
197 | 197 | } | |
198 | 198 | case _ => | |
199 | 199 | throw("Game has not been initialized, total winners not found") | |
200 | 200 | } | |
201 | 201 | ||
202 | 202 |
github/deemru/w8io/169f3d6 30.47 ms ◑