tx · FixSVkRrmDnHcVkiatMYhbvWkTvoEHqCG9UER5Vs1xM2 3MxsZUkxjngrsHn7WNd2xEbwWkUfKdmzP6u: -0.01400000 Waves 2019.10.27 00:09 [737624] smart account 3MxsZUkxjngrsHn7WNd2xEbwWkUfKdmzP6u > SELF 0.00000000 Waves
{ "type": 13, "id": "FixSVkRrmDnHcVkiatMYhbvWkTvoEHqCG9UER5Vs1xM2", "fee": 1400000, "feeAssetId": null, "timestamp": 1572124147927, "version": 1, "sender": "3MxsZUkxjngrsHn7WNd2xEbwWkUfKdmzP6u", "senderPublicKey": "BFgvNhTxuzThVrRXLX7LfTfCHVeCPDsF6JEpadKJPvox", "proofs": [ "2VUmsoYZoVVR9oT5sm9G76UwvjQoJCFyGMu6DXwuN5LqyKdN2CipkSDXUdm4xtFu4Reso9RAi1QxwCY5Q8z7mqhM" ], "script": "base64:AAIDAAAAAAAAABEIARIDCgEIEgMKAQgSAwoBCAAAACIAAAAACVJTQVBVQkxJQwkAAlsAAAABAgAAAY9iYXNlNjQ6TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFtT2xSQlRZRU8zSDdZOXJCbW9GUUZuNDM5MlB4MFF3MTNEc2RFaG56TUgyY2o2WTV5bVB1Q09MTU5lNXFyVXpRbDhvUkx6SUJ6RlZNWmx3VVlsMmJvc3JPSXhRYllGN1dWUVd2b1Z4RVQxWUlnRG0zTnp6T0xBNXVIN0NLTzBzbnNobU1GQ0RPWkVldzQxR2pLaDNQZ3grbmJBZ3VQOVpRUGZxU2FmRW1DM0NOLzR5RHNKcktyaVJuaVpKbzlqUy80TExzUkt3QjdIQVpIem9GOUxMN3RTWkgzaHRhTkd0YmRUa3haMVR6U1QzTWIyVlBTenNadlFEb2NYVVZPbUpPdTBvMjlhT1krR2tHL0c0UkNLMEZCV1FIRVV2QzUxVFJEUzVrOGphZDBPMU1vYmpRYzZiMThkK2Z1b1ZGZE5mWndHSCt1RnVkdFB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ndpbkFtdAIAAAAAAgAAAAACAAAAAAQAAAAGcmVmdW5kCQAAZQAAAAIFAAAABnBheUFtdAkAAGkAAAACCQAAaAAAAAIFAAAABnBheUFtdAUAAAALRkVFV0FWRVNCRVQAAAAAAAAAAGQEAAAACWFkclJlZnVuZAkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQkAAZsAAAABBQAAAApwYVB1YktleTU4BAAAAAhyZWZUb2tlbgkBAAAACVR5cGVUb2tlbgAAAAEFAAAACHBheVR5cGVBCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAGZ2FtZUlkBQAAAA5uZXdHYW1lRGF0YVN0cgUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACWFkclJlZnVuZAUAAAAGcmVmdW5kBQAAAAhyZWZUb2tlbgUAAAADbmlsAAAAABFps70=", "chainId": 84, "height": 737624, "spentComplexity": 0 } View: original | compacted Prev: CSmMhCBT2QSKv9kBb6gAT7evvRvN9QGSr2SkYiMDci11 Next: GMbPSk3Z9idYFohU2phfuwYk5cgP5ku8mZqFrKAER3dx Diff:
Old | New | Differences | |
---|---|---|---|
21 | 21 | ||
22 | 22 | let STATECANCELED = "CANCELED" | |
23 | 23 | ||
24 | - | let WAVELET = 1 | |
25 | - | ||
26 | 24 | let FEEWAVESBET = 4 | |
27 | 25 | ||
28 | 26 | let FEEMCAFEE = 2 | |
29 | - | ||
30 | - | let BETMIN = (1 * WAVELET) | |
31 | - | ||
32 | - | let BETMAX = ((1000 * 100) * WAVELET) | |
33 | 27 | ||
34 | 28 | let IdxGameState = 0 | |
35 | 29 | ||
64 | 58 | then (playerCoin != "BLUE") | |
65 | 59 | else false) | |
66 | 60 | then throw("Invalid play, change your play to RED or BLUE.") | |
67 | - | else if (if ((BETMIN > amount)) | |
68 | - | then true | |
69 | - | else (amount > BETMAX)) | |
70 | - | then throw(((("Bet amount is not in range: minBet=" + toString((BETMIN / 100000000))) + " maxBet=") + toString((BETMAX / 100000000)))) | |
71 | - | else ((((amount * 2) / 100000) * (100 - (FEEWAVESBET + FEEMCAFEE))) / 100) | |
61 | + | else ((((amount * 2) / 100000) * (100 - (FEEWAVESBET + FEEMCAFEE))) / 100) | |
72 | 62 | ||
73 | 63 | ||
74 | 64 | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
164 | 154 | else "WBET" | |
165 | 155 | ||
166 | 156 | ||
157 | + | func TypeToken (s) = if ((s == "WAVES")) | |
158 | + | then unit | |
159 | + | else WBET | |
160 | + | ||
161 | + | ||
167 | 162 | func SelectCoinB (coin) = if ((coin == "RED")) | |
168 | 163 | then "BLUE" | |
169 | 164 | else "RED" | |
228 | 223 | } | |
229 | 224 | ||
230 | 225 | ||
226 | + | ||
227 | + | @Callable(i) | |
228 | + | func cancelChallenge (gameId) = { | |
229 | + | let feeAssetId = isDefined(i.feeAssetId) | |
230 | + | let gameDataList = ExtractGameDataList(gameId) | |
231 | + | let gameState = gameDataList[IdxGameState] | |
232 | + | if (feeAssetId) | |
233 | + | then throw("Transaction's fee must be in Waves. Game aborted.") | |
234 | + | else if ((gameState != STATESUBMITTED)) | |
235 | + | then throw("Invalid game state for passed gameId") | |
236 | + | else { | |
237 | + | let paCoin = gameDataList[IdxPlayerACoin] | |
238 | + | let paPubKey58 = gameDataList[IdxPlayerAPubKey58] | |
239 | + | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
240 | + | let payTypeA = gameDataList[IdxPayType] | |
241 | + | let payAmt = parseIntValue(gameDataList[IdxPayAmt]) | |
242 | + | let newGameDataStr = FormatGameDataStr(STATECANCELED, paCoin, paPubKey58, payTypeA, payAmt, winAmt, "", "", "") | |
243 | + | let refund = (payAmt - ((payAmt * FEEWAVESBET) / 100)) | |
244 | + | let adrRefund = addressFromPublicKey(toBytes(paPubKey58)) | |
245 | + | let refToken = TypeToken(payTypeA) | |
246 | + | ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(adrRefund, refund, refToken)])) | |
247 | + | } | |
248 | + | } | |
249 | + | ||
250 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmOlRBTYEO3H7Y9rBmoFQFn4392Px0Qw13DsdEhnzMH2cj6Y5ymPuCOLMNe5qrUzQl8oRLzIBzFVMZlwUYl2bosrOIxQbYF7WVQWvoVxET1YIgDm3NzzOLA5uH7CKO0snshmMFCDOZEew41GjKh3Pgx+nbAguP9ZQPfqSafEmC3CN/4yDsJrKriRniZJo9jS/4LLsRKwB7HAZHzoF9LL7tSZH3htaNGtbdTkxZ1TzST3Mb2VPSzsZvQDocXUVOmJOu0o29aOY+GkG/G4RCK0FBWQHEUvC51TRDS5k8jad0O1MobjQc6b18d+fuoVFdNfZwGH+uFudtPG3UJTf2mkzZQIDAQAB") | |
5 | 5 | ||
6 | 6 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
7 | 7 | ||
8 | 8 | let RESERVATIONKEY = "$RESERVED_AMOUNT" | |
9 | 9 | ||
10 | 10 | let WBET = base58'23vgV9p9pD83A7CFbsDEc4zjanep7UeFo4ZRS6oGorhv' | |
11 | 11 | ||
12 | 12 | let WALLETWAVESBET = Address(base58'3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX') | |
13 | 13 | ||
14 | 14 | let WALLETMCAFFE = Address(base58'') | |
15 | 15 | ||
16 | 16 | let STATESUBMITTED = "SUBMITTED" | |
17 | 17 | ||
18 | 18 | let STATEWAITING = "WAITING" | |
19 | 19 | ||
20 | 20 | let STATEFINISHED = "FINISHED" | |
21 | 21 | ||
22 | 22 | let STATECANCELED = "CANCELED" | |
23 | 23 | ||
24 | - | let WAVELET = 1 | |
25 | - | ||
26 | 24 | let FEEWAVESBET = 4 | |
27 | 25 | ||
28 | 26 | let FEEMCAFEE = 2 | |
29 | - | ||
30 | - | let BETMIN = (1 * WAVELET) | |
31 | - | ||
32 | - | let BETMAX = ((1000 * 100) * WAVELET) | |
33 | 27 | ||
34 | 28 | let IdxGameState = 0 | |
35 | 29 | ||
36 | 30 | let IdxPlayerACoin = 1 | |
37 | 31 | ||
38 | 32 | let IdxPlayerAPubKey58 = 2 | |
39 | 33 | ||
40 | 34 | let IdxPayType = 3 | |
41 | 35 | ||
42 | 36 | let IdxPayAmt = 4 | |
43 | 37 | ||
44 | 38 | let IdxWinAmt = 5 | |
45 | 39 | ||
46 | 40 | let IdxPlayerBCoin = 6 | |
47 | 41 | ||
48 | 42 | let IdxPlayerBPubKey58 = 7 | |
49 | 43 | ||
50 | 44 | let IdxRandOrEmpty = 8 | |
51 | 45 | ||
52 | 46 | func IncrementGameNum () = { | |
53 | 47 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
54 | 48 | case num: Int => | |
55 | 49 | num | |
56 | 50 | case _ => | |
57 | 51 | 0 | |
58 | 52 | } | |
59 | 53 | (gameNum + 1) | |
60 | 54 | } | |
61 | 55 | ||
62 | 56 | ||
63 | 57 | func ValidateBetAndDefineWinAmt (playerCoin,amount) = if (if ((playerCoin != "RED")) | |
64 | 58 | then (playerCoin != "BLUE") | |
65 | 59 | else false) | |
66 | 60 | then throw("Invalid play, change your play to RED or BLUE.") | |
67 | - | else if (if ((BETMIN > amount)) | |
68 | - | then true | |
69 | - | else (amount > BETMAX)) | |
70 | - | then throw(((("Bet amount is not in range: minBet=" + toString((BETMIN / 100000000))) + " maxBet=") + toString((BETMAX / 100000000)))) | |
71 | - | else ((((amount * 2) / 100000) * (100 - (FEEWAVESBET + FEEMCAFEE))) / 100) | |
61 | + | else ((((amount * 2) / 100000) * (100 - (FEEWAVESBET + FEEMCAFEE))) / 100) | |
72 | 62 | ||
73 | 63 | ||
74 | 64 | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
75 | 65 | case a: Int => | |
76 | 66 | a | |
77 | 67 | case _ => | |
78 | 68 | 0 | |
79 | 69 | } | |
80 | 70 | ||
81 | 71 | ||
82 | 72 | func ValidateAndIncreaseReservedAmt (winAmt) = { | |
83 | 73 | let newReservedAmount = (ExtractReservedAmt() + winAmt) | |
84 | 74 | let balance = wavesBalance(this) | |
85 | 75 | if ((newReservedAmount > balance)) | |
86 | 76 | then throw("Insufficient funds on Waves Rider account. Transaction was rejected for your safety.") | |
87 | 77 | else newReservedAmount | |
88 | 78 | } | |
89 | 79 | ||
90 | 80 | ||
91 | 81 | func FormatGameDataParam (p) = { | |
92 | 82 | let s = size(p) | |
93 | 83 | if ((s == 0)) | |
94 | 84 | then throw("Parameter size must be greater then 0.") | |
95 | 85 | else if ((s > 99)) | |
96 | 86 | then throw("Parameter size must be less then 100.") | |
97 | 87 | else if ((10 > s)) | |
98 | 88 | then (("0" + toString(s)) + p) | |
99 | 89 | else (toString(s) + p) | |
100 | 90 | } | |
101 | 91 | ||
102 | 92 | ||
103 | 93 | func FormatGameDataStr (gameState,playerACoin,playerAPubKey58,payType,payAmount,winAmt,playerBCoin,playerBPubKey58,randOrEmpty) = { | |
104 | 94 | let fullStateStr = ((((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(playerACoin)) + "_") + FormatGameDataParam(playerAPubKey58)) + "_") + FormatGameDataParam(payType)) + "_") + FormatGameDataParam(toString(payAmount))) + "_") + FormatGameDataParam(toString(winAmt))) | |
105 | 95 | if (if (if ((playerBCoin == "")) | |
106 | 96 | then (playerBPubKey58 == "") | |
107 | 97 | else false) | |
108 | 98 | then (randOrEmpty == "") | |
109 | 99 | else false) | |
110 | 100 | then fullStateStr | |
111 | 101 | else if (if (if ((playerBCoin != "")) | |
112 | 102 | then (playerBPubKey58 != "") | |
113 | 103 | else false) | |
114 | 104 | then (randOrEmpty == "") | |
115 | 105 | else false) | |
116 | 106 | then (((fullStateStr + "_") + (FormatGameDataParam(playerBCoin) + "_")) + (FormatGameDataParam(playerBPubKey58) + "_")) | |
117 | 107 | else ((((fullStateStr + "_") + (FormatGameDataParam(playerBCoin) + "_")) + (FormatGameDataParam(playerBPubKey58) + "_")) + FormatGameDataParam(randOrEmpty)) | |
118 | 108 | } | |
119 | 109 | ||
120 | 110 | ||
121 | 111 | func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0)) | |
122 | 112 | then drop(remaining, 1) | |
123 | 113 | else remaining | |
124 | 114 | ||
125 | 115 | ||
126 | 116 | func ParseNextAttribute (remaining) = { | |
127 | 117 | let s = size(remaining) | |
128 | 118 | if ((s > 0)) | |
129 | 119 | then { | |
130 | 120 | let nn = parseIntValue(take(remaining, 2)) | |
131 | 121 | let v = take(drop(remaining, 2), nn) | |
132 | 122 | let tmpRemaining = drop(remaining, (nn + 2)) | |
133 | 123 | let remainingState = RemoveUnderscoreIfPresent(tmpRemaining) | |
134 | 124 | [v, remainingState] | |
135 | 125 | } | |
136 | 126 | else throw("Empty string was passed into parseNextAttribute func") | |
137 | 127 | } | |
138 | 128 | ||
139 | 129 | ||
140 | 130 | func ParseGameRawDataStr (rawStateStr) = { | |
141 | 131 | let gameState = ParseNextAttribute(rawStateStr) | |
142 | 132 | let playerAChoice = ParseNextAttribute(gameState[1]) | |
143 | 133 | let playerAPubKey58 = ParseNextAttribute(playerAChoice[1]) | |
144 | 134 | let playerAPayType = ParseNextAttribute(playerAPubKey58[1]) | |
145 | 135 | let playerAPayAmt = ParseNextAttribute(playerAPayType[1]) | |
146 | 136 | let winAmt = ParseNextAttribute(playerAPayAmt[1]) | |
147 | 137 | [gameState[0], playerAChoice[0], playerAPubKey58[0], playerAPayType[0], playerAPayAmt[0], winAmt[0]] | |
148 | 138 | } | |
149 | 139 | ||
150 | 140 | ||
151 | 141 | func ExtractGameDataList (gameId) = { | |
152 | 142 | let rawDataStr = match getString(this, gameId) { | |
153 | 143 | case str: String => | |
154 | 144 | str | |
155 | 145 | case _ => | |
156 | 146 | throw(("Couldn't find game by " + gameId)) | |
157 | 147 | } | |
158 | 148 | ParseGameRawDataStr(rawDataStr) | |
159 | 149 | } | |
160 | 150 | ||
161 | 151 | ||
162 | 152 | func TypePayment (p) = if ((p.assetId == assetInfo(base58'WAVES'))) | |
163 | 153 | then "WAVES" | |
164 | 154 | else "WBET" | |
165 | 155 | ||
166 | 156 | ||
157 | + | func TypeToken (s) = if ((s == "WAVES")) | |
158 | + | then unit | |
159 | + | else WBET | |
160 | + | ||
161 | + | ||
167 | 162 | func SelectCoinB (coin) = if ((coin == "RED")) | |
168 | 163 | then "BLUE" | |
169 | 164 | else "RED" | |
170 | 165 | ||
171 | 166 | ||
172 | 167 | @Callable(i) | |
173 | 168 | func playCoin (paCoin) = { | |
174 | 169 | let gameId = toBase58String(i.transactionId) | |
175 | 170 | let payment = extract(i.payment) | |
176 | 171 | let feeAssetId = isDefined(i.feeAssetId) | |
177 | 172 | let gameIdUsed = isDefined(getString(this, gameId)) | |
178 | 173 | let winAmt = ValidateBetAndDefineWinAmt(paCoin, payment.amount) | |
179 | 174 | if (if ((payment.assetId != assetInfo(base58'WAVES'))) | |
180 | 175 | then (payment.assetId != WBET) | |
181 | 176 | else false) | |
182 | 177 | then throw("Payment should be in Wavesbet or Waves") | |
183 | 178 | else if (feeAssetId) | |
184 | 179 | then throw("Transaction's fee must be in Waves. Game aborted.") | |
185 | 180 | else if (gameIdUsed) | |
186 | 181 | then throw("Passed gameId had been used before. Game aborted.") | |
187 | 182 | else { | |
188 | 183 | let newGameNum = IncrementGameNum() | |
189 | 184 | let playerAPubKey58 = toBase58String(i.callerPublicKey) | |
190 | 185 | let payType = TypePayment(payment) | |
191 | 186 | let gameDataStr = FormatGameDataStr(STATESUBMITTED, paCoin, playerAPubKey58, payType, payment.amount, winAmt, "", "", "") | |
192 | 187 | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, ((payment.amount * FEEWAVESBET) / 100), WBET), ScriptTransfer(this, 500000, unit)])) | |
193 | 188 | } | |
194 | 189 | } | |
195 | 190 | ||
196 | 191 | ||
197 | 192 | ||
198 | 193 | @Callable(i) | |
199 | 194 | func acceptChallenge (gameId) = { | |
200 | 195 | let payment = extract(i.payment) | |
201 | 196 | let feeAssetId = isDefined(i.feeAssetId) | |
202 | 197 | let payTypeB = TypePayment(payment) | |
203 | 198 | let gameDataList = ExtractGameDataList(gameId) | |
204 | 199 | let gameState = gameDataList[IdxGameState] | |
205 | 200 | let payTypeA = gameDataList[IdxPayType] | |
206 | 201 | let payAmt = parseIntValue(gameDataList[IdxPayAmt]) | |
207 | 202 | if (if ((payment.assetId != assetInfo(base58'WAVES'))) | |
208 | 203 | then (payment.assetId != WBET) | |
209 | 204 | else false) | |
210 | 205 | then throw("Payment should be in Wavesbet or Waves") | |
211 | 206 | else if (feeAssetId) | |
212 | 207 | then throw("Transaction's fee must be in Waves. Game aborted.") | |
213 | 208 | else if ((payTypeB != payTypeA)) | |
214 | 209 | then throw("Payment must be made in the same currency token as the bet, WBET/WBET or WAVES/WAVES.") | |
215 | 210 | else if ((payment.amount == payAmt)) | |
216 | 211 | then throw("Payout must be equal to the bet amount.") | |
217 | 212 | else if ((gameState != STATESUBMITTED)) | |
218 | 213 | then throw("Invalid game state for passed gameId") | |
219 | 214 | else { | |
220 | 215 | let paCoin = gameDataList[IdxPlayerACoin] | |
221 | 216 | let paPubKey58 = gameDataList[IdxPlayerAPubKey58] | |
222 | 217 | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
223 | 218 | let pbCoin = SelectCoinB(paCoin) | |
224 | 219 | let pbPubKey58 = toBase58String(i.callerPublicKey) | |
225 | 220 | let newGameDataStr = FormatGameDataStr(STATEWAITING, paCoin, paPubKey58, payTypeA, payAmt, winAmt, pbCoin, pbPubKey58, "") | |
226 | 221 | ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, ((payment.amount * FEEWAVESBET) / 100), WBET), ScriptTransfer(this, 500000, unit)])) | |
227 | 222 | } | |
228 | 223 | } | |
229 | 224 | ||
230 | 225 | ||
226 | + | ||
227 | + | @Callable(i) | |
228 | + | func cancelChallenge (gameId) = { | |
229 | + | let feeAssetId = isDefined(i.feeAssetId) | |
230 | + | let gameDataList = ExtractGameDataList(gameId) | |
231 | + | let gameState = gameDataList[IdxGameState] | |
232 | + | if (feeAssetId) | |
233 | + | then throw("Transaction's fee must be in Waves. Game aborted.") | |
234 | + | else if ((gameState != STATESUBMITTED)) | |
235 | + | then throw("Invalid game state for passed gameId") | |
236 | + | else { | |
237 | + | let paCoin = gameDataList[IdxPlayerACoin] | |
238 | + | let paPubKey58 = gameDataList[IdxPlayerAPubKey58] | |
239 | + | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
240 | + | let payTypeA = gameDataList[IdxPayType] | |
241 | + | let payAmt = parseIntValue(gameDataList[IdxPayAmt]) | |
242 | + | let newGameDataStr = FormatGameDataStr(STATECANCELED, paCoin, paPubKey58, payTypeA, payAmt, winAmt, "", "", "") | |
243 | + | let refund = (payAmt - ((payAmt * FEEWAVESBET) / 100)) | |
244 | + | let adrRefund = addressFromPublicKey(toBytes(paPubKey58)) | |
245 | + | let refToken = TypeToken(payTypeA) | |
246 | + | ScriptResult(WriteSet([DataEntry(gameId, newGameDataStr)]), TransferSet([ScriptTransfer(adrRefund, refund, refToken)])) | |
247 | + | } | |
248 | + | } | |
249 | + | ||
250 | + |
github/deemru/w8io/169f3d6 59.30 ms ◑