Created
March 5, 2026 11:50
-
-
Save ordishs/96efbccf2b9d270ad324e06ac00665dc to your computer and use it in GitHub Desktop.
BlackjackBet contract in Rúnar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BlackjackBet extends StatefulSmartContract { | |
| readonly playerPubKey: PubKey; | |
| readonly housePubKey: PubKey; | |
| readonly oraclePubKey: RabinPubKey; | |
| readonly betAmount: bigint; | |
| // ... | |
| public settleBlackjack(outcomeType: bigint, rabinSig: RabinSig, | |
| padding: ByteString, playerSig: Sig) { | |
| // Natural 21: player takes everything (2.5x bet) | |
| } | |
| public settleWin(outcomeType: bigint, rabinSig: RabinSig, | |
| padding: ByteString, playerSig: Sig) { | |
| // Regular win: player gets 2x, house gets remainder | |
| } | |
| public settleLoss(outcomeType: bigint, rabinSig: RabinSig, | |
| padding: ByteString, houseSig: Sig) { | |
| // Loss: house takes everything | |
| } | |
| public cancel(playerSig: Sig, houseSig: Sig) { | |
| // Push/tie: cooperative refund, each gets their stake back | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment