tx · 4bHKND1FAGGeVvp12T25hd9P3TsgePqhi3JToEsM1C1C

3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd:  -0.10000000 Waves

2021.12.01 02:18 [1814423] smart account 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd > SELF 0.00000000 Waves

{ "type": 13, "id": "4bHKND1FAGGeVvp12T25hd9P3TsgePqhi3JToEsM1C1C", "fee": 10000000, "feeAssetId": null, "timestamp": 1638314428752, "version": 1, "sender": "3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd", "senderPublicKey": "7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi", "proofs": [ "3e1vFJoRoCD3m9w8sjUQgqaN8JLXrEZpqVR2d1jbeQG6LHXEGMhJ6yAWN18VUeAAJQijzsJ9HY1BLB8dZC2kuqzk" ], "script": "base64:AAIFAAAAAAAAA+cIAhIDCgEIEgMKAQgaDAoCYTESBmNhc2lubxoLCgJhMhIFV0FWRVMaDAoCYTMSBm1heEJldBoPCgJhNBIJc2VwYXJhdG9yGhAKAmE1EgpnZXROZXdEZWNrGhQKAmE2Eg5nZXRTaXhOZXdEZWNrcxoNCgJhNxIHZ2V0RGVjaxoKCgJhOBIEZGVjaxoVCgJhORIPZ2V0UmFuZG9tTnVtYmVyGgsKAmIxEgVzYWx0MRoLCgJiMhIFc2FsdDIaEgoCYjMSDGFuc3dlcnNDb3VudBoKCgJiNBIEaGFzaBoLCgJiNRIFaW5kZXgaCgoCYjYSBHJhbmQaHQoCYjcSF2dldFByZXZpb3VzUmFuZG9tTnVtYmVyGg0KAmI4EgdhZGRyZXNzGg0KAmI5EgckbWF0Y2gwGhUKAmMxEg9nZXRBbW91bnRPclplcm8aCgoCYzISBHRoaXMaCQoCYzMSA2tleRoQCgJjNBIKZ2V0UGF5bWVudBoJCgJjNRIDcG10GhIKAmM2EgxnZXRDYXJkVmFsdWUaEAoCYzcSCnN0cmluZ0NhcmQaDwoCYzgSCWd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AAAMwN0MJAARMAAAAAgIAAAADMDhDCQAETAAAAAICAAAAAzA5QwkABEwAAAACAgAAAAMxMEMJAARMAAAAAgIAAAADMTFDCQAETAAAAAICAAAAAzEyQwkABEwAAAACAgAAAAMxM0MJAARMAAAAAgIAAAADMDFECQAETAAAAAICAAAAAzAyRAkABEwAAAACAgAAAAMwM0QJAARMAAAAAgIAAAADMDRECQAETAAAAAICAAAAAzA1RAkABEwAAAACAgAAAAMwNkQJAARMAAAAAgIAAAADMDdECQAETAAAAAICAAAAAzA4RAkABEwAAAACAgAAAAMwOUQJAARMAAAAAgIAAAADMTBECQAETAAAAAICAAAAAzExRAkABEwAAAACAgAAAAMxMkQJAARMAAAAAgIAAAADMTNECQAETAAAAAICAAAAAzAxSAkABEwAAAACAgAAAAMwMkgJAARMAAAAAgIAAAADMDNICQAETAAAAAICAAAAAzA0SAkABEwAAAACAgAAAAMwNUgJAARMAAAAAgIAAAADMDZICQAETAAAAAICAAAAAzA3SAkABEwAAAACAgAAAAMwOEgJAARMAAAAAgIAAAADMDlICQAETAAAAAICAAAAAzEwSAkABEwAAAACAgAAAAMxMUgJAARMAAAAAgIAAAADMTJICQAETAAAAAICAAAAAzEzSAkABEwAAAACAgAAAAMwMVMJAARMAAAAAgIAAAADMDJTCQAETAAAAAICAAAAAzAzUwkABEwAAAACAgAAAAMwNFMJAARMAAAAAgIAAAADMDVTCQAETAAAAAICAAAAAzA2UwkABEwAAAACAgAAAAMwN1MJAARMAAAAAgIAAAADMDhTCQAETAAAAAICAAAAAzA5UwkABEwAAAACAgAAAAMxMFMJAARMAAAAAgIAAAADMTFTCQAETAAAAAICAAAAAzEyUwkABEwAAAACAgAAAAMxM1MFAAAAA25pbAEAAAACYTYAAAAACQAETgAAAAIJAAROAAAAAgkABE4AAAACCQAETgAAAAIJAAROAAAAAgkBAAAAAmE1AAAAAAkBAAAAAmE1AAAAAAkBAAAAAmE1AAAAAAkBAAAAAmE1AAAAAAkBAAAAAmE1AAAAAAkBAAAA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aW5nIHRoaXMgcm91bmQDAwkAAAAAAAACBQAAAAJmNwUAAAACZDIJAAAAAAAAAgUAAAACZjcFAAAAAmExBwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAAJmOAkAAaQAAAABBQAAAAJnMQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAAmcxBQAAAAR1bml0BQAAAANuaWwDAwkAAAAAAAACBQAAAAJmNwUAAAACZDIJAAAAAAAAAgUAAAACZjcFAAAAAmY5BwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAAAJmOAkAAaQAAAABCQAAaAAAAAIFAAAAAmcxAAAAAAAAAAACCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgkAAGgAAAACBQAAAAJnMQAAAAAAAAAAAgUAAAAEdW5pdAUAAAADbmlsCQAAAgAAAAECAAAAFllvdSBhcmUgbm90IHRoZSB3aW5uZXIAAAABAAAAAnR4AQAAAAJnMgAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5zxq/jA==", "chainId": 84, "height": 1814423, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8DmR7fMpJpr8AjtWvktZVTHYktvguFRPBxRLjsi34sHS Next: 9o1a7zFpmGsNr6sudj4UnE65WzvjqBksAbaGXfwgNBMY 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 getSixNewDecks () = (((((getNewDeck() ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck())
1616
1717
1818 func getDeck (deck) = if ((0 >= size(deck)))
1919 then getSixNewDecks()
2020 else deck
2121
2222
2323 func getRandomNumber (salt1,salt2,answersCount) = {
2424 let hash = sha256(toBytes((salt1 + salt2)))
2525 let index = toInt(hash)
2626 let rand = (index % answersCount)
2727 if ((0 > rand))
2828 then ((-1 * rand) + 1)
2929 else (rand + 1)
3030 }
3131
3232
3333 func getPreviousRandomNumber (address) = match getInteger(this, (address + "_LastRandonNumber")) {
3434 case n: Int =>
3535 toString(n)
3636 case _ =>
3737 address
3838 }
3939
4040
4141 func getAmountOrZero (this,key) = match getInteger(this, key) {
4242 case a: Int =>
4343 a
4444 case _ =>
4545 0
4646 }
4747
4848
4949 func getPayment (i) = if ((size(i.payments) == 0))
5050 then throw("Payment must be attached")
5151 else {
5252 let pmt = i.payments[0]
5353 if (isDefined(pmt.assetId))
5454 then throw("This function accepts WAVES tokens only")
5555 else pmt.amount
5656 }
5757
5858
5959 func getCardValue (stringCard) = {
6060 let p = parseIntValue(take(stringCard, 2))
6161 if ((p == 1))
6262 then 20
6363 else p
6464 }
6565
6666
6767 func getWinner (cardPlayer,cardCasino,callerAddress,casino) = {
6868 let p = getCardValue(cardPlayer)
6969 let o = getCardValue(cardCasino)
7070 if ((p > o))
7171 then callerAddress
7272 else casino
7373 }
7474
7575
7676 func getAvailableDeck (this,availableProp) = if (isDefined(getString(this, availableProp)))
7777 then {
7878 let stringDeck = getStringValue(this, availableProp)
7979 let deck = split(stringDeck, separator)
8080 getDeck(deck)
8181 }
8282 else getSixNewDecks()
8383
8484
8585 func getPlayerCardAndPositionAndUpdateDeck (meKey,callerAddress,deck) = {
8686 let avDeck2 = getDeck(deck)
8787 let cardPosition = getRandomNumber(((meKey + makeString(avDeck2, separator)) + callerAddress), getPreviousRandomNumber(callerAddress), size(avDeck2))
8888 let card = avDeck2[(cardPosition % size(avDeck2))]
8989 let avDeck3 = removeByIndex(avDeck2, (cardPosition % size(avDeck2)))
9090 $Tuple3(card, cardPosition, avDeck3)
9191 }
9292
9393
9494 @Callable(i)
9595 func bet (round) = {
9696 let callerAddress = toBase58String(i.caller.bytes)
9797 let meKey = round
9898 let p = getPayment(i)
9999 let roundBetsKey = (round + "_sumBets")
100100 let curSumBets = getAmountOrZero(c2, roundBetsKey)
101101 let currentDraws = match getInteger(c2, (round + "_drawSequence")) {
102102 case a: Int =>
103103 (a + 1)
104104 case _ =>
105105 0
106106 }
107107 let currentPlayer = match getString(c2, (round + "_player")) {
108108 case a: String =>
109109 a
110110 case _ =>
111111 unit
112112 }
113113 let initialBet = match getInteger(c2, (round + "_initialBet")) {
114114 case a: Int =>
115115 a
116116 case _ =>
117117 p
118118 }
119119 let availableProp = (meKey + "_available")
120120 let newSumBets = (curSumBets + p)
121121 if (if (isDefined(getBoolean(c2, (round + "_stop"))))
122122 then true
123123 else isDefined(getString(c2, round)))
124124 then throw("This round is already played")
125125 else if (if (isDefined(getString(c2, (round + "_player"))))
126126 then (currentPlayer != callerAddress)
127127 else false)
128128 then throw("This is not your game")
129129 else if ((newSumBets > maxBet))
130130 then throw(((("Maximum amount of bets for round " + toString(maxBet)) + ". With your bet it's ") + toString(newSumBets)))
131131 else if ((initialBet != p))
132132 then throw(((("Initial bet not maching original:" + toString(initialBet)) + ", actual:") + toString(p)))
133133 else {
134134 let avDeck = getAvailableDeck(c2, availableProp)
135135 let $t040074122 = getPlayerCardAndPositionAndUpdateDeck(meKey, callerAddress, avDeck)
136136 let cardPlayer = $t040074122._1
137137 let cardPositionPlayer = $t040074122._2
138138 let avDeck1 = $t040074122._3
139139 let $t041274243 = getPlayerCardAndPositionAndUpdateDeck(meKey, callerAddress, avDeck1)
140140 let cardCasino = $t041274243._1
141141 let cardPositionCasino = $t041274243._2
142142 let avDeck2 = $t041274243._3
143143 if ((getCardValue(cardPlayer) == getCardValue(cardCasino)))
144144 then [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_player"), callerAddress), IntegerEntry((round + "_initialBet"), initialBet), 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))]
145145 else {
146146 let winner = getWinner(cardPlayer, cardCasino, callerAddress, casino)
147147 [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_player"), callerAddress), IntegerEntry((round + "_initialBet"), initialBet), StringEntry((meKey + "_salt_debug"), meKey), IntegerEntry((meKey + "_LastRandonNumber"), cardPositionCasino), IntegerEntry((round + "_sumBets"), newSumBets), StringEntry((meKey + "_playerCard"), cardPlayer), StringEntry((meKey + "_casinoCard"), cardCasino), BooleanEntry((round + "_stop"), true), StringEntry((round + "_winner"), winner)]
148148 }
149149 }
150150 }
151151
152152
153153
154154 @Callable(i)
155155 func withdraw (round) = {
156156 let callerAddress = toBase58String(i.caller.bytes)
157157 let meKey = ((round + "_") + callerAddress)
158158 let withdrawKey = (round + "_withdraw")
159159 if (isDefined(getString(c2, withdrawKey)))
160160 then throw("You have already got your prize")
161161 else if (!(isDefined(getString(c2, (round + "_winner")))))
162162 then throw("There is no winner, it was a draw")
163163 else {
164164 let winner = getStringValue(c2, (round + "_winner"))
165165 let player = getStringValue(c2, (round + "_player"))
166166 let curSumBet = getIntegerValue(c2, (round + "_sumBets"))
167167 if ((curSumBet == 0))
168168 then throw("You won nothing this round")
169169 else if (if ((winner == callerAddress))
170170 then (winner == casino)
171171 else false)
172172 then [StringEntry(withdrawKey, toString(curSumBet)), ScriptTransfer(i.caller, curSumBet, unit)]
173173 else if (if ((winner == callerAddress))
174174 then (winner == player)
175175 else false)
176176 then [StringEntry(withdrawKey, toString((curSumBet * 2))), ScriptTransfer(i.caller, (curSumBet * 2), unit)]
177177 else throw("You are not the winner")
178178 }
179179 }
180180
181181
182182 @Verifier(tx)
183183 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
184184

github/deemru/w8io/026f985 
43.72 ms