tx · C7EMUrbJvfo1YZd8n7fR7Lkr2Pw1skyDk2qsFFN93Kwz 3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX: -0.05000000 Waves 2019.10.28 07:23 [739466] smart account 3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX > SELF 0.00000000 Waves
{ "type": 13, "id": "C7EMUrbJvfo1YZd8n7fR7Lkr2Pw1skyDk2qsFFN93Kwz", "fee": 5000000, "feeAssetId": null, "timestamp": 1572236593845, "version": 1, "sender": "3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX", "senderPublicKey": "ACfUG5PwG2GssMuyEwVEhkYAbbbP1geSHR8XoNxLyu6V", "proofs": [ "5B4H5rYCxbEx6KBvEAJvrBypnDaBYX5GWYcBfRJ9uKErp65hEQd2oHHzyZR2evPnwtWfRo4ybcqrqSjMyyB1Mr2" ], "script": "base64:AAIDAAAAAAAAAA4IARIECgIIARIECgIIAgAAACYAAAAACVJTQVBVQkxJQwkAAlsAAAABAgAAAY9iYXNlNjQ6TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFnNGRBUjZYYkJEQVM5aHIvRWozZEp2NkZmYzQ2NngvbU9HTVdVM2xyQUJzM3FhOEJIbXVKR25rZmJwRWYydkF3WVRPV1B2dnpmTTEwT0JiZmxvU3lxM2M5TUt2eVRlMWx1QkxHcVc0dlpVWEl5dlNnejFsaXlVVmVmSVF5M2R5RjlqYmVUWmJDMGJiY1QvN08zREVMKzAxejZBK3JEQ2FjU1owbEdvbFNRNkFuaEx4eklrVnBPUUpickJtQyt4K1p1WlBDTVd6SnluZDVhZU9uN2phai9ta1JWeXhlNmcvME9oV3o0TmlpWlhldU1SQis4bUt5MGZXRC9VbElsWldIc0FTMlptcmtYS3FqTHEwLzB3cjhJTEprem5qU3Fkbkk1SWJqZzN1UXJqLzRBTitpOXIyOGFRNzMvWmtQdFk1U2J3MEFPaUFCQnU3Z0htcTlheVZ4WlFJREFRQ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RyYW5zYWN0aW9uBAAAAAN0dHgFAAAAByRtYXRjaDAJAABnAAAAAgkAAGUAAAACCQAD6wAAAAIFAAAABHRoaXMFAAAABFdCRVQIBQAAAAN0dHgAAAAGYW1vdW50CQEAAAASRXh0cmFjdFJlc2VydmVkQW10AAAAAAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAA3N0eAUAAAAHJG1hdGNoMAYHB0NA2Kc=", "chainId": 84, "height": 739466, "spentComplexity": 0 } View: original | compacted Prev: 6TN2UzpqopB3uUh2yy3JFYP8b1zyZEENLuwLShTAgsfL Next: FwfpqDPfs3EvW1znFgeaBgWkz9oSo2YyLTkwEc4xbs2w Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
7 | 7 | ||
8 | + | let RESERVATIONKEY = "$RESERVED_AMOUNT" | |
9 | + | ||
8 | 10 | let WBET = base58'23vgV9p9pD83A7CFbsDEc4zjanep7UeFo4ZRS6oGorhv' | |
11 | + | ||
12 | + | let WAVELET = 100000000 | |
9 | 13 | ||
10 | 14 | let FEEWAVESBET = 4 | |
11 | 15 | ||
12 | 16 | let FEEMCAFEE = 2 | |
13 | 17 | ||
14 | - | let | |
18 | + | let STATESUBMITTED = "SUBMITTED" | |
15 | 19 | ||
16 | 20 | let STATEWON = "WON" | |
17 | 21 | ||
29 | 33 | ||
30 | 34 | let PREDICTIONMAX = 99 | |
31 | 35 | ||
36 | + | let IdxGameState = 0 | |
37 | + | ||
38 | + | let IdxPrediction = 1 | |
39 | + | ||
40 | + | let IdxType = 2 | |
41 | + | ||
42 | + | let IdxPlayerPubKey58 = 3 | |
43 | + | ||
44 | + | let IdxWinAmt = 4 | |
45 | + | ||
46 | + | let IdxRandOrEmpty = 5 | |
47 | + | ||
32 | 48 | func IncrementGameNum () = { | |
33 | 49 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
34 | 50 | case num: Int => | |
37 | 53 | 0 | |
38 | 54 | } | |
39 | 55 | (gameNum + 1) | |
56 | + | } | |
57 | + | ||
58 | + | ||
59 | + | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
60 | + | case a: Int => | |
61 | + | a | |
62 | + | case _ => | |
63 | + | 0 | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | func ValidateAndIncreaseReservedAmt (winAmt) = { | |
68 | + | let newReservedAmount = (ExtractReservedAmt() + winAmt) | |
69 | + | let balance = assetBalance(this, WBET) | |
70 | + | if ((newReservedAmount > balance)) | |
71 | + | then throw("Insufficient funds on Wavesbet Dice account. Transaction was rejected for your safety.") | |
72 | + | else newReservedAmount | |
73 | + | } | |
74 | + | ||
75 | + | ||
76 | + | func FormatGameDataParam (p) = { | |
77 | + | let s = size(p) | |
78 | + | if ((s == 0)) | |
79 | + | then throw("Parameter size must be greater then 0") | |
80 | + | else if ((s > 99)) | |
81 | + | then throw("Parameter size must be less then 100") | |
82 | + | else if ((10 > s)) | |
83 | + | then (("0" + toString(s)) + p) | |
84 | + | else (toString(s) + p) | |
85 | + | } | |
86 | + | ||
87 | + | ||
88 | + | func FormatGameDataStr (gameState,prediction,typeRoll,playerPubKey58,winAmt,randOrEmpty) = { | |
89 | + | let fullStateStr = ((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(toString(prediction))) + "_") + FormatGameDataParam(typeRoll)) + "_") + FormatGameDataParam(playerPubKey58)) + "_") + FormatGameDataParam(toString(winAmt))) | |
90 | + | if ((randOrEmpty == "")) | |
91 | + | then fullStateStr | |
92 | + | else ((fullStateStr + "_") + FormatGameDataParam(randOrEmpty)) | |
93 | + | } | |
94 | + | ||
95 | + | ||
96 | + | func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0)) | |
97 | + | then drop(remaining, 1) | |
98 | + | else remaining | |
99 | + | ||
100 | + | ||
101 | + | func ParseNextAttribute (remaining) = { | |
102 | + | let s = size(remaining) | |
103 | + | if ((s > 0)) | |
104 | + | then { | |
105 | + | let nn = parseIntValue(take(remaining, 2)) | |
106 | + | let v = take(drop(remaining, 2), nn) | |
107 | + | let tmpRemaining = drop(remaining, (nn + 2)) | |
108 | + | let remainingState = RemoveUnderscoreIfPresent(tmpRemaining) | |
109 | + | [v, remainingState] | |
110 | + | } | |
111 | + | else throw("Empty string was passed into parseNextAttribute func") | |
112 | + | } | |
113 | + | ||
114 | + | ||
115 | + | func ParseGameRawDataStr (rawStateStr) = { | |
116 | + | let gameState = ParseNextAttribute(rawStateStr) | |
117 | + | let prediction = ParseNextAttribute(gameState[1]) | |
118 | + | let rollType = ParseNextAttribute(prediction[1]) | |
119 | + | let playerPubKey58 = ParseNextAttribute(rollType[1]) | |
120 | + | let winAmt = ParseNextAttribute(playerPubKey58[1]) | |
121 | + | [gameState[0], prediction[0], rollType[0], playerPubKey58[0], winAmt[0]] | |
122 | + | } | |
123 | + | ||
124 | + | ||
125 | + | func ExtractGameDataList (gameId) = { | |
126 | + | let rawDataStr = match getString(this, gameId) { | |
127 | + | case str: String => | |
128 | + | str | |
129 | + | case _ => | |
130 | + | throw(("Couldn't find game by " + gameId)) | |
131 | + | } | |
132 | + | ParseGameRawDataStr(rawDataStr) | |
133 | + | } | |
134 | + | ||
135 | + | ||
136 | + | func DecreaseReservedAmt (gameId,winAmt) = { | |
137 | + | let newReservedAmount = (ExtractReservedAmt() - winAmt) | |
138 | + | if ((0 > newReservedAmount)) | |
139 | + | then throw("Invalid Dice Roller account state - reserved amount is less than 0") | |
140 | + | else DataEntry(RESERVATIONKEY, newReservedAmount) | |
40 | 141 | } | |
41 | 142 | ||
42 | 143 | ||
58 | 159 | else false) | |
59 | 160 | then toString(r) | |
60 | 161 | else throw(("Unsupported r parameter passed: expected=[1,...,100] actual=" + toString(r))) | |
162 | + | ||
163 | + | ||
164 | + | func WinScriptSet (gameId,playerAddress,winAmt,newGameDataStr,decreasedReserves) = { | |
165 | + | let wSetCommonData = [decreasedReserves] | |
166 | + | let tSetCommonData = [ScriptTransfer(playerAddress, winAmt, WBET)] | |
167 | + | let gameData = DataEntry(gameId, newGameDataStr) | |
168 | + | ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData)) | |
169 | + | } | |
61 | 170 | ||
62 | 171 | ||
63 | 172 | func Multiplier (prediction,rollType) = if ((rollType == ROLLUNDER)) | |
451 | 560 | else 100000 | |
452 | 561 | ||
453 | 562 | ||
454 | - | func diceWin (type,prediction, | |
455 | - | then if ((prediction >= | |
563 | + | func diceWin (type,prediction,number) = if ((type == ROLLUNDER)) | |
564 | + | then if ((prediction >= number)) | |
456 | 565 | then true | |
457 | 566 | else false | |
458 | 567 | else if ((type == ROLLOVER)) | |
459 | - | then if (( | |
568 | + | then if ((number >= prediction)) | |
460 | 569 | then true | |
461 | 570 | else false | |
462 | 571 | else false | |
481 | 590 | ||
482 | 591 | ||
483 | 592 | @Callable(i) | |
484 | - | func playDice (rollType,prediction | |
593 | + | func playDice (rollType,prediction) = { | |
485 | 594 | let gameId = toBase58String(i.transactionId) | |
486 | 595 | let payment = extract(i.payment) | |
487 | 596 | let feeAssetId = isDefined(i.feeAssetId) | |
597 | + | let multi = Multiplier(prediction, rollType) | |
598 | + | let winAmt = ValidateBetAndDefineWinAmt(payment.amount, prediction, rollType) | |
488 | 599 | let playerBalance = wavesBalance(i.caller) | |
489 | 600 | let gameIdUsed = isDefined(getString(this, gameId)) | |
490 | 601 | if ((payment.assetId != WBET)) | |
491 | - | then throw("Payment should be in Wavesbet | |
492 | - | else if (( | |
493 | - | then throw("There are not enough waves, it takes 0. | |
602 | + | then throw("Payment should be in Wavesbet") | |
603 | + | else if ((1000000 > playerBalance)) | |
604 | + | then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.") | |
494 | 605 | else if (feeAssetId) | |
495 | 606 | then throw("Transaction's fee must be in Waves. Game aborted.") | |
496 | 607 | else if (gameIdUsed) | |
497 | 608 | then throw("Passed gameId had been used before. Game aborted.") | |
498 | 609 | else { | |
499 | - | let rand = GenerateRandInt(gameId, rsaSig) | |
500 | - | let randStr = RandToStr(rand) | |
501 | - | let result = diceWin(rollType, prediction, rand) | |
502 | - | let winAmt = if (result) | |
503 | - | then ValidateBetAndDefineWinAmt(payment.amount, prediction, rollType) | |
504 | - | else 0 | |
505 | 610 | let newGameNum = IncrementGameNum() | |
506 | - | let betData = WriteSet([DataEntry(gameId, if (result) | |
507 | - | then STATEWON | |
508 | - | else STATELOST), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry("random", rand), DataEntry("payment", payment.amount), DataEntry("payout", winAmt)]) | |
509 | - | if (result) | |
510 | - | then ScriptResult(betData, TransferSet([ScriptTransfer(i.caller, winAmt, WBET)])) | |
511 | - | else ScriptResult(betData, TransferSet(nil)) | |
611 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
612 | + | let gameDataStr = FormatGameDataStr(STATESUBMITTED, prediction, rollType, playerPubKey58, winAmt, "") | |
613 | + | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil)) | |
512 | 614 | } | |
513 | 615 | } | |
514 | 616 | ||
617 | + | ||
618 | + | ||
619 | + | @Callable(i) | |
620 | + | func withdraw (gameId,rsaSig) = { | |
621 | + | let gameDataList = ExtractGameDataList(gameId) | |
622 | + | let gameState = gameDataList[IdxGameState] | |
623 | + | let prediction = parseIntValue(gameDataList[IdxPrediction]) | |
624 | + | let rollType = gameDataList[IdxType] | |
625 | + | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
626 | + | let playerPubKey58 = gameDataList[IdxPlayerPubKey58] | |
627 | + | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
628 | + | let decreasedReserves = DecreaseReservedAmt(gameId, winAmt) | |
629 | + | if ((gameState != STATESUBMITTED)) | |
630 | + | then throw("Invalid game state for passed gameId. Game aborted.") | |
631 | + | else { | |
632 | + | let rand = GenerateRandInt(gameId, rsaSig) | |
633 | + | let randStr = RandToStr(rand) | |
634 | + | if (diceWin(rollType, prediction, rand)) | |
635 | + | then { | |
636 | + | let newGameDataStr = FormatGameDataStr(STATEWON, prediction, rollType, playerPubKey58, winAmt, randStr) | |
637 | + | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, decreasedReserves) | |
638 | + | } | |
639 | + | else { | |
640 | + | let newGameDataStr = FormatGameDataStr(STATELOST, prediction, rollType, playerPubKey58, winAmt, randStr) | |
641 | + | WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves]) | |
642 | + | } | |
643 | + | } | |
644 | + | } | |
645 | + | ||
646 | + | ||
647 | + | @Verifier(tx) | |
648 | + | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
649 | + | then match tx { | |
650 | + | case ttx: TransferTransaction => | |
651 | + | ((assetBalance(this, WBET) - ttx.amount) >= ExtractReservedAmt()) | |
652 | + | case stx: SetScriptTransaction => | |
653 | + | true | |
654 | + | case _ => | |
655 | + | false | |
656 | + | } | |
657 | + | else false | |
515 | 658 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB") | |
5 | 5 | ||
6 | 6 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
7 | 7 | ||
8 | + | let RESERVATIONKEY = "$RESERVED_AMOUNT" | |
9 | + | ||
8 | 10 | let WBET = base58'23vgV9p9pD83A7CFbsDEc4zjanep7UeFo4ZRS6oGorhv' | |
11 | + | ||
12 | + | let WAVELET = 100000000 | |
9 | 13 | ||
10 | 14 | let FEEWAVESBET = 4 | |
11 | 15 | ||
12 | 16 | let FEEMCAFEE = 2 | |
13 | 17 | ||
14 | - | let | |
18 | + | let STATESUBMITTED = "SUBMITTED" | |
15 | 19 | ||
16 | 20 | let STATEWON = "WON" | |
17 | 21 | ||
18 | 22 | let STATELOST = "LOST" | |
19 | 23 | ||
20 | 24 | let ROLLUNDER = "UNDER" | |
21 | 25 | ||
22 | 26 | let ROLLOVER = "OVER" | |
23 | 27 | ||
24 | 28 | let BETMIN = (100 * WAVELET) | |
25 | 29 | ||
26 | 30 | let BETMAX = (20000000 * WAVELET) | |
27 | 31 | ||
28 | 32 | let PREDICTIONMIN = 1 | |
29 | 33 | ||
30 | 34 | let PREDICTIONMAX = 99 | |
31 | 35 | ||
36 | + | let IdxGameState = 0 | |
37 | + | ||
38 | + | let IdxPrediction = 1 | |
39 | + | ||
40 | + | let IdxType = 2 | |
41 | + | ||
42 | + | let IdxPlayerPubKey58 = 3 | |
43 | + | ||
44 | + | let IdxWinAmt = 4 | |
45 | + | ||
46 | + | let IdxRandOrEmpty = 5 | |
47 | + | ||
32 | 48 | func IncrementGameNum () = { | |
33 | 49 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
34 | 50 | case num: Int => | |
35 | 51 | num | |
36 | 52 | case _ => | |
37 | 53 | 0 | |
38 | 54 | } | |
39 | 55 | (gameNum + 1) | |
56 | + | } | |
57 | + | ||
58 | + | ||
59 | + | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
60 | + | case a: Int => | |
61 | + | a | |
62 | + | case _ => | |
63 | + | 0 | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | func ValidateAndIncreaseReservedAmt (winAmt) = { | |
68 | + | let newReservedAmount = (ExtractReservedAmt() + winAmt) | |
69 | + | let balance = assetBalance(this, WBET) | |
70 | + | if ((newReservedAmount > balance)) | |
71 | + | then throw("Insufficient funds on Wavesbet Dice account. Transaction was rejected for your safety.") | |
72 | + | else newReservedAmount | |
73 | + | } | |
74 | + | ||
75 | + | ||
76 | + | func FormatGameDataParam (p) = { | |
77 | + | let s = size(p) | |
78 | + | if ((s == 0)) | |
79 | + | then throw("Parameter size must be greater then 0") | |
80 | + | else if ((s > 99)) | |
81 | + | then throw("Parameter size must be less then 100") | |
82 | + | else if ((10 > s)) | |
83 | + | then (("0" + toString(s)) + p) | |
84 | + | else (toString(s) + p) | |
85 | + | } | |
86 | + | ||
87 | + | ||
88 | + | func FormatGameDataStr (gameState,prediction,typeRoll,playerPubKey58,winAmt,randOrEmpty) = { | |
89 | + | let fullStateStr = ((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(toString(prediction))) + "_") + FormatGameDataParam(typeRoll)) + "_") + FormatGameDataParam(playerPubKey58)) + "_") + FormatGameDataParam(toString(winAmt))) | |
90 | + | if ((randOrEmpty == "")) | |
91 | + | then fullStateStr | |
92 | + | else ((fullStateStr + "_") + FormatGameDataParam(randOrEmpty)) | |
93 | + | } | |
94 | + | ||
95 | + | ||
96 | + | func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0)) | |
97 | + | then drop(remaining, 1) | |
98 | + | else remaining | |
99 | + | ||
100 | + | ||
101 | + | func ParseNextAttribute (remaining) = { | |
102 | + | let s = size(remaining) | |
103 | + | if ((s > 0)) | |
104 | + | then { | |
105 | + | let nn = parseIntValue(take(remaining, 2)) | |
106 | + | let v = take(drop(remaining, 2), nn) | |
107 | + | let tmpRemaining = drop(remaining, (nn + 2)) | |
108 | + | let remainingState = RemoveUnderscoreIfPresent(tmpRemaining) | |
109 | + | [v, remainingState] | |
110 | + | } | |
111 | + | else throw("Empty string was passed into parseNextAttribute func") | |
112 | + | } | |
113 | + | ||
114 | + | ||
115 | + | func ParseGameRawDataStr (rawStateStr) = { | |
116 | + | let gameState = ParseNextAttribute(rawStateStr) | |
117 | + | let prediction = ParseNextAttribute(gameState[1]) | |
118 | + | let rollType = ParseNextAttribute(prediction[1]) | |
119 | + | let playerPubKey58 = ParseNextAttribute(rollType[1]) | |
120 | + | let winAmt = ParseNextAttribute(playerPubKey58[1]) | |
121 | + | [gameState[0], prediction[0], rollType[0], playerPubKey58[0], winAmt[0]] | |
122 | + | } | |
123 | + | ||
124 | + | ||
125 | + | func ExtractGameDataList (gameId) = { | |
126 | + | let rawDataStr = match getString(this, gameId) { | |
127 | + | case str: String => | |
128 | + | str | |
129 | + | case _ => | |
130 | + | throw(("Couldn't find game by " + gameId)) | |
131 | + | } | |
132 | + | ParseGameRawDataStr(rawDataStr) | |
133 | + | } | |
134 | + | ||
135 | + | ||
136 | + | func DecreaseReservedAmt (gameId,winAmt) = { | |
137 | + | let newReservedAmount = (ExtractReservedAmt() - winAmt) | |
138 | + | if ((0 > newReservedAmount)) | |
139 | + | then throw("Invalid Dice Roller account state - reserved amount is less than 0") | |
140 | + | else DataEntry(RESERVATIONKEY, newReservedAmount) | |
40 | 141 | } | |
41 | 142 | ||
42 | 143 | ||
43 | 144 | func GenerateRandInt (gameId,rsaSign) = { | |
44 | 145 | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
45 | 146 | if (rsaSigValid) | |
46 | 147 | then { | |
47 | 148 | let rand = (toInt(sha256(rsaSign)) % 100) | |
48 | 149 | if ((0 > rand)) | |
49 | 150 | then ((-1 * rand) + 1) | |
50 | 151 | else (rand + 1) | |
51 | 152 | } | |
52 | 153 | else throw("Invalid RSA signature") | |
53 | 154 | } | |
54 | 155 | ||
55 | 156 | ||
56 | 157 | func RandToStr (r) = if (if ((r >= 1)) | |
57 | 158 | then (100 >= r) | |
58 | 159 | else false) | |
59 | 160 | then toString(r) | |
60 | 161 | else throw(("Unsupported r parameter passed: expected=[1,...,100] actual=" + toString(r))) | |
162 | + | ||
163 | + | ||
164 | + | func WinScriptSet (gameId,playerAddress,winAmt,newGameDataStr,decreasedReserves) = { | |
165 | + | let wSetCommonData = [decreasedReserves] | |
166 | + | let tSetCommonData = [ScriptTransfer(playerAddress, winAmt, WBET)] | |
167 | + | let gameData = DataEntry(gameId, newGameDataStr) | |
168 | + | ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData)) | |
169 | + | } | |
61 | 170 | ||
62 | 171 | ||
63 | 172 | func Multiplier (prediction,rollType) = if ((rollType == ROLLUNDER)) | |
64 | 173 | then if ((prediction == 1)) | |
65 | 174 | then 9850000 | |
66 | 175 | else if ((prediction == 2)) | |
67 | 176 | then 4925000 | |
68 | 177 | else if ((prediction == 3)) | |
69 | 178 | then 3283330 | |
70 | 179 | else if ((prediction == 4)) | |
71 | 180 | then 2462500 | |
72 | 181 | else if ((prediction == 5)) | |
73 | 182 | then 1970000 | |
74 | 183 | else if ((prediction == 6)) | |
75 | 184 | then 1641660 | |
76 | 185 | else if ((prediction == 7)) | |
77 | 186 | then 1407140 | |
78 | 187 | else if ((prediction == 8)) | |
79 | 188 | then 1231250 | |
80 | 189 | else if ((prediction == 9)) | |
81 | 190 | then 1094440 | |
82 | 191 | else if ((prediction == 10)) | |
83 | 192 | then 985000 | |
84 | 193 | else if ((prediction == 11)) | |
85 | 194 | then 895450 | |
86 | 195 | else if ((prediction == 12)) | |
87 | 196 | then 820830 | |
88 | 197 | else if ((prediction == 13)) | |
89 | 198 | then 757690 | |
90 | 199 | else if ((prediction == 14)) | |
91 | 200 | then 703570 | |
92 | 201 | else if ((prediction == 15)) | |
93 | 202 | then 656660 | |
94 | 203 | else if ((prediction == 16)) | |
95 | 204 | then 615620 | |
96 | 205 | else if ((prediction == 17)) | |
97 | 206 | then 579410 | |
98 | 207 | else if ((prediction == 18)) | |
99 | 208 | then 547220 | |
100 | 209 | else if ((prediction == 19)) | |
101 | 210 | then 518420 | |
102 | 211 | else if ((prediction == 20)) | |
103 | 212 | then 492500 | |
104 | 213 | else if ((prediction == 21)) | |
105 | 214 | then 469040 | |
106 | 215 | else if ((prediction == 22)) | |
107 | 216 | then 447720 | |
108 | 217 | else if ((prediction == 23)) | |
109 | 218 | then 428260 | |
110 | 219 | else if ((prediction == 24)) | |
111 | 220 | then 410410 | |
112 | 221 | else if ((prediction == 25)) | |
113 | 222 | then 394000 | |
114 | 223 | else if ((prediction == 26)) | |
115 | 224 | then 378840 | |
116 | 225 | else if ((prediction == 27)) | |
117 | 226 | then 364810 | |
118 | 227 | else if ((prediction == 28)) | |
119 | 228 | then 351780 | |
120 | 229 | else if ((prediction == 29)) | |
121 | 230 | then 339650 | |
122 | 231 | else if ((prediction == 30)) | |
123 | 232 | then 328330 | |
124 | 233 | else if ((prediction == 31)) | |
125 | 234 | then 317740 | |
126 | 235 | else if ((prediction == 32)) | |
127 | 236 | then 307810 | |
128 | 237 | else if ((prediction == 33)) | |
129 | 238 | then 298480 | |
130 | 239 | else if ((prediction == 34)) | |
131 | 240 | then 289700 | |
132 | 241 | else if ((prediction == 35)) | |
133 | 242 | then 281420 | |
134 | 243 | else if ((prediction == 36)) | |
135 | 244 | then 273610 | |
136 | 245 | else if ((prediction == 37)) | |
137 | 246 | then 259210 | |
138 | 247 | else if ((prediction == 38)) | |
139 | 248 | then 259210 | |
140 | 249 | else if ((prediction == 39)) | |
141 | 250 | then 252560 | |
142 | 251 | else if ((prediction == 40)) | |
143 | 252 | then 246250 | |
144 | 253 | else if ((prediction == 41)) | |
145 | 254 | then 240240 | |
146 | 255 | else if ((prediction == 42)) | |
147 | 256 | then 234520 | |
148 | 257 | else if ((prediction == 43)) | |
149 | 258 | then 229060 | |
150 | 259 | else if ((prediction == 44)) | |
151 | 260 | then 223860 | |
152 | 261 | else if ((prediction == 45)) | |
153 | 262 | then 218880 | |
154 | 263 | else if ((prediction == 46)) | |
155 | 264 | then 214130 | |
156 | 265 | else if ((prediction == 47)) | |
157 | 266 | then 209570 | |
158 | 267 | else if ((prediction == 48)) | |
159 | 268 | then 205200 | |
160 | 269 | else if ((prediction == 49)) | |
161 | 270 | then 201020 | |
162 | 271 | else if ((prediction == 50)) | |
163 | 272 | then 197000 | |
164 | 273 | else if ((prediction == 51)) | |
165 | 274 | then 193130 | |
166 | 275 | else if ((prediction == 52)) | |
167 | 276 | then 189420 | |
168 | 277 | else if ((prediction == 53)) | |
169 | 278 | then 185840 | |
170 | 279 | else if ((prediction == 54)) | |
171 | 280 | then 182400 | |
172 | 281 | else if ((prediction == 55)) | |
173 | 282 | then 179090 | |
174 | 283 | else if ((prediction == 56)) | |
175 | 284 | then 175890 | |
176 | 285 | else if ((prediction == 57)) | |
177 | 286 | then 172800 | |
178 | 287 | else if ((prediction == 58)) | |
179 | 288 | then 169820 | |
180 | 289 | else if ((prediction == 59)) | |
181 | 290 | then 166940 | |
182 | 291 | else if ((prediction == 60)) | |
183 | 292 | then 164160 | |
184 | 293 | else if ((prediction == 61)) | |
185 | 294 | then 161470 | |
186 | 295 | else if ((prediction == 62)) | |
187 | 296 | then 158870 | |
188 | 297 | else if ((prediction == 63)) | |
189 | 298 | then 156340 | |
190 | 299 | else if ((prediction == 64)) | |
191 | 300 | then 153900 | |
192 | 301 | else if ((prediction == 65)) | |
193 | 302 | then 151530 | |
194 | 303 | else if ((prediction == 66)) | |
195 | 304 | then 149240 | |
196 | 305 | else if ((prediction == 67)) | |
197 | 306 | then 147010 | |
198 | 307 | else if ((prediction == 68)) | |
199 | 308 | then 144850 | |
200 | 309 | else if ((prediction == 69)) | |
201 | 310 | then 142750 | |
202 | 311 | else if ((prediction == 70)) | |
203 | 312 | then 140710 | |
204 | 313 | else if ((prediction == 71)) | |
205 | 314 | then 138730 | |
206 | 315 | else if ((prediction == 72)) | |
207 | 316 | then 136800 | |
208 | 317 | else if ((prediction == 73)) | |
209 | 318 | then 134930 | |
210 | 319 | else if ((prediction == 74)) | |
211 | 320 | then 133100 | |
212 | 321 | else if ((prediction == 75)) | |
213 | 322 | then 131330 | |
214 | 323 | else if ((prediction == 76)) | |
215 | 324 | then 129600 | |
216 | 325 | else if ((prediction == 77)) | |
217 | 326 | then 127920 | |
218 | 327 | else if ((prediction == 78)) | |
219 | 328 | then 126280 | |
220 | 329 | else if ((prediction == 79)) | |
221 | 330 | then 124680 | |
222 | 331 | else if ((prediction == 80)) | |
223 | 332 | then 123120 | |
224 | 333 | else if ((prediction == 81)) | |
225 | 334 | then 121600 | |
226 | 335 | else if ((prediction == 82)) | |
227 | 336 | then 120120 | |
228 | 337 | else if ((prediction == 83)) | |
229 | 338 | then 118670 | |
230 | 339 | else if ((prediction == 84)) | |
231 | 340 | then 117260 | |
232 | 341 | else if ((prediction == 85)) | |
233 | 342 | then 115880 | |
234 | 343 | else if ((prediction == 86)) | |
235 | 344 | then 114530 | |
236 | 345 | else if ((prediction == 87)) | |
237 | 346 | then 113210 | |
238 | 347 | else if ((prediction == 88)) | |
239 | 348 | then 111930 | |
240 | 349 | else if ((prediction == 89)) | |
241 | 350 | then 110670 | |
242 | 351 | else if ((prediction == 90)) | |
243 | 352 | then 109440 | |
244 | 353 | else if ((prediction == 91)) | |
245 | 354 | then 108240 | |
246 | 355 | else if ((prediction == 92)) | |
247 | 356 | then 107060 | |
248 | 357 | else if ((prediction == 93)) | |
249 | 358 | then 105910 | |
250 | 359 | else if ((prediction == 94)) | |
251 | 360 | then 104780 | |
252 | 361 | else if ((prediction == 95)) | |
253 | 362 | then 103680 | |
254 | 363 | else if ((prediction == 96)) | |
255 | 364 | then 103680 | |
256 | 365 | else 100000 | |
257 | 366 | else if ((rollType == ROLLOVER)) | |
258 | 367 | then if ((prediction == 4)) | |
259 | 368 | then 103680 | |
260 | 369 | else if ((prediction == 5)) | |
261 | 370 | then 103680 | |
262 | 371 | else if ((prediction == 6)) | |
263 | 372 | then 104780 | |
264 | 373 | else if ((prediction == 7)) | |
265 | 374 | then 105910 | |
266 | 375 | else if ((prediction == 8)) | |
267 | 376 | then 107060 | |
268 | 377 | else if ((prediction == 9)) | |
269 | 378 | then 108240 | |
270 | 379 | else if ((prediction == 10)) | |
271 | 380 | then 109440 | |
272 | 381 | else if ((prediction == 11)) | |
273 | 382 | then 110670 | |
274 | 383 | else if ((prediction == 12)) | |
275 | 384 | then 111930 | |
276 | 385 | else if ((prediction == 13)) | |
277 | 386 | then 113210 | |
278 | 387 | else if ((prediction == 14)) | |
279 | 388 | then 114530 | |
280 | 389 | else if ((prediction == 15)) | |
281 | 390 | then 115880 | |
282 | 391 | else if ((prediction == 16)) | |
283 | 392 | then 117260 | |
284 | 393 | else if ((prediction == 17)) | |
285 | 394 | then 118670 | |
286 | 395 | else if ((prediction == 18)) | |
287 | 396 | then 120120 | |
288 | 397 | else if ((prediction == 19)) | |
289 | 398 | then 121600 | |
290 | 399 | else if ((prediction == 20)) | |
291 | 400 | then 123120 | |
292 | 401 | else if ((prediction == 21)) | |
293 | 402 | then 124680 | |
294 | 403 | else if ((prediction == 22)) | |
295 | 404 | then 126280 | |
296 | 405 | else if ((prediction == 23)) | |
297 | 406 | then 127920 | |
298 | 407 | else if ((prediction == 24)) | |
299 | 408 | then 129600 | |
300 | 409 | else if ((prediction == 25)) | |
301 | 410 | then 131330 | |
302 | 411 | else if ((prediction == 26)) | |
303 | 412 | then 133100 | |
304 | 413 | else if ((prediction == 27)) | |
305 | 414 | then 134930 | |
306 | 415 | else if ((prediction == 28)) | |
307 | 416 | then 136800 | |
308 | 417 | else if ((prediction == 29)) | |
309 | 418 | then 138730 | |
310 | 419 | else if ((prediction == 30)) | |
311 | 420 | then 140710 | |
312 | 421 | else if ((prediction == 31)) | |
313 | 422 | then 142750 | |
314 | 423 | else if ((prediction == 32)) | |
315 | 424 | then 144850 | |
316 | 425 | else if ((prediction == 33)) | |
317 | 426 | then 147010 | |
318 | 427 | else if ((prediction == 34)) | |
319 | 428 | then 149240 | |
320 | 429 | else if ((prediction == 35)) | |
321 | 430 | then 151530 | |
322 | 431 | else if ((prediction == 36)) | |
323 | 432 | then 153900 | |
324 | 433 | else if ((prediction == 37)) | |
325 | 434 | then 156340 | |
326 | 435 | else if ((prediction == 38)) | |
327 | 436 | then 158870 | |
328 | 437 | else if ((prediction == 39)) | |
329 | 438 | then 161470 | |
330 | 439 | else if ((prediction == 40)) | |
331 | 440 | then 164160 | |
332 | 441 | else if ((prediction == 41)) | |
333 | 442 | then 166940 | |
334 | 443 | else if ((prediction == 42)) | |
335 | 444 | then 169820 | |
336 | 445 | else if ((prediction == 43)) | |
337 | 446 | then 172800 | |
338 | 447 | else if ((prediction == 44)) | |
339 | 448 | then 175890 | |
340 | 449 | else if ((prediction == 45)) | |
341 | 450 | then 179090 | |
342 | 451 | else if ((prediction == 46)) | |
343 | 452 | then 185840 | |
344 | 453 | else if ((prediction == 47)) | |
345 | 454 | then 185840 | |
346 | 455 | else if ((prediction == 48)) | |
347 | 456 | then 189420 | |
348 | 457 | else if ((prediction == 49)) | |
349 | 458 | then 193130 | |
350 | 459 | else if ((prediction == 50)) | |
351 | 460 | then 197000 | |
352 | 461 | else if ((prediction == 51)) | |
353 | 462 | then 201020 | |
354 | 463 | else if ((prediction == 52)) | |
355 | 464 | then 205200 | |
356 | 465 | else if ((prediction == 53)) | |
357 | 466 | then 209570 | |
358 | 467 | else if ((prediction == 54)) | |
359 | 468 | then 214130 | |
360 | 469 | else if ((prediction == 55)) | |
361 | 470 | then 218880 | |
362 | 471 | else if ((prediction == 56)) | |
363 | 472 | then 223860 | |
364 | 473 | else if ((prediction == 57)) | |
365 | 474 | then 229060 | |
366 | 475 | else if ((prediction == 58)) | |
367 | 476 | then 234520 | |
368 | 477 | else if ((prediction == 59)) | |
369 | 478 | then 240240 | |
370 | 479 | else if ((prediction == 60)) | |
371 | 480 | then 246250 | |
372 | 481 | else if ((prediction == 61)) | |
373 | 482 | then 252560 | |
374 | 483 | else if ((prediction == 62)) | |
375 | 484 | then 259210 | |
376 | 485 | else if ((prediction == 63)) | |
377 | 486 | then 259210 | |
378 | 487 | else if ((prediction == 64)) | |
379 | 488 | then 273610 | |
380 | 489 | else if ((prediction == 65)) | |
381 | 490 | then 281420 | |
382 | 491 | else if ((prediction == 66)) | |
383 | 492 | then 289700 | |
384 | 493 | else if ((prediction == 67)) | |
385 | 494 | then 298480 | |
386 | 495 | else if ((prediction == 68)) | |
387 | 496 | then 307810 | |
388 | 497 | else if ((prediction == 69)) | |
389 | 498 | then 317740 | |
390 | 499 | else if ((prediction == 70)) | |
391 | 500 | then 328330 | |
392 | 501 | else if ((prediction == 71)) | |
393 | 502 | then 339650 | |
394 | 503 | else if ((prediction == 72)) | |
395 | 504 | then 351780 | |
396 | 505 | else if ((prediction == 73)) | |
397 | 506 | then 364810 | |
398 | 507 | else if ((prediction == 74)) | |
399 | 508 | then 378840 | |
400 | 509 | else if ((prediction == 75)) | |
401 | 510 | then 394000 | |
402 | 511 | else if ((prediction == 76)) | |
403 | 512 | then 410410 | |
404 | 513 | else if ((prediction == 77)) | |
405 | 514 | then 428260 | |
406 | 515 | else if ((prediction == 78)) | |
407 | 516 | then 447720 | |
408 | 517 | else if ((prediction == 79)) | |
409 | 518 | then 469040 | |
410 | 519 | else if ((prediction == 80)) | |
411 | 520 | then 492500 | |
412 | 521 | else if ((prediction == 81)) | |
413 | 522 | then 518420 | |
414 | 523 | else if ((prediction == 82)) | |
415 | 524 | then 547220 | |
416 | 525 | else if ((prediction == 83)) | |
417 | 526 | then 579410 | |
418 | 527 | else if ((prediction == 84)) | |
419 | 528 | then 615620 | |
420 | 529 | else if ((prediction == 85)) | |
421 | 530 | then 656660 | |
422 | 531 | else if ((prediction == 86)) | |
423 | 532 | then 703570 | |
424 | 533 | else if ((prediction == 87)) | |
425 | 534 | then 757690 | |
426 | 535 | else if ((prediction == 88)) | |
427 | 536 | then 820830 | |
428 | 537 | else if ((prediction == 89)) | |
429 | 538 | then 895450 | |
430 | 539 | else if ((prediction == 90)) | |
431 | 540 | then 985000 | |
432 | 541 | else if ((prediction == 91)) | |
433 | 542 | then 1094440 | |
434 | 543 | else if ((prediction == 92)) | |
435 | 544 | then 1231250 | |
436 | 545 | else if ((prediction == 93)) | |
437 | 546 | then 1407140 | |
438 | 547 | else if ((prediction == 94)) | |
439 | 548 | then 1641660 | |
440 | 549 | else if ((prediction == 95)) | |
441 | 550 | then 1970000 | |
442 | 551 | else if ((prediction == 96)) | |
443 | 552 | then 2462500 | |
444 | 553 | else if ((prediction == 97)) | |
445 | 554 | then 3283330 | |
446 | 555 | else if ((prediction == 98)) | |
447 | 556 | then 4925000 | |
448 | 557 | else if ((prediction == 99)) | |
449 | 558 | then 9850000 | |
450 | 559 | else 100000 | |
451 | 560 | else 100000 | |
452 | 561 | ||
453 | 562 | ||
454 | - | func diceWin (type,prediction, | |
455 | - | then if ((prediction >= | |
563 | + | func diceWin (type,prediction,number) = if ((type == ROLLUNDER)) | |
564 | + | then if ((prediction >= number)) | |
456 | 565 | then true | |
457 | 566 | else false | |
458 | 567 | else if ((type == ROLLOVER)) | |
459 | - | then if (( | |
568 | + | then if ((number >= prediction)) | |
460 | 569 | then true | |
461 | 570 | else false | |
462 | 571 | else false | |
463 | 572 | ||
464 | 573 | ||
465 | 574 | func ValidateBetAndDefineWinAmt (amount,prediction,rollType) = if (if ((BETMIN > amount)) | |
466 | 575 | then true | |
467 | 576 | else (amount > BETMAX)) | |
468 | 577 | then throw(((("Bet amount is not in range: minBet=" + toString((BETMIN / WAVELET))) + " maxBet=") + toString((BETMAX / WAVELET)))) | |
469 | 578 | else if (if ((rollType != ROLLUNDER)) | |
470 | 579 | then (rollType != ROLLOVER) | |
471 | 580 | else false) | |
472 | 581 | then throw("Invalid Roll type, try with OVER or UNDER") | |
473 | 582 | else if (if ((PREDICTIONMIN > prediction)) | |
474 | 583 | then true | |
475 | 584 | else (prediction > PREDICTIONMAX)) | |
476 | 585 | then throw(((("Prediction is out of the range: " + toString(PREDICTIONMIN)) + " <= prediction <= ") + toString(PREDICTIONMAX))) | |
477 | 586 | else { | |
478 | 587 | let multi = Multiplier(prediction, rollType) | |
479 | 588 | ((((amount * multi) / 100000) * (100 - (FEEWAVESBET + FEEMCAFEE))) / 100) | |
480 | 589 | } | |
481 | 590 | ||
482 | 591 | ||
483 | 592 | @Callable(i) | |
484 | - | func playDice (rollType,prediction | |
593 | + | func playDice (rollType,prediction) = { | |
485 | 594 | let gameId = toBase58String(i.transactionId) | |
486 | 595 | let payment = extract(i.payment) | |
487 | 596 | let feeAssetId = isDefined(i.feeAssetId) | |
597 | + | let multi = Multiplier(prediction, rollType) | |
598 | + | let winAmt = ValidateBetAndDefineWinAmt(payment.amount, prediction, rollType) | |
488 | 599 | let playerBalance = wavesBalance(i.caller) | |
489 | 600 | let gameIdUsed = isDefined(getString(this, gameId)) | |
490 | 601 | if ((payment.assetId != WBET)) | |
491 | - | then throw("Payment should be in Wavesbet | |
492 | - | else if (( | |
493 | - | then throw("There are not enough waves, it takes 0. | |
602 | + | then throw("Payment should be in Wavesbet") | |
603 | + | else if ((1000000 > playerBalance)) | |
604 | + | then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.") | |
494 | 605 | else if (feeAssetId) | |
495 | 606 | then throw("Transaction's fee must be in Waves. Game aborted.") | |
496 | 607 | else if (gameIdUsed) | |
497 | 608 | then throw("Passed gameId had been used before. Game aborted.") | |
498 | 609 | else { | |
499 | - | let rand = GenerateRandInt(gameId, rsaSig) | |
500 | - | let randStr = RandToStr(rand) | |
501 | - | let result = diceWin(rollType, prediction, rand) | |
502 | - | let winAmt = if (result) | |
503 | - | then ValidateBetAndDefineWinAmt(payment.amount, prediction, rollType) | |
504 | - | else 0 | |
505 | 610 | let newGameNum = IncrementGameNum() | |
506 | - | let betData = WriteSet([DataEntry(gameId, if (result) | |
507 | - | then STATEWON | |
508 | - | else STATELOST), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry("random", rand), DataEntry("payment", payment.amount), DataEntry("payout", winAmt)]) | |
509 | - | if (result) | |
510 | - | then ScriptResult(betData, TransferSet([ScriptTransfer(i.caller, winAmt, WBET)])) | |
511 | - | else ScriptResult(betData, TransferSet(nil)) | |
611 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
612 | + | let gameDataStr = FormatGameDataStr(STATESUBMITTED, prediction, rollType, playerPubKey58, winAmt, "") | |
613 | + | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil)) | |
512 | 614 | } | |
513 | 615 | } | |
514 | 616 | ||
617 | + | ||
618 | + | ||
619 | + | @Callable(i) | |
620 | + | func withdraw (gameId,rsaSig) = { | |
621 | + | let gameDataList = ExtractGameDataList(gameId) | |
622 | + | let gameState = gameDataList[IdxGameState] | |
623 | + | let prediction = parseIntValue(gameDataList[IdxPrediction]) | |
624 | + | let rollType = gameDataList[IdxType] | |
625 | + | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
626 | + | let playerPubKey58 = gameDataList[IdxPlayerPubKey58] | |
627 | + | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
628 | + | let decreasedReserves = DecreaseReservedAmt(gameId, winAmt) | |
629 | + | if ((gameState != STATESUBMITTED)) | |
630 | + | then throw("Invalid game state for passed gameId. Game aborted.") | |
631 | + | else { | |
632 | + | let rand = GenerateRandInt(gameId, rsaSig) | |
633 | + | let randStr = RandToStr(rand) | |
634 | + | if (diceWin(rollType, prediction, rand)) | |
635 | + | then { | |
636 | + | let newGameDataStr = FormatGameDataStr(STATEWON, prediction, rollType, playerPubKey58, winAmt, randStr) | |
637 | + | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, decreasedReserves) | |
638 | + | } | |
639 | + | else { | |
640 | + | let newGameDataStr = FormatGameDataStr(STATELOST, prediction, rollType, playerPubKey58, winAmt, randStr) | |
641 | + | WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves]) | |
642 | + | } | |
643 | + | } | |
644 | + | } | |
645 | + | ||
646 | + | ||
647 | + | @Verifier(tx) | |
648 | + | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
649 | + | then match tx { | |
650 | + | case ttx: TransferTransaction => | |
651 | + | ((assetBalance(this, WBET) - ttx.amount) >= ExtractReservedAmt()) | |
652 | + | case stx: SetScriptTransaction => | |
653 | + | true | |
654 | + | case _ => | |
655 | + | false | |
656 | + | } | |
657 | + | else false | |
515 | 658 |
github/deemru/w8io/169f3d6 98.75 ms ◑