tx · AQMBQGrszZevyxe33J1dW69svFNTKPtrnNtaBx1intb3

3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd:  -0.10000000 Waves

2021.11.16 01:34 [1792748] smart account 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd > SELF 0.00000000 Waves

{ "type": 13, "id": "AQMBQGrszZevyxe33J1dW69svFNTKPtrnNtaBx1intb3", "fee": 10000000, "feeAssetId": null, "timestamp": 1637015701171, "version": 2, "chainId": 84, "sender": "3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd", "senderPublicKey": "7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi", "proofs": [ "2m1B9f48MCL67JiGXxgDqYHB5knokQ2LXqeTZyF3RJFrJPiuLL9KTCdFLAwwYJ8gv2W8Sxa1U9zSA7eY5jUhdExx" ], "script": "base64:AAIFAAAAAAAAAAwIAhIDCgEIEgMKAQgAAAANAAAAAAZjYXNpbm8CAAAAIzNNdGFDTDR2MWJqVGFiVXFzN29VNG9mUzhmYmFpMzRXTTFpAAAAAAVXQVZFUwAAAAAAO5rKAAAAAAAGbWF4QmV0CQAAaAAAAAIAAAAAAAAAAGQFAAAABVdBVkVTAAAAAAlzZXBhcmF0b3ICAAAAASwBAAAACmdldE5ld0RlY2sAAAAACQAETAAAAAICAAAAAzAxQwkABEwAAAACAgAAAAMwMkMJAARMAAAAAgIAAAADMDNDCQAETAAAAAICAAAAAzA0QwkABEwAAAACAgAAAAMwNUMJAARMAAAAAgIAAAADMDZDCQAETAAAAAICAAAAAzA3QwkABEwAAAACAgAAAAMwOEMJAARMAAAAAgIAAAADMDlDCQAETAAAAAICAAAAAzEwQwkABEwAAAACAgAAAAMxMUMJAARMAAAAAgIAAAADMTJDCQAETAAAAAICAAAAAzEzQwkABEwAAAACAgAAAAMwMUQJAARMAAAAAgIAAAADMDJECQAETAAAAAICAAAAAzAzRAkABEwAAAACAgAAAAMwNEQJAARMAAAAAgIAAAADMD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AAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACWN1clN1bUJldAUAAAAEdW5pdAUAAAADbmlsAwMJAAAAAAAAAgUAAAAGd2lubmVyBQAAAA1jYWxsZXJBZGRyZXNzCQAAAAAAAAIFAAAABndpbm5lcgUAAAAGcGxheWVyBwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAAt3aXRoZHJhd0tleQkAAaQAAAABCQAAaAAAAAIFAAAACWN1clN1bUJldAAAAAAAAAAAAgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIJAABoAAAAAgUAAAAJY3VyU3VtQmV0AAAAAAAAAAACBQAAAAR1bml0BQAAAANuaWwJAAACAAAAAQIAAAAWWW91IGFyZSBub3QgdGhlIHdpbm5lcgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5sA5/cw==", "height": 1792748, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HDF4eqfcW99NAANuC6s3RRcfCSMCEqrKNLmAHeuk83au Next: 7zwrvgDowCo1YH4ML9TfC2BLfCzZuQq7TCkZcPETj3uo Diff:
OldNewDifferences
119119 let avDeck1 = removeByIndex(avDeck, (cardPositionPlayer % size(avDeck)))
120120 let avDeck2 = getDeck(avDeck1)
121121 let cardPositionCasino = getRandomNumber(((meKey + makeString(avDeck2, separator)) + callerAddress), getPreviousRandomNumber(callerAddress), size(avDeck2))
122- let cardCasino = avDeck2[((cardPositionPlayer + 12) % size(avDeck2))]
122+ let cardCasino = avDeck2[(cardPositionCasino % size(avDeck2))]
123123 let avDeck3 = removeByIndex(avDeck2, (cardPositionCasino % size(avDeck2)))
124124 if ((getCardValue(cardPlayer) == getCardValue(cardCasino)))
125125 then [StringEntry(availableProp, makeString(avDeck3, separator)), StringEntry((round + "_player"), callerAddress), StringEntry((meKey + "_salt_debug"), meKey), IntegerEntry((meKey + "_LastRandonNumber"), cardPositionCasino), IntegerEntry((round + "_sumBets"), newSumBets), StringEntry((meKey + "_playerCard"), cardPlayer), StringEntry((meKey + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), (currentDraws + 1))]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let casino = "3MtaCL4v1bjTabUqs7oU4ofS8fbai34WM1i"
55
66 let WAVES = 1000000000
77
88 let maxBet = (100 * WAVES)
99
1010 let separator = ","
1111
1212 func getNewDeck () = ["01C", "02C", "03C", "04C", "05C", "06C", "07C", "08C", "09C", "10C", "11C", "12C", "13C", "01D", "02D", "03D", "04D", "05D", "06D", "07D", "08D", "09D", "10D", "11D", "12D", "13D", "01H", "02H", "03H", "04H", "05H", "06H", "07H", "08H", "09H", "10H", "11H", "12H", "13H", "01S", "02S", "03S", "04S", "05S", "06S", "07S", "08S", "09S", "10S", "11S", "12S", "13S"]
1313
1414
1515 func getDeck (deck) = if ((0 >= size(deck)))
1616 then getNewDeck()
1717 else deck
1818
1919
2020 func getRandomNumber (salt1,salt2,answersCount) = {
2121 let hash = sha256(toBytes((salt1 + salt2)))
2222 let index = toInt(hash)
2323 let rand = (index % answersCount)
2424 if ((0 > rand))
2525 then ((-1 * rand) + 1)
2626 else (rand + 1)
2727 }
2828
2929
3030 func getPreviousRandomNumber (address) = match getInteger(this, (address + "_LastRandonNumber")) {
3131 case n: Int =>
3232 toString(n)
3333 case _ =>
3434 address
3535 }
3636
3737
3838 func getAmountOrZero (this,key) = match getInteger(this, key) {
3939 case a: Int =>
4040 a
4141 case _ =>
4242 0
4343 }
4444
4545
4646 func getPayment (i) = if ((size(i.payments) == 0))
4747 then throw("Payment must be attached")
4848 else {
4949 let pmt = i.payments[0]
5050 if (isDefined(pmt.assetId))
5151 then throw("This function accepts WAVES tokens only")
5252 else pmt.amount
5353 }
5454
5555
5656 func getCardValue (stringCard) = {
5757 let p = parseIntValue(take(stringCard, 2))
5858 if ((p == 1))
5959 then 20
6060 else p
6161 }
6262
6363
6464 func getWinner (cardPlayer,cardCasino,callerAddress,casino) = {
6565 let p = getCardValue(cardPlayer)
6666 let o = getCardValue(cardCasino)
6767 if ((p > o))
6868 then callerAddress
6969 else casino
7070 }
7171
7272
7373 func getAvailableDeck (this,availableProp) = if (isDefined(getString(this, availableProp)))
7474 then {
7575 let stringDeck = getStringValue(this, availableProp)
7676 let deck = split(stringDeck, separator)
7777 if ((size(deck) == 0))
7878 then getNewDeck()
7979 else deck
8080 }
8181 else getNewDeck()
8282
8383
8484 @Callable(i)
8585 func bet (round) = {
8686 let callerAddress = toBase58String(i.caller.bytes)
8787 let meKey = round
8888 let p = getPayment(i)
8989 let roundBetsKey = (round + "_sumBets")
9090 let curSumBets = getAmountOrZero(this, roundBetsKey)
9191 let currentDraws = match getInteger(this, (round + "_drawSequence")) {
9292 case a: Int =>
9393 (a + 1)
9494 case _ =>
9595 0
9696 }
9797 let currentPlayer = match getString(this, (round + "_player")) {
9898 case a: String =>
9999 a
100100 case _ =>
101101 unit
102102 }
103103 let availableProp = (meKey + "_available")
104104 let newSumBets = (curSumBets + p)
105105 if (if (isDefined(getBoolean(this, (round + "_stop"))))
106106 then true
107107 else isDefined(getString(this, round)))
108108 then throw("This round is already played")
109109 else if (if (isDefined(getString(this, (round + "_player"))))
110110 then (currentPlayer != callerAddress)
111111 else false)
112112 then throw("This is not your game")
113113 else if ((newSumBets > maxBet))
114114 then throw(((("Maximum amount of bets for round " + toString(maxBet)) + ". With your bet it's ") + toString(newSumBets)))
115115 else {
116116 let avDeck = getAvailableDeck(this, availableProp)
117117 let cardPositionPlayer = getRandomNumber(((meKey + makeString(avDeck, separator)) + callerAddress), getPreviousRandomNumber(callerAddress), size(avDeck))
118118 let cardPlayer = avDeck[(cardPositionPlayer % size(avDeck))]
119119 let avDeck1 = removeByIndex(avDeck, (cardPositionPlayer % size(avDeck)))
120120 let avDeck2 = getDeck(avDeck1)
121121 let cardPositionCasino = getRandomNumber(((meKey + makeString(avDeck2, separator)) + callerAddress), getPreviousRandomNumber(callerAddress), size(avDeck2))
122- let cardCasino = avDeck2[((cardPositionPlayer + 12) % size(avDeck2))]
122+ let cardCasino = avDeck2[(cardPositionCasino % size(avDeck2))]
123123 let avDeck3 = removeByIndex(avDeck2, (cardPositionCasino % size(avDeck2)))
124124 if ((getCardValue(cardPlayer) == getCardValue(cardCasino)))
125125 then [StringEntry(availableProp, makeString(avDeck3, separator)), StringEntry((round + "_player"), callerAddress), StringEntry((meKey + "_salt_debug"), meKey), IntegerEntry((meKey + "_LastRandonNumber"), cardPositionCasino), IntegerEntry((round + "_sumBets"), newSumBets), StringEntry((meKey + "_playerCard"), cardPlayer), StringEntry((meKey + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), (currentDraws + 1))]
126126 else {
127127 let winner = getWinner(cardPlayer, cardCasino, callerAddress, casino)
128128 [StringEntry(availableProp, makeString(avDeck3, separator)), StringEntry((meKey + "_salt_debug"), meKey), StringEntry((round + "_player"), callerAddress), IntegerEntry((meKey + "_LastRandonNumber"), cardPositionCasino), IntegerEntry((round + "_sumBets"), newSumBets), StringEntry((meKey + "_playerCard"), cardPlayer), StringEntry((meKey + "_casinoCard"), cardCasino), BooleanEntry((round + "_stop"), true), StringEntry((round + "_winner"), winner)]
129129 }
130130 }
131131 }
132132
133133
134134
135135 @Callable(i)
136136 func withdraw (round) = {
137137 let callerAddress = toBase58String(i.caller.bytes)
138138 let meKey = ((round + "_") + callerAddress)
139139 let withdrawKey = (round + "_withdraw")
140140 if (isDefined(getString(this, withdrawKey)))
141141 then throw("You have already got your prize")
142142 else if (!(isDefined(getString(this, (round + "_winner")))))
143143 then throw("There is no winner, it was a draw")
144144 else {
145145 let winner = getStringValue(this, (round + "_winner"))
146146 let player = getStringValue(this, (round + "_player"))
147147 let curSumBet = getIntegerValue(this, (round + "_sumBets"))
148148 if ((curSumBet == 0))
149149 then throw("You won nothing this round")
150150 else if (if ((winner == callerAddress))
151151 then (winner == casino)
152152 else false)
153153 then [StringEntry(withdrawKey, toString(curSumBet)), ScriptTransfer(i.caller, curSumBet, unit)]
154154 else if (if ((winner == callerAddress))
155155 then (winner == player)
156156 else false)
157157 then [StringEntry(withdrawKey, toString((curSumBet * 2))), ScriptTransfer(i.caller, (curSumBet * 2), unit)]
158158 else throw("You are not the winner")
159159 }
160160 }
161161
162162
163163 @Verifier(tx)
164164 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
165165

github/deemru/w8io/026f985 
28.23 ms