tx · BiQSZyKCwfzcGY13xu7yTKgSb7xrDfdc3NumCVyn8Vd

3MtKQXaiKQxSTRPpa8GjJ5zE7mE992eBrGu:  -0.05000000 Waves

2020.01.04 21:40 [839502] smart account 3MtKQXaiKQxSTRPpa8GjJ5zE7mE992eBrGu > SELF 0.00000000 Waves

{ "type": 13, "id": "BiQSZyKCwfzcGY13xu7yTKgSb7xrDfdc3NumCVyn8Vd", "fee": 5000000, "feeAssetId": null, "timestamp": 1578163254357, "version": 1, "sender": "3MtKQXaiKQxSTRPpa8GjJ5zE7mE992eBrGu", "senderPublicKey": "2vmjFmSn7wGYrffwrNFgTN6j9CATDKwa8t8KAXWe2HVW", "proofs": [ "3tvEAo1BtvrYLvr3LZvL6Vg2rA8igBmgqfhpGJYZenRb4FcXzpJoqCrT9bQJ9P79JHgRskab2bRkdtFSWfiwdr15" ], "script": "base64:AAIDAAAAAAAAABIIARIDCgEIEgQKAggCEgMKAQgAAAAmAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBZ3NrN1lBbDZzUTV3VnU2UHpQZlhhYzQrOWZ4eGliK3NLNmRydlBRWmVCMkFrS3U2MzdaMHE0bUUxaGdFNnlvcDVzcGhoZ1VzbVJtMUJrYmk3MFZCYVJjRUdzczRISHNoMktIOFBEZFRSd1NMYnd0TjJYZkFSNWQwZ254a2t6bUM2M2VOcTJZNFhncWF4U2Y1ZlFUNTV5bUdWSHhoZm1CRDRyL3BGRUdiWCt5L01MTWlRRWRsT0NzTjJBUjlvVUlZY1dHenFsZ1dqa0J6emVmVDdkdzJBcEJzYlRMMlU1YkFQNnNKcWI1TVkxcWp0ZEY5NGVIMnQ1eXhTS3Z3OWR0YVBycjg4NGtCSUxKenVIWmxkcmlSYitYMHgrNGNBN05Ka2JVMmoyWUQ1ZWUxTmVSV0JXRGhrQ1NuNUpEbDlXeENHTnQrKz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UAAAAMcmVmdW5kV2FsbGV0BQAAAAlyZWZ1bmRBbXQFAAAAC3JlZnVuZFRva2VuBQAAAANuaWwAAAAA91j4Sg==", "chainId": 84, "height": 839502, "spentComplexity": 0 } View: original | compacted Prev: HB2bEKCqab8CHMfAPSSgGubf9suDK7M22WG9ebbp7DSX Next: AMw4ANAEQCyby6LuonB5eMmHDRG8Jx6cVghSUkvVXPTN Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB")
4+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgsk7YAl6sQ5wVu6PzPfXac4+9fxxib+sK6drvPQZeB2AkKu637Z0q4mE1hgE6yop5sphhgUsmRm1Bkbi70VBaRcEGss4HHsh2KH8PDdTRwSLbwtN2XfAR5d0gnxkkzmC63eNq2Y4XgqaxSf5fQT55ymGVHxhfmBD4r/pFEGbX+y/MLMiQEdlOCsN2AR9oUIYcWGzqlgWjkBzzefT7dw2ApBsbTL2U5bAP6sJqb5MY1qjtdF94eH2t5yxSKvw9dtaPrr884kBILJzuHZldriRb+X0x+4cA7NJkbU2j2YD5ee1NeRWBWDhkCSn5JDl9WxCGNt++9aEiGeTMUeY+W9otwIDAQAB")
55
66 let GAMESCOUNTERKEY = "$GAME_NUM"
77
88 let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw'
99
10-let WALLETWAVESBET = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
10+let WALLETCOMMUNITY = Address(base58'3P7bfbLomsuFA955TnhpNUQHMcvc4DTk38G')
1111
12-let WALLETMCAFEE = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
12+let WALLETWAVESBET = Address(base58'3PPbfEZzwMswooP4nDkavpxhJfisgQGgfnj')
1313
14-let FEEWAVESBET = 4
14+let WALLETMCAFEE = Address(base58'3P6gcpVsPxMJ9HHM1SoCM6RP68FHYKovCk5')
15+
16+let WAVELET = 100000000
17+
18+let FEECOMMUNITY = 1
19+
20+let FEEWAVESBET = 3
1521
1622 let FEEMCAFEE = 2
17-
18-let WAVELET = 100000000
1923
2024 let STATESUBMITTED = "SUBMITTED"
2125
162166 then (BETMINWAVES > amount)
163167 else false)
164168 then throw(("The minimum bet on Waves is " + toString((BETMINWAVES / WAVELET))))
165- else fraction((amount * 2), ((100 - FEEWAVESBET) - FEEMCAFEE), 100)
169+ else fraction((amount * 2), (((100 - FEEWAVESBET) - FEEMCAFEE) - FEECOMMUNITY), 100)
166170
167171
168172 @Callable(i)
178182 else if (feeAssetId)
179183 then throw("Transaction's fee must be in Waves. Game aborted.")
180184 else if (gameIdUsed)
181- then throw("Passed gameId had been used before. Game aborted.")
185+ then throw("Passed GameId had been used before. Game aborted.")
182186 else {
183187 let newGameNum = IncrementGameNum()
184188 let playerAPubKey58 = toBase58String(i.callerPublicKey)
231235 let winAddr = if ((paCoin == luckyCoin))
232236 then addressFromPublicKey(fromBase58String(paPubKey58))
233237 else i.caller
234- ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, fraction((payAmt * 2), FEEWAVESBET, 100), tokenAssetId), ScriptTransfer(WALLETMCAFEE, fraction((payAmt * 2), FEEMCAFEE, 100), tokenAssetId), ScriptTransfer(winAddr, winAmt, tokenAssetId)]))
238+ ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETCOMMUNITY, fraction((payAmt * 2), FEECOMMUNITY, 100), tokenAssetId), ScriptTransfer(WALLETWAVESBET, fraction((payAmt * 2), FEEWAVESBET, 100), tokenAssetId), ScriptTransfer(WALLETMCAFEE, fraction((payAmt * 2), FEEMCAFEE, 100), tokenAssetId), ScriptTransfer(winAddr, winAmt, tokenAssetId)]))
235239 }
236240 }
237241
254258 then throw("Invalid game state for passed gameId. Game aborted.")
255259 else if ((paPubKey58 != pubKey58))
256260 then throw("You cannot cancel a game created by another player. Game aborted.")
257- else if ((i.caller == this))
258- then throw("Coinflip contract cannot cancel a game. Game aborted.")
259- else {
260- let newGameDataStr = FormatGameDataStr(STATECANCELED, paCoin, paPubKey58, payType, payAmt, winAmt, "", "", "")
261- let refundAmt = fraction(payAmt, ((100 - FEEWAVESBET) - FEEMCAFEE), 100)
262- let refundWallet = addressFromPublicKey(fromBase58String(paPubKey58))
263- let refundToken = tokenType(payType)
264- ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, fraction(payAmt, FEEWAVESBET, 100), refundToken), ScriptTransfer(WALLETMCAFEE, fraction(payAmt, FEEMCAFEE, 100), refundToken), ScriptTransfer(refundWallet, refundAmt, refundToken)]))
265- }
261+ else {
262+ let newGameDataStr = FormatGameDataStr(STATECANCELED, paCoin, paPubKey58, payType, payAmt, winAmt, "", "", "")
263+ let refundAmt = fraction(payAmt, (((100 - FEEWAVESBET) - FEEMCAFEE) - FEECOMMUNITY), 100)
264+ let refundWallet = addressFromPublicKey(fromBase58String(paPubKey58))
265+ let refundToken = tokenType(payType)
266+ ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETCOMMUNITY, fraction((payAmt * 2), FEECOMMUNITY, 100), refundToken), ScriptTransfer(WALLETWAVESBET, fraction((payAmt * 2), FEEWAVESBET, 100), refundToken), ScriptTransfer(WALLETMCAFEE, fraction((payAmt * 2), FEEMCAFEE, 100), refundToken), ScriptTransfer(refundWallet, refundAmt, refundToken)]))
267+ }
266268 }
267269
268270
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB")
4+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgsk7YAl6sQ5wVu6PzPfXac4+9fxxib+sK6drvPQZeB2AkKu637Z0q4mE1hgE6yop5sphhgUsmRm1Bkbi70VBaRcEGss4HHsh2KH8PDdTRwSLbwtN2XfAR5d0gnxkkzmC63eNq2Y4XgqaxSf5fQT55ymGVHxhfmBD4r/pFEGbX+y/MLMiQEdlOCsN2AR9oUIYcWGzqlgWjkBzzefT7dw2ApBsbTL2U5bAP6sJqb5MY1qjtdF94eH2t5yxSKvw9dtaPrr884kBILJzuHZldriRb+X0x+4cA7NJkbU2j2YD5ee1NeRWBWDhkCSn5JDl9WxCGNt++9aEiGeTMUeY+W9otwIDAQAB")
55
66 let GAMESCOUNTERKEY = "$GAME_NUM"
77
88 let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw'
99
10-let WALLETWAVESBET = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
10+let WALLETCOMMUNITY = Address(base58'3P7bfbLomsuFA955TnhpNUQHMcvc4DTk38G')
1111
12-let WALLETMCAFEE = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
12+let WALLETWAVESBET = Address(base58'3PPbfEZzwMswooP4nDkavpxhJfisgQGgfnj')
1313
14-let FEEWAVESBET = 4
14+let WALLETMCAFEE = Address(base58'3P6gcpVsPxMJ9HHM1SoCM6RP68FHYKovCk5')
15+
16+let WAVELET = 100000000
17+
18+let FEECOMMUNITY = 1
19+
20+let FEEWAVESBET = 3
1521
1622 let FEEMCAFEE = 2
17-
18-let WAVELET = 100000000
1923
2024 let STATESUBMITTED = "SUBMITTED"
2125
2226 let STATEACCEPTED = "ACCEPTED"
2327
2428 let STATEFINISHED = "FINISHED"
2529
2630 let STATECANCELED = "CANCELED"
2731
2832 let COINRED = "RED"
2933
3034 let COINBLUE = "BLUE"
3135
3236 let BETMINWAVES = ((1 * WAVELET) / 4)
3337
3438 let BETMINWBET = (100 * WAVELET)
3539
3640 let IdxGameState = 0
3741
3842 let IdxPlayerACoin = 1
3943
4044 let IdxPlayerAPubKey58 = 2
4145
4246 let IdxPayType = 3
4347
4448 let IdxPayAmt = 4
4549
4650 let IdxWinAmt = 5
4751
4852 let IdxPlayerBCoin = 6
4953
5054 let IdxPlayerBPubKey58 = 7
5155
5256 let IdxLuckyCoin = 8
5357
5458 func IncrementGameNum () = {
5559 let gameNum = match getInteger(this, GAMESCOUNTERKEY) {
5660 case num: Int =>
5761 num
5862 case _ =>
5963 0
6064 }
6165 (gameNum + 1)
6266 }
6367
6468
6569 func GenerateRandInt (gameId,rsaSign) = {
6670 let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
6771 if (rsaSigValid)
6872 then {
6973 let rand = (toInt(sha256(rsaSign)) % 100)
7074 if ((0 > rand))
7175 then ((-1 * rand) + 1)
7276 else (rand + 1)
7377 }
7478 else throw("Invalid RSA signature")
7579 }
7680
7781
7882 func paymentType (payment) = if ((payment.assetId == WBET))
7983 then "WBET"
8084 else "WAVES"
8185
8286
8387 func tokenType (token) = if ((token == "WBET"))
8488 then WBET
8589 else unit
8690
8791
8892 func FormatGameDataParam (p) = {
8993 let s = size(p)
9094 if ((s == 0))
9195 then throw("Parameter size must be greater then 0")
9296 else if ((s > 99))
9397 then throw("Parameter size must be less then 100")
9498 else if ((10 > s))
9599 then (("0" + toString(s)) + p)
96100 else (toString(s) + p)
97101 }
98102
99103
100104 func FormatGameDataStr (gameState,playerACoin,playerAPubKey58,payType,payAmount,winAmt,playerBCoin,playerBPubKey58,luckyCoin) = {
101105 let fullStateStr = ((((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(playerACoin)) + "_") + FormatGameDataParam(playerAPubKey58)) + "_") + FormatGameDataParam(payType)) + "_") + FormatGameDataParam(toString(payAmount))) + "_") + FormatGameDataParam(toString(winAmt)))
102106 if (if (if ((playerBCoin == ""))
103107 then true
104108 else (playerBPubKey58 == ""))
105109 then true
106110 else (luckyCoin == ""))
107111 then fullStateStr
108112 else ((((((fullStateStr + "_") + FormatGameDataParam(playerBCoin)) + "_") + FormatGameDataParam(playerBPubKey58)) + "_") + FormatGameDataParam(luckyCoin))
109113 }
110114
111115
112116 func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0))
113117 then drop(remaining, 1)
114118 else remaining
115119
116120
117121 func ParseNextAttribute (remaining) = {
118122 let s = size(remaining)
119123 if ((s > 0))
120124 then {
121125 let nn = parseIntValue(take(remaining, 2))
122126 let v = take(drop(remaining, 2), nn)
123127 let tmpRemaining = drop(remaining, (nn + 2))
124128 let remainingState = RemoveUnderscoreIfPresent(tmpRemaining)
125129 [v, remainingState]
126130 }
127131 else throw("Empty string was passed into parseNextAttribute func")
128132 }
129133
130134
131135 func ParseGameRawDataStr (rawStateStr) = {
132136 let gameState = ParseNextAttribute(rawStateStr)
133137 let paCoin = ParseNextAttribute(gameState[1])
134138 let paPubKey58 = ParseNextAttribute(paCoin[1])
135139 let payType = ParseNextAttribute(paPubKey58[1])
136140 let payAmt = ParseNextAttribute(payType[1])
137141 let winAmt = ParseNextAttribute(payAmt[1])
138142 [gameState[0], paCoin[0], paPubKey58[0], payType[0], payAmt[0], winAmt[0]]
139143 }
140144
141145
142146 func ExtractGameDataList (gameId) = {
143147 let rawDataStr = match getString(this, gameId) {
144148 case str: String =>
145149 str
146150 case _ =>
147151 throw(("Couldn't find game by " + gameId))
148152 }
149153 ParseGameRawDataStr(rawDataStr)
150154 }
151155
152156
153157 func ValidateBetAndDefineWinAmt (amount,playerCoin,paymentType) = if (if ((playerCoin != COINRED))
154158 then (playerCoin != COINBLUE)
155159 else false)
156160 then throw("Invalid play, change your bet to RED or BLUE coin. Game aborted.")
157161 else if (if ((paymentType == "WBET"))
158162 then (BETMINWBET > amount)
159163 else false)
160164 then throw(("The minimum bet on Wbet is " + toString((BETMINWBET / WAVELET))))
161165 else if (if ((paymentType == "WAVES"))
162166 then (BETMINWAVES > amount)
163167 else false)
164168 then throw(("The minimum bet on Waves is " + toString((BETMINWAVES / WAVELET))))
165- else fraction((amount * 2), ((100 - FEEWAVESBET) - FEEMCAFEE), 100)
169+ else fraction((amount * 2), (((100 - FEEWAVESBET) - FEEMCAFEE) - FEECOMMUNITY), 100)
166170
167171
168172 @Callable(i)
169173 func playCoinflip (paCoin) = {
170174 let gameId = toBase58String(i.transactionId)
171175 let gameIdUsed = isDefined(getString(this, gameId))
172176 let payment = extract(i.payment)
173177 let feeAssetId = isDefined(i.feeAssetId)
174178 if (if ((payment.assetId != assetInfo(base58'WAVES')))
175179 then (payment.assetId != WBET)
176180 else false)
177181 then throw("Payment should be in Wbet or Waves. Game aborted.")
178182 else if (feeAssetId)
179183 then throw("Transaction's fee must be in Waves. Game aborted.")
180184 else if (gameIdUsed)
181- then throw("Passed gameId had been used before. Game aborted.")
185+ then throw("Passed GameId had been used before. Game aborted.")
182186 else {
183187 let newGameNum = IncrementGameNum()
184188 let playerAPubKey58 = toBase58String(i.callerPublicKey)
185189 let payType = paymentType(payment)
186190 let winAmt = ValidateBetAndDefineWinAmt(payment.amount, paCoin, payType)
187191 let gameDataStr = FormatGameDataStr(STATESUBMITTED, paCoin, playerAPubKey58, payType, payment.amount, winAmt, "", "", "")
188192 ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil))
189193 }
190194 }
191195
192196
193197
194198 @Callable(i)
195199 func acceptCoinChallenge (gameId,rsaSig) = {
196200 let gameDataList = ExtractGameDataList(gameId)
197201 let gameState = gameDataList[IdxGameState]
198202 let paCoin = gameDataList[IdxPlayerACoin]
199203 let paPubKey58 = gameDataList[IdxPlayerAPubKey58]
200204 let payType = gameDataList[IdxPayType]
201205 let payAmt = parseIntValue(gameDataList[IdxPayAmt])
202206 let winAmt = parseIntValue(gameDataList[IdxWinAmt])
203207 let payment = extract(i.payment)
204208 let feeAssetId = isDefined(i.feeAssetId)
205209 let pbPubKey58 = toBase58String(i.callerPublicKey)
206210 let payTypeB = paymentType(payment)
207211 if (if ((payment.assetId != assetInfo(base58'WAVES')))
208212 then (payment.assetId != WBET)
209213 else false)
210214 then throw("Payment should be in Wbet or Waves. Game aborted.")
211215 else if (feeAssetId)
212216 then throw("Transaction's fee must be in Waves. Game aborted.")
213217 else if ((paPubKey58 == pbPubKey58))
214218 then throw("You can't accept a challenge created by yourself. Game aborted.")
215219 else if ((payType != payTypeB))
216220 then throw("Payment must be made in the same token as the bet, WBET/WBET or WAVES/WAVES. Game aborted.")
217221 else if ((payAmt != payment.amount))
218222 then throw("Payout must be equal to the challenger bet amount. Game aborted.")
219223 else if ((gameState != STATESUBMITTED))
220224 then throw("Invalid game state for passed gameId. Game aborted.")
221225 else {
222226 let rand = GenerateRandInt(gameId, rsaSig)
223227 let luckyCoin = if ((rand > 50))
224228 then COINRED
225229 else COINBLUE
226230 let pbCoin = if ((paCoin == COINRED))
227231 then COINBLUE
228232 else COINRED
229233 let tokenAssetId = tokenType(payType)
230234 let newGameDataStr = FormatGameDataStr(STATEFINISHED, paCoin, paPubKey58, payType, payAmt, winAmt, pbCoin, pbPubKey58, luckyCoin)
231235 let winAddr = if ((paCoin == luckyCoin))
232236 then addressFromPublicKey(fromBase58String(paPubKey58))
233237 else i.caller
234- ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, fraction((payAmt * 2), FEEWAVESBET, 100), tokenAssetId), ScriptTransfer(WALLETMCAFEE, fraction((payAmt * 2), FEEMCAFEE, 100), tokenAssetId), ScriptTransfer(winAddr, winAmt, tokenAssetId)]))
238+ ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETCOMMUNITY, fraction((payAmt * 2), FEECOMMUNITY, 100), tokenAssetId), ScriptTransfer(WALLETWAVESBET, fraction((payAmt * 2), FEEWAVESBET, 100), tokenAssetId), ScriptTransfer(WALLETMCAFEE, fraction((payAmt * 2), FEEMCAFEE, 100), tokenAssetId), ScriptTransfer(winAddr, winAmt, tokenAssetId)]))
235239 }
236240 }
237241
238242
239243
240244 @Callable(i)
241245 func cancelCoinChallenge (gameId) = {
242246 let gameDataList = ExtractGameDataList(gameId)
243247 let gameState = gameDataList[IdxGameState]
244248 let paCoin = gameDataList[IdxPlayerACoin]
245249 let paPubKey58 = gameDataList[IdxPlayerAPubKey58]
246250 let payType = gameDataList[IdxPayType]
247251 let payAmt = parseIntValue(gameDataList[IdxPayAmt])
248252 let winAmt = parseIntValue(gameDataList[IdxWinAmt])
249253 let pubKey58 = toBase58String(i.callerPublicKey)
250254 let feeAssetId = isDefined(i.feeAssetId)
251255 if (feeAssetId)
252256 then throw("Transaction's fee must be in Waves. Game aborted.")
253257 else if ((gameState != STATESUBMITTED))
254258 then throw("Invalid game state for passed gameId. Game aborted.")
255259 else if ((paPubKey58 != pubKey58))
256260 then throw("You cannot cancel a game created by another player. Game aborted.")
257- else if ((i.caller == this))
258- then throw("Coinflip contract cannot cancel a game. Game aborted.")
259- else {
260- let newGameDataStr = FormatGameDataStr(STATECANCELED, paCoin, paPubKey58, payType, payAmt, winAmt, "", "", "")
261- let refundAmt = fraction(payAmt, ((100 - FEEWAVESBET) - FEEMCAFEE), 100)
262- let refundWallet = addressFromPublicKey(fromBase58String(paPubKey58))
263- let refundToken = tokenType(payType)
264- ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, fraction(payAmt, FEEWAVESBET, 100), refundToken), ScriptTransfer(WALLETMCAFEE, fraction(payAmt, FEEMCAFEE, 100), refundToken), ScriptTransfer(refundWallet, refundAmt, refundToken)]))
265- }
261+ else {
262+ let newGameDataStr = FormatGameDataStr(STATECANCELED, paCoin, paPubKey58, payType, payAmt, winAmt, "", "", "")
263+ let refundAmt = fraction(payAmt, (((100 - FEEWAVESBET) - FEEMCAFEE) - FEECOMMUNITY), 100)
264+ let refundWallet = addressFromPublicKey(fromBase58String(paPubKey58))
265+ let refundToken = tokenType(payType)
266+ ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETCOMMUNITY, fraction((payAmt * 2), FEECOMMUNITY, 100), refundToken), ScriptTransfer(WALLETWAVESBET, fraction((payAmt * 2), FEEWAVESBET, 100), refundToken), ScriptTransfer(WALLETMCAFEE, fraction((payAmt * 2), FEEMCAFEE, 100), refundToken), ScriptTransfer(refundWallet, refundAmt, refundToken)]))
267+ }
266268 }
267269
268270

github/deemru/w8io/026f985 
91.82 ms