tx · 8FSeP4uFcbJif1vaQCAR9KvWJyjk1AgkXdLxzSkpELGd 3MpkFCdSispaqdDqUAAWqEnVxLKPT6nKzJ4: -0.01700000 Waves 2022.10.25 00:45 [2287047] smart account 3MpkFCdSispaqdDqUAAWqEnVxLKPT6nKzJ4 > SELF 0.00000000 Waves
{ "type": 13, "id": "8FSeP4uFcbJif1vaQCAR9KvWJyjk1AgkXdLxzSkpELGd", "fee": 1700000, "feeAssetId": null, "timestamp": 1666647985872, "version": 2, "chainId": 84, "sender": "3MpkFCdSispaqdDqUAAWqEnVxLKPT6nKzJ4", "senderPublicKey": "6QC3XgxZ7LknQ4t7GpdJ6ojyVp67T2oyBKA4Kwq83LLs", "proofs": [ "4pZUERFgqnkwg4ZLy198xMGLjcVC2Bfv2pVbopXp7TX1iAWvLBLUgjCUDpC2yK57FEzEvvknToxF6QGcyjaDZhRM" ], "script": "base64:BgI4CAISAwoBCBIAEgMKAQgSAwoBCBIDCgEIEgcKBQgIAQEIEgMKAQgSBAoCCAgSBQoDCAgBEgMKAQgoAAV3YXZlcwCAwtcvAA50aWNrZXRQcmljZUludADAhD0AC3RpY2tldFByaWNlBQ50aWNrZXRQcmljZUludAAGaW52RmVlAKDCHgASd2l0aGRyYXdGZWVQZXJjZW50AAUAFmZlZUNvbGxlY3RvckFkZHJlc3NLZXkCE2ZlZUNvbGxlY3RvckFkZHJlc3MAGXRvdXJuYW1lbnRCdXlJbkZlZVBlcmNlbnQACgAOZGVwb3NpdEFzc2V0SWQCLDV1ZTFmaXVWNmo2VUJyNlhmMjhRbXM2eTVGcXpLdHF2YXh4aHd1N2hUUTU4AB9hbGxvd2VkU3BlY2lhbFRvdXJuYW1lbnRDcmVhdG9yAiMzTjI0ejdja2VGWnRTa2pLbkRqVEppejd2VGhac1ozdG1idQENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAW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nlLZXkBBQ1jYWxsZXJBZGRyU3RyCQCUCgIJAMwIAgkBDEludGVnZXJFbnRyeQIJARphZGRyZXNzVG90YWxMb2NrZWRGdW5kc0tleQEFDWNhbGxlckFkZHJTdHIJAGQCBRdjdXJyZW50VG90YWxMb2NrZWRGdW5kcwgFA3BtdAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIJASFhZGRyZXNzTG9ja2VkRnVuZHNUb3RhbEhpc3RvcnlLZXkBBQ1jYWxsZXJBZGRyU3RyCQBkAgUeY3VycmVudExvY2tlZEZ1bmRzVG90YWxIaXN0b3J5CAUDcG10BmFtb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBHGFkZHJlc3NMb2NrZWRGdW5kc0ZvckdhbWVLZXkCBQ1jYWxsZXJBZGRyU3RyBQZnYW1lSWQIBQNwbXQGYW1vdW50BQNuaWwAAQECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlHb3bT", "height": 2287047, "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 = "3N24z7ckeFZtSkjKnDjTJiz7vThZsZ3tmbu" | |
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 | + | @Verifier(tx) | |
374 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
375 | + |
github/deemru/w8io/026f985 24.83 ms ◑