Luckyꜩ

Are you feeling lucky? No house edge, 50/50 chance of doubling up, or losing it all.

Place your bet!

Try installing TezBox for a better experience

Loading Wallet...



Recent Luck

Loading recent transactions

The smart contract powering Luckyꜩ has been written in fi, and compiled into valid Michelson code. Please view the source below. Luckyꜩ is also unique as it uses an external Oracle service that I developed (and will release open source in the near future).

const string ORACLE_ID "c9ef2608b7f4835c884aaf856d760894350ed5f8"; const tez ORACLE_FEE "1.00"; const tez MINBET "10.00"; object Bet( account sender, tez amount, bool processed, bool winner ); object OracleRequest( string oracleId, nat returnId ); storage map(nat => Bet) bets; storage nat nextBetId; @bet(){ if (AMOUNT < MINBET) throw; storage.nextBetId.add(nat 1); storage.bets.push(storage.nextBetId, new Bet(SOURCE, sub(AMOUNT, ORACLE_FEE), bool False, bool False)); pay(oracle "TZ1fAdo1y6Un4TSAN4Kt7HJg7EMV1kVqaNaL", ORACLE_FEE, new OracleRequest(ORACLE_ID, storage.nextBetId)); } //Oracle callback @result(nat betId, int result){ if (SOURCE != oracle "TZ1fAdo1y6Un4TSAN4Kt7HJg7EMV1kVqaNaL") throw; if (!storage.bets.in(input.betId)) throw; let Bet bet = storage.bets.get(input.betId); if (bet.processed) throw; bet.processed = bool True; if (input.result == int 1) { bet.winner = bool True; } storage.bets.push(input.betId, bet); if (bet.winner){ pay(bet.sender, mul(bet.amount, nat 2)); } else { clean(); } }
parameter (or unit (pair nat int));return unit;storage (pair (map nat (pair (contract unit unit) (pair tez (pair bool bool)))) nat);code{DUP;CDR;SWAP;UNIT;SWAP;CAR;IF_LEFT{UNIT;AMOUNT;DIP{PUSH tez "10.00"};CMPLT;IF{FAIL}{};DIIP{SWAP};DIP{SWAP};SWAP;DUP;DIP{SWAP;DIP{SWAP};DIIP{SWAP}};CDR;DIP{PUSH nat 1};ADD;DIP{DIIP{SWAP};DIP{SWAP};SWAP};DIP{DUP;CAR;SWAP;CDR;DROP};SWAP;PAIR;SWAP;DIP{SWAP};DIIP{SWAP};DIIP{SWAP};DIP{SWAP};SWAP;DUP;DIP{SWAP;DIP{SWAP};DIIP{SWAP}};CDR;DIP{PUSH bool False;DIP{PUSH bool False};SWAP;PAIR;DIP{AMOUNT;DIP{PUSH tez "1.00"};SUB};SWAP;PAIR;DIP{SOURCE unit unit};SWAP;PAIR;SOME};DIIP{DIIP{SWAP};DIP{SWAP};SWAP;DUP;DIP{SWAP;DIP{SWAP};DIIP{SWAP}};CAR};UPDATE;DIP{DIIP{SWAP};DIP{SWAP};SWAP};DIP{CDR};PAIR;SWAP;DIP{SWAP};DIIP{SWAP};DIIP{SWAP};DIP{SWAP};SWAP;DUP;DIP{SWAP;DIP{SWAP};DIIP{SWAP}};CDR;DIP{PUSH string "c9ef2608b7f4835c884aaf856d760894350ed5f8"};SWAP;PAIR;DIP{PUSH tez "1.00"};DIIP{PUSH (contract (pair string nat) unit) "TZ1fAdo1y6Un4TSAN4Kt7HJg7EMV1kVqaNaL"};DIIIP{DROP;DROP;DROP};TRANSFER_TOKENS;PAIR}{NONE (pair (contract unit unit) (pair tez (pair bool bool)));SOURCE (pair string nat) unit;MANAGER;DIP{PUSH key_hash "tz1a66pkzhUpc2kRnyYV8Q9tkUAnTj5ACoHz"};CMPNEQ;IF{FAIL}{};SWAP;DUP;DIP{SWAP};CAR;DIP{DIIP{SWAP};DIP{SWAP};SWAP;DUP;DIP{SWAP;DIP{SWAP};DIIP{SWAP}};CAR};MEM;DIP{PUSH bool False};CMPEQ;IF{FAIL}{};SWAP;DUP;DIP{SWAP};CAR;DIP{DIIP{SWAP};DIP{SWAP};SWAP;DUP;DIP{SWAP;DIP{SWAP};DIIP{SWAP}};CAR};GET;IF_NONE{FAIL}{};SOME;DIP{DROP};DUP;IF_NONE{FAIL}{};CDDAR;DIP{PUSH bool True};CMPEQ;IF{FAIL}{};PUSH bool True;DIP{DUP;IF_NONE{FAIL}{}};DIP{DUP;CAR;SWAP;CDR;DUP;CAR;SWAP;CDR;CDR};PAIR;SWAP;PAIR;SWAP;PAIR;SOME;DIP{DROP};SWAP;DUP;DIP{SWAP};CDR;DIP{PUSH int 1};CMPEQ;IF{PUSH bool True;DIP{DUP;IF_NONE{FAIL}{}};DIP{DUP;CAR;SWAP;CDR;DUP;CAR;SWAP;CDR;DUP;CAR;SWAP;CDR;DROP};SWAP;PAIR;SWAP;PAIR;SWAP;PAIR;SOME;DIP{DROP}}{};SWAP;DUP;DIP{SWAP};CAR;DIP{DUP;IF_NONE{FAIL}{};SOME};DIIP{DIIP{SWAP};DIP{SWAP};SWAP;DUP;DIP{SWAP;DIP{SWAP};DIIP{SWAP}};CAR};UPDATE;DIP{DIIP{SWAP};DIP{SWAP};SWAP};DIP{CDR};PAIR;SWAP;DIP{SWAP};DIIP{SWAP};DUP;IF_NONE{FAIL}{};CDDDR;DIP{PUSH bool True};CMPEQ;IF{UNIT;DIP{DUP;IF_NONE{FAIL}{};CDAR;DIP{PUSH nat 2};MUL};DIIP{DUP;IF_NONE{FAIL}{};CAR};DIIIP{DROP;DROP;DROP};TRANSFER_TOKENS}{DROP;DROP};PAIR}};

