tx · 31DSDoGhxVxPrdQDCeY35ub8ThZRSZjiZvmR8J7tgKYq

3MtKQXaiKQxSTRPpa8GjJ5zE7mE992eBrGu:  -0.05000000 Waves

2020.01.04 23:23 [839603] smart account 3MtKQXaiKQxSTRPpa8GjJ5zE7mE992eBrGu > SELF 0.00000000 Waves

{ "type": 13, "id": "31DSDoGhxVxPrdQDCeY35ub8ThZRSZjiZvmR8J7tgKYq", "fee": 5000000, "feeAssetId": null, "timestamp": 1578169339452, "version": 1, "sender": "3MtKQXaiKQxSTRPpa8GjJ5zE7mE992eBrGu", "senderPublicKey": "2vmjFmSn7wGYrffwrNFgTN6j9CATDKwa8t8KAXWe2HVW", "proofs": [ "3SXRos9yP1CJXr8ohCCgEZ5U2tRJWJW1mZhQpo1Hkoo9hG4gpfnDK6n7KcxwFDcRxGWaZUW2k625w9mFuuAfsTTm" ], "script": "base64:AAIDAAAAAAAAABIIARIDCgEIEgQKAggCEgMKAQgAAAAmAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBZzRkQVI2WGJCREFTOWhyL0VqM2RKdjZGZmM0NjZ4L21PR01XVTNsckFCczNxYThCSG11Skdua2ZicEVmMnZBd1lUT1dQdnZ6Zk0xME9CYmZsb1N5cTNjOU1LdnlUZTFsdUJMR3FXNHZaVVhJeXZTZ3oxbGl5VVZlZklReTNkeUY5amJlVFpiQzBiYmNULzdPM0RFTCswMXo2QStyRENhY1NaMGxHb2xTUTZBbmhMeHpJa1ZwT1FKYnJCbUMreCtadVpQQ01Xekp5bmQ1YWVPbjdqYWovbWtSVnl4ZTZnLzBPaFd6NE5paVpYZXVNUkIrOG1LeTBmV0QvVWxJbFpXSHNBUzJabXJrWEtxakxxMC8wd3I4SUxKa3pualNxZG5JNUliamczdVFyai80QU4raTlyMjhhUTczL1prUHRZNVNidzBBT2lBQkJ1N2dIbXE5YXlWe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AUAAAALcmVmdW5kVG9rZW4FAAAAA25pbAAAAADZ2/M9", "chainId": 84, "height": 839603, "spentComplexity": 0 } View: original | compacted Prev: AMw4ANAEQCyby6LuonB5eMmHDRG8Jx6cVghSUkvVXPTN Next: F9w48K21fa3otxZJshCRvRwCF3pzYPSaizHvpDHDQYsw Diff:
OldNewDifferences
217217 else if ((paPubKey58 == pbPubKey58))
218218 then throw("You can't accept a challenge created by yourself. Game aborted.")
219219 else if ((payType != payTypeB))
220- then throw("Payment must be made in the same token as the bet, WBET/WBET or WAVES/WAVES. Game aborted.")
220+ then throw("Payment must be made in the same token, WBET/WBET or WAVES/WAVES. Game aborted.")
221221 else if ((payAmt != payment.amount))
222222 then throw("Payout must be equal to the challenger bet amount. Game aborted.")
223223 else if ((gameState != STATESUBMITTED))
235235 let winAddr = if ((paCoin == luckyCoin))
236236 then addressFromPublicKey(fromBase58String(paPubKey58))
237237 else i.caller
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)]))
238+ let feeAmt = ((payAmt * 2) - winAmt)
239+ ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETCOMMUNITY, fraction(feeAmt, (FEECOMMUNITY * 10), 100), tokenAssetId), ScriptTransfer(WALLETWAVESBET, fraction(feeAmt, (FEEWAVESBET * 10), 100), tokenAssetId), ScriptTransfer(WALLETMCAFEE, fraction(feeAmt, (FEEMCAFEE * 10), 100), tokenAssetId), ScriptTransfer(winAddr, winAmt, tokenAssetId)]))
239240 }
240241 }
241242
263264 let refundAmt = fraction(payAmt, (((100 - FEEWAVESBET) - FEEMCAFEE) - FEECOMMUNITY), 100)
264265 let refundWallet = addressFromPublicKey(fromBase58String(paPubKey58))
265266 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+ ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETCOMMUNITY, fraction(payAmt, FEECOMMUNITY, 100), refundToken), ScriptTransfer(WALLETWAVESBET, fraction(payAmt, FEEWAVESBET, 100), refundToken), ScriptTransfer(WALLETMCAFEE, fraction(payAmt, FEEMCAFEE, 100), refundToken), ScriptTransfer(refundWallet, refundAmt, refundToken)]))
267268 }
268269 }
269270
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB")
55
66 let GAMESCOUNTERKEY = "$GAME_NUM"
77
88 let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw'
99
1010 let WALLETCOMMUNITY = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
1111
1212 let WALLETWAVESBET = Address(base58'3MxK12u62zsu9xh3hU7p5iJncCLANd3zhTZ')
1313
1414 let WALLETMCAFEE = Address(base58'3MxK12u62zsu9xh3hU7p5iJncCLANd3zhTZ')
1515
1616 let WAVELET = 100000000
1717
1818 let FEECOMMUNITY = 1
1919
2020 let FEEWAVESBET = 3
2121
2222 let FEEMCAFEE = 2
2323
2424 let STATESUBMITTED = "SUBMITTED"
2525
2626 let STATEACCEPTED = "ACCEPTED"
2727
2828 let STATEFINISHED = "FINISHED"
2929
3030 let STATECANCELED = "CANCELED"
3131
3232 let COINRED = "RED"
3333
3434 let COINBLUE = "BLUE"
3535
3636 let BETMINWAVES = ((1 * WAVELET) / 4)
3737
3838 let BETMINWBET = (100 * WAVELET)
3939
4040 let IdxGameState = 0
4141
4242 let IdxPlayerACoin = 1
4343
4444 let IdxPlayerAPubKey58 = 2
4545
4646 let IdxPayType = 3
4747
4848 let IdxPayAmt = 4
4949
5050 let IdxWinAmt = 5
5151
5252 let IdxPlayerBCoin = 6
5353
5454 let IdxPlayerBPubKey58 = 7
5555
5656 let IdxLuckyCoin = 8
5757
5858 func IncrementGameNum () = {
5959 let gameNum = match getInteger(this, GAMESCOUNTERKEY) {
6060 case num: Int =>
6161 num
6262 case _ =>
6363 0
6464 }
6565 (gameNum + 1)
6666 }
6767
6868
6969 func GenerateRandInt (gameId,rsaSign) = {
7070 let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
7171 if (rsaSigValid)
7272 then {
7373 let rand = (toInt(sha256(rsaSign)) % 100)
7474 if ((0 > rand))
7575 then ((-1 * rand) + 1)
7676 else (rand + 1)
7777 }
7878 else throw("Invalid RSA signature")
7979 }
8080
8181
8282 func paymentType (payment) = if ((payment.assetId == WBET))
8383 then "WBET"
8484 else "WAVES"
8585
8686
8787 func tokenType (token) = if ((token == "WBET"))
8888 then WBET
8989 else unit
9090
9191
9292 func FormatGameDataParam (p) = {
9393 let s = size(p)
9494 if ((s == 0))
9595 then throw("Parameter size must be greater then 0")
9696 else if ((s > 99))
9797 then throw("Parameter size must be less then 100")
9898 else if ((10 > s))
9999 then (("0" + toString(s)) + p)
100100 else (toString(s) + p)
101101 }
102102
103103
104104 func FormatGameDataStr (gameState,playerACoin,playerAPubKey58,payType,payAmount,winAmt,playerBCoin,playerBPubKey58,luckyCoin) = {
105105 let fullStateStr = ((((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(playerACoin)) + "_") + FormatGameDataParam(playerAPubKey58)) + "_") + FormatGameDataParam(payType)) + "_") + FormatGameDataParam(toString(payAmount))) + "_") + FormatGameDataParam(toString(winAmt)))
106106 if (if (if ((playerBCoin == ""))
107107 then true
108108 else (playerBPubKey58 == ""))
109109 then true
110110 else (luckyCoin == ""))
111111 then fullStateStr
112112 else ((((((fullStateStr + "_") + FormatGameDataParam(playerBCoin)) + "_") + FormatGameDataParam(playerBPubKey58)) + "_") + FormatGameDataParam(luckyCoin))
113113 }
114114
115115
116116 func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0))
117117 then drop(remaining, 1)
118118 else remaining
119119
120120
121121 func ParseNextAttribute (remaining) = {
122122 let s = size(remaining)
123123 if ((s > 0))
124124 then {
125125 let nn = parseIntValue(take(remaining, 2))
126126 let v = take(drop(remaining, 2), nn)
127127 let tmpRemaining = drop(remaining, (nn + 2))
128128 let remainingState = RemoveUnderscoreIfPresent(tmpRemaining)
129129 [v, remainingState]
130130 }
131131 else throw("Empty string was passed into parseNextAttribute func")
132132 }
133133
134134
135135 func ParseGameRawDataStr (rawStateStr) = {
136136 let gameState = ParseNextAttribute(rawStateStr)
137137 let paCoin = ParseNextAttribute(gameState[1])
138138 let paPubKey58 = ParseNextAttribute(paCoin[1])
139139 let payType = ParseNextAttribute(paPubKey58[1])
140140 let payAmt = ParseNextAttribute(payType[1])
141141 let winAmt = ParseNextAttribute(payAmt[1])
142142 [gameState[0], paCoin[0], paPubKey58[0], payType[0], payAmt[0], winAmt[0]]
143143 }
144144
145145
146146 func ExtractGameDataList (gameId) = {
147147 let rawDataStr = match getString(this, gameId) {
148148 case str: String =>
149149 str
150150 case _ =>
151151 throw(("Couldn't find game by " + gameId))
152152 }
153153 ParseGameRawDataStr(rawDataStr)
154154 }
155155
156156
157157 func ValidateBetAndDefineWinAmt (amount,playerCoin,paymentType) = if (if ((playerCoin != COINRED))
158158 then (playerCoin != COINBLUE)
159159 else false)
160160 then throw("Invalid play, change your bet to RED or BLUE coin. Game aborted.")
161161 else if (if ((paymentType == "WBET"))
162162 then (BETMINWBET > amount)
163163 else false)
164164 then throw(("The minimum bet on Wbet is " + toString((BETMINWBET / WAVELET))))
165165 else if (if ((paymentType == "WAVES"))
166166 then (BETMINWAVES > amount)
167167 else false)
168168 then throw(("The minimum bet on Waves is " + toString((BETMINWAVES / WAVELET))))
169169 else fraction((amount * 2), (((100 - FEEWAVESBET) - FEEMCAFEE) - FEECOMMUNITY), 100)
170170
171171
172172 @Callable(i)
173173 func playCoinflip (paCoin) = {
174174 let gameId = toBase58String(i.transactionId)
175175 let gameIdUsed = isDefined(getString(this, gameId))
176176 let payment = extract(i.payment)
177177 let feeAssetId = isDefined(i.feeAssetId)
178178 if (if ((payment.assetId != assetInfo(base58'WAVES')))
179179 then (payment.assetId != WBET)
180180 else false)
181181 then throw("Payment should be in Wbet or Waves. Game aborted.")
182182 else if (feeAssetId)
183183 then throw("Transaction's fee must be in Waves. Game aborted.")
184184 else if (gameIdUsed)
185185 then throw("Passed GameId had been used before. Game aborted.")
186186 else {
187187 let newGameNum = IncrementGameNum()
188188 let playerAPubKey58 = toBase58String(i.callerPublicKey)
189189 let payType = paymentType(payment)
190190 let winAmt = ValidateBetAndDefineWinAmt(payment.amount, paCoin, payType)
191191 let gameDataStr = FormatGameDataStr(STATESUBMITTED, paCoin, playerAPubKey58, payType, payment.amount, winAmt, "", "", "")
192192 ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil))
193193 }
194194 }
195195
196196
197197
198198 @Callable(i)
199199 func acceptCoinChallenge (gameId,rsaSig) = {
200200 let gameDataList = ExtractGameDataList(gameId)
201201 let gameState = gameDataList[IdxGameState]
202202 let paCoin = gameDataList[IdxPlayerACoin]
203203 let paPubKey58 = gameDataList[IdxPlayerAPubKey58]
204204 let payType = gameDataList[IdxPayType]
205205 let payAmt = parseIntValue(gameDataList[IdxPayAmt])
206206 let winAmt = parseIntValue(gameDataList[IdxWinAmt])
207207 let payment = extract(i.payment)
208208 let feeAssetId = isDefined(i.feeAssetId)
209209 let pbPubKey58 = toBase58String(i.callerPublicKey)
210210 let payTypeB = paymentType(payment)
211211 if (if ((payment.assetId != assetInfo(base58'WAVES')))
212212 then (payment.assetId != WBET)
213213 else false)
214214 then throw("Payment should be in Wbet or Waves. Game aborted.")
215215 else if (feeAssetId)
216216 then throw("Transaction's fee must be in Waves. Game aborted.")
217217 else if ((paPubKey58 == pbPubKey58))
218218 then throw("You can't accept a challenge created by yourself. Game aborted.")
219219 else if ((payType != payTypeB))
220- then throw("Payment must be made in the same token as the bet, WBET/WBET or WAVES/WAVES. Game aborted.")
220+ then throw("Payment must be made in the same token, WBET/WBET or WAVES/WAVES. Game aborted.")
221221 else if ((payAmt != payment.amount))
222222 then throw("Payout must be equal to the challenger bet amount. Game aborted.")
223223 else if ((gameState != STATESUBMITTED))
224224 then throw("Invalid game state for passed gameId. Game aborted.")
225225 else {
226226 let rand = GenerateRandInt(gameId, rsaSig)
227227 let luckyCoin = if ((rand > 50))
228228 then COINRED
229229 else COINBLUE
230230 let pbCoin = if ((paCoin == COINRED))
231231 then COINBLUE
232232 else COINRED
233233 let tokenAssetId = tokenType(payType)
234234 let newGameDataStr = FormatGameDataStr(STATEFINISHED, paCoin, paPubKey58, payType, payAmt, winAmt, pbCoin, pbPubKey58, luckyCoin)
235235 let winAddr = if ((paCoin == luckyCoin))
236236 then addressFromPublicKey(fromBase58String(paPubKey58))
237237 else i.caller
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)]))
238+ let feeAmt = ((payAmt * 2) - winAmt)
239+ ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETCOMMUNITY, fraction(feeAmt, (FEECOMMUNITY * 10), 100), tokenAssetId), ScriptTransfer(WALLETWAVESBET, fraction(feeAmt, (FEEWAVESBET * 10), 100), tokenAssetId), ScriptTransfer(WALLETMCAFEE, fraction(feeAmt, (FEEMCAFEE * 10), 100), tokenAssetId), ScriptTransfer(winAddr, winAmt, tokenAssetId)]))
239240 }
240241 }
241242
242243
243244
244245 @Callable(i)
245246 func cancelCoinChallenge (gameId) = {
246247 let gameDataList = ExtractGameDataList(gameId)
247248 let gameState = gameDataList[IdxGameState]
248249 let paCoin = gameDataList[IdxPlayerACoin]
249250 let paPubKey58 = gameDataList[IdxPlayerAPubKey58]
250251 let payType = gameDataList[IdxPayType]
251252 let payAmt = parseIntValue(gameDataList[IdxPayAmt])
252253 let winAmt = parseIntValue(gameDataList[IdxWinAmt])
253254 let pubKey58 = toBase58String(i.callerPublicKey)
254255 let feeAssetId = isDefined(i.feeAssetId)
255256 if (feeAssetId)
256257 then throw("Transaction's fee must be in Waves. Game aborted.")
257258 else if ((gameState != STATESUBMITTED))
258259 then throw("Invalid game state for passed gameId. Game aborted.")
259260 else if ((paPubKey58 != pubKey58))
260261 then throw("You cannot cancel a game created by another player. Game aborted.")
261262 else {
262263 let newGameDataStr = FormatGameDataStr(STATECANCELED, paCoin, paPubKey58, payType, payAmt, winAmt, "", "", "")
263264 let refundAmt = fraction(payAmt, (((100 - FEEWAVESBET) - FEEMCAFEE) - FEECOMMUNITY), 100)
264265 let refundWallet = addressFromPublicKey(fromBase58String(paPubKey58))
265266 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+ ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETCOMMUNITY, fraction(payAmt, FEECOMMUNITY, 100), refundToken), ScriptTransfer(WALLETWAVESBET, fraction(payAmt, FEEWAVESBET, 100), refundToken), ScriptTransfer(WALLETMCAFEE, fraction(payAmt, FEEMCAFEE, 100), refundToken), ScriptTransfer(refundWallet, refundAmt, refundToken)]))
267268 }
268269 }
269270
270271

github/deemru/w8io/026f985 
70.86 ms