tx · C2gSDi61YeUkgaD14RuipYvmyjDH5bYwo4LH1hamXHdv

3N3dmyiBdj7pmjnQrzTTvmfzKSqndSzCMmk:  -0.01500000 Waves

2022.09.30 22:32 [2252270] smart account 3N3dmyiBdj7pmjnQrzTTvmfzKSqndSzCMmk > SELF 0.00000000 Waves

{ "type": 13, "id": "C2gSDi61YeUkgaD14RuipYvmyjDH5bYwo4LH1hamXHdv", "fee": 1500000, "feeAssetId": null, "timestamp": 1664566322374, "version": 2, "chainId": 84, "sender": "3N3dmyiBdj7pmjnQrzTTvmfzKSqndSzCMmk", "senderPublicKey": "AR4BeE6hYADMvKxgRQs4ADN3krEqb2j8WE3WfJxzL3zE", "proofs": [ "2hbCA9b9HPkLFnPiqrinJ5cmcCq4Cu8vH5nkdr9i3EoP4akdRozuUVBeGz3ii4zvyBnn6n9QhKT6gPuGBBXETskf" ], "script": "base64:BgJACAISAwoBCBIAEgMKAQgSAwoBCBIDCgEIEgcKBQgIAQEIEgQKAggIEgUKAwgIARIDCgEIEgASBQoDCAgIEgASACUABXdhdmVzAIDC1y8ADnRpY2tldFByaWNlSW50AMCEPQALdGlja2V0UHJpY2UFDnRpY2tldFByaWNlSW50AAZpbnZGZWUAoMIeABJ3aXRoZHJhd0ZlZVBlcmNlbnQABQAWZmVlQ29sbGVjdG9yQWRkcmVzc0tleQITZmVlQ29sbGVjdG9yQWRkcmVzcwAZdG91cm5hbWVudEJ1eUluRmVlUGVyY2VudAAKAA5kZXBvc2l0QXNzZXRJZAIsNXVlMWZpdVY2ajZVQnI2WGYyOFFtczZ5NUZxekt0cXZheHhod3U3aFRRNTgBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAABEmdldFRpY2tldHNDb3VudEtleQENYWRkcmVzc1N0cmluZwkArAICBQ1hZGRyZXNzU3RyaW5nAg1fdGlja2V0c0NvdW50ASJidXlJbkFtb3VudEZvclRvdXJuYW1lbnRGb3JBY2NvdW50Agx0b3VybmFtZW50SWQHYWNjb3VudAkArAICCQCsAgIFDHRvdXJuYW1lbnRJZAIXX2J1eUluQW1vdW50Rm9yQWNjb3VudF8FB2FjY291bnQBI2J1eUluQXNzZXRJZEZvclRvdXJuYW1lbnRGb3JBY2NvdW50Agx0b3VybmFtZW50SWQHYWNjb3VudAkArAICCQCsAgIFDHRvdXJuYW1lbnRJZAIYX2J1eUluQXNzZXRJZEZvckFjY291bnRfBQdhY2NvdW50AR10aWNrZXRGb3JUb3VybmFtZW50Rm9yQWNjb3VudAIMdG91cm5hbWVudElkB2FjY291bnQJAKwCAgkArAICBQx0b3VybmFtZW50SWQCEl90aWNrZXRGb3JBY2NvdW50XwUHYWNjb3VudAEmdG91cm5hbWVudFRvdGFsQnV5SW5Db2xsZWN0ZWRBbW91bnRLZXkBDHRvdXJuYW1lbnRJZAkArAICBQx0b3VybmFtZW50SWQCJF90b3VybmFtZW50VG90YWxCdXlJbkNvbGxlY3RlZEFtb3VudAEUdG91cm5hbWVudENyZWF0b3JLZXkBDHRvdXJuYW1lbnRJZAkArAICBQx0b3VybmFtZW50SWQCEl90b3VybmFtZW50Q3JlYXRvcgERdG91cm5hbWVudE5hbWVLZXkBDHRvdXJuYW1lbnRJZAkArAICBQx0b3VybmFtZW50SWQCD190b3VybmFtZW50TmFtZQEYdG91cm5hbWVudFByaXplQW1vdW50S2V5AQx0b3VybmFtZW50SWQJAKwCAgUMdG91cm5hbWVudElkAhZfdG91cm5hbWVudFByaXplQW1vdW50ARx0b3VybmFtZW50TWF4UGxheWVyc0NvdW50S2V5AQx0b3VybmFtZW50SWQJAKwCAgUMdG91cm5hbWVudElkAhpfdG91cm5hbWVudE1heFBsYXllcnNDb3VudAEZdG91cm5hbWVudFBsYXllcnNDb3VudEtleQEMdG91cm5hbWVudElkCQCsAgIFDHRvdXJuYW1lbnRJZAIXX3RvdXJuYW1lbnRQbGF5ZXJzQ291bnQBGXR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sbGVyQWRkclN0cgkAZAIFE2N1cnJlbnRUaWNrZXRzQ291bnQAAQUDbmlsAAEBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5J2XvIg==", "height": 2252270, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ALVv1Gqtyyj22fLfvrxvF2tyZc65AyiTbPYgEDDNt35P Next: H5vptWcjz4WPsYBEns1hEzCtjeDRsetyRaRc5U3gLDme Diff:
OldNewDifferences
1313
1414 let feeCollectorAddressKey = "feeCollectorAddress"
1515
16+let tournamentBuyInFeePercent = 10
17+
1618 let depositAssetId = "5ue1fiuV6j6UBr6Xf28Qms6y5FqzKtqvaxxhwu7hTQ58"
1719
1820 func tryGetInteger (key) = match getInteger(this, key) {
2628 func getTicketsCountKey (addressString) = (addressString + "_ticketsCount")
2729
2830
31+func buyInAmountForTournamentForAccount (tournamentId,account) = ((tournamentId + "_buyInAmountForAccount_") + account)
32+
33+
34+func buyInAssetIdForTournamentForAccount (tournamentId,account) = ((tournamentId + "_buyInAssetIdForAccount_") + account)
35+
36+
2937 func ticketForTournamentForAccount (tournamentId,account) = ((tournamentId + "_ticketForAccount_") + account)
3038
3139
3240 func tournamentTotalBuyInCollectedAmountKey (tournamentId) = (tournamentId + "_tournamentTotalBuyInCollectedAmount")
41+
42+
43+func tournamentCreatorKey (tournamentId) = (tournamentId + "_tournamentCreator")
3344
3445
3546 func tournamentNameKey (tournamentId) = (tournamentId + "_tournamentName")
6677
6778
6879 func tournamentStatusKey (tournamentId) = (tournamentId + "_tournamentStatus")
80+
81+
82+func tournamentBuyInFeeCollectedKey (tournamentId) = (tournamentId + "_tournamentBuyInFeeCollected")
6983
7084
7185 func tournamentWinningTransactionIdKey (tournamentId) = (tournamentId + "_tournamentWinningTransactionId")
125139
126140
127141 @Callable(i)
142+func cancelSignUpToTournament (tournamentId) = {
143+ let tournamentStatus = getStringValue(tournamentStatusKey(tournamentId))
144+ if ((tournamentStatus != "registration"))
145+ then throw("Tournament is not in registration phase!")
146+ else {
147+ let callerAddrStr = toBase58String(i.caller.bytes)
148+ let paidBuyInAmount = getIntegerValue(buyInAmountForTournamentForAccount(tournamentId, callerAddrStr))
149+ let paidBuyInAssetId = getStringValue(buyInAssetIdForTournamentForAccount(tournamentId, callerAddrStr))
150+ let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId))
151+ let totalBuyInCollectedAmount = tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId))
152+ $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)
153+ }
154+ }
155+
156+
157+
158+@Callable(i)
128159 func signUpToTournament (tournamentId) = {
129160 let maxPlayersCount = getIntegerValue(this, tournamentMaxPlayersCountKey(tournamentId))
130161 let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId))
154185 else {
155186 let callerAddrStr = toBase58String(i.caller.bytes)
156187 let totalBuyInCollectedAmount = tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId))
157- $Tuple2([BooleanEntry(ticketForTournamentForAccount(tournamentId, callerAddrStr), true), IntegerEntry(tournamentPlayersCountKey(tournamentId), (alreadyRegisteredPlayersCount + 1)), IntegerEntry(tournamentTotalBuyInCollectedAmountKey(tournamentId), (totalBuyInCollectedAmount + pmt.amount))], 1)
188+ $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)
158189 }
159190 }
191+ }
192+
193+
194+
195+@Callable(i)
196+func cancelTournament (tournamentId) = {
197+ let callerAddrStr = toBase58String(i.caller.bytes)
198+ let tournamentCreator = getStringValue(tournamentCreatorKey(tournamentId))
199+ if ((tournamentCreator != callerAddrStr))
200+ then throw("Only tournament creator can cancel it!")
201+ else {
202+ let tournamentStatus = getStringValue(tournamentStatusKey(tournamentId))
203+ if ((tournamentStatus != "registration"))
204+ then throw("Tournament is not in registration phase!")
205+ else {
206+ let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId))
207+ if ((alreadyRegisteredPlayersCount > 0))
208+ then throw("Cannot cancel a tournament when players are already registered to it!")
209+ else {
210+ let tournamentPrizeAmount = getIntegerValue(tournamentPrizeAmountKey(tournamentId))
211+ let tournamentPrizeAssetId = getStringValue(tournamentPrizeAssetIdKey(tournamentId))
212+ $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)
213+ }
214+ }
215+ }
160216 }
161217
162218
193249 case _ =>
194250 ["", 0]
195251 }
252+ let callerAddrStr = toBase58String(i.caller.bytes)
196253 $Tuple2([IntegerEntry(tournamentPrizeAmountKey(tournamentId), pmt.amount), IntegerEntry(tournamentPlayersCountKey(tournamentId), 0), IntegerEntry(tournamentMaxPlayersCountKey(tournamentId), playersCount), StringEntry(tournamentPrizeAssetIdKey(tournamentId), prizeAssetId), StringEntry(tournamentPrizeAssetNameKey(tournamentId), {
197254 let @ = assetDetails[0]
198255 if ($isInstanceOf(@, "String"))
213270 if ($isInstanceOf(@, "Int"))
214271 then @
215272 else throw(($getType(buyInAsset[1]) + " couldn't be cast to Int"))
216- }), StringEntry(tournamentBuyInAssetIdKey(tournamentId), buyInAssetId), StringEntry(tournamentNameKey(tournamentId), name)], 1)
273+ }), StringEntry(tournamentBuyInAssetIdKey(tournamentId), buyInAssetId), StringEntry(tournamentNameKey(tournamentId), name), StringEntry(tournamentCreatorKey(tournamentId), callerAddrStr)], 1)
217274 }
218275
219276
221278 @Callable(i)
222279 func finishTournament (tournamentId,winningTransfertTransactionId) = if ((i.caller != this))
223280 then throw("Admin Only")
224- else $Tuple2([StringEntry(tournamentWinningTransactionIdKey(tournamentId), winningTransfertTransactionId), StringEntry(tournamentStatusKey(tournamentId), "finished")], 1)
281+ else {
282+ let tournamentCreator = getStringValue(tournamentCreatorKey(tournamentId))
283+ let tournamentTotalBuyInAmount = tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId))
284+ let tournamentBuyInAmount = getIntegerValue(tournamentBuyInAmountKey(tournamentId))
285+ let tournamentBuyInAssetId = match getString(tournamentBuyInAssetIdKey(tournamentId)) {
286+ case id: String =>
287+ if ((id == ""))
288+ then unit
289+ else fromBase58String(id)
290+ case _ =>
291+ unit
292+ }
293+ let tournamentBuyInFee = fraction(tournamentTotalBuyInAmount, tournamentBuyInFeePercent, 100)
294+ $Tuple2([StringEntry(tournamentWinningTransactionIdKey(tournamentId), winningTransfertTransactionId), StringEntry(tournamentStatusKey(tournamentId), "finished"), IntegerEntry(tournamentBuyInFeeCollectedKey(tournamentId), tournamentBuyInFee), ScriptTransfer(addressFromStringValue(tournamentCreator), (tournamentTotalBuyInAmount - tournamentBuyInFee), tournamentBuyInAssetId)], 1)
295+ }
225296
226297
227298
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let waves = 100000000
55
66 let ticketPriceInt = 1000000
77
88 let ticketPrice = ticketPriceInt
99
1010 let invFee = 500000
1111
1212 let withdrawFeePercent = 5
1313
1414 let feeCollectorAddressKey = "feeCollectorAddress"
1515
16+let tournamentBuyInFeePercent = 10
17+
1618 let depositAssetId = "5ue1fiuV6j6UBr6Xf28Qms6y5FqzKtqvaxxhwu7hTQ58"
1719
1820 func tryGetInteger (key) = match getInteger(this, key) {
1921 case b: Int =>
2022 b
2123 case _ =>
2224 0
2325 }
2426
2527
2628 func getTicketsCountKey (addressString) = (addressString + "_ticketsCount")
2729
2830
31+func buyInAmountForTournamentForAccount (tournamentId,account) = ((tournamentId + "_buyInAmountForAccount_") + account)
32+
33+
34+func buyInAssetIdForTournamentForAccount (tournamentId,account) = ((tournamentId + "_buyInAssetIdForAccount_") + account)
35+
36+
2937 func ticketForTournamentForAccount (tournamentId,account) = ((tournamentId + "_ticketForAccount_") + account)
3038
3139
3240 func tournamentTotalBuyInCollectedAmountKey (tournamentId) = (tournamentId + "_tournamentTotalBuyInCollectedAmount")
41+
42+
43+func tournamentCreatorKey (tournamentId) = (tournamentId + "_tournamentCreator")
3344
3445
3546 func tournamentNameKey (tournamentId) = (tournamentId + "_tournamentName")
3647
3748
3849 func tournamentPrizeAmountKey (tournamentId) = (tournamentId + "_tournamentPrizeAmount")
3950
4051
4152 func tournamentMaxPlayersCountKey (tournamentId) = (tournamentId + "_tournamentMaxPlayersCount")
4253
4354
4455 func tournamentPlayersCountKey (tournamentId) = (tournamentId + "_tournamentPlayersCount")
4556
4657
4758 func tournamentPrizeAssetIdKey (tournamentId) = (tournamentId + "_tournamentPrizeAssetId")
4859
4960
5061 func tournamentPrizeAssetNameKey (tournamentId) = (tournamentId + "_tournamentPrizeAssetName")
5162
5263
5364 func tournamentBuyInAmountKey (tournamentId) = (tournamentId + "_tournamentBuyInAmount")
5465
5566
5667 func tournamentBuyInAssetIdKey (tournamentId) = (tournamentId + "_tournamentBuyInAssetId")
5768
5869
5970 func tournamentBuyInAssetNameKey (tournamentId) = (tournamentId + "_tournamentBuyInAssetName")
6071
6172
6273 func tournamentBuyInAssetDecimalsKey (tournamentId) = (tournamentId + "_tournamentBuyInAssetDecimals")
6374
6475
6576 func tournamentPrizeAssetDecimalsKey (tournamentId) = (tournamentId + "_tournamentPrizeAssetDecimals")
6677
6778
6879 func tournamentStatusKey (tournamentId) = (tournamentId + "_tournamentStatus")
80+
81+
82+func tournamentBuyInFeeCollectedKey (tournamentId) = (tournamentId + "_tournamentBuyInFeeCollected")
6983
7084
7185 func tournamentWinningTransactionIdKey (tournamentId) = (tournamentId + "_tournamentWinningTransactionId")
7286
7387
7488 func gameWinnerKey (gameId) = (gameId + "_winner")
7589
7690
7791 func addressAvailableFundsKey (address) = (address + "_availableFunds")
7892
7993
8094 func addressTotalLockedFundsKey (address) = (address + "_totalLockedFunds")
8195
8296
8397 func addressLockedFundsTotalHistoryKey (address) = (address + "_lockedFundsTotalHistory")
8498
8599
86100 func addressLockedFundsForGameKey (address,gameId) = ((address + "_lockedFunds_") + gameId)
87101
88102
89103 func addressAvailableRewardsKey (address) = (address + "_availableRewards")
90104
91105
92106 func getTicketsCount (addressString) = tryGetInteger(getTicketsCountKey(addressString))
93107
94108
95109 func consumeTicket (playerAddr) = {
96110 let currentTicketCount = getTicketsCount(playerAddr)
97111 let newCurrentTicketCount = (currentTicketCount - 1)
98112 if ((0 > newCurrentTicketCount))
99113 then 0
100114 else newCurrentTicketCount
101115 }
102116
103117
104118 @Callable(i)
105119 func setFeeCollectorAddress (collectorAddr) = if ((i.caller != this))
106120 then throw("Admin Only")
107121 else [StringEntry(feeCollectorAddressKey, collectorAddr)]
108122
109123
110124
111125 @Callable(i)
112126 func depositFunds () = {
113127 let pmt = if ((size(i.payments) == 1))
114128 then i.payments[0]
115129 else throw("Please attach exactly one payment")
116130 if ((pmt.assetId != fromBase58String(depositAssetId)))
117131 then throw("You can only deposit USDN")
118132 else {
119133 let callerAddrStr = toBase58String(i.caller.bytes)
120134 let currentAvailableFunds = tryGetInteger(addressAvailableFundsKey(callerAddrStr))
121135 $Tuple2([IntegerEntry(addressAvailableFundsKey(callerAddrStr), (currentAvailableFunds + pmt.amount))], 1)
122136 }
123137 }
124138
125139
126140
127141 @Callable(i)
142+func cancelSignUpToTournament (tournamentId) = {
143+ let tournamentStatus = getStringValue(tournamentStatusKey(tournamentId))
144+ if ((tournamentStatus != "registration"))
145+ then throw("Tournament is not in registration phase!")
146+ else {
147+ let callerAddrStr = toBase58String(i.caller.bytes)
148+ let paidBuyInAmount = getIntegerValue(buyInAmountForTournamentForAccount(tournamentId, callerAddrStr))
149+ let paidBuyInAssetId = getStringValue(buyInAssetIdForTournamentForAccount(tournamentId, callerAddrStr))
150+ let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId))
151+ let totalBuyInCollectedAmount = tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId))
152+ $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)
153+ }
154+ }
155+
156+
157+
158+@Callable(i)
128159 func signUpToTournament (tournamentId) = {
129160 let maxPlayersCount = getIntegerValue(this, tournamentMaxPlayersCountKey(tournamentId))
130161 let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId))
131162 let tournamentStatus = getStringValue(tournamentStatusKey(tournamentId))
132163 if ((tournamentStatus != "registration"))
133164 then throw("Tournament is not in registration phase!")
134165 else if ((alreadyRegisteredPlayersCount == maxPlayersCount))
135166 then throw("Tournament is currently full, please try again later!")
136167 else {
137168 let pmt = if ((size(i.payments) == 1))
138169 then i.payments[0]
139170 else throw("Please attach exactly one payment")
140171 let buyInAssetid = match pmt.assetId {
141172 case b: Unit =>
142173 ""
143174 case b: ByteVector =>
144175 toBase58String(b)
145176 case _ =>
146177 throw("Match error")
147178 }
148179 let buyInRequiredAmount = getIntegerValue(this, tournamentBuyInAmountKey(tournamentId))
149180 let buyInRequiredAssetId = getStringValue(this, tournamentBuyInAssetIdKey(tournamentId))
150181 if ((buyInRequiredAmount != pmt.amount))
151182 then throw(("Attached payment amount is invalid, must be " + toString(buyInRequiredAmount)))
152183 else if ((buyInRequiredAssetId != buyInAssetid))
153184 then throw(("Attached payment asset id is invalid, must be " + buyInRequiredAssetId))
154185 else {
155186 let callerAddrStr = toBase58String(i.caller.bytes)
156187 let totalBuyInCollectedAmount = tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId))
157- $Tuple2([BooleanEntry(ticketForTournamentForAccount(tournamentId, callerAddrStr), true), IntegerEntry(tournamentPlayersCountKey(tournamentId), (alreadyRegisteredPlayersCount + 1)), IntegerEntry(tournamentTotalBuyInCollectedAmountKey(tournamentId), (totalBuyInCollectedAmount + pmt.amount))], 1)
188+ $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)
158189 }
159190 }
191+ }
192+
193+
194+
195+@Callable(i)
196+func cancelTournament (tournamentId) = {
197+ let callerAddrStr = toBase58String(i.caller.bytes)
198+ let tournamentCreator = getStringValue(tournamentCreatorKey(tournamentId))
199+ if ((tournamentCreator != callerAddrStr))
200+ then throw("Only tournament creator can cancel it!")
201+ else {
202+ let tournamentStatus = getStringValue(tournamentStatusKey(tournamentId))
203+ if ((tournamentStatus != "registration"))
204+ then throw("Tournament is not in registration phase!")
205+ else {
206+ let alreadyRegisteredPlayersCount = tryGetInteger(tournamentPlayersCountKey(tournamentId))
207+ if ((alreadyRegisteredPlayersCount > 0))
208+ then throw("Cannot cancel a tournament when players are already registered to it!")
209+ else {
210+ let tournamentPrizeAmount = getIntegerValue(tournamentPrizeAmountKey(tournamentId))
211+ let tournamentPrizeAssetId = getStringValue(tournamentPrizeAssetIdKey(tournamentId))
212+ $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)
213+ }
214+ }
215+ }
160216 }
161217
162218
163219
164220 @Callable(i)
165221 func createTournament (tournamentId,name,playersCount,buyInAmount,buyInAssetId) = {
166222 let pmt = if ((size(i.payments) == 1))
167223 then i.payments[0]
168224 else throw("Please attach exactly one payment")
169225 let prizeAssetId = match pmt.assetId {
170226 case b: Unit =>
171227 ""
172228 case b: ByteVector =>
173229 toBase58String(b)
174230 case _ =>
175231 throw("Match error")
176232 }
177233 let assetDetails = match pmt.assetId {
178234 case b: Unit =>
179235 ["Waves", 8]
180236 case b: ByteVector =>
181237 match assetInfo(b) {
182238 case asset: Asset =>
183239 [asset.name, asset.decimals]
184240 case _ =>
185241 throw("Can't find asset")
186242 }
187243 case _ =>
188244 throw("Match error")
189245 }
190246 let buyInAsset = match assetInfo(fromBase58String(buyInAssetId)) {
191247 case asset: Asset =>
192248 [asset.name, asset.decimals]
193249 case _ =>
194250 ["", 0]
195251 }
252+ let callerAddrStr = toBase58String(i.caller.bytes)
196253 $Tuple2([IntegerEntry(tournamentPrizeAmountKey(tournamentId), pmt.amount), IntegerEntry(tournamentPlayersCountKey(tournamentId), 0), IntegerEntry(tournamentMaxPlayersCountKey(tournamentId), playersCount), StringEntry(tournamentPrizeAssetIdKey(tournamentId), prizeAssetId), StringEntry(tournamentPrizeAssetNameKey(tournamentId), {
197254 let @ = assetDetails[0]
198255 if ($isInstanceOf(@, "String"))
199256 then @
200257 else throw(($getType(assetDetails[0]) + " couldn't be cast to String"))
201258 }), IntegerEntry(tournamentPrizeAssetDecimalsKey(tournamentId), {
202259 let @ = assetDetails[1]
203260 if ($isInstanceOf(@, "Int"))
204261 then @
205262 else throw(($getType(assetDetails[1]) + " couldn't be cast to Int"))
206263 }), StringEntry(tournamentStatusKey(tournamentId), "registration"), IntegerEntry(tournamentBuyInAmountKey(tournamentId), buyInAmount), StringEntry(tournamentBuyInAssetNameKey(tournamentId), {
207264 let @ = buyInAsset[0]
208265 if ($isInstanceOf(@, "String"))
209266 then @
210267 else throw(($getType(buyInAsset[0]) + " couldn't be cast to String"))
211268 }), IntegerEntry(tournamentBuyInAssetDecimalsKey(tournamentId), {
212269 let @ = buyInAsset[1]
213270 if ($isInstanceOf(@, "Int"))
214271 then @
215272 else throw(($getType(buyInAsset[1]) + " couldn't be cast to Int"))
216- }), StringEntry(tournamentBuyInAssetIdKey(tournamentId), buyInAssetId), StringEntry(tournamentNameKey(tournamentId), name)], 1)
273+ }), StringEntry(tournamentBuyInAssetIdKey(tournamentId), buyInAssetId), StringEntry(tournamentNameKey(tournamentId), name), StringEntry(tournamentCreatorKey(tournamentId), callerAddrStr)], 1)
217274 }
218275
219276
220277
221278 @Callable(i)
222279 func finishTournament (tournamentId,winningTransfertTransactionId) = if ((i.caller != this))
223280 then throw("Admin Only")
224- else $Tuple2([StringEntry(tournamentWinningTransactionIdKey(tournamentId), winningTransfertTransactionId), StringEntry(tournamentStatusKey(tournamentId), "finished")], 1)
281+ else {
282+ let tournamentCreator = getStringValue(tournamentCreatorKey(tournamentId))
283+ let tournamentTotalBuyInAmount = tryGetInteger(tournamentTotalBuyInCollectedAmountKey(tournamentId))
284+ let tournamentBuyInAmount = getIntegerValue(tournamentBuyInAmountKey(tournamentId))
285+ let tournamentBuyInAssetId = match getString(tournamentBuyInAssetIdKey(tournamentId)) {
286+ case id: String =>
287+ if ((id == ""))
288+ then unit
289+ else fromBase58String(id)
290+ case _ =>
291+ unit
292+ }
293+ let tournamentBuyInFee = fraction(tournamentTotalBuyInAmount, tournamentBuyInFeePercent, 100)
294+ $Tuple2([StringEntry(tournamentWinningTransactionIdKey(tournamentId), winningTransfertTransactionId), StringEntry(tournamentStatusKey(tournamentId), "finished"), IntegerEntry(tournamentBuyInFeeCollectedKey(tournamentId), tournamentBuyInFee), ScriptTransfer(addressFromStringValue(tournamentCreator), (tournamentTotalBuyInAmount - tournamentBuyInFee), tournamentBuyInAssetId)], 1)
295+ }
225296
226297
227298
228299 @Callable(i)
229300 func playerExitGame (gameId,playerAddr,exitStackAmount) = if ((i.caller != this))
230301 then throw("Admin Only")
231302 else {
232303 let currentTotalLockedFunds = tryGetInteger(addressTotalLockedFundsKey(playerAddr))
233304 let currentGameLockedAmountForPlayer = tryGetInteger(addressLockedFundsForGameKey(playerAddr, gameId))
234305 $Tuple2([IntegerEntry(addressTotalLockedFundsKey(playerAddr), (currentTotalLockedFunds - currentGameLockedAmountForPlayer)), IntegerEntry(addressLockedFundsForGameKey(playerAddr, gameId), 0), ScriptTransfer(addressFromStringValue(playerAddr), exitStackAmount, fromBase58String(depositAssetId))], 1)
235306 }
236307
237308
238309
239310 @Callable(i)
240311 func lockFundsForGame (gameId) = {
241312 let pmt = if ((size(i.payments) == 1))
242313 then i.payments[0]
243314 else throw("Please attach exactly one payment")
244315 if ((pmt.assetId != fromBase58String(depositAssetId)))
245316 then throw("You can only deposit USDN")
246317 else {
247318 let callerAddrStr = toBase58String(i.caller.bytes)
248319 let currentTotalLockedFunds = tryGetInteger(addressTotalLockedFundsKey(callerAddrStr))
249320 let currentLockedFundsTotalHistory = tryGetInteger(addressLockedFundsTotalHistoryKey(callerAddrStr))
250321 $Tuple2([IntegerEntry(addressTotalLockedFundsKey(callerAddrStr), (currentTotalLockedFunds + pmt.amount)), IntegerEntry(addressLockedFundsTotalHistoryKey(callerAddrStr), (currentLockedFundsTotalHistory + pmt.amount)), IntegerEntry(addressLockedFundsForGameKey(callerAddrStr, gameId), pmt.amount)], 1)
251322 }
252323 }
253324
254325
255326
256327 @Callable(i)
257328 func withdrawFunds () = {
258329 let callerAddrStr = toBase58String(i.caller.bytes)
259330 let feeCollectorAddr = addressFromStringValue(getStringValue(feeCollectorAddressKey))
260331 let currentAvailableFunds = tryGetInteger(addressAvailableFundsKey(callerAddrStr))
261332 let withdrawFee = fraction(currentAvailableFunds, withdrawFeePercent, 100)
262333 let actualAvailableFunds = (currentAvailableFunds - withdrawFee)
263334 if ((0 >= actualAvailableFunds))
264335 then throw("No available funds to withdraw")
265336 else [IntegerEntry(addressAvailableFundsKey(callerAddrStr), 0), ScriptTransfer(i.caller, actualAvailableFunds, fromBase58String(depositAssetId)), ScriptTransfer(feeCollectorAddr, withdrawFee, fromBase58String(depositAssetId))]
266337 }
267338
268339
269340
270341 @Callable(i)
271342 func setWinnerHeadsUp (gameId,winnerAddrStr,otherPlayerAddr) = if ((i.caller != this))
272343 then throw("Admin Only")
273344 else {
274345 let availableRewardsKey = addressAvailableRewardsKey(winnerAddrStr)
275346 let currentAvailableRewards = tryGetInteger(availableRewardsKey)
276347 let newTicketCountWinner = consumeTicket(winnerAddrStr)
277348 let newTicketCountOtherPlayer = consumeTicket(otherPlayerAddr)
278349 [StringEntry(gameWinnerKey(gameId), winnerAddrStr), IntegerEntry(availableRewardsKey, (currentAvailableRewards + (ticketPrice * 2))), IntegerEntry(getTicketsCountKey(winnerAddrStr), newTicketCountWinner), IntegerEntry(getTicketsCountKey(otherPlayerAddr), newTicketCountOtherPlayer)]
279350 }
280351
281352
282353
283354 @Callable(i)
284355 func withdrawRewards () = {
285356 let callerAddrStr = toBase58String(i.caller.bytes)
286357 let feeCollectorAddr = addressFromStringValue(getStringValue(feeCollectorAddressKey))
287358 let currentAvailableRewards = tryGetInteger(addressAvailableRewardsKey(callerAddrStr))
288359 let withdrawFee = fraction(currentAvailableRewards, withdrawFeePercent, 100)
289360 let actualAvailableRewards = ((currentAvailableRewards - invFee) - withdrawFee)
290361 if ((0 >= currentAvailableRewards))
291362 then throw("No available rewards to withdraw")
292363 else [IntegerEntry(addressAvailableRewardsKey(callerAddrStr), 0), ScriptTransfer(i.caller, actualAvailableRewards, unit), ScriptTransfer(feeCollectorAddr, withdrawFee, unit)]
293364 }
294365
295366
296367
297368 @Callable(i)
298369 func buyTickets () = {
299370 let pmt = if ((size(i.payments) == 1))
300371 then i.payments[0]
301372 else throw("Please attach exactly one payment")
302373 if (isDefined(pmt.assetId))
303374 then throw("Tickets can only ibe purchased in Waves")
304375 else if ((pmt.amount != ticketPrice))
305376 then throw((("The payment must be of exactly " + toString(ticketPriceInt)) + " waves"))
306377 else {
307378 let callerAddrStr = toBase58String(i.caller.bytes)
308379 let currentTicketsCount = tryGetInteger(getTicketsCountKey(callerAddrStr))
309380 $Tuple2([IntegerEntry(getTicketsCountKey(callerAddrStr), (currentTicketsCount + 1))], 1)
310381 }
311382 }
312383
313384
314385 @Verifier(tx)
315386 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
316387

github/deemru/w8io/873ac7e 
59.10 ms