It is highly recommended that you use the TezBox chrome plugin wallet when using Luckyꜩ - otherwise you will need to have access to a tezos-client to make transactions from

Alternatively, the TezBox lightweight browser wallet will be available soon so follow us on twitter to keep up to date.

To play, simply choose your bet size and hit the "I'm feeling Lucky!" button. If you're using TezBox a payment prompt will appear (ensure your TezBox is unlocked), otherwise a command to run on your tezos-client will be displayed. Depending on the tezos network, the result can take approximately 5 minutes to be processed.

Other questions and answers
How does this dapp work?
It's pretty simple - you send a transaction to the smart contract that is atelast 10tez. The smart contract than stores your bet in storage, and queries our Oracle contract. Our off-chain oracle service picks up on the query, and responds directly to our smart contract with a result (win or lose), which triggers a pay out if required.
Do I really need to use TezBox?
No you don't - but you'll find the experience is a lot more streamlined if you do. We're developing a Firefox plugin for TezBox, as well as a lightweight browser wallet and mobile wallets too.
TezBox won't prompt me for payment, what do I do?
Check to ensure your TezBox wallet is unlocked (click the plugin icon). If this is not the issue, it could be an issue with the node we connect to, or alphanet in general.
My balance is updating before the transaction has been processed, why is that?
The balance displayed is currently showing the "unconfirmed" balance of your address. It updates it almost real-time, but prior to the transactions being confirmed.
Why does 1ꜩ seem to disappear when using this?
This is to cover the oracle fee, no other house-edge/fee is impossed
Can I really win tez with this?
Alphanet tez, yes - which is fake pretend tez.
Wow awesome, is there any way I can support you with this?
Any help and or support is appreciated, flick me a message via the Riot channel (@stephenandrews) or email. If you want to support me financially (any and all funding is welcome), please direct funds to my Bitcoin address: 1KSiyfgs5XwTZjaLpmCTHxonsyXMx383P1

Luckyꜩ is brought to you by myself, Stephen Andrews - check me out on github or pop into the Riot channel and say hello. My focus is to aid in the development of decentralized app related tools and resources to allow developers to easily start and deploy working apps for the Tezos block chain.

Luckyꜩ is the first working dapp released to the public on the Tezos alphanet, and utilises a powerful combination of tools that I've been working on, which will all be open source. These tools include

  • TezBox - full Tezos wallet, with a MetaMask like chrome plugin
  • eztz.js - powerful web3-inspired JS library which integrates with the chain
  • fi - currently in alpha, an interpreted language that compiles to valid Michelson
  • TezRPC - a load-balanced Tezos RPC proxy service and extended API
  • Luckyꜩ related code can be viewed from our github repo
  • Soon to be announced Oracle Service - bridging the on-chain/off-chain divide

Moving forward, I want to keep up the momentum I've picked up with the above projects to ensure I can deliver solid, secure and complete open source tools for developers to work with, modify and contribute toward.

I am currently unpaid and unfunded for the work I've complete thus far, and would really appreciate any finacial donations or support with documentation/code review/design work. Flick me a message via the Riot channel (@stephenandrews) or email. Donations can be made via Bitcoin to 1KSiyfgs5XwTZjaLpmCTHxonsyXMx383P1.

A special thank you to all who have donated in the past, and any donations going forward.