tx · AQGZtp25SwDPbQBYoHzSr2XGxb4t5gcYdy26w4WBRLMW

3N8AAVCWsARDFzZzMWAoc6fd1zgzURX75PW:  -0.01400000 Waves

2022.09.30 00:34 [2250946] smart account 3N8AAVCWsARDFzZzMWAoc6fd1zgzURX75PW > SELF 0.00000000 Waves

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

github/deemru/w8io/026f985 
44.05 ms