tx · E35nAn8xn5FYFWogUd5KqEHaNiKF9DJ4iDP9V7PYHG8D 3Ms2w4mesxtWJiooCZLiB8KutLCXyk2w6LS: -0.01700000 Waves 2022.10.13 03:20 [2269837] smart account 3Ms2w4mesxtWJiooCZLiB8KutLCXyk2w6LS > SELF 0.00000000 Waves
{ "type": 13, "id": "E35nAn8xn5FYFWogUd5KqEHaNiKF9DJ4iDP9V7PYHG8D", "fee": 1700000, "feeAssetId": null, "timestamp": 1665620434199, "version": 2, "chainId": 84, "sender": "3Ms2w4mesxtWJiooCZLiB8KutLCXyk2w6LS", "senderPublicKey": "2p9r6uEw5fhQ9aNjv2ofbEeKNPS5MJ9QortzAw2fekVb", "proofs": [ "3K1kuHVKyd78QbJ7wW314eSAGSNQse9BzGuHeqkTDv55nGekLdfAgcd2wqkLZBFVSwsFK8g6u22dMC2cuvw4xEgQ" ], "script": "base64:BgJFCAISAwoBCBIAEgMKAQgSAwoBCBIDCgEIEgcKBQgIAQEIEgMKAQgSBAoCCAgSBQoDCAgBEgMKAQgSABIFCgMICAgSABIAKAAFd2F2ZXMAgMLXLwAOdGlja2V0UHJpY2VJbnQAwIQ9AAt0aWNrZXRQcmljZQUOdGlja2V0UHJpY2VJbnQABmludkZlZQCgwh4AEndpdGhkcmF3RmVlUGVyY2VudAAFABZmZWVDb2xsZWN0b3JBZGRyZXNzS2V5AhNmZWVDb2xsZWN0b3JBZGRyZXNzABl0b3VybmFtZW50QnV5SW5GZWVQZXJjZW50AAoADmRlcG9zaXRBc3NldElkAiw1dWUxZml1VjZqNlVCcjZYZjI4UW1zNnk1RnF6S3RxdmF4eGh3dTdoVFE1OAAfYWxsb3dlZFNwZWNpYWxUb3VybmFtZW50Q3JlYXRvcgIjM04xd3JWUWdMUnJlN1h1aDE4UWEyMmk0eFg5WUhrMzdiWGUBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0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G9uZSBwYXltZW50AwkBCWlzRGVmaW5lZAEIBQNwbXQHYXNzZXRJZAkAAgECJ1RpY2tldHMgY2FuIG9ubHkgaWJlIHB1cmNoYXNlZCBpbiBXYXZlcwMJAQIhPQIIBQNwbXQGYW1vdW50BQt0aWNrZXRQcmljZQkAAgEJAKwCAgkArAICAh9UaGUgcGF5bWVudCBtdXN0IGJlIG9mIGV4YWN0bHkgCQCkAwEFDnRpY2tldFByaWNlSW50AgYgd2F2ZXMEDWNhbGxlckFkZHJTdHIJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQTY3VycmVudFRpY2tldHNDb3VudAkBDXRyeUdldEludGVnZXIBCQESZ2V0VGlja2V0c0NvdW50S2V5AQUNY2FsbGVyQWRkclN0cgkAlAoCCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQESZ2V0VGlja2V0c0NvdW50S2V5AQUNY2FsbGVyQWRkclN0cgkAZAIFE2N1cnJlbnRUaWNrZXRzQ291bnQAAQUDbmlsAAEBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5fFFkSg==", "height": 2269837, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let waves = 100000000 | |
5 | + | ||
6 | + | let ticketPriceInt = 1000000 | |
7 | + | ||
8 | + | let ticketPrice = ticketPriceInt | |
9 | + | ||
10 | + | let invFee = 500000 | |
11 | + | ||
12 | + | let withdrawFeePercent = 5 | |
13 | + | ||
14 | + | let feeCollectorAddressKey = "feeCollectorAddress" | |
15 | + | ||
16 | + | let tournamentBuyInFeePercent = 10 | |
17 | + | ||
18 | + | let depositAssetId = "5ue1fiuV6j6UBr6Xf28Qms6y5FqzKtqvaxxhwu7hTQ58" | |
19 | + | ||
20 | + | let allowedSpecialTournamentCreator = "3N1wrVQgLRre7Xuh18Qa22i4xX9YHk37bXe" | |
21 | + | ||
22 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
23 | + | case b: Int => | |
24 | + | b | |
25 | + | case _ => | |
26 | + | 0 | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | func getTicketsCountKey (addressString) = (addressString + "_ticketsCount") | |
31 | + | ||
32 | + | ||
33 | + | func buyInAmountForTournamentForAccount (tournamentId,account) = ((tournamentId + "_buyInAmountForAccount_") + account) | |
34 | + | ||
35 | + | ||
36 | + | func buyInAssetIdForTournamentForAccount (tournamentId,account) = ((tournamentId + "_buyInAssetIdForAccount_") + account) | |
37 | + | ||
38 | + | ||
39 | + | func ticketForTournamentForAccount (tournamentId,account) = ((tournamentId + "_ticketForAccount_") + account) | |
40 | + | ||
41 | + | ||
42 | + | func tournamentTotalBuyInCollectedAmountKey (tournamentId) = (tournamentId + "_tournamentTotalBuyInCollectedAmount") | |
43 | + | ||
44 | + | ||
45 | + | func tournamentTotalBuyInCollectedAmountMinusFeesKey (tournamentId) = (tournamentId + "_tournamentTotalBuyInCollectedAmountMinusFees") | |
46 | + | ||
47 | + | ||
48 | + | func tournamentCreatorKey (tournamentId) = (tournamentId + "_tournamentCreator") | |
49 | + | ||
50 | + | ||
51 | + | func tournamentNameKey (tournamentId) = (tournamentId + "_tournamentName") | |
52 | + | ||
53 | + | ||
54 | + | func tournamentPrizeAmountKey (tournamentId) = (tournamentId + "_tournamentPrizeAmount") | |
55 | + | ||
56 | + | ||
57 | + | func tournamentMaxPlayersCountKey (tournamentId) = (tournamentId + "_tournamentMaxPlayersCount") | |
58 | + | ||
59 | + | ||
60 | + | func tournamentPlayersCountKey (tournamentId) = (tournamentId + "_tournamentPlayersCount") | |
61 | + | ||
62 | + | ||
63 | + | func tournamentPrizeAssetIdKey (tournamentId) = (tournamentId + "_tournamentPrizeAssetId") | |
64 | + | ||
65 | + | ||
66 | + | func tournamentPrizeAssetNameKey (tournamentId) = (tournamentId + "_tournamentPrizeAssetName") | |
67 | + | ||
68 | + | ||
69 | + | func tournamentBuyInAmountKey (tournamentId) = (tournamentId + "_tournamentBuyInAmount") | |
70 | + | ||
71 | + | ||
72 | + | func tournamentBuyInAssetIdKey (tournamentId) = (tournamentId + "_tournamentBuyInAssetId") | |
73 | + | ||
74 | + | ||
75 | + | func tournamentBuyInAssetNameKey (tournamentId) = (tournamentId + "_tournamentBuyInAssetName") | |
76 | + | ||
77 | + | ||
78 | + | func tournamentBuyInAssetDecimalsKey (tournamentId) = (tournamentId + "_tournamentBuyInAssetDecimals") | |
79 | + | ||
80 | + | ||
81 | + | func tournamentPrizeAssetDecimalsKey (tournamentId) = (tournamentId + "_tournamentPrizeAssetDecimals") | |
82 | + | ||
83 | + | ||
84 | + | func tournamentStatusKey (tournamentId) = (tournamentId + "_tournamentStatus") | |
85 | + | ||
86 | + | ||
87 | + | func tournamentBuyInFeeCollectedKey (tournamentId) = (tournamentId + "_tournamentBuyInFeeCollected") | |
88 | + | ||
89 | + | ||
90 | + | func tournamentServiceFeeCollectedKey (tournamentId) = (tournamentId + "_tournamentServiceFeeCollected") | |
91 | + | ||
92 | + | ||
93 | + | func tournamentWinningTransactionIdKey (tournamentId) = (tournamentId + "_tournamentWinningTransactionId") | |
94 | + | ||
95 | + | ||
96 | + | func gameWinnerKey (gameId) = (gameId + "_winner") | |
97 | + | ||
98 | + | ||
99 | + | func addressAvailableFundsKey (address) = (address + "_availableFunds") | |
100 | + | ||
101 | + | ||
102 | + | func addressTotalLockedFundsKey (address) = (address + "_totalLockedFunds") | |
103 | + | ||
104 | + | ||
105 | + | func addressLockedFundsTotalHistoryKey (address) = (address + "_lockedFundsTotalHistory") | |
106 | + | ||
107 | + | ||
108 | + | func addressLockedFundsForGameKey (address,gameId) = ((address + "_lockedFunds_") + gameId) | |
109 | + | ||
110 | + | ||
111 | + | func addressAvailableRewardsKey (address) = (address + "_availableRewards") | |
112 | + | ||
113 | + | ||
114 | + | func getTicketsCount (addressString) = tryGetInteger(getTicketsCountKey(addressString)) | |
115 | + | ||
116 | + | ||
117 | + | func consumeTicket (playerAddr) = { | |
118 | + | let currentTicketCount = getTicketsCount(playerAddr) | |
119 | + | let newCurrentTicketCount = (currentTicketCount - 1) | |
120 | + | if ((0 > newCurrentTicketCount)) | |
121 | + | then 0 | |
122 | + | else newCurrentTicketCount | |
123 | + | } | |
124 | + | ||
125 | + | ||
126 | + | @Callable(i) | |
127 | + | func setFeeCollectorAddress (collectorAddr) = if ((i.caller != this)) | |
128 | + | then throw("Admin Only") | |
129 | + | else [StringEntry(feeCollectorAddressKey, collectorAddr)] | |
130 | + | ||
131 | + | ||
132 | + | ||
133 | + | @Callable(i) | |
134 | + | func depositFunds () = { | |
135 | + | let pmt = if ((size(i.payments) == 1)) | |
136 | + | then i.payments[0] | |
137 | + | else throw("Please attach exactly one payment") | |
138 | + | if ((pmt.assetId != fromBase58String(depositAssetId))) | |
139 | + | then throw("You can only deposit USDN") | |
140 | + | else { | |
141 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
142 | + | let currentAvailableFunds = tryGetInteger(addressAvailableFundsKey(callerAddrStr)) | |
143 | + | $Tuple2([IntegerEntry(addressAvailableFundsKey(callerAddrStr), (currentAvailableFunds + pmt.amount))], 1) | |
144 | + | } | |
145 | + | } | |
146 | + | ||
147 | + | ||
148 | + | ||
149 | + | @Callable(i) | |
150 | + | func cancelSignUpToTournament (tournamentId) = { | |
151 | + | let tournamentStatus = getStringValue(tournamentStatusKey(tournamentId)) | |
152 | + | if ((tournamentStatus != "registration")) | |
153 | + | then throw("Tournament is not in registration phase!") | |
154 | + | else { | |
155 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
156 | + | let paidBuyInAmount = getIntegerValue(buyInAmountForTournamentForAccount(tournamentId, callerAddrStr)) | |
157 | + | let paidBuyInAssetId = getStringValue(buyInAssetIdForTournamentForAccount(tournamentId, callerAddrStr)) | |
158 | + | let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId)) | |
159 | + | let totalBuyInCollectedAmount = (tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId)) - paidBuyInAmount) | |
160 | + | let feesTaken = fraction(totalBuyInCollectedAmount, tournamentBuyInFeePercent, 100) | |
161 | + | $Tuple2([ScriptTransfer(addressFromStringValue(callerAddrStr), paidBuyInAmount, fromBase58String(paidBuyInAssetId)), DeleteEntry(ticketForTournamentForAccount(tournamentId, callerAddrStr)), DeleteEntry(buyInAmountForTournamentForAccount(tournamentId, callerAddrStr)), DeleteEntry(buyInAssetIdForTournamentForAccount(tournamentId, callerAddrStr)), IntegerEntry(tournamentPlayersCountKey(tournamentId), (alreadyRegisteredPlayersCount - 1)), IntegerEntry(tournamentTotalBuyInCollectedAmountKey(tournamentId), totalBuyInCollectedAmount), IntegerEntry(tournamentTotalBuyInCollectedAmountMinusFeesKey(tournamentId), (totalBuyInCollectedAmount - feesTaken))], 1) | |
162 | + | } | |
163 | + | } | |
164 | + | ||
165 | + | ||
166 | + | ||
167 | + | @Callable(i) | |
168 | + | func signUpToTournament (tournamentId) = { | |
169 | + | let maxPlayersCount = getIntegerValue(this, tournamentMaxPlayersCountKey(tournamentId)) | |
170 | + | let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId)) | |
171 | + | let tournamentStatus = getStringValue(tournamentStatusKey(tournamentId)) | |
172 | + | if (if ((tournamentStatus != "registration")) | |
173 | + | then (tournamentStatus != "started") | |
174 | + | else false) | |
175 | + | then throw("Tournament is not in registration phase!") | |
176 | + | else if ((alreadyRegisteredPlayersCount == maxPlayersCount)) | |
177 | + | then throw("Tournament is currently full, please try again later!") | |
178 | + | else { | |
179 | + | let pmt = if ((size(i.payments) == 1)) | |
180 | + | then i.payments[0] | |
181 | + | else throw("Please attach exactly one payment") | |
182 | + | let buyInAssetid = match pmt.assetId { | |
183 | + | case b: Unit => | |
184 | + | "" | |
185 | + | case b: ByteVector => | |
186 | + | toBase58String(b) | |
187 | + | case _ => | |
188 | + | throw("Match error") | |
189 | + | } | |
190 | + | let buyInRequiredAmount = getIntegerValue(this, tournamentBuyInAmountKey(tournamentId)) | |
191 | + | let buyInRequiredAssetId = getStringValue(this, tournamentBuyInAssetIdKey(tournamentId)) | |
192 | + | if ((buyInRequiredAmount != pmt.amount)) | |
193 | + | then throw(("Attached payment amount is invalid, must be " + toString(buyInRequiredAmount))) | |
194 | + | else if ((buyInRequiredAssetId != buyInAssetid)) | |
195 | + | then throw(("Attached payment asset id is invalid, must be " + buyInRequiredAssetId)) | |
196 | + | else { | |
197 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
198 | + | let totalBuyInCollectedAmount = (tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId)) + pmt.amount) | |
199 | + | let feesTaken = fraction(totalBuyInCollectedAmount, tournamentBuyInFeePercent, 100) | |
200 | + | $Tuple2([BooleanEntry(ticketForTournamentForAccount(tournamentId, callerAddrStr), true), IntegerEntry(buyInAmountForTournamentForAccount(tournamentId, callerAddrStr), pmt.amount), StringEntry(buyInAssetIdForTournamentForAccount(tournamentId, callerAddrStr), buyInAssetid), IntegerEntry(tournamentPlayersCountKey(tournamentId), (alreadyRegisteredPlayersCount + 1)), IntegerEntry(tournamentTotalBuyInCollectedAmountKey(tournamentId), totalBuyInCollectedAmount), IntegerEntry(tournamentTotalBuyInCollectedAmountMinusFeesKey(tournamentId), (totalBuyInCollectedAmount - feesTaken))], 1) | |
201 | + | } | |
202 | + | } | |
203 | + | } | |
204 | + | ||
205 | + | ||
206 | + | ||
207 | + | @Callable(i) | |
208 | + | func cancelTournament (tournamentId) = { | |
209 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
210 | + | let tournamentCreator = getStringValue(tournamentCreatorKey(tournamentId)) | |
211 | + | let creatorCheck = if ((tournamentCreator == callerAddrStr)) | |
212 | + | then true | |
213 | + | else if ((i.caller == this)) | |
214 | + | then true | |
215 | + | else throw("Only tournament creator can cancel it!") | |
216 | + | if ((creatorCheck == creatorCheck)) | |
217 | + | then { | |
218 | + | let tournamentStatus = getStringValue(tournamentStatusKey(tournamentId)) | |
219 | + | if (if ((i.caller != this)) | |
220 | + | then (tournamentStatus != "registration") | |
221 | + | else false) | |
222 | + | then throw("Tournament is not in registration phase!") | |
223 | + | else { | |
224 | + | let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId)) | |
225 | + | if ((alreadyRegisteredPlayersCount > 0)) | |
226 | + | then throw("Cannot cancel a tournament when players are already registered to it!") | |
227 | + | else { | |
228 | + | let tournamentPrizeAmount = getIntegerValue(tournamentPrizeAmountKey(tournamentId)) | |
229 | + | let tournamentPrizeAssetId = getStringValue(tournamentPrizeAssetIdKey(tournamentId)) | |
230 | + | $Tuple2([DeleteEntry(tournamentPrizeAmountKey(tournamentId)), DeleteEntry(tournamentPlayersCountKey(tournamentId)), DeleteEntry(tournamentMaxPlayersCountKey(tournamentId)), DeleteEntry(tournamentPrizeAssetIdKey(tournamentId)), DeleteEntry(tournamentPrizeAssetNameKey(tournamentId)), DeleteEntry(tournamentPrizeAssetDecimalsKey(tournamentId)), DeleteEntry(tournamentStatusKey(tournamentId)), DeleteEntry(tournamentBuyInAmountKey(tournamentId)), DeleteEntry(tournamentBuyInAssetNameKey(tournamentId)), DeleteEntry(tournamentBuyInAssetDecimalsKey(tournamentId)), DeleteEntry(tournamentBuyInAssetIdKey(tournamentId)), DeleteEntry(tournamentNameKey(tournamentId)), DeleteEntry(tournamentCreatorKey(tournamentId)), ScriptTransfer(addressFromStringValue(tournamentCreator), tournamentPrizeAmount, fromBase58String(tournamentPrizeAssetId))], 1) | |
231 | + | } | |
232 | + | } | |
233 | + | } | |
234 | + | else throw("Strict value is not equal to itself.") | |
235 | + | } | |
236 | + | ||
237 | + | ||
238 | + | ||
239 | + | @Callable(i) | |
240 | + | func createTournament (tournamentId,name,playersCount,buyInAmount,buyInAssetId) = { | |
241 | + | let pmt = if ((size(i.payments) == 1)) | |
242 | + | then i.payments[0] | |
243 | + | else { | |
244 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
245 | + | if ((callerAddrStr == allowedSpecialTournamentCreator)) | |
246 | + | then AttachedPayment(unit, 0) | |
247 | + | else throw("Please attach exactly one payment") | |
248 | + | } | |
249 | + | let tournamentCreator = match getString(tournamentCreatorKey(tournamentId)) { | |
250 | + | case creator: String => | |
251 | + | throw(("Tournament already exists with this id " + tournamentId)) | |
252 | + | case _ => | |
253 | + | unit | |
254 | + | } | |
255 | + | if ((tournamentCreator == tournamentCreator)) | |
256 | + | then { | |
257 | + | let prizeAssetId = match pmt.assetId { | |
258 | + | case b: Unit => | |
259 | + | "" | |
260 | + | case b: ByteVector => | |
261 | + | toBase58String(b) | |
262 | + | case _ => | |
263 | + | throw("Match error") | |
264 | + | } | |
265 | + | let assetDetails = match pmt.assetId { | |
266 | + | case b: Unit => | |
267 | + | ["Waves", 8] | |
268 | + | case b: ByteVector => | |
269 | + | match assetInfo(b) { | |
270 | + | case asset: Asset => | |
271 | + | [asset.name, asset.decimals] | |
272 | + | case _ => | |
273 | + | throw("Can't find asset") | |
274 | + | } | |
275 | + | case _ => | |
276 | + | throw("Match error") | |
277 | + | } | |
278 | + | let buyInAsset = match assetInfo(fromBase58String(buyInAssetId)) { | |
279 | + | case asset: Asset => | |
280 | + | [asset.name, asset.decimals] | |
281 | + | case _ => | |
282 | + | ["", 0] | |
283 | + | } | |
284 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
285 | + | $Tuple2([IntegerEntry(tournamentPrizeAmountKey(tournamentId), pmt.amount), IntegerEntry(tournamentPlayersCountKey(tournamentId), 0), IntegerEntry(tournamentMaxPlayersCountKey(tournamentId), playersCount), StringEntry(tournamentPrizeAssetIdKey(tournamentId), prizeAssetId), StringEntry(tournamentPrizeAssetNameKey(tournamentId), { | |
286 | + | let @ = assetDetails[0] | |
287 | + | if ($isInstanceOf(@, "String")) | |
288 | + | then @ | |
289 | + | else throw(($getType(@) + " couldn't be cast to String")) | |
290 | + | }), IntegerEntry(tournamentPrizeAssetDecimalsKey(tournamentId), { | |
291 | + | let @ = assetDetails[1] | |
292 | + | if ($isInstanceOf(@, "Int")) | |
293 | + | then @ | |
294 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
295 | + | }), StringEntry(tournamentStatusKey(tournamentId), "registration"), IntegerEntry(tournamentBuyInAmountKey(tournamentId), buyInAmount), StringEntry(tournamentBuyInAssetNameKey(tournamentId), { | |
296 | + | let @ = buyInAsset[0] | |
297 | + | if ($isInstanceOf(@, "String")) | |
298 | + | then @ | |
299 | + | else throw(($getType(@) + " couldn't be cast to String")) | |
300 | + | }), IntegerEntry(tournamentBuyInAssetDecimalsKey(tournamentId), { | |
301 | + | let @ = buyInAsset[1] | |
302 | + | if ($isInstanceOf(@, "Int")) | |
303 | + | then @ | |
304 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
305 | + | }), StringEntry(tournamentBuyInAssetIdKey(tournamentId), buyInAssetId), StringEntry(tournamentNameKey(tournamentId), name), StringEntry(tournamentCreatorKey(tournamentId), callerAddrStr)], 1) | |
306 | + | } | |
307 | + | else throw("Strict value is not equal to itself.") | |
308 | + | } | |
309 | + | ||
310 | + | ||
311 | + | ||
312 | + | @Callable(i) | |
313 | + | func startTournament (tournamentId) = if ((i.caller != this)) | |
314 | + | then throw("Admin Only") | |
315 | + | else $Tuple2([StringEntry(tournamentStatusKey(tournamentId), "started")], 1) | |
316 | + | ||
317 | + | ||
318 | + | ||
319 | + | @Callable(i) | |
320 | + | func finishTournament (tournamentId,winningTransfertTransactionId) = if ((i.caller != this)) | |
321 | + | then throw("Admin Only") | |
322 | + | else { | |
323 | + | let tournamentCreator = getStringValue(tournamentCreatorKey(tournamentId)) | |
324 | + | let tournamentTotalBuyInAmount = tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId)) | |
325 | + | let tournamentBuyInAmount = getIntegerValue(tournamentBuyInAmountKey(tournamentId)) | |
326 | + | let tournamentBuyInAssetId = match getString(tournamentBuyInAssetIdKey(tournamentId)) { | |
327 | + | case id: String => | |
328 | + | if ((id == "")) | |
329 | + | then unit | |
330 | + | else fromBase58String(id) | |
331 | + | case _ => | |
332 | + | unit | |
333 | + | } | |
334 | + | let tournamentBuyInFee = fraction(tournamentTotalBuyInAmount, tournamentBuyInFeePercent, 100) | |
335 | + | let tournamentPrizeAmount = getIntegerValue(tournamentPrizeAmountKey(tournamentId)) | |
336 | + | if ((tournamentPrizeAmount > 0)) | |
337 | + | then $Tuple2([StringEntry(tournamentWinningTransactionIdKey(tournamentId), winningTransfertTransactionId), StringEntry(tournamentStatusKey(tournamentId), "finished"), IntegerEntry(tournamentBuyInFeeCollectedKey(tournamentId), tournamentBuyInFee), ScriptTransfer(addressFromStringValue(tournamentCreator), (tournamentTotalBuyInAmount - tournamentBuyInFee), tournamentBuyInAssetId)], 1) | |
338 | + | else { | |
339 | + | let serviceFee = fraction(tournamentBuyInFee, 20, 100) | |
340 | + | $Tuple2([StringEntry(tournamentWinningTransactionIdKey(tournamentId), winningTransfertTransactionId), StringEntry(tournamentStatusKey(tournamentId), "finished"), IntegerEntry(tournamentBuyInFeeCollectedKey(tournamentId), tournamentBuyInFee), IntegerEntry(tournamentServiceFeeCollectedKey(tournamentId), serviceFee), ScriptTransfer(addressFromStringValue(tournamentCreator), (tournamentBuyInFee - serviceFee), tournamentBuyInAssetId)], 1) | |
341 | + | } | |
342 | + | } | |
343 | + | ||
344 | + | ||
345 | + | ||
346 | + | @Callable(i) | |
347 | + | func playerExitGame (gameId,playerAddr,exitStackAmount) = if ((i.caller != this)) | |
348 | + | then throw("Admin Only") | |
349 | + | else { | |
350 | + | let currentTotalLockedFunds = tryGetInteger(addressTotalLockedFundsKey(playerAddr)) | |
351 | + | let currentGameLockedAmountForPlayer = tryGetInteger(addressLockedFundsForGameKey(playerAddr, gameId)) | |
352 | + | $Tuple2([IntegerEntry(addressTotalLockedFundsKey(playerAddr), (currentTotalLockedFunds - currentGameLockedAmountForPlayer)), IntegerEntry(addressLockedFundsForGameKey(playerAddr, gameId), 0), ScriptTransfer(addressFromStringValue(playerAddr), exitStackAmount, fromBase58String(depositAssetId))], 1) | |
353 | + | } | |
354 | + | ||
355 | + | ||
356 | + | ||
357 | + | @Callable(i) | |
358 | + | func lockFundsForGame (gameId) = { | |
359 | + | let pmt = if ((size(i.payments) == 1)) | |
360 | + | then i.payments[0] | |
361 | + | else throw("Please attach exactly one payment") | |
362 | + | if ((pmt.assetId != fromBase58String(depositAssetId))) | |
363 | + | then throw("You can only deposit USDN") | |
364 | + | else { | |
365 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
366 | + | let currentTotalLockedFunds = tryGetInteger(addressTotalLockedFundsKey(callerAddrStr)) | |
367 | + | let currentLockedFundsTotalHistory = tryGetInteger(addressLockedFundsTotalHistoryKey(callerAddrStr)) | |
368 | + | $Tuple2([IntegerEntry(addressTotalLockedFundsKey(callerAddrStr), (currentTotalLockedFunds + pmt.amount)), IntegerEntry(addressLockedFundsTotalHistoryKey(callerAddrStr), (currentLockedFundsTotalHistory + pmt.amount)), IntegerEntry(addressLockedFundsForGameKey(callerAddrStr, gameId), pmt.amount)], 1) | |
369 | + | } | |
370 | + | } | |
371 | + | ||
372 | + | ||
373 | + | ||
374 | + | @Callable(i) | |
375 | + | func withdrawFunds () = { | |
376 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
377 | + | let feeCollectorAddr = addressFromStringValue(getStringValue(feeCollectorAddressKey)) | |
378 | + | let currentAvailableFunds = tryGetInteger(addressAvailableFundsKey(callerAddrStr)) | |
379 | + | let withdrawFee = fraction(currentAvailableFunds, withdrawFeePercent, 100) | |
380 | + | let actualAvailableFunds = (currentAvailableFunds - withdrawFee) | |
381 | + | if ((0 >= actualAvailableFunds)) | |
382 | + | then throw("No available funds to withdraw") | |
383 | + | else [IntegerEntry(addressAvailableFundsKey(callerAddrStr), 0), ScriptTransfer(i.caller, actualAvailableFunds, fromBase58String(depositAssetId)), ScriptTransfer(feeCollectorAddr, withdrawFee, fromBase58String(depositAssetId))] | |
384 | + | } | |
385 | + | ||
386 | + | ||
387 | + | ||
388 | + | @Callable(i) | |
389 | + | func setWinnerHeadsUp (gameId,winnerAddrStr,otherPlayerAddr) = if ((i.caller != this)) | |
390 | + | then throw("Admin Only") | |
391 | + | else { | |
392 | + | let availableRewardsKey = addressAvailableRewardsKey(winnerAddrStr) | |
393 | + | let currentAvailableRewards = tryGetInteger(availableRewardsKey) | |
394 | + | let newTicketCountWinner = consumeTicket(winnerAddrStr) | |
395 | + | let newTicketCountOtherPlayer = consumeTicket(otherPlayerAddr) | |
396 | + | [StringEntry(gameWinnerKey(gameId), winnerAddrStr), IntegerEntry(availableRewardsKey, (currentAvailableRewards + (ticketPrice * 2))), IntegerEntry(getTicketsCountKey(winnerAddrStr), newTicketCountWinner), IntegerEntry(getTicketsCountKey(otherPlayerAddr), newTicketCountOtherPlayer)] | |
397 | + | } | |
398 | + | ||
399 | + | ||
400 | + | ||
401 | + | @Callable(i) | |
402 | + | func withdrawRewards () = { | |
403 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
404 | + | let feeCollectorAddr = addressFromStringValue(getStringValue(feeCollectorAddressKey)) | |
405 | + | let currentAvailableRewards = tryGetInteger(addressAvailableRewardsKey(callerAddrStr)) | |
406 | + | let withdrawFee = fraction(currentAvailableRewards, withdrawFeePercent, 100) | |
407 | + | let actualAvailableRewards = ((currentAvailableRewards - invFee) - withdrawFee) | |
408 | + | if ((0 >= currentAvailableRewards)) | |
409 | + | then throw("No available rewards to withdraw") | |
410 | + | else [IntegerEntry(addressAvailableRewardsKey(callerAddrStr), 0), ScriptTransfer(i.caller, actualAvailableRewards, unit), ScriptTransfer(feeCollectorAddr, withdrawFee, unit)] | |
411 | + | } | |
412 | + | ||
413 | + | ||
414 | + | ||
415 | + | @Callable(i) | |
416 | + | func buyTickets () = { | |
417 | + | let pmt = if ((size(i.payments) == 1)) | |
418 | + | then i.payments[0] | |
419 | + | else throw("Please attach exactly one payment") | |
420 | + | if (isDefined(pmt.assetId)) | |
421 | + | then throw("Tickets can only ibe purchased in Waves") | |
422 | + | else if ((pmt.amount != ticketPrice)) | |
423 | + | then throw((("The payment must be of exactly " + toString(ticketPriceInt)) + " waves")) | |
424 | + | else { | |
425 | + | let callerAddrStr = toBase58String(i.caller.bytes) | |
426 | + | let currentTicketsCount = tryGetInteger(getTicketsCountKey(callerAddrStr)) | |
427 | + | $Tuple2([IntegerEntry(getTicketsCountKey(callerAddrStr), (currentTicketsCount + 1))], 1) | |
428 | + | } | |
429 | + | } | |
430 | + | ||
431 | + | ||
432 | + | @Verifier(tx) | |
433 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
434 | + |
github/deemru/w8io/026f985 30.00 ms ◑